@tylertech/forge-ai 0.15.3-dev.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +192 -0
- package/README.md +76 -2
- package/custom-elements.json +5442 -15097
- package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.mjs +9 -0
- package/dist/ai-agent-info/ai-agent-info.mjs +4 -78
- package/dist/ai-agent-info/ai-agent-info2.mjs +55 -0
- package/dist/ai-agent-info/index.d.ts +1 -1
- package/dist/ai-agent-info/index.mjs +1 -5
- package/dist/ai-agent-selector/ai-agent-selector.d.ts +2 -2
- package/dist/ai-agent-selector/ai-agent-selector.mjs +4 -439
- package/dist/ai-agent-selector/ai-agent-selector2.mjs +344 -0
- package/dist/ai-agent-selector/index.mjs +1 -5
- package/dist/ai-artifact/ai-artifact.mjs +4 -39
- package/dist/ai-artifact/ai-artifact2.mjs +31 -0
- package/dist/ai-artifact/index.d.ts +1 -1
- package/dist/ai-artifact/index.mjs +1 -5
- package/dist/ai-artifact-card/ai-artifact-card.mjs +4 -142
- package/dist/ai-artifact-card/ai-artifact-card2.mjs +103 -0
- package/dist/ai-artifact-card/index.d.ts +1 -1
- package/dist/ai-artifact-card/index.mjs +1 -5
- package/dist/ai-artifact-card-group/ai-artifact-card-group.mjs +4 -137
- package/dist/ai-artifact-card-group/ai-artifact-card-group2.mjs +100 -0
- package/dist/ai-artifact-card-group/index.d.ts +1 -1
- package/dist/ai-artifact-card-group/index.mjs +1 -5
- package/dist/ai-assistant-response/ai-assistant-response.d.ts +1 -2
- package/dist/ai-assistant-response/ai-assistant-response.mjs +4 -236
- package/dist/ai-assistant-response/ai-assistant-response2.mjs +137 -0
- package/dist/ai-assistant-response/index.d.ts +1 -1
- package/dist/ai-assistant-response/index.mjs +1 -5
- package/dist/ai-canvas/ai-canvas.d.ts +3 -3
- package/dist/ai-canvas/ai-canvas.mjs +4 -95
- package/dist/ai-canvas/ai-canvas2.mjs +74 -0
- package/dist/ai-canvas/index.d.ts +1 -1
- package/dist/ai-canvas/index.mjs +1 -5
- package/dist/ai-chain-of-thought/ai-chain-of-thought.mjs +4 -45
- package/dist/ai-chain-of-thought/ai-chain-of-thought2.mjs +35 -0
- package/dist/ai-chain-of-thought/index.d.ts +5 -5
- package/dist/ai-chain-of-thought/index.mjs +6 -17
- package/dist/ai-chain-of-thought/thought-base/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-base/thought-base.mjs +4 -43
- package/dist/ai-chain-of-thought/thought-base/thought-base2.mjs +31 -0
- package/dist/ai-chain-of-thought/thought-detail/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-detail/thought-detail.mjs +4 -34
- package/dist/ai-chain-of-thought/thought-detail/thought-detail2.mjs +26 -0
- package/dist/ai-chain-of-thought/thought-image/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-image/thought-image.mjs +4 -43
- package/dist/ai-chain-of-thought/thought-image/thought-image2.mjs +30 -0
- package/dist/ai-chain-of-thought/thought-search-result/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-search-result/thought-search-result.mjs +4 -62
- package/dist/ai-chain-of-thought/thought-search-result/thought-search-result2.mjs +45 -0
- package/dist/ai-chat-header/ai-chat-header.d.ts +7 -5
- package/dist/ai-chat-header/ai-chat-header.mjs +4 -439
- package/dist/ai-chat-header/ai-chat-header2.mjs +319 -0
- package/dist/ai-chat-header/index.d.ts +2 -2
- package/dist/ai-chat-header/index.mjs +1 -5
- package/dist/ai-chat-interface/ai-chat-interface.d.ts +1 -0
- package/dist/ai-chat-interface/ai-chat-interface.mjs +4 -103
- package/dist/ai-chat-interface/ai-chat-interface2.mjs +73 -0
- package/dist/ai-chat-interface/index.mjs +1 -5
- package/dist/ai-client-message/ai-client-message.d.ts +5 -6
- package/dist/ai-client-message/ai-client-message.mjs +4 -112
- package/dist/ai-client-message/ai-client-message2.mjs +76 -0
- package/dist/ai-client-message/index.mjs +1 -5
- package/dist/ai-context-chip/ai-context-chip.d.ts +1 -1
- package/dist/ai-context-chip/ai-context-chip.mjs +4 -169
- package/dist/ai-context-chip/ai-context-chip2.mjs +113 -0
- package/dist/ai-context-chip/index.mjs +1 -5
- package/dist/ai-context-items/ai-context-items.d.ts +11 -5
- package/dist/ai-context-items/ai-context-items.mjs +4 -78
- package/dist/ai-context-items/ai-context-items2.mjs +53 -0
- package/dist/ai-context-items/index.d.ts +1 -1
- package/dist/ai-context-items/index.mjs +1 -5
- package/dist/ai-conversations-panel/ai-conversations-panel.d.ts +2 -2
- package/dist/ai-conversations-panel/ai-conversations-panel.mjs +4 -632
- package/dist/ai-conversations-panel/ai-conversations-panel2.mjs +531 -0
- package/dist/ai-conversations-panel/index.mjs +1 -5
- package/dist/ai-copy-button/ai-copy-button.mjs +4 -116
- package/dist/ai-copy-button/ai-copy-button2.mjs +88 -0
- package/dist/ai-copy-button/index.mjs +1 -5
- package/dist/ai-dialog/ai-dialog.mjs +4 -304
- package/dist/ai-dialog/ai-dialog2.mjs +237 -0
- package/dist/ai-dialog/index.d.ts +1 -1
- package/dist/ai-dialog/index.mjs +1 -5
- package/dist/ai-disclaimer/ai-disclaimer.mjs +4 -70
- package/dist/ai-disclaimer/ai-disclaimer2.mjs +46 -0
- package/dist/ai-disclaimer/index.d.ts +1 -1
- package/dist/ai-disclaimer/index.mjs +1 -5
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group.mjs +4 -80
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group2.mjs +51 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.d.ts +5 -1
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.mjs +4 -330
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item2.mjs +280 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu-separator.mjs +4 -26
- package/dist/ai-dropdown-menu/ai-dropdown-menu-separator2.mjs +19 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu.d.ts +5 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu.mjs +4 -351
- package/dist/ai-dropdown-menu/ai-dropdown-menu2.mjs +268 -0
- package/dist/ai-dropdown-menu/index.d.ts +1 -0
- package/dist/ai-dropdown-menu/index.mjs +5 -10
- package/dist/ai-dropdown-menu/navigation-controller.d.ts +9 -1
- package/dist/ai-dropdown-menu/navigation-controller.mjs +214 -204
- package/dist/ai-dropdown-menu/selection-manager.mjs +202 -182
- package/dist/ai-edit-thread/ai-edit-thread.d.ts +1 -1
- package/dist/ai-edit-thread/ai-edit-thread.mjs +4 -137
- package/dist/ai-edit-thread/ai-edit-thread2.mjs +96 -0
- package/dist/ai-edit-thread/index.d.ts +1 -1
- package/dist/ai-edit-thread/index.mjs +1 -5
- package/dist/ai-empty-state/ai-empty-state.mjs +4 -38
- package/dist/ai-empty-state/ai-empty-state2.mjs +28 -0
- package/dist/ai-empty-state/index.d.ts +1 -1
- package/dist/ai-empty-state/index.mjs +1 -5
- package/dist/ai-error-message/ai-error-message.mjs +4 -80
- package/dist/ai-error-message/ai-error-message2.mjs +62 -0
- package/dist/ai-error-message/index.mjs +1 -5
- package/dist/ai-fab/ai-fab.mjs +4 -81
- package/dist/ai-fab/ai-fab2.mjs +54 -0
- package/dist/ai-fab/index.d.ts +1 -1
- package/dist/ai-fab/index.mjs +1 -5
- package/dist/ai-file-picker/ai-file-picker.d.ts +1 -0
- package/dist/ai-file-picker/ai-file-picker.mjs +4 -224
- package/dist/ai-file-picker/ai-file-picker2.mjs +172 -0
- package/dist/ai-file-picker/index.mjs +1 -4
- package/dist/ai-gradient-container/ai-gradient-container.mjs +4 -61
- package/dist/ai-gradient-container/ai-gradient-container2.mjs +38 -0
- package/dist/ai-gradient-container/index.d.ts +1 -1
- package/dist/ai-gradient-container/index.mjs +1 -5
- package/dist/ai-icon/ai-icon.d.ts +3 -0
- package/dist/ai-icon/ai-icon.mjs +4 -71
- package/dist/ai-icon/ai-icon2.mjs +41 -0
- package/dist/ai-icon/index.d.ts +1 -1
- package/dist/ai-icon/index.mjs +1 -5
- package/dist/ai-message-thread/ai-message-thread.d.ts +4 -3
- package/dist/ai-message-thread/ai-message-thread.mjs +4 -360
- package/dist/ai-message-thread/ai-message-thread2.mjs +279 -0
- package/dist/ai-message-thread/index.mjs +1 -5
- package/dist/ai-modal/ai-modal.mjs +4 -178
- package/dist/ai-modal/ai-modal2.mjs +141 -0
- package/dist/ai-modal/index.mjs +1 -4
- package/dist/ai-prompt/ai-prompt.d.ts +10 -6
- package/dist/ai-prompt/ai-prompt.mjs +4 -534
- package/dist/ai-prompt/ai-prompt2.mjs +438 -0
- package/dist/ai-prompt/index.mjs +1 -5
- package/dist/ai-reasoning/ai-reasoning.mjs +4 -44
- package/dist/ai-reasoning/ai-reasoning2.mjs +35 -0
- package/dist/ai-reasoning/index.d.ts +2 -2
- package/dist/ai-reasoning/index.mjs +4 -8
- package/dist/ai-reasoning/reasoning-content/index.d.ts +1 -1
- package/dist/ai-reasoning/reasoning-content/index.mjs +1 -5
- package/dist/ai-reasoning/reasoning-content/reasoning-content.mjs +4 -90
- package/dist/ai-reasoning/reasoning-content/reasoning-content2.mjs +68 -0
- package/dist/ai-reasoning-header/ai-reasoning-header.d.ts +7 -1
- package/dist/ai-reasoning-header/ai-reasoning-header.mjs +4 -68
- package/dist/ai-reasoning-header/ai-reasoning-header2.mjs +51 -0
- package/dist/ai-reasoning-header/index.d.ts +1 -1
- package/dist/ai-reasoning-header/index.mjs +1 -5
- package/dist/ai-response-message/ai-response-message.mjs +4 -25
- package/dist/ai-response-message/ai-response-message2.mjs +17 -0
- package/dist/ai-response-message/index.mjs +1 -5
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar.d.ts +1 -1
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar.mjs +4 -230
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar2.mjs +171 -0
- package/dist/ai-response-message-toolbar/index.mjs +1 -5
- package/dist/ai-sidebar/ai-sidebar.d.ts +4 -4
- package/dist/ai-sidebar/ai-sidebar.mjs +4 -256
- package/dist/ai-sidebar/ai-sidebar2.mjs +211 -0
- package/dist/ai-sidebar/index.d.ts +2 -2
- package/dist/ai-sidebar/index.mjs +1 -5
- package/dist/ai-slash-command-menu/ai-slash-command-menu.d.ts +2 -1
- package/dist/ai-slash-command-menu/ai-slash-command-menu.mjs +4 -200
- package/dist/ai-slash-command-menu/ai-slash-command-menu2.mjs +160 -0
- package/dist/ai-slash-command-menu/index.mjs +1 -5
- package/dist/ai-spinner/ai-spinner.mjs +4 -41
- package/dist/ai-spinner/ai-spinner2.mjs +29 -0
- package/dist/ai-spinner/index.d.ts +1 -1
- package/dist/ai-spinner/index.mjs +1 -5
- package/dist/ai-steps/ai-steps.mjs +4 -163
- package/dist/ai-steps/ai-steps2.mjs +133 -0
- package/dist/ai-steps/index.d.ts +1 -1
- package/dist/ai-steps/index.mjs +1 -5
- package/dist/ai-suggestions/ai-suggestions.d.ts +2 -5
- package/dist/ai-suggestions/ai-suggestions.mjs +4 -164
- package/dist/ai-suggestions/ai-suggestions2.mjs +125 -0
- package/dist/ai-suggestions/index.d.ts +2 -1
- package/dist/ai-suggestions/index.mjs +1 -5
- package/dist/ai-thinking-indicator/ai-thinking-indicator.d.ts +2 -1
- package/dist/ai-thinking-indicator/ai-thinking-indicator.mjs +4 -160
- package/dist/ai-thinking-indicator/ai-thinking-indicator2.mjs +143 -0
- package/dist/ai-thinking-indicator/index.d.ts +1 -1
- package/dist/ai-thinking-indicator/index.mjs +1 -5
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu.d.ts +2 -2
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu.mjs +4 -152
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu2.mjs +109 -0
- package/dist/ai-thread-actions-menu/index.d.ts +1 -1
- package/dist/ai-thread-actions-menu/index.mjs +1 -5
- package/dist/ai-threads-search/ai-threads-search.d.ts +3 -4
- package/dist/ai-threads-search/ai-threads-search.mjs +4 -602
- package/dist/ai-threads-search/ai-threads-search2.mjs +495 -0
- package/dist/ai-threads-search/index.d.ts +1 -1
- package/dist/ai-threads-search/index.mjs +1 -5
- package/dist/ai-tool-call/ai-tool-call.d.ts +21 -0
- package/dist/ai-tool-call/ai-tool-call.mjs +4 -0
- package/dist/ai-tool-call/ai-tool-call2.mjs +132 -0
- package/dist/{ai-chatbot → ai-tool-call}/create-tool-renderer.d.ts +1 -1
- package/dist/ai-tool-call/create-tool-renderer.mjs +10 -0
- package/dist/ai-tool-call/index.d.ts +6 -0
- package/dist/ai-tool-call/index.mjs +5 -0
- package/dist/{ai-chatbot → ai-tool-call}/tool-canvas.d.ts +1 -1
- package/dist/ai-tool-call/tool-canvas.mjs +135 -0
- package/dist/ai-tool-call/utils.d.ts +12 -0
- package/dist/ai-tool-call/utils.mjs +20 -0
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.d.ts +1 -1
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.mjs +4 -331
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator2.mjs +225 -0
- package/dist/ai-tool-call-indicator/index.mjs +1 -5
- package/dist/ai-user-message/ai-user-message.mjs +4 -151
- package/dist/ai-user-message/ai-user-message2.mjs +105 -0
- package/dist/ai-user-message/index.mjs +1 -5
- package/dist/ai-user-message-toolbar/ai-user-message-toolbar.mjs +4 -160
- package/dist/ai-user-message-toolbar/ai-user-message-toolbar2.mjs +102 -0
- package/dist/ai-user-message-toolbar/index.mjs +1 -5
- package/dist/ai-voice-input/ai-voice-input.d.ts +1 -1
- package/dist/ai-voice-input/ai-voice-input.mjs +4 -113
- package/dist/ai-voice-input/ai-voice-input2.mjs +92 -0
- package/dist/ai-voice-input/index.d.ts +1 -1
- package/dist/ai-voice-input/index.mjs +1 -5
- package/dist/core/drag-controller.mjs +196 -221
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.mjs +7 -8
- package/dist/core/overlay/index.mjs +1 -4
- package/dist/core/overlay/overlay.d.ts +1 -1
- package/dist/core/overlay/overlay.mjs +4 -180
- package/dist/core/overlay/overlay2.mjs +146 -0
- package/dist/core/popover/index.mjs +1 -4
- package/dist/core/popover/popover.mjs +4 -98
- package/dist/core/popover/popover2.mjs +71 -0
- package/dist/core/resize-controller.mjs +132 -154
- package/dist/core/tooltip/index.mjs +1 -4
- package/dist/core/tooltip/tooltip.mjs +4 -279
- package/dist/core/tooltip/tooltip2.mjs +213 -0
- package/dist/index.d.ts +45 -53
- package/dist/index.mjs +100 -214
- package/dist/jsx.d.ts +895 -0
- package/dist/tools/ai-data-table/ai-data-table.d.ts +1 -2
- package/dist/tools/ai-data-table/ai-data-table.mjs +4 -257
- package/dist/tools/ai-data-table/ai-data-table2.mjs +185 -0
- package/dist/tools/ai-data-table/index.d.ts +0 -1
- package/dist/tools/ai-data-table/index.mjs +1 -6
- package/dist/tools/ai-paginator/ai-paginator.d.ts +14 -0
- package/dist/tools/ai-paginator/ai-paginator.mjs +4 -115
- package/dist/tools/ai-paginator/ai-paginator2.mjs +90 -0
- package/dist/tools/ai-paginator/index.mjs +1 -4
- package/dist/tools/ai-steps/ai-steps.d.ts +2 -3
- package/dist/tools/ai-steps/ai-steps.mjs +4 -49
- package/dist/tools/ai-steps/ai-steps2.mjs +30 -0
- package/dist/tools/ai-steps/index.d.ts +0 -1
- package/dist/tools/ai-steps/index.mjs +1 -6
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.mjs +7 -12
- package/dist/types/chat.d.ts +102 -0
- package/dist/types/feature.d.ts +1 -0
- package/dist/types/file.d.ts +36 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.mjs +0 -0
- package/dist/types/thread.d.ts +14 -0
- package/dist/types/tool.d.ts +197 -0
- package/dist/utils/csv-utils.mjs +37 -57
- package/dist/utils/delete-thread-controller.d.ts +1 -1
- package/dist/utils/delete-thread-controller.mjs +48 -71
- package/dist/utils/dom.d.ts +14 -0
- package/dist/utils/dom.mjs +30 -0
- package/dist/utils/format.d.ts +9 -0
- package/dist/utils/format.mjs +27 -0
- package/dist/utils/index.d.ts +9 -6
- package/dist/utils/index.mjs +6 -16
- package/dist/utils/infinite-scroll-controller.mjs +88 -94
- package/dist/utils/keyboard-navigation-controller.mjs +62 -70
- package/dist/utils/markdown-stream-controller.mjs +48 -0
- package/dist/utils/markdown.d.ts +10 -1
- package/dist/utils/markdown.mjs +261 -40
- package/dist/utils/storage-utils.mjs +30 -24
- package/package.json +40 -104
- package/dist/ai-agent-info/ai-agent-info.scss.mjs +0 -4
- package/dist/ai-agent-selector/ai-agent-selector.scss.mjs +0 -4
- package/dist/ai-artifact/ai-artifact.scss.mjs +0 -4
- package/dist/ai-artifact-card/ai-artifact-card.scss.mjs +0 -283
- package/dist/ai-artifact-card-group/ai-artifact-card-group.scss.mjs +0 -173
- package/dist/ai-assistant-response/ai-assistant-response.scss.mjs +0 -4
- package/dist/ai-attachment/ai-attachment.d.ts +0 -39
- package/dist/ai-attachment/ai-attachment.mjs +0 -130
- package/dist/ai-attachment/ai-attachment.scss.mjs +0 -4
- package/dist/ai-attachment/index.d.ts +0 -1
- package/dist/ai-attachment/index.mjs +0 -5
- package/dist/ai-button/ai-button.d.ts +0 -21
- package/dist/ai-button/ai-button.mjs +0 -68
- package/dist/ai-button/ai-button.scss.mjs +0 -4
- package/dist/ai-button/index.d.ts +0 -1
- package/dist/ai-button/index.mjs +0 -5
- package/dist/ai-canvas/ai-canvas.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/ai-chain-of-thought.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-base/thought-base.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-detail/thought-detail.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-image/thought-image.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-search-result/thought-search-result.scss.mjs +0 -4
- package/dist/ai-chat-header/ai-chat-header.scss.mjs +0 -4
- package/dist/ai-chat-interface/ai-chat-interface.scss.mjs +0 -4
- package/dist/ai-chatbot/ag-ui-adapter.d.ts +0 -24
- package/dist/ai-chatbot/ag-ui-adapter.mjs +0 -388
- package/dist/ai-chatbot/agent-adapter.d.ts +0 -310
- package/dist/ai-chatbot/agent-adapter.mjs +0 -221
- package/dist/ai-chatbot/agent-runner.d.ts +0 -41
- package/dist/ai-chatbot/agent-runner.mjs +0 -265
- package/dist/ai-chatbot/ai-chatbot-base.d.ts +0 -179
- package/dist/ai-chatbot/ai-chatbot-base.mjs +0 -684
- package/dist/ai-chatbot/ai-chatbot-tool-call.d.ts +0 -19
- package/dist/ai-chatbot/ai-chatbot-tool-call.mjs +0 -182
- package/dist/ai-chatbot/ai-chatbot-tool-call.scss.mjs +0 -4
- package/dist/ai-chatbot/ai-chatbot.d.ts +0 -196
- package/dist/ai-chatbot/ai-chatbot.mjs +0 -502
- package/dist/ai-chatbot/ai-chatbot.scss.mjs +0 -4
- package/dist/ai-chatbot/create-tool-renderer.mjs +0 -16
- package/dist/ai-chatbot/event-emitter.d.ts +0 -43
- package/dist/ai-chatbot/event-emitter.mjs +0 -81
- package/dist/ai-chatbot/file-upload-manager.d.ts +0 -27
- package/dist/ai-chatbot/file-upload-manager.mjs +0 -106
- package/dist/ai-chatbot/http-agent-with-credentials.d.ts +0 -8
- package/dist/ai-chatbot/http-agent-with-credentials.mjs +0 -14
- package/dist/ai-chatbot/index.d.ts +0 -18
- package/dist/ai-chatbot/index.mjs +0 -40
- package/dist/ai-chatbot/markdown-stream-controller.mjs +0 -50
- package/dist/ai-chatbot/message-state-controller.d.ts +0 -72
- package/dist/ai-chatbot/message-state-controller.mjs +0 -392
- package/dist/ai-chatbot/request-serialization.d.ts +0 -33
- package/dist/ai-chatbot/request-serialization.mjs +0 -31
- package/dist/ai-chatbot/tool-canvas.mjs +0 -128
- package/dist/ai-chatbot/types.d.ts +0 -582
- package/dist/ai-chatbot/utils.d.ts +0 -49
- package/dist/ai-chatbot/utils.mjs +0 -114
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.d.ts +0 -190
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +0 -986
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.scss.mjs +0 -4
- package/dist/ai-chatbot-launcher/index.d.ts +0 -1
- package/dist/ai-chatbot-launcher/index.mjs +0 -5
- package/dist/ai-client-message/ai-client-message.scss.mjs +0 -4
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.d.ts +0 -34
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.mjs +0 -134
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.scss.mjs +0 -4
- package/dist/ai-confirmation-prompt/index.d.ts +0 -1
- package/dist/ai-confirmation-prompt/index.mjs +0 -5
- package/dist/ai-context-chip/ai-context-chip.scss.mjs +0 -4
- package/dist/ai-context-items/ai-context-items.scss.mjs +0 -4
- package/dist/ai-conversations-panel/ai-conversations-panel.scss.mjs +0 -4
- package/dist/ai-copy-button/ai-copy-button.scss.mjs +0 -4
- package/dist/ai-dialog/ai-dialog.scss.mjs +0 -4
- package/dist/ai-disclaimer/ai-disclaimer.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu-separator.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu.scss.mjs +0 -4
- package/dist/ai-edit-thread/ai-edit-thread.scss.mjs +0 -4
- package/dist/ai-embedded-chat/ai-embedded-chat.d.ts +0 -64
- package/dist/ai-embedded-chat/ai-embedded-chat.mjs +0 -173
- package/dist/ai-embedded-chat/ai-embedded-chat.scss.mjs +0 -4
- package/dist/ai-embedded-chat/index.d.ts +0 -1
- package/dist/ai-embedded-chat/index.mjs +0 -5
- package/dist/ai-empty-state/ai-empty-state.scss.mjs +0 -4
- package/dist/ai-error-message/ai-error-message.scss.mjs +0 -4
- package/dist/ai-fab/ai-fab.scss.mjs +0 -4
- package/dist/ai-file-picker/ai-file-picker.scss.mjs +0 -4
- package/dist/ai-floating-chat/ai-floating-chat.d.ts +0 -53
- package/dist/ai-floating-chat/ai-floating-chat.mjs +0 -147
- package/dist/ai-floating-chat/ai-floating-chat.scss.mjs +0 -4
- package/dist/ai-floating-chat/index.d.ts +0 -1
- package/dist/ai-floating-chat/index.mjs +0 -5
- package/dist/ai-gradient-container/ai-gradient-container.scss.mjs +0 -4
- package/dist/ai-icon/ai-icon.scss.mjs +0 -4
- package/dist/ai-icon-button/ai-icon-button.d.ts +0 -19
- package/dist/ai-icon-button/ai-icon-button.mjs +0 -66
- package/dist/ai-icon-button/ai-icon-button.scss.mjs +0 -4
- package/dist/ai-icon-button/index.d.ts +0 -1
- package/dist/ai-icon-button/index.mjs +0 -5
- package/dist/ai-message-thread/ai-message-thread.scss.mjs +0 -4
- package/dist/ai-modal/ai-modal.scss.mjs +0 -4
- package/dist/ai-prompt/ai-prompt.scss.mjs +0 -4
- package/dist/ai-prompt/prompt-button/index.d.ts +0 -1
- package/dist/ai-prompt/prompt-button/index.mjs +0 -5
- package/dist/ai-prompt/prompt-button/prompt-button.d.ts +0 -16
- package/dist/ai-prompt/prompt-button/prompt-button.mjs +0 -40
- package/dist/ai-prompt/prompt-button/prompt-button.scss.mjs +0 -4
- package/dist/ai-reasoning/ai-reasoning.scss.mjs +0 -4
- package/dist/ai-reasoning/reasoning-content/reasoning-content.scss.mjs +0 -4
- package/dist/ai-reasoning-header/ai-reasoning-header.scss.mjs +0 -4
- package/dist/ai-response-message/ai-response-message.scss.mjs +0 -4
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar.scss.mjs +0 -4
- package/dist/ai-sidebar/ai-sidebar.scss.mjs +0 -4
- package/dist/ai-sidebar-chat/ai-sidebar-chat.d.ts +0 -54
- package/dist/ai-sidebar-chat/ai-sidebar-chat.mjs +0 -163
- package/dist/ai-sidebar-chat/ai-sidebar-chat.scss.mjs +0 -4
- package/dist/ai-sidebar-chat/index.d.ts +0 -1
- package/dist/ai-sidebar-chat/index.mjs +0 -5
- package/dist/ai-slash-command-menu/ai-slash-command-menu.scss.mjs +0 -4
- package/dist/ai-spinner/ai-spinner.scss.mjs +0 -4
- package/dist/ai-steps/ai-steps.scss.mjs +0 -4
- package/dist/ai-suggestions/ai-suggestions.scss.mjs +0 -500
- package/dist/ai-thinking-indicator/ai-thinking-indicator.scss.mjs +0 -143
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu.scss.mjs +0 -4
- package/dist/ai-threads/ai-threads.d.ts +0 -82
- package/dist/ai-threads/ai-threads.mjs +0 -343
- package/dist/ai-threads/ai-threads.scss.mjs +0 -4
- package/dist/ai-threads/index.d.ts +0 -1
- package/dist/ai-threads/index.mjs +0 -5
- package/dist/ai-threads-search/ai-threads-search.scss.mjs +0 -4
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.scss.mjs +0 -4
- package/dist/ai-user-message/ai-user-message.scss.mjs +0 -4
- package/dist/ai-user-message-toolbar/ai-user-message-toolbar.scss.mjs +0 -4
- package/dist/ai-voice-input/ai-voice-input.scss.mjs +0 -4
- package/dist/core/canvas-controller.d.ts +0 -81
- package/dist/core/canvas-controller.mjs +0 -221
- package/dist/core/chatbot-core-controller.d.ts +0 -57
- package/dist/core/chatbot-core-controller.mjs +0 -545
- package/dist/core/overlay/overlay.scss.mjs +0 -4
- package/dist/core/popover/popover.scss.mjs +0 -4
- package/dist/core/tooltip/tooltip.scss.mjs +0 -4
- package/dist/tools/ai-data-table/ai-data-table-definition.d.ts +0 -2
- package/dist/tools/ai-data-table/ai-data-table-definition.mjs +0 -43
- package/dist/tools/ai-data-table/ai-data-table.scss.mjs +0 -4
- package/dist/tools/ai-mcp-app/ai-mcp-app.d.ts +0 -70
- package/dist/tools/ai-mcp-app/ai-mcp-app.mjs +0 -589
- package/dist/tools/ai-mcp-app/ai-mcp-app.scss.mjs +0 -4
- package/dist/tools/ai-mcp-app/index.d.ts +0 -3
- package/dist/tools/ai-mcp-app/index.mjs +0 -6
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.d.ts +0 -60
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.mjs +0 -147
- package/dist/tools/ai-mcp-app/mcp-app-bridge-types.d.ts +0 -124
- package/dist/tools/ai-mcp-app/mcp-app-bridge.d.ts +0 -41
- package/dist/tools/ai-mcp-app/mcp-app-bridge.mjs +0 -293
- package/dist/tools/ai-mcp-app/mcp-app-context.d.ts +0 -46
- package/dist/tools/ai-mcp-app/mcp-app-context.mjs +0 -5
- package/dist/tools/ai-paginator/ai-paginator.scss.mjs +0 -4
- package/dist/tools/ai-steps/ai-steps-definition.d.ts +0 -2
- package/dist/tools/ai-steps/ai-steps-definition.mjs +0 -51
- package/dist/tools/ai-steps/ai-steps.scss.mjs +0 -4
- package/dist/utils/inert-outside.d.ts +0 -7
- package/dist/utils/inert-outside.mjs +0 -28
- package/dist/utils.d.ts +0 -32
- package/dist/utils.mjs +0 -57
- /package/dist/{ai-chatbot → utils}/markdown-stream-controller.d.ts +0 -0
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.mjs";
|
|
2
|
+
import "../ai-spinner/ai-spinner2.mjs";
|
|
3
|
+
import "../ai-icon/ai-icon2.mjs";
|
|
4
|
+
import "../ai-modal/ai-modal2.mjs";
|
|
5
|
+
import { DeleteThreadController } from "../utils/delete-thread-controller.mjs";
|
|
6
|
+
import { InfiniteScrollController } from "../utils/infinite-scroll-controller.mjs";
|
|
7
|
+
import "../ai-error-message/index.mjs";
|
|
8
|
+
import "../ai-thread-actions-menu/index.mjs";
|
|
9
|
+
import "../ai-edit-thread/index.mjs";
|
|
10
|
+
import ai_conversations_panel_default from "./ai-conversations-panel.mjs";
|
|
11
|
+
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
12
|
+
import { customElement, property, query, state } from "lit/decorators.js";
|
|
13
|
+
import { when } from "lit/directives/when.js";
|
|
14
|
+
//#region src/lib/ai-conversations-panel/ai-conversations-panel.ts
|
|
15
|
+
var AiConversationsPanelComponentTagName = "forge-ai-conversations-panel";
|
|
16
|
+
var AiConversationsPanelComponent = class AiConversationsPanelComponent extends LitElement {
|
|
17
|
+
constructor(..._args) {
|
|
18
|
+
super(..._args);
|
|
19
|
+
this.threads = [];
|
|
20
|
+
this.totalChats = 0;
|
|
21
|
+
this.selectedThreadId = null;
|
|
22
|
+
this.showThreadRename = false;
|
|
23
|
+
this.showThreadDelete = false;
|
|
24
|
+
this.loading = false;
|
|
25
|
+
this._viewState = "main";
|
|
26
|
+
this._isSearching = false;
|
|
27
|
+
this._searchResults = [];
|
|
28
|
+
this._searchQuery = "";
|
|
29
|
+
this._editingThreadId = null;
|
|
30
|
+
this._hiddenThreadIds = /* @__PURE__ */ new Set();
|
|
31
|
+
this._openMenuThreadId = null;
|
|
32
|
+
this.#deleteThreadController = new DeleteThreadController(this, { onConfirm: (thread) => {
|
|
33
|
+
const onSuccess = () => {
|
|
34
|
+
this._hiddenThreadIds.add(thread.id);
|
|
35
|
+
this.requestUpdate();
|
|
36
|
+
};
|
|
37
|
+
const onError = (error) => {
|
|
38
|
+
this._hiddenThreadIds.delete(thread.id);
|
|
39
|
+
this.requestUpdate();
|
|
40
|
+
if (error) console.error("Delete failed:", error);
|
|
41
|
+
};
|
|
42
|
+
const event = new CustomEvent("forge-ai-conversations-panel-delete", {
|
|
43
|
+
detail: {
|
|
44
|
+
id: thread.id,
|
|
45
|
+
thread,
|
|
46
|
+
onSuccess,
|
|
47
|
+
onError
|
|
48
|
+
},
|
|
49
|
+
bubbles: true,
|
|
50
|
+
composed: true,
|
|
51
|
+
cancelable: true
|
|
52
|
+
});
|
|
53
|
+
if (this.dispatchEvent(event)) {
|
|
54
|
+
this._hiddenThreadIds.add(thread.id);
|
|
55
|
+
this.requestUpdate();
|
|
56
|
+
}
|
|
57
|
+
} });
|
|
58
|
+
this.#recentChatsScrollController = new InfiniteScrollController(this, { onLoadMore: () => this.#handleRecentChatsLoadMore() });
|
|
59
|
+
this.#searchChatsScrollController = new InfiniteScrollController(this, { onLoadMore: () => this.#handleSearchChatsLoadMore() });
|
|
60
|
+
this.#header = html`
|
|
61
|
+
<div class="header">
|
|
62
|
+
<forge-ai-icon></forge-ai-icon>
|
|
63
|
+
<button class="close-button forge-icon-button forge-icon-button--medium" @click=${this.#handleCloseClick} aria-label="Close conversations panel">
|
|
64
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
65
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
66
|
+
<path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
67
|
+
</svg>
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
`;
|
|
71
|
+
this.#chatsLabel = html`<div class="chats-label">Recent chats</div>`;
|
|
72
|
+
this.#loadingIndicator = html`
|
|
73
|
+
<div class="loading-indicator">
|
|
74
|
+
<forge-ai-spinner size="small"></forge-ai-spinner>
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
77
|
+
this.#chatActionsList = html`
|
|
78
|
+
<ul class="forge-list forge-list--dense forge-list--navlist chat-actions-list" role="list">
|
|
79
|
+
<li class="forge-list-item new-chat-item" role="listitem">
|
|
80
|
+
<button @click=${this.#handleNewChatClick}>
|
|
81
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="forge-icon" aria-hidden="true">
|
|
82
|
+
<path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.2L4 17.2V4h16zm-4-7v2h-3v3h-2v-3H8V9h3V6h2v3z" />
|
|
83
|
+
</svg>
|
|
84
|
+
<span>New chat</span>
|
|
85
|
+
</button>
|
|
86
|
+
</li>
|
|
87
|
+
<li class="forge-list-item new-chat-item" role="listitem">
|
|
88
|
+
<button @click=${this.#handleSearchChatsClick}>
|
|
89
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="forge-icon" aria-hidden="true">
|
|
90
|
+
<path
|
|
91
|
+
d="M9 6v2H2V6zm0 5v2H2v-2zm9 5v2H2v-2zm1.31-4.5c.44-.68.69-1.5.69-2.39 0-2.5-2-4.5-4.5-4.5s-4.5 2-4.5 4.5 2 4.5 4.5 4.5c.87 0 1.69-.25 2.38-.68L21 16l1.39-1.39zm-3.81.11c-1.38 0-2.5-1.11-2.5-2.5s1.12-2.5 2.5-2.5a2.5 2.5 0 0 1 0 5" />
|
|
92
|
+
</svg>
|
|
93
|
+
<span>Search chats</span>
|
|
94
|
+
</button>
|
|
95
|
+
</li>
|
|
96
|
+
</ul>
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
static {
|
|
100
|
+
this.styles = unsafeCSS(ai_conversations_panel_default);
|
|
101
|
+
}
|
|
102
|
+
#searchDebounceTimeout;
|
|
103
|
+
#deleteThreadController;
|
|
104
|
+
#recentChatsScrollController;
|
|
105
|
+
#searchChatsScrollController;
|
|
106
|
+
get #shouldEnableRecentPagination() {
|
|
107
|
+
if (this.totalChats <= 0) return false;
|
|
108
|
+
return this.threads.filter((t) => !this._hiddenThreadIds.has(t.id)).length < this.totalChats;
|
|
109
|
+
}
|
|
110
|
+
get #shouldEnableSearchPagination() {
|
|
111
|
+
if (this.totalChats <= 0) return false;
|
|
112
|
+
return this._searchResults.filter((t) => !this._hiddenThreadIds.has(t.id)).length < this.totalChats;
|
|
113
|
+
}
|
|
114
|
+
connectedCallback() {
|
|
115
|
+
super.connectedCallback();
|
|
116
|
+
this.updateComplete.then(() => {
|
|
117
|
+
if (this._viewState === "main" && this.threads.length) this._searchInputMain?.focus();
|
|
118
|
+
else if (this._viewState === "search") this._searchInputSearch?.focus();
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
disconnectedCallback() {
|
|
122
|
+
super.disconnectedCallback();
|
|
123
|
+
clearTimeout(this.#searchDebounceTimeout);
|
|
124
|
+
}
|
|
125
|
+
firstUpdated() {
|
|
126
|
+
this.#attachScrollController();
|
|
127
|
+
}
|
|
128
|
+
updated(changedProperties) {
|
|
129
|
+
if (changedProperties.has("_viewState") || changedProperties.has("threads") || changedProperties.has("totalChats")) {
|
|
130
|
+
if (changedProperties.has("threads") || changedProperties.has("totalChats")) {
|
|
131
|
+
this.#recentChatsScrollController.reset();
|
|
132
|
+
this.#searchChatsScrollController.reset();
|
|
133
|
+
}
|
|
134
|
+
this.#attachScrollController();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
#attachScrollController() {
|
|
138
|
+
if (!this._threadListContainer) return;
|
|
139
|
+
this.#recentChatsScrollController.detach();
|
|
140
|
+
this.#searchChatsScrollController.detach();
|
|
141
|
+
if (this._viewState === "main" && this.#shouldEnableRecentPagination) this.#recentChatsScrollController.attach(this._threadListContainer);
|
|
142
|
+
else if (this._viewState === "search" && this.#shouldEnableSearchPagination) this.#searchChatsScrollController.attach(this._threadListContainer);
|
|
143
|
+
}
|
|
144
|
+
resetToMainView() {
|
|
145
|
+
this.#transitionToMain();
|
|
146
|
+
this._editingThreadId = null;
|
|
147
|
+
}
|
|
148
|
+
get #displayedThreads() {
|
|
149
|
+
return (this._viewState === "search" ? this._searchResults : this.threads).filter((thread) => !this._hiddenThreadIds.has(thread.id));
|
|
150
|
+
}
|
|
151
|
+
#handleSearch(searchQuery) {
|
|
152
|
+
this._searchQuery = searchQuery;
|
|
153
|
+
this.#searchChatsScrollController.reset();
|
|
154
|
+
const setResults = (results) => {
|
|
155
|
+
this._searchResults = results;
|
|
156
|
+
this._isSearching = false;
|
|
157
|
+
};
|
|
158
|
+
const event = new CustomEvent("forge-ai-conversations-panel-search", {
|
|
159
|
+
detail: {
|
|
160
|
+
query: searchQuery,
|
|
161
|
+
setResults
|
|
162
|
+
},
|
|
163
|
+
bubbles: true,
|
|
164
|
+
composed: true,
|
|
165
|
+
cancelable: true
|
|
166
|
+
});
|
|
167
|
+
if (!this.dispatchEvent(event)) this._isSearching = true;
|
|
168
|
+
else {
|
|
169
|
+
this._isSearching = false;
|
|
170
|
+
this._searchResults = this.threads.filter((thread) => thread.title.toLowerCase().includes(searchQuery.toLowerCase()));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
#handleSearchInput(event) {
|
|
174
|
+
const searchQuery = event.target.value;
|
|
175
|
+
clearTimeout(this.#searchDebounceTimeout);
|
|
176
|
+
if (!searchQuery.trim()) {
|
|
177
|
+
this._searchQuery = "";
|
|
178
|
+
this._searchResults = this.threads;
|
|
179
|
+
this._isSearching = false;
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
this.#searchDebounceTimeout = window.setTimeout(() => {
|
|
183
|
+
this.#handleSearch(searchQuery);
|
|
184
|
+
}, 300);
|
|
185
|
+
}
|
|
186
|
+
#handleRecentChatsLoadMore() {
|
|
187
|
+
const appendResults = (results) => {
|
|
188
|
+
if (results.length === 0) this.#recentChatsScrollController.setHasMore(false);
|
|
189
|
+
else this.threads = [...this.threads, ...results];
|
|
190
|
+
this.#recentChatsScrollController.setLoadingState(false);
|
|
191
|
+
};
|
|
192
|
+
const event = new CustomEvent("forge-ai-conversations-panel-load-more", {
|
|
193
|
+
detail: {
|
|
194
|
+
query: "",
|
|
195
|
+
appendResults
|
|
196
|
+
},
|
|
197
|
+
bubbles: true,
|
|
198
|
+
composed: true
|
|
199
|
+
});
|
|
200
|
+
this.dispatchEvent(event);
|
|
201
|
+
}
|
|
202
|
+
#handleSearchChatsLoadMore() {
|
|
203
|
+
const appendResults = (results) => {
|
|
204
|
+
if (results.length === 0) this.#searchChatsScrollController.setHasMore(false);
|
|
205
|
+
else this._searchResults = [...this._searchResults, ...results];
|
|
206
|
+
this.#searchChatsScrollController.setLoadingState(false);
|
|
207
|
+
};
|
|
208
|
+
const event = new CustomEvent("forge-ai-conversations-panel-load-more", {
|
|
209
|
+
detail: {
|
|
210
|
+
query: this._searchQuery,
|
|
211
|
+
appendResults
|
|
212
|
+
},
|
|
213
|
+
bubbles: true,
|
|
214
|
+
composed: true
|
|
215
|
+
});
|
|
216
|
+
this.dispatchEvent(event);
|
|
217
|
+
}
|
|
218
|
+
#transitionToSearch() {
|
|
219
|
+
if (this._viewState === "search") return;
|
|
220
|
+
this._viewState = "search";
|
|
221
|
+
this._searchQuery = "";
|
|
222
|
+
this._searchResults = this.threads;
|
|
223
|
+
this._isSearching = false;
|
|
224
|
+
this._editingThreadId = null;
|
|
225
|
+
this.#recentChatsScrollController.reset();
|
|
226
|
+
this.#searchChatsScrollController.reset();
|
|
227
|
+
this.updateComplete.then(() => this._searchInputSearch?.focus());
|
|
228
|
+
}
|
|
229
|
+
#transitionToMain() {
|
|
230
|
+
if (this._viewState === "main") return;
|
|
231
|
+
this._viewState = "main";
|
|
232
|
+
this._searchQuery = "";
|
|
233
|
+
this._searchResults = [];
|
|
234
|
+
this._isSearching = false;
|
|
235
|
+
this._editingThreadId = null;
|
|
236
|
+
this.#recentChatsScrollController.reset();
|
|
237
|
+
this.#searchChatsScrollController.reset();
|
|
238
|
+
clearTimeout(this.#searchDebounceTimeout);
|
|
239
|
+
}
|
|
240
|
+
#handleBackClick() {
|
|
241
|
+
this.#transitionToMain();
|
|
242
|
+
}
|
|
243
|
+
#handleThreadSelect(thread) {
|
|
244
|
+
const event = new CustomEvent("forge-ai-conversations-panel-select", {
|
|
245
|
+
detail: {
|
|
246
|
+
id: thread.id,
|
|
247
|
+
title: thread.title
|
|
248
|
+
},
|
|
249
|
+
bubbles: true,
|
|
250
|
+
composed: true
|
|
251
|
+
});
|
|
252
|
+
this.dispatchEvent(event);
|
|
253
|
+
}
|
|
254
|
+
#handleNewChatClick() {
|
|
255
|
+
const event = new CustomEvent("forge-ai-conversations-panel-new-chat", {
|
|
256
|
+
bubbles: true,
|
|
257
|
+
composed: true,
|
|
258
|
+
cancelable: true
|
|
259
|
+
});
|
|
260
|
+
this.dispatchEvent(event);
|
|
261
|
+
}
|
|
262
|
+
#handleSearchChatsClick() {
|
|
263
|
+
this.#transitionToSearch();
|
|
264
|
+
}
|
|
265
|
+
#handleCloseClick() {
|
|
266
|
+
const event = new CustomEvent("forge-ai-conversations-panel-close", {
|
|
267
|
+
bubbles: true,
|
|
268
|
+
composed: true
|
|
269
|
+
});
|
|
270
|
+
this.dispatchEvent(event);
|
|
271
|
+
}
|
|
272
|
+
#handleRetryClick() {
|
|
273
|
+
const event = new CustomEvent("forge-ai-conversations-panel-retry", {
|
|
274
|
+
bubbles: true,
|
|
275
|
+
composed: true
|
|
276
|
+
});
|
|
277
|
+
this.dispatchEvent(event);
|
|
278
|
+
}
|
|
279
|
+
#handleMenuRename(e) {
|
|
280
|
+
this._editingThreadId = e.detail.id;
|
|
281
|
+
this._openMenuThreadId = null;
|
|
282
|
+
}
|
|
283
|
+
#handleMenuOpen(e) {
|
|
284
|
+
this._openMenuThreadId = e.detail.id;
|
|
285
|
+
}
|
|
286
|
+
#handleMenuClose() {
|
|
287
|
+
this._openMenuThreadId = null;
|
|
288
|
+
}
|
|
289
|
+
#handleMenuDeleteClick(e) {
|
|
290
|
+
const { id } = e.detail;
|
|
291
|
+
const thread = this.#displayedThreads.find((t) => t.id === id);
|
|
292
|
+
if (!thread) return;
|
|
293
|
+
this.#deleteThreadController.show(thread);
|
|
294
|
+
}
|
|
295
|
+
#handleEditSave(e) {
|
|
296
|
+
const { id, oldTitle, newTitle } = e.detail;
|
|
297
|
+
const thread = this.#displayedThreads.find((t) => t.id === id);
|
|
298
|
+
if (!thread) return;
|
|
299
|
+
const onSuccess = () => {
|
|
300
|
+
thread.title = newTitle;
|
|
301
|
+
this.requestUpdate();
|
|
302
|
+
};
|
|
303
|
+
const onError = (error) => {
|
|
304
|
+
thread.title = oldTitle;
|
|
305
|
+
this.requestUpdate();
|
|
306
|
+
if (error) console.error("Rename failed:", error);
|
|
307
|
+
};
|
|
308
|
+
const event = new CustomEvent("forge-ai-conversations-panel-rename", {
|
|
309
|
+
detail: {
|
|
310
|
+
id,
|
|
311
|
+
oldTitle,
|
|
312
|
+
newTitle,
|
|
313
|
+
onSuccess,
|
|
314
|
+
onError
|
|
315
|
+
},
|
|
316
|
+
bubbles: true,
|
|
317
|
+
composed: true,
|
|
318
|
+
cancelable: true
|
|
319
|
+
});
|
|
320
|
+
if (this.dispatchEvent(event)) {
|
|
321
|
+
thread.title = newTitle;
|
|
322
|
+
this.requestUpdate();
|
|
323
|
+
}
|
|
324
|
+
this._editingThreadId = null;
|
|
325
|
+
}
|
|
326
|
+
#handleEditCancel() {
|
|
327
|
+
this._editingThreadId = null;
|
|
328
|
+
}
|
|
329
|
+
#header;
|
|
330
|
+
get #headerSearch() {
|
|
331
|
+
return html`
|
|
332
|
+
<div class="header header--search">
|
|
333
|
+
<button class="back-button forge-icon-button forge-icon-button--medium" @click=${this.#handleBackClick} aria-label="Back to recent chats">
|
|
334
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
335
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
336
|
+
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z" />
|
|
337
|
+
</svg>
|
|
338
|
+
</button>
|
|
339
|
+
<forge-ai-icon></forge-ai-icon>
|
|
340
|
+
<div class="search-header-end">
|
|
341
|
+
<button class="close-button forge-icon-button forge-icon-button--medium" @click=${this.#handleCloseClick} aria-label="Close conversations panel">
|
|
342
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
343
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
344
|
+
<path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
345
|
+
</svg>
|
|
346
|
+
</button>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
`;
|
|
350
|
+
}
|
|
351
|
+
#chatsLabel;
|
|
352
|
+
get #searchFieldSearch() {
|
|
353
|
+
return html`
|
|
354
|
+
<div class="forge-field forge-field--small search-field">
|
|
355
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="forge-icon" aria-hidden="true">
|
|
356
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
357
|
+
<path
|
|
358
|
+
d="M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" />
|
|
359
|
+
</svg>
|
|
360
|
+
<input
|
|
361
|
+
type="text"
|
|
362
|
+
id="search-input-search"
|
|
363
|
+
aria-label="Search"
|
|
364
|
+
placeholder="Find a chat"
|
|
365
|
+
autocomplete="off"
|
|
366
|
+
.value=${this._searchQuery}
|
|
367
|
+
@input=${this.#handleSearchInput} />
|
|
368
|
+
${when(this._isSearching, () => html`<forge-ai-spinner size="small" class="search-spinner"></forge-ai-spinner>`)}
|
|
369
|
+
</div>
|
|
370
|
+
`;
|
|
371
|
+
}
|
|
372
|
+
get #emptyState() {
|
|
373
|
+
const message = this._viewState === "search" && this._searchQuery.trim() ? "No chats found" : "No chats yet";
|
|
374
|
+
return html`
|
|
375
|
+
<div class="empty-state">
|
|
376
|
+
<p>${message}</p>
|
|
377
|
+
</div>
|
|
378
|
+
`;
|
|
379
|
+
}
|
|
380
|
+
get #activeScrollController() {
|
|
381
|
+
return this._viewState === "search" ? this.#searchChatsScrollController : this.#recentChatsScrollController;
|
|
382
|
+
}
|
|
383
|
+
get #loadingMoreIndicator() {
|
|
384
|
+
if (!this.#activeScrollController.isLoadingMore) return nothing;
|
|
385
|
+
return html`
|
|
386
|
+
<div class="loading-more-indicator">
|
|
387
|
+
<forge-ai-spinner size="small"></forge-ai-spinner>
|
|
388
|
+
</div>
|
|
389
|
+
`;
|
|
390
|
+
}
|
|
391
|
+
#loadingIndicator;
|
|
392
|
+
get #errorState() {
|
|
393
|
+
return html`
|
|
394
|
+
<div class="error-state">
|
|
395
|
+
<forge-ai-error-message density="small">
|
|
396
|
+
<span slot="title">Error</span>
|
|
397
|
+
<p class="error-state__message">${this.errorMessage}</p>
|
|
398
|
+
<button class="forge-button forge-button--outlined forge-button--dense error-state__retry" type="button" @click=${this.#handleRetryClick}>
|
|
399
|
+
Retry
|
|
400
|
+
</button>
|
|
401
|
+
</forge-ai-error-message>
|
|
402
|
+
</div>
|
|
403
|
+
`;
|
|
404
|
+
}
|
|
405
|
+
/** The single-line variant, used when threads are already on screen and the list stays visible. */
|
|
406
|
+
get #compactError() {
|
|
407
|
+
return html`
|
|
408
|
+
<forge-ai-error-message class="compact-error" density="small">
|
|
409
|
+
<div class="compact-error__body">
|
|
410
|
+
<span>${this.errorMessage}</span>
|
|
411
|
+
<button class="forge-button forge-button--outlined forge-button--dense compact-error__retry" type="button" @click=${this.#handleRetryClick}>
|
|
412
|
+
Retry
|
|
413
|
+
</button>
|
|
414
|
+
</div>
|
|
415
|
+
</forge-ai-error-message>
|
|
416
|
+
`;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* A failure that arrives while a page is in flight is a pagination failure, so it reads at the
|
|
420
|
+
* bottom of the list where the load-more spinner would have been. Any other failure - a rejected
|
|
421
|
+
* thread selection, for instance - is not tied to the end of the list, so it sits above it.
|
|
422
|
+
*/
|
|
423
|
+
get #errorPlacement() {
|
|
424
|
+
if (!this.errorMessage || this.#displayedThreads.length === 0) return "none";
|
|
425
|
+
return this.#activeScrollController.isLoadingMore ? "list-footer" : "above-list";
|
|
426
|
+
}
|
|
427
|
+
get #threadList() {
|
|
428
|
+
if (this.#displayedThreads.length === 0) {
|
|
429
|
+
if (this.errorMessage) return this.#errorState;
|
|
430
|
+
if (this.loading && this._viewState === "main") return this.#loadingIndicator;
|
|
431
|
+
return this.#emptyState;
|
|
432
|
+
}
|
|
433
|
+
return this.#threadItems;
|
|
434
|
+
}
|
|
435
|
+
get #threadItems() {
|
|
436
|
+
const threads = this.#displayedThreads;
|
|
437
|
+
return html`
|
|
438
|
+
<ul class="forge-list forge-list--dense forge-list--navlist" role="list">
|
|
439
|
+
${threads.map((thread) => {
|
|
440
|
+
const isSelected = this.selectedThreadId === thread.id;
|
|
441
|
+
const isEditing = this._editingThreadId === thread.id;
|
|
442
|
+
const hasOpenMenu = this._openMenuThreadId === thread.id;
|
|
443
|
+
return html`
|
|
444
|
+
<li class="forge-list-item ${isSelected ? "forge-list-item--selected" : ""} ${hasOpenMenu ? "forge-list-item--menu-open" : ""}" role="listitem">
|
|
445
|
+
${when(isEditing, () => html`
|
|
446
|
+
<forge-ai-edit-thread
|
|
447
|
+
.thread=${thread}
|
|
448
|
+
.value=${thread.title}
|
|
449
|
+
@forge-ai-edit-thread-save=${this.#handleEditSave}
|
|
450
|
+
@forge-ai-edit-thread-cancel=${this.#handleEditCancel}>
|
|
451
|
+
</forge-ai-edit-thread>
|
|
452
|
+
`, () => html`
|
|
453
|
+
<button @click=${() => this.#handleThreadSelect(thread)} aria-current=${isSelected ? "true" : nothing}>
|
|
454
|
+
<span>${thread.title}</span>
|
|
455
|
+
</button>
|
|
456
|
+
${when(this.showThreadRename || this.showThreadDelete, () => html`
|
|
457
|
+
<div class="thread-item-actions">
|
|
458
|
+
<forge-ai-thread-actions-menu
|
|
459
|
+
.thread=${thread}
|
|
460
|
+
?show-rename=${this.showThreadRename}
|
|
461
|
+
?show-delete=${this.showThreadDelete}
|
|
462
|
+
@forge-ai-thread-actions-menu-rename=${this.#handleMenuRename}
|
|
463
|
+
@forge-ai-thread-actions-menu-delete-click=${this.#handleMenuDeleteClick}
|
|
464
|
+
@forge-ai-thread-actions-menu-open=${this.#handleMenuOpen}
|
|
465
|
+
@forge-ai-thread-actions-menu-close=${this.#handleMenuClose}>
|
|
466
|
+
</forge-ai-thread-actions-menu>
|
|
467
|
+
</div>
|
|
468
|
+
`)}
|
|
469
|
+
`)}
|
|
470
|
+
</li>
|
|
471
|
+
`;
|
|
472
|
+
})}
|
|
473
|
+
</ul>
|
|
474
|
+
${this.#errorPlacement === "list-footer" ? this.#compactError : this.#loadingMoreIndicator}
|
|
475
|
+
`;
|
|
476
|
+
}
|
|
477
|
+
get #threadListContainer() {
|
|
478
|
+
return html` <div class="thread-list-container">${this.#threadList}</div> `;
|
|
479
|
+
}
|
|
480
|
+
#chatActionsList;
|
|
481
|
+
render() {
|
|
482
|
+
const isMainView = this._viewState === "main";
|
|
483
|
+
const isSearchView = this._viewState === "search";
|
|
484
|
+
return html`
|
|
485
|
+
<aside class="conversations-panel" role="complementary" aria-label="Conversation history">
|
|
486
|
+
${when(isMainView, () => this.#header)} ${when(isSearchView, () => this.#headerSearch)} ${when(isMainView, () => this.#chatActionsList)}
|
|
487
|
+
${when(isMainView, () => this.#chatsLabel)} ${when(isSearchView, () => this.#searchFieldSearch)}
|
|
488
|
+
${when(this.#errorPlacement === "above-list", () => this.#compactError)} ${this.#threadListContainer}
|
|
489
|
+
</aside>
|
|
490
|
+
${this.#deleteThreadController.template}
|
|
491
|
+
`;
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
__decorate([property({ type: Array })], AiConversationsPanelComponent.prototype, "threads", void 0);
|
|
495
|
+
__decorate([property({
|
|
496
|
+
type: Number,
|
|
497
|
+
attribute: "total-chats"
|
|
498
|
+
})], AiConversationsPanelComponent.prototype, "totalChats", void 0);
|
|
499
|
+
__decorate([property({
|
|
500
|
+
type: String,
|
|
501
|
+
attribute: "selected-thread-id"
|
|
502
|
+
})], AiConversationsPanelComponent.prototype, "selectedThreadId", void 0);
|
|
503
|
+
__decorate([property({
|
|
504
|
+
type: Boolean,
|
|
505
|
+
attribute: "show-thread-rename"
|
|
506
|
+
})], AiConversationsPanelComponent.prototype, "showThreadRename", void 0);
|
|
507
|
+
__decorate([property({
|
|
508
|
+
type: Boolean,
|
|
509
|
+
attribute: "show-thread-delete"
|
|
510
|
+
})], AiConversationsPanelComponent.prototype, "showThreadDelete", void 0);
|
|
511
|
+
__decorate([property({
|
|
512
|
+
type: Boolean,
|
|
513
|
+
reflect: true
|
|
514
|
+
})], AiConversationsPanelComponent.prototype, "loading", void 0);
|
|
515
|
+
__decorate([property({
|
|
516
|
+
type: String,
|
|
517
|
+
attribute: "error-message"
|
|
518
|
+
})], AiConversationsPanelComponent.prototype, "errorMessage", void 0);
|
|
519
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_viewState", void 0);
|
|
520
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_isSearching", void 0);
|
|
521
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_searchResults", void 0);
|
|
522
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_searchQuery", void 0);
|
|
523
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_editingThreadId", void 0);
|
|
524
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_hiddenThreadIds", void 0);
|
|
525
|
+
__decorate([state()], AiConversationsPanelComponent.prototype, "_openMenuThreadId", void 0);
|
|
526
|
+
__decorate([query("#search-input-main")], AiConversationsPanelComponent.prototype, "_searchInputMain", void 0);
|
|
527
|
+
__decorate([query("#search-input-search")], AiConversationsPanelComponent.prototype, "_searchInputSearch", void 0);
|
|
528
|
+
__decorate([query(".thread-list-container")], AiConversationsPanelComponent.prototype, "_threadListContainer", void 0);
|
|
529
|
+
AiConversationsPanelComponent = __decorate([customElement(AiConversationsPanelComponentTagName)], AiConversationsPanelComponent);
|
|
530
|
+
//#endregion
|
|
531
|
+
export { AiConversationsPanelComponent, AiConversationsPanelComponentTagName };
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
AiConversationsPanelComponent,
|
|
4
|
-
AiConversationsPanelComponentTagName
|
|
5
|
-
};
|
|
1
|
+
export { AiConversationsPanelComponent, AiConversationsPanelComponentTagName } from "./ai-conversations-panel2.mjs";
|