@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,22 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { Observable } from "@peers-app/peers-sdk";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { useObservable } from "../hooks";
|
|
3
4
|
|
|
4
|
-
interface IProps
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interface IProps
|
|
6
|
+
extends Omit<
|
|
7
|
+
React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,
|
|
8
|
+
"checked"
|
|
9
|
+
> {
|
|
10
|
+
checked?: boolean | Observable<boolean | undefined>;
|
|
11
|
+
type?: React.HTMLInputTypeAttribute;
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
export function Checkbox(props: IProps) {
|
|
10
15
|
const [checked, setChecked] = useObservable(props.checked);
|
|
11
|
-
const type = props.type ??
|
|
16
|
+
const type = props.type ?? "checkbox";
|
|
12
17
|
function onChange(evt: React.ChangeEvent<HTMLInputElement>) {
|
|
13
|
-
let _value:
|
|
14
|
-
if (type ===
|
|
18
|
+
let _value: boolean = evt.target.checked;
|
|
19
|
+
if (type === "checkbox") {
|
|
15
20
|
_value = !!_value;
|
|
16
21
|
}
|
|
17
22
|
setChecked(_value);
|
|
18
23
|
}
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
}
|
|
24
|
+
return <input onChange={onChange} type={type} {...props} checked={checked} />;
|
|
25
|
+
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
Groups,
|
|
3
|
+
getMe,
|
|
4
|
+
getUserContext,
|
|
5
|
+
type IGroup,
|
|
6
|
+
newid,
|
|
7
|
+
newKeys,
|
|
8
|
+
peersCorePackageId,
|
|
9
|
+
rpcServerCalls,
|
|
10
|
+
setUserTrustLevel,
|
|
11
|
+
TrustLevel,
|
|
12
|
+
type UserContext,
|
|
13
|
+
Users,
|
|
14
|
+
} from "@peers-app/peers-sdk";
|
|
15
|
+
import React, { useEffect, useState } from "react";
|
|
16
|
+
import { usePromise } from "../hooks";
|
|
4
17
|
|
|
5
18
|
interface GroupSwitcherProps {
|
|
6
19
|
colorMode: string;
|
|
@@ -32,13 +45,13 @@ export function GroupSwitcher({ colorMode, isMobile = false }: GroupSwitcherProp
|
|
|
32
45
|
const currentGroupId = userContext?.currentlyActiveGroupId();
|
|
33
46
|
if (!currentGroupId) return null;
|
|
34
47
|
return allGroups.find((g: IGroup) => g.groupId === currentGroupId) || null;
|
|
35
|
-
}, [allGroups, userContext?.currentlyActiveGroupId
|
|
48
|
+
}, [allGroups, userContext?.currentlyActiveGroupId]);
|
|
36
49
|
|
|
37
50
|
const handleGroupSelect = (group: IGroup | null) => {
|
|
38
51
|
if (!userContext) return;
|
|
39
52
|
|
|
40
53
|
// Set the active group through user context
|
|
41
|
-
userContext.currentlyActiveGroupId(group?.groupId ||
|
|
54
|
+
userContext.currentlyActiveGroupId(group?.groupId || "");
|
|
42
55
|
setShowDropdown(false);
|
|
43
56
|
};
|
|
44
57
|
|
|
@@ -48,67 +61,76 @@ export function GroupSwitcher({ colorMode, isMobile = false }: GroupSwitcherProp
|
|
|
48
61
|
};
|
|
49
62
|
|
|
50
63
|
const getGroupIcon = (group: IGroup | null | undefined) => {
|
|
51
|
-
if (!group) return
|
|
52
|
-
return group.iconClassName ||
|
|
64
|
+
if (!group) return "bi-person-fill"; // Personal group icon
|
|
65
|
+
return group.iconClassName || "bi-people-fill";
|
|
53
66
|
};
|
|
54
67
|
|
|
55
68
|
const getGroupName = (group: IGroup | null | undefined) => {
|
|
56
|
-
if (!group) return
|
|
69
|
+
if (!group) return "Personal";
|
|
57
70
|
return group.name;
|
|
58
71
|
};
|
|
59
72
|
|
|
60
|
-
const isDark = colorMode ===
|
|
73
|
+
const isDark = colorMode === "dark";
|
|
61
74
|
|
|
62
75
|
return (
|
|
63
76
|
<>
|
|
64
77
|
<div className="dropdown">
|
|
65
78
|
<button
|
|
66
|
-
className={`btn btn-sm ${isMobile ?
|
|
79
|
+
className={`btn btn-sm ${isMobile ? "" : "me-2"} d-flex align-items-center`}
|
|
67
80
|
onClick={() => setShowDropdown(!showDropdown)}
|
|
68
81
|
title={`Current group: ${getGroupName(currentGroup)}`}
|
|
69
82
|
style={{
|
|
70
|
-
padding: isMobile ?
|
|
71
|
-
fontSize:
|
|
72
|
-
borderRadius:
|
|
73
|
-
border:
|
|
74
|
-
background:
|
|
75
|
-
color: isDark ?
|
|
76
|
-
minWidth: isMobile ?
|
|
83
|
+
padding: isMobile ? "4px" : "4px 8px",
|
|
84
|
+
fontSize: "12px",
|
|
85
|
+
borderRadius: "6px",
|
|
86
|
+
border: "none",
|
|
87
|
+
background: "transparent",
|
|
88
|
+
color: isDark ? "#adb5bd" : "#6c757d",
|
|
89
|
+
minWidth: isMobile ? "36px" : undefined,
|
|
77
90
|
}}
|
|
78
91
|
onMouseEnter={(e) => {
|
|
79
|
-
e.currentTarget.style.backgroundColor = isDark ?
|
|
80
|
-
e.currentTarget.style.color = isDark ?
|
|
92
|
+
e.currentTarget.style.backgroundColor = isDark ? "#495057" : "#f8f9fa";
|
|
93
|
+
e.currentTarget.style.color = isDark ? "#ffffff" : "#0d6efd";
|
|
81
94
|
}}
|
|
82
95
|
onMouseLeave={(e) => {
|
|
83
|
-
e.currentTarget.style.backgroundColor =
|
|
84
|
-
e.currentTarget.style.color = isDark ?
|
|
96
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
97
|
+
e.currentTarget.style.color = isDark ? "#adb5bd" : "#6c757d";
|
|
85
98
|
}}
|
|
86
99
|
>
|
|
87
|
-
<i
|
|
100
|
+
<i
|
|
101
|
+
className={`${getGroupIcon(currentGroup)} ${isMobile ? "" : "me-1"}`}
|
|
102
|
+
style={{ fontSize: "14px" }}
|
|
103
|
+
/>
|
|
88
104
|
{!isMobile && (
|
|
89
|
-
<span className="text-truncate" style={{ maxWidth:
|
|
105
|
+
<span className="text-truncate" style={{ maxWidth: "80px" }}>
|
|
90
106
|
{getGroupName(currentGroup)}
|
|
91
107
|
</span>
|
|
92
108
|
)}
|
|
93
|
-
<i className="bi-chevron-down ms-1" style={{ fontSize:
|
|
109
|
+
<i className="bi-chevron-down ms-1" style={{ fontSize: "10px" }} />
|
|
94
110
|
</button>
|
|
95
111
|
|
|
96
112
|
{showDropdown && (
|
|
97
113
|
<div
|
|
98
|
-
className={`dropdown-menu show position-absolute ${isDark ?
|
|
114
|
+
className={`dropdown-menu show position-absolute ${isDark ? "dropdown-menu-dark" : ""}`}
|
|
99
115
|
style={{
|
|
100
116
|
left: 0,
|
|
101
|
-
top:
|
|
117
|
+
top: "100%",
|
|
102
118
|
zIndex: 1000,
|
|
103
|
-
minWidth:
|
|
104
|
-
maxHeight:
|
|
105
|
-
overflowY:
|
|
119
|
+
minWidth: "200px",
|
|
120
|
+
maxHeight: "300px",
|
|
121
|
+
overflowY: "auto",
|
|
106
122
|
}}
|
|
107
123
|
>
|
|
108
124
|
{/* Personal Group */}
|
|
109
125
|
<button
|
|
110
|
-
className={`dropdown-item d-flex align-items-center ${!currentGroup ?
|
|
111
|
-
style={{
|
|
126
|
+
className={`dropdown-item d-flex align-items-center ${!currentGroup ? "active" : ""}`}
|
|
127
|
+
style={{
|
|
128
|
+
cursor: "pointer",
|
|
129
|
+
border: "none",
|
|
130
|
+
background: "none",
|
|
131
|
+
width: "100%",
|
|
132
|
+
textAlign: "left",
|
|
133
|
+
}}
|
|
112
134
|
onClick={() => handleGroupSelect(null)}
|
|
113
135
|
>
|
|
114
136
|
<i className="bi-person-fill me-2" />
|
|
@@ -116,9 +138,7 @@ export function GroupSwitcher({ colorMode, isMobile = false }: GroupSwitcherProp
|
|
|
116
138
|
</button>
|
|
117
139
|
|
|
118
140
|
{/* Divider */}
|
|
119
|
-
{allGroups.length > 0 &&
|
|
120
|
-
<div className="dropdown-divider" />
|
|
121
|
-
)}
|
|
141
|
+
{allGroups.length > 0 && <div className="dropdown-divider" />}
|
|
122
142
|
|
|
123
143
|
{/* Group List */}
|
|
124
144
|
{allGroups
|
|
@@ -126,8 +146,14 @@ export function GroupSwitcher({ colorMode, isMobile = false }: GroupSwitcherProp
|
|
|
126
146
|
.map((group: IGroup) => (
|
|
127
147
|
<button
|
|
128
148
|
key={group.groupId}
|
|
129
|
-
className={`dropdown-item d-flex align-items-center ${currentGroup?.groupId === group.groupId ?
|
|
130
|
-
style={{
|
|
149
|
+
className={`dropdown-item d-flex align-items-center ${currentGroup?.groupId === group.groupId ? "active" : ""}`}
|
|
150
|
+
style={{
|
|
151
|
+
cursor: "pointer",
|
|
152
|
+
border: "none",
|
|
153
|
+
background: "none",
|
|
154
|
+
width: "100%",
|
|
155
|
+
textAlign: "left",
|
|
156
|
+
}}
|
|
131
157
|
onClick={() => handleGroupSelect(group)}
|
|
132
158
|
>
|
|
133
159
|
<i className={`${getGroupIcon(group)} me-2`} />
|
|
@@ -139,7 +165,13 @@ export function GroupSwitcher({ colorMode, isMobile = false }: GroupSwitcherProp
|
|
|
139
165
|
<div className="dropdown-divider" />
|
|
140
166
|
<button
|
|
141
167
|
className="dropdown-item d-flex align-items-center"
|
|
142
|
-
style={{
|
|
168
|
+
style={{
|
|
169
|
+
cursor: "pointer",
|
|
170
|
+
border: "none",
|
|
171
|
+
background: "none",
|
|
172
|
+
width: "100%",
|
|
173
|
+
textAlign: "left",
|
|
174
|
+
}}
|
|
143
175
|
onClick={handleCreateClick}
|
|
144
176
|
>
|
|
145
177
|
<i className="bi-plus-circle me-2" />
|
|
@@ -187,25 +219,30 @@ interface CreateGroupModalProps {
|
|
|
187
219
|
onGroupCreated: (groupId: string) => void;
|
|
188
220
|
}
|
|
189
221
|
|
|
190
|
-
function CreateGroupModal({
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
222
|
+
function CreateGroupModal({
|
|
223
|
+
colorMode,
|
|
224
|
+
userContext,
|
|
225
|
+
onClose,
|
|
226
|
+
onGroupCreated,
|
|
227
|
+
}: CreateGroupModalProps) {
|
|
228
|
+
const [groupName, setGroupName] = useState("");
|
|
229
|
+
const [iconClassName, setIconClassName] = useState("bi-people-fill");
|
|
230
|
+
const [description, setDescription] = useState("");
|
|
194
231
|
const [isCreating, setIsCreating] = useState(false);
|
|
195
232
|
const [error, setError] = useState<string | null>(null);
|
|
196
233
|
|
|
197
|
-
const isDark = colorMode ===
|
|
234
|
+
const isDark = colorMode === "dark";
|
|
198
235
|
|
|
199
236
|
const handleCreate = async () => {
|
|
200
237
|
// Validate
|
|
201
238
|
const trimmedName = groupName.trim();
|
|
202
239
|
if (!trimmedName) {
|
|
203
|
-
setError(
|
|
240
|
+
setError("Group name is required");
|
|
204
241
|
return;
|
|
205
242
|
}
|
|
206
243
|
|
|
207
244
|
if (trimmedName.length > 100) {
|
|
208
|
-
setError(
|
|
245
|
+
setError("Group name must be 100 characters or less");
|
|
209
246
|
return;
|
|
210
247
|
}
|
|
211
248
|
|
|
@@ -223,16 +260,17 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
223
260
|
const groupDataContext = userContext.getDataContext(groupId);
|
|
224
261
|
|
|
225
262
|
// Store groupKeys.secretKey securely for this group
|
|
226
|
-
const persistentVarsTable =
|
|
227
|
-
|
|
263
|
+
const persistentVarsTable =
|
|
264
|
+
userContext.userDataContext.tableContainer.getTableByName("PersistentVars");
|
|
265
|
+
const groupSecretKeyVarName = `groupSecretKey_${groupDataContext.dataContextId}`;
|
|
228
266
|
await persistentVarsTable.save({
|
|
229
267
|
persistentVarId: newid(),
|
|
230
268
|
name: groupSecretKeyVarName,
|
|
231
|
-
scope:
|
|
269
|
+
scope: "groupUser",
|
|
232
270
|
isSecret: true,
|
|
233
271
|
value: { value: groupKeys.secretKey },
|
|
234
272
|
});
|
|
235
|
-
|
|
273
|
+
|
|
236
274
|
// Add current user to the group's users table
|
|
237
275
|
await Users(groupDataContext).save(me);
|
|
238
276
|
|
|
@@ -245,35 +283,37 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
245
283
|
groupId,
|
|
246
284
|
name: trimmedName,
|
|
247
285
|
description: description.trim(),
|
|
248
|
-
iconClassName: iconClassName.trim() ||
|
|
286
|
+
iconClassName: iconClassName.trim() || "bi-people-fill",
|
|
249
287
|
founderUserId: me.userId,
|
|
250
288
|
disabled: false,
|
|
251
289
|
publicKey: groupKeys.publicKey,
|
|
252
290
|
publicBoxKey: groupKeys.publicBoxKey,
|
|
253
|
-
signature:
|
|
291
|
+
signature: "", // Will be set by signAndSave()
|
|
254
292
|
});
|
|
255
293
|
|
|
256
294
|
await Groups(groupDataContext).signAndSave(newGroup);
|
|
257
295
|
|
|
258
296
|
// Auto-install peers-core for the new group
|
|
259
|
-
await rpcServerCalls
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
297
|
+
await rpcServerCalls
|
|
298
|
+
.addOrUpdatePackage(peersCorePackageId, { dataContextId: groupId })
|
|
299
|
+
.catch((err: unknown) => {
|
|
300
|
+
console.error("Error auto-installing peers-core for group:", err);
|
|
301
|
+
});
|
|
302
|
+
|
|
263
303
|
// Notify parent
|
|
264
304
|
onGroupCreated(newGroup.groupId);
|
|
265
|
-
} catch (err:
|
|
266
|
-
console.error(
|
|
267
|
-
setError(err.message
|
|
305
|
+
} catch (err: unknown) {
|
|
306
|
+
console.error("Failed to create group:", err);
|
|
307
|
+
setError(err instanceof Error ? err.message : "Failed to create group. Please try again.");
|
|
268
308
|
setIsCreating(false);
|
|
269
309
|
}
|
|
270
310
|
};
|
|
271
311
|
|
|
272
312
|
const handleKeyDown = (e: React.KeyboardEvent) => {
|
|
273
|
-
if (e.key ===
|
|
313
|
+
if (e.key === "Enter" && !e.shiftKey && groupName.trim()) {
|
|
274
314
|
e.preventDefault();
|
|
275
315
|
handleCreate();
|
|
276
|
-
} else if (e.key ===
|
|
316
|
+
} else if (e.key === "Escape") {
|
|
277
317
|
onClose();
|
|
278
318
|
}
|
|
279
319
|
};
|
|
@@ -285,9 +325,9 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
285
325
|
top: 0,
|
|
286
326
|
left: 0,
|
|
287
327
|
zIndex: 1050,
|
|
288
|
-
backgroundColor:
|
|
289
|
-
backdropFilter:
|
|
290
|
-
paddingTop:
|
|
328
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
329
|
+
backdropFilter: "blur(4px)",
|
|
330
|
+
paddingTop: "10vh",
|
|
291
331
|
}}
|
|
292
332
|
onClick={(e) => {
|
|
293
333
|
if (e.target === e.currentTarget) {
|
|
@@ -296,42 +336,44 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
296
336
|
}}
|
|
297
337
|
>
|
|
298
338
|
<div
|
|
299
|
-
className={`${isDark ?
|
|
339
|
+
className={`${isDark ? "bg-dark text-light" : "bg-white text-dark"}`}
|
|
300
340
|
style={{
|
|
301
|
-
width:
|
|
302
|
-
maxWidth:
|
|
303
|
-
borderRadius:
|
|
304
|
-
boxShadow: isDark
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
border: isDark ? '1px solid #495057' : '1px solid #dee2e6',
|
|
308
|
-
overflow: 'hidden'
|
|
341
|
+
width: "90%",
|
|
342
|
+
maxWidth: "500px",
|
|
343
|
+
borderRadius: "12px",
|
|
344
|
+
boxShadow: isDark ? "0 20px 40px rgba(0, 0, 0, 0.5)" : "0 20px 40px rgba(0, 0, 0, 0.1)",
|
|
345
|
+
border: isDark ? "1px solid #495057" : "1px solid #dee2e6",
|
|
346
|
+
overflow: "hidden",
|
|
309
347
|
}}
|
|
310
348
|
>
|
|
311
349
|
{/* Header */}
|
|
312
350
|
<div
|
|
313
351
|
className="p-3 border-bottom d-flex align-items-center justify-content-between"
|
|
314
352
|
style={{
|
|
315
|
-
borderBottomColor: isDark ?
|
|
353
|
+
borderBottomColor: isDark ? "#495057" : "#dee2e6",
|
|
316
354
|
}}
|
|
317
355
|
>
|
|
318
356
|
<div className="d-flex align-items-center">
|
|
319
|
-
<i className="bi-people-fill me-2" style={{ fontSize:
|
|
357
|
+
<i className="bi-people-fill me-2" style={{ fontSize: "20px" }} />
|
|
320
358
|
<h6 className="mb-0">Create New Group</h6>
|
|
321
359
|
</div>
|
|
322
360
|
<button
|
|
323
361
|
className="btn btn-sm p-0"
|
|
324
362
|
style={{
|
|
325
|
-
border:
|
|
326
|
-
background:
|
|
327
|
-
fontSize:
|
|
328
|
-
lineHeight:
|
|
329
|
-
opacity: 0.6
|
|
363
|
+
border: "none",
|
|
364
|
+
background: "none",
|
|
365
|
+
fontSize: "24px",
|
|
366
|
+
lineHeight: "1",
|
|
367
|
+
opacity: 0.6,
|
|
330
368
|
}}
|
|
331
369
|
onClick={onClose}
|
|
332
370
|
disabled={isCreating}
|
|
333
|
-
onMouseEnter={(e) =>
|
|
334
|
-
|
|
371
|
+
onMouseEnter={(e) => {
|
|
372
|
+
e.currentTarget.style.opacity = "1";
|
|
373
|
+
}}
|
|
374
|
+
onMouseLeave={(e) => {
|
|
375
|
+
e.currentTarget.style.opacity = "0.6";
|
|
376
|
+
}}
|
|
335
377
|
>
|
|
336
378
|
<i className="bi-x" />
|
|
337
379
|
</button>
|
|
@@ -341,7 +383,7 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
341
383
|
<div className="p-3">
|
|
342
384
|
{/* Error Alert */}
|
|
343
385
|
{error && (
|
|
344
|
-
<div className="alert alert-danger py-2 px-3 mb-3" style={{ fontSize:
|
|
386
|
+
<div className="alert alert-danger py-2 px-3 mb-3" style={{ fontSize: "14px" }}>
|
|
345
387
|
<i className="bi-exclamation-triangle me-2" />
|
|
346
388
|
{error}
|
|
347
389
|
</div>
|
|
@@ -354,7 +396,7 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
354
396
|
</label>
|
|
355
397
|
<input
|
|
356
398
|
type="text"
|
|
357
|
-
className={`form-control ${isDark ?
|
|
399
|
+
className={`form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`}
|
|
358
400
|
placeholder="Enter group name"
|
|
359
401
|
value={groupName}
|
|
360
402
|
onChange={(e) => {
|
|
@@ -362,15 +404,14 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
362
404
|
setError(null);
|
|
363
405
|
}}
|
|
364
406
|
onKeyDown={handleKeyDown}
|
|
365
|
-
autoFocus
|
|
366
407
|
disabled={isCreating}
|
|
367
408
|
maxLength={100}
|
|
368
409
|
style={{
|
|
369
|
-
fontSize:
|
|
370
|
-
backgroundColor: isDark ?
|
|
410
|
+
fontSize: "14px",
|
|
411
|
+
backgroundColor: isDark ? "#343a40" : "#ffffff",
|
|
371
412
|
}}
|
|
372
413
|
/>
|
|
373
|
-
<small className="text-muted" style={{ fontSize:
|
|
414
|
+
<small className="text-muted" style={{ fontSize: "11px" }}>
|
|
374
415
|
{groupName.length}/100 characters
|
|
375
416
|
</small>
|
|
376
417
|
</div>
|
|
@@ -380,26 +421,26 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
380
421
|
<label className="form-label small mb-1">Icon</label>
|
|
381
422
|
<div className="input-group">
|
|
382
423
|
<span
|
|
383
|
-
className={`input-group-text ${isDark ?
|
|
384
|
-
style={{ backgroundColor: isDark ?
|
|
424
|
+
className={`input-group-text ${isDark ? "bg-dark text-light border-secondary" : ""}`}
|
|
425
|
+
style={{ backgroundColor: isDark ? "#343a40" : undefined }}
|
|
385
426
|
>
|
|
386
|
-
<i className={iconClassName ||
|
|
427
|
+
<i className={iconClassName || "bi-people-fill"} />
|
|
387
428
|
</span>
|
|
388
429
|
<input
|
|
389
430
|
type="text"
|
|
390
|
-
className={`form-control ${isDark ?
|
|
431
|
+
className={`form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`}
|
|
391
432
|
placeholder="bi-people-fill"
|
|
392
433
|
value={iconClassName}
|
|
393
434
|
onChange={(e) => setIconClassName(e.target.value)}
|
|
394
435
|
onKeyDown={handleKeyDown}
|
|
395
436
|
disabled={isCreating}
|
|
396
437
|
style={{
|
|
397
|
-
fontSize:
|
|
398
|
-
backgroundColor: isDark ?
|
|
438
|
+
fontSize: "14px",
|
|
439
|
+
backgroundColor: isDark ? "#343a40" : "#ffffff",
|
|
399
440
|
}}
|
|
400
441
|
/>
|
|
401
442
|
</div>
|
|
402
|
-
<small className="text-muted" style={{ fontSize:
|
|
443
|
+
<small className="text-muted" style={{ fontSize: "11px" }}>
|
|
403
444
|
Bootstrap icon class name (e.g., bi-star-fill, bi-house-fill)
|
|
404
445
|
</small>
|
|
405
446
|
</div>
|
|
@@ -408,7 +449,7 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
408
449
|
<div className="mb-3">
|
|
409
450
|
<label className="form-label small mb-1">Description (optional)</label>
|
|
410
451
|
<textarea
|
|
411
|
-
className={`form-control ${isDark ?
|
|
452
|
+
className={`form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`}
|
|
412
453
|
placeholder="Enter group description"
|
|
413
454
|
value={description}
|
|
414
455
|
onChange={(e) => setDescription(e.target.value)}
|
|
@@ -416,12 +457,12 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
416
457
|
rows={3}
|
|
417
458
|
maxLength={500}
|
|
418
459
|
style={{
|
|
419
|
-
fontSize:
|
|
420
|
-
backgroundColor: isDark ?
|
|
421
|
-
resize:
|
|
460
|
+
fontSize: "14px",
|
|
461
|
+
backgroundColor: isDark ? "#343a40" : "#ffffff",
|
|
462
|
+
resize: "none",
|
|
422
463
|
}}
|
|
423
464
|
/>
|
|
424
|
-
<small className="text-muted" style={{ fontSize:
|
|
465
|
+
<small className="text-muted" style={{ fontSize: "11px" }}>
|
|
425
466
|
{description.length}/500 characters
|
|
426
467
|
</small>
|
|
427
468
|
</div>
|
|
@@ -431,14 +472,14 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
431
472
|
<div
|
|
432
473
|
className="p-3 border-top d-flex justify-content-end gap-2"
|
|
433
474
|
style={{
|
|
434
|
-
borderTopColor: isDark ?
|
|
475
|
+
borderTopColor: isDark ? "#495057" : "#dee2e6",
|
|
435
476
|
}}
|
|
436
477
|
>
|
|
437
478
|
<button
|
|
438
|
-
className={`btn btn-sm ${isDark ?
|
|
479
|
+
className={`btn btn-sm ${isDark ? "btn-outline-light" : "btn-outline-secondary"}`}
|
|
439
480
|
onClick={onClose}
|
|
440
481
|
disabled={isCreating}
|
|
441
|
-
style={{ minWidth:
|
|
482
|
+
style={{ minWidth: "80px" }}
|
|
442
483
|
>
|
|
443
484
|
Cancel
|
|
444
485
|
</button>
|
|
@@ -446,11 +487,15 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
446
487
|
className="btn btn-sm btn-primary"
|
|
447
488
|
onClick={handleCreate}
|
|
448
489
|
disabled={isCreating || !groupName.trim()}
|
|
449
|
-
style={{ minWidth:
|
|
490
|
+
style={{ minWidth: "80px" }}
|
|
450
491
|
>
|
|
451
492
|
{isCreating ? (
|
|
452
493
|
<>
|
|
453
|
-
<span
|
|
494
|
+
<span
|
|
495
|
+
className="spinner-border spinner-border-sm me-1"
|
|
496
|
+
role="status"
|
|
497
|
+
aria-hidden="true"
|
|
498
|
+
/>
|
|
454
499
|
Creating...
|
|
455
500
|
</>
|
|
456
501
|
) : (
|
|
@@ -466,8 +511,8 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated }: C
|
|
|
466
511
|
<div
|
|
467
512
|
className={`px-3 py-2 small text-muted border-top`}
|
|
468
513
|
style={{
|
|
469
|
-
borderTopColor: isDark ?
|
|
470
|
-
fontSize:
|
|
514
|
+
borderTopColor: isDark ? "#495057" : "#dee2e6",
|
|
515
|
+
fontSize: "11px",
|
|
471
516
|
}}
|
|
472
517
|
>
|
|
473
518
|
<kbd className="small">↵</kbd> to create • <kbd className="small">esc</kbd> to cancel
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Observable } from "@peers-app/peers-sdk";
|
|
2
2
|
import moment from "moment-timezone";
|
|
3
|
-
import
|
|
3
|
+
import type React from "react";
|
|
4
4
|
import { useObservable } from "../hooks";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
date: Observable<Date | undefined> | Date | undefined
|
|
6
|
+
interface IProps
|
|
7
|
+
extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
8
|
+
date: Observable<Date | undefined> | Date | undefined;
|
|
9
9
|
}
|
|
10
10
|
export const InputDate = (props: IProps) => {
|
|
11
|
-
|
|
12
11
|
const [date, setDate] = useObservable<Date | undefined>(props.date);
|
|
13
12
|
|
|
14
|
-
const
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
delete inputProps.date;
|
|
13
|
+
const { date: _omitDate, ...inputProps } = props;
|
|
17
14
|
|
|
18
15
|
return (
|
|
19
16
|
<input
|
|
20
17
|
{...inputProps}
|
|
21
|
-
type=
|
|
22
|
-
value={date?.toISOString?.().substring(0, 10) ??
|
|
23
|
-
onChange={evt => {
|
|
24
|
-
setDate(
|
|
25
|
-
|
|
18
|
+
type="date"
|
|
19
|
+
value={date?.toISOString?.().substring(0, 10) ?? ""}
|
|
20
|
+
onChange={(evt) => {
|
|
21
|
+
setDate(
|
|
22
|
+
evt.currentTarget.value
|
|
23
|
+
? moment(new Date(evt.currentTarget.value)).startOf("day").add(1, "day").toDate()
|
|
24
|
+
: undefined,
|
|
25
|
+
);
|
|
26
|
+
}}
|
|
26
27
|
/>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
28
|
+
);
|
|
29
|
+
};
|