@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,5 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
computePackageVersionHash,
|
|
3
|
+
type IDoc,
|
|
4
|
+
type IPackage,
|
|
5
|
+
type IPackageVersion,
|
|
6
|
+
Packages,
|
|
7
|
+
PackageVersions,
|
|
8
|
+
Users,
|
|
9
|
+
} from "@peers-app/peers-sdk";
|
|
10
|
+
import { useState } from "react";
|
|
3
11
|
import { useObservable, useObservableState, usePromise } from "../../hooks";
|
|
4
12
|
|
|
5
13
|
function formatDate(iso: string): string {
|
|
@@ -8,7 +16,7 @@ function formatDate(iso: string): string {
|
|
|
8
16
|
const now = new Date();
|
|
9
17
|
const diffMs = now.getTime() - d.getTime();
|
|
10
18
|
const diffMins = Math.floor(diffMs / 60000);
|
|
11
|
-
if (diffMins < 1) return
|
|
19
|
+
if (diffMins < 1) return "just now";
|
|
12
20
|
if (diffMins < 60) return `${diffMins}m ago`;
|
|
13
21
|
const diffHours = Math.floor(diffMins / 60);
|
|
14
22
|
if (diffHours < 24) return `${diffHours}h ago`;
|
|
@@ -21,10 +29,10 @@ function formatDate(iso: string): string {
|
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
function tagBadgeClass(tag?: string): string {
|
|
24
|
-
if (!tag) return
|
|
25
|
-
if (tag.startsWith(
|
|
26
|
-
if (tag ===
|
|
27
|
-
return
|
|
32
|
+
if (!tag) return "text-bg-secondary";
|
|
33
|
+
if (tag.startsWith("beta")) return "text-bg-warning";
|
|
34
|
+
if (tag === "stable") return "text-bg-info";
|
|
35
|
+
return "text-bg-secondary";
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
@@ -35,29 +43,35 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
35
43
|
const [activating, setActivating] = useState<string | null>(null);
|
|
36
44
|
const [deleting, setDeleting] = useState<string | null>(null);
|
|
37
45
|
const [pinning, setPinning] = useState(false);
|
|
38
|
-
const isPinned = versionFollowRange ===
|
|
46
|
+
const isPinned = versionFollowRange === "pinned";
|
|
39
47
|
|
|
40
|
-
const versions = usePromise(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
const versions = usePromise(
|
|
49
|
+
async () => {
|
|
50
|
+
const all = await PackageVersions().list({ packageId: pkg.packageId });
|
|
51
|
+
const parse = (v: string) => v.split(".").map(Number);
|
|
52
|
+
const sorted = all.sort((a, b) => {
|
|
53
|
+
const [aMaj, aMin, aPat] = parse(a.version || "0.0.0");
|
|
54
|
+
const [bMaj, bMin, bPat] = parse(b.version || "0.0.0");
|
|
55
|
+
if (bMaj !== aMaj) return bMaj - aMaj;
|
|
56
|
+
if (bMin !== aMin) return bMin - aMin;
|
|
57
|
+
if (bPat !== aPat) return bPat - aPat;
|
|
58
|
+
return (b.createdAt || "").localeCompare(a.createdAt || "");
|
|
59
|
+
});
|
|
60
|
+
const uniqueCreatorIds = [...new Set(sorted.map((pv) => pv.createdBy).filter(Boolean))];
|
|
61
|
+
const userMap = new Map<string, string>();
|
|
62
|
+
await Promise.all(
|
|
63
|
+
uniqueCreatorIds.map(async (uid) => {
|
|
64
|
+
try {
|
|
65
|
+
const user = await Users().get(uid, { useCache: true });
|
|
66
|
+
if (user?.name) userMap.set(uid, user.name);
|
|
67
|
+
} catch {}
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
return { sorted, userMap };
|
|
71
|
+
},
|
|
72
|
+
undefined,
|
|
73
|
+
[pkg.packageId, refreshKey()],
|
|
74
|
+
);
|
|
61
75
|
|
|
62
76
|
async function activateVersion(pv: IPackageVersion) {
|
|
63
77
|
setActivating(pv.packageVersionId);
|
|
@@ -77,7 +91,8 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
async function deleteVersion(pv: IPackageVersion) {
|
|
80
|
-
if (!confirm(`Delete version v${pv.version} (${pv.packageVersionHash?.substring(0, 8)})?`))
|
|
94
|
+
if (!confirm(`Delete version v${pv.version} (${pv.packageVersionHash?.substring(0, 8)})?`))
|
|
95
|
+
return;
|
|
81
96
|
setDeleting(pv.packageVersionId);
|
|
82
97
|
try {
|
|
83
98
|
await PackageVersions().delete(pv.packageVersionId);
|
|
@@ -91,7 +106,13 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
91
106
|
|
|
92
107
|
async function promoteVersion(pv: IPackageVersion, newTag: string) {
|
|
93
108
|
try {
|
|
94
|
-
const pvHash = computePackageVersionHash(
|
|
109
|
+
const pvHash = computePackageVersionHash(
|
|
110
|
+
pv.version,
|
|
111
|
+
newTag,
|
|
112
|
+
pv.packageBundleFileHash,
|
|
113
|
+
pv.routesBundleFileHash,
|
|
114
|
+
pv.uiBundleFileHash,
|
|
115
|
+
);
|
|
95
116
|
const updated = { ...pv, versionTag: newTag, packageVersionHash: pvHash };
|
|
96
117
|
await PackageVersions().signAndSave(updated, { saveAsSnapshot: true });
|
|
97
118
|
refreshKey(refreshKey() + 1);
|
|
@@ -102,7 +123,13 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
102
123
|
|
|
103
124
|
async function updateVersion(pv: IPackageVersion, newSemver: string) {
|
|
104
125
|
try {
|
|
105
|
-
const pvHash = computePackageVersionHash(
|
|
126
|
+
const pvHash = computePackageVersionHash(
|
|
127
|
+
newSemver,
|
|
128
|
+
pv.versionTag || "beta",
|
|
129
|
+
pv.packageBundleFileHash,
|
|
130
|
+
pv.routesBundleFileHash,
|
|
131
|
+
pv.uiBundleFileHash,
|
|
132
|
+
);
|
|
106
133
|
const updated = { ...pv, version: newSemver, packageVersionHash: pvHash };
|
|
107
134
|
await PackageVersions().signAndSave(updated, { saveAsSnapshot: true });
|
|
108
135
|
refreshKey(refreshKey() + 1);
|
|
@@ -116,7 +143,7 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
116
143
|
try {
|
|
117
144
|
const current = await Packages().get(pkg.packageId);
|
|
118
145
|
if (current) {
|
|
119
|
-
current.versionFollowRange =
|
|
146
|
+
current.versionFollowRange = "pinned";
|
|
120
147
|
await Packages().signAndSave(current);
|
|
121
148
|
await pkg.load();
|
|
122
149
|
}
|
|
@@ -128,7 +155,11 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
128
155
|
}
|
|
129
156
|
|
|
130
157
|
if (!versions) {
|
|
131
|
-
return
|
|
158
|
+
return (
|
|
159
|
+
<div className="text-center p-3">
|
|
160
|
+
<div className="spinner-border spinner-border-sm" />
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
132
163
|
}
|
|
133
164
|
|
|
134
165
|
const { sorted, userMap } = versions;
|
|
@@ -144,9 +175,11 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
144
175
|
|
|
145
176
|
return (
|
|
146
177
|
<div>
|
|
147
|
-
<small className="text-muted">
|
|
178
|
+
<small className="text-muted">
|
|
179
|
+
{sorted.length} version{sorted.length !== 1 ? "s" : ""}
|
|
180
|
+
</small>
|
|
148
181
|
<div className="list-group mt-2">
|
|
149
|
-
{sorted.map(pv => (
|
|
182
|
+
{sorted.map((pv) => (
|
|
150
183
|
<VersionRow
|
|
151
184
|
key={pv.packageVersionId}
|
|
152
185
|
pv={pv}
|
|
@@ -168,7 +201,7 @@ export const PackageVersionsList = (props: { pkg: IDoc<IPackage> }) => {
|
|
|
168
201
|
);
|
|
169
202
|
};
|
|
170
203
|
|
|
171
|
-
const TAG_OPTIONS = [
|
|
204
|
+
const TAG_OPTIONS = ["beta", "stable"];
|
|
172
205
|
|
|
173
206
|
function VersionRow(props: {
|
|
174
207
|
pv: IPackageVersion;
|
|
@@ -202,31 +235,30 @@ function VersionRow(props: {
|
|
|
202
235
|
setEditingVersion(false);
|
|
203
236
|
}
|
|
204
237
|
|
|
205
|
-
const currentTag = pv.versionTag ||
|
|
206
|
-
const promoteTargets = TAG_OPTIONS.filter(t => t !== currentTag);
|
|
238
|
+
const currentTag = pv.versionTag || "beta";
|
|
239
|
+
const promoteTargets = TAG_OPTIONS.filter((t) => t !== currentTag);
|
|
207
240
|
|
|
208
241
|
return (
|
|
209
|
-
<div className={`list-group-item ${isActive ?
|
|
242
|
+
<div className={`list-group-item ${isActive ? "list-group-item-success" : ""}`}>
|
|
210
243
|
<div className="d-flex align-items-center justify-content-between">
|
|
211
244
|
<div className="d-flex align-items-center flex-wrap">
|
|
212
245
|
{editingVersion ? (
|
|
213
246
|
<input
|
|
214
247
|
type="text"
|
|
215
248
|
className="form-control form-control-sm me-2"
|
|
216
|
-
style={{ width:
|
|
249
|
+
style={{ width: "7em" }}
|
|
217
250
|
value={versionDraft}
|
|
218
|
-
onChange={e => setVersionDraft(e.target.value)}
|
|
251
|
+
onChange={(e) => setVersionDraft(e.target.value)}
|
|
219
252
|
onBlur={commitVersion}
|
|
220
|
-
onKeyDown={e => {
|
|
221
|
-
if (e.key ===
|
|
222
|
-
if (e.key ===
|
|
253
|
+
onKeyDown={(e) => {
|
|
254
|
+
if (e.key === "Enter") commitVersion();
|
|
255
|
+
if (e.key === "Escape") setEditingVersion(false);
|
|
223
256
|
}}
|
|
224
|
-
autoFocus
|
|
225
257
|
/>
|
|
226
258
|
) : (
|
|
227
259
|
<strong
|
|
228
260
|
className="me-2"
|
|
229
|
-
style={{ cursor:
|
|
261
|
+
style={{ cursor: "pointer" }}
|
|
230
262
|
onClick={startEditing}
|
|
231
263
|
title="Click to edit version"
|
|
232
264
|
>
|
|
@@ -234,17 +266,11 @@ function VersionRow(props: {
|
|
|
234
266
|
</strong>
|
|
235
267
|
)}
|
|
236
268
|
{pv.versionTag && (
|
|
237
|
-
<span className={`badge ${tagBadgeClass(pv.versionTag)} me-2`}>
|
|
238
|
-
{pv.versionTag}
|
|
239
|
-
</span>
|
|
269
|
+
<span className={`badge ${tagBadgeClass(pv.versionTag)} me-2`}>{pv.versionTag}</span>
|
|
240
270
|
)}
|
|
241
|
-
<code className="text-muted small me-2">
|
|
242
|
-
{pv.packageVersionHash?.substring(0, 8)}
|
|
243
|
-
</code>
|
|
271
|
+
<code className="text-muted small me-2">{pv.packageVersionHash?.substring(0, 8)}</code>
|
|
244
272
|
<small className="text-muted me-2">{formatDate(pv.createdAt)}</small>
|
|
245
|
-
{creatorName &&
|
|
246
|
-
<small className="text-muted">by {creatorName}</small>
|
|
247
|
-
)}
|
|
273
|
+
{creatorName && <small className="text-muted">by {creatorName}</small>}
|
|
248
274
|
</div>
|
|
249
275
|
<div className="d-flex gap-1 align-items-center">
|
|
250
276
|
{promoteTargets.length > 0 && (
|
|
@@ -257,12 +283,9 @@ function VersionRow(props: {
|
|
|
257
283
|
Promote
|
|
258
284
|
</button>
|
|
259
285
|
<ul className="dropdown-menu dropdown-menu-end">
|
|
260
|
-
{promoteTargets.map(tag => (
|
|
286
|
+
{promoteTargets.map((tag) => (
|
|
261
287
|
<li key={tag}>
|
|
262
|
-
<button
|
|
263
|
-
className="dropdown-item"
|
|
264
|
-
onClick={() => props.onPromote(pv, tag)}
|
|
265
|
-
>
|
|
288
|
+
<button className="dropdown-item" onClick={() => props.onPromote(pv, tag)}>
|
|
266
289
|
{currentTag} → {tag}
|
|
267
290
|
</button>
|
|
268
291
|
</li>
|
|
@@ -270,22 +293,24 @@ function VersionRow(props: {
|
|
|
270
293
|
</ul>
|
|
271
294
|
</div>
|
|
272
295
|
)}
|
|
273
|
-
{isActive ? (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
296
|
+
{isActive ? (
|
|
297
|
+
<>
|
|
298
|
+
<button
|
|
299
|
+
className="btn btn-sm btn-outline-secondary"
|
|
300
|
+
disabled={isPinned || pinning}
|
|
301
|
+
onClick={() => props.onPin()}
|
|
302
|
+
title={isPinned ? "Already pinned" : "Pin to this version (disable auto-updates)"}
|
|
303
|
+
>
|
|
304
|
+
{pinning ? (
|
|
305
|
+
<span className="spinner-border spinner-border-sm" />
|
|
306
|
+
) : (
|
|
307
|
+
<i className="bi bi-pin-fill"></i>
|
|
308
|
+
)}
|
|
309
|
+
{isPinned ? " Pinned" : " Pin"}
|
|
310
|
+
</button>
|
|
311
|
+
<span className="badge text-bg-success align-self-center">active</span>
|
|
312
|
+
</>
|
|
313
|
+
) : (
|
|
289
314
|
<button
|
|
290
315
|
className="btn btn-sm btn-outline-primary"
|
|
291
316
|
disabled={activating === pv.packageVersionId}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
type IDoc,
|
|
3
|
+
type IOSchema,
|
|
4
|
+
type IPeerType,
|
|
5
|
+
type Observable,
|
|
6
|
+
PeerTypes,
|
|
7
|
+
} from "@peers-app/peers-sdk";
|
|
8
|
+
import { useEffect } from "react";
|
|
3
9
|
import { Input } from "../../components/input";
|
|
4
10
|
import { IOSchemaEditor } from "../../components/io-schema";
|
|
5
11
|
import { LoadingIndicator } from "../../components/loading-indicator";
|
|
@@ -15,26 +21,31 @@ interface IProps {
|
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
export const PeerTypeDetails = (props: IProps) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const valueType = usePromise(
|
|
25
|
+
async () => {
|
|
26
|
+
const valueType = await PeerTypes().get(props.peerTypeId);
|
|
27
|
+
if (!valueType) {
|
|
28
|
+
throw new Error("Variable not found");
|
|
29
|
+
}
|
|
30
|
+
const doc = PeerTypes().initDoc(valueType);
|
|
31
|
+
updateActiveTabTitle(doc.name || "Type");
|
|
32
|
+
return doc;
|
|
33
|
+
},
|
|
34
|
+
undefined,
|
|
35
|
+
[props.peerTypeId],
|
|
36
|
+
);
|
|
29
37
|
|
|
30
38
|
useEffect(() => {
|
|
31
39
|
if (!valueType) return;
|
|
32
40
|
const sub = valueType.qs.name.subscribe(() => {
|
|
33
|
-
valueType.name = valueType.qs
|
|
41
|
+
valueType.name = valueType.qs
|
|
42
|
+
.name()
|
|
43
|
+
.replaceAll(/\s/g, "_")
|
|
44
|
+
.replaceAll(/[^a-zA-Z0-9_-]/g, "");
|
|
34
45
|
});
|
|
35
46
|
return () => {
|
|
36
47
|
sub.dispose();
|
|
37
|
-
}
|
|
48
|
+
};
|
|
38
49
|
}, [valueType]);
|
|
39
50
|
|
|
40
51
|
if (!valueType) {
|
|
@@ -43,7 +54,6 @@ export const PeerTypeDetails = (props: IProps) => {
|
|
|
43
54
|
|
|
44
55
|
return (
|
|
45
56
|
<div className="container-fluid p-3">
|
|
46
|
-
|
|
47
57
|
<div className="d-flex">
|
|
48
58
|
<div>
|
|
49
59
|
<h4>
|
|
@@ -54,17 +64,14 @@ export const PeerTypeDetails = (props: IProps) => {
|
|
|
54
64
|
<h4>
|
|
55
65
|
<Input
|
|
56
66
|
key={valueType.peerTypeId}
|
|
57
|
-
className=
|
|
58
|
-
style={{ width:
|
|
67
|
+
className="border border-0"
|
|
68
|
+
style={{ width: "100%", outline: "none", backgroundColor: "transparent" }}
|
|
59
69
|
value={valueType.qs.name}
|
|
60
70
|
/>
|
|
61
71
|
</h4>
|
|
62
72
|
</div>
|
|
63
73
|
<div>
|
|
64
|
-
<SaveButton
|
|
65
|
-
key={valueType.peerTypeId}
|
|
66
|
-
doc={valueType}
|
|
67
|
-
/>
|
|
74
|
+
<SaveButton key={valueType.peerTypeId} doc={valueType} />
|
|
68
75
|
</div>
|
|
69
76
|
</div>
|
|
70
77
|
|
|
@@ -72,32 +79,34 @@ export const PeerTypeDetails = (props: IProps) => {
|
|
|
72
79
|
key={valueType.peerTypeId}
|
|
73
80
|
tabs={[
|
|
74
81
|
{
|
|
75
|
-
name:
|
|
82
|
+
name: "Info",
|
|
83
|
+
content: (
|
|
76
84
|
<ScreenTabBody>
|
|
77
85
|
<VariableInfo valueType={valueType} />
|
|
78
86
|
</ScreenTabBody>
|
|
87
|
+
),
|
|
79
88
|
},
|
|
80
89
|
{
|
|
81
|
-
name:
|
|
90
|
+
name: "Schema",
|
|
91
|
+
content: (
|
|
82
92
|
<ScreenTabBody>
|
|
83
93
|
<VariableSchema valueType={valueType} />
|
|
84
94
|
</ScreenTabBody>
|
|
95
|
+
),
|
|
85
96
|
},
|
|
86
97
|
]}
|
|
87
98
|
/>
|
|
88
99
|
</div>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
100
|
+
);
|
|
101
|
+
};
|
|
92
102
|
|
|
93
103
|
const VariableInfo = (props: { valueType: IDoc<IPeerType> }) => {
|
|
94
|
-
const { valueType } = props
|
|
104
|
+
const { valueType } = props;
|
|
95
105
|
|
|
96
|
-
valueType.description = valueType.description ||
|
|
106
|
+
valueType.description = valueType.description || "";
|
|
97
107
|
|
|
98
108
|
return (
|
|
99
109
|
<div>
|
|
100
|
-
|
|
101
110
|
<small className="text-body-secondary">Name:</small>
|
|
102
111
|
<Input
|
|
103
112
|
value={valueType.qs.name}
|
|
@@ -109,33 +118,34 @@ const VariableInfo = (props: { valueType: IDoc<IPeerType> }) => {
|
|
|
109
118
|
<small className="text-body-secondary">
|
|
110
119
|
Icon Class:
|
|
111
120
|
<small>
|
|
112
|
-
<Tooltip
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
121
|
+
<Tooltip
|
|
122
|
+
markdownContent={[
|
|
123
|
+
"Icon classes can be found at:",
|
|
124
|
+
"[Bootstrap Icons](https://icons.getbootstrap.com/)",
|
|
125
|
+
].join(" ")}
|
|
126
|
+
/>
|
|
116
127
|
</small>
|
|
117
128
|
</small>
|
|
118
129
|
<IconPicker icon={valueType.qs.iconClass} />
|
|
119
|
-
|
|
120
130
|
|
|
121
131
|
<small className="mt-2 text-body-secondary">Description:</small>
|
|
122
|
-
<MarkdownEditorInline
|
|
123
|
-
value={valueType.qs.description as Observable<string>}
|
|
124
|
-
/>
|
|
125
|
-
|
|
132
|
+
<MarkdownEditorInline value={valueType.qs.description as Observable<string>} />
|
|
126
133
|
</div>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
129
136
|
|
|
130
137
|
const VariableSchema = (props: { valueType: IDoc<IPeerType> }) => {
|
|
131
|
-
const { valueType } = props
|
|
138
|
+
const { valueType } = props;
|
|
132
139
|
|
|
133
140
|
return (
|
|
134
141
|
<div>
|
|
135
|
-
<IOSchemaEditor
|
|
142
|
+
<IOSchemaEditor
|
|
143
|
+
ioSchema={valueType.qs.schema as Observable<IOSchema>}
|
|
144
|
+
simpleValueName="value"
|
|
145
|
+
/>
|
|
136
146
|
</div>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
147
|
+
);
|
|
148
|
+
};
|
|
139
149
|
|
|
140
150
|
export const IconPicker = (props: { icon: Observable<string | undefined> }) => {
|
|
141
151
|
const { icon } = props;
|
|
@@ -143,7 +153,7 @@ export const IconPicker = (props: { icon: Observable<string | undefined> }) => {
|
|
|
143
153
|
useObservable(icon);
|
|
144
154
|
|
|
145
155
|
if (icon() === undefined) {
|
|
146
|
-
icon(
|
|
156
|
+
icon("");
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
return (
|
|
@@ -153,10 +163,10 @@ export const IconPicker = (props: { icon: Observable<string | undefined> }) => {
|
|
|
153
163
|
className="form-control mb-3 p-0 ps-2"
|
|
154
164
|
placeholder="icon class"
|
|
155
165
|
title="Icon"
|
|
156
|
-
/>
|
|
157
|
-
<div className="me-2 ms-2" style={{ width:
|
|
166
|
+
/>
|
|
167
|
+
<div className="me-2 ms-2" style={{ width: "22px" }}>
|
|
158
168
|
<i className={icon()}></i>
|
|
159
169
|
</div>
|
|
160
170
|
</div>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
171
|
+
);
|
|
172
|
+
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { MarkdownWithMentions } from
|
|
4
|
-
import { mainContentPath } from
|
|
5
|
-
import {
|
|
6
|
-
import { registerInternalPeersUI } from '../../ui-router/ui-loader';
|
|
1
|
+
import { IOSchemaType, type IPeerType, newid, PeerTypes } from "@peers-app/peers-sdk";
|
|
2
|
+
import { ListScreen } from "../../components/list-screen";
|
|
3
|
+
import { MarkdownWithMentions } from "../../components/markdown-with-mentions";
|
|
4
|
+
import { mainContentPath } from "../../globals";
|
|
5
|
+
import { registerInternalPeersUI } from "../../ui-router/ui-loader";
|
|
7
6
|
|
|
8
7
|
export function PeerTypeLists() {
|
|
9
8
|
async function newRecord(name: string) {
|
|
10
|
-
const peerTypeName = name.replace(/\s+/g,
|
|
9
|
+
const peerTypeName = name.replace(/\s+/g, "_");
|
|
11
10
|
let valueType = await PeerTypes().insert({
|
|
12
11
|
peerTypeId: newid(),
|
|
13
12
|
name: peerTypeName,
|
|
14
|
-
description:
|
|
13
|
+
description: "",
|
|
15
14
|
schema: {
|
|
16
15
|
type: IOSchemaType.none,
|
|
17
16
|
fields: [],
|
|
@@ -24,25 +23,17 @@ export function PeerTypeLists() {
|
|
|
24
23
|
|
|
25
24
|
function getFilter(searchText: string) {
|
|
26
25
|
return {
|
|
27
|
-
$or: [
|
|
28
|
-
{ name: { $matchWords: searchText } },
|
|
29
|
-
{ description: { $matchWords: searchText } },
|
|
30
|
-
],
|
|
26
|
+
$or: [{ name: { $matchWords: searchText } }, { description: { $matchWords: searchText } }],
|
|
31
27
|
};
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
function renderItem(item: IPeerType) {
|
|
35
31
|
return (
|
|
36
|
-
<div
|
|
37
|
-
key={item.peerTypeId}
|
|
38
|
-
className='container-fluid pb-4'
|
|
39
|
-
>
|
|
32
|
+
<div key={item.peerTypeId} className="container-fluid pb-4">
|
|
40
33
|
<i className={item.iconClass ?? "bi bi-code-square"}></i>
|
|
41
|
-
<a href={`#peer-types/${item.peerTypeId}`}>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<div style={{ paddingLeft: '20px' }}>
|
|
45
|
-
<MarkdownWithMentions content={item.description || ''} />
|
|
34
|
+
<a href={`#peer-types/${item.peerTypeId}`}>{item.name || "<empty-name>"}</a>
|
|
35
|
+
<div style={{ paddingLeft: "20px" }}>
|
|
36
|
+
<MarkdownWithMentions content={item.description || ""} />
|
|
46
37
|
</div>
|
|
47
38
|
</div>
|
|
48
39
|
);
|
|
@@ -53,22 +44,21 @@ export function PeerTypeLists() {
|
|
|
53
44
|
table={PeerTypes()}
|
|
54
45
|
newRecord={newRecord}
|
|
55
46
|
getFilter={getFilter}
|
|
56
|
-
sortBy={[
|
|
47
|
+
sortBy={["name"]}
|
|
57
48
|
renderItem={renderItem}
|
|
58
49
|
placeholderName="value type"
|
|
59
50
|
/>
|
|
60
51
|
);
|
|
61
52
|
}
|
|
62
53
|
|
|
63
|
-
|
|
64
54
|
registerInternalPeersUI({
|
|
65
|
-
peersUIId:
|
|
55
|
+
peersUIId: "00m5fshz2g6ea23v8z6y0a1cj",
|
|
66
56
|
component: PeerTypeLists,
|
|
67
57
|
routes: [
|
|
68
58
|
{
|
|
69
|
-
isMatch: (
|
|
70
|
-
uiCategory:
|
|
71
|
-
priority: 2
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
});
|
|
59
|
+
isMatch: (_props, context) => context.path === "peer-types",
|
|
60
|
+
uiCategory: "screen",
|
|
61
|
+
priority: 2,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
});
|