@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.
- package/.github/workflows/publish.yml +8 -5
- package/babel.config.js +4 -4
- package/biome.json +191 -0
- package/dist/command-palette/command-palette-ui.d.ts +1 -2
- package/dist/command-palette/command-palette-ui.js +175 -244
- package/dist/command-palette/command-palette.js +65 -64
- package/dist/components/chat-overlay.d.ts +2 -2
- package/dist/components/chat-overlay.js +160 -217
- package/dist/components/checkbox.d.ts +5 -4
- package/dist/components/checkbox.js +4 -7
- package/dist/components/group-switcher.d.ts +1 -2
- package/dist/components/group-switcher.js +119 -159
- package/dist/components/input-date.d.ts +3 -3
- package/dist/components/input-date.js +6 -6
- package/dist/components/input-number.d.ts +7 -6
- package/dist/components/input-number.js +25 -20
- package/dist/components/input.d.ts +5 -4
- package/dist/components/input.js +4 -7
- package/dist/components/inverse-lazy-list.d.ts +3 -3
- package/dist/components/inverse-lazy-list.js +13 -47
- package/dist/components/io-schema-values.d.ts +5 -6
- package/dist/components/io-schema-values.js +28 -65
- package/dist/components/io-schema.d.ts +4 -5
- package/dist/components/io-schema.js +42 -79
- package/dist/components/lazy-list.d.ts +3 -3
- package/dist/components/lazy-list.js +38 -58
- package/dist/components/list-screen.d.ts +3 -8
- package/dist/components/list-screen.js +28 -23
- package/dist/components/loading-indicator.d.ts +1 -2
- package/dist/components/loading-indicator.js +2 -6
- package/dist/components/markdown-editor/autolink-plugin.js +5 -8
- package/dist/components/markdown-editor/editor-inline.d.ts +2 -3
- package/dist/components/markdown-editor/editor-inline.js +2 -6
- package/dist/components/markdown-editor/editor.d.ts +6 -6
- package/dist/components/markdown-editor/editor.js +9 -19
- package/dist/components/markdown-editor/markdown-plugin.d.ts +1 -1
- package/dist/components/markdown-editor/markdown-plugin.js +20 -21
- package/dist/components/markdown-editor/mention-node.d.ts +2 -2
- package/dist/components/markdown-editor/mention-node.js +24 -24
- package/dist/components/markdown-editor/mentions-plugin.d.ts +2 -2
- package/dist/components/markdown-editor/mentions-plugin.js +61 -62
- package/dist/components/markdown-editor/theme.js +28 -28
- package/dist/components/markdown-editor/toolbar.d.ts +2 -3
- package/dist/components/markdown-editor/toolbar.js +32 -49
- package/dist/components/markdown-with-mentions.d.ts +1 -1
- package/dist/components/markdown-with-mentions.js +43 -43
- package/dist/components/message-logs/message-logs.d.ts +1 -2
- package/dist/components/message-logs/message-logs.js +91 -116
- package/dist/components/messages/avatar.d.ts +3 -4
- package/dist/components/messages/avatar.js +37 -46
- package/dist/components/messages/channel-message-list.d.ts +5 -6
- package/dist/components/messages/channel-message-list.js +34 -34
- package/dist/components/messages/channel-view.d.ts +1 -2
- package/dist/components/messages/channel-view.js +23 -57
- package/dist/components/messages/message-compose.d.ts +3 -4
- package/dist/components/messages/message-compose.js +27 -38
- package/dist/components/messages/message-display.d.ts +2 -3
- package/dist/components/messages/message-display.js +42 -95
- package/dist/components/messages/thread-message-list.d.ts +4 -5
- package/dist/components/messages/thread-message-list.js +29 -29
- package/dist/components/router.d.ts +1 -2
- package/dist/components/router.js +58 -66
- package/dist/components/save-button.d.ts +3 -3
- package/dist/components/save-button.js +23 -33
- package/dist/components/sortable-list.d.ts +11 -12
- package/dist/components/sortable-list.js +42 -22
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +16 -47
- package/dist/components/tooltip.d.ts +4 -4
- package/dist/components/tooltip.js +4 -9
- package/dist/components/trust-level-badge.d.ts +2 -3
- package/dist/components/trust-level-badge.js +16 -16
- package/dist/components/trust-level-dropdown.d.ts +3 -4
- package/dist/components/trust-level-dropdown.js +32 -55
- package/dist/components/typeahead.d.ts +3 -3
- package/dist/components/typeahead.js +48 -89
- package/dist/components/voice-indicator.d.ts +2 -2
- package/dist/components/voice-indicator.js +93 -106
- package/dist/components/voice-subscribe-events.d.ts +32 -0
- package/dist/components/voice-subscribe-events.js +2 -0
- package/dist/globals.d.ts +3 -5
- package/dist/globals.js +22 -33
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +22 -12
- package/dist/hooks.test.js +129 -145
- package/dist/index.d.ts +9 -8
- package/dist/index.js +13 -12
- package/dist/mention-configs.d.ts +2 -2
- package/dist/mention-configs.js +55 -42
- package/dist/screens/assistants/assistant-config.d.ts +2 -3
- package/dist/screens/assistants/assistant-config.js +9 -22
- package/dist/screens/assistants/assistant-details.d.ts +1 -2
- package/dist/screens/assistants/assistant-details.js +13 -28
- package/dist/screens/assistants/assistant-info.d.ts +2 -3
- package/dist/screens/assistants/assistant-info.js +3 -17
- package/dist/screens/assistants/assistant-list.d.ts +1 -2
- package/dist/screens/assistants/assistant-list.js +15 -56
- package/dist/screens/assistants/assistant-tools.d.ts +2 -3
- package/dist/screens/assistants/assistant-tools.js +10 -24
- package/dist/screens/console-logs/console-logs-list.d.ts +1 -2
- package/dist/screens/console-logs/console-logs-list.js +130 -134
- package/dist/screens/console-logs/log-display.d.ts +2 -3
- package/dist/screens/console-logs/log-display.js +40 -42
- package/dist/screens/console-logs/log-filters.d.ts +1 -2
- package/dist/screens/console-logs/log-filters.js +2 -24
- package/dist/screens/console-logs/mobile-log-card.d.ts +2 -3
- package/dist/screens/console-logs/mobile-log-card.js +64 -67
- package/dist/screens/console-logs/resizable-table-header.d.ts +1 -2
- package/dist/screens/console-logs/resizable-table-header.js +31 -67
- package/dist/screens/contacts/contact-details.d.ts +1 -2
- package/dist/screens/contacts/contact-details.js +16 -46
- package/dist/screens/contacts/contact-list.d.ts +1 -2
- package/dist/screens/contacts/contact-list.js +44 -103
- package/dist/screens/contacts/index.d.ts +4 -4
- package/dist/screens/contacts/index.js +1 -1
- package/dist/screens/contacts/user-connect.d.ts +1 -2
- package/dist/screens/contacts/user-connect.js +85 -186
- package/dist/screens/data-explorer/data-explorer.d.ts +1 -2
- package/dist/screens/data-explorer/data-explorer.js +61 -181
- package/dist/screens/data-explorer/index.d.ts +2 -2
- package/dist/screens/data-explorer/query-executor.d.ts +1 -2
- package/dist/screens/data-explorer/query-executor.js +56 -166
- package/dist/screens/groups/group-details.d.ts +1 -2
- package/dist/screens/groups/group-details.js +27 -122
- package/dist/screens/groups/group-invite-listener.d.ts +2 -3
- package/dist/screens/groups/group-invite-listener.js +8 -104
- package/dist/screens/groups/group-list.d.ts +1 -2
- package/dist/screens/groups/group-list.js +56 -133
- package/dist/screens/groups/group-members.d.ts +2 -3
- package/dist/screens/groups/group-members.js +62 -132
- package/dist/screens/groups/index.d.ts +4 -4
- package/dist/screens/groups/index.js +1 -1
- package/dist/screens/join-group/index.d.ts +2 -2
- package/dist/screens/join-group/join-group.d.ts +1 -2
- package/dist/screens/join-group/join-group.js +9 -109
- package/dist/screens/network-viewer/connection-troubleshooter.d.ts +2 -3
- package/dist/screens/network-viewer/connection-troubleshooter.js +89 -193
- package/dist/screens/network-viewer/cpu-usage-graph.d.ts +1 -2
- package/dist/screens/network-viewer/cpu-usage-graph.js +60 -99
- package/dist/screens/network-viewer/device-details-modal.d.ts +1 -2
- package/dist/screens/network-viewer/device-details-modal.js +25 -177
- package/dist/screens/network-viewer/group-details-modal.d.ts +1 -2
- package/dist/screens/network-viewer/group-details-modal.js +31 -142
- package/dist/screens/network-viewer/index.d.ts +4 -4
- package/dist/screens/network-viewer/index.js +3 -3
- package/dist/screens/network-viewer/network-viewer-ipc.d.ts +22 -0
- package/dist/screens/network-viewer/network-viewer-ipc.js +6 -0
- package/dist/screens/network-viewer/network-viewer.d.ts +1 -2
- package/dist/screens/network-viewer/network-viewer.js +91 -296
- package/dist/screens/network-viewer/usage-graph.d.ts +1 -2
- package/dist/screens/network-viewer/usage-graph.js +78 -110
- package/dist/screens/packages/package-details.d.ts +1 -2
- package/dist/screens/packages/package-details.js +35 -41
- package/dist/screens/packages/package-info.d.ts +2 -2
- package/dist/screens/packages/package-info.js +33 -86
- package/dist/screens/packages/package-list.d.ts +1 -2
- package/dist/screens/packages/package-list.js +42 -106
- package/dist/screens/packages/package-new-local.d.ts +1 -2
- package/dist/screens/packages/package-new-local.js +13 -19
- package/dist/screens/packages/package-versions.d.ts +2 -3
- package/dist/screens/packages/package-versions.js +29 -96
- package/dist/screens/peer-types/peer-type-details.d.ts +3 -4
- package/dist/screens/peer-types/peer-type-details.js +26 -78
- package/dist/screens/peer-types/peer-type-list.d.ts +1 -2
- package/dist/screens/peer-types/peer-type-list.js +13 -24
- package/dist/screens/search/global-search.d.ts +1 -2
- package/dist/screens/search/global-search.js +104 -182
- package/dist/screens/settings/color-mode-dropdown.d.ts +3 -4
- package/dist/screens/settings/color-mode-dropdown.js +18 -37
- package/dist/screens/settings/settings-page.d.ts +1 -1
- package/dist/screens/settings/settings-page.js +86 -213
- package/dist/screens/settings/voice-settings-agent.d.ts +1 -1
- package/dist/screens/settings/voice-settings-agent.js +7 -44
- package/dist/screens/settings/voice-settings-api-keys.d.ts +2 -2
- package/dist/screens/settings/voice-settings-api-keys.js +2 -29
- package/dist/screens/settings/voice-settings-output.d.ts +2 -2
- package/dist/screens/settings/voice-settings-output.js +2 -40
- package/dist/screens/settings/voice-settings-providers.d.ts +2 -2
- package/dist/screens/settings/voice-settings-providers.js +2 -19
- package/dist/screens/settings/voice-settings-types.d.ts +4 -4
- package/dist/screens/settings/voice-settings-types.js +31 -31
- package/dist/screens/settings/voice-settings-wake-word.d.ts +2 -2
- package/dist/screens/settings/voice-settings-wake-word.js +2 -33
- package/dist/screens/settings/voice-settings.d.ts +1 -1
- package/dist/screens/settings/voice-settings.js +35 -112
- package/dist/screens/setup-user.d.ts +1 -2
- package/dist/screens/setup-user.js +38 -116
- package/dist/screens/tools/tool-code.d.ts +2 -3
- package/dist/screens/tools/tool-code.js +9 -13
- package/dist/screens/tools/tool-details.d.ts +1 -2
- package/dist/screens/tools/tool-details.js +26 -39
- package/dist/screens/tools/tool-info.d.ts +2 -3
- package/dist/screens/tools/tool-info.js +9 -48
- package/dist/screens/tools/tool-list.d.ts +1 -2
- package/dist/screens/tools/tool-list.js +33 -65
- package/dist/screens/tools/tool-schema.d.ts +2 -3
- package/dist/screens/tools/tool-schema.js +2 -13
- package/dist/screens/tools/tool-test-details.d.ts +1 -2
- package/dist/screens/tools/tool-test-details.js +12 -28
- package/dist/screens/tools/tool-test-list.d.ts +1 -2
- package/dist/screens/tools/tool-test-list.js +17 -56
- package/dist/screens/variables/variable-details.d.ts +1 -2
- package/dist/screens/variables/variable-details.js +19 -86
- package/dist/screens/variables/variable-list.d.ts +1 -2
- package/dist/screens/variables/variable-list.js +16 -27
- package/dist/screens/welcome-modal.d.ts +1 -2
- package/dist/screens/welcome-modal.js +44 -111
- package/dist/screens/workflows/workflow-details.d.ts +1 -2
- package/dist/screens/workflows/workflow-details.js +17 -31
- package/dist/screens/workflows/workflow-info.d.ts +2 -3
- package/dist/screens/workflows/workflow-info.js +2 -9
- package/dist/screens/workflows/workflow-instructions.d.ts +2 -3
- package/dist/screens/workflows/workflow-instructions.js +23 -55
- package/dist/screens/workflows/workflow-list.d.ts +1 -2
- package/dist/screens/workflows/workflow-list.js +23 -62
- package/dist/setupTests.d.ts +1 -1
- package/dist/setupTests.js +10 -11
- package/dist/system-apps/assistants.app.d.ts +1 -1
- package/dist/system-apps/assistants.app.js +3 -3
- package/dist/system-apps/console-logs.app.d.ts +1 -1
- package/dist/system-apps/console-logs.app.js +3 -3
- package/dist/system-apps/contacts.app.d.ts +1 -1
- package/dist/system-apps/contacts.app.js +4 -4
- package/dist/system-apps/data-explorer.app.d.ts +1 -1
- package/dist/system-apps/data-explorer.app.js +4 -4
- package/dist/system-apps/groups.app.d.ts +1 -1
- package/dist/system-apps/groups.app.js +4 -4
- package/dist/system-apps/index.d.ts +17 -17
- package/dist/system-apps/index.js +52 -52
- package/dist/system-apps/join-group.app.d.ts +1 -1
- package/dist/system-apps/join-group.app.js +4 -4
- package/dist/system-apps/mobile-settings.app.d.ts +1 -1
- package/dist/system-apps/mobile-settings.app.js +3 -3
- package/dist/system-apps/network-viewer.app.d.ts +1 -1
- package/dist/system-apps/network-viewer.app.js +4 -4
- package/dist/system-apps/packages.app.d.ts +1 -1
- package/dist/system-apps/packages.app.js +3 -3
- package/dist/system-apps/search.app.d.ts +1 -1
- package/dist/system-apps/search.app.js +4 -4
- package/dist/system-apps/settings.app.d.ts +1 -1
- package/dist/system-apps/settings.app.js +3 -3
- package/dist/system-apps/threads.app.d.ts +1 -1
- package/dist/system-apps/threads.app.js +3 -3
- package/dist/system-apps/tools.app.d.ts +1 -1
- package/dist/system-apps/tools.app.js +3 -3
- package/dist/system-apps/types.app.d.ts +1 -1
- package/dist/system-apps/types.app.js +3 -3
- package/dist/system-apps/variables.app.d.ts +1 -1
- package/dist/system-apps/variables.app.js +3 -3
- package/dist/system-apps/workflows.app.d.ts +1 -1
- package/dist/system-apps/workflows.app.js +3 -3
- package/dist/tabs-layout/tabs-layout.d.ts +2 -3
- package/dist/tabs-layout/tabs-layout.js +215 -246
- package/dist/tabs-layout/tabs-state.d.ts +2 -2
- package/dist/tabs-layout/tabs-state.js +73 -61
- package/dist/ui-defaults/index.d.ts +2 -2
- package/dist/ui-defaults/list-screen.d.ts +2 -3
- package/dist/ui-defaults/list-screen.js +33 -37
- package/dist/ui-defaults/markdown-field.js +24 -56
- package/dist/ui-router/routes-loader.d.ts +1 -1
- package/dist/ui-router/routes-loader.js +17 -13
- package/dist/ui-router/ui-loader.d.ts +6 -6
- package/dist/ui-router/ui-loader.js +172 -268
- package/dist/utils.js +49 -39
- package/jest.config.js +16 -16
- package/package.json +16 -14
- package/src/command-palette/command-palette-ui.tsx +261 -237
- package/src/command-palette/command-palette.ts +81 -78
- package/src/components/chat-overlay.tsx +366 -261
- package/src/components/checkbox.tsx +15 -12
- package/src/components/group-switcher.tsx +150 -105
- package/src/components/input-date.tsx +17 -16
- package/src/components/input-number.tsx +47 -31
- package/src/components/input.tsx +15 -12
- package/src/components/inverse-lazy-list.tsx +14 -13
- package/src/components/io-schema-values.tsx +51 -69
- package/src/components/io-schema.tsx +94 -69
- package/src/components/lazy-list.tsx +51 -34
- package/src/components/list-screen.tsx +51 -35
- package/src/components/loading-indicator.tsx +2 -4
- package/src/components/markdown-editor/autolink-plugin.tsx +4 -11
- package/src/components/markdown-editor/editor-inline.tsx +3 -4
- package/src/components/markdown-editor/editor.tsx +53 -51
- package/src/components/markdown-editor/markdown-plugin.tsx +48 -40
- package/src/components/markdown-editor/mention-node.ts +39 -38
- package/src/components/markdown-editor/mentions-plugin.tsx +99 -101
- package/src/components/markdown-editor/theme.ts +28 -29
- package/src/components/markdown-editor/toolbar.tsx +53 -47
- package/src/components/markdown-with-mentions.tsx +56 -46
- package/src/components/message-logs/message-logs.tsx +225 -165
- package/src/components/messages/avatar.tsx +70 -52
- package/src/components/messages/channel-message-list.tsx +80 -68
- package/src/components/messages/channel-view.tsx +34 -33
- package/src/components/messages/message-compose.tsx +84 -67
- package/src/components/messages/message-display.tsx +103 -89
- package/src/components/messages/thread-message-list.tsx +53 -44
- package/src/components/router.tsx +42 -43
- package/src/components/save-button.tsx +43 -39
- package/src/components/sortable-list.tsx +77 -49
- package/src/components/tabs.tsx +31 -31
- package/src/components/tooltip.tsx +21 -28
- package/src/components/trust-level-badge.tsx +15 -11
- package/src/components/trust-level-dropdown.tsx +49 -19
- package/src/components/typeahead.tsx +57 -59
- package/src/components/voice-indicator.tsx +158 -141
- package/src/components/voice-subscribe-events.ts +20 -0
- package/src/globals.tsx +42 -40
- package/src/hooks.test.tsx +141 -134
- package/src/hooks.ts +80 -48
- package/src/index.tsx +17 -10
- package/src/mention-configs.ts +122 -68
- package/src/screens/assistants/assistant-config.tsx +28 -18
- package/src/screens/assistants/assistant-details.tsx +35 -36
- package/src/screens/assistants/assistant-info.tsx +16 -11
- package/src/screens/assistants/assistant-list.tsx +37 -34
- package/src/screens/assistants/assistant-tools.tsx +41 -20
- package/src/screens/console-logs/console-logs-list.tsx +173 -140
- package/src/screens/console-logs/log-display.tsx +65 -38
- package/src/screens/console-logs/log-filters.tsx +4 -3
- package/src/screens/console-logs/mobile-log-card.tsx +78 -71
- package/src/screens/console-logs/resizable-table-header.tsx +29 -21
- package/src/screens/contacts/contact-details.tsx +29 -30
- package/src/screens/contacts/contact-list.tsx +71 -60
- package/src/screens/contacts/index.ts +5 -5
- package/src/screens/contacts/user-connect.tsx +177 -171
- package/src/screens/data-explorer/data-explorer.tsx +134 -98
- package/src/screens/data-explorer/index.ts +2 -3
- package/src/screens/data-explorer/query-executor.tsx +90 -80
- package/src/screens/groups/group-details.tsx +120 -101
- package/src/screens/groups/group-invite-listener.tsx +34 -37
- package/src/screens/groups/group-list.tsx +119 -103
- package/src/screens/groups/group-members.tsx +225 -164
- package/src/screens/groups/index.ts +5 -6
- package/src/screens/join-group/index.ts +2 -2
- package/src/screens/join-group/join-group.tsx +41 -39
- package/src/screens/network-viewer/connection-troubleshooter.tsx +145 -104
- package/src/screens/network-viewer/cpu-usage-graph.tsx +39 -43
- package/src/screens/network-viewer/device-details-modal.tsx +46 -59
- package/src/screens/network-viewer/group-details-modal.tsx +68 -49
- package/src/screens/network-viewer/index.ts +4 -5
- package/src/screens/network-viewer/network-viewer-ipc.ts +23 -0
- package/src/screens/network-viewer/network-viewer.tsx +261 -236
- package/src/screens/network-viewer/usage-graph.tsx +57 -49
- package/src/screens/packages/package-details.tsx +43 -35
- package/src/screens/packages/package-info.tsx +107 -66
- package/src/screens/packages/package-list.tsx +175 -98
- package/src/screens/packages/package-new-local.tsx +28 -26
- package/src/screens/packages/package-versions.tsx +102 -77
- package/src/screens/peer-types/peer-type-details.tsx +60 -50
- package/src/screens/peer-types/peer-type-list.tsx +20 -30
- package/src/screens/search/global-search.tsx +153 -137
- package/src/screens/settings/color-mode-dropdown.tsx +52 -35
- package/src/screens/settings/settings-page.tsx +215 -141
- package/src/screens/settings/voice-settings-agent.tsx +13 -12
- package/src/screens/settings/voice-settings-api-keys.tsx +14 -12
- package/src/screens/settings/voice-settings-output.tsx +12 -11
- package/src/screens/settings/voice-settings-providers.tsx +7 -3
- package/src/screens/settings/voice-settings-types.ts +52 -49
- package/src/screens/settings/voice-settings-wake-word.tsx +25 -9
- package/src/screens/settings/voice-settings.tsx +66 -43
- package/src/screens/setup-user.tsx +88 -41
- package/src/screens/tools/tool-code.tsx +12 -17
- package/src/screens/tools/tool-details.tsx +28 -28
- package/src/screens/tools/tool-info.tsx +14 -19
- package/src/screens/tools/tool-list.tsx +58 -40
- package/src/screens/tools/tool-schema.tsx +16 -9
- package/src/screens/tools/tool-test-details.tsx +11 -22
- package/src/screens/tools/tool-test-list.tsx +29 -30
- package/src/screens/variables/variable-details.tsx +63 -51
- package/src/screens/variables/variable-list.tsx +29 -30
- package/src/screens/welcome-modal.tsx +68 -48
- package/src/screens/workflows/workflow-details.tsx +40 -30
- package/src/screens/workflows/workflow-info.tsx +4 -11
- package/src/screens/workflows/workflow-instructions.tsx +35 -28
- package/src/screens/workflows/workflow-list.tsx +50 -40
- package/src/setupTests.ts +14 -13
- package/src/system-apps/assistants.app.ts +5 -5
- package/src/system-apps/console-logs.app.ts +4 -4
- package/src/system-apps/contacts.app.ts +6 -6
- package/src/system-apps/data-explorer.app.ts +5 -5
- package/src/system-apps/groups.app.ts +6 -6
- package/src/system-apps/index.ts +49 -49
- package/src/system-apps/join-group.app.ts +5 -5
- package/src/system-apps/mobile-settings.app.ts +4 -5
- package/src/system-apps/network-viewer.app.ts +5 -5
- package/src/system-apps/packages.app.ts +5 -5
- package/src/system-apps/search.app.ts +6 -6
- package/src/system-apps/settings.app.ts +5 -5
- package/src/system-apps/threads.app.ts +5 -5
- package/src/system-apps/tools.app.ts +5 -5
- package/src/system-apps/types.app.ts +5 -5
- package/src/system-apps/variables.app.ts +5 -5
- package/src/system-apps/workflows.app.ts +5 -5
- package/src/tabs-layout/tabs-layout.tsx +345 -254
- package/src/tabs-layout/tabs-state.ts +100 -81
- package/src/ui-defaults/index.ts +2 -3
- package/src/ui-defaults/list-screen.tsx +45 -40
- package/src/ui-defaults/markdown-field.tsx +22 -26
- package/src/ui-router/routes-loader.ts +40 -24
- package/src/ui-router/ui-loader.tsx +312 -214
- package/src/utils.ts +68 -81
- package/tsconfig.json +5 -10
- package/dist/components/input-datetime.d.ts +0 -7
- package/dist/components/input-datetime.js +0 -35
- package/dist/components/lazy-sortable-list.d.ts +0 -29
- package/dist/components/lazy-sortable-list.js +0 -12
- package/dist/components/left-bar.d.ts +0 -5
- package/dist/components/left-bar.js +0 -207
- package/dist/components/main-content-container.d.ts +0 -2
- package/dist/components/main-content-container.js +0 -92
- package/dist/components/messages/thread-view.d.ts +0 -6
- package/dist/components/messages/thread-view.js +0 -174
- package/dist/components/off-canvas.d.ts +0 -13
- package/dist/components/off-canvas.js +0 -89
- package/dist/components/text-list-editor.tsx/text-list-editor.d.ts +0 -6
- package/dist/components/text-list-editor.tsx/text-list-editor.js +0 -13
- package/dist/components/top-bar.d.ts +0 -2
- package/dist/components/top-bar.js +0 -51
- package/dist/components/typeahead/mentions-plugin.d.ts +0 -7
- package/dist/components/typeahead/mentions-plugin.js +0 -203
- package/dist/components/typeahead/typeahead-editor.d.ts +0 -15
- package/dist/components/typeahead/typeahead-editor.js +0 -134
- package/dist/components/typeahead/typeahead.d.ts +0 -12
- package/dist/components/typeahead/typeahead.js +0 -94
- package/dist/screens/profile.d.ts +0 -2
- package/dist/screens/profile.js +0 -76
- package/src/components/input-datetime.tsx +0 -41
- package/src/components/lazy-sortable-list.tsx +0 -51
- package/src/components/left-bar.tsx +0 -322
- package/src/components/main-content-container.tsx +0 -79
- package/src/components/messages/thread-view.tsx +0 -214
- package/src/components/off-canvas.tsx +0 -83
- package/src/components/text-list-editor.tsx/text-list-editor.tsx +0 -13
- package/src/components/top-bar.tsx +0 -119
- package/src/components/typeahead/mentions-plugin.tsx +0 -265
- package/src/components/typeahead/typeahead-editor.tsx +0 -140
- package/src/components/typeahead/typeahead.tsx +0 -77
- package/src/screens/profile.tsx +0 -75
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
|
|
3
3
|
interface ICpuDataPoint {
|
|
4
4
|
timestamp: number;
|
|
@@ -28,7 +28,7 @@ export function CpuUsageGraph({
|
|
|
28
28
|
fetchCpuUsage,
|
|
29
29
|
durationMinutes = 5,
|
|
30
30
|
updateInterval = 5000,
|
|
31
|
-
minHeight = 80
|
|
31
|
+
minHeight = 80,
|
|
32
32
|
}: ICpuUsageGraphProps) {
|
|
33
33
|
const [dataPoints, setDataPoints] = useState<ICpuDataPoint[]>([]);
|
|
34
34
|
const [currentCpu, setCurrentCpu] = useState<number>(0);
|
|
@@ -72,7 +72,7 @@ export function CpuUsageGraph({
|
|
|
72
72
|
setDataPoints((prev) => {
|
|
73
73
|
const newPoint: ICpuDataPoint = {
|
|
74
74
|
timestamp: Date.now(),
|
|
75
|
-
value: cpuValue
|
|
75
|
+
value: cpuValue,
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
const updated = [...prev, newPoint];
|
|
@@ -85,7 +85,7 @@ export function CpuUsageGraph({
|
|
|
85
85
|
return updated;
|
|
86
86
|
});
|
|
87
87
|
} catch (error) {
|
|
88
|
-
console.error(
|
|
88
|
+
console.error("Error fetching CPU usage:", error);
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
@@ -104,7 +104,7 @@ export function CpuUsageGraph({
|
|
|
104
104
|
|
|
105
105
|
// Calculate SVG path
|
|
106
106
|
const getLinePath = (): string => {
|
|
107
|
-
if (dataPoints.length < 2) return
|
|
107
|
+
if (dataPoints.length < 2) return "";
|
|
108
108
|
|
|
109
109
|
const paddingLeft = 25;
|
|
110
110
|
const paddingRight = 10;
|
|
@@ -129,12 +129,14 @@ export function CpuUsageGraph({
|
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
// Create SVG path
|
|
132
|
-
const pathData = points
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
const pathData = points
|
|
133
|
+
.map((point, idx) => {
|
|
134
|
+
if (idx === 0) {
|
|
135
|
+
return `M ${point.x} ${point.y}`;
|
|
136
|
+
}
|
|
137
|
+
return `L ${point.x} ${point.y}`;
|
|
138
|
+
})
|
|
139
|
+
.join(" ");
|
|
138
140
|
|
|
139
141
|
return pathData;
|
|
140
142
|
};
|
|
@@ -142,7 +144,7 @@ export function CpuUsageGraph({
|
|
|
142
144
|
// Get gradient path for fill
|
|
143
145
|
const getGradientPath = (): string => {
|
|
144
146
|
const linePath = getLinePath();
|
|
145
|
-
if (!linePath) return
|
|
147
|
+
if (!linePath) return "";
|
|
146
148
|
|
|
147
149
|
const paddingLeft = 25;
|
|
148
150
|
const paddingRight = 10;
|
|
@@ -159,16 +161,23 @@ export function CpuUsageGraph({
|
|
|
159
161
|
<div
|
|
160
162
|
ref={containerRef}
|
|
161
163
|
className="cpu-usage-graph"
|
|
162
|
-
style={{
|
|
164
|
+
style={{
|
|
165
|
+
margin: 0,
|
|
166
|
+
padding: 0,
|
|
167
|
+
position: "relative",
|
|
168
|
+
width: "100%",
|
|
169
|
+
height: "100%",
|
|
170
|
+
minHeight: `${minHeight}px`,
|
|
171
|
+
}}
|
|
163
172
|
>
|
|
164
173
|
<svg
|
|
165
174
|
width={width}
|
|
166
175
|
height={height}
|
|
167
176
|
style={{
|
|
168
|
-
border:
|
|
169
|
-
borderRadius:
|
|
170
|
-
backgroundColor:
|
|
171
|
-
display:
|
|
177
|
+
border: "1px solid rgba(128, 128, 128, 0.2)",
|
|
178
|
+
borderRadius: "4px",
|
|
179
|
+
backgroundColor: "rgba(0, 0, 0, 0.02)",
|
|
180
|
+
display: "block",
|
|
172
181
|
}}
|
|
173
182
|
>
|
|
174
183
|
<defs>
|
|
@@ -210,12 +219,7 @@ export function CpuUsageGraph({
|
|
|
210
219
|
})}
|
|
211
220
|
|
|
212
221
|
{/* Fill area under the line */}
|
|
213
|
-
{gradientPath && (
|
|
214
|
-
<path
|
|
215
|
-
d={gradientPath}
|
|
216
|
-
fill="url(#cpuGradient)"
|
|
217
|
-
/>
|
|
218
|
-
)}
|
|
222
|
+
{gradientPath && <path d={gradientPath} fill="url(#cpuGradient)" />}
|
|
219
223
|
|
|
220
224
|
{/* Line */}
|
|
221
225
|
{linePath && (
|
|
@@ -248,15 +252,7 @@ export function CpuUsageGraph({
|
|
|
248
252
|
if (idx !== dataPoints.length - 1) return null;
|
|
249
253
|
|
|
250
254
|
return (
|
|
251
|
-
<circle
|
|
252
|
-
key={idx}
|
|
253
|
-
cx={x}
|
|
254
|
-
cy={y}
|
|
255
|
-
r="3"
|
|
256
|
-
fill="#0d6efd"
|
|
257
|
-
stroke="white"
|
|
258
|
-
strokeWidth="1.5"
|
|
259
|
-
/>
|
|
255
|
+
<circle key={idx} cx={x} cy={y} r="3" fill="#0d6efd" stroke="white" strokeWidth="1.5" />
|
|
260
256
|
);
|
|
261
257
|
})}
|
|
262
258
|
|
|
@@ -277,17 +273,17 @@ export function CpuUsageGraph({
|
|
|
277
273
|
{/* Centered CPU percentage overlay */}
|
|
278
274
|
<div
|
|
279
275
|
style={{
|
|
280
|
-
position:
|
|
281
|
-
top:
|
|
282
|
-
left:
|
|
283
|
-
transform:
|
|
284
|
-
fontSize:
|
|
285
|
-
fontWeight:
|
|
286
|
-
color:
|
|
287
|
-
pointerEvents:
|
|
288
|
-
userSelect:
|
|
289
|
-
textAlign:
|
|
290
|
-
lineHeight:
|
|
276
|
+
position: "absolute",
|
|
277
|
+
top: "50%",
|
|
278
|
+
left: "50%",
|
|
279
|
+
transform: "translate(-50%, -50%)",
|
|
280
|
+
fontSize: "2rem",
|
|
281
|
+
fontWeight: "bold",
|
|
282
|
+
color: "rgba(255, 255, 255, 0.7)",
|
|
283
|
+
pointerEvents: "none",
|
|
284
|
+
userSelect: "none",
|
|
285
|
+
textAlign: "center",
|
|
286
|
+
lineHeight: "1.2",
|
|
291
287
|
}}
|
|
292
288
|
>
|
|
293
289
|
CPU
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { LoadingIndicator } from
|
|
4
|
-
import { TrustLevelBadge } from
|
|
1
|
+
import { TrustLevel } from "@peers-app/peers-sdk";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { LoadingIndicator } from "../../components/loading-indicator";
|
|
4
|
+
import { TrustLevelBadge } from "../../components/trust-level-badge";
|
|
5
|
+
import { getNetworkViewerApi } from "./network-viewer-ipc";
|
|
5
6
|
|
|
6
7
|
/** Format bytes to human-readable string (KB, MB, GB) */
|
|
7
8
|
function formatBytes(bytes: number): string {
|
|
@@ -13,7 +14,7 @@ function formatBytes(bytes: number): string {
|
|
|
13
14
|
|
|
14
15
|
/** Format transfer rate to human-readable string (KB/s or MB/s) */
|
|
15
16
|
function formatRate(mbps: number | undefined): string {
|
|
16
|
-
if (mbps === undefined || mbps === 0) return
|
|
17
|
+
if (mbps === undefined || mbps === 0) return "0 KB/s";
|
|
17
18
|
// Show KB/s if less than 0.1 MB/s (100 KB/s)
|
|
18
19
|
if (mbps < 0.1) {
|
|
19
20
|
const kbps = mbps * 1024;
|
|
@@ -29,14 +30,14 @@ interface IDeviceDetails {
|
|
|
29
30
|
userName?: string;
|
|
30
31
|
deviceName?: string;
|
|
31
32
|
trustLevel: number;
|
|
32
|
-
connectionState:
|
|
33
|
+
connectionState: "connected" | "syncing" | "idle";
|
|
33
34
|
sharedGroups: string[];
|
|
34
|
-
roles:
|
|
35
|
-
pathType:
|
|
35
|
+
roles: Record<string, unknown>;
|
|
36
|
+
pathType: "direct" | "indirect" | "unknown";
|
|
36
37
|
throughDeviceIds?: string[];
|
|
37
38
|
networkInfo?: {
|
|
38
39
|
deviceId: string;
|
|
39
|
-
connections:
|
|
40
|
+
connections: Array<{ deviceId: string; userId: string }>;
|
|
40
41
|
preferredDeviceIds: string[];
|
|
41
42
|
connectionSlotsAvailable: number;
|
|
42
43
|
cpuPercent: number;
|
|
@@ -67,15 +68,18 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
67
68
|
const [loading, setLoading] = useState(true);
|
|
68
69
|
const [notFound, setNotFound] = useState(false);
|
|
69
70
|
|
|
70
|
-
const loadData = async () => {
|
|
71
|
+
const loadData = useCallback(async () => {
|
|
71
72
|
try {
|
|
72
|
-
const api = (
|
|
73
|
+
const api = getNetworkViewerApi();
|
|
73
74
|
if (!api) {
|
|
74
|
-
console.warn(
|
|
75
|
+
console.warn("Network Viewer API not available");
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
const deviceData = await api.getDeviceDetails(deviceId)
|
|
79
|
+
const deviceData = (await api.getDeviceDetails(deviceId)) as
|
|
80
|
+
| IDeviceDetails
|
|
81
|
+
| null
|
|
82
|
+
| undefined;
|
|
79
83
|
|
|
80
84
|
if (!deviceData) {
|
|
81
85
|
setNotFound(true);
|
|
@@ -84,20 +88,20 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
84
88
|
setNotFound(false);
|
|
85
89
|
}
|
|
86
90
|
} catch (error) {
|
|
87
|
-
console.error(
|
|
91
|
+
console.error("Error loading device details:", error);
|
|
88
92
|
setNotFound(true);
|
|
89
93
|
} finally {
|
|
90
94
|
setLoading(false);
|
|
91
95
|
}
|
|
92
|
-
};
|
|
96
|
+
}, [deviceId]);
|
|
93
97
|
|
|
94
98
|
const handleDisconnect = async () => {
|
|
95
|
-
if (!confirm(
|
|
99
|
+
if (!confirm("Are you sure you want to disconnect from this device?")) {
|
|
96
100
|
return;
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
try {
|
|
100
|
-
const api = (
|
|
104
|
+
const api = getNetworkViewerApi();
|
|
101
105
|
if (api && deviceId) {
|
|
102
106
|
await api.disconnectDevice(deviceId);
|
|
103
107
|
if (onDisconnect) {
|
|
@@ -106,7 +110,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
106
110
|
onClose();
|
|
107
111
|
}
|
|
108
112
|
} catch (error) {
|
|
109
|
-
console.error(
|
|
113
|
+
console.error("Error disconnecting device:", error);
|
|
110
114
|
}
|
|
111
115
|
};
|
|
112
116
|
|
|
@@ -115,24 +119,30 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
115
119
|
// Auto-refresh every 5 seconds
|
|
116
120
|
const interval = setInterval(loadData, 5000);
|
|
117
121
|
return () => clearInterval(interval);
|
|
118
|
-
}, [
|
|
122
|
+
}, [loadData]);
|
|
119
123
|
|
|
120
124
|
return (
|
|
121
125
|
<div
|
|
122
126
|
className="position-fixed top-0 start-0 w-100 h-100 d-flex align-items-start justify-content-center"
|
|
123
|
-
style={{
|
|
127
|
+
style={{
|
|
128
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
129
|
+
zIndex: 1050,
|
|
130
|
+
overflowY: "auto",
|
|
131
|
+
paddingTop: "2rem",
|
|
132
|
+
paddingBottom: "2rem",
|
|
133
|
+
}}
|
|
124
134
|
onClick={onClose}
|
|
125
135
|
>
|
|
126
136
|
<div
|
|
127
137
|
className="card"
|
|
128
|
-
style={{ maxWidth:
|
|
138
|
+
style={{ maxWidth: "900px", width: "90%", maxHeight: "90vh" }}
|
|
129
139
|
onClick={(e) => e.stopPropagation()}
|
|
130
140
|
>
|
|
131
141
|
{/* Header */}
|
|
132
142
|
<div className="card-header d-flex justify-content-between align-items-center">
|
|
133
143
|
<div>
|
|
134
144
|
<h5 className="mb-0">
|
|
135
|
-
{loading ?
|
|
145
|
+
{loading ? "Loading..." : device?.userName || device?.userId || "Device Details"}
|
|
136
146
|
</h5>
|
|
137
147
|
{device?.userName && (
|
|
138
148
|
<small className="text-muted">
|
|
@@ -142,10 +152,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
142
152
|
</div>
|
|
143
153
|
<div>
|
|
144
154
|
{device && (
|
|
145
|
-
<button
|
|
146
|
-
className="btn btn-sm btn-danger me-2"
|
|
147
|
-
onClick={handleDisconnect}
|
|
148
|
-
>
|
|
155
|
+
<button className="btn btn-sm btn-danger me-2" onClick={handleDisconnect}>
|
|
149
156
|
<i className="bi bi-x-circle"></i> Disconnect
|
|
150
157
|
</button>
|
|
151
158
|
)}
|
|
@@ -154,7 +161,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
154
161
|
</div>
|
|
155
162
|
|
|
156
163
|
{/* Body */}
|
|
157
|
-
<div className="card-body" style={{ overflowY:
|
|
164
|
+
<div className="card-body" style={{ overflowY: "auto", maxHeight: "calc(90vh - 120px)" }}>
|
|
158
165
|
{loading && <LoadingIndicator />}
|
|
159
166
|
|
|
160
167
|
{!loading && (notFound || !device) && (
|
|
@@ -195,9 +202,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
195
202
|
<strong>Path Type:</strong>
|
|
196
203
|
<br />
|
|
197
204
|
<span
|
|
198
|
-
className={`badge bg-${
|
|
199
|
-
device.pathType === 'direct' ? 'success' : 'info'
|
|
200
|
-
}`}
|
|
205
|
+
className={`badge bg-${device.pathType === "direct" ? "success" : "info"}`}
|
|
201
206
|
>
|
|
202
207
|
{device.pathType}
|
|
203
208
|
</span>
|
|
@@ -206,9 +211,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
206
211
|
<div className="col-md-12 mb-3">
|
|
207
212
|
<strong>Path:</strong>
|
|
208
213
|
<br />
|
|
209
|
-
<small className="text-muted">
|
|
210
|
-
{device.throughDeviceIds.join(' → ')}
|
|
211
|
-
</small>
|
|
214
|
+
<small className="text-muted">{device.throughDeviceIds.join(" → ")}</small>
|
|
212
215
|
</div>
|
|
213
216
|
)}
|
|
214
217
|
</div>
|
|
@@ -221,16 +224,12 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
221
224
|
<div className="col-md-6 mb-3">
|
|
222
225
|
<strong>Send Rate:</strong>
|
|
223
226
|
<br />
|
|
224
|
-
<span className="text-success">
|
|
225
|
-
↑ {formatRate(device.sendRateMBps)}
|
|
226
|
-
</span>
|
|
227
|
+
<span className="text-success">↑ {formatRate(device.sendRateMBps)}</span>
|
|
227
228
|
</div>
|
|
228
229
|
<div className="col-md-6 mb-3">
|
|
229
230
|
<strong>Receive Rate:</strong>
|
|
230
231
|
<br />
|
|
231
|
-
<span className="text-primary">
|
|
232
|
-
↓ {formatRate(device.receiveRateMBps)}
|
|
233
|
-
</span>
|
|
232
|
+
<span className="text-primary">↓ {formatRate(device.receiveRateMBps)}</span>
|
|
234
233
|
</div>
|
|
235
234
|
<div className="col-md-6 mb-3">
|
|
236
235
|
<strong>Total Sent:</strong>
|
|
@@ -269,19 +268,15 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
269
268
|
<td>
|
|
270
269
|
<code className="text-muted small">{groupId}</code>
|
|
271
270
|
</td>
|
|
272
|
-
<td>{role
|
|
271
|
+
<td>{role != null ? String(role) : "N/A"}</td>
|
|
273
272
|
<td>
|
|
274
273
|
{syncStats ? (
|
|
275
274
|
<>
|
|
276
275
|
{syncStats.isPreferred && (
|
|
277
|
-
<span className="badge bg-primary me-2">
|
|
278
|
-
Preferred
|
|
279
|
-
</span>
|
|
276
|
+
<span className="badge bg-primary me-2">Preferred</span>
|
|
280
277
|
)}
|
|
281
278
|
<small className="text-muted">
|
|
282
|
-
{new Date(
|
|
283
|
-
syncStats.lastSyncTime
|
|
284
|
-
).toLocaleString()}
|
|
279
|
+
{new Date(syncStats.lastSyncTime).toLocaleString()}
|
|
285
280
|
</small>
|
|
286
281
|
</>
|
|
287
282
|
) : (
|
|
@@ -305,23 +300,17 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
305
300
|
<div className="col-md-3 mb-3">
|
|
306
301
|
<strong>CPU Usage:</strong>
|
|
307
302
|
<br />
|
|
308
|
-
<span className="h5">
|
|
309
|
-
{device.networkInfo.cpuPercent.toFixed(1)}%
|
|
310
|
-
</span>
|
|
303
|
+
<span className="h5">{device.networkInfo.cpuPercent.toFixed(1)}%</span>
|
|
311
304
|
</div>
|
|
312
305
|
<div className="col-md-3 mb-3">
|
|
313
306
|
<strong>Memory Usage:</strong>
|
|
314
307
|
<br />
|
|
315
|
-
<span className="h5">
|
|
316
|
-
{device.networkInfo.memPercent.toFixed(1)}%
|
|
317
|
-
</span>
|
|
308
|
+
<span className="h5">{device.networkInfo.memPercent.toFixed(1)}%</span>
|
|
318
309
|
</div>
|
|
319
310
|
<div className="col-md-3 mb-3">
|
|
320
311
|
<strong>Connection Slots:</strong>
|
|
321
312
|
<br />
|
|
322
|
-
<span className="h5">
|
|
323
|
-
{device.networkInfo.connectionSlotsAvailable}
|
|
324
|
-
</span>
|
|
313
|
+
<span className="h5">{device.networkInfo.connectionSlotsAvailable}</span>
|
|
325
314
|
</div>
|
|
326
315
|
<div className="col-md-3 mb-3">
|
|
327
316
|
<strong>Total Connections:</strong>
|
|
@@ -345,9 +334,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
345
334
|
|
|
346
335
|
{device.networkInfo.connections.length > 0 && (
|
|
347
336
|
<div>
|
|
348
|
-
<strong>
|
|
349
|
-
Remote Connections ({device.networkInfo.connections.length}):
|
|
350
|
-
</strong>
|
|
337
|
+
<strong>Remote Connections ({device.networkInfo.connections.length}):</strong>
|
|
351
338
|
<div className="table-responsive mt-2">
|
|
352
339
|
<table className="table table-sm table-hover">
|
|
353
340
|
<thead>
|
|
@@ -357,7 +344,7 @@ export function DeviceDetailsModal({ deviceId, onClose, onDisconnect }: IDeviceD
|
|
|
357
344
|
</tr>
|
|
358
345
|
</thead>
|
|
359
346
|
<tbody>
|
|
360
|
-
{device.networkInfo.connections.map((conn
|
|
347
|
+
{device.networkInfo.connections.map((conn, idx: number) => (
|
|
361
348
|
<tr key={idx}>
|
|
362
349
|
<td>
|
|
363
350
|
<code className="text-muted small">{conn.deviceId}</code>
|