@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,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDoc, IPeerEventType } from "@peers-app/peers-sdk";
|
|
3
|
+
import { MarkdownEditorInline } from "../../components/markdown-editor/editor-inline";
|
|
4
|
+
import { Input } from "../../components/input";
|
|
5
|
+
|
|
6
|
+
export const PeerEventInfo = (props: { peerEventType: IDoc<IPeerEventType> }) => {
|
|
7
|
+
const { peerEventType } = props;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
|
|
12
|
+
<small>Name:</small>
|
|
13
|
+
<Input
|
|
14
|
+
value={peerEventType.qs.name}
|
|
15
|
+
className="form-control mb-3 p-0 ps-2"
|
|
16
|
+
placeholder="Event name"
|
|
17
|
+
title="Event name"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<div className='mt-2'>
|
|
21
|
+
<small>Description:</small>
|
|
22
|
+
<MarkdownEditorInline
|
|
23
|
+
value={peerEventType.qs.description as any}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ICursorIterable, IOSchemaType, IPeerEventType, newid, observable, PeerEventTypes } from "@peers-app/peers-sdk";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { Input } from "../../components/input";
|
|
4
|
+
import { LazyList } from "../../components/lazy-list";
|
|
5
|
+
import { LoadingIndicator } from '../../components/loading-indicator';
|
|
6
|
+
import { MarkdownWithMentions } from '../../components/markdown-with-mentions';
|
|
7
|
+
import { isDesktop, mainContentPath } from '../../globals';
|
|
8
|
+
import { useObservable } from "../../hooks";
|
|
9
|
+
|
|
10
|
+
export function PeerEventList() {
|
|
11
|
+
const [searchTextObs] = useState(() => observable(''));
|
|
12
|
+
const [searchText] = useObservable(searchTextObs);
|
|
13
|
+
|
|
14
|
+
const [cursorObs] = useState(() => observable<ICursorIterable<IPeerEventType>>());
|
|
15
|
+
const [cursorId] = useState(() => observable(newid()));
|
|
16
|
+
|
|
17
|
+
async function newCursor() {
|
|
18
|
+
const cursor = await PeerEventTypes().cursor({ name: { $matchWords: searchText } }, { sortBy: ['-createdAt'] });
|
|
19
|
+
cursorObs(cursor);
|
|
20
|
+
cursorId(newid());
|
|
21
|
+
return cursor;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
newCursor();
|
|
26
|
+
}, [searchText]);
|
|
27
|
+
|
|
28
|
+
async function searchSubmit(evt: React.KeyboardEvent<HTMLInputElement>) {
|
|
29
|
+
if (evt.key !== "Enter") return;
|
|
30
|
+
if (!searchText.trim()) return;
|
|
31
|
+
const peerEventName = searchText.trim();
|
|
32
|
+
const event = await PeerEventTypes().initRecord({
|
|
33
|
+
name: peerEventName,
|
|
34
|
+
description: '',
|
|
35
|
+
schema: {
|
|
36
|
+
type: IOSchemaType.none,
|
|
37
|
+
fields: []
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
await PeerEventTypes().insert(event);
|
|
41
|
+
mainContentPath(`events/${event.peerEventTypeId}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function loadMore(events: IPeerEventType[]): Promise<IPeerEventType[]> {
|
|
45
|
+
let moreMatches: IPeerEventType[] = [];
|
|
46
|
+
let cursor = cursorObs() || await newCursor();
|
|
47
|
+
for await (const event of cursor) {
|
|
48
|
+
if (events.find(e => e.peerEventTypeId === event.peerEventTypeId)) continue;
|
|
49
|
+
moreMatches.push(event);
|
|
50
|
+
if (searchText.length && moreMatches.length > 5) break;
|
|
51
|
+
if (moreMatches.length >= 50) break;
|
|
52
|
+
}
|
|
53
|
+
if (moreMatches.length === 0) {
|
|
54
|
+
cursorObs(undefined);
|
|
55
|
+
}
|
|
56
|
+
return moreMatches;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div className='container-fluid'>
|
|
61
|
+
<Input value={searchTextObs} className="form-control mt-3" style={{ marginBottom: "10px" }} placeholder="Search or create new event"
|
|
62
|
+
autoFocus={isDesktop() ? true : false}
|
|
63
|
+
onKeyUp={evt => searchSubmit(evt)}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<div className="peers-list-container">
|
|
67
|
+
<LazyList
|
|
68
|
+
key={cursorId()}
|
|
69
|
+
loadMore={loadMore}
|
|
70
|
+
scrollThreshold={0.6}
|
|
71
|
+
renderItems={(events) => {
|
|
72
|
+
return events.map(event => {
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
key={event.peerEventTypeId}
|
|
76
|
+
className='container-fluid pb-4'
|
|
77
|
+
>
|
|
78
|
+
<i className="bi bi-lightning-charge-fill"></i>
|
|
79
|
+
<a href={`#events/${event.peerEventTypeId}`}>
|
|
80
|
+
{event.name}
|
|
81
|
+
</a>
|
|
82
|
+
<div style={{ paddingLeft: '20px' }}>
|
|
83
|
+
<MarkdownWithMentions content={event.description} />
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
})
|
|
89
|
+
}}
|
|
90
|
+
loadingIndicator={
|
|
91
|
+
<div className="d-flex justify-content-center" style={{ height: 200 }}>
|
|
92
|
+
<LoadingIndicator />
|
|
93
|
+
</div>
|
|
94
|
+
}
|
|
95
|
+
endOfList={
|
|
96
|
+
<div className="d-flex justify-content-center" style={{ height: 200 }}>
|
|
97
|
+
{/* <span className="h3">End of List</span> */}
|
|
98
|
+
</div>
|
|
99
|
+
}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { IDoc, IPeerEventType, Observable, } from "@peers-app/peers-sdk";
|
|
2
|
+
import React, { useEffect } from "react";
|
|
3
|
+
import { Input } from "../../components/input";
|
|
4
|
+
import { MarkdownWithMentions } from "../../components/markdown-with-mentions";
|
|
5
|
+
import { Tooltip } from "../../components/tooltip";
|
|
6
|
+
import { useObservableState } from "../../hooks";
|
|
7
|
+
import { getCronErrors, getCronExplanation } from "./cron";
|
|
8
|
+
|
|
9
|
+
export const PeerEventSchedule = (props: { peerEventType: IDoc<IPeerEventType> }) => {
|
|
10
|
+
const { peerEventType } = props;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
|
|
15
|
+
<div className="mt-3"></div>
|
|
16
|
+
<small>Chron Schedule</small>
|
|
17
|
+
<CronScheduleEditor cronSchedule={peerEventType.qs.cronSchedule} q={peerEventType.q} />
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const CronScheduleEditor = (props: { cronSchedule: Observable<string | undefined>, q: Observable<number> }) => {
|
|
24
|
+
const { cronSchedule } = props;
|
|
25
|
+
const tempSchedule = useObservableState(props.cronSchedule() ?? '');
|
|
26
|
+
const cronError = useObservableState('');
|
|
27
|
+
const cronExplanation = useObservableState('');
|
|
28
|
+
|
|
29
|
+
const emptyCronMessage = [
|
|
30
|
+
'Enter a valid cron schedule to have this workflow automatically run.',
|
|
31
|
+
'For detailed information, see [Cron Schedule Syntax](https://en.wikipedia.org/wiki/Cron#CRON_expression)',
|
|
32
|
+
'and [CronTab.Guru](https://crontab.guru/)\n',
|
|
33
|
+
'The format is:',
|
|
34
|
+
'- `minute hour day-of-month month day-of-week`. ',
|
|
35
|
+
' - `*` means every',
|
|
36
|
+
' - `1-5` means 1 through 5',
|
|
37
|
+
' - `1,4` means 1 and 4',
|
|
38
|
+
'',
|
|
39
|
+
'Examples:',
|
|
40
|
+
'- run every day at 3am:\n - `0 3 * * *`',
|
|
41
|
+
'- run every Monday at 3am:\n - `0 3 * * 1`',
|
|
42
|
+
'- run every Monday and Thursday at 3am:\n - `0 3 * * 1,4`',
|
|
43
|
+
'- run every weekday at 3am:\n - `0 3 * * 1-5`',
|
|
44
|
+
|
|
45
|
+
].join('\n')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
|
|
50
|
+
function updateExplanation() {
|
|
51
|
+
if (cronError()) {
|
|
52
|
+
cronExplanation('');
|
|
53
|
+
}
|
|
54
|
+
else if (!tempSchedule()) {
|
|
55
|
+
cronExplanation(emptyCronMessage);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
cronExplanation(getCronExplanation(tempSchedule()));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
cronExplanation(getCronExplanation(tempSchedule()));
|
|
63
|
+
|
|
64
|
+
const sub = tempSchedule.subscribe(() => {
|
|
65
|
+
// validate and format cron schedule
|
|
66
|
+
let schedule = tempSchedule() || '';
|
|
67
|
+
schedule = schedule.trim();
|
|
68
|
+
cronExplanation('');
|
|
69
|
+
cronError('');
|
|
70
|
+
cronSchedule(undefined);
|
|
71
|
+
if (!schedule) {
|
|
72
|
+
updateExplanation();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const errors = getCronErrors(schedule);
|
|
77
|
+
if (errors) {
|
|
78
|
+
cronError(errors);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
cronSchedule(schedule);
|
|
83
|
+
updateExplanation();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const sub2 = props.q.subscribe(() => {
|
|
87
|
+
if (props.q() === 0) {
|
|
88
|
+
tempSchedule(cronSchedule() || '');
|
|
89
|
+
cronError('');
|
|
90
|
+
cronExplanation(getCronExplanation(tempSchedule()));
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
return () => {
|
|
94
|
+
sub.dispose();
|
|
95
|
+
sub2.dispose();
|
|
96
|
+
}
|
|
97
|
+
}, [cronSchedule, tempSchedule]);
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<Tooltip
|
|
103
|
+
markdownContent={emptyCronMessage}
|
|
104
|
+
handleClassName={`p-2 small`}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<Input
|
|
108
|
+
value={tempSchedule}
|
|
109
|
+
className={`form-control mb-3 p-0 p-2 ` + (cronError() ? 'border-danger' : '')}
|
|
110
|
+
placeholder="minute hour day(of month) month day(of week)"
|
|
111
|
+
title="Cron Schedule"
|
|
112
|
+
style={{ fontFamily: 'monospace' }}
|
|
113
|
+
/>
|
|
114
|
+
{cronError()
|
|
115
|
+
? (
|
|
116
|
+
<div className="text-danger">
|
|
117
|
+
<MarkdownWithMentions content={cronError()} />
|
|
118
|
+
</div>
|
|
119
|
+
)
|
|
120
|
+
: (
|
|
121
|
+
<div>
|
|
122
|
+
<MarkdownWithMentions content={cronExplanation()} />
|
|
123
|
+
</div>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
</>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { getIconClassName, getUserContext, Groups, IDoc, IGroup, Observable, generateGroupShare, checkQRCodeCompatibility, copyToClipboard } from "@peers-app/peers-sdk";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { Checkbox } from "../../components/checkbox";
|
|
4
|
+
import { Input } from "../../components/input";
|
|
5
|
+
import { LoadingIndicator } from "../../components/loading-indicator";
|
|
6
|
+
import { MarkdownEditorInline } from "../../components/markdown-editor/editor-inline";
|
|
7
|
+
import { SaveButton } from "../../components/save-button";
|
|
8
|
+
import { ScreenTabBody, Tabs } from "../../components/tabs";
|
|
9
|
+
import { usePromise } from "../../hooks";
|
|
10
|
+
import { updateActiveTabTitle } from "../../tabs-layout/tabs-state";
|
|
11
|
+
import { registerInternalPeersUI } from "../../ui-router/ui-loader";
|
|
12
|
+
import { GroupMembersUI } from "./group-members";
|
|
13
|
+
|
|
14
|
+
interface IProps {
|
|
15
|
+
groupId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const GroupDetails = (props: IProps) => {
|
|
19
|
+
|
|
20
|
+
const group = usePromise(async () => {
|
|
21
|
+
const userContext = await getUserContext();
|
|
22
|
+
const userGroupTable = Groups(userContext.userDataContext);
|
|
23
|
+
const group = await userGroupTable.get(props.groupId);
|
|
24
|
+
if (!group) {
|
|
25
|
+
throw new Error('Group not found');
|
|
26
|
+
}
|
|
27
|
+
updateActiveTabTitle(group.name || "Group");
|
|
28
|
+
const groupDoc = userGroupTable.initDoc(group);
|
|
29
|
+
// Bit of a hack - saves go to both the group and user db
|
|
30
|
+
const originalSave = groupDoc.save;
|
|
31
|
+
groupDoc.save = async () => {
|
|
32
|
+
const saveResult = await originalSave();
|
|
33
|
+
const groupDataContext = userContext.getDataContext(group.groupId);
|
|
34
|
+
const groupGroupTable = Groups(groupDataContext);
|
|
35
|
+
await groupGroupTable.save(saveResult.toJS());
|
|
36
|
+
return saveResult;
|
|
37
|
+
}
|
|
38
|
+
return groupDoc;
|
|
39
|
+
}, undefined, [props.groupId]);
|
|
40
|
+
|
|
41
|
+
if (!group) {
|
|
42
|
+
return <LoadingIndicator />;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className="container-fluid p-3">
|
|
47
|
+
|
|
48
|
+
<div className="d-flex">
|
|
49
|
+
<div>
|
|
50
|
+
<h4>
|
|
51
|
+
<i className={`${getIconClassName(Groups())} me-2`}></i>
|
|
52
|
+
</h4>
|
|
53
|
+
</div>
|
|
54
|
+
<div className="flex-grow-1">
|
|
55
|
+
<h4>
|
|
56
|
+
<Input
|
|
57
|
+
key={group.groupId}
|
|
58
|
+
className='border border-0'
|
|
59
|
+
style={{ width: '100%', outline: 'none', backgroundColor: 'transparent' }}
|
|
60
|
+
value={group.qs.name}
|
|
61
|
+
/>
|
|
62
|
+
</h4>
|
|
63
|
+
</div>
|
|
64
|
+
<div className="d-flex gap-2">
|
|
65
|
+
<ShareButton groupId={props.groupId} />
|
|
66
|
+
<SaveButton
|
|
67
|
+
key={group.groupId}
|
|
68
|
+
doc={group}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<Tabs
|
|
74
|
+
key={group.groupId}
|
|
75
|
+
tabs={[
|
|
76
|
+
{
|
|
77
|
+
name: 'Info', content:
|
|
78
|
+
<ScreenTabBody>
|
|
79
|
+
<GroupInfo group={group} />
|
|
80
|
+
</ScreenTabBody>
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Members', content:
|
|
84
|
+
<ScreenTabBody>
|
|
85
|
+
<GroupMembersWrapper groupId={props.groupId} />
|
|
86
|
+
</ScreenTabBody>
|
|
87
|
+
},
|
|
88
|
+
]}
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const GroupInfo = (props: { group: IDoc<IGroup> }) => {
|
|
95
|
+
const { group } = props
|
|
96
|
+
|
|
97
|
+
group.description = group.description || '';
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<div>
|
|
101
|
+
|
|
102
|
+
<small>Name:</small>
|
|
103
|
+
<Input
|
|
104
|
+
value={group.qs.name}
|
|
105
|
+
className="form-control mb-3 p-0 ps-2"
|
|
106
|
+
placeholder="Group name"
|
|
107
|
+
title="Group name"
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
<small>Icon Class Name:</small>
|
|
111
|
+
<Input
|
|
112
|
+
value={group.qs.iconClassName}
|
|
113
|
+
className="form-control mb-3 p-0 ps-2"
|
|
114
|
+
placeholder="bi-people-fill"
|
|
115
|
+
title="Icon class name (e.g., bi-people-fill, bi-house-fill, bi-star-fill)"
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<small>Group ID:</small>
|
|
119
|
+
<div className="form-control mb-3 p-2 bg-body-secondary text-body-secondary" style={{ fontFamily: 'monospace', fontSize: '0.9em' }}>
|
|
120
|
+
{group.groupId}
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div className="d-flex flex-row">
|
|
124
|
+
<div className="ms-2">
|
|
125
|
+
<label className="form-label small mt-2 me-2">Disabled:</label>
|
|
126
|
+
<Checkbox
|
|
127
|
+
className="form-check-input mt-2"
|
|
128
|
+
checked={group.qs.disabled}
|
|
129
|
+
/>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<br />
|
|
134
|
+
|
|
135
|
+
<small className="mt-2">Description:</small>
|
|
136
|
+
<MarkdownEditorInline
|
|
137
|
+
value={group.qs.description as Observable<string>}
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const ShareButton = ({ groupId }: { groupId: string }) => {
|
|
145
|
+
const [isSharing, setIsSharing] = useState(false);
|
|
146
|
+
const [shareResult, setShareResult] = useState<{
|
|
147
|
+
success: boolean;
|
|
148
|
+
message: string;
|
|
149
|
+
qrInfo?: any;
|
|
150
|
+
} | null>(null);
|
|
151
|
+
|
|
152
|
+
const handleShare = async () => {
|
|
153
|
+
setIsSharing(true);
|
|
154
|
+
setShareResult(null);
|
|
155
|
+
|
|
156
|
+
try {
|
|
157
|
+
// Generate the group share data
|
|
158
|
+
const groupShare = await generateGroupShare(groupId);
|
|
159
|
+
|
|
160
|
+
// Check QR code compatibility
|
|
161
|
+
const qrInfo = checkQRCodeCompatibility(groupShare, 20);
|
|
162
|
+
|
|
163
|
+
// Convert to JSON
|
|
164
|
+
const groupShareJson = JSON.stringify(groupShare, null, 2);
|
|
165
|
+
|
|
166
|
+
// Copy to clipboard
|
|
167
|
+
const copied = await copyToClipboard(groupShareJson);
|
|
168
|
+
|
|
169
|
+
if (copied) {
|
|
170
|
+
setShareResult({
|
|
171
|
+
success: true,
|
|
172
|
+
message: `Group share data copied to clipboard! (${qrInfo.size} chars, ${qrInfo.memberCount} admin members)`,
|
|
173
|
+
qrInfo
|
|
174
|
+
});
|
|
175
|
+
} else {
|
|
176
|
+
setShareResult({
|
|
177
|
+
success: false,
|
|
178
|
+
message: 'Failed to copy to clipboard. Please copy manually from the modal.',
|
|
179
|
+
qrInfo
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
} catch (error: any) {
|
|
183
|
+
setShareResult({
|
|
184
|
+
success: false,
|
|
185
|
+
message: `Error generating share: ${error.message}`,
|
|
186
|
+
});
|
|
187
|
+
} finally {
|
|
188
|
+
setIsSharing(false);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<>
|
|
194
|
+
<button
|
|
195
|
+
className="btn btn-secondary btn-sm"
|
|
196
|
+
onClick={handleShare}
|
|
197
|
+
disabled={isSharing}
|
|
198
|
+
title="Share group with admin members"
|
|
199
|
+
>
|
|
200
|
+
{isSharing ? (
|
|
201
|
+
<>
|
|
202
|
+
<span className="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true"></span>
|
|
203
|
+
Sharing...
|
|
204
|
+
</>
|
|
205
|
+
) : (
|
|
206
|
+
<>
|
|
207
|
+
<i className="bi-share me-1"></i>
|
|
208
|
+
Share
|
|
209
|
+
</>
|
|
210
|
+
)}
|
|
211
|
+
</button>
|
|
212
|
+
|
|
213
|
+
{shareResult && (
|
|
214
|
+
<div className="position-fixed top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center"
|
|
215
|
+
style={{ backgroundColor: 'rgba(0,0,0,0.5)', zIndex: 1050 }}>
|
|
216
|
+
<div className="card" style={{ maxWidth: '500px', width: '90%' }}>
|
|
217
|
+
<div className="card-header d-flex justify-content-between align-items-center">
|
|
218
|
+
<h6 className="mb-0">
|
|
219
|
+
<i className={`bi-${shareResult.success ? 'check-circle text-success' : 'exclamation-triangle text-warning'} me-2`}></i>
|
|
220
|
+
Group Share {shareResult.success ? 'Ready' : 'Error'}
|
|
221
|
+
</h6>
|
|
222
|
+
<button
|
|
223
|
+
className="btn-close"
|
|
224
|
+
onClick={() => setShareResult(null)}
|
|
225
|
+
aria-label="Close"
|
|
226
|
+
></button>
|
|
227
|
+
</div>
|
|
228
|
+
<div className="card-body">
|
|
229
|
+
<p className="mb-3">{shareResult.message}</p>
|
|
230
|
+
|
|
231
|
+
{shareResult.qrInfo && (
|
|
232
|
+
<div className="mb-3">
|
|
233
|
+
<h6>QR Code Compatibility</h6>
|
|
234
|
+
<div className="row g-2">
|
|
235
|
+
<div className="col-6">
|
|
236
|
+
<small className="text-muted">Size:</small><br/>
|
|
237
|
+
<strong>{shareResult.qrInfo.size} chars</strong>
|
|
238
|
+
</div>
|
|
239
|
+
<div className="col-6">
|
|
240
|
+
<small className="text-muted">QR Version 20:</small><br/>
|
|
241
|
+
<span className={`badge bg-${shareResult.qrInfo.fits ? 'success' : 'warning'}`}>
|
|
242
|
+
{shareResult.qrInfo.fits ? '✓ Fits' : '⚠ Too Large'} ({shareResult.qrInfo.usagePercent}%)
|
|
243
|
+
</span>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
{!shareResult.qrInfo.fits && (
|
|
248
|
+
<div className="alert alert-warning mt-2 mb-0">
|
|
249
|
+
<small>
|
|
250
|
+
<i className="bi-exclamation-triangle me-1"></i>
|
|
251
|
+
Data may be too large for standard QR codes. Consider reducing admin members or use text sharing.
|
|
252
|
+
</small>
|
|
253
|
+
</div>
|
|
254
|
+
)}
|
|
255
|
+
</div>
|
|
256
|
+
)}
|
|
257
|
+
|
|
258
|
+
<div className="text-end">
|
|
259
|
+
<button
|
|
260
|
+
className="btn btn-secondary me-2"
|
|
261
|
+
onClick={() => setShareResult(null)}
|
|
262
|
+
>
|
|
263
|
+
Close
|
|
264
|
+
</button>
|
|
265
|
+
{shareResult.success && (
|
|
266
|
+
<button
|
|
267
|
+
className="btn btn-primary"
|
|
268
|
+
onClick={handleShare}
|
|
269
|
+
>
|
|
270
|
+
Copy Again
|
|
271
|
+
</button>
|
|
272
|
+
)}
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
)}
|
|
278
|
+
</>
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const GroupMembersWrapper = (props: { groupId: string }) => {
|
|
283
|
+
const userContext = usePromise(() => getUserContext());
|
|
284
|
+
if (!userContext) return null;
|
|
285
|
+
|
|
286
|
+
return <GroupMembersUI groupId={props.groupId} userContext={userContext} />;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
registerInternalPeersUI({
|
|
290
|
+
peersUIId: '00group00details00component',
|
|
291
|
+
component: GroupDetails,
|
|
292
|
+
routes: [
|
|
293
|
+
{
|
|
294
|
+
isMatch: (props, context) => {
|
|
295
|
+
const match = context.path.match(/^groups\/([a-zA-Z0-9]{25})$/);
|
|
296
|
+
if (match) {
|
|
297
|
+
props.groupId = match[1];
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
return false;
|
|
301
|
+
},
|
|
302
|
+
uiCategory: 'screen',
|
|
303
|
+
priority: 2
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
})
|