@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
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.TabsLayoutApp = TabsLayoutApp;
|
|
37
37
|
exports.TabsLayout = TabsLayout;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
39
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
39
40
|
const react_1 = __importStar(require("react"));
|
|
40
41
|
const command_palette_1 = require("../command-palette/command-palette");
|
|
@@ -63,13 +64,12 @@ class TabErrorBoundary extends react_1.Component {
|
|
|
63
64
|
}
|
|
64
65
|
render() {
|
|
65
66
|
if (this.state.hasError) {
|
|
66
|
-
return (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
react_1.default.createElement("button", { className: "btn btn-outline-primary btn-sm", onClick: () => this.setState({ hasError: false, error: null }) }, "Try Again")));
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { padding: "24px", textAlign: "center" }, children: [(0, jsx_runtime_1.jsxs)("h4", { style: { marginBottom: "12px" }, children: ["Something went wrong in \"", this.props.tabTitle, "\""] }), (0, jsx_runtime_1.jsx)("p", { style: {
|
|
68
|
+
opacity: 0.7,
|
|
69
|
+
marginBottom: "16px",
|
|
70
|
+
fontFamily: "monospace",
|
|
71
|
+
fontSize: "13px",
|
|
72
|
+
}, children: this.state.error?.message || "Unknown error" }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-outline-primary btn-sm", onClick: () => this.setState({ hasError: false, error: null }), children: "Try Again" })] }));
|
|
73
73
|
}
|
|
74
74
|
return this.props.children;
|
|
75
75
|
}
|
|
@@ -83,11 +83,11 @@ function TabsLayoutApp() {
|
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
if (!userId) {
|
|
86
|
-
document.getElementById(
|
|
87
|
-
return
|
|
86
|
+
document.getElementById("appLoadingDiv")?.remove();
|
|
87
|
+
return (0, jsx_runtime_1.jsx)(setup_user_1.SetupUser, {});
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
|
-
return
|
|
90
|
+
return (0, jsx_runtime_1.jsx)(TabsLayout, { userId: userId });
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
let userContextInitialized = false;
|
|
@@ -117,23 +117,20 @@ function TabsLayout(props) {
|
|
|
117
117
|
}, [loaded]);
|
|
118
118
|
if (!loaded)
|
|
119
119
|
return false;
|
|
120
|
-
document.getElementById(
|
|
121
|
-
return (
|
|
122
|
-
react_1.default.createElement(TabsLayoutInternal, null),
|
|
123
|
-
react_1.default.createElement(command_palette_ui_1.CommandPaletteOverlay, null),
|
|
124
|
-
showWelcomeModal && (react_1.default.createElement(welcome_modal_1.WelcomeModal, { colorMode: _colorMode, onClose: () => setShowWelcomeModal(false) }))));
|
|
120
|
+
document.getElementById("appLoadingDiv")?.remove();
|
|
121
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TabsLayoutInternal, {}), (0, jsx_runtime_1.jsx)(command_palette_ui_1.CommandPaletteOverlay, {}), showWelcomeModal && ((0, jsx_runtime_1.jsx)(welcome_modal_1.WelcomeModal, { colorMode: _colorMode, onClose: () => setShowWelcomeModal(false) }))] }));
|
|
125
122
|
}
|
|
126
123
|
function TabsLayoutInternal() {
|
|
127
124
|
const [_colorMode] = (0, hooks_1.useObservable)(color_mode_dropdown_1.colorMode);
|
|
128
125
|
const [tabs] = (0, hooks_1.useObservable)(tabs_state_1.activeTabs);
|
|
129
126
|
const [activeTab] = (0, hooks_1.useObservable)(tabs_state_1.activeTabId);
|
|
130
|
-
const [currentlyActiveGroupId, setCurrentlyActiveGroupId] = (0, react_1.useState)(
|
|
127
|
+
const [currentlyActiveGroupId, setCurrentlyActiveGroupId] = (0, react_1.useState)("");
|
|
131
128
|
const [switchingGroup, setSwitchingGroup] = (0, react_1.useState)(false);
|
|
132
129
|
(0, react_1.useEffect)(() => {
|
|
133
130
|
let sub;
|
|
134
|
-
(0, peers_sdk_1.getUserContext)().then(userContext => {
|
|
131
|
+
(0, peers_sdk_1.getUserContext)().then((userContext) => {
|
|
135
132
|
setCurrentlyActiveGroupId(userContext.currentlyActiveGroupId() || userContext.userId);
|
|
136
|
-
sub = userContext.currentlyActiveGroupId.subscribe(async (
|
|
133
|
+
sub = userContext.currentlyActiveGroupId.subscribe(async (_groupId) => {
|
|
137
134
|
setCurrentlyActiveGroupId(userContext.currentlyActiveGroupId() || userContext.userId);
|
|
138
135
|
setSwitchingGroup(true);
|
|
139
136
|
await userContext.waitForActiveGroupPersistence();
|
|
@@ -151,16 +148,16 @@ function TabsLayoutInternal() {
|
|
|
151
148
|
const isMobile = !(0, globals_1.isDesktop)();
|
|
152
149
|
const closeTab = (tabId) => {
|
|
153
150
|
const currentTabs = (0, tabs_state_1.activeTabs)();
|
|
154
|
-
const tabToClose = currentTabs.find(t => t.tabId === tabId);
|
|
151
|
+
const tabToClose = currentTabs.find((t) => t.tabId === tabId);
|
|
155
152
|
if (!tabToClose || tabToClose.tabId === "launcher")
|
|
156
153
|
return;
|
|
157
|
-
const closedIndex = currentTabs.findIndex(t => t.tabId === tabId);
|
|
158
|
-
const newTabs = currentTabs.filter(t => t.tabId !== tabId);
|
|
154
|
+
const closedIndex = currentTabs.findIndex((t) => t.tabId === tabId);
|
|
155
|
+
const newTabs = currentTabs.filter((t) => t.tabId !== tabId);
|
|
159
156
|
(0, tabs_state_1.activeTabs)(newTabs);
|
|
160
157
|
tabs_state_1.initializedTabs.delete(tabId);
|
|
161
158
|
if (activeTab === tabId) {
|
|
162
159
|
if (newTabs.length === 0) {
|
|
163
|
-
(0, tabs_state_1.activeTabId)(
|
|
160
|
+
(0, tabs_state_1.activeTabId)("launcher");
|
|
164
161
|
}
|
|
165
162
|
else if (closedIndex < newTabs.length) {
|
|
166
163
|
(0, tabs_state_1.activeTabId)(newTabs[closedIndex].tabId);
|
|
@@ -173,133 +170,119 @@ function TabsLayoutInternal() {
|
|
|
173
170
|
const switchTab = (tabId) => {
|
|
174
171
|
(0, tabs_state_1.activeTabId)(tabId);
|
|
175
172
|
};
|
|
176
|
-
return (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
react_1.default.createElement("div", { className: "d-flex flex-grow-1 overflow-auto", style: {
|
|
206
|
-
scrollbarWidth: 'none',
|
|
207
|
-
msOverflowStyle: 'none'
|
|
208
|
-
} }, tabs.map(tab => (react_1.default.createElement(TabHeader, { key: tab.tabId, tab: tab, isActive: activeTab === tab.tabId, onSwitch: switchTab, onClose: closeTab, colorMode: _colorMode }))))))),
|
|
209
|
-
react_1.default.createElement("div", { className: "flex-grow-1 overflow-hidden" }, tabs.map(tab => (react_1.default.createElement("div", { key: tab.tabId, className: `h-100 ${activeTab === tab.tabId ? 'd-block' : 'd-none'}`, style: { display: activeTab === tab.tabId ? 'block' : 'none' } },
|
|
210
|
-
react_1.default.createElement(TabErrorBoundary, { tabTitle: tab.title, tabId: tab.tabId },
|
|
211
|
-
react_1.default.createElement(TabContent, { tab: tab, isMobile: isMobile, isActive: activeTab === tab.tabId }))))))));
|
|
173
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-column", style: { height: "calc(100vh - 25px)", overflow: "hidden" }, children: [switchingGroup && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
174
|
+
position: "fixed",
|
|
175
|
+
inset: 0,
|
|
176
|
+
zIndex: 9999,
|
|
177
|
+
display: "flex",
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
justifyContent: "center",
|
|
180
|
+
backgroundColor: _colorMode === "light" ? "rgba(255,255,255,0.85)" : "rgba(0,0,0,0.85)",
|
|
181
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "spinner-border text-secondary mb-3", role: "status" }), (0, jsx_runtime_1.jsx)("div", { className: `small ${_colorMode === "light" ? "text-muted" : "text-secondary"}`, children: "Switching group..." })] }) })), (0, jsx_runtime_1.jsx)("div", { className: `border-bottom ${_colorMode === "light" ? "bg-light" : "bg-dark"}`, style: {
|
|
182
|
+
borderBottomWidth: "1px",
|
|
183
|
+
borderBottomColor: _colorMode === "light" ? "#dee2e6" : "#495057",
|
|
184
|
+
}, children: isMobile ? ((0, jsx_runtime_1.jsx)(MobileTabsHeader, { tabs: tabs, activeTab: activeTab, onSwitch: switchTab, onClose: closeTab, colorMode: _colorMode })) : ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center px-1", style: { height: "36px" }, children: [(0, jsx_runtime_1.jsx)(group_switcher_1.GroupSwitcher, { colorMode: _colorMode, isMobile: false }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm me-2 d-flex align-items-center", onClick: command_palette_1.openCommandPalette, title: "Search everything (Cmd+K)", style: {
|
|
185
|
+
padding: "4px 8px",
|
|
186
|
+
fontSize: "12px",
|
|
187
|
+
borderRadius: "6px",
|
|
188
|
+
border: "none",
|
|
189
|
+
background: "transparent",
|
|
190
|
+
color: _colorMode === "light" ? "#6c757d" : "#adb5bd",
|
|
191
|
+
}, onMouseEnter: (e) => {
|
|
192
|
+
e.currentTarget.style.backgroundColor =
|
|
193
|
+
_colorMode === "light" ? "#f8f9fa" : "#495057";
|
|
194
|
+
e.currentTarget.style.color = _colorMode === "light" ? "#0d6efd" : "#ffffff";
|
|
195
|
+
}, onMouseLeave: (e) => {
|
|
196
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
197
|
+
e.currentTarget.style.color = _colorMode === "light" ? "#6c757d" : "#adb5bd";
|
|
198
|
+
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-search", style: { fontSize: "14px" } }) }), (0, jsx_runtime_1.jsx)("div", { className: "d-flex flex-grow-1 overflow-auto", style: {
|
|
199
|
+
scrollbarWidth: "none",
|
|
200
|
+
msOverflowStyle: "none",
|
|
201
|
+
}, children: tabs.map((tab) => ((0, jsx_runtime_1.jsx)(TabHeader, { tab: tab, isActive: activeTab === tab.tabId, onSwitch: switchTab, onClose: closeTab, colorMode: _colorMode }, tab.tabId))) })] })) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow-1 overflow-hidden", children: tabs.map((tab) => ((0, jsx_runtime_1.jsx)("div", { className: `h-100 ${activeTab === tab.tabId ? "d-block" : "d-none"}`, style: { display: activeTab === tab.tabId ? "block" : "none" }, children: (0, jsx_runtime_1.jsx)(TabErrorBoundary, { tabTitle: tab.title, tabId: tab.tabId, children: (0, jsx_runtime_1.jsx)(TabContent, { tab: tab, isMobile: isMobile, isActive: activeTab === tab.tabId }) }) }, tab.tabId))) })] }, currentlyActiveGroupId));
|
|
212
202
|
}
|
|
213
|
-
function MobileTabsHeader({ tabs, activeTab, onSwitch, onClose, colorMode }) {
|
|
203
|
+
function MobileTabsHeader({ tabs, activeTab, onSwitch, onClose, colorMode, }) {
|
|
214
204
|
const [showMenuDropdown, setShowMenuDropdown] = react_1.default.useState(false);
|
|
215
|
-
const currentTab = tabs.find(t => t.tabId === activeTab);
|
|
216
|
-
const nonLauncherTabs = tabs.filter(t => t.packageId !==
|
|
217
|
-
return (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
react_1.default.createElement("span", null, "Search")),
|
|
246
|
-
nonLauncherTabs.length > 0 && (react_1.default.createElement("div", { className: "dropdown-divider", style: { margin: '8px 0' } })),
|
|
247
|
-
nonLauncherTabs.slice().reverse().map(tab => (react_1.default.createElement("div", { key: tab.tabId, className: `dropdown-item d-flex align-items-center justify-content-between ${activeTab === tab.tabId ? 'active' : ''}`, style: { cursor: 'pointer', padding: '14px 18px', fontSize: '17px' }, onClick: () => {
|
|
248
|
-
onSwitch(tab.tabId);
|
|
249
|
-
setShowMenuDropdown(false);
|
|
250
|
-
} },
|
|
251
|
-
react_1.default.createElement("div", { className: "d-flex align-items-center" },
|
|
252
|
-
tab.iconClassName && react_1.default.createElement("i", { className: `${tab.iconClassName} me-3`, style: { fontSize: '20px' } }),
|
|
253
|
-
react_1.default.createElement("span", null, tab.title)),
|
|
254
|
-
react_1.default.createElement("button", { className: "btn btn-sm p-0 ms-3", style: { width: '32px', height: '32px', fontSize: '20px' }, onClick: (e) => {
|
|
255
|
-
e.stopPropagation();
|
|
256
|
-
onClose(tab.tabId);
|
|
257
|
-
} },
|
|
258
|
-
react_1.default.createElement("i", { className: "bi-x" }))))))))),
|
|
259
|
-
showMenuDropdown && (react_1.default.createElement("div", { className: "position-fixed w-100 h-100", style: { top: 0, left: 0, zIndex: 999 }, onClick: () => setShowMenuDropdown(false) }))));
|
|
205
|
+
const currentTab = tabs.find((t) => t.tabId === activeTab);
|
|
206
|
+
const nonLauncherTabs = tabs.filter((t) => t.packageId !== "launcher");
|
|
207
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-between px-2 position-relative", style: { height: "36px" }, children: [(0, jsx_runtime_1.jsx)("div", { className: "d-flex align-items-center gap-1", children: (0, jsx_runtime_1.jsx)(group_switcher_1.GroupSwitcher, { colorMode: colorMode, isMobile: true }) }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-center position-absolute", style: {
|
|
208
|
+
left: "50%",
|
|
209
|
+
transform: "translateX(-50%)",
|
|
210
|
+
pointerEvents: "none",
|
|
211
|
+
maxWidth: "calc(100% - 140px)",
|
|
212
|
+
}, children: [currentTab?.iconClassName && currentTab.packageId !== "launcher" && ((0, jsx_runtime_1.jsx)("i", { className: `${currentTab.iconClassName} me-2` })), (0, jsx_runtime_1.jsx)("span", { className: "fw-medium text-truncate small", children: currentTab?.title || "Apps" })] }), (0, jsx_runtime_1.jsx)("div", { className: "d-flex align-items-center", children: (0, jsx_runtime_1.jsxs)("div", { className: "dropdown", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", className: `btn btn-sm ${colorMode === "light" ? "btn-outline-dark" : "btn-outline-light"}`, onClick: () => setShowMenuDropdown(!showMenuDropdown), style: { minWidth: "36px" }, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-list" }), nonLauncherTabs.length > 0 && (0, jsx_runtime_1.jsx)("span", { className: "ms-1", children: nonLauncherTabs.length })] }), showMenuDropdown && ((0, jsx_runtime_1.jsxs)("div", { className: `dropdown-menu show position-absolute ${colorMode === "light" ? "" : "dropdown-menu-dark"}`, style: {
|
|
213
|
+
right: 0,
|
|
214
|
+
top: "100%",
|
|
215
|
+
zIndex: 1000,
|
|
216
|
+
minWidth: "280px",
|
|
217
|
+
maxHeight: "calc(100vh - 60px)",
|
|
218
|
+
overflowY: "auto",
|
|
219
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: `dropdown-item d-flex align-items-center ${activeTab === "launcher" ? "active" : ""}`, style: { cursor: "pointer", padding: "14px 18px", fontSize: "17px" }, onClick: () => {
|
|
220
|
+
onSwitch("launcher");
|
|
221
|
+
setShowMenuDropdown(false);
|
|
222
|
+
}, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-grid-3x3-gap me-3", style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("span", { children: "Apps" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dropdown-item d-flex align-items-center", style: { cursor: "pointer", padding: "14px 18px", fontSize: "17px" }, onClick: () => {
|
|
223
|
+
(0, command_palette_1.openCommandPalette)();
|
|
224
|
+
setShowMenuDropdown(false);
|
|
225
|
+
}, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-search me-3", style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("span", { children: "Search" })] }), nonLauncherTabs.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "dropdown-divider", style: { margin: "8px 0" } })), nonLauncherTabs
|
|
226
|
+
.slice()
|
|
227
|
+
.reverse()
|
|
228
|
+
.map((tab) => ((0, jsx_runtime_1.jsxs)("div", { className: `dropdown-item d-flex align-items-center justify-content-between ${activeTab === tab.tabId ? "active" : ""}`, style: { cursor: "pointer", padding: "14px 18px", fontSize: "17px" }, onClick: () => {
|
|
229
|
+
onSwitch(tab.tabId);
|
|
230
|
+
setShowMenuDropdown(false);
|
|
231
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center", children: [tab.iconClassName && ((0, jsx_runtime_1.jsx)("i", { className: `${tab.iconClassName} me-3`, style: { fontSize: "20px" } })), (0, jsx_runtime_1.jsx)("span", { children: tab.title })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm p-0 ms-3", style: { width: "32px", height: "32px", fontSize: "20px" }, onClick: (e) => {
|
|
232
|
+
e.stopPropagation();
|
|
233
|
+
onClose(tab.tabId);
|
|
234
|
+
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-x" }) })] }, tab.tabId)))] }))] }) }), showMenuDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "position-fixed w-100 h-100", style: { top: 0, left: 0, zIndex: 999 }, onClick: () => setShowMenuDropdown(false) }))] }));
|
|
260
235
|
}
|
|
261
236
|
function TabHeader({ tab, isActive, onSwitch, onClose, colorMode }) {
|
|
262
237
|
const activeClass = isActive
|
|
263
|
-
?
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
238
|
+
? colorMode === "light"
|
|
239
|
+
? "bg-white"
|
|
240
|
+
: "bg-secondary"
|
|
241
|
+
: colorMode === "light"
|
|
242
|
+
? "bg-light"
|
|
243
|
+
: "bg-dark";
|
|
244
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `d-flex align-items-center px-2 py-1 user-select-none ${activeClass}`, style: {
|
|
245
|
+
cursor: "pointer",
|
|
246
|
+
minWidth: "100px",
|
|
247
|
+
maxWidth: "180px",
|
|
248
|
+
height: "34px",
|
|
249
|
+
fontSize: "13px",
|
|
250
|
+
borderTop: isActive ? "2px solid #0d6efd" : "2px solid transparent",
|
|
251
|
+
borderLeft: "1px solid transparent",
|
|
252
|
+
borderRight: `1px solid ${colorMode === "light" ? "#dee2e6" : "#495057"}`,
|
|
253
|
+
borderBottom: isActive
|
|
254
|
+
? colorMode === "light"
|
|
255
|
+
? "1px solid white"
|
|
256
|
+
: "1px solid #343a40"
|
|
257
|
+
: "none",
|
|
258
|
+
marginBottom: isActive ? "-1px" : "0",
|
|
259
|
+
borderRadius: isActive ? "6px 6px 0 0" : "0",
|
|
260
|
+
transition: "all 0.15s ease",
|
|
278
261
|
zIndex: isActive ? 1 : 0,
|
|
279
|
-
boxShadow: isActive ?
|
|
262
|
+
boxShadow: isActive ? "0 2px 4px rgba(0,0,0,0.1)" : "none",
|
|
280
263
|
}, onMouseEnter: (e) => {
|
|
281
264
|
if (!isActive) {
|
|
282
|
-
e.currentTarget.style.backgroundColor = colorMode ===
|
|
265
|
+
e.currentTarget.style.backgroundColor = colorMode === "light" ? "#f8f9fa" : "#495057";
|
|
283
266
|
}
|
|
284
267
|
}, onMouseLeave: (e) => {
|
|
285
268
|
if (!isActive) {
|
|
286
|
-
e.currentTarget.style.backgroundColor = colorMode ===
|
|
269
|
+
e.currentTarget.style.backgroundColor = colorMode === "light" ? "#f1f3f4" : "#343a40";
|
|
287
270
|
}
|
|
288
|
-
}, onClick: () => onSwitch(tab.tabId) },
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
e
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
271
|
+
}, onClick: () => onSwitch(tab.tabId), children: [tab.iconClassName && (0, jsx_runtime_1.jsx)("i", { className: `${tab.iconClassName} me-2` }), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate", style: { maxWidth: "120px", fontSize: "12px" }, children: tab.title }), tab.tabId !== "launcher" && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn p-0 ms-1 opacity-75 hover-opacity-100", style: {
|
|
272
|
+
width: "14px",
|
|
273
|
+
height: "14px",
|
|
274
|
+
fontSize: "11px",
|
|
275
|
+
border: "none",
|
|
276
|
+
background: "none",
|
|
277
|
+
borderRadius: "2px",
|
|
278
|
+
}, onMouseEnter: (e) => {
|
|
279
|
+
e.currentTarget.style.backgroundColor = "rgba(0,0,0,0.1)";
|
|
280
|
+
}, onMouseLeave: (e) => {
|
|
281
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
282
|
+
}, onClick: (e) => {
|
|
283
|
+
e.stopPropagation();
|
|
284
|
+
onClose(tab.tabId);
|
|
285
|
+
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-x" }) }))] }));
|
|
303
286
|
}
|
|
304
287
|
function TabContent({ tab, isMobile, isActive }) {
|
|
305
288
|
// Only render content if this tab is active OR has been previously initialized
|
|
@@ -313,157 +296,143 @@ function TabContent({ tab, isMobile, isActive }) {
|
|
|
313
296
|
if (!shouldRender) {
|
|
314
297
|
return null;
|
|
315
298
|
}
|
|
316
|
-
return
|
|
299
|
+
return (0, jsx_runtime_1.jsx)(TabContentRenderer, { tab: tab, isMobile: isMobile });
|
|
317
300
|
}
|
|
318
301
|
// Create individual tab content components that don't re-render
|
|
319
302
|
const TabContentRenderer = react_1.default.memo(({ tab, isMobile }) => {
|
|
320
|
-
if (tab.packageId ===
|
|
321
|
-
return
|
|
303
|
+
if (tab.packageId === "launcher") {
|
|
304
|
+
return (0, jsx_runtime_1.jsx)(AppLauncherTab, { isMobile: isMobile });
|
|
322
305
|
}
|
|
323
306
|
// System apps use the main Router (which reads from mainContentPath)
|
|
324
307
|
// Package apps use UIRouter with explicit path
|
|
325
|
-
const isSystemApp = tab.packageId ===
|
|
326
|
-
return (
|
|
308
|
+
const isSystemApp = tab.packageId === "system-apps";
|
|
309
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `h-100 overflow-auto ${isMobile ? "p-2" : "p-3"}`, children: isSystemApp ? ((0, jsx_runtime_1.jsx)(router_1.Router, { path: tab.path })) : ((0, jsx_runtime_1.jsx)(ui_loader_1.UIRouter, { path: tab.path, uiCategory: "screen", props: {} })) }));
|
|
327
310
|
}, (prevProps, nextProps) => {
|
|
328
311
|
// Only re-render if the tab or isMobile changed
|
|
329
|
-
return prevProps.tab.tabId === nextProps.tab.tabId &&
|
|
312
|
+
return (prevProps.tab.tabId === nextProps.tab.tabId &&
|
|
330
313
|
prevProps.tab.path === nextProps.tab.path &&
|
|
331
|
-
prevProps.isMobile === nextProps.isMobile;
|
|
314
|
+
prevProps.isMobile === nextProps.isMobile);
|
|
332
315
|
});
|
|
333
316
|
function AppLauncherTab({ isMobile }) {
|
|
334
317
|
const [packages] = (0, hooks_1.useObservable)(routes_loader_1.allPackages);
|
|
335
318
|
const [recentApps] = (0, hooks_1.useObservable)(tabs_state_1.recentlyUsedApps);
|
|
336
|
-
const [searchTerm, setSearchTerm] = react_1.default.useState(
|
|
319
|
+
const [searchTerm, setSearchTerm] = react_1.default.useState("");
|
|
337
320
|
// Combine regular packages with system apps package
|
|
338
321
|
const allPackages_ = [...packages, system_apps_1.systemPackage];
|
|
339
322
|
// Create app items from nav items in packages
|
|
340
323
|
const allApps = allPackages_
|
|
341
|
-
.filter(p => !p.disabled && p.appNavs && p.appNavs.length > 0)
|
|
342
|
-
.flatMap(pkg =>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
path
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
while (path.includes('//')) {
|
|
353
|
-
path = path.replace('//', '/');
|
|
324
|
+
.filter((p) => !p.disabled && p.appNavs && p.appNavs.length > 0)
|
|
325
|
+
.flatMap((pkg) => {
|
|
326
|
+
const navs = pkg.appNavs;
|
|
327
|
+
if (!navs)
|
|
328
|
+
return [];
|
|
329
|
+
return navs.map((navItem) => {
|
|
330
|
+
// Construct path - use direct path for system apps, package-nav for others
|
|
331
|
+
let path;
|
|
332
|
+
if (pkg.packageId === "system-apps") {
|
|
333
|
+
// System apps use direct routing (like the original left bar)
|
|
334
|
+
path = navItem.navigationPath ?? navItem.name.replace(/\s/g, "-").toLowerCase();
|
|
354
335
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
336
|
+
else {
|
|
337
|
+
// Regular packages use package-nav format
|
|
338
|
+
path = `package-nav/${pkg.packageId}/${(navItem.navigationPath ?? navItem.name).replace(/[^a-zA-Z0-9]/g, "-").toLowerCase()}`;
|
|
339
|
+
while (path.includes("//")) {
|
|
340
|
+
path = path.replace("//", "/");
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
packageId: pkg.packageId,
|
|
345
|
+
packageName: pkg.name,
|
|
346
|
+
navItem,
|
|
347
|
+
path,
|
|
348
|
+
name: navItem.name,
|
|
349
|
+
displayName: navItem.displayName || navItem.name,
|
|
350
|
+
iconClassName: navItem.iconClassName || "bi-box-seam",
|
|
351
|
+
};
|
|
352
|
+
});
|
|
353
|
+
});
|
|
366
354
|
// Filter apps based on search term
|
|
367
355
|
const filteredApps = searchTerm.trim()
|
|
368
|
-
? allApps.filter(app => app.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
356
|
+
? allApps.filter((app) => app.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
369
357
|
app.displayName.toLowerCase().includes(searchTerm.toLowerCase()))
|
|
370
358
|
: allApps;
|
|
371
359
|
// Categorize filtered apps by package ID
|
|
372
|
-
const systemApps = filteredApps.filter(app => app.packageId ===
|
|
373
|
-
const userApps = filteredApps.filter(app => app.packageId !==
|
|
360
|
+
const systemApps = filteredApps.filter((app) => app.packageId === "system-apps");
|
|
361
|
+
const userApps = filteredApps.filter((app) => app.packageId !== "system-apps");
|
|
374
362
|
// Get recently used apps by matching paths (only show if they match search)
|
|
375
363
|
const recentAppItems = recentApps
|
|
376
|
-
.map(path => filteredApps.find(app => app.path === path))
|
|
364
|
+
.map((path) => filteredApps.find((app) => app.path === path))
|
|
377
365
|
.filter(Boolean);
|
|
378
366
|
const openApp = (appItem) => {
|
|
379
367
|
// Check if this is the mobile-settings app and we're in React Native
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
type: 'navigate',
|
|
387
|
-
path: 'mobile-settings'
|
|
368
|
+
const w = window;
|
|
369
|
+
if (appItem.path === "mobile-settings" && typeof w.__NATIVE_THEME !== "undefined") {
|
|
370
|
+
if (w.ReactNativeWebView) {
|
|
371
|
+
w.ReactNativeWebView.postMessage(JSON.stringify({
|
|
372
|
+
type: "navigate",
|
|
373
|
+
path: "mobile-settings",
|
|
388
374
|
}));
|
|
389
375
|
}
|
|
390
376
|
else {
|
|
391
|
-
|
|
392
|
-
window.location.href = 'peers://mobile-settings';
|
|
377
|
+
window.location.href = "peers://mobile-settings";
|
|
393
378
|
}
|
|
394
379
|
return;
|
|
395
380
|
}
|
|
396
381
|
(0, tabs_state_1.goToTabPath)(appItem.path);
|
|
397
382
|
};
|
|
398
|
-
return (
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
transform: 'translateY(-50%)',
|
|
416
|
-
border: 'none',
|
|
417
|
-
background: 'none',
|
|
418
|
-
color: '#6c757d'
|
|
419
|
-
}, onClick: () => setSearchTerm('') },
|
|
420
|
-
react_1.default.createElement("i", { className: "bi-x" }))))),
|
|
421
|
-
recentAppItems.length > 0 && (react_1.default.createElement(AppSection, { title: "Recently Used", iconClassName: "bi-clock", apps: recentAppItems, onOpenApp: openApp, isMobile: isMobile })),
|
|
422
|
-
userApps.length > 0 && (react_1.default.createElement(AppSection, { title: "User Apps", iconClassName: "bi-person", apps: userApps, onOpenApp: openApp, isMobile: isMobile })),
|
|
423
|
-
systemApps.length > 0 && (react_1.default.createElement(AppSection, { title: "System Apps", iconClassName: "bi-gear", apps: systemApps, onOpenApp: openApp, isMobile: isMobile }))));
|
|
383
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `container-fluid ${isMobile ? "p-2" : "p-4"}`, style: { maxHeight: "100%", overflowY: "auto" }, children: [(0, jsx_runtime_1.jsx)("div", { className: isMobile ? "mb-3" : "mb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "position-relative", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-search position-absolute", style: {
|
|
384
|
+
left: "12px",
|
|
385
|
+
top: "50%",
|
|
386
|
+
transform: "translateY(-50%)",
|
|
387
|
+
color: "#6c757d",
|
|
388
|
+
zIndex: 1,
|
|
389
|
+
} }), (0, jsx_runtime_1.jsx)("input", { type: "text", className: "form-control", placeholder: "Search apps...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), style: {
|
|
390
|
+
paddingLeft: "40px",
|
|
391
|
+
fontSize: isMobile ? "14px" : "15px",
|
|
392
|
+
} }), searchTerm && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm position-absolute", style: {
|
|
393
|
+
right: "8px",
|
|
394
|
+
top: "50%",
|
|
395
|
+
transform: "translateY(-50%)",
|
|
396
|
+
border: "none",
|
|
397
|
+
background: "none",
|
|
398
|
+
color: "#6c757d",
|
|
399
|
+
}, onClick: () => setSearchTerm(""), children: (0, jsx_runtime_1.jsx)("i", { className: "bi-x" }) }))] }) }), recentAppItems.length > 0 && ((0, jsx_runtime_1.jsx)(AppSection, { title: "Recently Used", iconClassName: "bi-clock", apps: recentAppItems, onOpenApp: openApp, isMobile: isMobile })), userApps.length > 0 && ((0, jsx_runtime_1.jsx)(AppSection, { title: "User Apps", iconClassName: "bi-person", apps: userApps, onOpenApp: openApp, isMobile: isMobile })), systemApps.length > 0 && ((0, jsx_runtime_1.jsx)(AppSection, { title: "System Apps", iconClassName: "bi-gear", apps: systemApps, onOpenApp: openApp, isMobile: isMobile }))] }));
|
|
424
400
|
}
|
|
425
401
|
function AppSection({ title, iconClassName, apps, onOpenApp, isMobile }) {
|
|
426
|
-
return (
|
|
427
|
-
react_1.default.createElement("h4", { className: `${isMobile ? 'mb-3 h5' : 'mb-3'}` },
|
|
428
|
-
react_1.default.createElement("i", { className: `${iconClassName} me-2` }),
|
|
429
|
-
title),
|
|
430
|
-
react_1.default.createElement("div", { className: `d-flex flex-wrap ${isMobile ? 'gap-3' : 'gap-4'}`, style: { gap: isMobile ? '16px' : '20px' } }, apps.map(app => (react_1.default.createElement(AppCard, { key: `${app.packageId}-${app.path}`, appItem: app, onOpenApp: onOpenApp, isMobile: isMobile }))))));
|
|
402
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5", children: [(0, jsx_runtime_1.jsxs)("h4", { className: `${isMobile ? "mb-3 h5" : "mb-3"}`, children: [(0, jsx_runtime_1.jsx)("i", { className: `${iconClassName} me-2` }), title] }), (0, jsx_runtime_1.jsx)("div", { className: `d-flex flex-wrap ${isMobile ? "gap-3" : "gap-4"}`, style: { gap: isMobile ? "16px" : "20px" }, children: apps.map((app) => ((0, jsx_runtime_1.jsx)(AppCard, { appItem: app, onOpenApp: onOpenApp, isMobile: isMobile }, `${app.packageId}-${app.path}`))) })] }));
|
|
431
403
|
}
|
|
432
404
|
function AppCard({ appItem, onOpenApp, isMobile }) {
|
|
433
405
|
const [_colorMode] = (0, hooks_1.useObservable)(color_mode_dropdown_1.colorMode);
|
|
434
|
-
const isDark = _colorMode ===
|
|
435
|
-
return (
|
|
436
|
-
cursor:
|
|
437
|
-
width: isMobile ?
|
|
438
|
-
transition:
|
|
439
|
-
background:
|
|
440
|
-
border:
|
|
406
|
+
const isDark = _colorMode === "dark";
|
|
407
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: "d-flex flex-column align-items-center text-center", style: {
|
|
408
|
+
cursor: "pointer",
|
|
409
|
+
width: isMobile ? "80px" : "90px",
|
|
410
|
+
transition: "all 0.15s ease",
|
|
411
|
+
background: "none",
|
|
412
|
+
border: "none",
|
|
441
413
|
padding: 0,
|
|
442
414
|
}, title: appItem.name, onMouseEnter: (e) => {
|
|
443
|
-
e.currentTarget.style.transform =
|
|
415
|
+
e.currentTarget.style.transform = "scale(1.05)";
|
|
444
416
|
}, onMouseLeave: (e) => {
|
|
445
|
-
e.currentTarget.style.transform =
|
|
446
|
-
}, onClick: () => onOpenApp(appItem)
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
textOverflow: 'ellipsis',
|
|
467
|
-
whiteSpace: 'nowrap'
|
|
468
|
-
} }, appItem.displayName)));
|
|
417
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
418
|
+
}, onClick: () => onOpenApp(appItem), children: [(0, jsx_runtime_1.jsx)("div", { className: "d-flex align-items-center justify-content-center mb-2", style: {
|
|
419
|
+
width: isMobile ? "64px" : "72px",
|
|
420
|
+
height: isMobile ? "64px" : "72px",
|
|
421
|
+
backgroundColor: isDark ? "#343a40" : "#f8f9fa",
|
|
422
|
+
borderRadius: "12px",
|
|
423
|
+
border: `1px solid ${isDark ? "#495057" : "#e9ecef"}`,
|
|
424
|
+
boxShadow: isDark ? "0 2px 4px rgba(0,0,0,0.3)" : "0 2px 4px rgba(0,0,0,0.08)",
|
|
425
|
+
transition: "all 0.15s ease",
|
|
426
|
+
}, children: (0, jsx_runtime_1.jsx)("i", { className: appItem.iconClassName, style: {
|
|
427
|
+
fontSize: isMobile ? "28px" : "32px",
|
|
428
|
+
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
429
|
+
} }) }), (0, jsx_runtime_1.jsx)("span", { className: isDark ? "text-light" : "text-dark", style: {
|
|
430
|
+
fontSize: isMobile ? "11px" : "12px",
|
|
431
|
+
fontWeight: "500",
|
|
432
|
+
lineHeight: "1.2",
|
|
433
|
+
maxWidth: "100%",
|
|
434
|
+
overflow: "hidden",
|
|
435
|
+
textOverflow: "ellipsis",
|
|
436
|
+
whiteSpace: "nowrap",
|
|
437
|
+
}, children: appItem.displayName })] }));
|
|
469
438
|
}
|