@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 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 =
|
|
75
|
-
overlayTextColor =
|
|
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
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
|
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
|
-
:
|
|
296
|
+
: "rgba(13, 110, 253, 0.3)";
|
|
293
297
|
const gradientColorLight = rgbaMatch
|
|
294
298
|
? `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, 0.05)`
|
|
295
|
-
:
|
|
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={{
|
|
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:
|
|
308
|
-
borderRadius:
|
|
309
|
-
backgroundColor:
|
|
310
|
-
display:
|
|
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:
|
|
428
|
-
top:
|
|
429
|
-
left:
|
|
430
|
-
transform:
|
|
431
|
-
fontSize:
|
|
432
|
-
fontWeight:
|
|
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:
|
|
435
|
-
userSelect:
|
|
436
|
-
textAlign:
|
|
437
|
-
lineHeight:
|
|
438
|
-
whiteSpace:
|
|
439
|
-
maxWidth:
|
|
440
|
-
overflowWrap:
|
|
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
|
|
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(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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[
|
|
37
|
+
const addActions: ISaveButtonProps["addActions"] = [
|
|
36
38
|
{
|
|
37
|
-
label:
|
|
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:
|
|
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, {
|
|
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=
|
|
76
|
-
style={{ width:
|
|
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:
|
|
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:
|
|
110
|
+
name: "Versions",
|
|
111
|
+
content: (
|
|
107
112
|
<ScreenTabBody>
|
|
108
113
|
<PackageVersionsList pkg={pkg} />
|
|
109
114
|
</ScreenTabBody>
|
|
115
|
+
),
|
|
110
116
|
},
|
|
111
117
|
{
|
|
112
|
-
name:
|
|
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:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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 {
|
|
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>(
|
|
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(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
|
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
|
|
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
|
-
>
|
|
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
|
-
{
|
|
159
|
+
{remoteRepoUrl ? (
|
|
124
160
|
<div className="mt-2">
|
|
125
161
|
<small>
|
|
126
162
|
Source URL:
|
|
127
163
|
<small>
|
|
128
|
-
<Tooltip
|
|
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(
|
|
170
|
+
rpcServerCalls.openLinkInBrowser(remoteRepoUrl);
|
|
133
171
|
}}
|
|
134
|
-
>
|
|
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
|
|
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">
|
|
160
|
-
|
|
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
|
|
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 ||
|
|
221
|
+
value={versionFollowRange || "latest"}
|
|
180
222
|
onChange={(e) => {
|
|
181
|
-
const val = e.target.value as
|
|
182
|
-
pkg.versionFollowRange = 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 ?
|
|
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 ||
|
|
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
|
|
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
|
+
};
|