@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,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
workflowMentionConfig,
|
|
1
|
+
import type { IAppNav, IMentionData } from "@peers-app/peers-sdk";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useObservable } from "../../hooks";
|
|
4
|
+
import {
|
|
5
|
+
assistantMentionConfig,
|
|
6
|
+
type IMentionConfig,
|
|
7
|
+
toolMentionConfig,
|
|
8
|
+
userMentionConfig,
|
|
10
9
|
valueTypeMentionConfig,
|
|
11
|
-
|
|
12
|
-
} from
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
10
|
+
workflowMentionConfig,
|
|
11
|
+
} from "../../mention-configs";
|
|
12
|
+
import { systemPackage } from "../../system-apps";
|
|
13
|
+
import { goToTabPath } from "../../tabs-layout/tabs-state";
|
|
14
|
+
import { allPackages } from "../../ui-router/routes-loader";
|
|
15
|
+
import { colorMode } from "../settings/color-mode-dropdown";
|
|
16
16
|
|
|
17
17
|
interface SearchResult {
|
|
18
18
|
config: IMentionConfig;
|
|
@@ -30,16 +30,28 @@ interface AppSearchItem {
|
|
|
30
30
|
iconClassName: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const searchConfigs: Array<{
|
|
34
|
+
config: IMentionConfig;
|
|
35
|
+
category: string;
|
|
36
|
+
navigationPath: string;
|
|
37
|
+
}> = [
|
|
38
|
+
{ config: toolMentionConfig, category: "Tools", navigationPath: "tools" },
|
|
39
|
+
{ config: assistantMentionConfig, category: "Assistants", navigationPath: "assistants" },
|
|
40
|
+
{ config: workflowMentionConfig, category: "Workflows", navigationPath: "workflows" },
|
|
41
|
+
{ config: valueTypeMentionConfig, category: "Types", navigationPath: "peer-types" },
|
|
42
|
+
{ config: userMentionConfig, category: "Users", navigationPath: "contacts" },
|
|
43
|
+
];
|
|
44
|
+
|
|
33
45
|
export function GlobalSearch() {
|
|
34
46
|
const [_colorMode] = useObservable(colorMode);
|
|
35
47
|
const [packages] = useObservable(allPackages);
|
|
36
|
-
const [searchQuery, setSearchQuery] = useState(
|
|
48
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
37
49
|
const [searchResults, setSearchResults] = useState<SearchResult[]>([]);
|
|
38
50
|
const [appResults, setAppResults] = useState<AppSearchItem[]>([]);
|
|
39
51
|
const [isSearching, setIsSearching] = useState(false);
|
|
40
52
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
41
|
-
|
|
42
|
-
const isDark = _colorMode ===
|
|
53
|
+
|
|
54
|
+
const isDark = _colorMode === "dark";
|
|
43
55
|
|
|
44
56
|
// Focus search input on mount
|
|
45
57
|
useEffect(() => {
|
|
@@ -48,30 +60,23 @@ export function GlobalSearch() {
|
|
|
48
60
|
}
|
|
49
61
|
}, []);
|
|
50
62
|
|
|
51
|
-
// Search configs with their display names
|
|
52
|
-
const searchConfigs: Array<{ config: IMentionConfig; category: string; navigationPath: string }> = [
|
|
53
|
-
{ config: toolMentionConfig, category: 'Tools', navigationPath: 'tools' },
|
|
54
|
-
{ config: assistantMentionConfig, category: 'Assistants', navigationPath: 'assistants' },
|
|
55
|
-
{ config: workflowMentionConfig, category: 'Workflows', navigationPath: 'workflows' },
|
|
56
|
-
{ config: valueTypeMentionConfig, category: 'Types', navigationPath: 'peer-types' },
|
|
57
|
-
{ config: userMentionConfig, category: 'Users', navigationPath: 'profile' },
|
|
58
|
-
];
|
|
59
|
-
|
|
60
63
|
// Get all apps (system and user)
|
|
61
|
-
const getAllApps = (): AppSearchItem[] => {
|
|
64
|
+
const getAllApps = useCallback((): AppSearchItem[] => {
|
|
62
65
|
const allPackages_ = [...packages, systemPackage];
|
|
63
66
|
return allPackages_
|
|
64
|
-
.filter(p => !p.disabled && p.appNavs && p.appNavs.length > 0)
|
|
65
|
-
.flatMap(pkg =>
|
|
66
|
-
pkg.appNavs
|
|
67
|
+
.filter((p) => !p.disabled && p.appNavs && p.appNavs.length > 0)
|
|
68
|
+
.flatMap((pkg) => {
|
|
69
|
+
const navs = pkg.appNavs;
|
|
70
|
+
if (!navs?.length) return [];
|
|
71
|
+
return navs.map((navItem) => {
|
|
67
72
|
// Construct path - use direct path for system apps, package-nav for others
|
|
68
73
|
let path: string;
|
|
69
|
-
if (pkg.packageId ===
|
|
70
|
-
path = navItem.navigationPath ?? navItem.name.replace(/\s/g,
|
|
74
|
+
if (pkg.packageId === "system-apps") {
|
|
75
|
+
path = navItem.navigationPath ?? navItem.name.replace(/\s/g, "-").toLowerCase();
|
|
71
76
|
} else {
|
|
72
|
-
path = `package-nav/${pkg.packageId}/${(navItem.navigationPath ?? navItem.name).replace(/[^a-zA-Z0-9]/g,
|
|
73
|
-
while (path.includes(
|
|
74
|
-
path = path.replace(
|
|
77
|
+
path = `package-nav/${pkg.packageId}/${(navItem.navigationPath ?? navItem.name).replace(/[^a-zA-Z0-9]/g, "-").toLowerCase()}`;
|
|
78
|
+
while (path.includes("//")) {
|
|
79
|
+
path = path.replace("//", "/");
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -82,11 +87,11 @@ export function GlobalSearch() {
|
|
|
82
87
|
path,
|
|
83
88
|
name: navItem.name,
|
|
84
89
|
displayName: navItem.displayName || navItem.name,
|
|
85
|
-
iconClassName: navItem.iconClassName ||
|
|
90
|
+
iconClassName: navItem.iconClassName || "bi-box-seam",
|
|
86
91
|
};
|
|
87
|
-
})
|
|
88
|
-
);
|
|
89
|
-
};
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}, [packages]);
|
|
90
95
|
|
|
91
96
|
// Debounced search effect
|
|
92
97
|
useEffect(() => {
|
|
@@ -115,16 +120,17 @@ export function GlobalSearch() {
|
|
|
115
120
|
|
|
116
121
|
const searchResults = await Promise.all(searchPromises);
|
|
117
122
|
const filteredResults = searchResults.filter(Boolean) as SearchResult[];
|
|
118
|
-
|
|
123
|
+
|
|
119
124
|
setSearchResults(filteredResults);
|
|
120
125
|
|
|
121
126
|
// Search apps
|
|
122
127
|
const allApps = getAllApps();
|
|
123
128
|
const lowerQuery = searchQuery.toLowerCase();
|
|
124
|
-
const filteredApps = allApps.filter(
|
|
125
|
-
app
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
const filteredApps = allApps.filter(
|
|
130
|
+
(app) =>
|
|
131
|
+
app.name.toLowerCase().includes(lowerQuery) ||
|
|
132
|
+
app.displayName.toLowerCase().includes(lowerQuery) ||
|
|
133
|
+
app.packageName.toLowerCase().includes(lowerQuery),
|
|
128
134
|
);
|
|
129
135
|
setAppResults(filteredApps);
|
|
130
136
|
} finally {
|
|
@@ -133,7 +139,7 @@ export function GlobalSearch() {
|
|
|
133
139
|
}, 300); // 300ms debounce
|
|
134
140
|
|
|
135
141
|
return () => clearTimeout(timeoutId);
|
|
136
|
-
}, [searchQuery,
|
|
142
|
+
}, [searchQuery, getAllApps]);
|
|
137
143
|
|
|
138
144
|
const handleItemClick = (result: SearchResult, item: IMentionData) => {
|
|
139
145
|
// Try using the config's onClick first
|
|
@@ -142,16 +148,10 @@ export function GlobalSearch() {
|
|
|
142
148
|
return;
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
//
|
|
146
|
-
const configPath = searchConfigs.find(c => c.config === result.config)?.navigationPath;
|
|
151
|
+
// Detail route under the same system app as list (e.g. tools/:id, contacts/:userId).
|
|
152
|
+
const configPath = searchConfigs.find((c) => c.config === result.config)?.navigationPath;
|
|
147
153
|
if (configPath) {
|
|
148
|
-
|
|
149
|
-
// Special case for users - just go to profile for now
|
|
150
|
-
goToTabPath('profile');
|
|
151
|
-
} else {
|
|
152
|
-
// Navigate to the detail page if possible
|
|
153
|
-
goToTabPath(`${configPath}/${item.id}`);
|
|
154
|
-
}
|
|
154
|
+
goToTabPath(`${configPath}/${item.id}`);
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
157
|
|
|
@@ -159,69 +159,70 @@ export function GlobalSearch() {
|
|
|
159
159
|
goToTabPath(app.path);
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
const totalResults =
|
|
162
|
+
const totalResults =
|
|
163
|
+
searchResults.reduce((sum, result) => sum + result.items.length, 0) + appResults.length;
|
|
163
164
|
|
|
164
165
|
return (
|
|
165
|
-
<div className="container-fluid h-100 p-4" style={{ maxHeight:
|
|
166
|
+
<div className="container-fluid h-100 p-4" style={{ maxHeight: "100vh", overflowY: "auto" }}>
|
|
166
167
|
{/* Search Header */}
|
|
167
168
|
<div className="mb-4">
|
|
168
169
|
<h1 className="h3 mb-3 d-flex align-items-center">
|
|
169
170
|
<i className="bi-search me-3" />
|
|
170
171
|
Search Everything
|
|
171
172
|
</h1>
|
|
172
|
-
|
|
173
|
+
|
|
173
174
|
{/* Search Input */}
|
|
174
175
|
<div className="position-relative">
|
|
175
|
-
<i
|
|
176
|
-
className="bi-search position-absolute"
|
|
176
|
+
<i
|
|
177
|
+
className="bi-search position-absolute"
|
|
177
178
|
style={{
|
|
178
|
-
left:
|
|
179
|
-
top:
|
|
180
|
-
transform:
|
|
181
|
-
color:
|
|
179
|
+
left: "16px",
|
|
180
|
+
top: "50%",
|
|
181
|
+
transform: "translateY(-50%)",
|
|
182
|
+
color: "#6c757d",
|
|
182
183
|
zIndex: 1,
|
|
183
|
-
fontSize:
|
|
184
|
-
}}
|
|
184
|
+
fontSize: "18px",
|
|
185
|
+
}}
|
|
185
186
|
/>
|
|
186
187
|
<input
|
|
187
188
|
ref={inputRef}
|
|
188
189
|
type="text"
|
|
189
|
-
className={`form-control form-control-lg ${isDark ?
|
|
190
|
+
className={`form-control form-control-lg ${isDark ? "bg-dark text-light border-secondary" : ""}`}
|
|
190
191
|
placeholder="Search across apps, tools, assistants, workflows, and more..."
|
|
191
192
|
value={searchQuery}
|
|
192
193
|
onChange={(e) => setSearchQuery(e.target.value)}
|
|
193
194
|
style={{
|
|
194
|
-
paddingLeft:
|
|
195
|
-
fontSize:
|
|
196
|
-
borderRadius:
|
|
197
|
-
backgroundColor: isDark ?
|
|
198
|
-
border: isDark ?
|
|
195
|
+
paddingLeft: "50px",
|
|
196
|
+
fontSize: "18px",
|
|
197
|
+
borderRadius: "12px",
|
|
198
|
+
backgroundColor: isDark ? "#343a40" : "#f8f9fa",
|
|
199
|
+
border: isDark ? "2px solid #495057" : "2px solid #dee2e6",
|
|
199
200
|
}}
|
|
200
201
|
/>
|
|
201
202
|
{isSearching && (
|
|
202
|
-
<div
|
|
203
|
+
<div
|
|
203
204
|
className="position-absolute"
|
|
204
205
|
style={{
|
|
205
|
-
right:
|
|
206
|
-
top:
|
|
207
|
-
transform:
|
|
206
|
+
right: "16px",
|
|
207
|
+
top: "50%",
|
|
208
|
+
transform: "translateY(-50%)",
|
|
208
209
|
}}
|
|
209
210
|
>
|
|
210
211
|
<div className="spinner-border spinner-border-sm text-muted" />
|
|
211
212
|
</div>
|
|
212
213
|
)}
|
|
213
214
|
</div>
|
|
214
|
-
|
|
215
|
+
|
|
215
216
|
{/* Search Stats */}
|
|
216
217
|
{searchQuery && (
|
|
217
218
|
<div className="mt-3 text-muted small">
|
|
218
|
-
{isSearching
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
{isSearching
|
|
220
|
+
? "Searching..."
|
|
221
|
+
: totalResults > 0
|
|
222
|
+
? `Found ${totalResults} result${totalResults !== 1 ? "s" : ""}`
|
|
223
|
+
: searchQuery.trim()
|
|
224
|
+
? "No results found"
|
|
225
|
+
: null}
|
|
225
226
|
</div>
|
|
226
227
|
)}
|
|
227
228
|
</div>
|
|
@@ -231,11 +232,9 @@ export function GlobalSearch() {
|
|
|
231
232
|
<div>
|
|
232
233
|
{searchResults.length === 0 && appResults.length === 0 ? (
|
|
233
234
|
<div className="text-center py-5">
|
|
234
|
-
<i className="bi-search mb-3 d-block text-muted" style={{ fontSize:
|
|
235
|
+
<i className="bi-search mb-3 d-block text-muted" style={{ fontSize: "48px" }} />
|
|
235
236
|
<h4 className="text-muted">No results found</h4>
|
|
236
|
-
<p className="text-muted">
|
|
237
|
-
Try different keywords or check your spelling
|
|
238
|
-
</p>
|
|
237
|
+
<p className="text-muted">Try different keywords or check your spelling</p>
|
|
239
238
|
</div>
|
|
240
239
|
) : (
|
|
241
240
|
<div>
|
|
@@ -243,51 +242,61 @@ export function GlobalSearch() {
|
|
|
243
242
|
{appResults.length > 0 && (
|
|
244
243
|
<div className="mb-5">
|
|
245
244
|
<div className="d-flex align-items-center mb-3">
|
|
246
|
-
<i
|
|
245
|
+
<i
|
|
246
|
+
className="bi-grid-3x3-gap me-3"
|
|
247
|
+
style={{ fontSize: "20px", color: "#6c757d" }}
|
|
248
|
+
/>
|
|
247
249
|
<h4 className="mb-0 me-3">Apps</h4>
|
|
248
250
|
<span className="badge bg-secondary">{appResults.length}</span>
|
|
249
251
|
</div>
|
|
250
252
|
<div className="row g-3">
|
|
251
253
|
{appResults.map((app) => (
|
|
252
|
-
<div
|
|
254
|
+
<div
|
|
255
|
+
key={`${app.packageId}-${app.path}`}
|
|
256
|
+
className="col-12 col-md-6 col-lg-4"
|
|
257
|
+
>
|
|
253
258
|
<div
|
|
254
|
-
className={`card h-100 ${isDark ?
|
|
259
|
+
className={`card h-100 ${isDark ? "bg-dark border-secondary" : "bg-light"}`}
|
|
255
260
|
style={{
|
|
256
|
-
cursor:
|
|
257
|
-
transition:
|
|
258
|
-
borderRadius:
|
|
261
|
+
cursor: "pointer",
|
|
262
|
+
transition: "all 0.15s ease",
|
|
263
|
+
borderRadius: "8px",
|
|
259
264
|
}}
|
|
260
265
|
onClick={() => handleAppClick(app)}
|
|
261
266
|
onMouseEnter={(e) => {
|
|
262
|
-
e.currentTarget.style.transform =
|
|
263
|
-
e.currentTarget.style.boxShadow = isDark
|
|
264
|
-
?
|
|
265
|
-
:
|
|
267
|
+
e.currentTarget.style.transform = "translateY(-2px)";
|
|
268
|
+
e.currentTarget.style.boxShadow = isDark
|
|
269
|
+
? "0 4px 12px rgba(0,0,0,0.3)"
|
|
270
|
+
: "0 4px 12px rgba(0,0,0,0.1)";
|
|
266
271
|
}}
|
|
267
272
|
onMouseLeave={(e) => {
|
|
268
|
-
e.currentTarget.style.transform =
|
|
269
|
-
e.currentTarget.style.boxShadow =
|
|
273
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
274
|
+
e.currentTarget.style.boxShadow = "none";
|
|
270
275
|
}}
|
|
271
276
|
>
|
|
272
277
|
<div className="card-body p-3">
|
|
273
278
|
<div className="d-flex align-items-start">
|
|
274
|
-
<i
|
|
279
|
+
<i
|
|
275
280
|
className={`${app.iconClassName} me-3 mt-1`}
|
|
276
|
-
style={{
|
|
277
|
-
fontSize:
|
|
278
|
-
color: isDark ?
|
|
279
|
-
minWidth:
|
|
281
|
+
style={{
|
|
282
|
+
fontSize: "16px",
|
|
283
|
+
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
284
|
+
minWidth: "16px",
|
|
280
285
|
}}
|
|
281
286
|
/>
|
|
282
287
|
<div className="flex-grow-1">
|
|
283
|
-
<h6 className="card-title mb-1 fw-medium">
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
<h6 className="card-title mb-1 fw-medium">{app.displayName}</h6>
|
|
289
|
+
<small
|
|
290
|
+
className="text-muted text-uppercase"
|
|
291
|
+
style={{ fontSize: "11px", letterSpacing: "0.5px" }}
|
|
292
|
+
>
|
|
293
|
+
{app.packageId === "system-apps" ? "System App" : app.packageName}
|
|
288
294
|
</small>
|
|
289
295
|
</div>
|
|
290
|
-
<i
|
|
296
|
+
<i
|
|
297
|
+
className="bi-arrow-right text-muted"
|
|
298
|
+
style={{ fontSize: "12px" }}
|
|
299
|
+
/>
|
|
291
300
|
</div>
|
|
292
301
|
</div>
|
|
293
302
|
</div>
|
|
@@ -302,7 +311,10 @@ export function GlobalSearch() {
|
|
|
302
311
|
<div key={result.category} className="mb-5">
|
|
303
312
|
{/* Category Header */}
|
|
304
313
|
<div className="d-flex align-items-center mb-3">
|
|
305
|
-
<i
|
|
314
|
+
<i
|
|
315
|
+
className={`${result.config.iconClass} me-3`}
|
|
316
|
+
style={{ fontSize: "20px", color: "#6c757d" }}
|
|
317
|
+
/>
|
|
306
318
|
<h4 className="mb-0 me-3">{result.category}</h4>
|
|
307
319
|
<span className="badge bg-secondary">{result.items.length}</span>
|
|
308
320
|
</div>
|
|
@@ -312,43 +324,47 @@ export function GlobalSearch() {
|
|
|
312
324
|
{result.items.map((item) => (
|
|
313
325
|
<div key={item.id} className="col-12 col-md-6 col-lg-4">
|
|
314
326
|
<div
|
|
315
|
-
className={`card h-100 ${isDark ?
|
|
327
|
+
className={`card h-100 ${isDark ? "bg-dark border-secondary" : "bg-light"}`}
|
|
316
328
|
style={{
|
|
317
|
-
cursor:
|
|
318
|
-
transition:
|
|
319
|
-
borderRadius:
|
|
329
|
+
cursor: "pointer",
|
|
330
|
+
transition: "all 0.15s ease",
|
|
331
|
+
borderRadius: "8px",
|
|
320
332
|
}}
|
|
321
333
|
onClick={() => handleItemClick(result, item)}
|
|
322
334
|
onMouseEnter={(e) => {
|
|
323
|
-
e.currentTarget.style.transform =
|
|
324
|
-
e.currentTarget.style.boxShadow = isDark
|
|
325
|
-
?
|
|
326
|
-
:
|
|
335
|
+
e.currentTarget.style.transform = "translateY(-2px)";
|
|
336
|
+
e.currentTarget.style.boxShadow = isDark
|
|
337
|
+
? "0 4px 12px rgba(0,0,0,0.3)"
|
|
338
|
+
: "0 4px 12px rgba(0,0,0,0.1)";
|
|
327
339
|
}}
|
|
328
340
|
onMouseLeave={(e) => {
|
|
329
|
-
e.currentTarget.style.transform =
|
|
330
|
-
e.currentTarget.style.boxShadow =
|
|
341
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
342
|
+
e.currentTarget.style.boxShadow = "none";
|
|
331
343
|
}}
|
|
332
344
|
>
|
|
333
345
|
<div className="card-body p-3">
|
|
334
346
|
<div className="d-flex align-items-start">
|
|
335
|
-
<i
|
|
347
|
+
<i
|
|
336
348
|
className={`${result.config.iconClass} me-3 mt-1`}
|
|
337
|
-
style={{
|
|
338
|
-
fontSize:
|
|
339
|
-
color: isDark ?
|
|
340
|
-
minWidth:
|
|
349
|
+
style={{
|
|
350
|
+
fontSize: "16px",
|
|
351
|
+
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
352
|
+
minWidth: "16px",
|
|
341
353
|
}}
|
|
342
354
|
/>
|
|
343
355
|
<div className="flex-grow-1">
|
|
344
|
-
<h6 className="card-title mb-1 fw-medium">
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
356
|
+
<h6 className="card-title mb-1 fw-medium">{item.name}</h6>
|
|
357
|
+
<small
|
|
358
|
+
className="text-muted text-uppercase"
|
|
359
|
+
style={{ fontSize: "11px", letterSpacing: "0.5px" }}
|
|
360
|
+
>
|
|
348
361
|
{result.category.slice(0, -1)}
|
|
349
362
|
</small>
|
|
350
363
|
</div>
|
|
351
|
-
<i
|
|
364
|
+
<i
|
|
365
|
+
className="bi-arrow-right text-muted"
|
|
366
|
+
style={{ fontSize: "12px" }}
|
|
367
|
+
/>
|
|
352
368
|
</div>
|
|
353
369
|
</div>
|
|
354
370
|
</div>
|
|
@@ -365,17 +381,17 @@ export function GlobalSearch() {
|
|
|
365
381
|
{/* Initial State */}
|
|
366
382
|
{!searchQuery && (
|
|
367
383
|
<div className="text-center py-5">
|
|
368
|
-
<i className="bi-search mb-3 d-block text-muted" style={{ fontSize:
|
|
384
|
+
<i className="bi-search mb-3 d-block text-muted" style={{ fontSize: "64px" }} />
|
|
369
385
|
<h3 className="text-muted mb-3">Search across everything</h3>
|
|
370
|
-
<p className="text-muted mb-4" style={{ maxWidth:
|
|
386
|
+
<p className="text-muted mb-4" style={{ maxWidth: "400px", margin: "0 auto" }}>
|
|
371
387
|
Find apps, tools, assistants, workflows, types, and users all in one place.
|
|
372
388
|
</p>
|
|
373
389
|
<div className="d-flex flex-wrap justify-content-center gap-2">
|
|
374
390
|
{searchConfigs.map(({ config, category }) => (
|
|
375
|
-
<span
|
|
391
|
+
<span
|
|
376
392
|
key={category}
|
|
377
|
-
className={`badge ${isDark ?
|
|
378
|
-
style={{ fontSize:
|
|
393
|
+
className={`badge ${isDark ? "bg-secondary" : "bg-light text-dark"} px-3 py-2 d-flex align-items-center`}
|
|
394
|
+
style={{ fontSize: "12px" }}
|
|
379
395
|
>
|
|
380
396
|
<i className={`${config.iconClass} me-2`} />
|
|
381
397
|
{category}
|
|
@@ -386,4 +402,4 @@ export function GlobalSearch() {
|
|
|
386
402
|
)}
|
|
387
403
|
</div>
|
|
388
404
|
);
|
|
389
|
-
}
|
|
405
|
+
}
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import { camelCaseToSpaces, deviceVar } from "@peers-app/peers-sdk";
|
|
2
|
-
import
|
|
3
|
-
import { useObservable } from '../../hooks';
|
|
2
|
+
import { useObservable } from "../../hooks";
|
|
4
3
|
|
|
5
|
-
export type ColorModePreference =
|
|
6
|
-
export type ColorMode =
|
|
4
|
+
export type ColorModePreference = "light" | "dark" | "auto";
|
|
5
|
+
export type ColorMode = "light" | "dark";
|
|
7
6
|
|
|
8
|
-
export const colorMode = deviceVar<ColorMode>(
|
|
9
|
-
defaultValue:
|
|
7
|
+
export const colorMode = deviceVar<ColorMode>("colorMode", {
|
|
8
|
+
defaultValue: "dark",
|
|
10
9
|
});
|
|
11
10
|
|
|
12
|
-
export const colorModePreference = deviceVar<ColorModePreference>(
|
|
13
|
-
defaultValue:
|
|
11
|
+
export const colorModePreference = deviceVar<ColorModePreference>("colorModePreference", {
|
|
12
|
+
defaultValue: "dark",
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
function applyColorMode(modePreference?: ColorModePreference): ColorMode {
|
|
17
16
|
if (!modePreference) {
|
|
18
|
-
modePreference = colorModePreference() ||
|
|
17
|
+
modePreference = colorModePreference() || "dark";
|
|
19
18
|
} else {
|
|
20
19
|
colorModePreference(modePreference);
|
|
21
20
|
}
|
|
22
21
|
let mode = colorMode();
|
|
23
|
-
if (modePreference ===
|
|
24
|
-
const isDarkMode = window.matchMedia
|
|
25
|
-
mode = isDarkMode ?
|
|
22
|
+
if (modePreference === "auto") {
|
|
23
|
+
const isDarkMode = window.matchMedia?.("(prefers-color-scheme: dark)").matches;
|
|
24
|
+
mode = isDarkMode ? "dark" : "light";
|
|
26
25
|
} else {
|
|
27
26
|
mode = modePreference;
|
|
28
27
|
}
|
|
29
|
-
document.documentElement.setAttribute(
|
|
30
|
-
if (mode ===
|
|
31
|
-
document.documentElement.style.backgroundColor =
|
|
32
|
-
document.body.style.backgroundColor =
|
|
28
|
+
document.documentElement.setAttribute("data-bs-theme", mode);
|
|
29
|
+
if (mode === "light") {
|
|
30
|
+
document.documentElement.style.backgroundColor = "";
|
|
31
|
+
document.body.style.backgroundColor = "initial";
|
|
33
32
|
} else {
|
|
34
|
-
document.documentElement.style.backgroundColor =
|
|
35
|
-
document.body.style.backgroundColor =
|
|
33
|
+
document.documentElement.style.backgroundColor = "rgb(33, 37, 41)";
|
|
34
|
+
document.body.style.backgroundColor = "rgb(33, 37, 41)";
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
const themeMeta = document.querySelector('meta[name="theme-color"]');
|
|
39
38
|
if (themeMeta) {
|
|
40
|
-
themeMeta.setAttribute(
|
|
39
|
+
themeMeta.setAttribute("content", mode === "light" ? "#ffffff" : "#212529");
|
|
41
40
|
}
|
|
42
41
|
colorMode(mode);
|
|
43
42
|
colorMode.notifySubscribers();
|
|
@@ -45,21 +44,39 @@ function applyColorMode(modePreference?: ColorModePreference): ColorMode {
|
|
|
45
44
|
return mode;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
colorModePreference.subscribe(newValue => applyColorMode(newValue));
|
|
47
|
+
colorModePreference.subscribe((newValue) => applyColorMode(newValue));
|
|
49
48
|
|
|
50
49
|
export const ColorModeDropdown = () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
const [modePreference] = useObservable(colorModePreference);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="dropdown">
|
|
54
|
+
<button
|
|
55
|
+
className="btn btn-secondary dropdown-toggle"
|
|
56
|
+
type="button"
|
|
57
|
+
id="colorModeDropdown"
|
|
58
|
+
data-bs-toggle="dropdown"
|
|
59
|
+
aria-expanded="false"
|
|
60
|
+
>
|
|
61
|
+
Color Mode: {camelCaseToSpaces(modePreference)}
|
|
62
|
+
</button>
|
|
63
|
+
<ul className="dropdown-menu" aria-labelledby="colorModeDropdown">
|
|
64
|
+
<li>
|
|
65
|
+
<button className="dropdown-item" onClick={() => colorModePreference("auto")}>
|
|
66
|
+
Auto {modePreference === "auto" && "✓"}
|
|
67
|
+
</button>
|
|
68
|
+
</li>
|
|
69
|
+
<li>
|
|
70
|
+
<button className="dropdown-item" onClick={() => colorModePreference("light")}>
|
|
71
|
+
Light {modePreference === "light" && "✓"}
|
|
72
|
+
</button>
|
|
73
|
+
</li>
|
|
74
|
+
<li>
|
|
75
|
+
<button className="dropdown-item" onClick={() => colorModePreference("dark")}>
|
|
76
|
+
Dark {modePreference === "dark" && "✓"}
|
|
77
|
+
</button>
|
|
78
|
+
</li>
|
|
79
|
+
</ul>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|