@swisper.ai/web-chat-ui 0.0.2 → 0.0.4
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/README.md +9 -12
- package/dist/components/canvas-shell/canvas-shell.d.ts +32 -10
- package/dist/components/canvas-shell/canvas-shell.d.ts.map +1 -1
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts +49 -17
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts.map +1 -1
- package/dist/components/chat-card/chat-card.d.ts +1 -0
- package/dist/components/chat-card/chat-card.d.ts.map +1 -1
- package/dist/components/chat-card/chat-card.stories.d.ts +47 -1
- package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-body.d.ts +8 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-footer.d.ts +8 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-form.d.ts +15 -2
- package/dist/components/chat-card/components/chat-card-form.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-header.d.ts +23 -2
- package/dist/components/chat-card/components/chat-card-header.d.ts.map +1 -1
- package/dist/components/chat-card/contexts.d.ts +2 -0
- package/dist/components/chat-card/contexts.d.ts.map +1 -1
- package/dist/components/chat-card/hooks.d.ts +1 -0
- package/dist/components/chat-card/hooks.d.ts.map +1 -1
- package/dist/components/chat-card/types.d.ts +3 -0
- package/dist/components/chat-card/types.d.ts.map +1 -1
- package/dist/components/chat-card-container/chat-card-container.d.ts +4 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts.map +1 -1
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts +12 -1
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -1
- package/dist/components/chat-container/chat-container.d.ts.map +1 -1
- package/dist/components/chat-container/chat-container.stories.d.ts +36 -11
- package/dist/components/chat-container/chat-container.stories.d.ts.map +1 -1
- package/dist/components/chat-input/chat-input.d.ts +27 -2
- package/dist/components/chat-input/chat-input.d.ts.map +1 -1
- package/dist/components/chat-input/chat-input.stories.d.ts +63 -3
- package/dist/components/chat-input/chat-input.stories.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list-item.d.ts +6 -0
- package/dist/components/chat-list/chat-list-item.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list-items.d.ts +12 -1
- package/dist/components/chat-list/chat-list-items.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list.d.ts +36 -2
- package/dist/components/chat-list/chat-list.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list.stories.d.ts +67 -9
- package/dist/components/chat-list/chat-list.stories.d.ts.map +1 -1
- package/dist/components/chat-message/chat-message.d.ts +12 -1
- package/dist/components/chat-message/chat-message.d.ts.map +1 -1
- package/dist/components/chat-message/chat-message.stories.d.ts +31 -0
- package/dist/components/chat-message/chat-message.stories.d.ts.map +1 -1
- package/dist/components/chat-message/index.d.ts +1 -1
- package/dist/components/chat-message/index.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts +3 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts +25 -5
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts +32 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/index.d.ts +2 -2
- package/dist/components/chat-message-attachment-card/index.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/utils.d.ts +1 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts.map +1 -1
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts +13 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts.map +1 -1
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts +22 -5
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts.map +1 -1
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts +42 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts.map +1 -1
- package/dist/components/chat-message-toolbar/index.d.ts +1 -1
- package/dist/components/chat-message-toolbar/index.d.ts.map +1 -1
- package/dist/components/chat-messages/chat-messages.d.ts +34 -2
- package/dist/components/chat-messages/chat-messages.d.ts.map +1 -1
- package/dist/components/chat-messages/chat-messages.stories.d.ts +33 -2
- package/dist/components/chat-messages/chat-messages.stories.d.ts.map +1 -1
- package/dist/components/chat-notification-card/chat-notification-card.d.ts +56 -4
- package/dist/components/chat-notification-card/chat-notification-card.d.ts.map +1 -1
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts +50 -1
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts.map +1 -1
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts +6 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts.map +1 -1
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts +43 -1
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +37 -17
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts +53 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -1
- package/dist/components/chat-reply/chat-reply.d.ts +11 -0
- package/dist/components/chat-reply/chat-reply.d.ts.map +1 -1
- package/dist/components/chat-reply/chat-reply.stories.d.ts +23 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts.map +1 -1
- package/dist/components/chat-reply/index.d.ts +1 -1
- package/dist/components/chat-reply/index.d.ts.map +1 -1
- package/dist/components/chat-suggestion/chat-suggestion.d.ts +36 -10
- package/dist/components/chat-suggestion/chat-suggestion.d.ts.map +1 -1
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts +66 -2
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts.map +1 -1
- package/dist/components/chat-suggestion/index.d.ts +2 -1
- package/dist/components/chat-suggestion/index.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +26 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +25 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -1
- package/dist/components/chat-thread/chat-thread.d.ts +17 -2
- package/dist/components/chat-thread/chat-thread.d.ts.map +1 -1
- package/dist/components/chat-thread/chat-thread.stories.d.ts +75 -10
- package/dist/components/chat-thread/chat-thread.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/markdown-viewer/markdown-viewer.d.ts +8 -1
- package/dist/components/markdown-viewer/markdown-viewer.d.ts.map +1 -1
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts +18 -1
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts.map +1 -1
- package/dist/components/rich-text-area/rich-text-area.d.ts +17 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts.map +1 -1
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts +52 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts.map +1 -1
- package/dist/components/rich-text-area/styled.d.ts +6 -2
- package/dist/components/rich-text-area/styled.d.ts.map +1 -1
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts +9 -2
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts.map +1 -1
- package/dist/components/rich-text-field/components/index.d.ts +5 -5
- package/dist/components/rich-text-field/components/index.d.ts.map +1 -1
- package/dist/components/rich-text-field/components/text-color-button.d.ts +12 -1
- package/dist/components/rich-text-field/components/text-color-button.d.ts.map +1 -1
- package/dist/components/rich-text-field/rich-text-field.d.ts +22 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts.map +1 -1
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts +28 -1
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -1
- package/dist/components/topmenu/index.d.ts +2 -0
- package/dist/components/topmenu/index.d.ts.map +1 -0
- package/dist/components/topmenu/topmenu.d.ts +22 -0
- package/dist/components/topmenu/topmenu.d.ts.map +1 -0
- package/dist/components/topmenu/topmenu.stories.d.ts +31 -0
- package/dist/components/topmenu/topmenu.stories.d.ts.map +1 -0
- package/dist/docs/agent.stories.d.ts.map +1 -1
- package/dist/docs/chat-panel.d.ts +7 -5
- package/dist/docs/chat-panel.d.ts.map +1 -1
- package/dist/docs/chatbot-panel.d.ts.map +1 -1
- package/dist/docs/chatbot.stories.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +1227 -1260
- package/dist/index.es.js.map +1 -1
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +9 -7
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +1 -1
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +37 -9
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +41 -16
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +6 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +1 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +22 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +1 -1
- package/package.json +15 -9
- package/src/__storybook__/parent-block.tsx +21 -0
- package/src/components/canvas-shell/__stories__/canvas-panel.tsx +25 -0
- package/src/components/canvas-shell/__stories__/document-list.tsx +29 -0
- package/src/components/canvas-shell/__stories__/fixtures.ts +222 -0
- package/src/components/canvas-shell/__stories__/holdings-table.tsx +56 -0
- package/src/components/canvas-shell/__stories__/types.ts +47 -0
- package/src/components/canvas-shell/{canvas-shell.test.tsx → __tests__/canvas-shell.spec.tsx} +1 -1
- package/src/components/canvas-shell/canvas-shell.json +24 -0
- package/src/components/canvas-shell/canvas-shell.stories.tsx +581 -122
- package/src/components/canvas-shell/canvas-shell.tsx +44 -17
- package/src/components/chat-card/__stories__/fixtures.ts +119 -0
- package/src/components/chat-card/__stories__/types.ts +44 -0
- package/src/components/chat-card/chat-card.json +67 -3
- package/src/components/chat-card/chat-card.stories.tsx +872 -148
- package/src/components/chat-card/chat-card.tsx +2 -0
- package/src/components/chat-card/components/chat-card-body.tsx +12 -0
- package/src/components/chat-card/components/chat-card-footer.tsx +11 -0
- package/src/components/chat-card/components/chat-card-form.tsx +21 -2
- package/src/components/chat-card/components/chat-card-header.tsx +39 -2
- package/src/components/chat-card/contexts.tsx +2 -0
- package/src/components/chat-card/hooks.ts +1 -0
- package/src/components/chat-card/types.ts +3 -0
- package/src/components/chat-card-container/__stories__/fixtures.ts +54 -0
- package/src/components/chat-card-container/__stories__/resizable-chat-window.tsx +19 -0
- package/src/components/chat-card-container/__stories__/result-card.tsx +31 -0
- package/src/components/chat-card-container/__stories__/types.ts +16 -0
- package/src/components/chat-card-container/chat-card-container.json +7 -0
- package/src/components/chat-card-container/chat-card-container.stories.tsx +209 -56
- package/src/components/chat-card-container/chat-card-container.tsx +5 -0
- package/src/components/chat-container/__stories__/chat-composer.tsx +67 -0
- package/src/components/chat-container/__stories__/fixtures.ts +27 -0
- package/src/components/chat-container/__stories__/measure.ts +22 -0
- package/src/components/chat-container/__stories__/types.ts +7 -0
- package/src/components/chat-container/__stories__/variable-readout.tsx +64 -0
- package/src/components/chat-container/chat-container.json +9 -1
- package/src/components/chat-container/chat-container.stories.tsx +538 -106
- package/src/components/chat-container/chat-container.tsx +3 -0
- package/src/components/chat-input/__stories__/fixtures.ts +31 -0
- package/src/components/chat-input/chat-input.json +10 -2
- package/src/components/chat-input/chat-input.stories.tsx +660 -197
- package/src/components/chat-input/chat-input.tsx +32 -2
- package/src/components/chat-list/__stories__/chat-row.tsx +41 -0
- package/src/components/chat-list/__stories__/fixtures.ts +94 -0
- package/src/components/chat-list/__stories__/types.ts +13 -0
- package/src/components/chat-list/chat-list-item.tsx +6 -0
- package/src/components/chat-list/chat-list-items.tsx +16 -0
- package/src/components/chat-list/chat-list.json +24 -2
- package/src/components/chat-list/chat-list.stories.tsx +631 -215
- package/src/components/chat-list/chat-list.tsx +51 -4
- package/src/components/chat-message/__stories__/fixtures.ts +53 -0
- package/src/components/chat-message/__stories__/sent-attachment.tsx +22 -0
- package/src/components/chat-message/__stories__/tool-steps.tsx +37 -0
- package/src/components/chat-message/chat-message.json +10 -1
- package/src/components/chat-message/chat-message.stories.tsx +282 -20
- package/src/components/chat-message/chat-message.tsx +16 -1
- package/src/components/chat-message/index.ts +8 -1
- package/src/components/chat-message-attachment-card/__stories__/fixtures.ts +30 -0
- package/src/components/chat-message-attachment-card/__stories__/types.ts +14 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx +4 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.json +20 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx +266 -51
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.tsx +37 -4
- package/src/components/chat-message-attachment-card/index.ts +6 -0
- package/src/components/chat-message-attachment-card/utils.ts +1 -0
- package/src/components/chat-message-response/__stories__/fixtures.ts +50 -0
- package/src/components/chat-message-response/chat-message-response.json +5 -0
- package/src/components/chat-message-response/chat-message-response.stories.tsx +135 -26
- package/src/components/chat-message-toolbar/chat-message-toolbar.json +21 -3
- package/src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx +377 -6
- package/src/components/chat-message-toolbar/chat-message-toolbar.tsx +47 -12
- package/src/components/chat-message-toolbar/index.ts +4 -0
- package/src/components/chat-messages/__stories__/conversation-frame.tsx +25 -0
- package/src/components/chat-messages/__stories__/conversation-group.tsx +22 -0
- package/src/components/chat-messages/__stories__/fixtures.ts +70 -0
- package/src/components/chat-messages/__stories__/types.ts +5 -0
- package/src/components/chat-messages/chat-messages.json +30 -12
- package/src/components/chat-messages/chat-messages.stories.tsx +439 -212
- package/src/components/chat-messages/chat-messages.tsx +46 -3
- package/src/components/chat-notification-card/__stories__/fixtures.ts +38 -0
- package/src/components/chat-notification-card/__stories__/types.ts +13 -0
- package/src/components/chat-notification-card/chat-notification-card.json +52 -2
- package/src/components/chat-notification-card/chat-notification-card.stories.tsx +542 -62
- package/src/components/chat-notification-card/chat-notification-card.tsx +97 -6
- package/src/components/chat-notification-popup/__stories__/fixtures.ts +36 -0
- package/src/components/chat-notification-popup/__stories__/notification-item.tsx +93 -0
- package/src/components/chat-notification-popup/__stories__/types.ts +14 -0
- package/src/components/chat-notification-popup/chat-notification-popup.json +14 -1
- package/src/components/chat-notification-popup/chat-notification-popup.stories.tsx +467 -17
- package/src/components/chat-notification-popup/chat-notification-popup.tsx +18 -3
- package/src/components/chat-prompt-box/__stories__/fixtures.ts +16 -0
- package/src/components/chat-prompt-box/__stories__/types.ts +8 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +25 -2
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +535 -43
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +73 -19
- package/src/components/chat-reply/chat-reply.json +10 -0
- package/src/components/chat-reply/chat-reply.stories.tsx +264 -21
- package/src/components/chat-reply/chat-reply.tsx +15 -0
- package/src/components/chat-reply/index.ts +10 -1
- package/src/components/chat-suggestion/__stories__/fixtures.ts +16 -0
- package/src/components/chat-suggestion/__tests__/chat-suggestion.spec.tsx +185 -0
- package/src/components/chat-suggestion/chat-suggestion.json +62 -20
- package/src/components/chat-suggestion/chat-suggestion.stories.tsx +542 -58
- package/src/components/chat-suggestion/chat-suggestion.tsx +154 -65
- package/src/components/chat-suggestion/index.ts +9 -0
- package/src/components/chat-thinking-process/__stories__/fixtures.ts +56 -0
- package/src/components/chat-thinking-process/chat-thinking-process.json +28 -3
- package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +354 -78
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +55 -4
- package/src/components/chat-thread/__stories__/fixtures.ts +171 -0
- package/src/components/chat-thread/__stories__/scroll-position.ts +9 -0
- package/src/components/chat-thread/__stories__/snippets.ts +129 -0
- package/src/components/chat-thread/__stories__/thread-frame.tsx +22 -0
- package/src/components/chat-thread/__stories__/thread-turns.tsx +35 -0
- package/src/components/chat-thread/__stories__/types.ts +12 -0
- package/src/components/chat-thread/__stories__/use-turn-stream.ts +78 -0
- package/src/components/chat-thread/chat-thread.json +23 -3
- package/src/components/chat-thread/chat-thread.stories.tsx +804 -142
- package/src/components/chat-thread/chat-thread.tsx +64 -16
- package/src/components/index.ts +1 -3
- package/src/components/markdown-viewer/__stories__/fixtures.ts +67 -0
- package/src/components/markdown-viewer/markdown-viewer.json +7 -1
- package/src/components/markdown-viewer/markdown-viewer.stories.tsx +219 -50
- package/src/components/markdown-viewer/markdown-viewer.tsx +9 -0
- package/src/components/rich-text-area/__stories__/fixtures.ts +30 -0
- package/src/components/rich-text-area/rich-text-area.json +6 -4
- package/src/components/rich-text-area/rich-text-area.stories.tsx +597 -41
- package/src/components/rich-text-area/rich-text-area.tsx +22 -1
- package/src/components/rich-text-area/styled.tsx +11 -5
- package/src/components/rich-text-field/__stories__/fixtures.ts +29 -0
- package/src/components/rich-text-field/components/formatting-toolbar-plugin.tsx +10 -1
- package/src/components/rich-text-field/components/index.ts +8 -5
- package/src/components/rich-text-field/components/text-color-button.tsx +16 -2
- package/src/components/rich-text-field/rich-text-field.json +3 -1
- package/src/components/rich-text-field/rich-text-field.stories.tsx +452 -61
- package/src/components/rich-text-field/rich-text-field.tsx +23 -0
- package/src/components/topmenu/index.ts +1 -0
- package/src/components/topmenu/topmenu.json +107 -0
- package/src/components/topmenu/topmenu.stories.tsx +334 -0
- package/src/components/topmenu/topmenu.tsx +71 -0
- package/src/docs/agent.stories.tsx +16 -16
- package/src/docs/chat-panel.tsx +37 -32
- package/src/docs/chatbot-panel.tsx +11 -2
- package/src/docs/chatbot.mdx +17 -12
- package/src/docs/chatbot.stories.tsx +7 -8
- package/src/layouts/chat-card-list-layout/__stories__/fixtures.ts +112 -0
- package/src/layouts/chat-card-list-layout/__stories__/result-card.tsx +36 -0
- package/src/layouts/chat-card-list-layout/__stories__/types.ts +31 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +14 -1
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +316 -84
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +11 -7
- package/src/layouts/chat-card-three-column-layout/__stories__/fixtures.ts +117 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/resizable-chat-window.tsx +18 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-details.tsx +85 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-list.tsx +50 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-map.tsx +44 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-rooms.tsx +61 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/types.ts +35 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +16 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +603 -182
- package/src/layouts/chat-card-two-column-layout/__stories__/connection-itinerary.tsx +51 -0
- package/src/layouts/chat-card-two-column-layout/__stories__/fixtures.ts +83 -0
- package/src/layouts/chat-card-two-column-layout/__stories__/route-map.tsx +24 -0
- package/src/layouts/chat-card-two-column-layout/__stories__/types.ts +15 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +13 -1
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +368 -67
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +11 -2
- package/dist/components/card-item-picker/card-item-picker-context.d.ts +0 -21
- package/dist/components/card-item-picker/card-item-picker-context.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker-list.d.ts +0 -24
- package/dist/components/card-item-picker/card-item-picker-list.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts +0 -28
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker-row.d.ts +0 -12
- package/dist/components/card-item-picker/card-item-picker-row.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts +0 -19
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts.map +0 -1
- package/dist/components/card-item-picker/index.d.ts +0 -9
- package/dist/components/card-item-picker/index.d.ts.map +0 -1
- package/dist/components/chat-message-history/chat-message-history.d.ts +0 -48
- package/dist/components/chat-message-history/chat-message-history.d.ts.map +0 -1
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts +0 -7
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts.map +0 -1
- package/dist/components/chat-message-history/index.d.ts +0 -2
- package/dist/components/chat-message-history/index.d.ts.map +0 -1
- package/dist/components/spinner/index.d.ts +0 -2
- package/dist/components/spinner/index.d.ts.map +0 -1
- package/dist/components/spinner/spinner.d.ts +0 -9
- package/dist/components/spinner/spinner.d.ts.map +0 -1
- package/dist/components/spinner/spinner.stories.d.ts +0 -8
- package/dist/components/spinner/spinner.stories.d.ts.map +0 -1
- package/src/components/card-item-picker/__tests__/card-item-picker.spec.tsx +0 -279
- package/src/components/card-item-picker/card-item-picker-context.tsx +0 -44
- package/src/components/card-item-picker/card-item-picker-list.tsx +0 -95
- package/src/components/card-item-picker/card-item-picker-row-parts.tsx +0 -96
- package/src/components/card-item-picker/card-item-picker-row.tsx +0 -109
- package/src/components/card-item-picker/card-item-picker.json +0 -147
- package/src/components/card-item-picker/card-item-picker.stories.tsx +0 -158
- package/src/components/card-item-picker/index.ts +0 -24
- package/src/components/chat-message-history/chat-message-history.json +0 -99
- package/src/components/chat-message-history/chat-message-history.stories.tsx +0 -136
- package/src/components/chat-message-history/chat-message-history.tsx +0 -277
- package/src/components/chat-message-history/index.ts +0 -13
- package/src/components/spinner/index.ts +0 -1
- package/src/components/spinner/spinner.json +0 -73
- package/src/components/spinner/spinner.stories.tsx +0 -41
- package/src/components/spinner/spinner.tsx +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message/chat-message.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-message.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message/chat-message.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,OAAO,EAAE,WAAW,EAA0C,MAAM,gBAAgB,CAAC;AAErF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAoClC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,+EAA+E;AAC/E,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,MAAM,EAAE,KASpB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,iBAAS,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,oBAAoB,+BAwBtE;AAED,8GAA8G;AAC9G,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,OAAO,eAAe,CAoBhE,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,QAAQ,EAAE,KAqFtB,CAAC;AAEF,UAAU,0BAA0B;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,iBAAS,qBAAqB,CAAC,EAC7B,UAAU,EACV,SAAS,EACT,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,IAAI,EACJ,MAAM,GACP,EAAE,0BAA0B,+BAsB5B;AAED,sFAAsF;AACtF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,qBAAqB,CA8B7D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ChatMessage, ChatMessageContent, ChatMessageActions } from './chat-message';
|
|
1
|
+
export { ChatMessage, ChatMessageContent, ChatMessageActions, type ChatMessageProps, type ChatMessageContentProps, type ChatMessageActionsProps, } from './chat-message';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
2
2
|
type IconProps = SvgIconProps;
|
|
3
|
+
/** The file types the card has an icon for. `image` has no icon: show a `ChatMessageAttachmentCardPreview`. */
|
|
3
4
|
export type ChatMessageAttachmentCardIconType = 'spreadsheet' | 'pdf' | 'presentation' | 'document' | 'code' | 'image' | 'unknown';
|
|
4
5
|
export interface ChatMessageAttachmentCardIconProps extends IconProps {
|
|
6
|
+
/** The file type, which picks the icon and its background colour. `getAttachmentIcon(file)` returns it. */
|
|
5
7
|
icon: Exclude<ChatMessageAttachmentCardIconType, 'image'>;
|
|
6
8
|
}
|
|
9
|
+
/** The file-type icon on its coloured tile. `className` goes to the tile, every other prop to the icon. */
|
|
7
10
|
export declare function ChatMessageAttachmentCardIcon({ icon, className, ...rest }: ChatMessageAttachmentCardIconProps): import('react').JSX.Element;
|
|
8
11
|
export {};
|
|
9
12
|
//# sourceMappingURL=chat-message-attachment-card-icon.d.ts.map
|
package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-attachment-card-icon.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAM1D,KAAK,SAAS,GAAG,YAAY,CAAC;AAE9B,MAAM,MAAM,iCAAiC,GAC3C,aAAa,GAAG,KAAK,GAAG,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAmCrF,MAAM,WAAW,kCAAmC,SAAQ,SAAS;IACnE,IAAI,EAAE,OAAO,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;CAC3D;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,IAAI,EACJ,SAAS,EACT,GAAG,IAAI,EACR,EAAE,kCAAkC,+
|
|
1
|
+
{"version":3,"file":"chat-message-attachment-card-icon.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAM1D,KAAK,SAAS,GAAG,YAAY,CAAC;AAE9B,+GAA+G;AAC/G,MAAM,MAAM,iCAAiC,GAC3C,aAAa,GAAG,KAAK,GAAG,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAmCrF,MAAM,WAAW,kCAAmC,SAAQ,SAAS;IACnE,2GAA2G;IAC3G,IAAI,EAAE,OAAO,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;CAC3D;AAED,2GAA2G;AAC3G,wBAAgB,6BAA6B,CAAC,EAC5C,IAAI,EACJ,SAAS,EACT,GAAG,IAAI,EACR,EAAE,kCAAkC,+BAsBpC"}
|
|
@@ -1,30 +1,50 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface ChatMessageAttachmentCardProps {
|
|
3
|
+
/** Classes merged last onto the card root, e.g. `w-fit max-w-60` to cap the chip's width. */
|
|
3
4
|
className?: string;
|
|
5
|
+
/** The card parts: an icon or a preview, the content with the file name, and the actions. */
|
|
4
6
|
children?: ReactNode;
|
|
7
|
+
/** Shrinks the card to a 56px square for an image shown through `ChatMessageAttachmentCardPreview`. */
|
|
5
8
|
isPreview?: boolean;
|
|
9
|
+
/** Shows a pointer cursor, a hover background and the remove action on hover. Set `false` for a sent message's attachments. */
|
|
6
10
|
isInteractive?: boolean;
|
|
7
11
|
}
|
|
12
|
+
/** A compact chip for a file attached to a chat prompt or message. */
|
|
8
13
|
export declare function ChatMessageAttachmentCard({ className, children, isPreview, isInteractive, }: ChatMessageAttachmentCardProps): import('react').JSX.Element;
|
|
9
14
|
export interface ChatMessageAttachmentCardContentProps {
|
|
15
|
+
/** Classes merged last onto the content element. */
|
|
10
16
|
className?: string;
|
|
17
|
+
/** The file name, usually a `ChatMessageAttachmentCardTitle`. */
|
|
11
18
|
children?: ReactNode;
|
|
12
19
|
}
|
|
20
|
+
/** The text area of the card: takes the width left beside the icon and clips what overflows. */
|
|
13
21
|
export declare function ChatMessageAttachmentCardContent({ className, children, }: ChatMessageAttachmentCardContentProps): import('react').JSX.Element;
|
|
14
|
-
interface ChatMessageAttachmentCardTitleProps {
|
|
22
|
+
export interface ChatMessageAttachmentCardTitleProps {
|
|
23
|
+
/** Classes merged last onto the title element. */
|
|
15
24
|
className?: string;
|
|
25
|
+
/** The file name as uploaded, including its extension. */
|
|
16
26
|
children?: ReactNode;
|
|
17
27
|
}
|
|
28
|
+
/** The file name, truncated to one line. */
|
|
18
29
|
export declare function ChatMessageAttachmentCardTitle({ className, children, }: ChatMessageAttachmentCardTitleProps): import('react').JSX.Element;
|
|
19
|
-
interface ChatMessageAttachmentCardPreviewProps {
|
|
30
|
+
export interface ChatMessageAttachmentCardPreviewProps {
|
|
31
|
+
/** Classes merged last onto the `figure` that covers the card. */
|
|
20
32
|
className?: string;
|
|
33
|
+
/** Classes merged last onto the image inside the figure, e.g. `object-contain`. */
|
|
34
|
+
imageClassName?: string;
|
|
35
|
+
/** URL of the image, e.g. a data URL read from the attached file. */
|
|
21
36
|
previewSrc: string;
|
|
22
37
|
}
|
|
23
|
-
|
|
38
|
+
/** An image thumbnail that covers the whole card. Use it on a card with `isPreview`. */
|
|
39
|
+
export declare function ChatMessageAttachmentCardPreview({ className, imageClassName, previewSrc, }: ChatMessageAttachmentCardPreviewProps): import('react').JSX.Element;
|
|
24
40
|
export interface ChatMessageAttachmentCardActionsProps {
|
|
41
|
+
/** Classes merged last onto the wrapper pinned to the card's top-right corner. */
|
|
25
42
|
className?: string;
|
|
43
|
+
/** Classes merged last onto the remove button inside the wrapper. */
|
|
44
|
+
buttonClassName?: string;
|
|
45
|
+
/** Called when the remove button is clicked. The consumer removes the attachment. */
|
|
26
46
|
onDelete?: () => void;
|
|
27
47
|
}
|
|
28
|
-
|
|
29
|
-
export {};
|
|
48
|
+
/** The remove button of an interactive card, shown while the card is hovered. */
|
|
49
|
+
export declare function ChatMessageAttachmentCardActions({ className, buttonClassName, onDelete, }: ChatMessageAttachmentCardActionsProps): import('react').JSX.Element;
|
|
30
50
|
//# sourceMappingURL=chat-message-attachment-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-attachment-card.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/chat-message-attachment-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,8BAA8B;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,QAAQ,EACR,SAAS,EACT,aAAoB,GACrB,EAAE,8BAA8B,+
|
|
1
|
+
{"version":3,"file":"chat-message-attachment-card.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/chat-message-attachment-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,8BAA8B;IAC7C,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,QAAQ,C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SAAS,EACT,eAAe,EACf,QAAQ,GACT,EAAE,qCAAqC,+BA2BvC"}
|
package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { AttachedFile } from './__stories__/types';
|
|
2
3
|
import { ChatMessageAttachmentCard } from './chat-message-attachment-card';
|
|
4
|
+
import { ChatMessageAttachmentCardIconProps } from './chat-message-attachment-card-icon';
|
|
3
5
|
declare const meta: Meta<typeof ChatMessageAttachmentCard>;
|
|
4
6
|
export default meta;
|
|
5
7
|
type Story = StoryObj<typeof ChatMessageAttachmentCard>;
|
|
8
|
+
/** A file attached to the prompt before sending: its type icon, its name, and a remove button that shows on hover. */
|
|
6
9
|
export declare const Default: Story;
|
|
10
|
+
/** A file that was sent with a question: static, with no hover background and no remove action. */
|
|
7
11
|
export declare const NonInteractive: Story;
|
|
12
|
+
/** An attached image as a 56px square thumbnail, in place of the icon and file name. */
|
|
8
13
|
export declare const WithPreview: Story;
|
|
9
|
-
|
|
14
|
+
/** Every file type the card has an icon for, each with a file name that `getAttachmentIcon` maps to it. */
|
|
10
15
|
export declare const Icon: Story;
|
|
16
|
+
interface UploadedFilesPreviewProps {
|
|
17
|
+
initialFiles: AttachedFile[];
|
|
18
|
+
onRemove: (fileName: string) => void;
|
|
19
|
+
}
|
|
20
|
+
/** The prompt's attachment row: a chip per file, a thumbnail per image, each with a remove action. */
|
|
21
|
+
declare function UploadedFilesPreview({ initialFiles, onRemove }: UploadedFilesPreviewProps): import('react').JSX.Element | null;
|
|
22
|
+
type AttachmentRowStory = StoryObj<typeof UploadedFilesPreview>;
|
|
23
|
+
/** The files of one prompt in a row: the icon follows each file's extension, a long name truncates, and removing a file takes its chip out. */
|
|
24
|
+
export declare const AttachmentRow: AttachmentRowStory;
|
|
25
|
+
/** Checks that a long file name truncates and that pressing a file's remove button takes its chip out of the row. */
|
|
26
|
+
export declare const AttachmentRowRemove: AttachmentRowStory;
|
|
27
|
+
/** The card in each place it's allowed: the prompt box toolbar, a chat message, the prompt box attachment row and a sent question's attachments. */
|
|
28
|
+
export declare const Examples: Story;
|
|
29
|
+
interface ChatMessageAttachmentCardPlaygroundProps {
|
|
30
|
+
className?: string;
|
|
31
|
+
icon: ChatMessageAttachmentCardIconProps['icon'];
|
|
32
|
+
title: string;
|
|
33
|
+
previewSrc: string;
|
|
34
|
+
isPreview: boolean;
|
|
35
|
+
isInteractive: boolean;
|
|
36
|
+
hasActions: boolean;
|
|
37
|
+
onDelete: () => void;
|
|
38
|
+
}
|
|
39
|
+
declare function ChatMessageAttachmentCardPlayground({ className, icon, title, previewSrc, isPreview, isInteractive, hasActions, onDelete, }: ChatMessageAttachmentCardPlaygroundProps): import('react').JSX.Element;
|
|
40
|
+
/** Every part and prop on the Controls panel. `isPreview` swaps the icon and file name for the image, because the two never go together. */
|
|
41
|
+
export declare const Playground: StoryObj<typeof ChatMessageAttachmentCardPlayground>;
|
|
11
42
|
//# sourceMappingURL=chat-message-attachment-card.stories.d.ts.map
|
package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-attachment-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-message-attachment-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAiB5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,yBAAyB,EAK1B,MAAM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;CACtB;AAED,iBAAS,mCAAmC,CAAC,EAC3C,SAAS,EACT,IAAI,EACJ,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GACT,EAAE,wCAAwC,+BAoB1C;AAED,4IAA4I;AAC5I,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,mCAAmC,CAkC3E,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ChatMessageAttachmentCard, ChatMessageAttachmentCardContent, ChatMessageAttachmentCardTitle, ChatMessageAttachmentCardPreview, ChatMessageAttachmentCardActions, } from './chat-message-attachment-card';
|
|
2
|
-
export { ChatMessageAttachmentCardIcon, type ChatMessageAttachmentCardIconType, } from './chat-message-attachment-card-icon';
|
|
1
|
+
export { ChatMessageAttachmentCard, ChatMessageAttachmentCardContent, ChatMessageAttachmentCardTitle, ChatMessageAttachmentCardPreview, ChatMessageAttachmentCardActions, type ChatMessageAttachmentCardProps, type ChatMessageAttachmentCardContentProps, type ChatMessageAttachmentCardTitleProps, type ChatMessageAttachmentCardPreviewProps, type ChatMessageAttachmentCardActionsProps, } from './chat-message-attachment-card';
|
|
2
|
+
export { ChatMessageAttachmentCardIcon, type ChatMessageAttachmentCardIconProps, type ChatMessageAttachmentCardIconType, } from './chat-message-attachment-card-icon';
|
|
3
3
|
export { getAttachmentIcon } from './utils';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,EAChC,gCAAgC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,EAChC,gCAAgC,EAChC,KAAK,8BAA8B,EACnC,KAAK,qCAAqC,EAC1C,KAAK,mCAAmC,EACxC,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,GAC3C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,6BAA6B,EAC7B,KAAK,kCAAkC,EACvC,KAAK,iCAAiC,GACvC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChatMessageAttachmentCardIconType } from './chat-message-attachment-card-icon';
|
|
2
2
|
type IconType = Exclude<ChatMessageAttachmentCardIconType, 'image'>;
|
|
3
|
+
/** Picks the icon type for a file from its name's extension; a file it doesn't recognise is `unknown`. */
|
|
3
4
|
export declare function getAttachmentIcon(file: File): IconType;
|
|
4
5
|
export {};
|
|
5
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAE7F,KAAK,QAAQ,GAAG,OAAO,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;AAgBpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAoBtD"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-attachment-card/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAE7F,KAAK,QAAQ,GAAG,OAAO,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;AAgBpE,0GAA0G;AAC1G,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAoBtD"}
|
|
@@ -3,5 +3,18 @@ import { ChatMessageResponse } from './chat-message-response';
|
|
|
3
3
|
declare const meta: Meta<typeof ChatMessageResponse>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof ChatMessageResponse>;
|
|
6
|
+
/** A finished assistant reply: a short answer that quotes its evidence, rendered as page content. */
|
|
6
7
|
export declare const Default: Story;
|
|
8
|
+
/** A reply that is still arriving: the half-received bold run is closed, and no caret is shown. */
|
|
9
|
+
export declare const Streaming: Story;
|
|
10
|
+
/** The reply in each place it's allowed: a message's content, a chat thread and an assistant answer. */
|
|
11
|
+
export declare const Examples: Story;
|
|
12
|
+
/** The Markdown renders as semantic HTML: a heading, a list, a table and a native link. */
|
|
13
|
+
export declare const RendersSemanticMarkdown: Story;
|
|
14
|
+
/** A half-received bold run is closed while streaming, so no raw `**` reaches the reader. */
|
|
15
|
+
export declare const StreamingClosesPartialMarkdown: Story;
|
|
16
|
+
/** A `<swi-reply>` block never becomes a widget: the tag is stripped and no suggestion button appears. */
|
|
17
|
+
export declare const KeepsSwiBlocksAsText: Story;
|
|
18
|
+
/** Both props on the Controls panel, starting from the longest reply: heading, list, table, code and a link. */
|
|
19
|
+
export declare const Playground: Story;
|
|
7
20
|
//# sourceMappingURL=chat-message-response.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-response.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-response/chat-message-response.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-message-response.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-response/chat-message-response.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAc5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,mBAAmB,CAwB1C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAElD,qGAAqG;AACrG,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,QAAQ,EAAE,KAgCtB,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,EAAE,KAuBrC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,8BAA8B,EAAE,KAkB5C,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,oBAAoB,EAAE,KAkBlC,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC"}
|
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { IconButtonProps } from '@swisper.ai/ui';
|
|
3
3
|
export interface ChatMessageToolbarProps extends ComponentProps<'div'> {
|
|
4
|
+
/** The toolbar parts: a `ChatMessageToolbarTimestamp` and a `ChatMessageToolbarActions`. */
|
|
4
5
|
children: ReactNode;
|
|
6
|
+
/** Classes merged last onto the row. */
|
|
5
7
|
className?: string;
|
|
8
|
+
/** Flips the row, so the first part sits at the end. Set it under an end-aligned question. */
|
|
6
9
|
reverse?: boolean;
|
|
7
10
|
}
|
|
11
|
+
/** The row under a chat message: its timestamp at one end, its icon actions at the other. */
|
|
8
12
|
export declare function ChatMessageToolbar({ children, className, reverse, ...rest }: ChatMessageToolbarProps): import('react').JSX.Element;
|
|
9
|
-
export interface ChatMessageToolbarActionsProps {
|
|
13
|
+
export interface ChatMessageToolbarActionsProps extends ComponentProps<'div'> {
|
|
14
|
+
/** The actions, each a `ChatMessageToolbarActionButton`. */
|
|
10
15
|
children: ReactNode;
|
|
16
|
+
/** Classes merged last onto the group. */
|
|
11
17
|
className?: string;
|
|
12
18
|
}
|
|
13
|
-
|
|
19
|
+
/** Groups the toolbar's action buttons in a `role="group"` row. */
|
|
20
|
+
export declare function ChatMessageToolbarActions({ children, className, ...rest }: ChatMessageToolbarActionsProps): import('react').JSX.Element;
|
|
14
21
|
export interface ChatMessageToolbarActionButtonProps extends Omit<IconButtonProps, 'variant' | 'size'> {
|
|
22
|
+
/** The action's icon. */
|
|
15
23
|
children: ReactNode;
|
|
24
|
+
/** Classes merged last onto the button. */
|
|
16
25
|
className?: string;
|
|
26
|
+
/** Text of the hover tooltip. It is not the accessible name: pass `aria-label` as well. */
|
|
17
27
|
tooltip?: string;
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
/**
|
|
30
|
+
* One icon action in the toolbar: an extra-small tertiary `IconButton`, in a `Tooltip` when
|
|
31
|
+
* `tooltip` is set. The ref reaches the button, so it can be an `asChild` menu or popover trigger.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ChatMessageToolbarActionButton: import('react').ForwardRefExoticComponent<Omit<ChatMessageToolbarActionButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement | HTMLSpanElement>>;
|
|
34
|
+
export interface ChatMessageToolbarTimestampProps extends ComponentProps<'div'> {
|
|
35
|
+
/** The time, already formatted. */
|
|
21
36
|
children: ReactNode;
|
|
37
|
+
/** Classes merged last onto the timestamp. */
|
|
22
38
|
className?: string;
|
|
23
39
|
}
|
|
24
|
-
|
|
40
|
+
/** When the message was sent. Renders its children as given. */
|
|
41
|
+
export declare function ChatMessageToolbarTimestamp({ className, children, ...rest }: ChatMessageToolbarTimestampProps): import('react').JSX.Element;
|
|
25
42
|
//# sourceMappingURL=chat-message-toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-toolbar/chat-message-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"chat-message-toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-toolbar/chat-message-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG3E,MAAM,WAAW,uBAAwB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACpE,4FAA4F;IAC5F,QAAQ,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,OAAe,EACf,GAAG,IAAI,EACR,EAAE,uBAAuB,+BAkBzB;AAED,MAAM,WAAW,8BAA+B,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3E,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mEAAmE;AACnE,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,8BAA8B,+BAYhC;AAED,MAAM,WAAW,mCAAoC,SAAQ,IAAI,CAC/D,eAAe,EACf,SAAS,GAAG,MAAM,CACnB;IACC,yBAAyB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,8BAA8B,kKAuBzC,CAAC;AAIH,MAAM,WAAW,gCAAiC,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC7E,mCAAmC;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gEAAgE;AAChE,wBAAgB,2BAA2B,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,gCAAgC,+BAUlC"}
|
|
@@ -3,5 +3,47 @@ import { ChatMessageToolbar } from './chat-message-toolbar';
|
|
|
3
3
|
declare const meta: Meta<typeof ChatMessageToolbar>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof ChatMessageToolbar>;
|
|
6
|
+
/** The row under a message: when it was sent on one side, its edit and copy actions on the other. */
|
|
6
7
|
export declare const Default: Story;
|
|
8
|
+
/** `reverse` under the user's own question: the actions move to the left, the time to the right. */
|
|
9
|
+
export declare const Reversed: Story;
|
|
10
|
+
/** A disabled action stays in the row but takes no click and leaves the tab order. */
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
type DownloadFormat = 'markdown' | 'pdf';
|
|
13
|
+
interface MessageActionsToolbarProps {
|
|
14
|
+
/** When the message was sent, already formatted */
|
|
15
|
+
time: string;
|
|
16
|
+
onCopy: () => void;
|
|
17
|
+
onDownload: (format: DownloadFormat) => void;
|
|
18
|
+
}
|
|
19
|
+
declare function MessageActionsToolbar({ time, onCopy, onDownload }: MessageActionsToolbarProps): import('react').JSX.Element;
|
|
20
|
+
type MessageActionsStory = StoryObj<typeof MessageActionsToolbar>;
|
|
21
|
+
/** An action that opens a menu: the button is the menu's `asChild` trigger and keeps its tooltip. */
|
|
22
|
+
export declare const WithMenuAction: MessageActionsStory;
|
|
23
|
+
/** A click calls the action's handler, and the menu action opens its menu and reports the pick. */
|
|
24
|
+
export declare const WithMenuActionSelect: MessageActionsStory;
|
|
25
|
+
/** Tab reaches each action and opens its tooltip; Enter and Space activate it, ArrowDown opens a menu. */
|
|
26
|
+
export declare const WithMenuActionKeyboard: MessageActionsStory;
|
|
27
|
+
/** A disabled action ignores clicks and is skipped by Tab. */
|
|
28
|
+
export declare const DisabledAction: StoryObj<{
|
|
29
|
+
onBookmark: () => void;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* The toolbar in each place it's allowed: inside `ChatMessageActions`, under an answer, under a
|
|
33
|
+
* question and on an agent transcript turn. `ChatMessageActions` hides the row until its message is
|
|
34
|
+
* hovered from `md` up; these blocks keep it visible.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Examples: Story;
|
|
37
|
+
interface ChatMessageToolbarPlaygroundProps {
|
|
38
|
+
reverse: boolean;
|
|
39
|
+
timestamp: string;
|
|
40
|
+
hasTimestamp: boolean;
|
|
41
|
+
hasTooltips: boolean;
|
|
42
|
+
actionCount: number;
|
|
43
|
+
isDisabled: boolean;
|
|
44
|
+
onAction: (label: string) => void;
|
|
45
|
+
}
|
|
46
|
+
declare function ChatMessageToolbarPlayground({ reverse, timestamp, hasTimestamp, hasTooltips, actionCount, isDisabled, onAction, }: ChatMessageToolbarPlaygroundProps): import('react').JSX.Element;
|
|
47
|
+
/** Every part of the toolbar at once, with each part and prop on the Controls panel. */
|
|
48
|
+
export declare const Playground: StoryObj<typeof ChatMessageToolbarPlayground>;
|
|
7
49
|
//# sourceMappingURL=chat-message-toolbar.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-toolbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-message-toolbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA2B5D,OAAO,EACL,kBAAkB,E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CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,iBAAS,4BAA4B,CAAC,EACpC,OAAO,EACP,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,GACT,EAAE,iCAAiC,+BAmBnC;AAED,wFAAwF;AACxF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,4BAA4B,CA8BpE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ChatMessageToolbar, ChatMessageToolbarActions, ChatMessageToolbarActionButton, ChatMessageToolbarTimestamp, } from './chat-message-toolbar';
|
|
1
|
+
export { ChatMessageToolbar, ChatMessageToolbarActions, ChatMessageToolbarActionButton, ChatMessageToolbarTimestamp, type ChatMessageToolbarProps, type ChatMessageToolbarActionsProps, type ChatMessageToolbarActionButtonProps, type ChatMessageToolbarTimestampProps, } from './chat-message-toolbar';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-message-toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,GACtC,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,24 +1,56 @@
|
|
|
1
1
|
import { ReactNode, ComponentProps } from 'react';
|
|
2
2
|
export interface ChatMessagesProps {
|
|
3
|
+
/** A `ChatMessagesList` and an optional `ChatMessagesScrollButton`. */
|
|
3
4
|
children: ReactNode;
|
|
5
|
+
/** Classes merged last onto the root (`data-slot="chat-messages"`). */
|
|
4
6
|
className?: string;
|
|
7
|
+
/** Number of rows `ChatMessagesList` renders; changing it scrolls the last row into view. */
|
|
5
8
|
messageCount?: number;
|
|
9
|
+
/** Space in px between rows and between the messages inside a `ChatMessageListGroup`. */
|
|
6
10
|
gap?: number;
|
|
7
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Root of a conversation that scrolls itself. It holds the row count and the gap, and has to be
|
|
14
|
+
* rendered inside a `ChatConversationProvider`, which owns the scroll state.
|
|
15
|
+
*/
|
|
8
16
|
export declare function ChatMessages({ children, className, messageCount, gap, }: ChatMessagesProps): import('react').JSX.Element;
|
|
9
17
|
export interface ChatMessagesListProps {
|
|
18
|
+
/** Render function for one row; it gets the row's index and returns a `ChatMessageListGroup`. */
|
|
10
19
|
children: (index: number) => ReactNode;
|
|
20
|
+
/** Classes merged last onto the `role="log"` list (`data-slot="chat-messages-list"`). */
|
|
11
21
|
className?: string;
|
|
22
|
+
/** Classes merged last onto the scroll container (`data-slot="chat-messages-scroll-area"`). */
|
|
23
|
+
scrollAreaClassName?: string;
|
|
24
|
+
/** Classes merged last onto the scrolling viewport (`data-slot="chat-messages-viewport"`). */
|
|
25
|
+
viewportClassName?: string;
|
|
26
|
+
/** Classes merged last onto the hidden end sentinel the list uses to detect the bottom. */
|
|
12
27
|
bottomTriggerClassName?: string;
|
|
13
28
|
}
|
|
14
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The scrolling list: renders `messageCount` rows from its render function inside a `role="log"`
|
|
31
|
+
* list, and scrolls the last row to the top of the view when the count changes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ChatMessagesList({ children, className, scrollAreaClassName, viewportClassName, bottomTriggerClassName, }: ChatMessagesListProps): import('react').JSX.Element;
|
|
15
34
|
export interface ChatMessageListGroupProps extends ComponentProps<'div'> {
|
|
16
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* One row's content: a question with its answer. The last group is at least as tall as the
|
|
38
|
+
* viewport, so a new question can settle at the top while its answer grows below it.
|
|
39
|
+
*/
|
|
17
40
|
export declare function ChatMessageListGroup({ children, className, ...rest }: ChatMessageListGroupProps): import('react').JSX.Element;
|
|
18
41
|
export interface ChatMessagesScrollButtonProps {
|
|
42
|
+
/** Classes merged last onto the positioned wrapper (`data-slot="chat-messages-scroll-button"`). */
|
|
19
43
|
className?: string;
|
|
44
|
+
/** Classes merged last onto the icon button inside the wrapper. */
|
|
45
|
+
buttonClassName?: string;
|
|
46
|
+
/** The button's tooltip and its `aria-label`. */
|
|
20
47
|
tooltip?: string;
|
|
48
|
+
/** Replaces the chevron icon. */
|
|
21
49
|
children?: ReactNode;
|
|
22
50
|
}
|
|
23
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Scroll-to-latest button over the list. It is hidden while the view is at the bottom and scrolls
|
|
53
|
+
* there when clicked.
|
|
54
|
+
*/
|
|
55
|
+
export declare const ChatMessagesScrollButton: import('react').MemoExoticComponent<({ className, buttonClassName, tooltip, children, }: ChatMessagesScrollButtonProps) => import('react').JSX.Element>;
|
|
24
56
|
//# sourceMappingURL=chat-messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-messages.d.ts","sourceRoot":"","sources":["../../../src/components/chat-messages/chat-messages.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAyBf,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,YAAgB,EAChB,GAAQ,GACT,EAAE,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"chat-messages.d.ts","sourceRoot":"","sources":["../../../src/components/chat-messages/chat-messages.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAyBf,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,QAAQ,EAAE,SAAS,CAAC;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,YAAgB,EAChB,GAAQ,GACT,EAAE,iBAAiB,+BAoBnB;AAED,MAAM,WAAW,qBAAqB;IACpC,iGAAiG;IACjG,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACvC,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2FAA2F;IAC3F,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACvB,EAAE,qBAAqB,+BAyDvB;AAsBD,MAAM,WAAW,yBAA0B,SAAQ,cAAc,CAAC,KAAK,CAAC;CAAG;AAE3E;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,yBAAyB,+BAmB/F;AAED,MAAM,WAAW,6BAA6B;IAC5C,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA6CD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,2FAKlC,6BAA6B,iCAqC9B,CAAC"}
|
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ConversationTurn } from './__stories__/types';
|
|
4
|
+
import { ChatMessages, ChatMessagesProps } from './chat-messages';
|
|
3
5
|
declare const meta: Meta<typeof ChatMessages>;
|
|
4
6
|
export default meta;
|
|
5
7
|
type Story = StoryObj<typeof ChatMessages>;
|
|
8
|
+
/** A finished conversation in a fixed-height panel: one row per question with its answer, opened at the latest one. Raise `messageCount` to add the next question. */
|
|
6
9
|
export declare const Default: Story;
|
|
7
|
-
|
|
10
|
+
/** Scrolls up through the history, which shows the scroll button, then clicks it to return to the end. */
|
|
11
|
+
export declare const DefaultScrollToLatest: Story;
|
|
12
|
+
interface AssistantConversationProps {
|
|
13
|
+
initialTurns: ConversationTurn[];
|
|
14
|
+
followUps: ConversationTurn[];
|
|
15
|
+
onAsk: (question: string) => void;
|
|
16
|
+
}
|
|
17
|
+
declare function AssistantConversation({ initialTurns, followUps, onAsk }: AssistantConversationProps): import('react').JSX.Element;
|
|
18
|
+
type StreamingStory = StoryObj<typeof AssistantConversation>;
|
|
19
|
+
/** A new question settles at the top of the view and its answer streams in below it, past the end of the viewport. */
|
|
20
|
+
export declare const Streaming: StreamingStory;
|
|
21
|
+
/** Sends a follow-up and checks that the new question's group fills the viewport and settles at its top. */
|
|
22
|
+
export declare const StreamingNewQuestion: StreamingStory;
|
|
23
|
+
/** The conversation in each place it's allowed: under its provider, in a canvas shell, in an assistant side panel and on a full-page chat. */
|
|
24
|
+
export declare const Examples: Story;
|
|
25
|
+
interface ChatMessagesPlaygroundProps extends Omit<ChatMessagesProps, 'children'> {
|
|
26
|
+
listClassName: string;
|
|
27
|
+
scrollAreaClassName: string;
|
|
28
|
+
viewportClassName: string;
|
|
29
|
+
bottomTriggerClassName: string;
|
|
30
|
+
hasScrollButton: boolean;
|
|
31
|
+
tooltip: string;
|
|
32
|
+
scrollButtonClassName: string;
|
|
33
|
+
buttonClassName: string;
|
|
34
|
+
icon: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare function ChatMessagesPlayground({ listClassName, scrollAreaClassName, viewportClassName, bottomTriggerClassName, hasScrollButton, tooltip, scrollButtonClassName, buttonClassName, icon, ...rest }: ChatMessagesPlaygroundProps): import('react').JSX.Element;
|
|
37
|
+
/** Every part at once, with each prop of the root, the list and the scroll button on the Controls panel. */
|
|
38
|
+
export declare const Playground: StoryObj<typeof ChatMessagesPlayground>;
|
|
8
39
|
//# sourceMappingURL=chat-messages.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-messages.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-messages/chat-messages.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-messages.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-messages/chat-messages.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoB5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAEL,YAAY,EAGZ,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,IAAI,EAAE,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