@swisper.ai/web-chat-ui 0.0.2
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/LICENSE +202 -0
- package/README.md +251 -0
- package/dist/components/canvas-shell/canvas-shell.d.ts +64 -0
- package/dist/components/canvas-shell/canvas-shell.d.ts.map +1 -0
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts +26 -0
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts.map +1 -0
- package/dist/components/canvas-shell/index.d.ts +2 -0
- package/dist/components/canvas-shell/index.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-context.d.ts +21 -0
- package/dist/components/card-item-picker/card-item-picker-context.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-list.d.ts +24 -0
- package/dist/components/card-item-picker/card-item-picker-list.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts +28 -0
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-row.d.ts +12 -0
- package/dist/components/card-item-picker/card-item-picker-row.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts +19 -0
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts.map +1 -0
- package/dist/components/card-item-picker/index.d.ts +9 -0
- package/dist/components/card-item-picker/index.d.ts.map +1 -0
- package/dist/components/chat-card/chat-card.d.ts +4 -0
- package/dist/components/chat-card/chat-card.d.ts.map +1 -0
- package/dist/components/chat-card/chat-card.stories.d.ts +11 -0
- package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts +22 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts +20 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-form.d.ts +28 -0
- package/dist/components/chat-card/components/chat-card-form.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-header.d.ts +36 -0
- package/dist/components/chat-card/components/chat-card-header.d.ts.map +1 -0
- package/dist/components/chat-card/components/index.d.ts +5 -0
- package/dist/components/chat-card/components/index.d.ts.map +1 -0
- package/dist/components/chat-card/context.d.ts +13 -0
- package/dist/components/chat-card/context.d.ts.map +1 -0
- package/dist/components/chat-card/contexts.d.ts +16 -0
- package/dist/components/chat-card/contexts.d.ts.map +1 -0
- package/dist/components/chat-card/hooks.d.ts +13 -0
- package/dist/components/chat-card/hooks.d.ts.map +1 -0
- package/dist/components/chat-card/index.d.ts +6 -0
- package/dist/components/chat-card/index.d.ts.map +1 -0
- package/dist/components/chat-card/types.d.ts +21 -0
- package/dist/components/chat-card/types.d.ts.map +1 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts +43 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts.map +1 -0
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts +17 -0
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -0
- package/dist/components/chat-card-container/index.d.ts +3 -0
- package/dist/components/chat-card-container/index.d.ts.map +1 -0
- package/dist/components/chat-container/chat-container.d.ts +51 -0
- package/dist/components/chat-container/chat-container.d.ts.map +1 -0
- package/dist/components/chat-container/chat-container.stories.d.ts +21 -0
- package/dist/components/chat-container/chat-container.stories.d.ts.map +1 -0
- package/dist/components/chat-container/index.d.ts +3 -0
- package/dist/components/chat-container/index.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.d.ts +35 -0
- package/dist/components/chat-input/chat-input.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.stories.d.ts +14 -0
- package/dist/components/chat-input/chat-input.stories.d.ts.map +1 -0
- package/dist/components/chat-input/index.d.ts +3 -0
- package/dist/components/chat-input/index.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/auto-focus-plugin.d.ts +8 -0
- package/dist/components/chat-input/plugins/auto-focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/disabled-plugin.d.ts +7 -0
- package/dist/components/chat-input/plugins/disabled-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/focus-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/has-value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/has-value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/hooks.d.ts +2 -0
- package/dist/components/chat-input/plugins/hooks.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/index.d.ts +8 -0
- package/dist/components/chat-input/plugins/index.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/markdown-plain-paste-plugin.d.ts +2 -0
- package/dist/components/chat-input/plugins/markdown-plain-paste-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/utils.d.ts +4 -0
- package/dist/components/chat-input/plugins/utils.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/transformers.d.ts +3 -0
- package/dist/components/chat-input/transformers.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list-item.d.ts +8 -0
- package/dist/components/chat-list/chat-list-item.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list-items.d.ts +11 -0
- package/dist/components/chat-list/chat-list-items.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.d.ts +63 -0
- package/dist/components/chat-list/chat-list.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.stories.d.ts +13 -0
- package/dist/components/chat-list/chat-list.stories.d.ts.map +1 -0
- package/dist/components/chat-list/index.d.ts +4 -0
- package/dist/components/chat-list/index.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.d.ts +17 -0
- package/dist/components/chat-message/chat-message.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.stories.d.ts +11 -0
- package/dist/components/chat-message/chat-message.stories.d.ts.map +1 -0
- package/dist/components/chat-message/index.d.ts +2 -0
- package/dist/components/chat-message/index.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts +9 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts +30 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts +11 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/index.d.ts +4 -0
- package/dist/components/chat-message-attachment-card/index.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts +5 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts.map +1 -0
- package/dist/components/chat-message-history/chat-message-history.d.ts +48 -0
- package/dist/components/chat-message-history/chat-message-history.d.ts.map +1 -0
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts +7 -0
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts.map +1 -0
- package/dist/components/chat-message-history/index.d.ts +2 -0
- package/dist/components/chat-message-history/index.d.ts.map +1 -0
- package/dist/components/chat-message-response/chat-message-response.d.ts +7 -0
- package/dist/components/chat-message-response/chat-message-response.d.ts.map +1 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts +7 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts.map +1 -0
- package/dist/components/chat-message-response/index.d.ts +2 -0
- package/dist/components/chat-message-response/index.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts +25 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts +7 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/index.d.ts +2 -0
- package/dist/components/chat-message-toolbar/index.d.ts.map +1 -0
- package/dist/components/chat-messages/chat-messages.d.ts +24 -0
- package/dist/components/chat-messages/chat-messages.d.ts.map +1 -0
- package/dist/components/chat-messages/chat-messages.stories.d.ts +8 -0
- package/dist/components/chat-messages/chat-messages.stories.d.ts.map +1 -0
- package/dist/components/chat-messages/index.d.ts +2 -0
- package/dist/components/chat-messages/index.d.ts.map +1 -0
- package/dist/components/chat-notification-card/chat-notification-card.d.ts +114 -0
- package/dist/components/chat-notification-card/chat-notification-card.d.ts.map +1 -0
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts +10 -0
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts.map +1 -0
- package/dist/components/chat-notification-card/index.d.ts +4 -0
- package/dist/components/chat-notification-card/index.d.ts.map +1 -0
- package/dist/components/chat-notification-card/types.d.ts +2 -0
- package/dist/components/chat-notification-card/types.d.ts.map +1 -0
- package/dist/components/chat-notification-card/utils.d.ts +3 -0
- package/dist/components/chat-notification-card/utils.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts +12 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts +8 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/index.d.ts +2 -0
- package/dist/components/chat-notification-popup/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts +17 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-focus-plugin.d.ts +2 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +27 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts +9 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/index.d.ts.map +1 -0
- package/dist/components/chat-reply/chat-reply.d.ts +23 -0
- package/dist/components/chat-reply/chat-reply.d.ts.map +1 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts +7 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts.map +1 -0
- package/dist/components/chat-reply/index.d.ts +2 -0
- package/dist/components/chat-reply/index.d.ts.map +1 -0
- package/dist/components/chat-suggestion/chat-suggestion.d.ts +37 -0
- package/dist/components/chat-suggestion/chat-suggestion.d.ts.map +1 -0
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts +9 -0
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts.map +1 -0
- package/dist/components/chat-suggestion/index.d.ts +2 -0
- package/dist/components/chat-suggestion/index.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +47 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +10 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/index.d.ts +2 -0
- package/dist/components/chat-thinking-process/index.d.ts.map +1 -0
- package/dist/components/chat-thread/chat-thread.d.ts +78 -0
- package/dist/components/chat-thread/chat-thread.d.ts.map +1 -0
- package/dist/components/chat-thread/chat-thread.stories.d.ts +14 -0
- package/dist/components/chat-thread/chat-thread.stories.d.ts.map +1 -0
- package/dist/components/chat-thread/index.d.ts +2 -0
- package/dist/components/chat-thread/index.d.ts.map +1 -0
- package/dist/components/deprecated-empty-state.d.ts +22 -0
- package/dist/components/deprecated-empty-state.d.ts.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/markdown-viewer/hooks.d.ts +9 -0
- package/dist/components/markdown-viewer/hooks.d.ts.map +1 -0
- package/dist/components/markdown-viewer/index.d.ts +3 -0
- package/dist/components/markdown-viewer/index.d.ts.map +1 -0
- package/dist/components/markdown-viewer/markdown-viewer.d.ts +10 -0
- package/dist/components/markdown-viewer/markdown-viewer.d.ts.map +1 -0
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts +9 -0
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts.map +1 -0
- package/dist/components/markdown-viewer/types.d.ts +9 -0
- package/dist/components/markdown-viewer/types.d.ts.map +1 -0
- package/dist/components/markdown-viewer/utils.d.ts +3 -0
- package/dist/components/markdown-viewer/utils.d.ts.map +1 -0
- package/dist/components/new-chat-trigger/index.d.ts +2 -0
- package/dist/components/new-chat-trigger/index.d.ts.map +1 -0
- package/dist/components/new-chat-trigger/new-chat-trigger.d.ts +8 -0
- package/dist/components/new-chat-trigger/new-chat-trigger.d.ts.map +1 -0
- package/dist/components/rich-text-area/constants/index.d.ts +3 -0
- package/dist/components/rich-text-area/constants/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/hooks.d.ts +3 -0
- package/dist/components/rich-text-area/hooks.d.ts.map +1 -0
- package/dist/components/rich-text-area/html-config.d.ts +4 -0
- package/dist/components/rich-text-area/html-config.d.ts.map +1 -0
- package/dist/components/rich-text-area/index.d.ts +7 -0
- package/dist/components/rich-text-area/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/nodes/div-block-node.d.ts +18 -0
- package/dist/components/rich-text-area/nodes/div-block-node.d.ts.map +1 -0
- package/dist/components/rich-text-area/nodes/image-node.d.ts +24 -0
- package/dist/components/rich-text-area/nodes/image-node.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/blur-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/blur-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/controlled-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/controlled-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/disabled-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/disabled-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/file-attachment-plugin.d.ts +10 -0
- package/dist/components/rich-text-area/plugins/file-attachment-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/focus-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/focus-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/html-paste-plugin.d.ts +19 -0
- package/dist/components/rich-text-area/plugins/html-paste-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/image-drop-plugin.d.ts +12 -0
- package/dist/components/rich-text-area/plugins/image-drop-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/index.d.ts +11 -0
- package/dist/components/rich-text-area/plugins/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/markdown-plain-paste-plugin.d.ts +2 -0
- package/dist/components/rich-text-area/plugins/markdown-plain-paste-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts +20 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts.map +1 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts +7 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts.map +1 -0
- package/dist/components/rich-text-area/styled.d.ts +3 -0
- package/dist/components/rich-text-area/styled.d.ts.map +1 -0
- package/dist/components/rich-text-area/transformers.d.ts +16 -0
- package/dist/components/rich-text-area/transformers.d.ts.map +1 -0
- package/dist/components/rich-text-area/types.d.ts +8 -0
- package/dist/components/rich-text-area/types.d.ts.map +1 -0
- package/dist/components/rich-text-area/utils/index.d.ts +6 -0
- package/dist/components/rich-text-area/utils/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/alignment-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/alignment-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/attachment-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/attachment-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/bold-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/bold-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/clean-format-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/clean-format-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts +11 -0
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/image-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/image-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/index.d.ts +14 -0
- package/dist/components/rich-text-field/components/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/italic-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/italic-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/link-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/link-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/size-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/size-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/text-color-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/text-color-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/toolbar-button.d.ts +6 -0
- package/dist/components/rich-text-field/components/toolbar-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/toolbar-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/toolbar-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/typography-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/typography-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/underline-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/underline-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/constants.d.ts +57 -0
- package/dist/components/rich-text-field/constants.d.ts.map +1 -0
- package/dist/components/rich-text-field/context.d.ts +26 -0
- package/dist/components/rich-text-field/context.d.ts.map +1 -0
- package/dist/components/rich-text-field/index.d.ts +3 -0
- package/dist/components/rich-text-field/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts +17 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts.map +1 -0
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts +10 -0
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -0
- package/dist/components/rich-text-field/utils.d.ts +1759 -0
- package/dist/components/rich-text-field/utils.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/spinner.d.ts +9 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.stories.d.ts +8 -0
- package/dist/components/spinner/spinner.stories.d.ts.map +1 -0
- package/dist/contexts/chat-context/chat-context.d.ts +20 -0
- package/dist/contexts/chat-context/chat-context.d.ts.map +1 -0
- package/dist/contexts/chat-context/index.d.ts +2 -0
- package/dist/contexts/chat-context/index.d.ts.map +1 -0
- package/dist/contexts/chat-context/utils.d.ts +3 -0
- package/dist/contexts/chat-context/utils.d.ts.map +1 -0
- package/dist/contexts/chat-conversation-context/chat-conversation-context.d.ts +20 -0
- package/dist/contexts/chat-conversation-context/chat-conversation-context.d.ts.map +1 -0
- package/dist/contexts/chat-conversation-context/index.d.ts +2 -0
- package/dist/contexts/chat-conversation-context/index.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/docs/agent.stories.d.ts +41 -0
- package/dist/docs/agent.stories.d.ts.map +1 -0
- package/dist/docs/chat-panel.d.ts +33 -0
- package/dist/docs/chat-panel.d.ts.map +1 -0
- package/dist/docs/chatbot-panel.d.ts +20 -0
- package/dist/docs/chatbot-panel.d.ts.map +1 -0
- package/dist/docs/chatbot.stories.d.ts +11 -0
- package/dist/docs/chatbot.stories.d.ts.map +1 -0
- package/dist/domain/actions/constants.d.ts +2 -0
- package/dist/domain/actions/constants.d.ts.map +1 -0
- package/dist/domain/actions/hooks/index.d.ts +3 -0
- package/dist/domain/actions/hooks/index.d.ts.map +1 -0
- package/dist/domain/actions/index.d.ts +5 -0
- package/dist/domain/actions/index.d.ts.map +1 -0
- package/dist/domain/actions/types.d.ts +7 -0
- package/dist/domain/actions/types.d.ts.map +1 -0
- package/dist/domain/actions/utils/index.d.ts +11 -0
- package/dist/domain/actions/utils/index.d.ts.map +1 -0
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-chat-prompt-placeholder.d.ts +6 -0
- package/dist/hooks/use-chat-prompt-placeholder.d.ts.map +1 -0
- package/dist/hooks/use-chat-stream-message.d.ts +42 -0
- package/dist/hooks/use-chat-stream-message.d.ts.map +1 -0
- package/dist/hooks/use-current-chat-id.d.ts +2 -0
- package/dist/hooks/use-current-chat-id.d.ts.map +1 -0
- package/dist/hooks/use-is-current-chat-new.d.ts +2 -0
- package/dist/hooks/use-is-current-chat-new.d.ts.map +1 -0
- package/dist/hooks/use-loaded-chat-ids.d.ts +9 -0
- package/dist/hooks/use-loaded-chat-ids.d.ts.map +1 -0
- package/dist/hooks/use-on-chat-changed.d.ts +9 -0
- package/dist/hooks/use-on-chat-changed.d.ts.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +4404 -0
- package/dist/index.es.js.map +1 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +95 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +24 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-list-layout/index.d.ts +3 -0
- package/dist/layouts/chat-card-list-layout/index.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts +84 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts +45 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +37 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts +81 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/index.d.ts +5 -0
- package/dist/layouts/chat-card-three-column-layout/index.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +31 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts +12 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +19 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts +35 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/index.d.ts +4 -0
- package/dist/layouts/chat-card-two-column-layout/index.d.ts.map +1 -0
- package/dist/layouts/index.d.ts +4 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/use-streaming-markdown.d.ts +18 -0
- package/dist/utils/use-streaming-markdown.d.ts.map +1 -0
- package/package.json +155 -0
- package/src/__tests__/setup.ts +5 -0
- package/src/components/canvas-shell/canvas-shell.json +126 -0
- package/src/components/canvas-shell/canvas-shell.stories.tsx +194 -0
- package/src/components/canvas-shell/canvas-shell.test.tsx +205 -0
- package/src/components/canvas-shell/canvas-shell.tsx +250 -0
- package/src/components/canvas-shell/index.ts +19 -0
- package/src/components/card-item-picker/__tests__/card-item-picker.spec.tsx +279 -0
- package/src/components/card-item-picker/card-item-picker-context.tsx +44 -0
- package/src/components/card-item-picker/card-item-picker-list.tsx +95 -0
- package/src/components/card-item-picker/card-item-picker-row-parts.tsx +96 -0
- package/src/components/card-item-picker/card-item-picker-row.tsx +109 -0
- package/src/components/card-item-picker/card-item-picker.json +147 -0
- package/src/components/card-item-picker/card-item-picker.stories.tsx +158 -0
- package/src/components/card-item-picker/index.ts +24 -0
- package/src/components/chat-card/__tests__/chat-card.spec.tsx +118 -0
- package/src/components/chat-card/chat-card.json +162 -0
- package/src/components/chat-card/chat-card.stories.tsx +349 -0
- package/src/components/chat-card/chat-card.tsx +106 -0
- package/src/components/chat-card/components/chat-card-body.tsx +115 -0
- package/src/components/chat-card/components/chat-card-footer.tsx +95 -0
- package/src/components/chat-card/components/chat-card-form.tsx +120 -0
- package/src/components/chat-card/components/chat-card-header.tsx +240 -0
- package/src/components/chat-card/components/index.ts +4 -0
- package/src/components/chat-card/context.tsx +34 -0
- package/src/components/chat-card/contexts.tsx +42 -0
- package/src/components/chat-card/hooks.ts +51 -0
- package/src/components/chat-card/index.ts +5 -0
- package/src/components/chat-card/types.ts +23 -0
- package/src/components/chat-card-container/chat-card-container.json +84 -0
- package/src/components/chat-card-container/chat-card-container.stories.tsx +149 -0
- package/src/components/chat-card-container/chat-card-container.tsx +75 -0
- package/src/components/chat-card-container/index.ts +2 -0
- package/src/components/chat-container/chat-container.json +93 -0
- package/src/components/chat-container/chat-container.stories.tsx +179 -0
- package/src/components/chat-container/chat-container.tsx +231 -0
- package/src/components/chat-container/index.ts +2 -0
- package/src/components/chat-input/chat-input.json +106 -0
- package/src/components/chat-input/chat-input.stories.tsx +291 -0
- package/src/components/chat-input/chat-input.tsx +220 -0
- package/src/components/chat-input/index.ts +2 -0
- package/src/components/chat-input/plugins/auto-focus-plugin.tsx +43 -0
- package/src/components/chat-input/plugins/controlled-value-plugin.tsx +47 -0
- package/src/components/chat-input/plugins/disabled-plugin.tsx +18 -0
- package/src/components/chat-input/plugins/focus-plugin.tsx +44 -0
- package/src/components/chat-input/plugins/has-value-plugin.tsx +51 -0
- package/src/components/chat-input/plugins/hooks.ts +7 -0
- package/src/components/chat-input/plugins/index.ts +7 -0
- package/src/components/chat-input/plugins/markdown-plain-paste-plugin.tsx +63 -0
- package/src/components/chat-input/plugins/utils.ts +48 -0
- package/src/components/chat-input/plugins/value-plugin.tsx +35 -0
- package/src/components/chat-input/transformers.ts +4 -0
- package/src/components/chat-list/chat-list-item.tsx +33 -0
- package/src/components/chat-list/chat-list-items.tsx +144 -0
- package/src/components/chat-list/chat-list.json +117 -0
- package/src/components/chat-list/chat-list.stories.tsx +332 -0
- package/src/components/chat-list/chat-list.tsx +278 -0
- package/src/components/chat-list/index.ts +18 -0
- package/src/components/chat-message/chat-message.json +105 -0
- package/src/components/chat-message/chat-message.stories.tsx +95 -0
- package/src/components/chat-message/chat-message.tsx +66 -0
- package/src/components/chat-message/index.ts +1 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx +74 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.json +110 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx +131 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.tsx +142 -0
- package/src/components/chat-message-attachment-card/index.ts +12 -0
- package/src/components/chat-message-attachment-card/utils.ts +41 -0
- package/src/components/chat-message-history/chat-message-history.json +99 -0
- package/src/components/chat-message-history/chat-message-history.stories.tsx +136 -0
- package/src/components/chat-message-history/chat-message-history.tsx +277 -0
- package/src/components/chat-message-history/index.ts +13 -0
- package/src/components/chat-message-response/chat-message-response.json +68 -0
- package/src/components/chat-message-response/chat-message-response.stories.tsx +63 -0
- package/src/components/chat-message-response/chat-message-response.tsx +24 -0
- package/src/components/chat-message-response/index.ts +1 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.json +100 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx +62 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.tsx +97 -0
- package/src/components/chat-message-toolbar/index.ts +6 -0
- package/src/components/chat-messages/chat-messages.json +95 -0
- package/src/components/chat-messages/chat-messages.stories.tsx +284 -0
- package/src/components/chat-messages/chat-messages.tsx +264 -0
- package/src/components/chat-messages/index.ts +10 -0
- package/src/components/chat-notification-card/chat-notification-card.json +135 -0
- package/src/components/chat-notification-card/chat-notification-card.stories.tsx +290 -0
- package/src/components/chat-notification-card/chat-notification-card.tsx +684 -0
- package/src/components/chat-notification-card/index.ts +3 -0
- package/src/components/chat-notification-card/types.ts +1 -0
- package/src/components/chat-notification-card/utils.ts +34 -0
- package/src/components/chat-notification-popup/chat-notification-popup.json +97 -0
- package/src/components/chat-notification-popup/chat-notification-popup.stories.tsx +80 -0
- package/src/components/chat-notification-popup/chat-notification-popup.tsx +36 -0
- package/src/components/chat-notification-popup/index.ts +1 -0
- package/src/components/chat-prompt-box/chat-prompt-box-context.tsx +62 -0
- package/src/components/chat-prompt-box/chat-prompt-box-focus-plugin.tsx +22 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +106 -0
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +117 -0
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +296 -0
- package/src/components/chat-prompt-box/index.ts +16 -0
- package/src/components/chat-reply/chat-reply.json +79 -0
- package/src/components/chat-reply/chat-reply.stories.tsx +72 -0
- package/src/components/chat-reply/chat-reply.tsx +103 -0
- package/src/components/chat-reply/index.ts +1 -0
- package/src/components/chat-suggestion/chat-suggestion.json +108 -0
- package/src/components/chat-suggestion/chat-suggestion.stories.tsx +147 -0
- package/src/components/chat-suggestion/chat-suggestion.tsx +184 -0
- package/src/components/chat-suggestion/index.ts +8 -0
- package/src/components/chat-thinking-process/chat-thinking-process.json +110 -0
- package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +202 -0
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +268 -0
- package/src/components/chat-thinking-process/index.ts +9 -0
- package/src/components/chat-thread/__tests__/chat-thread.spec.tsx +385 -0
- package/src/components/chat-thread/chat-thread.json +120 -0
- package/src/components/chat-thread/chat-thread.stories.tsx +218 -0
- package/src/components/chat-thread/chat-thread.tsx +549 -0
- package/src/components/chat-thread/index.ts +18 -0
- package/src/components/deprecated-empty-state.ts +39 -0
- package/src/components/index.ts +26 -0
- package/src/components/markdown-viewer/hooks.ts +59 -0
- package/src/components/markdown-viewer/index.ts +2 -0
- package/src/components/markdown-viewer/markdown-viewer.json +84 -0
- package/src/components/markdown-viewer/markdown-viewer.stories.tsx +110 -0
- package/src/components/markdown-viewer/markdown-viewer.tsx +95 -0
- package/src/components/markdown-viewer/types.ts +10 -0
- package/src/components/markdown-viewer/utils.ts +5 -0
- package/src/components/new-chat-trigger/index.ts +1 -0
- package/src/components/new-chat-trigger/new-chat-trigger.tsx +29 -0
- package/src/components/rich-text-area/constants/index.ts +10 -0
- package/src/components/rich-text-area/hooks.ts +24 -0
- package/src/components/rich-text-area/html-config.ts +195 -0
- package/src/components/rich-text-area/index.ts +6 -0
- package/src/components/rich-text-area/nodes/div-block-node.tsx +145 -0
- package/src/components/rich-text-area/nodes/image-node.tsx +100 -0
- package/src/components/rich-text-area/plugins/blur-plugin.tsx +36 -0
- package/src/components/rich-text-area/plugins/controlled-plugin.tsx +23 -0
- package/src/components/rich-text-area/plugins/controlled-value-plugin.tsx +101 -0
- package/src/components/rich-text-area/plugins/disabled-plugin.tsx +17 -0
- package/src/components/rich-text-area/plugins/file-attachment-plugin.tsx +57 -0
- package/src/components/rich-text-area/plugins/focus-plugin.tsx +44 -0
- package/src/components/rich-text-area/plugins/html-paste-plugin.tsx +104 -0
- package/src/components/rich-text-area/plugins/image-drop-plugin.tsx +56 -0
- package/src/components/rich-text-area/plugins/index.ts +10 -0
- package/src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx +63 -0
- package/src/components/rich-text-area/plugins/value-plugin.tsx +46 -0
- package/src/components/rich-text-area/rich-text-area.json +102 -0
- package/src/components/rich-text-area/rich-text-area.stories.tsx +140 -0
- package/src/components/rich-text-area/rich-text-area.tsx +156 -0
- package/src/components/rich-text-area/styled.tsx +20 -0
- package/src/components/rich-text-area/transformers.ts +175 -0
- package/src/components/rich-text-area/types.ts +8 -0
- package/src/components/rich-text-area/utils/index.ts +77 -0
- package/src/components/rich-text-field/components/alignment-select.tsx +103 -0
- package/src/components/rich-text-field/components/attachment-button.tsx +25 -0
- package/src/components/rich-text-field/components/bold-button.tsx +21 -0
- package/src/components/rich-text-field/components/clean-format-button.tsx +44 -0
- package/src/components/rich-text-field/components/formatting-toolbar-plugin.tsx +69 -0
- package/src/components/rich-text-field/components/image-button.tsx +11 -0
- package/src/components/rich-text-field/components/index.ts +14 -0
- package/src/components/rich-text-field/components/italic-button.tsx +21 -0
- package/src/components/rich-text-field/components/link-button.tsx +11 -0
- package/src/components/rich-text-field/components/size-select.tsx +27 -0
- package/src/components/rich-text-field/components/text-color-button.tsx +41 -0
- package/src/components/rich-text-field/components/toolbar-button.tsx +27 -0
- package/src/components/rich-text-field/components/toolbar-select.tsx +19 -0
- package/src/components/rich-text-field/components/typography-select.tsx +27 -0
- package/src/components/rich-text-field/components/underline-button.tsx +21 -0
- package/src/components/rich-text-field/constants.ts +33 -0
- package/src/components/rich-text-field/context.tsx +251 -0
- package/src/components/rich-text-field/index.tsx +6 -0
- package/src/components/rich-text-field/rich-text-field.json +118 -0
- package/src/components/rich-text-field/rich-text-field.stories.tsx +218 -0
- package/src/components/rich-text-field/rich-text-field.tsx +93 -0
- package/src/components/rich-text-field/utils.ts +532 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/spinner/spinner.json +73 -0
- package/src/components/spinner/spinner.stories.tsx +41 -0
- package/src/components/spinner/spinner.tsx +32 -0
- package/src/contexts/chat-context/chat-context.tsx +97 -0
- package/src/contexts/chat-context/index.ts +1 -0
- package/src/contexts/chat-context/utils.ts +7 -0
- package/src/contexts/chat-conversation-context/chat-conversation-context.tsx +608 -0
- package/src/contexts/chat-conversation-context/index.ts +1 -0
- package/src/contexts/index.ts +2 -0
- package/src/docs/agent.stories.tsx +567 -0
- package/src/docs/chat-panel.tsx +174 -0
- package/src/docs/chatbot-panel.tsx +381 -0
- package/src/docs/chatbot.mdx +144 -0
- package/src/docs/chatbot.stories.tsx +63 -0
- package/src/domain/actions/constants.ts +1 -0
- package/src/domain/actions/hooks/index.ts +22 -0
- package/src/domain/actions/index.ts +4 -0
- package/src/domain/actions/types.ts +6 -0
- package/src/domain/actions/utils/index.ts +112 -0
- package/src/domain/index.ts +1 -0
- package/src/hooks/index.tsx +10 -0
- package/src/hooks/use-chat-prompt-placeholder.ts +7 -0
- package/src/hooks/use-chat-stream-message.ts +189 -0
- package/src/hooks/use-current-chat-id.ts +6 -0
- package/src/hooks/use-is-current-chat-new.ts +6 -0
- package/src/hooks/use-loaded-chat-ids.ts +32 -0
- package/src/hooks/use-on-chat-changed.ts +33 -0
- package/src/index.css +1 -0
- package/src/index.ts +6 -0
- package/src/layouts/chat-card-list-layout/__tests__/chat-card-list-layout.spec.tsx +204 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +116 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +190 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +250 -0
- package/src/layouts/chat-card-list-layout/index.ts +11 -0
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.sizing.test.ts +73 -0
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx +282 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +131 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts +78 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +273 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx +291 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts +135 -0
- package/src/layouts/chat-card-three-column-layout/index.ts +24 -0
- package/src/layouts/chat-card-two-column-layout/__tests__/chat-card-two-column-layout.spec.tsx +109 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +97 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.ts +21 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +138 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +132 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.ts +65 -0
- package/src/layouts/chat-card-two-column-layout/index.ts +17 -0
- package/src/layouts/index.ts +3 -0
- package/src/types.ts +29 -0
- package/src/utils/use-streaming-markdown.ts +113 -0
- package/tailwind.css +7 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ChatCard,
|
|
5
|
+
ChatCardBody,
|
|
6
|
+
ChatCardContent,
|
|
7
|
+
ChatCardHeader,
|
|
8
|
+
ChatCardHeaderContent,
|
|
9
|
+
ChatCardTitle,
|
|
10
|
+
} from '../../components/chat-card';
|
|
11
|
+
import { ChatCardContainer } from '../../components/chat-card-container';
|
|
12
|
+
import { ChatContainer } from '../../components/chat-container';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
ChatCardTwoColumnLayout,
|
|
16
|
+
ChatCardTwoColumnLayoutAside,
|
|
17
|
+
ChatCardTwoColumnLayoutMain,
|
|
18
|
+
} from './chat-card-two-column-layout';
|
|
19
|
+
import { chatCardTwoColumnLayoutCardVariants } from './chat-card-two-column-layout.variants';
|
|
20
|
+
|
|
21
|
+
const ROWS = ['Revenue', 'Gross margin', 'Operating costs', 'EBITDA', 'Net income', 'Cash flow'];
|
|
22
|
+
|
|
23
|
+
function Placeholder({ label, className = '' }: { label: string; className?: string }) {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
className={`flex h-full w-full items-center justify-center rounded-[8px] border border-dashed border-card-border-base text-sm ${className}`}
|
|
27
|
+
>
|
|
28
|
+
{label}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function Example() {
|
|
34
|
+
return (
|
|
35
|
+
<ChatContainer className="h-auto py-16">
|
|
36
|
+
{/* `full`: the card's minimum width goes past the default reading column */}
|
|
37
|
+
<ChatCardContainer variant="full">
|
|
38
|
+
<ChatCard className={chatCardTwoColumnLayoutCardVariants()}>
|
|
39
|
+
<ChatCardHeader>
|
|
40
|
+
<ChatCardHeaderContent>
|
|
41
|
+
<ChatCardTitle>Quarterly figures</ChatCardTitle>
|
|
42
|
+
</ChatCardHeaderContent>
|
|
43
|
+
</ChatCardHeader>
|
|
44
|
+
<ChatCardBody>
|
|
45
|
+
<ChatCardContent>
|
|
46
|
+
<ChatCardTwoColumnLayout className="h-[480px]">
|
|
47
|
+
<ChatCardTwoColumnLayoutAside>
|
|
48
|
+
<ul className="flex h-full flex-col gap-[8px] overflow-y-auto">
|
|
49
|
+
{ROWS.map((row) => (
|
|
50
|
+
<li
|
|
51
|
+
key={row}
|
|
52
|
+
className="rounded-[8px] border border-card-border-base p-[8px] text-sm"
|
|
53
|
+
>
|
|
54
|
+
{row}
|
|
55
|
+
</li>
|
|
56
|
+
))}
|
|
57
|
+
</ul>
|
|
58
|
+
</ChatCardTwoColumnLayoutAside>
|
|
59
|
+
|
|
60
|
+
<ChatCardTwoColumnLayoutMain>
|
|
61
|
+
<Placeholder label="Chart" className="bg-card-background-lvl-2" />
|
|
62
|
+
</ChatCardTwoColumnLayoutMain>
|
|
63
|
+
</ChatCardTwoColumnLayout>
|
|
64
|
+
</ChatCardContent>
|
|
65
|
+
</ChatCardBody>
|
|
66
|
+
</ChatCard>
|
|
67
|
+
</ChatCardContainer>
|
|
68
|
+
</ChatContainer>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const meta: Meta<typeof ChatCardTwoColumnLayout> = {
|
|
73
|
+
title: 'Chatbot/ChatCardTwoColumnLayout',
|
|
74
|
+
component: ChatCardTwoColumnLayout,
|
|
75
|
+
tags: ['autodocs'],
|
|
76
|
+
parameters: { layout: 'fullscreen' },
|
|
77
|
+
argTypes: {
|
|
78
|
+
children: {
|
|
79
|
+
control: false,
|
|
80
|
+
description: 'A `ChatCardTwoColumnLayoutAside` followed by a `ChatCardTwoColumnLayoutMain`.',
|
|
81
|
+
},
|
|
82
|
+
className: {
|
|
83
|
+
control: 'text',
|
|
84
|
+
description:
|
|
85
|
+
'Classes for the root. Set the height here (e.g. `h-[480px]`); the layout sets none.',
|
|
86
|
+
},
|
|
87
|
+
asChild: {
|
|
88
|
+
control: false,
|
|
89
|
+
description: 'Renders the single child element as the layout root instead of a `<div>`.',
|
|
90
|
+
table: { defaultValue: { summary: 'false' } },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
args: {
|
|
94
|
+
asChild: false,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export default meta;
|
|
99
|
+
type Story = StoryObj<typeof ChatCardTwoColumnLayout>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* From 744px of layout width, Aside is a 336px column beside Main; below it, Aside stacks
|
|
103
|
+
* above Main and Main takes the rest of the height. The threshold is the layout's own width,
|
|
104
|
+
* not the viewport's.
|
|
105
|
+
*/
|
|
106
|
+
export const Default: Story = {
|
|
107
|
+
render: () => <Example />,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** A narrow card: Aside stacks above Main although the viewport is wide. */
|
|
111
|
+
export const Stacked: Story = {
|
|
112
|
+
render: () => (
|
|
113
|
+
<div style={{ width: 500 }}>
|
|
114
|
+
<Example />
|
|
115
|
+
</div>
|
|
116
|
+
),
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Drag the dashed wrapper's right edge across 744px: the columns switch without the viewport
|
|
121
|
+
* changing, which is the point.
|
|
122
|
+
*/
|
|
123
|
+
export const ResizableContainer: Story = {
|
|
124
|
+
render: () => (
|
|
125
|
+
<div
|
|
126
|
+
className="border border-dashed border-card-border-base"
|
|
127
|
+
style={{
|
|
128
|
+
resize: 'horizontal',
|
|
129
|
+
overflow: 'auto',
|
|
130
|
+
width: 900,
|
|
131
|
+
minWidth: 360,
|
|
132
|
+
maxWidth: '100%',
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<Example />
|
|
136
|
+
</div>
|
|
137
|
+
),
|
|
138
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { createContext, forwardRef, useContext } from 'react';
|
|
3
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@swisper.ai/web-core';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
chatCardTwoColumnLayoutAsideVariants,
|
|
9
|
+
chatCardTwoColumnLayoutGridVariants,
|
|
10
|
+
chatCardTwoColumnLayoutMainVariants,
|
|
11
|
+
chatCardTwoColumnLayoutVariants,
|
|
12
|
+
} from './chat-card-two-column-layout.variants';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Carries nothing but "inside the layout". The panes' container queries only match inside
|
|
16
|
+
* the root's named container, so a pane outside it would stay stacked forever without any
|
|
17
|
+
* error. The check turns that into one.
|
|
18
|
+
*/
|
|
19
|
+
const ChatCardTwoColumnLayoutContext = createContext(false);
|
|
20
|
+
|
|
21
|
+
function useChatCardTwoColumnLayoutContext(part: string) {
|
|
22
|
+
if (!useContext(ChatCardTwoColumnLayoutContext)) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`[web-chat-ui] "${part}" must be used within a ChatCardTwoColumnLayout. ` +
|
|
25
|
+
'Its columns come from the layout’s container query, so render it as a child of ' +
|
|
26
|
+
'the ChatCardTwoColumnLayout element, not as a sibling of it.',
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ChatCardTwoColumnLayoutProps extends ComponentProps<'div'> {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A two-pane card body: Aside (a 336px column) beside Main (flexible), stacked as Aside over
|
|
38
|
+
* Main when the layout is narrower than 744px.
|
|
39
|
+
*
|
|
40
|
+
* The switch is a container query on the layout's **own width**, not a viewport breakpoint,
|
|
41
|
+
* because the card is sized by the chat window, not the viewport. Nothing floats, so unlike
|
|
42
|
+
* the three-column layout there is no measuring and no render prop.
|
|
43
|
+
*
|
|
44
|
+
* The root is the query container and renders the grid inside itself: an element cannot
|
|
45
|
+
* query its own width. `className` goes on the root, so a height set there reaches the grid.
|
|
46
|
+
* Height is not set here, because it belongs to the content, so pass it in `className`.
|
|
47
|
+
*/
|
|
48
|
+
export const ChatCardTwoColumnLayout = forwardRef<HTMLDivElement, ChatCardTwoColumnLayoutProps>(
|
|
49
|
+
function ChatCardTwoColumnLayout({ children, className, asChild = false, ...rest }, ref) {
|
|
50
|
+
const Component = asChild ? Slot : 'div';
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<ChatCardTwoColumnLayoutContext.Provider value>
|
|
54
|
+
<Component
|
|
55
|
+
ref={ref}
|
|
56
|
+
data-testid="chat-card-two-column-layout"
|
|
57
|
+
data-slot="chat-card-two-column-layout"
|
|
58
|
+
className={cn(chatCardTwoColumnLayoutVariants(), className)}
|
|
59
|
+
{...rest}
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
data-testid="chat-card-two-column-layout-grid"
|
|
63
|
+
data-slot="chat-card-two-column-layout-grid"
|
|
64
|
+
className={chatCardTwoColumnLayoutGridVariants()}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</div>
|
|
68
|
+
</Component>
|
|
69
|
+
</ChatCardTwoColumnLayoutContext.Provider>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
ChatCardTwoColumnLayout.displayName = 'ChatCardTwoColumnLayout';
|
|
75
|
+
|
|
76
|
+
export interface ChatCardTwoColumnLayoutAsideProps extends ComponentProps<'aside'> {
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
asChild?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Column 1 (336px) when the layout is at least 744px wide; the first row below that. */
|
|
82
|
+
export const ChatCardTwoColumnLayoutAside = forwardRef<
|
|
83
|
+
HTMLElement,
|
|
84
|
+
ChatCardTwoColumnLayoutAsideProps
|
|
85
|
+
>(function ChatCardTwoColumnLayoutAside({ children, className, asChild = false, ...rest }, ref) {
|
|
86
|
+
useChatCardTwoColumnLayoutContext('ChatCardTwoColumnLayoutAside');
|
|
87
|
+
|
|
88
|
+
const Component = asChild ? Slot : 'aside';
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<Component
|
|
92
|
+
ref={ref}
|
|
93
|
+
data-testid="chat-card-two-column-layout-aside"
|
|
94
|
+
data-slot="chat-card-two-column-layout-aside"
|
|
95
|
+
className={cn(chatCardTwoColumnLayoutAsideVariants(), className)}
|
|
96
|
+
{...rest}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</Component>
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
ChatCardTwoColumnLayoutAside.displayName = 'ChatCardTwoColumnLayoutAside';
|
|
104
|
+
|
|
105
|
+
export interface ChatCardTwoColumnLayoutMainProps extends ComponentProps<'main'> {
|
|
106
|
+
children: ReactNode;
|
|
107
|
+
asChild?: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The flexible track: column 2 side by side, the second row (taking the rest) stacked. */
|
|
111
|
+
export const ChatCardTwoColumnLayoutMain = forwardRef<
|
|
112
|
+
HTMLElement,
|
|
113
|
+
ChatCardTwoColumnLayoutMainProps
|
|
114
|
+
>(function ChatCardTwoColumnLayoutMain({ children, className, asChild = false, ...rest }, ref) {
|
|
115
|
+
useChatCardTwoColumnLayoutContext('ChatCardTwoColumnLayoutMain');
|
|
116
|
+
|
|
117
|
+
const Component = asChild ? Slot : 'main';
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<Component
|
|
121
|
+
ref={ref}
|
|
122
|
+
data-testid="chat-card-two-column-layout-main"
|
|
123
|
+
data-slot="chat-card-two-column-layout-main"
|
|
124
|
+
className={cn(chatCardTwoColumnLayoutMainVariants(), className)}
|
|
125
|
+
{...rest}
|
|
126
|
+
>
|
|
127
|
+
{children}
|
|
128
|
+
</Component>
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
ChatCardTwoColumnLayoutMain.displayName = 'ChatCardTwoColumnLayoutMain';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* The layout switches on a container query against its own width, not on viewport
|
|
5
|
+
* breakpoints: the card is sized by the chat window, and a sidebar or split view makes the
|
|
6
|
+
* viewport claim room the card doesn't have. `336px` and `744px` are `ASIDE_WIDTH` and
|
|
7
|
+
* `TWO_COLUMN_MIN_WIDTH` from `chat-card-two-column-layout.sizing.ts`, written out because
|
|
8
|
+
* Tailwind cannot read a constant. Change both together.
|
|
9
|
+
*
|
|
10
|
+
* The container is named so a two-column layout nested in another container still queries
|
|
11
|
+
* its own root, not the nearest ancestor.
|
|
12
|
+
*
|
|
13
|
+
* Class strings are written out in full because Tailwind finds classes by scanning source;
|
|
14
|
+
* a class assembled from a constant is never generated.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Root: the query container, nothing else. An element cannot match a container query
|
|
19
|
+
* against its own width, so the grid lives one level down, in `…GridVariants`.
|
|
20
|
+
*/
|
|
21
|
+
export const chatCardTwoColumnLayoutVariants = cva(['@container/chat-card-two-column-layout']);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The grid, rendered by the root around its children.
|
|
25
|
+
*
|
|
26
|
+
* Stacked, the rows are `auto 1fr`, so with a height on the root Main takes whatever Aside
|
|
27
|
+
* leaves. Side by side there is one `1fr` row; the stacked template would otherwise leave an
|
|
28
|
+
* empty `1fr` second row taking the height.
|
|
29
|
+
*/
|
|
30
|
+
export const chatCardTwoColumnLayoutGridVariants = cva([
|
|
31
|
+
'grid h-full gap-16',
|
|
32
|
+
'grid-cols-[minmax(0,1fr)] grid-rows-[auto_1fr]',
|
|
33
|
+
'@[744px]/chat-card-two-column-layout:grid-cols-[336px_minmax(0,1fr)] @[744px]/chat-card-two-column-layout:grid-rows-[minmax(0,1fr)]',
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Row 1 when stacked, column 1 when side by side. In the column, `min-h-0` + `overflow-hidden`
|
|
38
|
+
* keep a long list inside the row. Without them the grid item grows to its content and the
|
|
39
|
+
* card gets taller instead of scrolling.
|
|
40
|
+
*/
|
|
41
|
+
export const chatCardTwoColumnLayoutAsideVariants = cva([
|
|
42
|
+
'min-w-0 min-h-0',
|
|
43
|
+
'@[744px]/chat-card-two-column-layout:h-full @[744px]/chat-card-two-column-layout:overflow-hidden',
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The flexible track. `min-w-0` because a grid item's minimum width is its content by
|
|
48
|
+
* default: a map or a wide table would push the track past the card. `relative` so the
|
|
49
|
+
* consumer can anchor their own overlays to Main.
|
|
50
|
+
*/
|
|
51
|
+
export const chatCardTwoColumnLayoutMainVariants = cva(['relative min-w-0 min-h-0 h-full']);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Width recipe for the `ChatCard` that wraps the layout. The same recipe, for the same
|
|
55
|
+
* reason, as `chatCardThreeColumnLayoutCardVariants`: a grid of `1fr` tracks has no intrinsic
|
|
56
|
+
* width, so inside a shrink-to-fit message the card would collapse to nothing. It takes the
|
|
57
|
+
* whole chat window instead, and the layout decides whether two columns fit.
|
|
58
|
+
*
|
|
59
|
+
* Gated on `data-state=open` so a collapsed card goes back to header width.
|
|
60
|
+
*/
|
|
61
|
+
export const chatCardTwoColumnLayoutCardVariants = cva([
|
|
62
|
+
'data-[state=open]:w-full data-[state=open]:mx-0',
|
|
63
|
+
// `100%` fallback, like every other read of the variable, for a card outside `ChatContainer`
|
|
64
|
+
'data-[state=open]:min-w-[min(1130px,calc(var(--chat-window-width,100%)-var(--spacing-message)*2))]',
|
|
65
|
+
]);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ChatCardTwoColumnLayout,
|
|
3
|
+
ChatCardTwoColumnLayoutAside,
|
|
4
|
+
ChatCardTwoColumnLayoutMain,
|
|
5
|
+
} from './chat-card-two-column-layout';
|
|
6
|
+
export type {
|
|
7
|
+
ChatCardTwoColumnLayoutProps,
|
|
8
|
+
ChatCardTwoColumnLayoutAsideProps,
|
|
9
|
+
ChatCardTwoColumnLayoutMainProps,
|
|
10
|
+
} from './chat-card-two-column-layout';
|
|
11
|
+
export {
|
|
12
|
+
chatCardTwoColumnLayoutVariants,
|
|
13
|
+
chatCardTwoColumnLayoutGridVariants,
|
|
14
|
+
chatCardTwoColumnLayoutAsideVariants,
|
|
15
|
+
chatCardTwoColumnLayoutMainVariants,
|
|
16
|
+
chatCardTwoColumnLayoutCardVariants,
|
|
17
|
+
} from './chat-card-two-column-layout.variants';
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
import { type z, type ZodType } from 'zod/v4';
|
|
3
|
+
|
|
4
|
+
/** Markdown source text, as rendered by `MarkdownViewer`. */
|
|
5
|
+
export type Markdown = string;
|
|
6
|
+
|
|
7
|
+
export type SwiTagName = `swi-${string}`;
|
|
8
|
+
|
|
9
|
+
export type SwiCardVersion = `${number}.${number}.${number}`; // -> 1.0.0
|
|
10
|
+
|
|
11
|
+
export type ChatMessageCardPluginSchema = ZodType;
|
|
12
|
+
|
|
13
|
+
export type ChatMessageCardData<TSchema extends ChatMessageCardPluginSchema> = z.infer<TSchema>;
|
|
14
|
+
|
|
15
|
+
export type ChatMessageCardComponent<TSchema extends ChatMessageCardPluginSchema> = ComponentType<{
|
|
16
|
+
className?: string;
|
|
17
|
+
version: SwiCardVersion;
|
|
18
|
+
parsedData: ChatMessageCardData<TSchema>;
|
|
19
|
+
elementName: SwiTagName;
|
|
20
|
+
isInline?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
export type ChatId = string;
|
|
24
|
+
|
|
25
|
+
export interface ChatPromptPayload {
|
|
26
|
+
files?: File[];
|
|
27
|
+
prompt: string;
|
|
28
|
+
previousAiMessage?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UseStreamingMarkdownReturn {
|
|
4
|
+
markdown: string;
|
|
5
|
+
isStreaming: boolean;
|
|
6
|
+
pause: () => void;
|
|
7
|
+
resume: () => void;
|
|
8
|
+
reset: () => void;
|
|
9
|
+
stop: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Hook to simulate streaming markdown text character by character.
|
|
14
|
+
* Provides controls to pause, resume, reset, and stop the streaming.
|
|
15
|
+
*
|
|
16
|
+
* @param text - The text to stream
|
|
17
|
+
* @param interval - Milliseconds between each character (default: 30)
|
|
18
|
+
* @returns Object with markdown, isStreaming state, and control methods
|
|
19
|
+
*/
|
|
20
|
+
export function useStreamingMarkdown(text: string, interval = 30): UseStreamingMarkdownReturn {
|
|
21
|
+
const [streamedText, setStreamedText] = useState('');
|
|
22
|
+
const [isStreaming, setIsStreaming] = useState(false);
|
|
23
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
24
|
+
|
|
25
|
+
const intervalRef = useRef<NodeJS.Timeout | null>(null);
|
|
26
|
+
const currentIndexRef = useRef(0);
|
|
27
|
+
const textRef = useRef(text);
|
|
28
|
+
|
|
29
|
+
// Update text ref when text changes
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
textRef.current = text;
|
|
32
|
+
}, [text]);
|
|
33
|
+
|
|
34
|
+
// Cleanup function
|
|
35
|
+
const clearStreaming = useCallback(() => {
|
|
36
|
+
if (intervalRef.current) {
|
|
37
|
+
clearInterval(intervalRef.current);
|
|
38
|
+
intervalRef.current = null;
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
41
|
+
|
|
42
|
+
// Start streaming from current index
|
|
43
|
+
const startStreaming = useCallback(() => {
|
|
44
|
+
clearStreaming();
|
|
45
|
+
|
|
46
|
+
intervalRef.current = setInterval(() => {
|
|
47
|
+
if (currentIndexRef.current < textRef.current.length) {
|
|
48
|
+
setStreamedText(textRef.current.slice(0, currentIndexRef.current + 1));
|
|
49
|
+
currentIndexRef.current += 1;
|
|
50
|
+
} else {
|
|
51
|
+
setIsStreaming(false);
|
|
52
|
+
clearStreaming();
|
|
53
|
+
}
|
|
54
|
+
}, interval);
|
|
55
|
+
}, [interval, clearStreaming]);
|
|
56
|
+
|
|
57
|
+
// Initialize streaming when text or interval changes
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setStreamedText('');
|
|
60
|
+
setIsStreaming(true);
|
|
61
|
+
setIsPaused(false);
|
|
62
|
+
currentIndexRef.current = 0;
|
|
63
|
+
|
|
64
|
+
startStreaming();
|
|
65
|
+
|
|
66
|
+
return () => {
|
|
67
|
+
clearStreaming();
|
|
68
|
+
};
|
|
69
|
+
}, [text, interval, startStreaming, clearStreaming]);
|
|
70
|
+
|
|
71
|
+
// Pause streaming (preserves current position)
|
|
72
|
+
const pause = useCallback(() => {
|
|
73
|
+
if (isStreaming && !isPaused) {
|
|
74
|
+
clearStreaming();
|
|
75
|
+
setIsPaused(true);
|
|
76
|
+
}
|
|
77
|
+
}, [isStreaming, isPaused, clearStreaming]);
|
|
78
|
+
|
|
79
|
+
// Resume streaming from current position
|
|
80
|
+
const resume = useCallback(() => {
|
|
81
|
+
if (isPaused && currentIndexRef.current < textRef.current.length) {
|
|
82
|
+
setIsPaused(false);
|
|
83
|
+
setIsStreaming(true);
|
|
84
|
+
startStreaming();
|
|
85
|
+
}
|
|
86
|
+
}, [isPaused, startStreaming]);
|
|
87
|
+
|
|
88
|
+
// Reset streaming to beginning
|
|
89
|
+
const reset = useCallback(() => {
|
|
90
|
+
clearStreaming();
|
|
91
|
+
setStreamedText('');
|
|
92
|
+
setIsStreaming(true);
|
|
93
|
+
setIsPaused(false);
|
|
94
|
+
currentIndexRef.current = 0;
|
|
95
|
+
startStreaming();
|
|
96
|
+
}, [clearStreaming, startStreaming]);
|
|
97
|
+
|
|
98
|
+
// Stop streaming at current position (doesn't reset)
|
|
99
|
+
const stop = useCallback(() => {
|
|
100
|
+
clearStreaming();
|
|
101
|
+
setIsStreaming(false);
|
|
102
|
+
setIsPaused(false);
|
|
103
|
+
}, [clearStreaming]);
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
markdown: streamedText,
|
|
107
|
+
isStreaming,
|
|
108
|
+
pause,
|
|
109
|
+
resume,
|
|
110
|
+
reset,
|
|
111
|
+
stop,
|
|
112
|
+
};
|
|
113
|
+
}
|