@peers-app/peers-ui 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +8 -5
- package/babel.config.js +4 -4
- package/biome.json +191 -0
- package/dist/command-palette/command-palette-ui.d.ts +1 -2
- package/dist/command-palette/command-palette-ui.js +175 -244
- package/dist/command-palette/command-palette.js +65 -64
- package/dist/components/chat-overlay.d.ts +2 -2
- package/dist/components/chat-overlay.js +160 -217
- package/dist/components/checkbox.d.ts +5 -4
- package/dist/components/checkbox.js +4 -7
- package/dist/components/group-switcher.d.ts +1 -2
- package/dist/components/group-switcher.js +119 -159
- package/dist/components/input-date.d.ts +3 -3
- package/dist/components/input-date.js +6 -6
- package/dist/components/input-number.d.ts +7 -6
- package/dist/components/input-number.js +25 -20
- package/dist/components/input.d.ts +5 -4
- package/dist/components/input.js +4 -7
- package/dist/components/inverse-lazy-list.d.ts +3 -3
- package/dist/components/inverse-lazy-list.js +13 -47
- package/dist/components/io-schema-values.d.ts +5 -6
- package/dist/components/io-schema-values.js +28 -65
- package/dist/components/io-schema.d.ts +4 -5
- package/dist/components/io-schema.js +42 -79
- package/dist/components/lazy-list.d.ts +3 -3
- package/dist/components/lazy-list.js +38 -58
- package/dist/components/list-screen.d.ts +3 -8
- package/dist/components/list-screen.js +28 -23
- package/dist/components/loading-indicator.d.ts +1 -2
- package/dist/components/loading-indicator.js +2 -6
- package/dist/components/markdown-editor/autolink-plugin.js +5 -8
- package/dist/components/markdown-editor/editor-inline.d.ts +2 -3
- package/dist/components/markdown-editor/editor-inline.js +2 -6
- package/dist/components/markdown-editor/editor.d.ts +6 -6
- package/dist/components/markdown-editor/editor.js +9 -19
- package/dist/components/markdown-editor/markdown-plugin.d.ts +1 -1
- package/dist/components/markdown-editor/markdown-plugin.js +20 -21
- package/dist/components/markdown-editor/mention-node.d.ts +2 -2
- package/dist/components/markdown-editor/mention-node.js +24 -24
- package/dist/components/markdown-editor/mentions-plugin.d.ts +2 -2
- package/dist/components/markdown-editor/mentions-plugin.js +61 -62
- package/dist/components/markdown-editor/theme.js +28 -28
- package/dist/components/markdown-editor/toolbar.d.ts +2 -3
- package/dist/components/markdown-editor/toolbar.js +32 -49
- package/dist/components/markdown-with-mentions.d.ts +1 -1
- package/dist/components/markdown-with-mentions.js +43 -43
- package/dist/components/message-logs/message-logs.d.ts +1 -2
- package/dist/components/message-logs/message-logs.js +91 -116
- package/dist/components/messages/avatar.d.ts +3 -4
- package/dist/components/messages/avatar.js +37 -46
- package/dist/components/messages/channel-message-list.d.ts +5 -6
- package/dist/components/messages/channel-message-list.js +34 -34
- package/dist/components/messages/channel-view.d.ts +1 -2
- package/dist/components/messages/channel-view.js +23 -57
- package/dist/components/messages/message-compose.d.ts +3 -4
- package/dist/components/messages/message-compose.js +27 -38
- package/dist/components/messages/message-display.d.ts +2 -3
- package/dist/components/messages/message-display.js +42 -95
- package/dist/components/messages/thread-message-list.d.ts +4 -5
- package/dist/components/messages/thread-message-list.js +29 -29
- package/dist/components/router.d.ts +1 -2
- package/dist/components/router.js +58 -66
- package/dist/components/save-button.d.ts +3 -3
- package/dist/components/save-button.js +23 -33
- package/dist/components/sortable-list.d.ts +11 -12
- package/dist/components/sortable-list.js +42 -22
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +16 -47
- package/dist/components/tooltip.d.ts +4 -4
- package/dist/components/tooltip.js +4 -9
- package/dist/components/trust-level-badge.d.ts +2 -3
- package/dist/components/trust-level-badge.js +16 -16
- package/dist/components/trust-level-dropdown.d.ts +3 -4
- package/dist/components/trust-level-dropdown.js +32 -55
- package/dist/components/typeahead.d.ts +3 -3
- package/dist/components/typeahead.js +48 -89
- package/dist/components/voice-indicator.d.ts +2 -2
- package/dist/components/voice-indicator.js +93 -106
- package/dist/components/voice-subscribe-events.d.ts +32 -0
- package/dist/components/voice-subscribe-events.js +2 -0
- package/dist/globals.d.ts +3 -5
- package/dist/globals.js +22 -33
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +22 -12
- package/dist/hooks.test.js +129 -145
- package/dist/index.d.ts +9 -8
- package/dist/index.js +13 -12
- package/dist/mention-configs.d.ts +2 -2
- package/dist/mention-configs.js +55 -42
- package/dist/screens/assistants/assistant-config.d.ts +2 -3
- package/dist/screens/assistants/assistant-config.js +9 -22
- package/dist/screens/assistants/assistant-details.d.ts +1 -2
- package/dist/screens/assistants/assistant-details.js +13 -28
- package/dist/screens/assistants/assistant-info.d.ts +2 -3
- package/dist/screens/assistants/assistant-info.js +3 -17
- package/dist/screens/assistants/assistant-list.d.ts +1 -2
- package/dist/screens/assistants/assistant-list.js +15 -56
- package/dist/screens/assistants/assistant-tools.d.ts +2 -3
- package/dist/screens/assistants/assistant-tools.js +10 -24
- package/dist/screens/console-logs/console-logs-list.d.ts +1 -2
- package/dist/screens/console-logs/console-logs-list.js +130 -134
- package/dist/screens/console-logs/log-display.d.ts +2 -3
- package/dist/screens/console-logs/log-display.js +40 -42
- package/dist/screens/console-logs/log-filters.d.ts +1 -2
- package/dist/screens/console-logs/log-filters.js +2 -24
- package/dist/screens/console-logs/mobile-log-card.d.ts +2 -3
- package/dist/screens/console-logs/mobile-log-card.js +64 -67
- package/dist/screens/console-logs/resizable-table-header.d.ts +1 -2
- package/dist/screens/console-logs/resizable-table-header.js +31 -67
- package/dist/screens/contacts/contact-details.d.ts +1 -2
- package/dist/screens/contacts/contact-details.js +16 -46
- package/dist/screens/contacts/contact-list.d.ts +1 -2
- package/dist/screens/contacts/contact-list.js +44 -103
- package/dist/screens/contacts/index.d.ts +4 -4
- package/dist/screens/contacts/index.js +1 -1
- package/dist/screens/contacts/user-connect.d.ts +1 -2
- package/dist/screens/contacts/user-connect.js +85 -186
- package/dist/screens/data-explorer/data-explorer.d.ts +1 -2
- package/dist/screens/data-explorer/data-explorer.js +61 -181
- package/dist/screens/data-explorer/index.d.ts +2 -2
- package/dist/screens/data-explorer/query-executor.d.ts +1 -2
- package/dist/screens/data-explorer/query-executor.js +56 -166
- package/dist/screens/groups/group-details.d.ts +1 -2
- package/dist/screens/groups/group-details.js +27 -122
- package/dist/screens/groups/group-invite-listener.d.ts +2 -3
- package/dist/screens/groups/group-invite-listener.js +8 -104
- package/dist/screens/groups/group-list.d.ts +1 -2
- package/dist/screens/groups/group-list.js +56 -133
- package/dist/screens/groups/group-members.d.ts +2 -3
- package/dist/screens/groups/group-members.js +62 -132
- package/dist/screens/groups/index.d.ts +4 -4
- package/dist/screens/groups/index.js +1 -1
- package/dist/screens/join-group/index.d.ts +2 -2
- package/dist/screens/join-group/join-group.d.ts +1 -2
- package/dist/screens/join-group/join-group.js +9 -109
- package/dist/screens/network-viewer/connection-troubleshooter.d.ts +2 -3
- package/dist/screens/network-viewer/connection-troubleshooter.js +89 -193
- package/dist/screens/network-viewer/cpu-usage-graph.d.ts +1 -2
- package/dist/screens/network-viewer/cpu-usage-graph.js +60 -99
- package/dist/screens/network-viewer/device-details-modal.d.ts +1 -2
- package/dist/screens/network-viewer/device-details-modal.js +25 -177
- package/dist/screens/network-viewer/group-details-modal.d.ts +1 -2
- package/dist/screens/network-viewer/group-details-modal.js +31 -142
- package/dist/screens/network-viewer/index.d.ts +4 -4
- package/dist/screens/network-viewer/index.js +3 -3
- package/dist/screens/network-viewer/network-viewer-ipc.d.ts +22 -0
- package/dist/screens/network-viewer/network-viewer-ipc.js +6 -0
- package/dist/screens/network-viewer/network-viewer.d.ts +1 -2
- package/dist/screens/network-viewer/network-viewer.js +91 -296
- package/dist/screens/network-viewer/usage-graph.d.ts +1 -2
- package/dist/screens/network-viewer/usage-graph.js +78 -110
- package/dist/screens/packages/package-details.d.ts +1 -2
- package/dist/screens/packages/package-details.js +35 -41
- package/dist/screens/packages/package-info.d.ts +2 -2
- package/dist/screens/packages/package-info.js +33 -86
- package/dist/screens/packages/package-list.d.ts +1 -2
- package/dist/screens/packages/package-list.js +42 -106
- package/dist/screens/packages/package-new-local.d.ts +1 -2
- package/dist/screens/packages/package-new-local.js +13 -19
- package/dist/screens/packages/package-versions.d.ts +2 -3
- package/dist/screens/packages/package-versions.js +29 -96
- package/dist/screens/peer-types/peer-type-details.d.ts +3 -4
- package/dist/screens/peer-types/peer-type-details.js +26 -78
- package/dist/screens/peer-types/peer-type-list.d.ts +1 -2
- package/dist/screens/peer-types/peer-type-list.js +13 -24
- package/dist/screens/search/global-search.d.ts +1 -2
- package/dist/screens/search/global-search.js +104 -182
- package/dist/screens/settings/color-mode-dropdown.d.ts +3 -4
- package/dist/screens/settings/color-mode-dropdown.js +18 -37
- package/dist/screens/settings/settings-page.d.ts +1 -1
- package/dist/screens/settings/settings-page.js +86 -213
- package/dist/screens/settings/voice-settings-agent.d.ts +1 -1
- package/dist/screens/settings/voice-settings-agent.js +7 -44
- package/dist/screens/settings/voice-settings-api-keys.d.ts +2 -2
- package/dist/screens/settings/voice-settings-api-keys.js +2 -29
- package/dist/screens/settings/voice-settings-output.d.ts +2 -2
- package/dist/screens/settings/voice-settings-output.js +2 -40
- package/dist/screens/settings/voice-settings-providers.d.ts +2 -2
- package/dist/screens/settings/voice-settings-providers.js +2 -19
- package/dist/screens/settings/voice-settings-types.d.ts +4 -4
- package/dist/screens/settings/voice-settings-types.js +31 -31
- package/dist/screens/settings/voice-settings-wake-word.d.ts +2 -2
- package/dist/screens/settings/voice-settings-wake-word.js +2 -33
- package/dist/screens/settings/voice-settings.d.ts +1 -1
- package/dist/screens/settings/voice-settings.js +35 -112
- package/dist/screens/setup-user.d.ts +1 -2
- package/dist/screens/setup-user.js +38 -116
- package/dist/screens/tools/tool-code.d.ts +2 -3
- package/dist/screens/tools/tool-code.js +9 -13
- package/dist/screens/tools/tool-details.d.ts +1 -2
- package/dist/screens/tools/tool-details.js +26 -39
- package/dist/screens/tools/tool-info.d.ts +2 -3
- package/dist/screens/tools/tool-info.js +9 -48
- package/dist/screens/tools/tool-list.d.ts +1 -2
- package/dist/screens/tools/tool-list.js +33 -65
- package/dist/screens/tools/tool-schema.d.ts +2 -3
- package/dist/screens/tools/tool-schema.js +2 -13
- package/dist/screens/tools/tool-test-details.d.ts +1 -2
- package/dist/screens/tools/tool-test-details.js +12 -28
- package/dist/screens/tools/tool-test-list.d.ts +1 -2
- package/dist/screens/tools/tool-test-list.js +17 -56
- package/dist/screens/variables/variable-details.d.ts +1 -2
- package/dist/screens/variables/variable-details.js +19 -86
- package/dist/screens/variables/variable-list.d.ts +1 -2
- package/dist/screens/variables/variable-list.js +16 -27
- package/dist/screens/welcome-modal.d.ts +1 -2
- package/dist/screens/welcome-modal.js +44 -111
- package/dist/screens/workflows/workflow-details.d.ts +1 -2
- package/dist/screens/workflows/workflow-details.js +17 -31
- package/dist/screens/workflows/workflow-info.d.ts +2 -3
- package/dist/screens/workflows/workflow-info.js +2 -9
- package/dist/screens/workflows/workflow-instructions.d.ts +2 -3
- package/dist/screens/workflows/workflow-instructions.js +23 -55
- package/dist/screens/workflows/workflow-list.d.ts +1 -2
- package/dist/screens/workflows/workflow-list.js +23 -62
- package/dist/setupTests.d.ts +1 -1
- package/dist/setupTests.js +10 -11
- package/dist/system-apps/assistants.app.d.ts +1 -1
- package/dist/system-apps/assistants.app.js +3 -3
- package/dist/system-apps/console-logs.app.d.ts +1 -1
- package/dist/system-apps/console-logs.app.js +3 -3
- package/dist/system-apps/contacts.app.d.ts +1 -1
- package/dist/system-apps/contacts.app.js +4 -4
- package/dist/system-apps/data-explorer.app.d.ts +1 -1
- package/dist/system-apps/data-explorer.app.js +4 -4
- package/dist/system-apps/groups.app.d.ts +1 -1
- package/dist/system-apps/groups.app.js +4 -4
- package/dist/system-apps/index.d.ts +17 -17
- package/dist/system-apps/index.js +52 -52
- package/dist/system-apps/join-group.app.d.ts +1 -1
- package/dist/system-apps/join-group.app.js +4 -4
- package/dist/system-apps/mobile-settings.app.d.ts +1 -1
- package/dist/system-apps/mobile-settings.app.js +3 -3
- package/dist/system-apps/network-viewer.app.d.ts +1 -1
- package/dist/system-apps/network-viewer.app.js +4 -4
- package/dist/system-apps/packages.app.d.ts +1 -1
- package/dist/system-apps/packages.app.js +3 -3
- package/dist/system-apps/search.app.d.ts +1 -1
- package/dist/system-apps/search.app.js +4 -4
- package/dist/system-apps/settings.app.d.ts +1 -1
- package/dist/system-apps/settings.app.js +3 -3
- package/dist/system-apps/threads.app.d.ts +1 -1
- package/dist/system-apps/threads.app.js +3 -3
- package/dist/system-apps/tools.app.d.ts +1 -1
- package/dist/system-apps/tools.app.js +3 -3
- package/dist/system-apps/types.app.d.ts +1 -1
- package/dist/system-apps/types.app.js +3 -3
- package/dist/system-apps/variables.app.d.ts +1 -1
- package/dist/system-apps/variables.app.js +3 -3
- package/dist/system-apps/workflows.app.d.ts +1 -1
- package/dist/system-apps/workflows.app.js +3 -3
- package/dist/tabs-layout/tabs-layout.d.ts +2 -3
- package/dist/tabs-layout/tabs-layout.js +215 -246
- package/dist/tabs-layout/tabs-state.d.ts +2 -2
- package/dist/tabs-layout/tabs-state.js +73 -61
- package/dist/ui-defaults/index.d.ts +2 -2
- package/dist/ui-defaults/list-screen.d.ts +2 -3
- package/dist/ui-defaults/list-screen.js +33 -37
- package/dist/ui-defaults/markdown-field.js +24 -56
- package/dist/ui-router/routes-loader.d.ts +1 -1
- package/dist/ui-router/routes-loader.js +17 -13
- package/dist/ui-router/ui-loader.d.ts +6 -6
- package/dist/ui-router/ui-loader.js +172 -268
- package/dist/utils.js +49 -39
- package/jest.config.js +16 -16
- package/package.json +16 -14
- package/src/command-palette/command-palette-ui.tsx +261 -237
- package/src/command-palette/command-palette.ts +81 -78
- package/src/components/chat-overlay.tsx +366 -261
- package/src/components/checkbox.tsx +15 -12
- package/src/components/group-switcher.tsx +150 -105
- package/src/components/input-date.tsx +17 -16
- package/src/components/input-number.tsx +47 -31
- package/src/components/input.tsx +15 -12
- package/src/components/inverse-lazy-list.tsx +14 -13
- package/src/components/io-schema-values.tsx +51 -69
- package/src/components/io-schema.tsx +94 -69
- package/src/components/lazy-list.tsx +51 -34
- package/src/components/list-screen.tsx +51 -35
- package/src/components/loading-indicator.tsx +2 -4
- package/src/components/markdown-editor/autolink-plugin.tsx +4 -11
- package/src/components/markdown-editor/editor-inline.tsx +3 -4
- package/src/components/markdown-editor/editor.tsx +53 -51
- package/src/components/markdown-editor/markdown-plugin.tsx +48 -40
- package/src/components/markdown-editor/mention-node.ts +39 -38
- package/src/components/markdown-editor/mentions-plugin.tsx +99 -101
- package/src/components/markdown-editor/theme.ts +28 -29
- package/src/components/markdown-editor/toolbar.tsx +53 -47
- package/src/components/markdown-with-mentions.tsx +56 -46
- package/src/components/message-logs/message-logs.tsx +225 -165
- package/src/components/messages/avatar.tsx +70 -52
- package/src/components/messages/channel-message-list.tsx +80 -68
- package/src/components/messages/channel-view.tsx +34 -33
- package/src/components/messages/message-compose.tsx +84 -67
- package/src/components/messages/message-display.tsx +103 -89
- package/src/components/messages/thread-message-list.tsx +53 -44
- package/src/components/router.tsx +42 -43
- package/src/components/save-button.tsx +43 -39
- package/src/components/sortable-list.tsx +77 -49
- package/src/components/tabs.tsx +31 -31
- package/src/components/tooltip.tsx +21 -28
- package/src/components/trust-level-badge.tsx +15 -11
- package/src/components/trust-level-dropdown.tsx +49 -19
- package/src/components/typeahead.tsx +57 -59
- package/src/components/voice-indicator.tsx +158 -141
- package/src/components/voice-subscribe-events.ts +20 -0
- package/src/globals.tsx +42 -40
- package/src/hooks.test.tsx +141 -134
- package/src/hooks.ts +80 -48
- package/src/index.tsx +17 -10
- package/src/mention-configs.ts +122 -68
- package/src/screens/assistants/assistant-config.tsx +28 -18
- package/src/screens/assistants/assistant-details.tsx +35 -36
- package/src/screens/assistants/assistant-info.tsx +16 -11
- package/src/screens/assistants/assistant-list.tsx +37 -34
- package/src/screens/assistants/assistant-tools.tsx +41 -20
- package/src/screens/console-logs/console-logs-list.tsx +173 -140
- package/src/screens/console-logs/log-display.tsx +65 -38
- package/src/screens/console-logs/log-filters.tsx +4 -3
- package/src/screens/console-logs/mobile-log-card.tsx +78 -71
- package/src/screens/console-logs/resizable-table-header.tsx +29 -21
- package/src/screens/contacts/contact-details.tsx +29 -30
- package/src/screens/contacts/contact-list.tsx +71 -60
- package/src/screens/contacts/index.ts +5 -5
- package/src/screens/contacts/user-connect.tsx +177 -171
- package/src/screens/data-explorer/data-explorer.tsx +134 -98
- package/src/screens/data-explorer/index.ts +2 -3
- package/src/screens/data-explorer/query-executor.tsx +90 -80
- package/src/screens/groups/group-details.tsx +120 -101
- package/src/screens/groups/group-invite-listener.tsx +34 -37
- package/src/screens/groups/group-list.tsx +119 -103
- package/src/screens/groups/group-members.tsx +225 -164
- package/src/screens/groups/index.ts +5 -6
- package/src/screens/join-group/index.ts +2 -2
- package/src/screens/join-group/join-group.tsx +41 -39
- package/src/screens/network-viewer/connection-troubleshooter.tsx +145 -104
- package/src/screens/network-viewer/cpu-usage-graph.tsx +39 -43
- package/src/screens/network-viewer/device-details-modal.tsx +46 -59
- package/src/screens/network-viewer/group-details-modal.tsx +68 -49
- package/src/screens/network-viewer/index.ts +4 -5
- package/src/screens/network-viewer/network-viewer-ipc.ts +23 -0
- package/src/screens/network-viewer/network-viewer.tsx +261 -236
- package/src/screens/network-viewer/usage-graph.tsx +57 -49
- package/src/screens/packages/package-details.tsx +43 -35
- package/src/screens/packages/package-info.tsx +107 -66
- package/src/screens/packages/package-list.tsx +175 -98
- package/src/screens/packages/package-new-local.tsx +28 -26
- package/src/screens/packages/package-versions.tsx +102 -77
- package/src/screens/peer-types/peer-type-details.tsx +60 -50
- package/src/screens/peer-types/peer-type-list.tsx +20 -30
- package/src/screens/search/global-search.tsx +153 -137
- package/src/screens/settings/color-mode-dropdown.tsx +52 -35
- package/src/screens/settings/settings-page.tsx +215 -141
- package/src/screens/settings/voice-settings-agent.tsx +13 -12
- package/src/screens/settings/voice-settings-api-keys.tsx +14 -12
- package/src/screens/settings/voice-settings-output.tsx +12 -11
- package/src/screens/settings/voice-settings-providers.tsx +7 -3
- package/src/screens/settings/voice-settings-types.ts +52 -49
- package/src/screens/settings/voice-settings-wake-word.tsx +25 -9
- package/src/screens/settings/voice-settings.tsx +66 -43
- package/src/screens/setup-user.tsx +88 -41
- package/src/screens/tools/tool-code.tsx +12 -17
- package/src/screens/tools/tool-details.tsx +28 -28
- package/src/screens/tools/tool-info.tsx +14 -19
- package/src/screens/tools/tool-list.tsx +58 -40
- package/src/screens/tools/tool-schema.tsx +16 -9
- package/src/screens/tools/tool-test-details.tsx +11 -22
- package/src/screens/tools/tool-test-list.tsx +29 -30
- package/src/screens/variables/variable-details.tsx +63 -51
- package/src/screens/variables/variable-list.tsx +29 -30
- package/src/screens/welcome-modal.tsx +68 -48
- package/src/screens/workflows/workflow-details.tsx +40 -30
- package/src/screens/workflows/workflow-info.tsx +4 -11
- package/src/screens/workflows/workflow-instructions.tsx +35 -28
- package/src/screens/workflows/workflow-list.tsx +50 -40
- package/src/setupTests.ts +14 -13
- package/src/system-apps/assistants.app.ts +5 -5
- package/src/system-apps/console-logs.app.ts +4 -4
- package/src/system-apps/contacts.app.ts +6 -6
- package/src/system-apps/data-explorer.app.ts +5 -5
- package/src/system-apps/groups.app.ts +6 -6
- package/src/system-apps/index.ts +49 -49
- package/src/system-apps/join-group.app.ts +5 -5
- package/src/system-apps/mobile-settings.app.ts +4 -5
- package/src/system-apps/network-viewer.app.ts +5 -5
- package/src/system-apps/packages.app.ts +5 -5
- package/src/system-apps/search.app.ts +6 -6
- package/src/system-apps/settings.app.ts +5 -5
- package/src/system-apps/threads.app.ts +5 -5
- package/src/system-apps/tools.app.ts +5 -5
- package/src/system-apps/types.app.ts +5 -5
- package/src/system-apps/variables.app.ts +5 -5
- package/src/system-apps/workflows.app.ts +5 -5
- package/src/tabs-layout/tabs-layout.tsx +345 -254
- package/src/tabs-layout/tabs-state.ts +100 -81
- package/src/ui-defaults/index.ts +2 -3
- package/src/ui-defaults/list-screen.tsx +45 -40
- package/src/ui-defaults/markdown-field.tsx +22 -26
- package/src/ui-router/routes-loader.ts +40 -24
- package/src/ui-router/ui-loader.tsx +312 -214
- package/src/utils.ts +68 -81
- package/tsconfig.json +5 -10
- package/dist/components/input-datetime.d.ts +0 -7
- package/dist/components/input-datetime.js +0 -35
- package/dist/components/lazy-sortable-list.d.ts +0 -29
- package/dist/components/lazy-sortable-list.js +0 -12
- package/dist/components/left-bar.d.ts +0 -5
- package/dist/components/left-bar.js +0 -207
- package/dist/components/main-content-container.d.ts +0 -2
- package/dist/components/main-content-container.js +0 -92
- package/dist/components/messages/thread-view.d.ts +0 -6
- package/dist/components/messages/thread-view.js +0 -174
- package/dist/components/off-canvas.d.ts +0 -13
- package/dist/components/off-canvas.js +0 -89
- package/dist/components/text-list-editor.tsx/text-list-editor.d.ts +0 -6
- package/dist/components/text-list-editor.tsx/text-list-editor.js +0 -13
- package/dist/components/top-bar.d.ts +0 -2
- package/dist/components/top-bar.js +0 -51
- package/dist/components/typeahead/mentions-plugin.d.ts +0 -7
- package/dist/components/typeahead/mentions-plugin.js +0 -203
- package/dist/components/typeahead/typeahead-editor.d.ts +0 -15
- package/dist/components/typeahead/typeahead-editor.js +0 -134
- package/dist/components/typeahead/typeahead.d.ts +0 -12
- package/dist/components/typeahead/typeahead.js +0 -94
- package/dist/screens/profile.d.ts +0 -2
- package/dist/screens/profile.js +0 -76
- package/src/components/input-datetime.tsx +0 -41
- package/src/components/lazy-sortable-list.tsx +0 -51
- package/src/components/left-bar.tsx +0 -322
- package/src/components/main-content-container.tsx +0 -79
- package/src/components/messages/thread-view.tsx +0 -214
- package/src/components/off-canvas.tsx +0 -83
- package/src/components/text-list-editor.tsx/text-list-editor.tsx +0 -13
- package/src/components/top-bar.tsx +0 -119
- package/src/components/typeahead/mentions-plugin.tsx +0 -265
- package/src/components/typeahead/typeahead-editor.tsx +0 -140
- package/src/components/typeahead/typeahead.tsx +0 -77
- package/src/screens/profile.tsx +0 -75
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAppNav, IPackage, Observable } from "@peers-app/peers-sdk";
|
|
1
|
+
import { type IAppNav, type IPackage, type Observable } from "@peers-app/peers-sdk";
|
|
2
2
|
export interface TabState {
|
|
3
3
|
tabId: string;
|
|
4
4
|
packageId?: string;
|
|
@@ -18,7 +18,7 @@ export declare const recentlyUsedApps: Observable<string[]> & {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const initializedTabs: Set<string>;
|
|
20
20
|
export declare function goToTabPath(path: string): void;
|
|
21
|
-
export declare const handleMainPathChanged: (oldPath: string, newPath: string, setNewMainPath: (
|
|
21
|
+
export declare const handleMainPathChanged: (oldPath: string, newPath: string, setNewMainPath: (path: string) => void) => void;
|
|
22
22
|
type AppInfo = {
|
|
23
23
|
navItem: IAppNav;
|
|
24
24
|
package: IPackage;
|
|
@@ -8,27 +8,27 @@ const globals_1 = require("../globals");
|
|
|
8
8
|
const system_apps_1 = require("../system-apps");
|
|
9
9
|
const routes_loader_1 = require("../ui-router/routes-loader");
|
|
10
10
|
exports.launcherApp = {
|
|
11
|
-
tabId:
|
|
12
|
-
packageId:
|
|
13
|
-
path:
|
|
14
|
-
title:
|
|
15
|
-
iconClassName:
|
|
11
|
+
tabId: "launcher",
|
|
12
|
+
packageId: "launcher",
|
|
13
|
+
path: "",
|
|
14
|
+
title: "Apps",
|
|
15
|
+
iconClassName: "bi-grid-3x3-gap",
|
|
16
16
|
};
|
|
17
17
|
// Persistent vars for storage (write-only, no subscription to avoid oscillation)
|
|
18
|
-
const _persistentActiveTabs = (0, peers_sdk_1.groupDeviceVar)(
|
|
18
|
+
const _persistentActiveTabs = (0, peers_sdk_1.groupDeviceVar)("activeTabs", {
|
|
19
19
|
defaultValue: [exports.launcherApp],
|
|
20
20
|
});
|
|
21
|
-
const _persistentActiveTabId = (0, peers_sdk_1.groupDeviceVar)(
|
|
22
|
-
defaultValue:
|
|
21
|
+
const _persistentActiveTabId = (0, peers_sdk_1.groupDeviceVar)("activeTabId", {
|
|
22
|
+
defaultValue: "launcher",
|
|
23
23
|
});
|
|
24
|
-
const _persistentRecentlyUsedApps = (0, peers_sdk_1.groupUserVar)(
|
|
24
|
+
const _persistentRecentlyUsedApps = (0, peers_sdk_1.groupUserVar)("recentlyUsedApps", {
|
|
25
25
|
defaultValue: [],
|
|
26
26
|
});
|
|
27
27
|
// In-memory observables for UI state (loaded once, then write-through to persistent vars)
|
|
28
28
|
exports.activeTabs = (() => {
|
|
29
29
|
const obs = (0, peers_sdk_1.observable)([exports.launcherApp]);
|
|
30
30
|
// Write-through to persistent var on change
|
|
31
|
-
obs.subscribe(value => {
|
|
31
|
+
obs.subscribe((value) => {
|
|
32
32
|
_persistentActiveTabs(value);
|
|
33
33
|
});
|
|
34
34
|
// Load initial value once
|
|
@@ -38,9 +38,9 @@ exports.activeTabs = (() => {
|
|
|
38
38
|
return Object.assign(obs, { loadingPromise });
|
|
39
39
|
})();
|
|
40
40
|
exports.activeTabId = (() => {
|
|
41
|
-
const obs = (0, peers_sdk_1.observable)(
|
|
41
|
+
const obs = (0, peers_sdk_1.observable)("launcher");
|
|
42
42
|
// Write-through to persistent var on change
|
|
43
|
-
obs.subscribe(value => {
|
|
43
|
+
obs.subscribe((value) => {
|
|
44
44
|
_persistentActiveTabId(value);
|
|
45
45
|
});
|
|
46
46
|
// Load initial value once
|
|
@@ -52,7 +52,7 @@ exports.activeTabId = (() => {
|
|
|
52
52
|
exports.recentlyUsedApps = (() => {
|
|
53
53
|
const obs = (0, peers_sdk_1.observable)([]);
|
|
54
54
|
// Write-through to persistent var on change
|
|
55
|
-
obs.subscribe(value => {
|
|
55
|
+
obs.subscribe((value) => {
|
|
56
56
|
_persistentRecentlyUsedApps(value);
|
|
57
57
|
});
|
|
58
58
|
// Load initial value once
|
|
@@ -63,7 +63,7 @@ exports.recentlyUsedApps = (() => {
|
|
|
63
63
|
})();
|
|
64
64
|
exports.initializedTabs = new Set();
|
|
65
65
|
function goToTabPath(path) {
|
|
66
|
-
const tab = (0, exports.activeTabs)().find(t => t.path === path);
|
|
66
|
+
const tab = (0, exports.activeTabs)().find((t) => t.path === path);
|
|
67
67
|
if (tab) {
|
|
68
68
|
(0, exports.activeTabId)(tab.tabId);
|
|
69
69
|
}
|
|
@@ -74,45 +74,52 @@ function goToTabPath(path) {
|
|
|
74
74
|
path: path,
|
|
75
75
|
title: appInfo.navItem.displayName || appInfo.navItem.name,
|
|
76
76
|
packageId: appInfo.package.packageId,
|
|
77
|
-
iconClassName: appInfo.navItem.iconClassName
|
|
77
|
+
iconClassName: appInfo.navItem.iconClassName,
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
//
|
|
81
|
+
// No app matched — navigate by updating the active tab's path (e.g. deep link).
|
|
82
|
+
// Must replace the tab object (immutable): TabContentRenderer is memoized on tab.path,
|
|
83
|
+
// and mutating in place makes prev/next props compare equal so Router never re-renders.
|
|
82
84
|
const currentTabId = (0, exports.activeTabId)();
|
|
83
85
|
const currentTabs = (0, exports.activeTabs)();
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const idx = currentTabs.findIndex((t) => t.tabId === currentTabId);
|
|
87
|
+
if (idx >= 0 && currentTabs[idx].path !== "") {
|
|
88
|
+
const prev = currentTabs[idx];
|
|
89
|
+
const newTabs = [...currentTabs];
|
|
90
|
+
newTabs[idx] = { ...prev, path };
|
|
91
|
+
(0, exports.activeTabs)(newTabs);
|
|
92
|
+
if (prev.packageId !== "launcher") {
|
|
93
|
+
(0, globals_1._mainContentPath)(path);
|
|
94
|
+
}
|
|
88
95
|
}
|
|
89
96
|
else {
|
|
90
97
|
(0, exports.openNewTab)({
|
|
91
98
|
path: path,
|
|
92
99
|
title: "New Tab",
|
|
93
|
-
packageId:
|
|
94
|
-
iconClassName:
|
|
100
|
+
packageId: "system-apps",
|
|
101
|
+
iconClassName: "bi-question-circle",
|
|
95
102
|
});
|
|
96
103
|
}
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
const handleMainPathChanged = (oldPath, newPath, setNewMainPath) => {
|
|
101
|
-
const oldPathPart = oldPath.toLowerCase().trim().split(
|
|
102
|
-
const newPathPart = newPath.toLowerCase().trim().split(
|
|
103
|
-
const currentTab = (0, exports.activeTabs)().find(t => t.tabId === (0, exports.activeTabId)());
|
|
108
|
+
const oldPathPart = oldPath.toLowerCase().trim().split("?")[0];
|
|
109
|
+
const newPathPart = newPath.toLowerCase().trim().split("?")[0];
|
|
110
|
+
const currentTab = (0, exports.activeTabs)().find((t) => t.tabId === (0, exports.activeTabId)());
|
|
104
111
|
if (oldPathPart === newPathPart || (currentTab && currentTab.path === newPath)) {
|
|
105
112
|
// nothing to do
|
|
106
113
|
setNewMainPath(newPath);
|
|
107
114
|
return;
|
|
108
115
|
}
|
|
109
116
|
const appInfo = determineAppFromPath(newPath);
|
|
110
|
-
if (appInfo && oldPath !==
|
|
117
|
+
if (appInfo && oldPath !== "") {
|
|
111
118
|
(0, exports.openNewTab)({
|
|
112
119
|
path: newPath,
|
|
113
120
|
title: appInfo.navItem.displayName || appInfo.navItem.name,
|
|
114
121
|
packageId: appInfo.package.packageId,
|
|
115
|
-
iconClassName: appInfo.navItem.iconClassName
|
|
122
|
+
iconClassName: appInfo.navItem.iconClassName,
|
|
116
123
|
});
|
|
117
124
|
}
|
|
118
125
|
else {
|
|
@@ -123,55 +130,60 @@ exports.handleMainPathChanged = handleMainPathChanged;
|
|
|
123
130
|
function determineAppFromPath(path) {
|
|
124
131
|
const launcherInfo = {
|
|
125
132
|
navItem: {
|
|
126
|
-
name:
|
|
127
|
-
navigationPath:
|
|
128
|
-
iconClassName: exports.launcherApp.iconClassName ||
|
|
133
|
+
name: "Apps",
|
|
134
|
+
navigationPath: "",
|
|
135
|
+
iconClassName: exports.launcherApp.iconClassName || "bi-grid-3x3-gap",
|
|
129
136
|
},
|
|
130
|
-
package: system_apps_1.systemPackage
|
|
137
|
+
package: system_apps_1.systemPackage,
|
|
131
138
|
};
|
|
132
|
-
if (!path || path ===
|
|
139
|
+
if (!path || path === "" || path === "/") {
|
|
133
140
|
return launcherInfo;
|
|
134
141
|
}
|
|
135
142
|
// Remove leading/trailing slashes and query params
|
|
136
|
-
path = path.toLowerCase().trim().split(
|
|
137
|
-
if (path.startsWith(
|
|
143
|
+
path = path.toLowerCase().trim().split("?")[0];
|
|
144
|
+
if (path.startsWith("/")) {
|
|
138
145
|
path = path.substring(1);
|
|
139
146
|
}
|
|
140
|
-
const rootPath = path.split(
|
|
147
|
+
const rootPath = path.split("/")[0];
|
|
141
148
|
const _allPackages = [system_apps_1.systemPackage, ...(0, routes_loader_1.allPackages)()]; // WARNING allPackages might not be loaded yet
|
|
142
149
|
const allAppInfos = _allPackages
|
|
143
|
-
.filter(pkg => (pkg.appNavs?.length ?? 0) > 0)
|
|
144
|
-
.flatMap(pkg =>
|
|
150
|
+
.filter((pkg) => (pkg.appNavs?.length ?? 0) > 0)
|
|
151
|
+
.flatMap((pkg) => {
|
|
152
|
+
const navs = pkg.appNavs;
|
|
153
|
+
if (!navs)
|
|
154
|
+
return [];
|
|
155
|
+
return navs.map((navItem) => ({ navItem, package: pkg }));
|
|
156
|
+
});
|
|
145
157
|
// Find the most relevant app based on path
|
|
146
158
|
for (const appInfo of allAppInfos) {
|
|
147
159
|
const navPath = appInfo.navItem.navigationPath || appInfo.navItem.name.toLowerCase();
|
|
148
160
|
// Check for exact match or path starting with nav path
|
|
149
|
-
if (rootPath === navPath || rootPath.startsWith(navPath
|
|
161
|
+
if (rootPath === navPath || rootPath.startsWith(`${navPath}/`)) {
|
|
150
162
|
// Return the first matching app
|
|
151
163
|
return {
|
|
152
164
|
navItem: appInfo.navItem,
|
|
153
|
-
package: appInfo.package
|
|
165
|
+
package: appInfo.package,
|
|
154
166
|
};
|
|
155
167
|
}
|
|
156
168
|
}
|
|
157
169
|
// look for package-specific routes
|
|
158
170
|
// uri in format of "package-nav/{packageId}/{path}"
|
|
159
|
-
const packageNavPrefix =
|
|
171
|
+
const packageNavPrefix = "package-nav/";
|
|
160
172
|
if (path.startsWith(packageNavPrefix)) {
|
|
161
|
-
const parts = path.substring(packageNavPrefix.length).split(
|
|
173
|
+
const parts = path.substring(packageNavPrefix.length).split("/");
|
|
162
174
|
if (parts.length > 0) {
|
|
163
175
|
const packageId = parts[0];
|
|
164
|
-
const pkg = _allPackages.find(p => p.packageId === packageId);
|
|
176
|
+
const pkg = _allPackages.find((p) => p.packageId === packageId);
|
|
165
177
|
if (pkg) {
|
|
166
|
-
const subPath = parts.slice(1).join(
|
|
167
|
-
const navItem = pkg.appNavs?.find(n => {
|
|
178
|
+
const subPath = parts.slice(1).join("/");
|
|
179
|
+
const navItem = pkg.appNavs?.find((n) => {
|
|
168
180
|
const navPath = n.navigationPath || n.name.toLowerCase();
|
|
169
|
-
return subPath === navPath || subPath.startsWith(navPath
|
|
181
|
+
return subPath === navPath || subPath.startsWith(`${navPath}/`);
|
|
170
182
|
});
|
|
171
183
|
if (navItem) {
|
|
172
184
|
return {
|
|
173
185
|
navItem,
|
|
174
|
-
package: pkg
|
|
186
|
+
package: pkg,
|
|
175
187
|
};
|
|
176
188
|
}
|
|
177
189
|
}
|
|
@@ -186,7 +198,7 @@ const updateActiveTabTitle = (newTitle) => {
|
|
|
186
198
|
// using setTimeout to get around a race condition for setting title on new tabs
|
|
187
199
|
setTimeout(() => {
|
|
188
200
|
const currentTabs = (0, exports.activeTabs)();
|
|
189
|
-
const activeTab = currentTabs.find(t => t.tabId === (0, exports.activeTabId)());
|
|
201
|
+
const activeTab = currentTabs.find((t) => t.tabId === (0, exports.activeTabId)());
|
|
190
202
|
if (activeTab) {
|
|
191
203
|
activeTab.title = newTitle;
|
|
192
204
|
(0, exports.activeTabs)([...currentTabs]);
|
|
@@ -201,7 +213,7 @@ const openNewTab = (tab, forceNew = false) => {
|
|
|
201
213
|
tabId: (0, peers_sdk_1.newid)(),
|
|
202
214
|
};
|
|
203
215
|
const currentTabs = (0, exports.activeTabs)();
|
|
204
|
-
const existingTabIndex = currentTabs.findIndex(t => t.packageId === tab.packageId && t.path === tab.path);
|
|
216
|
+
const existingTabIndex = currentTabs.findIndex((t) => t.packageId === tab.packageId && t.path === tab.path);
|
|
205
217
|
if (existingTabIndex >= 0 && !forceNew) {
|
|
206
218
|
// Switch to existing tab
|
|
207
219
|
(0, exports.activeTabId)(currentTabs[existingTabIndex].tabId);
|
|
@@ -212,9 +224,9 @@ const openNewTab = (tab, forceNew = false) => {
|
|
|
212
224
|
(0, exports.activeTabId)(newTab.tabId);
|
|
213
225
|
}
|
|
214
226
|
// Update recently used (track by path instead of packageId)
|
|
215
|
-
if (tab.path && tab.packageId !==
|
|
227
|
+
if (tab.path && tab.packageId !== "launcher") {
|
|
216
228
|
const recent = (0, exports.recentlyUsedApps)();
|
|
217
|
-
const filtered = recent.filter(path => path !== tab.path);
|
|
229
|
+
const filtered = recent.filter((path) => path !== tab.path);
|
|
218
230
|
(0, exports.recentlyUsedApps)([tab.path, ...filtered].slice(0, 8));
|
|
219
231
|
}
|
|
220
232
|
};
|
|
@@ -223,15 +235,15 @@ exports.openNewTab = openNewTab;
|
|
|
223
235
|
const closeCurrentTab = () => {
|
|
224
236
|
const currentTabs = (0, exports.activeTabs)();
|
|
225
237
|
const _activeTabId = (0, exports.activeTabId)();
|
|
226
|
-
const tabToClose = currentTabs.find(t => t.tabId === _activeTabId);
|
|
238
|
+
const tabToClose = currentTabs.find((t) => t.tabId === _activeTabId);
|
|
227
239
|
if (!tabToClose || tabToClose.tabId === "launcher")
|
|
228
240
|
return;
|
|
229
|
-
const closedIndex = currentTabs.findIndex(t => t.tabId === _activeTabId);
|
|
230
|
-
const newTabs = currentTabs.filter(t => t.tabId !== _activeTabId);
|
|
241
|
+
const closedIndex = currentTabs.findIndex((t) => t.tabId === _activeTabId);
|
|
242
|
+
const newTabs = currentTabs.filter((t) => t.tabId !== _activeTabId);
|
|
231
243
|
(0, exports.activeTabs)(newTabs);
|
|
232
244
|
exports.initializedTabs.delete(_activeTabId);
|
|
233
245
|
if (newTabs.length === 0) {
|
|
234
|
-
(0, exports.activeTabId)(
|
|
246
|
+
(0, exports.activeTabId)("launcher");
|
|
235
247
|
}
|
|
236
248
|
else if (closedIndex < newTabs.length) {
|
|
237
249
|
(0, exports.activeTabId)(newTabs[closedIndex].tabId);
|
|
@@ -245,7 +257,7 @@ exports.closeCurrentTab = closeCurrentTab;
|
|
|
245
257
|
const switchToNextTab = () => {
|
|
246
258
|
const currentTabs = (0, exports.activeTabs)();
|
|
247
259
|
const activeTab = (0, exports.activeTabId)();
|
|
248
|
-
const currentIndex = currentTabs.findIndex(tab => tab.tabId === activeTab);
|
|
260
|
+
const currentIndex = currentTabs.findIndex((tab) => tab.tabId === activeTab);
|
|
249
261
|
if (currentIndex === -1)
|
|
250
262
|
return;
|
|
251
263
|
const nextIndex = currentIndex === currentTabs.length - 1 ? 0 : currentIndex + 1;
|
|
@@ -256,7 +268,7 @@ exports.switchToNextTab = switchToNextTab;
|
|
|
256
268
|
const switchToPreviousTab = () => {
|
|
257
269
|
const currentTabs = (0, exports.activeTabs)();
|
|
258
270
|
const activeTab = (0, exports.activeTabId)();
|
|
259
|
-
const currentIndex = currentTabs.findIndex(tab => tab.tabId === activeTab);
|
|
271
|
+
const currentIndex = currentTabs.findIndex((tab) => tab.tabId === activeTab);
|
|
260
272
|
if (currentIndex === -1)
|
|
261
273
|
return;
|
|
262
274
|
const prevIndex = currentIndex === 0 ? currentTabs.length - 1 : currentIndex - 1;
|
|
@@ -264,18 +276,18 @@ const switchToPreviousTab = () => {
|
|
|
264
276
|
};
|
|
265
277
|
exports.switchToPreviousTab = switchToPreviousTab;
|
|
266
278
|
// Keyboard shortcuts are now handled by the command palette system
|
|
267
|
-
exports.activeTabId.subscribe(newActiveTab => {
|
|
279
|
+
exports.activeTabId.subscribe((newActiveTab) => {
|
|
268
280
|
const currentTabs = (0, exports.activeTabs)();
|
|
269
|
-
const activeTab = currentTabs.find(t => t.tabId === newActiveTab);
|
|
281
|
+
const activeTab = currentTabs.find((t) => t.tabId === newActiveTab);
|
|
270
282
|
if (!activeTab) {
|
|
271
|
-
console.warn(
|
|
283
|
+
console.warn("Active tab not found:", newActiveTab);
|
|
272
284
|
return;
|
|
273
285
|
}
|
|
274
286
|
// Update mainContentPath for the new active tab
|
|
275
|
-
if (activeTab.packageId !==
|
|
287
|
+
if (activeTab.packageId !== "launcher") {
|
|
276
288
|
(0, globals_1._mainContentPath)(activeTab.path);
|
|
277
289
|
}
|
|
278
290
|
else {
|
|
279
|
-
(0, globals_1._mainContentPath)(
|
|
291
|
+
(0, globals_1._mainContentPath)(""); // Launcher or fallback
|
|
280
292
|
}
|
|
281
293
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import "./list-screen";
|
|
2
|
+
import "./markdown-field";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "@peers-app/peers-sdk";
|
|
3
2
|
declare const propsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
4
3
|
type IProps = z.infer<typeof propsSchema>;
|
|
5
|
-
export declare const DefaultListScreen: (
|
|
4
|
+
export declare const DefaultListScreen: (_props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export {};
|
|
@@ -1,46 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.DefaultListScreen = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
5
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const zod_1 = require("zod");
|
|
10
6
|
const list_screen_1 = require("../components/list-screen");
|
|
11
7
|
const globals_1 = require("../globals");
|
|
12
8
|
const ui_loader_1 = require("../ui-router/ui-loader");
|
|
13
|
-
const propsSchema =
|
|
9
|
+
const propsSchema = peers_sdk_1.z.object({
|
|
14
10
|
// items: zodAnyObject.array().describe('Items to display in the list'),
|
|
15
11
|
});
|
|
16
|
-
const DefaultListScreen = (
|
|
17
|
-
const path = (0, globals_1.mainContentPath)().toLowerCase().trim().split(
|
|
12
|
+
const DefaultListScreen = (_props) => {
|
|
13
|
+
const path = (0, globals_1.mainContentPath)().toLowerCase().trim().split("?")[0].split("#").pop()?.split("/")[0] || "";
|
|
18
14
|
const fuzzyTableName = ({
|
|
19
|
-
variables:
|
|
20
|
-
}[path] || path)
|
|
15
|
+
variables: "persistent_vars",
|
|
16
|
+
}[path] || path)
|
|
17
|
+
.replace(/[_-]/g, "")
|
|
18
|
+
.trim();
|
|
21
19
|
const allTables = (0, peers_sdk_1.getAllTables)();
|
|
22
|
-
const tableName = Object.keys(allTables).find(t => t.toLowerCase().replace(/[_-]/g,
|
|
23
|
-
const table = allTables[tableName ||
|
|
20
|
+
const tableName = Object.keys(allTables).find((t) => t.toLowerCase().replace(/[_-]/g, "").trim() === fuzzyTableName);
|
|
21
|
+
const table = allTables[tableName || ""];
|
|
24
22
|
if (!table) {
|
|
25
|
-
return (
|
|
26
|
-
"Table not found for path: \"",
|
|
27
|
-
path,
|
|
28
|
-
"\""));
|
|
23
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: "m-4", children: ["Table not found for path: \"", path, "\""] });
|
|
29
24
|
}
|
|
30
|
-
const idField = table.metaData.fields.find(f => f.name === table.metaData.primaryKeyName);
|
|
25
|
+
const idField = table.metaData.fields.find((f) => f.name === table.metaData.primaryKeyName);
|
|
31
26
|
if (!idField) {
|
|
32
|
-
throw new Error(
|
|
27
|
+
throw new Error("No primary key field found for table");
|
|
33
28
|
}
|
|
34
|
-
const nameField = table.metaData.fields.find(f => f.name ===
|
|
35
|
-
table.metaData.fields.find(f => f.name ===
|
|
36
|
-
table.metaData.fields.find(f => f.type === peers_sdk_1.FieldType.string);
|
|
29
|
+
const nameField = table.metaData.fields.find((f) => f.name === "name") ||
|
|
30
|
+
table.metaData.fields.find((f) => f.name === "title") ||
|
|
31
|
+
table.metaData.fields.find((f) => f.type === peers_sdk_1.FieldType.string);
|
|
37
32
|
if (!nameField) {
|
|
38
|
-
throw new Error(
|
|
33
|
+
throw new Error("No name field found to create new record with");
|
|
39
34
|
}
|
|
40
|
-
return (
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(list_screen_1.ListScreen, { table,
|
|
41
36
|
sortBy: [`-${idField.name}`],
|
|
42
37
|
newRecord: async (text) => {
|
|
43
|
-
text = text.trim().replace(/\s+/g,
|
|
38
|
+
text = text.trim().replace(/\s+/g, "_");
|
|
44
39
|
let item = table.initRecord({
|
|
45
40
|
[idField.name]: (0, peers_sdk_1.newid)(),
|
|
46
41
|
[nameField?.name]: text,
|
|
@@ -50,22 +45,23 @@ const DefaultListScreen = (props) => {
|
|
|
50
45
|
return item;
|
|
51
46
|
},
|
|
52
47
|
renderItem: (item) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} }));
|
|
48
|
+
const row = item;
|
|
49
|
+
const rowId = row[idField.name];
|
|
50
|
+
const displayName = row.name;
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "container-fluid pb-4", children: [(0, jsx_runtime_1.jsx)("i", { className: (0, peers_sdk_1.getIconClassName)(table) }), "\u00A0", (0, jsx_runtime_1.jsx)("a", { href: `#${path}/${String(rowId)}`, children: typeof displayName === "string" ? displayName : "<empty-name>" }), (0, jsx_runtime_1.jsx)("div", { style: { paddingLeft: "20px" } })] }, String(rowId)));
|
|
52
|
+
} }, path));
|
|
59
53
|
};
|
|
60
54
|
exports.DefaultListScreen = DefaultListScreen;
|
|
61
55
|
(0, ui_loader_1.registerInternalPeersUI)({
|
|
62
56
|
peersUIId: "00m5fql0x5v48vyrk5bllzdrr",
|
|
63
57
|
component: exports.DefaultListScreen,
|
|
64
|
-
routes: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
routes: [
|
|
59
|
+
{
|
|
60
|
+
isMatch: (_props, context) => context.path.split("/").length === 1,
|
|
61
|
+
uiEditMode: "view",
|
|
62
|
+
uiCategory: "screen",
|
|
63
|
+
uiSubcategory: "list",
|
|
64
|
+
priority: -Number.MAX_SAFE_INTEGER,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
71
67
|
});
|
|
@@ -1,41 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
36
4
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
37
|
-
|
|
38
|
-
const
|
|
5
|
+
// biome-ignore lint/correctness/noUnusedImports: classic JSX (`jsx: react`) needs React in scope for emit
|
|
6
|
+
const react_1 = require("react");
|
|
39
7
|
const editor_inline_1 = require("../components/markdown-editor/editor-inline");
|
|
40
8
|
const markdown_with_mentions_1 = require("../components/markdown-with-mentions");
|
|
41
9
|
const ui_loader_1 = require("../ui-router/ui-loader");
|
|
@@ -43,11 +11,11 @@ const ui_loader_1 = require("../ui-router/ui-loader");
|
|
|
43
11
|
* Markdown field component for viewing markdown content
|
|
44
12
|
*/
|
|
45
13
|
const MarkdownFieldView = (props) => {
|
|
46
|
-
const value = typeof props.value ===
|
|
14
|
+
const value = typeof props.value === "function" ? props.value() : props.value;
|
|
47
15
|
if (!value) {
|
|
48
16
|
return null;
|
|
49
17
|
}
|
|
50
|
-
return
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(markdown_with_mentions_1.MarkdownWithMentions, { content: value });
|
|
51
19
|
};
|
|
52
20
|
/**
|
|
53
21
|
* Markdown field component for editing markdown content
|
|
@@ -57,8 +25,8 @@ const MarkdownFieldEdit = (props) => {
|
|
|
57
25
|
onChangeRef.current = props.onChange;
|
|
58
26
|
// Create an observable for the editor that calls onChange when it changes
|
|
59
27
|
const [valueObs] = (0, react_1.useState)(() => {
|
|
60
|
-
const initialValue = typeof props.value ===
|
|
61
|
-
const obs = (0, peers_sdk_1.observable)(initialValue ||
|
|
28
|
+
const initialValue = typeof props.value === "function" ? props.value() : props.value;
|
|
29
|
+
const obs = (0, peers_sdk_1.observable)(initialValue || "");
|
|
62
30
|
// Subscribe to changes and call onChange
|
|
63
31
|
obs.subscribe((newValue) => {
|
|
64
32
|
onChangeRef.current?.(newValue);
|
|
@@ -67,17 +35,17 @@ const MarkdownFieldEdit = (props) => {
|
|
|
67
35
|
});
|
|
68
36
|
// Sync external value changes to the observable
|
|
69
37
|
(0, react_1.useEffect)(() => {
|
|
70
|
-
const currentValue = typeof props.value ===
|
|
38
|
+
const currentValue = typeof props.value === "function" ? props.value() : props.value;
|
|
71
39
|
if (currentValue !== valueObs()) {
|
|
72
|
-
valueObs(currentValue ||
|
|
40
|
+
valueObs(currentValue || "");
|
|
73
41
|
}
|
|
74
|
-
}, [props.value]);
|
|
75
|
-
return (
|
|
42
|
+
}, [props.value, valueObs]);
|
|
43
|
+
return (0, jsx_runtime_1.jsx)(editor_inline_1.MarkdownEditorInline, { value: valueObs });
|
|
76
44
|
};
|
|
77
45
|
// Schema for markdown field props
|
|
78
|
-
const markdownFieldPropsSchema =
|
|
79
|
-
value:
|
|
80
|
-
onChange:
|
|
46
|
+
const markdownFieldPropsSchema = peers_sdk_1.z.object({
|
|
47
|
+
value: peers_sdk_1.z.any(), // Can be string or Observable<string>
|
|
48
|
+
onChange: peers_sdk_1.z.function().optional(),
|
|
81
49
|
});
|
|
82
50
|
// Register the view mode component
|
|
83
51
|
(0, ui_loader_1.registerInternalPeersUI)({
|
|
@@ -85,11 +53,11 @@ const markdownFieldPropsSchema = zod_1.z.object({
|
|
|
85
53
|
propsSchema: markdownFieldPropsSchema,
|
|
86
54
|
routes: [
|
|
87
55
|
{
|
|
88
|
-
uiCategory:
|
|
89
|
-
uiSubcategory:
|
|
90
|
-
uiEditMode:
|
|
91
|
-
}
|
|
92
|
-
]
|
|
56
|
+
uiCategory: "field",
|
|
57
|
+
uiSubcategory: "markdown",
|
|
58
|
+
uiEditMode: "view",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
93
61
|
});
|
|
94
62
|
// Register the edit mode component
|
|
95
63
|
(0, ui_loader_1.registerInternalPeersUI)({
|
|
@@ -97,9 +65,9 @@ const markdownFieldPropsSchema = zod_1.z.object({
|
|
|
97
65
|
propsSchema: markdownFieldPropsSchema,
|
|
98
66
|
routes: [
|
|
99
67
|
{
|
|
100
|
-
uiCategory:
|
|
101
|
-
uiSubcategory:
|
|
102
|
-
uiEditMode:
|
|
103
|
-
}
|
|
104
|
-
]
|
|
68
|
+
uiCategory: "field",
|
|
69
|
+
uiSubcategory: "markdown",
|
|
70
|
+
uiEditMode: "edit",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
105
73
|
});
|
|
@@ -3,8 +3,8 @@ export declare const allPackages: import("@peers-app/peers-sdk").Observable<{
|
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
5
|
signature: string;
|
|
6
|
-
createdBy: string;
|
|
7
6
|
packageId: string;
|
|
7
|
+
createdBy: string;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
appNavs?: {
|
|
10
10
|
name: string;
|