@peers-app/peers-ui 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/.github/workflows/publish.yml +8 -5
  2. package/babel.config.js +4 -4
  3. package/biome.json +191 -0
  4. package/dist/command-palette/command-palette-ui.d.ts +1 -2
  5. package/dist/command-palette/command-palette-ui.js +175 -244
  6. package/dist/command-palette/command-palette.js +65 -64
  7. package/dist/components/chat-overlay.d.ts +2 -2
  8. package/dist/components/chat-overlay.js +160 -217
  9. package/dist/components/checkbox.d.ts +5 -4
  10. package/dist/components/checkbox.js +4 -7
  11. package/dist/components/group-switcher.d.ts +1 -2
  12. package/dist/components/group-switcher.js +119 -159
  13. package/dist/components/input-date.d.ts +3 -3
  14. package/dist/components/input-date.js +6 -6
  15. package/dist/components/input-number.d.ts +7 -6
  16. package/dist/components/input-number.js +25 -20
  17. package/dist/components/input.d.ts +5 -4
  18. package/dist/components/input.js +4 -7
  19. package/dist/components/inverse-lazy-list.d.ts +3 -3
  20. package/dist/components/inverse-lazy-list.js +13 -47
  21. package/dist/components/io-schema-values.d.ts +5 -6
  22. package/dist/components/io-schema-values.js +28 -65
  23. package/dist/components/io-schema.d.ts +4 -5
  24. package/dist/components/io-schema.js +42 -79
  25. package/dist/components/lazy-list.d.ts +3 -3
  26. package/dist/components/lazy-list.js +38 -58
  27. package/dist/components/list-screen.d.ts +3 -8
  28. package/dist/components/list-screen.js +28 -23
  29. package/dist/components/loading-indicator.d.ts +1 -2
  30. package/dist/components/loading-indicator.js +2 -6
  31. package/dist/components/markdown-editor/autolink-plugin.js +5 -8
  32. package/dist/components/markdown-editor/editor-inline.d.ts +2 -3
  33. package/dist/components/markdown-editor/editor-inline.js +2 -6
  34. package/dist/components/markdown-editor/editor.d.ts +6 -6
  35. package/dist/components/markdown-editor/editor.js +9 -19
  36. package/dist/components/markdown-editor/markdown-plugin.d.ts +1 -1
  37. package/dist/components/markdown-editor/markdown-plugin.js +20 -21
  38. package/dist/components/markdown-editor/mention-node.d.ts +2 -2
  39. package/dist/components/markdown-editor/mention-node.js +24 -24
  40. package/dist/components/markdown-editor/mentions-plugin.d.ts +2 -2
  41. package/dist/components/markdown-editor/mentions-plugin.js +61 -62
  42. package/dist/components/markdown-editor/theme.js +28 -28
  43. package/dist/components/markdown-editor/toolbar.d.ts +2 -3
  44. package/dist/components/markdown-editor/toolbar.js +32 -49
  45. package/dist/components/markdown-with-mentions.d.ts +1 -1
  46. package/dist/components/markdown-with-mentions.js +43 -43
  47. package/dist/components/message-logs/message-logs.d.ts +1 -2
  48. package/dist/components/message-logs/message-logs.js +91 -116
  49. package/dist/components/messages/avatar.d.ts +3 -4
  50. package/dist/components/messages/avatar.js +37 -46
  51. package/dist/components/messages/channel-message-list.d.ts +5 -6
  52. package/dist/components/messages/channel-message-list.js +34 -34
  53. package/dist/components/messages/channel-view.d.ts +1 -2
  54. package/dist/components/messages/channel-view.js +23 -57
  55. package/dist/components/messages/message-compose.d.ts +3 -4
  56. package/dist/components/messages/message-compose.js +27 -38
  57. package/dist/components/messages/message-display.d.ts +2 -3
  58. package/dist/components/messages/message-display.js +42 -95
  59. package/dist/components/messages/thread-message-list.d.ts +4 -5
  60. package/dist/components/messages/thread-message-list.js +29 -29
  61. package/dist/components/router.d.ts +1 -2
  62. package/dist/components/router.js +58 -66
  63. package/dist/components/save-button.d.ts +3 -3
  64. package/dist/components/save-button.js +23 -33
  65. package/dist/components/sortable-list.d.ts +11 -12
  66. package/dist/components/sortable-list.js +42 -22
  67. package/dist/components/tabs.d.ts +3 -3
  68. package/dist/components/tabs.js +16 -47
  69. package/dist/components/tooltip.d.ts +4 -4
  70. package/dist/components/tooltip.js +4 -9
  71. package/dist/components/trust-level-badge.d.ts +2 -3
  72. package/dist/components/trust-level-badge.js +16 -16
  73. package/dist/components/trust-level-dropdown.d.ts +3 -4
  74. package/dist/components/trust-level-dropdown.js +32 -55
  75. package/dist/components/typeahead.d.ts +3 -3
  76. package/dist/components/typeahead.js +48 -89
  77. package/dist/components/voice-indicator.d.ts +2 -2
  78. package/dist/components/voice-indicator.js +93 -106
  79. package/dist/components/voice-subscribe-events.d.ts +32 -0
  80. package/dist/components/voice-subscribe-events.js +2 -0
  81. package/dist/globals.d.ts +3 -5
  82. package/dist/globals.js +22 -33
  83. package/dist/hooks.d.ts +5 -5
  84. package/dist/hooks.js +22 -12
  85. package/dist/hooks.test.js +129 -145
  86. package/dist/index.d.ts +9 -8
  87. package/dist/index.js +13 -12
  88. package/dist/mention-configs.d.ts +2 -2
  89. package/dist/mention-configs.js +55 -42
  90. package/dist/screens/assistants/assistant-config.d.ts +2 -3
  91. package/dist/screens/assistants/assistant-config.js +9 -22
  92. package/dist/screens/assistants/assistant-details.d.ts +1 -2
  93. package/dist/screens/assistants/assistant-details.js +13 -28
  94. package/dist/screens/assistants/assistant-info.d.ts +2 -3
  95. package/dist/screens/assistants/assistant-info.js +3 -17
  96. package/dist/screens/assistants/assistant-list.d.ts +1 -2
  97. package/dist/screens/assistants/assistant-list.js +15 -56
  98. package/dist/screens/assistants/assistant-tools.d.ts +2 -3
  99. package/dist/screens/assistants/assistant-tools.js +10 -24
  100. package/dist/screens/console-logs/console-logs-list.d.ts +1 -2
  101. package/dist/screens/console-logs/console-logs-list.js +130 -134
  102. package/dist/screens/console-logs/log-display.d.ts +2 -3
  103. package/dist/screens/console-logs/log-display.js +40 -42
  104. package/dist/screens/console-logs/log-filters.d.ts +1 -2
  105. package/dist/screens/console-logs/log-filters.js +2 -24
  106. package/dist/screens/console-logs/mobile-log-card.d.ts +2 -3
  107. package/dist/screens/console-logs/mobile-log-card.js +64 -67
  108. package/dist/screens/console-logs/resizable-table-header.d.ts +1 -2
  109. package/dist/screens/console-logs/resizable-table-header.js +31 -67
  110. package/dist/screens/contacts/contact-details.d.ts +1 -2
  111. package/dist/screens/contacts/contact-details.js +16 -46
  112. package/dist/screens/contacts/contact-list.d.ts +1 -2
  113. package/dist/screens/contacts/contact-list.js +44 -103
  114. package/dist/screens/contacts/index.d.ts +4 -4
  115. package/dist/screens/contacts/index.js +1 -1
  116. package/dist/screens/contacts/user-connect.d.ts +1 -2
  117. package/dist/screens/contacts/user-connect.js +85 -186
  118. package/dist/screens/data-explorer/data-explorer.d.ts +1 -2
  119. package/dist/screens/data-explorer/data-explorer.js +61 -181
  120. package/dist/screens/data-explorer/index.d.ts +2 -2
  121. package/dist/screens/data-explorer/query-executor.d.ts +1 -2
  122. package/dist/screens/data-explorer/query-executor.js +56 -166
  123. package/dist/screens/groups/group-details.d.ts +1 -2
  124. package/dist/screens/groups/group-details.js +27 -122
  125. package/dist/screens/groups/group-invite-listener.d.ts +2 -3
  126. package/dist/screens/groups/group-invite-listener.js +8 -104
  127. package/dist/screens/groups/group-list.d.ts +1 -2
  128. package/dist/screens/groups/group-list.js +56 -133
  129. package/dist/screens/groups/group-members.d.ts +2 -3
  130. package/dist/screens/groups/group-members.js +62 -132
  131. package/dist/screens/groups/index.d.ts +4 -4
  132. package/dist/screens/groups/index.js +1 -1
  133. package/dist/screens/join-group/index.d.ts +2 -2
  134. package/dist/screens/join-group/join-group.d.ts +1 -2
  135. package/dist/screens/join-group/join-group.js +9 -109
  136. package/dist/screens/network-viewer/connection-troubleshooter.d.ts +2 -3
  137. package/dist/screens/network-viewer/connection-troubleshooter.js +89 -193
  138. package/dist/screens/network-viewer/cpu-usage-graph.d.ts +1 -2
  139. package/dist/screens/network-viewer/cpu-usage-graph.js +60 -99
  140. package/dist/screens/network-viewer/device-details-modal.d.ts +1 -2
  141. package/dist/screens/network-viewer/device-details-modal.js +25 -177
  142. package/dist/screens/network-viewer/group-details-modal.d.ts +1 -2
  143. package/dist/screens/network-viewer/group-details-modal.js +31 -142
  144. package/dist/screens/network-viewer/index.d.ts +4 -4
  145. package/dist/screens/network-viewer/index.js +3 -3
  146. package/dist/screens/network-viewer/network-viewer-ipc.d.ts +22 -0
  147. package/dist/screens/network-viewer/network-viewer-ipc.js +6 -0
  148. package/dist/screens/network-viewer/network-viewer.d.ts +1 -2
  149. package/dist/screens/network-viewer/network-viewer.js +91 -296
  150. package/dist/screens/network-viewer/usage-graph.d.ts +1 -2
  151. package/dist/screens/network-viewer/usage-graph.js +78 -110
  152. package/dist/screens/packages/package-details.d.ts +1 -2
  153. package/dist/screens/packages/package-details.js +35 -41
  154. package/dist/screens/packages/package-info.d.ts +2 -2
  155. package/dist/screens/packages/package-info.js +33 -86
  156. package/dist/screens/packages/package-list.d.ts +1 -2
  157. package/dist/screens/packages/package-list.js +42 -106
  158. package/dist/screens/packages/package-new-local.d.ts +1 -2
  159. package/dist/screens/packages/package-new-local.js +13 -19
  160. package/dist/screens/packages/package-versions.d.ts +2 -3
  161. package/dist/screens/packages/package-versions.js +29 -96
  162. package/dist/screens/peer-types/peer-type-details.d.ts +3 -4
  163. package/dist/screens/peer-types/peer-type-details.js +26 -78
  164. package/dist/screens/peer-types/peer-type-list.d.ts +1 -2
  165. package/dist/screens/peer-types/peer-type-list.js +13 -24
  166. package/dist/screens/search/global-search.d.ts +1 -2
  167. package/dist/screens/search/global-search.js +104 -182
  168. package/dist/screens/settings/color-mode-dropdown.d.ts +3 -4
  169. package/dist/screens/settings/color-mode-dropdown.js +18 -37
  170. package/dist/screens/settings/settings-page.d.ts +1 -1
  171. package/dist/screens/settings/settings-page.js +86 -213
  172. package/dist/screens/settings/voice-settings-agent.d.ts +1 -1
  173. package/dist/screens/settings/voice-settings-agent.js +7 -44
  174. package/dist/screens/settings/voice-settings-api-keys.d.ts +2 -2
  175. package/dist/screens/settings/voice-settings-api-keys.js +2 -29
  176. package/dist/screens/settings/voice-settings-output.d.ts +2 -2
  177. package/dist/screens/settings/voice-settings-output.js +2 -40
  178. package/dist/screens/settings/voice-settings-providers.d.ts +2 -2
  179. package/dist/screens/settings/voice-settings-providers.js +2 -19
  180. package/dist/screens/settings/voice-settings-types.d.ts +4 -4
  181. package/dist/screens/settings/voice-settings-types.js +31 -31
  182. package/dist/screens/settings/voice-settings-wake-word.d.ts +2 -2
  183. package/dist/screens/settings/voice-settings-wake-word.js +2 -33
  184. package/dist/screens/settings/voice-settings.d.ts +1 -1
  185. package/dist/screens/settings/voice-settings.js +35 -112
  186. package/dist/screens/setup-user.d.ts +1 -2
  187. package/dist/screens/setup-user.js +38 -116
  188. package/dist/screens/tools/tool-code.d.ts +2 -3
  189. package/dist/screens/tools/tool-code.js +9 -13
  190. package/dist/screens/tools/tool-details.d.ts +1 -2
  191. package/dist/screens/tools/tool-details.js +26 -39
  192. package/dist/screens/tools/tool-info.d.ts +2 -3
  193. package/dist/screens/tools/tool-info.js +9 -48
  194. package/dist/screens/tools/tool-list.d.ts +1 -2
  195. package/dist/screens/tools/tool-list.js +33 -65
  196. package/dist/screens/tools/tool-schema.d.ts +2 -3
  197. package/dist/screens/tools/tool-schema.js +2 -13
  198. package/dist/screens/tools/tool-test-details.d.ts +1 -2
  199. package/dist/screens/tools/tool-test-details.js +12 -28
  200. package/dist/screens/tools/tool-test-list.d.ts +1 -2
  201. package/dist/screens/tools/tool-test-list.js +17 -56
  202. package/dist/screens/variables/variable-details.d.ts +1 -2
  203. package/dist/screens/variables/variable-details.js +19 -86
  204. package/dist/screens/variables/variable-list.d.ts +1 -2
  205. package/dist/screens/variables/variable-list.js +16 -27
  206. package/dist/screens/welcome-modal.d.ts +1 -2
  207. package/dist/screens/welcome-modal.js +44 -111
  208. package/dist/screens/workflows/workflow-details.d.ts +1 -2
  209. package/dist/screens/workflows/workflow-details.js +17 -31
  210. package/dist/screens/workflows/workflow-info.d.ts +2 -3
  211. package/dist/screens/workflows/workflow-info.js +2 -9
  212. package/dist/screens/workflows/workflow-instructions.d.ts +2 -3
  213. package/dist/screens/workflows/workflow-instructions.js +23 -55
  214. package/dist/screens/workflows/workflow-list.d.ts +1 -2
  215. package/dist/screens/workflows/workflow-list.js +23 -62
  216. package/dist/setupTests.d.ts +1 -1
  217. package/dist/setupTests.js +10 -11
  218. package/dist/system-apps/assistants.app.d.ts +1 -1
  219. package/dist/system-apps/assistants.app.js +3 -3
  220. package/dist/system-apps/console-logs.app.d.ts +1 -1
  221. package/dist/system-apps/console-logs.app.js +3 -3
  222. package/dist/system-apps/contacts.app.d.ts +1 -1
  223. package/dist/system-apps/contacts.app.js +4 -4
  224. package/dist/system-apps/data-explorer.app.d.ts +1 -1
  225. package/dist/system-apps/data-explorer.app.js +4 -4
  226. package/dist/system-apps/groups.app.d.ts +1 -1
  227. package/dist/system-apps/groups.app.js +4 -4
  228. package/dist/system-apps/index.d.ts +17 -17
  229. package/dist/system-apps/index.js +52 -52
  230. package/dist/system-apps/join-group.app.d.ts +1 -1
  231. package/dist/system-apps/join-group.app.js +4 -4
  232. package/dist/system-apps/mobile-settings.app.d.ts +1 -1
  233. package/dist/system-apps/mobile-settings.app.js +3 -3
  234. package/dist/system-apps/network-viewer.app.d.ts +1 -1
  235. package/dist/system-apps/network-viewer.app.js +4 -4
  236. package/dist/system-apps/packages.app.d.ts +1 -1
  237. package/dist/system-apps/packages.app.js +3 -3
  238. package/dist/system-apps/search.app.d.ts +1 -1
  239. package/dist/system-apps/search.app.js +4 -4
  240. package/dist/system-apps/settings.app.d.ts +1 -1
  241. package/dist/system-apps/settings.app.js +3 -3
  242. package/dist/system-apps/threads.app.d.ts +1 -1
  243. package/dist/system-apps/threads.app.js +3 -3
  244. package/dist/system-apps/tools.app.d.ts +1 -1
  245. package/dist/system-apps/tools.app.js +3 -3
  246. package/dist/system-apps/types.app.d.ts +1 -1
  247. package/dist/system-apps/types.app.js +3 -3
  248. package/dist/system-apps/variables.app.d.ts +1 -1
  249. package/dist/system-apps/variables.app.js +3 -3
  250. package/dist/system-apps/workflows.app.d.ts +1 -1
  251. package/dist/system-apps/workflows.app.js +3 -3
  252. package/dist/tabs-layout/tabs-layout.d.ts +2 -3
  253. package/dist/tabs-layout/tabs-layout.js +215 -246
  254. package/dist/tabs-layout/tabs-state.d.ts +2 -2
  255. package/dist/tabs-layout/tabs-state.js +73 -61
  256. package/dist/ui-defaults/index.d.ts +2 -2
  257. package/dist/ui-defaults/list-screen.d.ts +2 -3
  258. package/dist/ui-defaults/list-screen.js +33 -37
  259. package/dist/ui-defaults/markdown-field.js +24 -56
  260. package/dist/ui-router/routes-loader.d.ts +1 -1
  261. package/dist/ui-router/routes-loader.js +17 -13
  262. package/dist/ui-router/ui-loader.d.ts +6 -6
  263. package/dist/ui-router/ui-loader.js +172 -268
  264. package/dist/utils.js +49 -39
  265. package/jest.config.js +16 -16
  266. package/package.json +16 -14
  267. package/src/command-palette/command-palette-ui.tsx +261 -237
  268. package/src/command-palette/command-palette.ts +81 -78
  269. package/src/components/chat-overlay.tsx +366 -261
  270. package/src/components/checkbox.tsx +15 -12
  271. package/src/components/group-switcher.tsx +150 -105
  272. package/src/components/input-date.tsx +17 -16
  273. package/src/components/input-number.tsx +47 -31
  274. package/src/components/input.tsx +15 -12
  275. package/src/components/inverse-lazy-list.tsx +14 -13
  276. package/src/components/io-schema-values.tsx +51 -69
  277. package/src/components/io-schema.tsx +94 -69
  278. package/src/components/lazy-list.tsx +51 -34
  279. package/src/components/list-screen.tsx +51 -35
  280. package/src/components/loading-indicator.tsx +2 -4
  281. package/src/components/markdown-editor/autolink-plugin.tsx +4 -11
  282. package/src/components/markdown-editor/editor-inline.tsx +3 -4
  283. package/src/components/markdown-editor/editor.tsx +53 -51
  284. package/src/components/markdown-editor/markdown-plugin.tsx +48 -40
  285. package/src/components/markdown-editor/mention-node.ts +39 -38
  286. package/src/components/markdown-editor/mentions-plugin.tsx +99 -101
  287. package/src/components/markdown-editor/theme.ts +28 -29
  288. package/src/components/markdown-editor/toolbar.tsx +53 -47
  289. package/src/components/markdown-with-mentions.tsx +56 -46
  290. package/src/components/message-logs/message-logs.tsx +225 -165
  291. package/src/components/messages/avatar.tsx +70 -52
  292. package/src/components/messages/channel-message-list.tsx +80 -68
  293. package/src/components/messages/channel-view.tsx +34 -33
  294. package/src/components/messages/message-compose.tsx +84 -67
  295. package/src/components/messages/message-display.tsx +103 -89
  296. package/src/components/messages/thread-message-list.tsx +53 -44
  297. package/src/components/router.tsx +42 -43
  298. package/src/components/save-button.tsx +43 -39
  299. package/src/components/sortable-list.tsx +77 -49
  300. package/src/components/tabs.tsx +31 -31
  301. package/src/components/tooltip.tsx +21 -28
  302. package/src/components/trust-level-badge.tsx +15 -11
  303. package/src/components/trust-level-dropdown.tsx +49 -19
  304. package/src/components/typeahead.tsx +57 -59
  305. package/src/components/voice-indicator.tsx +158 -141
  306. package/src/components/voice-subscribe-events.ts +20 -0
  307. package/src/globals.tsx +42 -40
  308. package/src/hooks.test.tsx +141 -134
  309. package/src/hooks.ts +80 -48
  310. package/src/index.tsx +17 -10
  311. package/src/mention-configs.ts +122 -68
  312. package/src/screens/assistants/assistant-config.tsx +28 -18
  313. package/src/screens/assistants/assistant-details.tsx +35 -36
  314. package/src/screens/assistants/assistant-info.tsx +16 -11
  315. package/src/screens/assistants/assistant-list.tsx +37 -34
  316. package/src/screens/assistants/assistant-tools.tsx +41 -20
  317. package/src/screens/console-logs/console-logs-list.tsx +173 -140
  318. package/src/screens/console-logs/log-display.tsx +65 -38
  319. package/src/screens/console-logs/log-filters.tsx +4 -3
  320. package/src/screens/console-logs/mobile-log-card.tsx +78 -71
  321. package/src/screens/console-logs/resizable-table-header.tsx +29 -21
  322. package/src/screens/contacts/contact-details.tsx +29 -30
  323. package/src/screens/contacts/contact-list.tsx +71 -60
  324. package/src/screens/contacts/index.ts +5 -5
  325. package/src/screens/contacts/user-connect.tsx +177 -171
  326. package/src/screens/data-explorer/data-explorer.tsx +134 -98
  327. package/src/screens/data-explorer/index.ts +2 -3
  328. package/src/screens/data-explorer/query-executor.tsx +90 -80
  329. package/src/screens/groups/group-details.tsx +120 -101
  330. package/src/screens/groups/group-invite-listener.tsx +34 -37
  331. package/src/screens/groups/group-list.tsx +119 -103
  332. package/src/screens/groups/group-members.tsx +225 -164
  333. package/src/screens/groups/index.ts +5 -6
  334. package/src/screens/join-group/index.ts +2 -2
  335. package/src/screens/join-group/join-group.tsx +41 -39
  336. package/src/screens/network-viewer/connection-troubleshooter.tsx +145 -104
  337. package/src/screens/network-viewer/cpu-usage-graph.tsx +39 -43
  338. package/src/screens/network-viewer/device-details-modal.tsx +46 -59
  339. package/src/screens/network-viewer/group-details-modal.tsx +68 -49
  340. package/src/screens/network-viewer/index.ts +4 -5
  341. package/src/screens/network-viewer/network-viewer-ipc.ts +23 -0
  342. package/src/screens/network-viewer/network-viewer.tsx +261 -236
  343. package/src/screens/network-viewer/usage-graph.tsx +57 -49
  344. package/src/screens/packages/package-details.tsx +43 -35
  345. package/src/screens/packages/package-info.tsx +107 -66
  346. package/src/screens/packages/package-list.tsx +175 -98
  347. package/src/screens/packages/package-new-local.tsx +28 -26
  348. package/src/screens/packages/package-versions.tsx +102 -77
  349. package/src/screens/peer-types/peer-type-details.tsx +60 -50
  350. package/src/screens/peer-types/peer-type-list.tsx +20 -30
  351. package/src/screens/search/global-search.tsx +153 -137
  352. package/src/screens/settings/color-mode-dropdown.tsx +52 -35
  353. package/src/screens/settings/settings-page.tsx +215 -141
  354. package/src/screens/settings/voice-settings-agent.tsx +13 -12
  355. package/src/screens/settings/voice-settings-api-keys.tsx +14 -12
  356. package/src/screens/settings/voice-settings-output.tsx +12 -11
  357. package/src/screens/settings/voice-settings-providers.tsx +7 -3
  358. package/src/screens/settings/voice-settings-types.ts +52 -49
  359. package/src/screens/settings/voice-settings-wake-word.tsx +25 -9
  360. package/src/screens/settings/voice-settings.tsx +66 -43
  361. package/src/screens/setup-user.tsx +88 -41
  362. package/src/screens/tools/tool-code.tsx +12 -17
  363. package/src/screens/tools/tool-details.tsx +28 -28
  364. package/src/screens/tools/tool-info.tsx +14 -19
  365. package/src/screens/tools/tool-list.tsx +58 -40
  366. package/src/screens/tools/tool-schema.tsx +16 -9
  367. package/src/screens/tools/tool-test-details.tsx +11 -22
  368. package/src/screens/tools/tool-test-list.tsx +29 -30
  369. package/src/screens/variables/variable-details.tsx +63 -51
  370. package/src/screens/variables/variable-list.tsx +29 -30
  371. package/src/screens/welcome-modal.tsx +68 -48
  372. package/src/screens/workflows/workflow-details.tsx +40 -30
  373. package/src/screens/workflows/workflow-info.tsx +4 -11
  374. package/src/screens/workflows/workflow-instructions.tsx +35 -28
  375. package/src/screens/workflows/workflow-list.tsx +50 -40
  376. package/src/setupTests.ts +14 -13
  377. package/src/system-apps/assistants.app.ts +5 -5
  378. package/src/system-apps/console-logs.app.ts +4 -4
  379. package/src/system-apps/contacts.app.ts +6 -6
  380. package/src/system-apps/data-explorer.app.ts +5 -5
  381. package/src/system-apps/groups.app.ts +6 -6
  382. package/src/system-apps/index.ts +49 -49
  383. package/src/system-apps/join-group.app.ts +5 -5
  384. package/src/system-apps/mobile-settings.app.ts +4 -5
  385. package/src/system-apps/network-viewer.app.ts +5 -5
  386. package/src/system-apps/packages.app.ts +5 -5
  387. package/src/system-apps/search.app.ts +6 -6
  388. package/src/system-apps/settings.app.ts +5 -5
  389. package/src/system-apps/threads.app.ts +5 -5
  390. package/src/system-apps/tools.app.ts +5 -5
  391. package/src/system-apps/types.app.ts +5 -5
  392. package/src/system-apps/variables.app.ts +5 -5
  393. package/src/system-apps/workflows.app.ts +5 -5
  394. package/src/tabs-layout/tabs-layout.tsx +345 -254
  395. package/src/tabs-layout/tabs-state.ts +100 -81
  396. package/src/ui-defaults/index.ts +2 -3
  397. package/src/ui-defaults/list-screen.tsx +45 -40
  398. package/src/ui-defaults/markdown-field.tsx +22 -26
  399. package/src/ui-router/routes-loader.ts +40 -24
  400. package/src/ui-router/ui-loader.tsx +312 -214
  401. package/src/utils.ts +68 -81
  402. package/tsconfig.json +5 -10
  403. package/dist/components/input-datetime.d.ts +0 -7
  404. package/dist/components/input-datetime.js +0 -35
  405. package/dist/components/lazy-sortable-list.d.ts +0 -29
  406. package/dist/components/lazy-sortable-list.js +0 -12
  407. package/dist/components/left-bar.d.ts +0 -5
  408. package/dist/components/left-bar.js +0 -207
  409. package/dist/components/main-content-container.d.ts +0 -2
  410. package/dist/components/main-content-container.js +0 -92
  411. package/dist/components/messages/thread-view.d.ts +0 -6
  412. package/dist/components/messages/thread-view.js +0 -174
  413. package/dist/components/off-canvas.d.ts +0 -13
  414. package/dist/components/off-canvas.js +0 -89
  415. package/dist/components/text-list-editor.tsx/text-list-editor.d.ts +0 -6
  416. package/dist/components/text-list-editor.tsx/text-list-editor.js +0 -13
  417. package/dist/components/top-bar.d.ts +0 -2
  418. package/dist/components/top-bar.js +0 -51
  419. package/dist/components/typeahead/mentions-plugin.d.ts +0 -7
  420. package/dist/components/typeahead/mentions-plugin.js +0 -203
  421. package/dist/components/typeahead/typeahead-editor.d.ts +0 -15
  422. package/dist/components/typeahead/typeahead-editor.js +0 -134
  423. package/dist/components/typeahead/typeahead.d.ts +0 -12
  424. package/dist/components/typeahead/typeahead.js +0 -94
  425. package/dist/screens/profile.d.ts +0 -2
  426. package/dist/screens/profile.js +0 -76
  427. package/src/components/input-datetime.tsx +0 -41
  428. package/src/components/lazy-sortable-list.tsx +0 -51
  429. package/src/components/left-bar.tsx +0 -322
  430. package/src/components/main-content-container.tsx +0 -79
  431. package/src/components/messages/thread-view.tsx +0 -214
  432. package/src/components/off-canvas.tsx +0 -83
  433. package/src/components/text-list-editor.tsx/text-list-editor.tsx +0 -13
  434. package/src/components/top-bar.tsx +0 -119
  435. package/src/components/typeahead/mentions-plugin.tsx +0 -265
  436. package/src/components/typeahead/typeahead-editor.tsx +0 -140
  437. package/src/components/typeahead/typeahead.tsx +0 -77
  438. package/src/screens/profile.tsx +0 -75
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState, useRef } from 'react';
1
+ import { useEffect, useRef, useState } from "react";
2
2
 
3
3
  interface IDataPoint {
4
4
  timestamp: number;
@@ -71,12 +71,12 @@ export function UsageGraph({
71
71
  durationMinutes = 5,
72
72
  updateInterval = 5000,
73
73
  minHeight = 80,
74
- color = 'rgba(13, 110, 253, 1)',
75
- overlayTextColor = 'rgba(255, 255, 255, 0.7)',
74
+ color = "rgba(13, 110, 253, 1)",
75
+ overlayTextColor = "rgba(255, 255, 255, 0.7)",
76
76
  minValue = 0,
77
77
  maxValue = 100,
78
78
  formatOverlayText,
79
- colorZones
79
+ colorZones,
80
80
  }: IUsageGraphProps) {
81
81
  const [dataPoints, setDataPoints] = useState<IDataPoint[]>([]);
82
82
  const [currentValue, setCurrentValue] = useState<number>(0);
@@ -120,12 +120,12 @@ export function UsageGraph({
120
120
  setDataPoints((prev) => {
121
121
  const newPoint: IDataPoint = {
122
122
  timestamp: Date.now(),
123
- value: value
123
+ value: value,
124
124
  };
125
125
 
126
126
  const updated = [...prev, newPoint];
127
127
  const oldestAllowedTime = Date.now() - durationMinutes * 60 * 1000;
128
- const filtered = updated.filter(point => point.timestamp >= oldestAllowedTime);
128
+ const filtered = updated.filter((point) => point.timestamp >= oldestAllowedTime);
129
129
  return filtered;
130
130
  });
131
131
  } catch (error) {
@@ -144,7 +144,7 @@ export function UsageGraph({
144
144
  clearInterval(intervalRef.current);
145
145
  }
146
146
  };
147
- }, [fetchUsage, updateInterval, label]);
147
+ }, [fetchUsage, updateInterval, label, durationMinutes]);
148
148
 
149
149
  // Get color for a value based on color zones
150
150
  const getColorForValue = (value: number): string => {
@@ -193,12 +193,14 @@ export function UsageGraph({
193
193
 
194
194
  // If no color zones, return single segment
195
195
  if (!colorZones || colorZones.length === 0) {
196
- const pathData = points.map((point, idx) => {
197
- if (idx === 0) {
198
- return `M ${point.x} ${point.y}`;
199
- }
200
- return `L ${point.x} ${point.y}`;
201
- }).join(' ');
196
+ const pathData = points
197
+ .map((point, idx) => {
198
+ if (idx === 0) {
199
+ return `M ${point.x} ${point.y}`;
200
+ }
201
+ return `L ${point.x} ${point.y}`;
202
+ })
203
+ .join(" ");
202
204
  return [{ path: pathData, color }];
203
205
  }
204
206
 
@@ -231,7 +233,7 @@ export function UsageGraph({
231
233
 
232
234
  // Calculate SVG path (for gradient fill)
233
235
  const getLinePath = (): string => {
234
- if (dataPoints.length < 2) return '';
236
+ if (dataPoints.length < 2) return "";
235
237
 
236
238
  const paddingLeft = 25;
237
239
  const paddingRight = 10;
@@ -258,12 +260,14 @@ export function UsageGraph({
258
260
  });
259
261
 
260
262
  // Create SVG path
261
- const pathData = points.map((point, idx) => {
262
- if (idx === 0) {
263
- return `M ${point.x} ${point.y}`;
264
- }
265
- return `L ${point.x} ${point.y}`;
266
- }).join(' ');
263
+ const pathData = points
264
+ .map((point, idx) => {
265
+ if (idx === 0) {
266
+ return `M ${point.x} ${point.y}`;
267
+ }
268
+ return `L ${point.x} ${point.y}`;
269
+ })
270
+ .join(" ");
267
271
 
268
272
  return pathData;
269
273
  };
@@ -271,7 +275,7 @@ export function UsageGraph({
271
275
  // Get gradient path for fill
272
276
  const getGradientPath = (): string => {
273
277
  const linePath = getLinePath();
274
- if (!linePath) return '';
278
+ if (!linePath) return "";
275
279
 
276
280
  const paddingLeft = 25;
277
281
  const paddingRight = 10;
@@ -281,7 +285,7 @@ export function UsageGraph({
281
285
  return `${linePath} L ${width - paddingRight} ${height - paddingBottom} L ${paddingLeft} ${height - paddingBottom} Z`;
282
286
  };
283
287
 
284
- const linePath = getLinePath();
288
+ const _linePath = getLinePath();
285
289
  const gradientPath = getGradientPath();
286
290
  const lineSegments = getLineSegments();
287
291
 
@@ -289,25 +293,32 @@ export function UsageGraph({
289
293
  const rgbaMatch = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/);
290
294
  const gradientColor = rgbaMatch
291
295
  ? `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0.3)`
292
- : 'rgba(13, 110, 253, 0.3)';
296
+ : "rgba(13, 110, 253, 0.3)";
293
297
  const gradientColorLight = rgbaMatch
294
298
  ? `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0.05)`
295
- : 'rgba(13, 110, 253, 0.05)';
299
+ : "rgba(13, 110, 253, 0.05)";
296
300
 
297
301
  return (
298
302
  <div
299
303
  ref={containerRef}
300
304
  className="usage-graph"
301
- style={{ margin: 0, padding: 0, position: 'relative', width: '100%', height: '100%', minHeight: `${minHeight}px` }}
305
+ style={{
306
+ margin: 0,
307
+ padding: 0,
308
+ position: "relative",
309
+ width: "100%",
310
+ height: "100%",
311
+ minHeight: `${minHeight}px`,
312
+ }}
302
313
  >
303
314
  <svg
304
315
  width={width}
305
316
  height={height}
306
317
  style={{
307
- border: '1px solid rgba(128, 128, 128, 0.2)',
308
- borderRadius: '4px',
309
- backgroundColor: 'rgba(0, 0, 0, 0.02)',
310
- display: 'block'
318
+ border: "1px solid rgba(128, 128, 128, 0.2)",
319
+ borderRadius: "4px",
320
+ backgroundColor: "rgba(0, 0, 0, 0.02)",
321
+ display: "block",
311
322
  }}
312
323
  >
313
324
  <defs>
@@ -350,12 +361,7 @@ export function UsageGraph({
350
361
  })}
351
362
 
352
363
  {/* Fill area under the line */}
353
- {gradientPath && (
354
- <path
355
- d={gradientPath}
356
- fill={`url(#${label}Gradient)`}
357
- />
358
- )}
364
+ {gradientPath && <path d={gradientPath} fill={`url(#${label}Gradient)`} />}
359
365
 
360
366
  {/* Line segments with color zones */}
361
367
  {lineSegments.map((segment, idx) => (
@@ -424,23 +430,25 @@ export function UsageGraph({
424
430
  {/* Centered overlay text */}
425
431
  <div
426
432
  style={{
427
- position: 'absolute',
428
- top: '50%',
429
- left: '50%',
430
- transform: 'translate(-50%, -50%)',
431
- fontSize: '2rem',
432
- fontWeight: 'bold',
433
+ position: "absolute",
434
+ top: "50%",
435
+ left: "50%",
436
+ transform: "translate(-50%, -50%)",
437
+ fontSize: "2rem",
438
+ fontWeight: "bold",
433
439
  color: overlayTextColor,
434
- pointerEvents: 'none',
435
- userSelect: 'none',
436
- textAlign: 'center',
437
- lineHeight: '1.2',
438
- whiteSpace: 'nowrap',
439
- maxWidth: '95%',
440
- overflowWrap: 'break-word'
440
+ pointerEvents: "none",
441
+ userSelect: "none",
442
+ textAlign: "center",
443
+ lineHeight: "1.2",
444
+ whiteSpace: "nowrap",
445
+ maxWidth: "95%",
446
+ overflowWrap: "break-word",
441
447
  }}
442
448
  >
443
- {formatOverlayText ? formatOverlayText(currentValue, label) : `${label} ${Math.round(currentValue)}%`}
449
+ {formatOverlayText
450
+ ? formatOverlayText(currentValue, label)
451
+ : `${label} ${Math.round(currentValue)}%`}
444
452
  </div>
445
453
  </div>
446
454
  );
@@ -1,67 +1,71 @@
1
1
  import { Packages, rpcServerCalls } from "@peers-app/peers-sdk";
2
2
  import React from "react";
3
+ import { Input } from "../../components/input";
3
4
  import { LoadingIndicator } from "../../components/loading-indicator";
4
- import { ISaveButtonProps, SaveButton } from "../../components/save-button";
5
+ import { type ISaveButtonProps, SaveButton } from "../../components/save-button";
5
6
  import { ScreenTabBody, Tabs } from "../../components/tabs";
6
- import { PackageInfo } from "./package-info";
7
- import { PackageVersionsList } from "./package-versions";
8
7
  import { useObservableState, usePromise } from "../../hooks";
9
- import { Input } from "../../components/input";
10
8
  import { updateActiveTabTitle } from "../../tabs-layout/tabs-state";
11
-
9
+ import { PackageInfo } from "./package-info";
10
+ import { PackageVersionsList } from "./package-versions";
12
11
 
13
12
  interface IProps {
14
13
  packageId: string;
15
14
  }
16
15
 
17
16
  export const PackageDetails = (props: IProps) => {
18
-
19
17
  const refresh = useObservableState(Date.now());
20
18
  const saveDeviceTagRef = React.useRef<(() => Promise<void>) | null>(null);
21
19
 
22
- const pkg = usePromise(async () => {
23
- const pkg = await Packages().get(props.packageId);
24
- if (!pkg) {
25
- throw new Error('Workflow not found');
26
- }
27
- updateActiveTabTitle(pkg.name || "Package");
28
- return Packages().initDoc(pkg);
29
- }, undefined, [props.packageId, refresh()]);
20
+ const pkg = usePromise(
21
+ async () => {
22
+ const pkg = await Packages().get(props.packageId);
23
+ if (!pkg) {
24
+ throw new Error("Workflow not found");
25
+ }
26
+ updateActiveTabTitle(pkg.name || "Package");
27
+ return Packages().initDoc(pkg);
28
+ },
29
+ undefined,
30
+ [props.packageId, refresh()],
31
+ );
30
32
 
31
33
  if (!pkg) {
32
34
  return <LoadingIndicator />;
33
35
  }
34
36
 
35
- const addActions: ISaveButtonProps['addActions'] = [
37
+ const addActions: ISaveButtonProps["addActions"] = [
36
38
  {
37
- label: 'Reload Package',
39
+ label: "Reload Package",
38
40
  onClick: async () => {
39
41
  await rpcServerCalls.addOrUpdatePackage(pkg.packageId, { update: true });
40
42
  await pkg.load();
41
43
  window.location.reload();
42
- }
44
+ },
43
45
  },
44
46
  ];
45
47
  if (!pkg.remoteRepo) {
46
48
  addActions.push({
47
- label: 'Make Remote ',
49
+ label: "Make Remote ",
48
50
  // className: 'text-bg-warning',
49
51
  onClick: async () => {
50
52
  if (confirm(`Create a remote repository from this local one: ${pkg.name}`)) {
51
53
  try {
52
- await rpcServerCalls.addOrUpdatePackage(pkg.packageId, { linkRemote: true, update: true });
54
+ await rpcServerCalls.addOrUpdatePackage(pkg.packageId, {
55
+ linkRemote: true,
56
+ update: true,
57
+ });
53
58
  refresh(Date.now());
54
59
  } catch (err) {
55
60
  alert(`Error linking remote repo: ${err}`);
56
61
  }
57
62
  }
58
- }
63
+ },
59
64
  });
60
65
  }
61
66
 
62
67
  return (
63
68
  <div className="container-fluid p-3">
64
-
65
69
  <div className="d-flex">
66
70
  <div>
67
71
  <h4>
@@ -72,8 +76,8 @@ export const PackageDetails = (props: IProps) => {
72
76
  <h4>
73
77
  <Input
74
78
  key={pkg.packageId}
75
- className='border border-0'
76
- style={{ width: '100%', outline: 'none', backgroundColor: 'transparent' }}
79
+ className="border border-0"
80
+ style={{ width: "100%", outline: "none", backgroundColor: "transparent" }}
77
81
  value={pkg.qs.name}
78
82
  />
79
83
  </h4>
@@ -86,9 +90,7 @@ export const PackageDetails = (props: IProps) => {
86
90
  await pkg.save();
87
91
  await saveDeviceTagRef.current?.();
88
92
  }}
89
- addActions={[
90
- ...addActions
91
- ]}
93
+ addActions={[...addActions]}
92
94
  />
93
95
  </div>
94
96
  </div>
@@ -97,31 +99,37 @@ export const PackageDetails = (props: IProps) => {
97
99
  key={pkg.packageId}
98
100
  tabs={[
99
101
  {
100
- name: 'Info', content:
102
+ name: "Info",
103
+ content: (
101
104
  <ScreenTabBody>
102
105
  <PackageInfo pkg={pkg} saveDeviceTagRef={saveDeviceTagRef} />
103
106
  </ScreenTabBody>
107
+ ),
104
108
  },
105
109
  {
106
- name: 'Versions', content:
110
+ name: "Versions",
111
+ content: (
107
112
  <ScreenTabBody>
108
113
  <PackageVersionsList pkg={pkg} />
109
114
  </ScreenTabBody>
115
+ ),
110
116
  },
111
117
  {
112
- name: 'Components', content:
118
+ name: "Components",
119
+ content: (
113
120
  <ScreenTabBody>
114
121
  TODO - show all of the different components in the package
115
122
  </ScreenTabBody>
123
+ ),
116
124
  },
117
125
  {
118
- name: 'Dependencies', content:
119
- <ScreenTabBody>
120
- TODO - show all of the dependencies of the package
121
- </ScreenTabBody>
126
+ name: "Dependencies",
127
+ content: (
128
+ <ScreenTabBody>TODO - show all of the dependencies of the package</ScreenTabBody>
129
+ ),
122
130
  },
123
131
  ]}
124
132
  />
125
133
  </div>
126
- )
127
- }
134
+ );
135
+ };
@@ -1,15 +1,24 @@
1
+ import {
2
+ doesTagMatch,
3
+ groupDeviceVar,
4
+ type IDoc,
5
+ type IPackage,
6
+ type IPackageVersion,
7
+ PackageVersions,
8
+ packagesRootDir,
9
+ rpcServerCalls,
10
+ } from "@peers-app/peers-sdk";
1
11
  import React from "react";
2
- import { rpcServerCalls, IDoc, IPackage, IPackageVersion, PackageVersions, packagesRootDir, groupDeviceVar, doesTagMatch } from "@peers-app/peers-sdk";
12
+ import { Input } from "../../components/input";
3
13
  import { MarkdownWithMentions } from "../../components/markdown-with-mentions";
4
14
  import { Tooltip } from "../../components/tooltip";
5
- import { Input } from "../../components/input";
6
15
  import { useObservable, usePromise } from "../../hooks";
7
16
 
8
- const deviceVersionTagVar = groupDeviceVar<string | undefined>('deviceVersionTag');
17
+ const deviceVersionTagVar = groupDeviceVar<string | undefined>("deviceVersionTag");
9
18
 
10
19
  export const PackageInfo = (props: {
11
- pkg: IDoc<IPackage>,
12
- saveDeviceTagRef?: React.MutableRefObject<(() => Promise<void>) | null>,
20
+ pkg: IDoc<IPackage>;
21
+ saveDeviceTagRef?: React.MutableRefObject<(() => Promise<void>) | null>;
13
22
  }) => {
14
23
  const { pkg } = props;
15
24
  const [activeVersionId] = useObservable(pkg.qs.activePackageVersionId);
@@ -22,16 +31,16 @@ export const PackageInfo = (props: {
22
31
  });
23
32
  const [localPath, setLocalPath] = useObservable(localPathVar);
24
33
 
25
- const [deviceTagDraft, setDeviceTagDraft] = React.useState(deviceTag || '');
34
+ const [deviceTagDraft, setDeviceTagDraft] = React.useState(deviceTag || "");
26
35
  const savingRef = React.useRef(false);
27
36
 
28
37
  React.useEffect(() => {
29
38
  if (!savingRef.current) {
30
- setDeviceTagDraft(deviceTag || '');
39
+ setDeviceTagDraft(deviceTag || "");
31
40
  }
32
41
  }, [deviceTag]);
33
42
 
34
- const deviceTagDirty = deviceTagDraft.trim() !== (deviceTag || '');
43
+ const deviceTagDirty = deviceTagDraft.trim() !== (deviceTag || "");
35
44
  const prevDirtyRef = React.useRef(false);
36
45
  React.useEffect(() => {
37
46
  if (deviceTagDirty && !prevDirtyRef.current) {
@@ -40,12 +49,12 @@ export const PackageInfo = (props: {
40
49
  pkg.q(Math.max(0, (pkg.q() || 0) - 1));
41
50
  }
42
51
  prevDirtyRef.current = deviceTagDirty;
43
- }, [deviceTagDirty]);
52
+ }, [deviceTagDirty, pkg.q]);
44
53
 
45
54
  if (props.saveDeviceTagRef) {
46
55
  props.saveDeviceTagRef.current = async () => {
47
56
  const val = deviceTagDraft.trim();
48
- if (val !== (deviceTag || '')) {
57
+ if (val !== (deviceTag || "")) {
49
58
  savingRef.current = true;
50
59
  try {
51
60
  if (val) {
@@ -60,32 +69,55 @@ export const PackageInfo = (props: {
60
69
  };
61
70
  }
62
71
 
63
- const activeVersion = usePromise(async () => {
64
- if (!activeVersionId) return null;
65
- return PackageVersions().get(activeVersionId) as Promise<IPackageVersion | null>;
66
- }, undefined, [activeVersionId]);
67
-
68
- const newerLevel = usePromise(async (): Promise<'major' | 'minor' | 'patch' | 'uptodate'> => {
69
- if (!activeVersionId) return 'uptodate';
70
- const all = await PackageVersions().list({ packageId: pkg.packageId });
71
- const active = all.find(v => v.packageVersionId === activeVersionId);
72
- if (!active?.version) return 'uptodate';
73
- const parse = (v: string) => v.split('.').map(Number);
74
- const [aMaj, aMin, aPat] = parse(active.version);
75
- let highest: 'major' | 'minor' | 'patch' | null = null;
76
- for (const v of all) {
77
- if (!v.version || v.packageVersionId === activeVersionId) continue;
78
- if (!doesTagMatch(active.versionTag, v.versionTag, followVersionTags, deviceTag)) continue;
79
- const [maj, min, pat] = parse(v.version);
80
- if (maj > aMaj) return 'major';
81
- if (maj === aMaj && min > aMin) { highest = 'minor'; continue; }
82
- if (maj === aMaj && min === aMin && pat > aPat && !highest) { highest = 'patch'; continue; }
83
- if (maj === aMaj && min === aMin && pat === aPat && (v.createdAt || '') > (active.createdAt || '') && !highest) { highest = 'patch'; }
84
- }
85
- return highest || 'uptodate';
86
- }, undefined, [activeVersionId, pkg.packageId, followVersionTags, deviceTag]);
72
+ const activeVersion = usePromise(
73
+ async () => {
74
+ if (!activeVersionId) return null;
75
+ return PackageVersions().get(activeVersionId) as Promise<IPackageVersion | null>;
76
+ },
77
+ undefined,
78
+ [activeVersionId],
79
+ );
87
80
 
88
- const isPinned = versionFollowRange === 'pinned';
81
+ const newerLevel = usePromise(
82
+ async (): Promise<"major" | "minor" | "patch" | "uptodate"> => {
83
+ if (!activeVersionId) return "uptodate";
84
+ const all = await PackageVersions().list({ packageId: pkg.packageId });
85
+ const active = all.find((v) => v.packageVersionId === activeVersionId);
86
+ if (!active?.version) return "uptodate";
87
+ const parse = (v: string) => v.split(".").map(Number);
88
+ const [aMaj, aMin, aPat] = parse(active.version);
89
+ let highest: "major" | "minor" | "patch" | null = null;
90
+ for (const v of all) {
91
+ if (!v.version || v.packageVersionId === activeVersionId) continue;
92
+ if (!doesTagMatch(active.versionTag, v.versionTag, followVersionTags, deviceTag)) continue;
93
+ const [maj, min, pat] = parse(v.version);
94
+ if (maj > aMaj) return "major";
95
+ if (maj === aMaj && min > aMin) {
96
+ highest = "minor";
97
+ continue;
98
+ }
99
+ if (maj === aMaj && min === aMin && pat > aPat && !highest) {
100
+ highest = "patch";
101
+ continue;
102
+ }
103
+ if (
104
+ maj === aMaj &&
105
+ min === aMin &&
106
+ pat === aPat &&
107
+ (v.createdAt || "") > (active.createdAt || "") &&
108
+ !highest
109
+ ) {
110
+ highest = "patch";
111
+ }
112
+ }
113
+ return highest || "uptodate";
114
+ },
115
+ undefined,
116
+ [activeVersionId, pkg.packageId, followVersionTags, deviceTag],
117
+ );
118
+
119
+ const isPinned = versionFollowRange === "pinned";
120
+ const remoteRepoUrl = pkg.remoteRepo;
89
121
 
90
122
  return (
91
123
  <div>
@@ -102,45 +134,49 @@ export const PackageInfo = (props: {
102
134
  <small>
103
135
  Local Path:
104
136
  <small>
105
- <Tooltip markdownContent={`The local path to the directory containing the package. This will open in VS Code if it's installed otherwise this will open in your native file system`} />
137
+ <Tooltip
138
+ markdownContent={`The local path to the directory containing the package. This will open in VS Code if it's installed otherwise this will open in your native file system`}
139
+ />
106
140
  <button
107
141
  className="btn btn-sm btn-link"
108
142
  onClick={() => {
109
143
  rpcServerCalls.openPackage(localPath || packagesRootDir);
110
144
  }}
111
- >Open Local</button>
145
+ >
146
+ Open Local
147
+ </button>
112
148
  </small>
113
149
  </small>
114
150
  <input
115
151
  type="text"
116
152
  className="form-control mb-3 p-0 ps-2"
117
153
  placeholder="~/peers/packages/my-package"
118
- value={localPath || ''}
119
- onChange={e => setLocalPath(e.target.value)}
154
+ value={localPath || ""}
155
+ onChange={(e) => setLocalPath(e.target.value)}
120
156
  />
121
157
  </div>
122
158
 
123
- {pkg.remoteRepo && (
159
+ {remoteRepoUrl ? (
124
160
  <div className="mt-2">
125
161
  <small>
126
162
  Source URL:
127
163
  <small>
128
- <Tooltip markdownContent={`The remote source of this package. Often a github repository URL or a link to the Peers page for the package.`} />
164
+ <Tooltip
165
+ markdownContent={`The remote source of this package. Often a github repository URL or a link to the Peers page for the package.`}
166
+ />
129
167
  <button
130
168
  className="btn btn-sm btn-link"
131
169
  onClick={() => {
132
- rpcServerCalls.openLinkInBrowser(pkg.remoteRepo!);
170
+ rpcServerCalls.openLinkInBrowser(remoteRepoUrl);
133
171
  }}
134
- >Open Remote</button>
172
+ >
173
+ Open Remote
174
+ </button>
135
175
  </small>
136
176
  </small>
137
- <Input
138
- value={pkg.qs.remoteRepo}
139
- className="form-control mb-3 p-0 ps-2"
140
- disabled
141
- />
177
+ <Input value={pkg.qs.remoteRepo} className="form-control mb-3 p-0 ps-2" disabled />
142
178
  </div>
143
- )}
179
+ ) : null}
144
180
 
145
181
  <div className="mt-2">
146
182
  <hr />
@@ -152,15 +188,21 @@ export const PackageInfo = (props: {
152
188
  <div className="d-flex align-items-center mt-1 mb-3">
153
189
  <strong className="me-2">v{activeVersion.version}</strong>
154
190
  {activeVersion.versionTag && (
155
- <span className={`badge ${activeVersion.versionTag.startsWith('beta') ? 'text-bg-warning' : 'text-bg-info'} me-2`}>
191
+ <span
192
+ className={`badge ${activeVersion.versionTag.startsWith("beta") ? "text-bg-warning" : "text-bg-info"} me-2`}
193
+ >
156
194
  {activeVersion.versionTag}
157
195
  </span>
158
196
  )}
159
- <code className="text-muted small me-2">{activeVersion.packageVersionHash?.substring(0, 8)}</code>
160
- {newerLevel === 'uptodate' ? (
197
+ <code className="text-muted small me-2">
198
+ {activeVersion.packageVersionHash?.substring(0, 8)}
199
+ </code>
200
+ {newerLevel === "uptodate" ? (
161
201
  <span className="badge text-bg-success">Up to date</span>
162
202
  ) : newerLevel ? (
163
- <span className={`badge text-bg-${newerLevel === 'major' ? 'danger' : newerLevel === 'minor' ? 'warning' : 'info'}`}>
203
+ <span
204
+ className={`badge text-bg-${newerLevel === "major" ? "danger" : newerLevel === "minor" ? "warning" : "info"}`}
205
+ >
164
206
  Newer {newerLevel} version available
165
207
  </span>
166
208
  ) : null}
@@ -176,10 +218,10 @@ export const PackageInfo = (props: {
176
218
  </small>
177
219
  <select
178
220
  className="form-select form-select-sm"
179
- value={versionFollowRange || 'latest'}
221
+ value={versionFollowRange || "latest"}
180
222
  onChange={(e) => {
181
- const val = e.target.value as 'pinned' | 'patch' | 'minor' | 'latest';
182
- pkg.versionFollowRange = val === 'latest' ? undefined : val;
223
+ const val = e.target.value as "pinned" | "patch" | "minor" | "latest";
224
+ pkg.versionFollowRange = val === "latest" ? undefined : val;
183
225
  }}
184
226
  >
185
227
  <option value="latest">Latest (auto-update to newest)</option>
@@ -189,7 +231,7 @@ export const PackageInfo = (props: {
189
231
  </select>
190
232
  </div>
191
233
 
192
- <div className={`mb-3 ${isPinned ? 'opacity-50' : ''}`}>
234
+ <div className={`mb-3 ${isPinned ? "opacity-50" : ""}`}>
193
235
  <small>
194
236
  Follow Version Tags:
195
237
  <Tooltip markdownContent="Which version tags to auto-activate. Leave empty for **current** (follows the active version's tag). Use `*` for any tag, or a comma-separated list like `stable,prod`." />
@@ -197,7 +239,7 @@ export const PackageInfo = (props: {
197
239
  <Input
198
240
  value={pkg.qs.followVersionTags}
199
241
  className="form-control form-control-sm p-0 ps-2"
200
- placeholder={`Following "${activeVersion?.versionTag || 'stable'}"`}
242
+ placeholder={`Following "${activeVersion?.versionTag || "stable"}"`}
201
243
  disabled={isPinned}
202
244
  />
203
245
  </div>
@@ -219,7 +261,7 @@ export const PackageInfo = (props: {
219
261
  <button
220
262
  className="btn btn-sm btn-outline-secondary"
221
263
  title="Clear device tag override"
222
- onClick={() => setDeviceTagDraft('')}
264
+ onClick={() => setDeviceTagDraft("")}
223
265
  >
224
266
  <i className="bi bi-x-lg"></i>
225
267
  </button>
@@ -232,13 +274,12 @@ export const PackageInfo = (props: {
232
274
  <hr />
233
275
  <small>
234
276
  Description:
235
- <Tooltip markdownContent={`This should be edited in the package's README.md. It will automatically update when you restart Peers or reload the package.`} />
277
+ <Tooltip
278
+ markdownContent={`This should be edited in the package's README.md. It will automatically update when you restart Peers or reload the package.`}
279
+ />
236
280
  </small>
237
- <MarkdownWithMentions
238
- content={pkg.description || ''}
239
- />
281
+ <MarkdownWithMentions content={pkg.description || ""} />
240
282
  </div>
241
-
242
283
  </div>
243
- )
244
- }
284
+ );
285
+ };