@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,265 @@
|
|
|
1
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
2
|
+
import {
|
|
3
|
+
LexicalTypeaheadMenuPlugin,
|
|
4
|
+
MenuOption,
|
|
5
|
+
useBasicTypeaheadTriggerMatch
|
|
6
|
+
} from '@lexical/react/LexicalTypeaheadMenuPlugin';
|
|
7
|
+
import { IMentionData, observable, Observable } from "@peers-app/peers-sdk";
|
|
8
|
+
import { $getSelection, TextNode } from 'lexical';
|
|
9
|
+
import { sortBy, uniqBy } from 'lodash';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
|
+
import * as ReactDOM from 'react-dom';
|
|
13
|
+
import { IMentionConfig } from '../../mention-configs';
|
|
14
|
+
import { $createMentionNode } from '../markdown-editor/mention-node';
|
|
15
|
+
|
|
16
|
+
// At most, 5 suggestions are shown in the popup.
|
|
17
|
+
const SUGGESTION_LIST_LENGTH_LIMIT = 10;
|
|
18
|
+
export const MENTIONS_MAX_RESULTS = 10;
|
|
19
|
+
|
|
20
|
+
function useMentionLookupService(mentionString: string | null, mentionConfigs: IMentionConfig[] = []): IMentionData[] {
|
|
21
|
+
const [results, setResults] = useState<Array<IMentionData>>([]);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!mentionString) {
|
|
25
|
+
setResults([]);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
(async () => {
|
|
29
|
+
mentionString = mentionString || '';
|
|
30
|
+
const prefix = mentionString[0];
|
|
31
|
+
// TODO simplify how users can include completed tasks in their search
|
|
32
|
+
let searchCompletedTasks = prefix === '$' && mentionString.startsWith('done');
|
|
33
|
+
if (searchCompletedTasks) {
|
|
34
|
+
mentionString = mentionString.slice(4);
|
|
35
|
+
}
|
|
36
|
+
let kind = '';
|
|
37
|
+
if (mentionString.includes(':')) {
|
|
38
|
+
const parts = mentionString.split(':');
|
|
39
|
+
kind = parts[0];
|
|
40
|
+
mentionString = parts[1] || '';
|
|
41
|
+
}
|
|
42
|
+
const config = mentionConfigs?.find(c => c.kind === kind);
|
|
43
|
+
if (config) {
|
|
44
|
+
let results = await config.query(mentionString);
|
|
45
|
+
results = results.map(r => ({ ...r, clickable: false }));
|
|
46
|
+
setResults(results);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const results = await Promise.all(
|
|
50
|
+
mentionConfigs?.map(c => c.query(mentionString || '')),
|
|
51
|
+
);
|
|
52
|
+
let allResults = results.flat();
|
|
53
|
+
allResults = uniqBy(allResults, 'id');
|
|
54
|
+
let filteredResults = allResults;
|
|
55
|
+
if (prefix === '@') {
|
|
56
|
+
filteredResults = filteredResults.filter((result) => result.kind === 'user' || result.kind === 'assistant');
|
|
57
|
+
} else {
|
|
58
|
+
filteredResults = filteredResults.filter((result) => result.kind !== 'user' && result.kind !== 'assistant');
|
|
59
|
+
}
|
|
60
|
+
if (kind) {
|
|
61
|
+
filteredResults = allResults.filter((result) => result.kind.toLowerCase() === kind.toLowerCase());
|
|
62
|
+
} else if (!filteredResults.length) {
|
|
63
|
+
filteredResults = allResults;
|
|
64
|
+
}
|
|
65
|
+
filteredResults = sortBy(filteredResults, r => {
|
|
66
|
+
return r.name.toLowerCase().indexOf((mentionString!).toLowerCase());
|
|
67
|
+
});
|
|
68
|
+
filteredResults = filteredResults.slice(0, SUGGESTION_LIST_LENGTH_LIMIT);
|
|
69
|
+
filteredResults = filteredResults.map(r => ({ ...r, clickable: false }));
|
|
70
|
+
setResults(filteredResults);
|
|
71
|
+
})();
|
|
72
|
+
}, [mentionString]);
|
|
73
|
+
|
|
74
|
+
return results;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
class MentionTypeaheadOption extends MenuOption {
|
|
78
|
+
name: string;
|
|
79
|
+
picture: JSX.Element;
|
|
80
|
+
id: string;
|
|
81
|
+
userId?: string;
|
|
82
|
+
|
|
83
|
+
constructor(
|
|
84
|
+
public readonly data: IMentionData,
|
|
85
|
+
picture: JSX.Element
|
|
86
|
+
) {
|
|
87
|
+
super(data.name);
|
|
88
|
+
this.name = data.name;
|
|
89
|
+
this.picture = picture;
|
|
90
|
+
this.id = data.id;
|
|
91
|
+
// if (data.kind === 'assistant') {
|
|
92
|
+
// this.userId = data.userId;
|
|
93
|
+
// }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function MentionsTypeaheadMenuItem({
|
|
98
|
+
index,
|
|
99
|
+
isSelected,
|
|
100
|
+
onClick,
|
|
101
|
+
onMouseEnter,
|
|
102
|
+
option,
|
|
103
|
+
}: {
|
|
104
|
+
index: number;
|
|
105
|
+
isSelected: boolean;
|
|
106
|
+
onClick: () => void;
|
|
107
|
+
onMouseEnter: () => void;
|
|
108
|
+
option: MentionTypeaheadOption;
|
|
109
|
+
}) {
|
|
110
|
+
let className = 'item';
|
|
111
|
+
if (isSelected) {
|
|
112
|
+
className += ' selected';
|
|
113
|
+
}
|
|
114
|
+
return (
|
|
115
|
+
<li
|
|
116
|
+
key={option.key}
|
|
117
|
+
tabIndex={-1}
|
|
118
|
+
className={className}
|
|
119
|
+
ref={option.setRefElement}
|
|
120
|
+
role="option"
|
|
121
|
+
aria-selected={isSelected}
|
|
122
|
+
id={'typeahead-item-' + index}
|
|
123
|
+
onMouseEnter={onMouseEnter}
|
|
124
|
+
onClick={onClick}
|
|
125
|
+
data-kind={option.data.kind}
|
|
126
|
+
data-id={option.id}
|
|
127
|
+
data-user-id={option.userId || undefined}
|
|
128
|
+
>
|
|
129
|
+
{option.picture}
|
|
130
|
+
<span className="text">{option.name}</span>
|
|
131
|
+
</li>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function MentionsPlugin(
|
|
136
|
+
props: {
|
|
137
|
+
mentionConfigs?: IMentionConfig[]
|
|
138
|
+
mentionsOpen?: Observable<boolean>
|
|
139
|
+
}
|
|
140
|
+
): JSX.Element | null {
|
|
141
|
+
const [editor] = useLexicalComposerContext();
|
|
142
|
+
|
|
143
|
+
const [queryString, setQueryString] = useState<string | null>(null);
|
|
144
|
+
const results = useMentionLookupService(queryString, props.mentionConfigs);
|
|
145
|
+
const [_mentionsOpen] = useState(() => observable(false));
|
|
146
|
+
|
|
147
|
+
if (props.mentionsOpen) {
|
|
148
|
+
const finalMentionsOpen = _mentionsOpen() && results.length > 0;
|
|
149
|
+
if (props.mentionsOpen() !== finalMentionsOpen) {
|
|
150
|
+
props.mentionsOpen(finalMentionsOpen);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const checkForSlashTriggerMatch = useBasicTypeaheadTriggerMatch('/', {
|
|
155
|
+
minLength: 0,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const options = useMemo(
|
|
159
|
+
() =>
|
|
160
|
+
results
|
|
161
|
+
.map(
|
|
162
|
+
(result) => {
|
|
163
|
+
let picture = <i className="bi bi-question pe-1" />;
|
|
164
|
+
const config = props.mentionConfigs?.find(c => c.kind === result.kind);
|
|
165
|
+
if (config) {
|
|
166
|
+
if (config.picture) {
|
|
167
|
+
picture = config.picture(result);
|
|
168
|
+
} else {
|
|
169
|
+
picture = <i className={config.iconClass + ' pe-1'} />;
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
picture = <i className={'bi bi-question pe-1'} />;
|
|
173
|
+
}
|
|
174
|
+
return new MentionTypeaheadOption(result, picture);
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
.slice(0, SUGGESTION_LIST_LENGTH_LIMIT),
|
|
178
|
+
[results],
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
const onSelectOption = useCallback(
|
|
182
|
+
(
|
|
183
|
+
selectedOption: MentionTypeaheadOption,
|
|
184
|
+
nodeToReplace: TextNode | null,
|
|
185
|
+
closeMenu: () => void,
|
|
186
|
+
) => {
|
|
187
|
+
editor.update(() => {
|
|
188
|
+
const mentionNode = $createMentionNode(selectedOption.data);
|
|
189
|
+
if (nodeToReplace) {
|
|
190
|
+
nodeToReplace.replace(mentionNode);
|
|
191
|
+
}
|
|
192
|
+
mentionNode.selectNext(); // Move cursor to the position after the mention
|
|
193
|
+
const selection = $getSelection();
|
|
194
|
+
if (selection !== null) {
|
|
195
|
+
selection.insertText(' '); // Insert a space after the mention
|
|
196
|
+
}
|
|
197
|
+
closeMenu();
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
[editor],
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const checkForMentionMatch = useCallback(
|
|
204
|
+
(text: string) => {
|
|
205
|
+
const textTrimmed = text.trimStart();
|
|
206
|
+
return {
|
|
207
|
+
leadOffset: text.length - textTrimmed.length,
|
|
208
|
+
matchingString: text.trim(),
|
|
209
|
+
replaceableString: text.trim(),
|
|
210
|
+
};
|
|
211
|
+
},
|
|
212
|
+
[checkForSlashTriggerMatch, editor],
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<LexicalTypeaheadMenuPlugin<MentionTypeaheadOption>
|
|
217
|
+
onQueryChange={setQueryString}
|
|
218
|
+
onSelectOption={onSelectOption}
|
|
219
|
+
triggerFn={checkForMentionMatch}
|
|
220
|
+
options={options}
|
|
221
|
+
onOpen={() => _mentionsOpen(true)}
|
|
222
|
+
onClose={() => _mentionsOpen(false)}
|
|
223
|
+
menuRenderFn={(
|
|
224
|
+
anchorElementRef,
|
|
225
|
+
{ selectedIndex, selectOptionAndCleanUp, setHighlightedIndex },
|
|
226
|
+
) => {
|
|
227
|
+
if (!(anchorElementRef.current && results.length)) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// distance from the top of the viewport to the top of the anchor element
|
|
232
|
+
const anchorTop = anchorElementRef.current.getBoundingClientRect().top;
|
|
233
|
+
const viewportHeight = window.innerHeight;
|
|
234
|
+
|
|
235
|
+
let className = 'typeahead-popover mentions-menu';
|
|
236
|
+
if (anchorTop > (viewportHeight / 2)) {
|
|
237
|
+
className += ' mentions-menu-popup';
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return ReactDOM.createPortal(
|
|
241
|
+
<div className={className}>
|
|
242
|
+
<ul>
|
|
243
|
+
{options.map((option, i: number) => (
|
|
244
|
+
<MentionsTypeaheadMenuItem
|
|
245
|
+
index={i}
|
|
246
|
+
isSelected={selectedIndex === i}
|
|
247
|
+
onClick={() => {
|
|
248
|
+
setHighlightedIndex(i);
|
|
249
|
+
selectOptionAndCleanUp(option);
|
|
250
|
+
}}
|
|
251
|
+
onMouseEnter={() => {
|
|
252
|
+
setHighlightedIndex(i);
|
|
253
|
+
}}
|
|
254
|
+
key={option.key}
|
|
255
|
+
option={option}
|
|
256
|
+
/>
|
|
257
|
+
))}
|
|
258
|
+
</ul>
|
|
259
|
+
</div>,
|
|
260
|
+
anchorElementRef.current,
|
|
261
|
+
);
|
|
262
|
+
}}
|
|
263
|
+
/>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { CodeNode } from '@lexical/code';
|
|
2
|
+
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
|
3
|
+
import { ListItemNode, ListNode } from '@lexical/list';
|
|
4
|
+
import { AutoFocusPlugin } from '@lexical/react/LexicalAutoFocusPlugin';
|
|
5
|
+
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
|
6
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
7
|
+
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
|
8
|
+
import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
|
|
9
|
+
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
10
|
+
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
|
|
11
|
+
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
|
|
12
|
+
import { observable, Observable } from "@peers-app/peers-sdk";
|
|
13
|
+
import { COMMAND_PRIORITY_LOW, KEY_DOWN_COMMAND } from 'lexical';
|
|
14
|
+
import React, { useEffect, useState } from 'react';
|
|
15
|
+
import { MarkdownPlugin } from '../markdown-editor/markdown-plugin';
|
|
16
|
+
import { MentionNode } from '../markdown-editor/mention-node';
|
|
17
|
+
import theme from '../markdown-editor/theme';
|
|
18
|
+
import { MentionsPlugin } from './mentions-plugin';
|
|
19
|
+
import { IMentionConfig, mentionConfigs } from '../../mention-configs';
|
|
20
|
+
|
|
21
|
+
const editorConfig = {
|
|
22
|
+
namespace: 'PeersEditor',
|
|
23
|
+
nodes: [
|
|
24
|
+
HeadingNode,
|
|
25
|
+
QuoteNode,
|
|
26
|
+
CodeNode,
|
|
27
|
+
ListNode,
|
|
28
|
+
ListItemNode,
|
|
29
|
+
MentionNode,
|
|
30
|
+
AutoLinkNode as any,
|
|
31
|
+
LinkNode,
|
|
32
|
+
],
|
|
33
|
+
// Handling of errors during update
|
|
34
|
+
onError(error: Error) {
|
|
35
|
+
throw error;
|
|
36
|
+
},
|
|
37
|
+
// The editor theme
|
|
38
|
+
theme,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export interface IEditorEffects {
|
|
42
|
+
onKeyDown?: (e: React.KeyboardEvent) => (boolean | void);
|
|
43
|
+
focus?: () => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ITypeaheadEditorProps {
|
|
47
|
+
value: Observable<string>;
|
|
48
|
+
effects?: IEditorEffects;
|
|
49
|
+
autoFocus?: boolean;
|
|
50
|
+
maxHeight?: string | number;
|
|
51
|
+
mentionConfigs?: IMentionConfig[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function TypeaheadEditor(props: ITypeaheadEditorProps) {
|
|
55
|
+
const { effects } = props;
|
|
56
|
+
const editorRef = React.useRef<HTMLDivElement>(null);
|
|
57
|
+
|
|
58
|
+
const [mentionsOpen] = useState(() => {
|
|
59
|
+
const obs = observable(false);
|
|
60
|
+
return obs;
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (effects) {
|
|
64
|
+
effects.focus = () => {
|
|
65
|
+
if (editorRef.current?.children[0]) {
|
|
66
|
+
const div = editorRef.current.children[0] as HTMLDivElement;
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
div.focus();
|
|
69
|
+
// Set the selection to the end of the div content
|
|
70
|
+
const range = document.createRange();
|
|
71
|
+
range.selectNodeContents(div);
|
|
72
|
+
range.collapse(false);
|
|
73
|
+
const selection = window.getSelection();
|
|
74
|
+
if (selection) {
|
|
75
|
+
selection.removeAllRanges();
|
|
76
|
+
selection.addRange(range);
|
|
77
|
+
}
|
|
78
|
+
}, 10);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const _mentionConfigs = props.mentionConfigs ?? mentionConfigs;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div className="border rounded border-dark-subtle">
|
|
87
|
+
<LexicalComposer initialConfig={{ ...editorConfig }}>
|
|
88
|
+
<div className="editor-container">
|
|
89
|
+
|
|
90
|
+
<div
|
|
91
|
+
className="editor-inner"
|
|
92
|
+
ref={editorRef}
|
|
93
|
+
style={{ maxHeight: props.maxHeight ?? 30, overflowY: 'hidden' }}
|
|
94
|
+
>
|
|
95
|
+
<RichTextPlugin
|
|
96
|
+
contentEditable={
|
|
97
|
+
<ContentEditable
|
|
98
|
+
className="editor-input p-1"
|
|
99
|
+
/>
|
|
100
|
+
}
|
|
101
|
+
// placeholder={(isEditable) => !isEditable ? <div className="text-muted">Type here...</div> : null}
|
|
102
|
+
ErrorBoundary={LexicalErrorBoundary}
|
|
103
|
+
/>
|
|
104
|
+
<HistoryPlugin />
|
|
105
|
+
{props.autoFocus && <AutoFocusPlugin defaultSelection='rootEnd' />}
|
|
106
|
+
|
|
107
|
+
{_mentionConfigs.length > 0 && (
|
|
108
|
+
<MentionsPlugin
|
|
109
|
+
mentionConfigs={_mentionConfigs}
|
|
110
|
+
mentionsOpen={mentionsOpen}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
|
|
114
|
+
<MarkdownPlugin markdownObs={props.value} />
|
|
115
|
+
{/* <MarkdownShortcutPlugin transformers={customMarkdownTransformers} /> */}
|
|
116
|
+
<OnKeyDownPlugin effects={props.effects} mentionsOpen={mentionsOpen} />
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</LexicalComposer>
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const OnKeyDownPlugin = (props: { effects?: IEditorEffects, mentionsOpen: Observable<boolean> }) => {
|
|
125
|
+
const [editor] = useLexicalComposerContext();
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
const removeListener = editor.registerCommand(KEY_DOWN_COMMAND, (event: KeyboardEvent) => {
|
|
128
|
+
if (props.mentionsOpen()) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
if (props.effects?.onKeyDown) {
|
|
132
|
+
const result = props.effects.onKeyDown(event as any);
|
|
133
|
+
return !!result;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}, COMMAND_PRIORITY_LOW);
|
|
137
|
+
return removeListener;
|
|
138
|
+
}, [editor]);
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { formatMention, getAllMentions, observable, Observable } from "@peers-app/peers-sdk";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { useObservable, usePromise, useSubscription } from "../../hooks";
|
|
4
|
+
import { IMentionConfig } from '../../mention-configs';
|
|
5
|
+
import { TypeaheadEditor } from './typeahead-editor';
|
|
6
|
+
|
|
7
|
+
interface IProps<T> {
|
|
8
|
+
value: Observable<string> | Observable<string | undefined>
|
|
9
|
+
textValue?: Observable<string>
|
|
10
|
+
mentionConfigs: IMentionConfig[]
|
|
11
|
+
autoFocus?: boolean
|
|
12
|
+
onSubmit?: (value: string, textValue: string) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function Typeahead<T>(props: IProps<T>) {
|
|
16
|
+
const { value: sourceValue } = props;
|
|
17
|
+
|
|
18
|
+
// const typeaheadValue = useObservableState('', true);
|
|
19
|
+
const [typeaheadValue] = useState(() => {
|
|
20
|
+
if (props.textValue) {
|
|
21
|
+
return props.textValue;
|
|
22
|
+
} else {
|
|
23
|
+
return observable('');
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
useObservable(typeaheadValue);
|
|
27
|
+
const existingMention = usePromise(async () => {
|
|
28
|
+
const id = sourceValue();
|
|
29
|
+
if (!id) return true;
|
|
30
|
+
for (const config of props.mentionConfigs) {
|
|
31
|
+
const refValue = await config.getById(id);
|
|
32
|
+
if (refValue) {
|
|
33
|
+
typeaheadValue(formatMention({ kind: config.kind, id, name: refValue.name }) + ' ');
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
useSubscription(typeaheadValue, () => {
|
|
41
|
+
const mentions = getAllMentions(typeaheadValue());
|
|
42
|
+
const resolvedMention = mentions.find(m => m.id !== sourceValue()) || mentions[0];
|
|
43
|
+
const resolvedId = resolvedMention?.id;
|
|
44
|
+
if (resolvedId !== sourceValue() || mentions.length > 1) {
|
|
45
|
+
sourceValue(resolvedId);
|
|
46
|
+
if (resolvedId) {
|
|
47
|
+
const newTypeaheadValue = formatMention(resolvedMention) + ' ';
|
|
48
|
+
typeaheadValue(newTypeaheadValue);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, true);
|
|
52
|
+
|
|
53
|
+
if (!existingMention) {
|
|
54
|
+
return <div>...</div>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<TypeaheadEditor
|
|
59
|
+
value={typeaheadValue}
|
|
60
|
+
mentionConfigs={props.mentionConfigs}
|
|
61
|
+
autoFocus={props.autoFocus}
|
|
62
|
+
|
|
63
|
+
// these settings configure it for a single line input
|
|
64
|
+
effects={{
|
|
65
|
+
onKeyDown(e) {
|
|
66
|
+
if (e.key === 'Enter') {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
if (props.onSubmit) {
|
|
69
|
+
props.onSubmit(sourceValue() ?? '', typeaheadValue());
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|