@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,6 +1,16 @@
1
- import { Devices, getMe, getUserContext, hasShownWelcomeModal, IDevice, thisDeviceId, TrustLevel, Users } from "@peers-app/peers-sdk";
2
- import React, { useEffect, useState } from 'react';
3
- import { useObservable, usePromise } from '../hooks';
1
+ import {
2
+ Devices,
3
+ getMe,
4
+ getUserContext,
5
+ hasShownWelcomeModal,
6
+ type IDevice,
7
+ TrustLevel,
8
+ thisDeviceId,
9
+ Users,
10
+ } from "@peers-app/peers-sdk";
11
+ import type React from "react";
12
+ import { useEffect, useState } from "react";
13
+ import { useObservable, usePromise } from "../hooks";
4
14
 
5
15
  interface WelcomeModalProps {
6
16
  colorMode: string;
@@ -8,13 +18,13 @@ interface WelcomeModalProps {
8
18
  }
9
19
 
10
20
  export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
11
- const [displayName, setDisplayName] = useState('');
12
- const [deviceName, setDeviceName] = useState('');
21
+ const [displayName, setDisplayName] = useState("");
22
+ const [deviceName, setDeviceName] = useState("");
13
23
  const [isSaving, setIsSaving] = useState(false);
14
24
  const [error, setError] = useState<string | null>(null);
15
25
  const [deviceId] = useObservable(thisDeviceId);
16
26
 
17
- const isDark = colorMode === 'dark';
27
+ const isDark = colorMode === "dark";
18
28
 
19
29
  // Load current user data
20
30
  const me = usePromise(async () => getMe());
@@ -36,7 +46,7 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
36
46
  setDeviceName(device.name);
37
47
  }
38
48
  } catch (err) {
39
- console.error('Error loading device name:', err);
49
+ console.error("Error loading device name:", err);
40
50
  }
41
51
  };
42
52
  loadDeviceName();
@@ -58,7 +68,7 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
58
68
  // Save device name
59
69
  if (deviceId && deviceName.trim()) {
60
70
  const devicesTable = Devices(userContext.userDataContext);
61
- const device: IDevice = await devicesTable.get(deviceId) || {
71
+ const device: IDevice = (await devicesTable.get(deviceId)) || {
62
72
  deviceId,
63
73
  userId: userContext.userId,
64
74
  firstSeen: new Date(),
@@ -71,11 +81,11 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
71
81
 
72
82
  // Mark the welcome modal as shown
73
83
  hasShownWelcomeModal(true);
74
-
84
+
75
85
  onClose();
76
- } catch (err: any) {
77
- console.error('Error saving profile:', err);
78
- setError(err.message || 'Failed to save. Please try again.');
86
+ } catch (err: unknown) {
87
+ console.error("Error saving profile:", err);
88
+ setError(err instanceof Error ? err.message : "Failed to save. Please try again.");
79
89
  setIsSaving(false);
80
90
  }
81
91
  };
@@ -87,10 +97,10 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
87
97
  };
88
98
 
89
99
  const handleKeyDown = (e: React.KeyboardEvent) => {
90
- if (e.key === 'Enter' && !e.shiftKey) {
100
+ if (e.key === "Enter" && !e.shiftKey) {
91
101
  e.preventDefault();
92
102
  handleSave();
93
- } else if (e.key === 'Escape') {
103
+ } else if (e.key === "Escape") {
94
104
  handleSkip();
95
105
  }
96
106
  };
@@ -106,34 +116,35 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
106
116
  top: 0,
107
117
  left: 0,
108
118
  zIndex: 1050,
109
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
110
- backdropFilter: 'blur(4px)',
111
- paddingTop: '10vh'
119
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
120
+ backdropFilter: "blur(4px)",
121
+ paddingTop: "10vh",
112
122
  }}
113
123
  >
114
124
  <div
115
- className={`${isDark ? 'bg-dark text-light' : 'bg-white text-dark'}`}
125
+ className={`${isDark ? "bg-dark text-light" : "bg-white text-dark"}`}
116
126
  style={{
117
- width: '90%',
118
- maxWidth: '500px',
119
- borderRadius: '12px',
120
- boxShadow: isDark
121
- ? '0 20px 40px rgba(0, 0, 0, 0.5)'
122
- : '0 20px 40px rgba(0, 0, 0, 0.1)',
123
- border: isDark ? '1px solid #495057' : '1px solid #dee2e6',
124
- overflow: 'hidden'
127
+ width: "90%",
128
+ maxWidth: "500px",
129
+ borderRadius: "12px",
130
+ boxShadow: isDark ? "0 20px 40px rgba(0, 0, 0, 0.5)" : "0 20px 40px rgba(0, 0, 0, 0.1)",
131
+ border: isDark ? "1px solid #495057" : "1px solid #dee2e6",
132
+ overflow: "hidden",
125
133
  }}
126
134
  >
127
135
  {/* Header */}
128
136
  <div
129
137
  className="p-4 text-center"
130
138
  style={{
131
- borderBottom: `1px solid ${isDark ? '#495057' : '#dee2e6'}`
139
+ borderBottom: `1px solid ${isDark ? "#495057" : "#dee2e6"}`,
132
140
  }}
133
141
  >
134
- <i className="bi-person-circle text-primary d-block mb-3" style={{ fontSize: '48px' }} />
142
+ <i className="bi-person-circle text-primary d-block mb-3" style={{ fontSize: "48px" }} />
135
143
  <h4 className="mb-2">Welcome to Peers!</h4>
136
- <p className={`mb-0 ${isDark ? 'text-light opacity-75' : 'text-muted'}`} style={{ fontSize: '14px' }}>
144
+ <p
145
+ className={`mb-0 ${isDark ? "text-light opacity-75" : "text-muted"}`}
146
+ style={{ fontSize: "14px" }}
147
+ >
137
148
  Let's personalize your experience. You can change these anytime in Settings.
138
149
  </p>
139
150
  </div>
@@ -142,7 +153,7 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
142
153
  <div className="p-4">
143
154
  {/* Error Alert */}
144
155
  {error && (
145
- <div className="alert alert-danger py-2 px-3 mb-3" style={{ fontSize: '14px' }}>
156
+ <div className="alert alert-danger py-2 px-3 mb-3" style={{ fontSize: "14px" }}>
146
157
  <i className="bi-exclamation-triangle me-2" />
147
158
  {error}
148
159
  </div>
@@ -156,7 +167,7 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
156
167
  </label>
157
168
  <input
158
169
  type="text"
159
- className={`form-control ${isDark ? 'bg-dark text-light border-secondary' : ''}`}
170
+ className={`form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`}
160
171
  placeholder="How should others see you?"
161
172
  value={displayName}
162
173
  onChange={(e) => {
@@ -164,15 +175,17 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
164
175
  setError(null);
165
176
  }}
166
177
  onKeyDown={handleKeyDown}
167
- autoFocus
168
178
  disabled={isSaving}
169
179
  maxLength={100}
170
180
  style={{
171
- fontSize: '14px',
172
- backgroundColor: isDark ? '#343a40' : '#ffffff'
181
+ fontSize: "14px",
182
+ backgroundColor: isDark ? "#343a40" : "#ffffff",
173
183
  }}
174
184
  />
175
- <small className={isDark ? 'text-light opacity-50' : 'text-muted'} style={{ fontSize: '11px' }}>
185
+ <small
186
+ className={isDark ? "text-light opacity-50" : "text-muted"}
187
+ style={{ fontSize: "11px" }}
188
+ >
176
189
  This name will be visible to others when you connect
177
190
  </small>
178
191
  </div>
@@ -185,7 +198,7 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
185
198
  </label>
186
199
  <input
187
200
  type="text"
188
- className={`form-control ${isDark ? 'bg-dark text-light border-secondary' : ''}`}
201
+ className={`form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`}
189
202
  placeholder="e.g., My Laptop, Work Computer"
190
203
  value={deviceName}
191
204
  onChange={(e) => {
@@ -196,11 +209,14 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
196
209
  disabled={isSaving}
197
210
  maxLength={100}
198
211
  style={{
199
- fontSize: '14px',
200
- backgroundColor: isDark ? '#343a40' : '#ffffff'
212
+ fontSize: "14px",
213
+ backgroundColor: isDark ? "#343a40" : "#ffffff",
201
214
  }}
202
215
  />
203
- <small className={isDark ? 'text-light opacity-50' : 'text-muted'} style={{ fontSize: '11px' }}>
216
+ <small
217
+ className={isDark ? "text-light opacity-50" : "text-muted"}
218
+ style={{ fontSize: "11px" }}
219
+ >
204
220
  Helps you identify this device when syncing across multiple devices
205
221
  </small>
206
222
  </div>
@@ -210,12 +226,12 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
210
226
  <div
211
227
  className="p-3 d-flex justify-content-between align-items-center"
212
228
  style={{
213
- borderTop: `1px solid ${isDark ? '#495057' : '#dee2e6'}`,
214
- backgroundColor: isDark ? '#2d3238' : '#f8f9fa'
229
+ borderTop: `1px solid ${isDark ? "#495057" : "#dee2e6"}`,
230
+ backgroundColor: isDark ? "#2d3238" : "#f8f9fa",
215
231
  }}
216
232
  >
217
233
  <button
218
- className={`btn btn-sm ${isDark ? 'btn-outline-light' : 'btn-outline-secondary'}`}
234
+ className={`btn btn-sm ${isDark ? "btn-outline-light" : "btn-outline-secondary"}`}
219
235
  onClick={handleSkip}
220
236
  disabled={isSaving}
221
237
  >
@@ -225,11 +241,15 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
225
241
  className="btn btn-sm btn-primary"
226
242
  onClick={handleSave}
227
243
  disabled={isSaving}
228
- style={{ minWidth: '100px' }}
244
+ style={{ minWidth: "100px" }}
229
245
  >
230
246
  {isSaving ? (
231
247
  <>
232
- <span className="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true" />
248
+ <span
249
+ className="spinner-border spinner-border-sm me-1"
250
+ role="status"
251
+ aria-hidden="true"
252
+ />
233
253
  Saving...
234
254
  </>
235
255
  ) : (
@@ -243,11 +263,11 @@ export function WelcomeModal({ colorMode, onClose }: WelcomeModalProps) {
243
263
 
244
264
  {/* Keyboard Shortcuts Helper */}
245
265
  <div
246
- className={`px-3 py-2 small text-center ${isDark ? 'text-light opacity-50' : 'text-muted'}`}
266
+ className={`px-3 py-2 small text-center ${isDark ? "text-light opacity-50" : "text-muted"}`}
247
267
  style={{
248
- borderTop: `1px solid ${isDark ? '#495057' : '#dee2e6'}`,
249
- fontSize: '11px',
250
- backgroundColor: isDark ? '#212529' : '#ffffff'
268
+ borderTop: `1px solid ${isDark ? "#495057" : "#dee2e6"}`,
269
+ fontSize: "11px",
270
+ backgroundColor: isDark ? "#212529" : "#ffffff",
251
271
  }}
252
272
  >
253
273
  <kbd className="small">↵</kbd> to save • <kbd className="small">esc</kbd> to skip
@@ -1,5 +1,10 @@
1
- import { defaultAssistantId, getAllAssistantIdsMentioned, IWorkflow, runWorkflow, Workflows } from "@peers-app/peers-sdk";
2
- import React from "react";
1
+ import {
2
+ defaultAssistantId,
3
+ getAllAssistantIdsMentioned,
4
+ type IWorkflow,
5
+ runWorkflow,
6
+ Workflows,
7
+ } from "@peers-app/peers-sdk";
3
8
  import { Input } from "../../components/input";
4
9
  import { LoadingIndicator } from "../../components/loading-indicator";
5
10
  import { SaveButton } from "../../components/save-button";
@@ -15,15 +20,18 @@ interface IProps {
15
20
  }
16
21
 
17
22
  export const WorkflowDetails = (props: IProps) => {
18
-
19
- const workflow = usePromise(async () => {
20
- const workflow = await Workflows().get(props.workflowId);
21
- if (!workflow) {
22
- throw new Error('Workflow not found');
23
- }
24
- updateActiveTabTitle(workflow.name || "Workflow");
25
- return Workflows().initDoc(workflow);
26
- }, undefined, [props.workflowId]);
23
+ const workflow = usePromise(
24
+ async () => {
25
+ const workflow = await Workflows().get(props.workflowId);
26
+ if (!workflow) {
27
+ throw new Error("Workflow not found");
28
+ }
29
+ updateActiveTabTitle(workflow.name || "Workflow");
30
+ return Workflows().initDoc(workflow);
31
+ },
32
+ undefined,
33
+ [props.workflowId],
34
+ );
27
35
 
28
36
  if (!workflow) {
29
37
  return <LoadingIndicator />;
@@ -32,14 +40,15 @@ export const WorkflowDetails = (props: IProps) => {
32
40
  async function saveChanges() {
33
41
  if (!workflow) return;
34
42
  workflow.updatedAt = new Date();
35
- const assistantsMentioned = await getAllAssistantIdsMentioned(workflow.instructions[0].markdown ?? '');
43
+ const assistantsMentioned = await getAllAssistantIdsMentioned(
44
+ workflow.instructions[0].markdown ?? "",
45
+ );
36
46
  workflow.defaultAssistantId = assistantsMentioned[0] || defaultAssistantId;
37
47
  workflow.save();
38
48
  }
39
49
 
40
50
  return (
41
51
  <div className="container-fluid p-3">
42
-
43
52
  <div className="d-flex">
44
53
  <div>
45
54
  <h4>
@@ -50,26 +59,24 @@ export const WorkflowDetails = (props: IProps) => {
50
59
  <h4>
51
60
  <Input
52
61
  key={workflow.workflowId}
53
- className='border border-0'
54
- style={{ width: '100%', outline: 'none', backgroundColor: 'transparent' }}
62
+ className="border border-0"
63
+ style={{ width: "100%", outline: "none", backgroundColor: "transparent" }}
55
64
  value={workflow.qs.name}
56
65
  />
57
66
  </h4>
58
67
  </div>
59
68
  <div>
60
- <button className="btn btn-success me-2" onClick={() => {
61
- saveChanges(); // TODO take this out, is just for testing
62
- _runWorkflow(workflow.toJS());
63
- }}>
69
+ <button
70
+ className="btn btn-success me-2"
71
+ onClick={() => {
72
+ saveChanges(); // TODO take this out, is just for testing
73
+ _runWorkflow(workflow.toJS());
74
+ }}
75
+ >
64
76
  Run All
65
77
  </button>
66
78
 
67
- <SaveButton
68
- key={workflow.workflowId}
69
- onClick={saveChanges}
70
- doc={workflow}
71
- />
72
-
79
+ <SaveButton key={workflow.workflowId} onClick={saveChanges} doc={workflow} />
73
80
  </div>
74
81
  </div>
75
82
 
@@ -77,23 +84,26 @@ export const WorkflowDetails = (props: IProps) => {
77
84
  key={workflow.workflowId}
78
85
  tabs={[
79
86
  {
80
- name: 'Info', content:
87
+ name: "Info",
88
+ content: (
81
89
  <ScreenTabBody>
82
90
  <WorkflowInfo workflow={workflow} />
83
91
  </ScreenTabBody>
92
+ ),
84
93
  },
85
94
  {
86
- name: 'Instructions', content:
95
+ name: "Instructions",
96
+ content: (
87
97
  <ScreenTabBody>
88
98
  <WorkflowInstructions workflow={workflow} />
89
99
  </ScreenTabBody>
100
+ ),
90
101
  },
91
102
  ]}
92
103
  />
93
104
  </div>
94
- )
95
- }
96
-
105
+ );
106
+ };
97
107
 
98
108
  async function _runWorkflow(workflow: IWorkflow) {
99
109
  // TODO maybe warn if there are pending changes
@@ -1,10 +1,7 @@
1
-
1
+ import type { IDoc, IWorkflow } from "@peers-app/peers-sdk";
2
2
  import { Input } from "../../components/input";
3
- import React from "react";
4
- import { IDoc, IWorkflow } from "@peers-app/peers-sdk";
5
3
  import { MarkdownEditorInline } from "../../components/markdown-editor/editor-inline";
6
4
 
7
-
8
5
  export const WorkflowInfo = (props: { workflow: IDoc<IWorkflow> }) => {
9
6
  const { workflow } = props;
10
7
 
@@ -19,11 +16,7 @@ export const WorkflowInfo = (props: { workflow: IDoc<IWorkflow> }) => {
19
16
  />
20
17
 
21
18
  <small>Description:</small>
22
- <MarkdownEditorInline
23
- value={workflow.qs.description}
24
- />
25
-
19
+ <MarkdownEditorInline value={workflow.qs.description} />
26
20
  </div>
27
- )
28
- }
29
-
21
+ );
22
+ };
@@ -1,6 +1,12 @@
1
- import { IDoc, IWorkflow, IWorkflowInstruction, Observable, observable } from "@peers-app/peers-sdk";
2
- import React, { useEffect, useState } from "react";
3
- import { IEditorEffects } from "../../components/markdown-editor/editor";
1
+ import {
2
+ type IDoc,
3
+ type IWorkflow,
4
+ type IWorkflowInstruction,
5
+ type Observable,
6
+ observable,
7
+ } from "@peers-app/peers-sdk";
8
+ import { useEffect, useState } from "react";
9
+ import type { IEditorEffects } from "../../components/markdown-editor/editor";
4
10
  import { MarkdownEditorInline } from "../../components/markdown-editor/editor-inline";
5
11
  import { useObservable } from "../../hooks";
6
12
 
@@ -13,15 +19,17 @@ export const WorkflowInstructions = (props: { workflow: IDoc<IWorkflow> }) => {
13
19
 
14
20
  return (
15
21
  <div>
16
- {workflow.qs.instructions().map((instruction, i) => {
22
+ {workflow.qs.instructions().map((_instruction, i) => {
17
23
  return (
18
24
  <div
19
25
  key={i}
20
26
  className="mb-2"
21
- style={{
22
- // border: '1px solid #ccc',
23
- // borderRadius: '5px',
24
- }}
27
+ style={
28
+ {
29
+ // border: '1px solid #ccc',
30
+ // borderRadius: '5px',
31
+ }
32
+ }
25
33
  >
26
34
  <WorkflowInstruction
27
35
  workflow={workflow}
@@ -30,12 +38,11 @@ export const WorkflowInstructions = (props: { workflow: IDoc<IWorkflow> }) => {
30
38
  focusedInstructionIndex={focusedInstructionIndex}
31
39
  />
32
40
  </div>
33
- )
41
+ );
34
42
  })}
35
43
  </div>
36
- )
37
- }
38
-
44
+ );
45
+ };
39
46
 
40
47
  interface IWorkflowInstructionProps {
41
48
  workflow: IDoc<IWorkflow>;
@@ -53,42 +60,41 @@ const WorkflowInstruction = (props: IWorkflowInstructionProps) => {
53
60
 
54
61
  const thisInstruction = instructions()[thisInstructionIndex];
55
62
 
56
- const [markdownObs] = useState(() => observable(thisInstruction.markdown ?? ''));
63
+ const [markdownObs] = useState(() => observable(thisInstruction.markdown ?? ""));
57
64
 
58
65
  useEffect(() => {
59
- const sub = focusedInstructionIndex.subscribe(focusedIndex => {
66
+ const sub = focusedInstructionIndex.subscribe((focusedIndex) => {
60
67
  if (focusedIndex === thisInstructionIndex) {
61
68
  mdEffects.focus?.();
62
69
  }
63
70
  });
64
71
  return () => sub.dispose();
65
- }, [thisInstructionIndex]);
72
+ }, [thisInstructionIndex, focusedInstructionIndex.subscribe, mdEffects.focus]);
66
73
 
67
74
  useEffect(() => {
68
- markdownObs(thisInstruction.markdown ?? '');
69
- const sub = markdownObs.subscribe(value => {
75
+ markdownObs(thisInstruction.markdown ?? "");
76
+ const sub = markdownObs.subscribe((value) => {
70
77
  thisInstruction.markdown = value;
71
78
  props.workflow.q(props.workflow.q() + 1);
72
79
  });
73
80
  return () => sub.dispose();
74
- }, [thisInstruction, instructions(), thisInstructionIndex]);
75
-
81
+ }, [thisInstruction, markdownObs, props.workflow.q]);
76
82
 
77
83
  let backspacedOnEmpty = false;
78
84
  mdEffects.onKeyDown = (evt) => {
79
- if (evt.key === 'Enter') {
85
+ if (evt.key === "Enter") {
80
86
  if (markdownObs().match(/\n\s*\n$/)) {
81
87
  // if the markdown ends with a new line, zero or more whitespace and then another newline, insert a new instruction below
82
88
  evt.preventDefault();
83
89
  const _instructions = instructions();
84
- _instructions.splice(thisInstructionIndex + 1, 0, { markdown: '' });
90
+ _instructions.splice(thisInstructionIndex + 1, 0, { markdown: "" });
85
91
  instructions([..._instructions]);
86
92
  markdownObs(markdownObs().trim());
87
93
  focusedInstructionIndex(thisInstructionIndex + 1);
88
94
  }
89
95
  }
90
- if (evt.key === 'Backspace') {
91
- if (markdownObs().trim() === '') {
96
+ if (evt.key === "Backspace") {
97
+ if (markdownObs().trim() === "") {
92
98
  if (backspacedOnEmpty) {
93
99
  evt.preventDefault();
94
100
  const _instructions = instructions();
@@ -103,11 +109,12 @@ const WorkflowInstruction = (props: IWorkflowInstructionProps) => {
103
109
  }
104
110
  }
105
111
  }
112
+ return false;
106
113
  };
107
114
 
108
115
  function runThisInstruction() {
109
116
  // runInstructions([thisInstruction]);
110
- confirm('TODO: run this instruction not implemented yet');
117
+ confirm("TODO: run this instruction not implemented yet");
111
118
  }
112
119
 
113
120
  return (
@@ -117,11 +124,11 @@ const WorkflowInstruction = (props: IWorkflowInstructionProps) => {
117
124
  autoFocus={props.thisInstructionIndex === focusedInstructionIndex()}
118
125
  topRightControls={[
119
126
  {
120
- iconClass: 'bi bi-play',
127
+ iconClass: "bi bi-play",
121
128
  title: `Run this instruction.`,
122
129
  onClick: runThisInstruction,
123
- }
130
+ },
124
131
  ]}
125
132
  />
126
- )
127
- }
133
+ );
134
+ };