@peers-app/peers-ui 0.0.14
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/README.md +52 -0
- package/.github/workflows/publish.yml +45 -0
- package/babel.config.js +7 -0
- package/dist/app.d.ts +9 -0
- package/dist/app.js +54 -0
- package/dist/command-palette/command-palette-ui.d.ts +2 -0
- package/dist/command-palette/command-palette-ui.js +192 -0
- package/dist/command-palette/command-palette.d.ts +23 -0
- package/dist/command-palette/command-palette.js +371 -0
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +20 -0
- package/dist/components/group-switcher.d.ts +6 -0
- package/dist/components/group-switcher.js +301 -0
- package/dist/components/input-date.d.ts +7 -0
- package/dist/components/input-date.js +19 -0
- package/dist/components/input-datetime.d.ts +7 -0
- package/dist/components/input-datetime.js +35 -0
- package/dist/components/input-number.d.ts +9 -0
- package/dist/components/input-number.js +87 -0
- package/dist/components/input.d.ts +7 -0
- package/dist/components/input.js +20 -0
- package/dist/components/io-schema-values.d.ts +15 -0
- package/dist/components/io-schema-values.js +105 -0
- package/dist/components/io-schema.d.ts +13 -0
- package/dist/components/io-schema.js +163 -0
- package/dist/components/lazy-list.d.ts +13 -0
- package/dist/components/lazy-list.js +91 -0
- package/dist/components/lazy-sortable-list.d.ts +29 -0
- package/dist/components/lazy-sortable-list.js +12 -0
- package/dist/components/left-bar.d.ts +3 -0
- package/dist/components/left-bar.js +130 -0
- package/dist/components/list-screen.d.ts +16 -0
- package/dist/components/list-screen.js +100 -0
- package/dist/components/loading-indicator.d.ts +2 -0
- package/dist/components/loading-indicator.js +12 -0
- package/dist/components/main-content-container.d.ts +2 -0
- package/dist/components/main-content-container.js +90 -0
- package/dist/components/markdown-editor/autolink-plugin.d.ts +2 -0
- package/dist/components/markdown-editor/autolink-plugin.js +29 -0
- package/dist/components/markdown-editor/editor-inline.d.ts +3 -0
- package/dist/components/markdown-editor/editor-inline.js +13 -0
- package/dist/components/markdown-editor/editor.d.ts +18 -0
- package/dist/components/markdown-editor/editor.js +143 -0
- package/dist/components/markdown-editor/markdown-plugin.d.ts +9 -0
- package/dist/components/markdown-editor/markdown-plugin.js +194 -0
- package/dist/components/markdown-editor/mention-node.d.ts +21 -0
- package/dist/components/markdown-editor/mention-node.js +160 -0
- package/dist/components/markdown-editor/mentions-plugin.d.ts +7 -0
- package/dist/components/markdown-editor/mentions-plugin.js +268 -0
- package/dist/components/markdown-editor/theme.d.ts +46 -0
- package/dist/components/markdown-editor/theme.js +48 -0
- package/dist/components/markdown-editor/toolbar.d.ts +10 -0
- package/dist/components/markdown-editor/toolbar.js +112 -0
- package/dist/components/markdown-with-mentions.d.ts +4 -0
- package/dist/components/markdown-with-mentions.js +140 -0
- package/dist/components/message-logs/message-logs.d.ts +6 -0
- package/dist/components/message-logs/message-logs.js +307 -0
- package/dist/components/messages/avatar.d.ts +10 -0
- package/dist/components/messages/avatar.js +65 -0
- package/dist/components/messages/channel-message-list.d.ts +14 -0
- package/dist/components/messages/channel-message-list.js +158 -0
- package/dist/components/messages/channel-view.d.ts +6 -0
- package/dist/components/messages/channel-view.js +82 -0
- package/dist/components/messages/message-compose.d.ts +11 -0
- package/dist/components/messages/message-compose.js +152 -0
- package/dist/components/messages/message-display.d.ts +10 -0
- package/dist/components/messages/message-display.js +152 -0
- package/dist/components/messages/thread-message-list.d.ts +11 -0
- package/dist/components/messages/thread-message-list.js +122 -0
- package/dist/components/messages/thread-view.d.ts +6 -0
- package/dist/components/messages/thread-view.js +174 -0
- package/dist/components/off-canvas.d.ts +13 -0
- package/dist/components/off-canvas.js +89 -0
- package/dist/components/router.d.ts +6 -0
- package/dist/components/router.js +240 -0
- package/dist/components/save-button.d.ts +13 -0
- package/dist/components/save-button.js +75 -0
- package/dist/components/sortable-list.d.ts +36 -0
- package/dist/components/sortable-list.js +77 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +69 -0
- package/dist/components/text-list-editor.tsx/text-list-editor.d.ts +6 -0
- package/dist/components/text-list-editor.tsx/text-list-editor.js +13 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +20 -0
- package/dist/components/top-bar.d.ts +2 -0
- package/dist/components/top-bar.js +51 -0
- package/dist/components/typeahead/mentions-plugin.d.ts +7 -0
- package/dist/components/typeahead/mentions-plugin.js +203 -0
- package/dist/components/typeahead/typeahead-editor.d.ts +15 -0
- package/dist/components/typeahead/typeahead-editor.js +134 -0
- package/dist/components/typeahead/typeahead.d.ts +12 -0
- package/dist/components/typeahead/typeahead.js +94 -0
- package/dist/components/typeahead.d.ts +22 -0
- package/dist/components/typeahead.js +270 -0
- package/dist/globals.d.ts +29 -0
- package/dist/globals.js +148 -0
- package/dist/hooks.d.ts +34 -0
- package/dist/hooks.js +137 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -0
- package/dist/layout-vars.d.ts +6 -0
- package/dist/layout-vars.js +10 -0
- package/dist/mention-configs.d.ts +18 -0
- package/dist/mention-configs.js +149 -0
- package/dist/screens/assistants/assistant-config.d.ts +5 -0
- package/dist/screens/assistants/assistant-config.js +52 -0
- package/dist/screens/assistants/assistant-details.d.ts +4 -0
- package/dist/screens/assistants/assistant-details.js +85 -0
- package/dist/screens/assistants/assistant-info.d.ts +6 -0
- package/dist/screens/assistants/assistant-info.js +28 -0
- package/dist/screens/assistants/assistant-list.d.ts +2 -0
- package/dist/screens/assistants/assistant-list.js +114 -0
- package/dist/screens/assistants/assistant-tools.d.ts +5 -0
- package/dist/screens/assistants/assistant-tools.js +38 -0
- package/dist/screens/contacts/contact-details.d.ts +6 -0
- package/dist/screens/contacts/contact-details.js +100 -0
- package/dist/screens/contacts/contact-list.d.ts +2 -0
- package/dist/screens/contacts/contact-list.js +213 -0
- package/dist/screens/contacts/index.d.ts +4 -0
- package/dist/screens/contacts/index.js +21 -0
- package/dist/screens/events/cron.d.ts +3 -0
- package/dist/screens/events/cron.js +77 -0
- package/dist/screens/events/event-details.d.ts +6 -0
- package/dist/screens/events/event-details.js +112 -0
- package/dist/screens/events/event-handlers.d.ts +7 -0
- package/dist/screens/events/event-handlers.js +84 -0
- package/dist/screens/events/event-info.d.ts +5 -0
- package/dist/screens/events/event-info.js +19 -0
- package/dist/screens/events/event-list.d.ts +2 -0
- package/dist/screens/events/event-list.js +107 -0
- package/dist/screens/events/event-schedule.d.ts +5 -0
- package/dist/screens/events/event-schedule.js +124 -0
- package/dist/screens/groups/group-details.d.ts +6 -0
- package/dist/screens/groups/group-details.js +218 -0
- package/dist/screens/groups/group-list.d.ts +2 -0
- package/dist/screens/groups/group-list.js +275 -0
- package/dist/screens/groups/group-members.d.ts +8 -0
- package/dist/screens/groups/group-members.js +315 -0
- package/dist/screens/groups/index.d.ts +6 -0
- package/dist/screens/groups/index.js +23 -0
- package/dist/screens/knowledge/knowledge-frame-details.bk.d.ts +6 -0
- package/dist/screens/knowledge/knowledge-frame-details.bk.js +84 -0
- package/dist/screens/knowledge/knowledge-frame-details.d.ts +8 -0
- package/dist/screens/knowledge/knowledge-frame-details.js +143 -0
- package/dist/screens/knowledge/knowledge-frame-list.d.ts +2 -0
- package/dist/screens/knowledge/knowledge-frame-list.js +45 -0
- package/dist/screens/knowledge/knowledge-value-details.d.ts +6 -0
- package/dist/screens/knowledge/knowledge-value-details.js +150 -0
- package/dist/screens/knowledge/knowledge-value-list-item.d.ts +5 -0
- package/dist/screens/knowledge/knowledge-value-list-item.js +39 -0
- package/dist/screens/knowledge/knowledge-value-list.d.ts +3 -0
- package/dist/screens/knowledge/knowledge-value-list.js +123 -0
- package/dist/screens/packages/package-details.d.ts +6 -0
- package/dist/screens/packages/package-details.js +82 -0
- package/dist/screens/packages/package-info.d.ts +5 -0
- package/dist/screens/packages/package-info.js +42 -0
- package/dist/screens/packages/package-list.d.ts +2 -0
- package/dist/screens/packages/package-list.js +182 -0
- package/dist/screens/packages/package-new-local.d.ts +2 -0
- package/dist/screens/packages/package-new-local.js +82 -0
- package/dist/screens/peer-types/peer-type-details.d.ts +10 -0
- package/dist/screens/peer-types/peer-type-details.js +126 -0
- package/dist/screens/peer-types/peer-type-list.d.ts +2 -0
- package/dist/screens/peer-types/peer-type-list.js +57 -0
- package/dist/screens/predicates/predicate-details.d.ts +6 -0
- package/dist/screens/predicates/predicate-details.js +103 -0
- package/dist/screens/predicates/predicate-list.d.ts +2 -0
- package/dist/screens/predicates/predicate-list.js +46 -0
- package/dist/screens/profile.d.ts +2 -0
- package/dist/screens/profile.js +66 -0
- package/dist/screens/search/global-search.d.ts +2 -0
- package/dist/screens/search/global-search.js +186 -0
- package/dist/screens/settings/color-mode-dropdown.d.ts +6 -0
- package/dist/screens/settings/color-mode-dropdown.js +63 -0
- package/dist/screens/settings/settings-page.d.ts +2 -0
- package/dist/screens/settings/settings-page.js +49 -0
- package/dist/screens/setup-user.d.ts +2 -0
- package/dist/screens/setup-user.js +270 -0
- package/dist/screens/tools/tool-code.d.ts +5 -0
- package/dist/screens/tools/tool-code.js +32 -0
- package/dist/screens/tools/tool-details.d.ts +6 -0
- package/dist/screens/tools/tool-details.js +68 -0
- package/dist/screens/tools/tool-info.d.ts +5 -0
- package/dist/screens/tools/tool-info.js +74 -0
- package/dist/screens/tools/tool-list.d.ts +2 -0
- package/dist/screens/tools/tool-list.js +123 -0
- package/dist/screens/tools/tool-schema.d.ts +5 -0
- package/dist/screens/tools/tool-schema.js +30 -0
- package/dist/screens/tools/tool-test-details.d.ts +4 -0
- package/dist/screens/tools/tool-test-details.js +54 -0
- package/dist/screens/tools/tool-test-list.d.ts +4 -0
- package/dist/screens/tools/tool-test-list.js +82 -0
- package/dist/screens/variables/variable-details.d.ts +6 -0
- package/dist/screens/variables/variable-details.js +140 -0
- package/dist/screens/variables/variable-list.d.ts +2 -0
- package/dist/screens/variables/variable-list.js +58 -0
- package/dist/screens/workflows/workflow-details.d.ts +6 -0
- package/dist/screens/workflows/workflow-details.js +122 -0
- package/dist/screens/workflows/workflow-info.d.ts +5 -0
- package/dist/screens/workflows/workflow-info.js +18 -0
- package/dist/screens/workflows/workflow-instructions.d.ts +5 -0
- package/dist/screens/workflows/workflow-instructions.js +118 -0
- package/dist/screens/workflows/workflow-list.d.ts +2 -0
- package/dist/screens/workflows/workflow-list.js +109 -0
- package/dist/screens/workflows/workflow-subscriptions.d.ts +6 -0
- package/dist/screens/workflows/workflow-subscriptions.js +81 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +31 -0
- package/dist/system-apps/assistants.app.d.ts +2 -0
- package/dist/system-apps/assistants.app.js +8 -0
- package/dist/system-apps/contacts.app.d.ts +2 -0
- package/dist/system-apps/contacts.app.js +9 -0
- package/dist/system-apps/events.app.d.ts +2 -0
- package/dist/system-apps/events.app.js +8 -0
- package/dist/system-apps/groups.app.d.ts +2 -0
- package/dist/system-apps/groups.app.js +9 -0
- package/dist/system-apps/index.d.ts +19 -0
- package/dist/system-apps/index.js +90 -0
- package/dist/system-apps/knowledge-frames.app.d.ts +2 -0
- package/dist/system-apps/knowledge-frames.app.js +9 -0
- package/dist/system-apps/knowledge-values.app.d.ts +2 -0
- package/dist/system-apps/knowledge-values.app.js +9 -0
- package/dist/system-apps/packages.app.d.ts +2 -0
- package/dist/system-apps/packages.app.js +8 -0
- package/dist/system-apps/predicates.app.d.ts +2 -0
- package/dist/system-apps/predicates.app.js +8 -0
- package/dist/system-apps/profile.app.d.ts +2 -0
- package/dist/system-apps/profile.app.js +8 -0
- package/dist/system-apps/search.app.d.ts +2 -0
- package/dist/system-apps/search.app.js +9 -0
- package/dist/system-apps/settings.app.d.ts +2 -0
- package/dist/system-apps/settings.app.js +8 -0
- package/dist/system-apps/threads.app.d.ts +2 -0
- package/dist/system-apps/threads.app.js +8 -0
- package/dist/system-apps/tools.app.d.ts +2 -0
- package/dist/system-apps/tools.app.js +8 -0
- package/dist/system-apps/types.app.d.ts +2 -0
- package/dist/system-apps/types.app.js +8 -0
- package/dist/system-apps/variables.app.d.ts +2 -0
- package/dist/system-apps/variables.app.js +8 -0
- package/dist/system-apps/workflows.app.d.ts +2 -0
- package/dist/system-apps/workflows.app.js +8 -0
- package/dist/tabs-layout/tabs-layout.d.ts +5 -0
- package/dist/tabs-layout/tabs-layout.js +374 -0
- package/dist/tabs-layout/tabs-state.d.ts +26 -0
- package/dist/tabs-layout/tabs-state.js +239 -0
- package/dist/three-bar-layout/left-bar-content.d.ts +7 -0
- package/dist/three-bar-layout/left-bar-content.js +151 -0
- package/dist/three-bar-layout/right-bar-content.d.ts +2 -0
- package/dist/three-bar-layout/right-bar-content.js +64 -0
- package/dist/three-bar-layout/three-bar-layout.d.ts +5 -0
- package/dist/three-bar-layout/three-bar-layout.js +218 -0
- package/dist/ui-defaults/index.d.ts +2 -0
- package/dist/ui-defaults/index.js +4 -0
- package/dist/ui-defaults/list-screen.d.ts +6 -0
- package/dist/ui-defaults/list-screen.js +74 -0
- package/dist/ui-defaults/notes-editor.d.ts +7 -0
- package/dist/ui-defaults/notes-editor.js +41 -0
- package/dist/ui-router/routes-loader.d.ts +25 -0
- package/dist/ui-router/routes-loader.js +97 -0
- package/dist/ui-router/ui-loader.d.ts +18 -0
- package/dist/ui-router/ui-loader.js +481 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +250 -0
- package/docs/conversation-tab.md +201 -0
- package/docs/getting-started.md +284 -0
- package/docs/knowledge.md +187 -0
- package/docs/tabs-ui.md +696 -0
- package/docs/user-contacts-ui.md +384 -0
- package/jest.config.js +25 -0
- package/package.json +109 -0
- package/src/app.tsx +59 -0
- package/src/command-palette/command-palette-ui.tsx +264 -0
- package/src/command-palette/command-palette.ts +364 -0
- package/src/components/checkbox.tsx +22 -0
- package/src/components/group-switcher.tsx +469 -0
- package/src/components/input-date.tsx +28 -0
- package/src/components/input-datetime.tsx +41 -0
- package/src/components/input-number.tsx +67 -0
- package/src/components/input.tsx +22 -0
- package/src/components/io-schema-values.tsx +122 -0
- package/src/components/io-schema.tsx +234 -0
- package/src/components/lazy-list.tsx +98 -0
- package/src/components/lazy-sortable-list.tsx +51 -0
- package/src/components/left-bar.tsx +264 -0
- package/src/components/list-screen.tsx +105 -0
- package/src/components/loading-indicator.tsx +9 -0
- package/src/components/main-content-container.tsx +76 -0
- package/src/components/markdown-editor/autolink-plugin.tsx +36 -0
- package/src/components/markdown-editor/editor-inline.tsx +10 -0
- package/src/components/markdown-editor/editor.tsx +152 -0
- package/src/components/markdown-editor/markdown-plugin.tsx +224 -0
- package/src/components/markdown-editor/mention-node.ts +199 -0
- package/src/components/markdown-editor/mentions-plugin.tsx +356 -0
- package/src/components/markdown-editor/theme.ts +47 -0
- package/src/components/markdown-editor/toolbar.tsx +263 -0
- package/src/components/markdown-with-mentions.tsx +183 -0
- package/src/components/message-logs/message-logs.tsx +406 -0
- package/src/components/messages/avatar.tsx +95 -0
- package/src/components/messages/channel-message-list.tsx +177 -0
- package/src/components/messages/channel-view.tsx +74 -0
- package/src/components/messages/message-compose.tsx +162 -0
- package/src/components/messages/message-display.tsx +217 -0
- package/src/components/messages/thread-message-list.tsx +126 -0
- package/src/components/messages/thread-view.tsx +214 -0
- package/src/components/off-canvas.tsx +83 -0
- package/src/components/router.tsx +224 -0
- package/src/components/save-button.tsx +109 -0
- package/src/components/sortable-list.tsx +102 -0
- package/src/components/tabs.tsx +70 -0
- package/src/components/text-list-editor.tsx/text-list-editor.tsx +13 -0
- package/src/components/tooltip.tsx +50 -0
- package/src/components/top-bar.tsx +119 -0
- package/src/components/typeahead/mentions-plugin.tsx +265 -0
- package/src/components/typeahead/typeahead-editor.tsx +140 -0
- package/src/components/typeahead/typeahead.tsx +77 -0
- package/src/components/typeahead.tsx +359 -0
- package/src/globals.tsx +162 -0
- package/src/hooks.ts +144 -0
- package/src/index.tsx +8 -0
- package/src/layout-vars.ts +8 -0
- package/src/mention-configs.ts +166 -0
- package/src/screens/assistants/assistant-config.tsx +80 -0
- package/src/screens/assistants/assistant-details.tsx +77 -0
- package/src/screens/assistants/assistant-info.tsx +45 -0
- package/src/screens/assistants/assistant-list.tsx +115 -0
- package/src/screens/assistants/assistant-tools.tsx +61 -0
- package/src/screens/contacts/contact-details.tsx +175 -0
- package/src/screens/contacts/contact-list.tsx +251 -0
- package/src/screens/contacts/index.ts +6 -0
- package/src/screens/events/cron.ts +74 -0
- package/src/screens/events/event-details.tsx +117 -0
- package/src/screens/events/event-handlers.tsx +61 -0
- package/src/screens/events/event-info.tsx +29 -0
- package/src/screens/events/event-list.tsx +104 -0
- package/src/screens/events/event-schedule.tsx +130 -0
- package/src/screens/groups/group-details.tsx +306 -0
- package/src/screens/groups/group-list.tsx +366 -0
- package/src/screens/groups/group-members.tsx +455 -0
- package/src/screens/groups/index.ts +9 -0
- package/src/screens/knowledge/knowledge-frame-details.bk.tsx +160 -0
- package/src/screens/knowledge/knowledge-frame-details.tsx +176 -0
- package/src/screens/knowledge/knowledge-frame-list.tsx +49 -0
- package/src/screens/knowledge/knowledge-value-details.tsx +181 -0
- package/src/screens/knowledge/knowledge-value-list-item.tsx +48 -0
- package/src/screens/knowledge/knowledge-value-list.tsx +131 -0
- package/src/screens/packages/package-details.tsx +117 -0
- package/src/screens/packages/package-info.tsx +83 -0
- package/src/screens/packages/package-list.tsx +191 -0
- package/src/screens/packages/package-new-local.tsx +93 -0
- package/src/screens/peer-types/peer-type-details.tsx +162 -0
- package/src/screens/peer-types/peer-type-list.tsx +74 -0
- package/src/screens/predicates/predicate-details.tsx +125 -0
- package/src/screens/predicates/predicate-list.tsx +50 -0
- package/src/screens/profile.tsx +68 -0
- package/src/screens/search/global-search.tsx +274 -0
- package/src/screens/settings/color-mode-dropdown.tsx +57 -0
- package/src/screens/settings/settings-page.tsx +76 -0
- package/src/screens/setup-user.tsx +367 -0
- package/src/screens/tools/tool-code.tsx +35 -0
- package/src/screens/tools/tool-details.tsx +101 -0
- package/src/screens/tools/tool-info.tsx +60 -0
- package/src/screens/tools/tool-list.tsx +121 -0
- package/src/screens/tools/tool-schema.tsx +42 -0
- package/src/screens/tools/tool-test-details.tsx +100 -0
- package/src/screens/tools/tool-test-list.tsx +74 -0
- package/src/screens/variables/variable-details.tsx +183 -0
- package/src/screens/variables/variable-list.tsx +74 -0
- package/src/screens/workflows/workflow-details.tsx +130 -0
- package/src/screens/workflows/workflow-info.tsx +29 -0
- package/src/screens/workflows/workflow-instructions.tsx +127 -0
- package/src/screens/workflows/workflow-list.tsx +107 -0
- package/src/screens/workflows/workflow-subscriptions.tsx +58 -0
- package/src/setupTests.ts +32 -0
- package/src/system-apps/assistants.app.ts +7 -0
- package/src/system-apps/contacts.app.ts +8 -0
- package/src/system-apps/events.app.ts +7 -0
- package/src/system-apps/groups.app.ts +8 -0
- package/src/system-apps/index.ts +79 -0
- package/src/system-apps/knowledge-frames.app.ts +8 -0
- package/src/system-apps/knowledge-values.app.ts +8 -0
- package/src/system-apps/packages.app.ts +7 -0
- package/src/system-apps/predicates.app.ts +7 -0
- package/src/system-apps/profile.app.ts +7 -0
- package/src/system-apps/search.app.ts +8 -0
- package/src/system-apps/settings.app.ts +7 -0
- package/src/system-apps/threads.app.ts +7 -0
- package/src/system-apps/tools.app.ts +7 -0
- package/src/system-apps/types.app.ts +7 -0
- package/src/system-apps/variables.app.ts +7 -0
- package/src/system-apps/workflows.app.ts +7 -0
- package/src/tabs-layout/tabs-layout.tsx +672 -0
- package/src/tabs-layout/tabs-state.ts +269 -0
- package/src/three-bar-layout/left-bar-content.tsx +202 -0
- package/src/three-bar-layout/right-bar-content.tsx +67 -0
- package/src/three-bar-layout/three-bar-layout.tsx +297 -0
- package/src/ui-defaults/index.ts +3 -0
- package/src/ui-defaults/list-screen.tsx +92 -0
- package/src/ui-defaults/notes-editor.tsx +51 -0
- package/src/ui-router/routes-loader.ts +98 -0
- package/src/ui-router/ui-loader.tsx +497 -0
- package/src/utils.ts +266 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { groupUserVar, IAppNav, IPackage, newid } from "@peers-app/peers-sdk";
|
|
2
|
+
import { _mainContentPath } from "../globals";
|
|
3
|
+
import { systemPackage } from "../system-apps";
|
|
4
|
+
import { allPackages } from "../ui-router/routes-loader";
|
|
5
|
+
|
|
6
|
+
export interface TabState {
|
|
7
|
+
tabId: string;
|
|
8
|
+
packageId?: string; // 'launcher' for app launcher tab
|
|
9
|
+
path: string;
|
|
10
|
+
title: string;
|
|
11
|
+
iconClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const launcherApp: TabState = {
|
|
15
|
+
tabId: 'launcher',
|
|
16
|
+
packageId: 'launcher',
|
|
17
|
+
path: '',
|
|
18
|
+
title: 'Apps',
|
|
19
|
+
iconClassName: 'bi-grid-3x3-gap',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Global persistent variables for tab state
|
|
23
|
+
export const activeTabs = groupUserVar<TabState[]>('activeTabs', {
|
|
24
|
+
defaultValue: [launcherApp],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const activeTabId = groupUserVar<string>('activeTabId', {
|
|
28
|
+
defaultValue: 'launcher',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const recentlyUsedApps = groupUserVar<string[]>('recentlyUsedApps', {
|
|
32
|
+
defaultValue: [],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const initializedTabs = new Set<string>();
|
|
36
|
+
|
|
37
|
+
export function goToTabPath(path: string) {
|
|
38
|
+
const tab = activeTabs().find(t => t.path === path);
|
|
39
|
+
if (tab) {
|
|
40
|
+
activeTabId(tab.tabId);
|
|
41
|
+
} else {
|
|
42
|
+
const appInfo = determineAppFromPath(path);
|
|
43
|
+
if (appInfo) {
|
|
44
|
+
openNewTab({
|
|
45
|
+
path: path,
|
|
46
|
+
title: appInfo.navItem.displayName || appInfo.navItem.name,
|
|
47
|
+
packageId: appInfo.package.packageId,
|
|
48
|
+
iconClassName: appInfo.navItem.iconClassName
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
// update current tab path if no app found
|
|
52
|
+
const currentTabId = activeTabId();
|
|
53
|
+
const currentTabs = activeTabs();
|
|
54
|
+
const currentTab = currentTabs.find(t => t.tabId === currentTabId);
|
|
55
|
+
if (currentTab && currentTab.path !== '') {
|
|
56
|
+
currentTab.path = path;
|
|
57
|
+
activeTabs([...currentTabs]);
|
|
58
|
+
} else {
|
|
59
|
+
openNewTab({
|
|
60
|
+
path: path,
|
|
61
|
+
title: "New Tab",
|
|
62
|
+
packageId: 'system-apps',
|
|
63
|
+
iconClassName: 'bi-question-circle'
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const handleMainPathChanged = (oldPath: string, newPath: string, setNewMainPath: ((path: string) => any)) => {
|
|
71
|
+
const oldPathPart = oldPath.toLowerCase().trim().split('?')[0];
|
|
72
|
+
const newPathPart = newPath.toLowerCase().trim().split('?')[0];
|
|
73
|
+
const currentTab = activeTabs().find(t => t.tabId === activeTabId());
|
|
74
|
+
if (oldPathPart === newPathPart || (currentTab && currentTab.path === newPath)) {
|
|
75
|
+
// nothing to do
|
|
76
|
+
setNewMainPath(newPath);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const appInfo = determineAppFromPath(newPath);
|
|
81
|
+
if (appInfo && oldPath !== '') {
|
|
82
|
+
openNewTab({
|
|
83
|
+
path: newPath,
|
|
84
|
+
title: appInfo.navItem.displayName || appInfo.navItem.name,
|
|
85
|
+
packageId: appInfo.package.packageId,
|
|
86
|
+
iconClassName: appInfo.navItem.iconClassName
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
setNewMainPath(newPath);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type AppInfo = { navItem: IAppNav, package: IPackage };
|
|
95
|
+
|
|
96
|
+
export function determineAppFromPath(path: string): AppInfo | undefined {
|
|
97
|
+
const launcherInfo = {
|
|
98
|
+
navItem: {
|
|
99
|
+
name: 'Apps',
|
|
100
|
+
navigationPath: '',
|
|
101
|
+
iconClassName: launcherApp.iconClassName || 'bi-grid-3x3-gap',
|
|
102
|
+
},
|
|
103
|
+
package: systemPackage
|
|
104
|
+
};
|
|
105
|
+
if (!path || path === '' || path === '/') {
|
|
106
|
+
return launcherInfo;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Remove leading/trailing slashes and query params
|
|
110
|
+
path = path.toLowerCase().trim().split('?')[0];
|
|
111
|
+
if (path.startsWith('/')) {
|
|
112
|
+
path = path.substring(1);
|
|
113
|
+
}
|
|
114
|
+
const rootPath = path.split('/')[0];
|
|
115
|
+
const _allPackages = [systemPackage, ...allPackages()]; // WARNING allPackages might not be loaded yet
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
const allAppInfos: AppInfo[] = _allPackages
|
|
119
|
+
.filter(pkg => (pkg.appNavs?.length ?? 0) > 0)
|
|
120
|
+
.flatMap(pkg =>
|
|
121
|
+
pkg.appNavs!.map(navItem => ({ navItem, package: pkg as IPackage }))
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
// Find the most relevant app based on path
|
|
125
|
+
for (const appInfo of allAppInfos) {
|
|
126
|
+
const navPath = appInfo.navItem.navigationPath || appInfo.navItem.name.toLowerCase();
|
|
127
|
+
|
|
128
|
+
// Check for exact match or path starting with nav path
|
|
129
|
+
if (rootPath === navPath || rootPath.startsWith(navPath + '/')) {
|
|
130
|
+
// Return the first matching app
|
|
131
|
+
return {
|
|
132
|
+
navItem: appInfo.navItem,
|
|
133
|
+
package: appInfo.package
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// look for package-specific routes
|
|
139
|
+
// uri in format of "package-nav/{packageId}/{path}"
|
|
140
|
+
const packageNavPrefix = 'package-nav/';
|
|
141
|
+
if (path.startsWith(packageNavPrefix)) {
|
|
142
|
+
const parts = path.substring(packageNavPrefix.length).split('/');
|
|
143
|
+
if (parts.length > 0) {
|
|
144
|
+
const packageId = parts[0];
|
|
145
|
+
const pkg = _allPackages.find(p => p.packageId === packageId);
|
|
146
|
+
if (pkg) {
|
|
147
|
+
const subPath = parts.slice(1).join('/');
|
|
148
|
+
const navItem = pkg.appNavs?.find(n => n.navigationPath === subPath || n.name.toLowerCase() === subPath);
|
|
149
|
+
if (navItem) {
|
|
150
|
+
return {
|
|
151
|
+
navItem,
|
|
152
|
+
package: pkg
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
console.warn(`No app found for path: ${path}`);
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Utility function for detail screens to update the active tab's title
|
|
164
|
+
export const updateActiveTabTitle = (newTitle: string) => {
|
|
165
|
+
// TODO Fix this to use a more reliable update mechanism
|
|
166
|
+
// using setTimeout to get around a race condition for setting title on new tabs
|
|
167
|
+
setTimeout(() => {
|
|
168
|
+
const currentTabs = activeTabs();
|
|
169
|
+
const activeTab = currentTabs.find(t => t.tabId === activeTabId());
|
|
170
|
+
if (activeTab) {
|
|
171
|
+
activeTab.title = newTitle;
|
|
172
|
+
activeTabs([...currentTabs]);
|
|
173
|
+
}
|
|
174
|
+
}, 100);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// Global function to open content in new tab
|
|
178
|
+
export const openNewTab = (tab: Omit<TabState, 'tabId'>, forceNew = false) => {
|
|
179
|
+
const newTab: TabState = {
|
|
180
|
+
...tab,
|
|
181
|
+
tabId: newid(),
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const currentTabs = activeTabs();
|
|
185
|
+
const existingTabIndex = currentTabs.findIndex(t =>
|
|
186
|
+
t.packageId === tab.packageId && t.path === tab.path
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
if (existingTabIndex >= 0 && !forceNew) {
|
|
190
|
+
// Switch to existing tab
|
|
191
|
+
activeTabId(currentTabs[existingTabIndex].tabId);
|
|
192
|
+
} else {
|
|
193
|
+
// Always add new tab (for app launcher or when forceNew is true)
|
|
194
|
+
activeTabs([...currentTabs, newTab]);
|
|
195
|
+
activeTabId(newTab.tabId);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Update recently used (track by path instead of packageId)
|
|
199
|
+
if (tab.path && tab.packageId !== 'launcher') {
|
|
200
|
+
const recent = recentlyUsedApps();
|
|
201
|
+
const filtered = recent.filter(path => path !== tab.path);
|
|
202
|
+
recentlyUsedApps([tab.path, ...filtered].slice(0, 8));
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// Close the current active tab (but not launcher)
|
|
207
|
+
export const closeCurrentTab = () => {
|
|
208
|
+
const currentTabs = activeTabs();
|
|
209
|
+
const _activeTabId = activeTabId();
|
|
210
|
+
const tabToClose = currentTabs.find(t => t.tabId === _activeTabId);
|
|
211
|
+
|
|
212
|
+
if (!tabToClose || tabToClose.tabId === "launcher") return;
|
|
213
|
+
|
|
214
|
+
const newTabs = currentTabs.filter(t => t.tabId !== _activeTabId);
|
|
215
|
+
activeTabs(newTabs);
|
|
216
|
+
|
|
217
|
+
initializedTabs.delete(_activeTabId);
|
|
218
|
+
|
|
219
|
+
// If closing active tab, switch to previous tab
|
|
220
|
+
if (newTabs.length > 0) {
|
|
221
|
+
const newActiveTab = newTabs[newTabs.length - 1].tabId;
|
|
222
|
+
activeTabId(newActiveTab);
|
|
223
|
+
} else {
|
|
224
|
+
activeTabId('launcher');
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// Navigate to next tab
|
|
229
|
+
export const switchToNextTab = () => {
|
|
230
|
+
const currentTabs = activeTabs();
|
|
231
|
+
const activeTab = activeTabId();
|
|
232
|
+
const currentIndex = currentTabs.findIndex(tab => tab.tabId === activeTab);
|
|
233
|
+
|
|
234
|
+
if (currentIndex === -1) return;
|
|
235
|
+
|
|
236
|
+
const nextIndex = currentIndex === currentTabs.length - 1 ? 0 : currentIndex + 1;
|
|
237
|
+
activeTabId(currentTabs[nextIndex].tabId);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// Navigate to previous tab
|
|
241
|
+
export const switchToPreviousTab = () => {
|
|
242
|
+
const currentTabs = activeTabs();
|
|
243
|
+
const activeTab = activeTabId();
|
|
244
|
+
const currentIndex = currentTabs.findIndex(tab => tab.tabId === activeTab);
|
|
245
|
+
|
|
246
|
+
if (currentIndex === -1) return;
|
|
247
|
+
|
|
248
|
+
const prevIndex = currentIndex === 0 ? currentTabs.length - 1 : currentIndex - 1;
|
|
249
|
+
activeTabId(currentTabs[prevIndex].tabId);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
// Keyboard shortcuts are now handled by the command palette system
|
|
253
|
+
|
|
254
|
+
activeTabId.subscribe(newActiveTab => {
|
|
255
|
+
const currentTabs = activeTabs();
|
|
256
|
+
const activeTab = currentTabs.find(t => t.tabId === newActiveTab);
|
|
257
|
+
|
|
258
|
+
if (!activeTab) {
|
|
259
|
+
console.warn('Active tab not found:', newActiveTab);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Update mainContentPath for the new active tab
|
|
264
|
+
if (activeTab.packageId !== 'launcher') {
|
|
265
|
+
_mainContentPath(activeTab.path);
|
|
266
|
+
} else {
|
|
267
|
+
_mainContentPath(''); // Launcher or fallback
|
|
268
|
+
}
|
|
269
|
+
});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { IPackage, Packages } from "@peers-app/peers-sdk";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { isDesktop, mainContentPath } from '../globals';
|
|
4
|
+
import { useObservable, usePromise } from '../hooks';
|
|
5
|
+
import * as color from '../screens/settings/color-mode-dropdown';
|
|
6
|
+
|
|
7
|
+
interface IProps {
|
|
8
|
+
collapsed?: boolean
|
|
9
|
+
toggleCollapsed: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let toggleCollapsed = () => { };
|
|
13
|
+
|
|
14
|
+
export const LeftBarContent = (props: IProps) => {
|
|
15
|
+
toggleCollapsed = props.toggleCollapsed;
|
|
16
|
+
const { collapsed } = props;
|
|
17
|
+
const [colorMode] = useObservable(color.colorMode);
|
|
18
|
+
const collapseButtonClass = colorMode === 'light' ? 'btn-outline-dark' : 'btn-outline-secondary';
|
|
19
|
+
|
|
20
|
+
const [_isDesktop] = useObservable(isDesktop);
|
|
21
|
+
const [contentPath] = useObservable(mainContentPath);
|
|
22
|
+
|
|
23
|
+
const packagesWithNavItems = usePromise(async () => {
|
|
24
|
+
const packages = await Packages().list();
|
|
25
|
+
return packages.filter(pkg => pkg.appNavs?.length);
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const knowledgeSublinks = [
|
|
29
|
+
{ text: "Frames", icon: "bi bi-window-dock", path: "knowledge-frames", left: 15 },
|
|
30
|
+
{ text: "Predicates", icon: "bi bi-node-plus-fill", left: 15 },
|
|
31
|
+
{ text: "Graph", icon: "bi bi-diagram-3-fill", left: 15 },
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
const knowledgeSublinkActive = contentPath.startsWith('knowledge-') || knowledgeSublinks.find(ks => contentPath.startsWith(ks.path || ks.text.toLowerCase()));
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<div
|
|
39
|
+
className="p-2 d-flex align-items-center"
|
|
40
|
+
style={{ minWidth: '50px' }}
|
|
41
|
+
>
|
|
42
|
+
{!collapsed && (
|
|
43
|
+
<h5 className="m-0 flex-grow-1">Peers</h5>
|
|
44
|
+
)}
|
|
45
|
+
<button
|
|
46
|
+
className={`btn btn-sm ${collapseButtonClass}`}
|
|
47
|
+
onClick={toggleCollapsed}
|
|
48
|
+
style={{ flexShrink: 0 }}
|
|
49
|
+
>
|
|
50
|
+
<i
|
|
51
|
+
className={`bi ${collapsed
|
|
52
|
+
? 'bi-chevron-double-right'
|
|
53
|
+
: 'bi-chevron-double-left'
|
|
54
|
+
}`}
|
|
55
|
+
title={collapsed ? 'Expand Sidebar' : 'Collapse Sidebar'}
|
|
56
|
+
></i>
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
<MenuSection
|
|
60
|
+
collapsed={collapsed}
|
|
61
|
+
menuItems={[
|
|
62
|
+
{ text: "Variables", icon: "bi bi-braces" },
|
|
63
|
+
{ text: "Types", icon: "bi bi-code-square", path: "peer-types" },
|
|
64
|
+
{ text: "Assistants", icon: "bi bi-person-fill-gear" },
|
|
65
|
+
{ text: "Tools", icon: "bi bi-tools" },
|
|
66
|
+
{ text: "Workflows", icon: "bi bi-database-fill-gear" },
|
|
67
|
+
{ text: "Events", icon: "bi bi-lightning-charge-fill" },
|
|
68
|
+
{ text: "Packages", icon: "bi bi-box-fill" },
|
|
69
|
+
]}
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<hr />
|
|
73
|
+
<MenuSection
|
|
74
|
+
collapsed={collapsed}
|
|
75
|
+
menuItems={[
|
|
76
|
+
{ text: "Threads", icon: "bi bi-cpu", path: "shell" },
|
|
77
|
+
{ text: `Knowledge ${knowledgeSublinkActive ? '' : '+'}`, icon: "bi bi-journal-bookmark-fill", path: "knowledge-values" },
|
|
78
|
+
...(knowledgeSublinkActive && knowledgeSublinks || []),
|
|
79
|
+
]}
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
{(packagesWithNavItems?.length ?? 0) > 0 &&
|
|
83
|
+
packagesWithNavItems?.map(p => <PackageNavItems key={p.packageId} pkg={p} collapsed={collapsed} />)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface IMenuSectionProps {
|
|
91
|
+
collapsed?: boolean
|
|
92
|
+
menuItems: IMenuItemProps[]
|
|
93
|
+
}
|
|
94
|
+
function MenuSection(props: IMenuSectionProps) {
|
|
95
|
+
return (
|
|
96
|
+
<div className="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
|
97
|
+
{props.menuItems.map(mi => <MenuItem key={mi.text + mi.path} {...mi} collapsed={props.collapsed}></MenuItem>)}
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
interface IMenuItemProps {
|
|
104
|
+
text: string
|
|
105
|
+
path?: string
|
|
106
|
+
icon: string
|
|
107
|
+
className?: string
|
|
108
|
+
left?: number
|
|
109
|
+
collapsed?: boolean
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function MenuItem(props: IMenuItemProps) {
|
|
113
|
+
const divRef = React.useRef<HTMLDivElement>(null);
|
|
114
|
+
useObservable(mainContentPath);
|
|
115
|
+
const link = props.path ?? props.text.replace(/\s/g, '-').toLowerCase();
|
|
116
|
+
const href = window.location.href.split('#')[1]?.trim() ?? '';
|
|
117
|
+
let isActive = href.split('/')[0] === link || href.startsWith(link);
|
|
118
|
+
if (link === 'shell' && !href) {
|
|
119
|
+
isActive = true;
|
|
120
|
+
}
|
|
121
|
+
let marginLeft = props.left || 0;
|
|
122
|
+
if (props.collapsed && marginLeft) {
|
|
123
|
+
marginLeft = 0;
|
|
124
|
+
}
|
|
125
|
+
const [_isDesktop] = useObservable(isDesktop);
|
|
126
|
+
const toolTip = props.collapsed ? props.text : '';
|
|
127
|
+
|
|
128
|
+
// useEffect(() => {
|
|
129
|
+
// if (divRef.current && _isDesktop && props.collapsed) {
|
|
130
|
+
// new Tooltip(divRef.current as HTMLElement);
|
|
131
|
+
// }
|
|
132
|
+
// }, [divRef, divRef?.current, props.collapsed]);
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<div
|
|
136
|
+
key={`${props.text}-${props.path}-${props.collapsed}`}
|
|
137
|
+
ref={divRef}
|
|
138
|
+
className={`nav-link text-reset ${isActive && 'active' || ''} ${props.className || ''}`}
|
|
139
|
+
data-bs-toggle="tooltip" data-bs-title={props.text} data-bs-placement="right"
|
|
140
|
+
style={{ cursor: "pointer", marginLeft: `${marginLeft}px` }}
|
|
141
|
+
onClick={() => {
|
|
142
|
+
mainContentPath(link);
|
|
143
|
+
if (!_isDesktop) {
|
|
144
|
+
toggleCollapsed();
|
|
145
|
+
}
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<a
|
|
149
|
+
style={{ textDecoration: 'none', textWrap: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}
|
|
150
|
+
>
|
|
151
|
+
<i className={props.icon}></i>
|
|
152
|
+
{props.collapsed ? '' :
|
|
153
|
+
<>
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
{props.text}
|
|
157
|
+
</>
|
|
158
|
+
}
|
|
159
|
+
</a>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function PackageNavItems(props: { pkg: IPackage, collapsed?: boolean }) {
|
|
165
|
+
const pkg = props.pkg;
|
|
166
|
+
if (!pkg.appNavs || pkg.appNavs.length === 0) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// if (pkg.appNavs?.length === 1 && pkg.appNavs[0].name === pkg.name) {
|
|
171
|
+
// const iconClassName = pkg.appNavs[0].iconClassName || "bi bi-question-square";
|
|
172
|
+
// // this package only has one nav item and it's named the same as the package so just show it as a top level item
|
|
173
|
+
// return <MenuItem
|
|
174
|
+
// text={pkg.name}
|
|
175
|
+
// icon={iconClassName}
|
|
176
|
+
// />
|
|
177
|
+
// }
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<>
|
|
181
|
+
{pkg.appNavs.length !== 1 || pkg.appNavs[0].name !== pkg.name && (
|
|
182
|
+
<label style={{ color: 'silver' }}>{pkg.name}</label>
|
|
183
|
+
)}
|
|
184
|
+
<MenuSection
|
|
185
|
+
collapsed={props.collapsed}
|
|
186
|
+
menuItems={
|
|
187
|
+
pkg.appNavs.map(ni => {
|
|
188
|
+
let path = `package-nav/${pkg.packageId}/${(ni.navigationPath ?? ni.name).replace(/[^a-zA-Z0-9]/g, '-').toLowerCase()}`;
|
|
189
|
+
while (path.includes('//')) {
|
|
190
|
+
path = path.replace('//', '/');
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
text: ni.name,
|
|
194
|
+
icon: ni.iconClassName || "bi bi-box-seam",
|
|
195
|
+
path,
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
/>
|
|
200
|
+
</>
|
|
201
|
+
)
|
|
202
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThreadContainer } from '../components/messages/thread-view';
|
|
3
|
+
import { useObservable } from '../hooks';
|
|
4
|
+
import { colorMode } from '../screens/settings/color-mode-dropdown';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const RightBarContent = () => {
|
|
9
|
+
const [_colorMode] = useObservable(colorMode);
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
className={`right-bar-content p-0 m-0 ${_colorMode === 'light' ? 'bg-white' : ''}`}
|
|
13
|
+
style={{ height: '100vh', overflowY: 'scroll' }}
|
|
14
|
+
>
|
|
15
|
+
<ThreadContainer closeThreadBtn={<span style={{ marginLeft: '40px'}}></span>} />
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// // I liked this layout so leaving it here in case it's useful later
|
|
21
|
+
// const TabsContainer = () => {
|
|
22
|
+
// const [activeTab, setActiveTab] = useState('threads');
|
|
23
|
+
// return (
|
|
24
|
+
// <div>
|
|
25
|
+
// {/* Tab Headers */}
|
|
26
|
+
// <ul className="nav nav-tabs">
|
|
27
|
+
// <li className="nav-item">
|
|
28
|
+
// <a
|
|
29
|
+
// href="#"
|
|
30
|
+
// className={`nav-link ${activeTab === 'threads' ? 'active' : ''}`}
|
|
31
|
+
// onClick={(e) => {
|
|
32
|
+
// e.preventDefault(); // Prevents page jump
|
|
33
|
+
// setActiveTab('threads');
|
|
34
|
+
// }}
|
|
35
|
+
// >
|
|
36
|
+
// Threads
|
|
37
|
+
// </a>
|
|
38
|
+
// </li>
|
|
39
|
+
// <li className="nav-item">
|
|
40
|
+
// <a
|
|
41
|
+
// href="#"
|
|
42
|
+
// className={`nav-link ${activeTab === 'notifications' ? 'active' : ''}`}
|
|
43
|
+
// onClick={(e) => {
|
|
44
|
+
// e.preventDefault();
|
|
45
|
+
// setActiveTab('notifications');
|
|
46
|
+
// }}
|
|
47
|
+
// >
|
|
48
|
+
// Notifications
|
|
49
|
+
// </a>
|
|
50
|
+
// </li>
|
|
51
|
+
// </ul>
|
|
52
|
+
// {/* Tab Content */}
|
|
53
|
+
// <div className="tab-content p-3">
|
|
54
|
+
// <div className={`tab-pane fade ${activeTab === 'threads' ? 'show active' : ''}`}>
|
|
55
|
+
// {/* Replace with your Threads content */}
|
|
56
|
+
// <h5>Threads</h5>
|
|
57
|
+
// <p>This is where your threads content goes.</p>
|
|
58
|
+
// </div>
|
|
59
|
+
// <div className={`tab-pane fade ${activeTab === 'notifications' ? 'show active' : ''}`}>
|
|
60
|
+
// {/* Replace with your Notifications content */}
|
|
61
|
+
// <h5>Notifications</h5>
|
|
62
|
+
// <p>This is where your notifications content goes.</p>
|
|
63
|
+
// </div>
|
|
64
|
+
// </div>
|
|
65
|
+
// </div>
|
|
66
|
+
// );
|
|
67
|
+
// }
|