@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
package/dist/index.es.js
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
1
|
import { Slot as e } from "@radix-ui/react-slot";
|
|
2
|
-
import t, { Children as n, cloneElement as r, createContext as i, forwardRef as a, isValidElement as o, memo as s, useCallback as c, useContext as l, useEffect as u,
|
|
3
|
-
import { Button as _,
|
|
2
|
+
import t, { Children as n, cloneElement as r, createContext as i, forwardRef as a, isValidElement as o, memo as s, useCallback as c, useContext as l, useEffect as u, useImperativeHandle as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
3
|
+
import { Button as g, Chip as _, Collapsible as v, CollapsibleContent as y, CollapsibleTrigger as b, Divider as x, EmptyState as S, EmptyStateActionRow as C, EmptyStateDescription as w, EmptyStateIcon as T, EmptyStateTitle as E, IconButton as D, List as ee, ListItem as te, ListItemAction as O, ListItemTitle as k, ListItemTrigger as A, Menu as ne, MenuProvider as re, MenuTrigger as j, OrderChip as ie, Popover as M, PopoverContent as ae, PopoverTrigger as N, ScrollArea as oe, SelectField as se, Skeleton as ce, Tooltip as P, Typography as F, listItemVariants as le, useIsResolution as ue } from "@swisper.ai/ui";
|
|
4
4
|
import { cn as I, useElementMeasure as L } from "@swisper.ai/web-core";
|
|
5
5
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
6
6
|
import { cva as V } from "class-variance-authority";
|
|
7
|
-
import { AttachmentsIcon as
|
|
8
|
-
import { CodeNode as
|
|
9
|
-
import { $isLinkNode as
|
|
10
|
-
import { $createListItemNode as
|
|
11
|
-
import { LexicalComposer as
|
|
12
|
-
import { ContentEditable as
|
|
13
|
-
import { LexicalErrorBoundary as
|
|
14
|
-
import { HistoryPlugin as
|
|
15
|
-
import { RichTextPlugin as
|
|
16
|
-
import { $createHeadingNode as
|
|
17
|
-
import { useLexicalComposerContext as
|
|
18
|
-
import { $convertFromMarkdownString as
|
|
19
|
-
import { $addUpdateTag as
|
|
20
|
-
import { OnChangePlugin as
|
|
21
|
-
import { createPortal as
|
|
22
|
-
import { useVirtualizer as
|
|
23
|
-
import * as
|
|
24
|
-
import { nanoid as
|
|
25
|
-
import
|
|
26
|
-
import { Streamdown as
|
|
27
|
-
import
|
|
7
|
+
import { AttachmentsIcon as de, ChevronDownIcon as H, ChevronUpIcon as fe, CloseIcon as U, CodeIcon as pe, DeleteIcon as me, DocIcon as he, DraftIcon as ge, FormatAlignCenterIcon as _e, FormatAlignLeftIcon as ve, FormatAlignRightIcon as ye, FormatBoldIcon as be, FormatCleanIcon as xe, FormatColorIcon as Se, FormatItalicIcon as Ce, FormatUnderlineIcon as we, ImageIcon as Te, LinkOffIcon as Ee, LinkOnIcon as De, MoreHorizontalIcon as Oe, OpenInFullIcon as ke, PdfIcon as Ae, PptIcon as je, SignalReadIcon as Me, SignalUnreadIcon as Ne, SnoozeIcon as Pe, XlsIcon as Fe } from "@swisper.ai/icons";
|
|
8
|
+
import { CodeNode as Ie } from "@lexical/code";
|
|
9
|
+
import { $isLinkNode as Le, LinkNode as Re, TOGGLE_LINK_COMMAND as ze } from "@lexical/link";
|
|
10
|
+
import { $createListItemNode as Be, $createListNode as Ve, ListItemNode as He, ListNode as Ue } from "@lexical/list";
|
|
11
|
+
import { LexicalComposer as We } from "@lexical/react/LexicalComposer";
|
|
12
|
+
import { ContentEditable as Ge } from "@lexical/react/LexicalContentEditable";
|
|
13
|
+
import { LexicalErrorBoundary as Ke } from "@lexical/react/LexicalErrorBoundary";
|
|
14
|
+
import { HistoryPlugin as qe } from "@lexical/react/LexicalHistoryPlugin";
|
|
15
|
+
import { RichTextPlugin as Je } from "@lexical/react/LexicalRichTextPlugin";
|
|
16
|
+
import { $createHeadingNode as Ye, HeadingNode as Xe, QuoteNode as Ze } from "@lexical/rich-text";
|
|
17
|
+
import { useLexicalComposerContext as Qe } from "@lexical/react/LexicalComposerContext";
|
|
18
|
+
import { $convertFromMarkdownString as $e, $convertToMarkdownString as et, TRANSFORMERS as tt, TRANSFORMERS as nt } from "@lexical/markdown";
|
|
19
|
+
import { $addUpdateTag as W, $createParagraphNode as rt, $createRangeSelection as it, $createTextNode as at, $getPreviousSelection as ot, $getRoot as G, $getSelection as K, $insertNodes as st, $isElementNode as ct, $isParagraphNode as lt, $isRangeSelection as q, $isTextNode as J, $selectAll as ut, $setSelection as dt, $setState as ft, COMMAND_PRIORITY_CRITICAL as pt, COMMAND_PRIORITY_EDITOR as mt, COMMAND_PRIORITY_LOW as ht, DecoratorNode as gt, ElementNode as _t, FORMAT_ELEMENT_COMMAND as vt, FORMAT_TEXT_COMMAND as yt, PASTE_COMMAND as bt, SELECTION_CHANGE_COMMAND as xt, SKIP_DOM_SELECTION_TAG as St, SKIP_SELECTION_FOCUS_TAG as Ct, createCommand as wt, createState as Tt, isHTMLElement as Et, setNodeIndentFromDOM as Dt } from "lexical";
|
|
20
|
+
import { OnChangePlugin as Ot } from "@lexical/react/LexicalOnChangePlugin";
|
|
21
|
+
import { createPortal as kt } from "react-dom";
|
|
22
|
+
import { useVirtualizer as At } from "@tanstack/react-virtual";
|
|
23
|
+
import * as jt from "@radix-ui/react-scroll-area";
|
|
24
|
+
import { nanoid as Mt } from "nanoid";
|
|
25
|
+
import Nt from "mime";
|
|
26
|
+
import { Streamdown as Pt, defaultRehypePlugins as Ft, defaultRemarkPlugins as It } from "streamdown";
|
|
27
|
+
import Lt, { defaultSchema as Rt } from "rehype-sanitize";
|
|
28
28
|
import "katex/dist/katex.min.css";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { $
|
|
36
|
-
import {
|
|
37
|
-
import { $getNearestBlockElementAncestorOrThrow as Xt, mergeRegister as Zt } from "@lexical/utils";
|
|
38
|
-
import { $forEachSelectedTextNode as Qt, $getSelectionStyleValueForProperty as $t, $isAtNodeEnd as en, $patchStyleText as tn } from "@lexical/selection";
|
|
29
|
+
import { MessageScroller as zt, useMessageScroller as Bt, useMessageScrollerScrollable as Vt } from "@shadcn/react/message-scroller";
|
|
30
|
+
import { AnimatePresence as Ht, motion as Ut } from "motion/react";
|
|
31
|
+
import { TablePlugin as Wt } from "@lexical/react/LexicalTablePlugin";
|
|
32
|
+
import { TableCellNode as Gt, TableNode as Kt, TableRowNode as qt } from "@lexical/table";
|
|
33
|
+
import { $generateHtmlFromNodes as Jt, $generateNodesFromDOM as Yt } from "@lexical/html";
|
|
34
|
+
import { EditorRefPlugin as Xt } from "@lexical/react/LexicalEditorRefPlugin";
|
|
35
|
+
import { $getNearestBlockElementAncestorOrThrow as Zt, mergeRegister as Qt } from "@lexical/utils";
|
|
36
|
+
import { $forEachSelectedTextNode as $t, $getSelectionStyleValueForProperty as en, $isAtNodeEnd as tn, $patchStyleText as nn } from "@lexical/selection";
|
|
39
37
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
40
|
-
import
|
|
41
|
-
import { DotLottieReact as rn } from "@lottiefiles/dotlottie-react";
|
|
38
|
+
import rn from "inline-style-parser";
|
|
42
39
|
import an from "remark-gfm";
|
|
43
40
|
import on from "remark-parse";
|
|
44
41
|
import { unified as sn } from "unified";
|
|
@@ -52,24 +49,25 @@ function fn() {
|
|
|
52
49
|
return e;
|
|
53
50
|
}
|
|
54
51
|
var pn = a(function({ children: t, className: n, visibleCount: r = un, defaultExpanded: i = !1, expanded: a, onExpandedChange: o, asChild: s = !1, ...l }, u) {
|
|
55
|
-
let [d, f] =
|
|
52
|
+
let [d, f] = h(i), [m, g] = h(0), _ = a ?? d, v = c(() => {
|
|
56
53
|
a === void 0 && f(!0), o?.(!0);
|
|
57
|
-
}, [a, o]), y =
|
|
54
|
+
}, [a, o]), y = p(() => ({
|
|
58
55
|
visibleCount: Math.max(0, r),
|
|
59
56
|
isExpanded: _,
|
|
60
57
|
expand: v,
|
|
61
|
-
hiddenCount:
|
|
62
|
-
setHiddenCount:
|
|
58
|
+
hiddenCount: m,
|
|
59
|
+
setHiddenCount: g
|
|
63
60
|
}), [
|
|
64
61
|
r,
|
|
65
62
|
_,
|
|
66
63
|
v,
|
|
67
|
-
|
|
64
|
+
m
|
|
68
65
|
]), b = s ? e : "div";
|
|
69
66
|
return /* @__PURE__ */ z(dn.Provider, {
|
|
70
67
|
value: y,
|
|
71
68
|
children: /* @__PURE__ */ z(b, {
|
|
72
69
|
ref: u,
|
|
70
|
+
"data-slot": "chat-card-list-layout",
|
|
73
71
|
"data-testid": "chat-card-list-layout",
|
|
74
72
|
"data-expanded": _,
|
|
75
73
|
className: I("group/chat-card-list-layout", "flex flex-col items-start gap-[8px]", n),
|
|
@@ -81,7 +79,7 @@ var pn = a(function({ children: t, className: n, visibleCount: r = un, defaultEx
|
|
|
81
79
|
pn.displayName = "ChatCardListLayout";
|
|
82
80
|
function mn({ children: e }) {
|
|
83
81
|
let { visibleCount: t, isExpanded: r, setHiddenCount: i } = fn(), a = n.toArray(e), o = r ? 0 : Math.max(0, a.length - t);
|
|
84
|
-
return
|
|
82
|
+
return f(() => {
|
|
85
83
|
i(o);
|
|
86
84
|
}, [o, i]), /* @__PURE__ */ z(R, { children: r ? a : a.slice(0, t) });
|
|
87
85
|
}
|
|
@@ -90,10 +88,11 @@ var hn = a(function({ children: e, onClick: t, className: n, ...r }, i) {
|
|
|
90
88
|
function c(e) {
|
|
91
89
|
s(), t?.(e);
|
|
92
90
|
}
|
|
93
|
-
return a || o === 0 ? null : /* @__PURE__ */ z(
|
|
91
|
+
return a || o === 0 ? null : /* @__PURE__ */ z(g, {
|
|
94
92
|
ref: i,
|
|
95
93
|
variant: "tertiary",
|
|
96
94
|
size: "sm",
|
|
95
|
+
"data-slot": "chat-card-list-layout-show-more",
|
|
97
96
|
"data-testid": "chat-card-list-layout-show-more",
|
|
98
97
|
onClick: c,
|
|
99
98
|
className: I("mx-auto", n),
|
|
@@ -152,14 +151,14 @@ function On(e, t) {
|
|
|
152
151
|
}, [e, t]);
|
|
153
152
|
}
|
|
154
153
|
var kn = a(function({ children: t, className: n, detailsPlacement: r = vn, asChild: i = !1, ...a }, o) {
|
|
155
|
-
let { ref: s, width: c } = L(), l = On(s, o), { size: u, isListFloating: d, isDetailsFloating: f, isDetailsSheet:
|
|
154
|
+
let { ref: s, width: c } = L(), l = On(s, o), { size: u, isListFloating: d, isDetailsFloating: f, isDetailsSheet: m } = _n(c, r), h = p(() => ({
|
|
156
155
|
isListFloating: d,
|
|
157
156
|
isDetailsFloating: f,
|
|
158
|
-
isDetailsSheet:
|
|
157
|
+
isDetailsSheet: m
|
|
159
158
|
}), [
|
|
160
159
|
d,
|
|
161
160
|
f,
|
|
162
|
-
|
|
161
|
+
m
|
|
163
162
|
]), g = i ? e : "div";
|
|
164
163
|
return /* @__PURE__ */ z(Tn.Provider, {
|
|
165
164
|
value: h,
|
|
@@ -239,20 +238,20 @@ var Pn = V(["@container/chat-card-two-column-layout"]), Fn = V([
|
|
|
239
238
|
function Bn(e) {
|
|
240
239
|
if (!l(zn)) throw Error(`[web-chat-ui] "${e}" must be used within a ChatCardTwoColumnLayout. Its columns come from the layout’s container query, so render it as a child of the ChatCardTwoColumnLayout element, not as a sibling of it.`);
|
|
241
240
|
}
|
|
242
|
-
var Vn = a(function({ children: t, className: n,
|
|
243
|
-
let
|
|
241
|
+
var Vn = a(function({ children: t, className: n, gridClassName: r, asChild: i = !1, ...a }, o) {
|
|
242
|
+
let s = i ? e : "div";
|
|
244
243
|
return /* @__PURE__ */ z(zn.Provider, {
|
|
245
244
|
value: !0,
|
|
246
|
-
children: /* @__PURE__ */ z(
|
|
247
|
-
ref:
|
|
245
|
+
children: /* @__PURE__ */ z(s, {
|
|
246
|
+
ref: o,
|
|
248
247
|
"data-testid": "chat-card-two-column-layout",
|
|
249
248
|
"data-slot": "chat-card-two-column-layout",
|
|
250
249
|
className: I(Pn(), n),
|
|
251
|
-
...
|
|
250
|
+
...a,
|
|
252
251
|
children: /* @__PURE__ */ z("div", {
|
|
253
252
|
"data-testid": "chat-card-two-column-layout-grid",
|
|
254
253
|
"data-slot": "chat-card-two-column-layout-grid",
|
|
255
|
-
className: Fn(),
|
|
254
|
+
className: I(Fn(), r),
|
|
256
255
|
children: t
|
|
257
256
|
})
|
|
258
257
|
})
|
|
@@ -297,27 +296,31 @@ function Gn({ value: e, children: t }) {
|
|
|
297
296
|
}
|
|
298
297
|
//#endregion
|
|
299
298
|
//#region src/components/chat-card/components/chat-card-header.tsx
|
|
300
|
-
function Kn({ className: e, children: t,
|
|
301
|
-
let { isCollapsible:
|
|
299
|
+
function Kn({ className: e, children: t, hoverAreaClassName: n, ...r }) {
|
|
300
|
+
let { isCollapsible: i, level: a } = Y(), o = /* @__PURE__ */ z("div", {
|
|
302
301
|
"data-slot": "chat-card-header-hover-area",
|
|
303
|
-
className: I("w-full", "flex flex-row items-start", "gap-card-header-gap",
|
|
302
|
+
className: I("w-full", "flex flex-row items-start", "gap-card-header-gap", a === 1 && "px-card-header-hover-area rounded-card-header", a === 1 && i && "hover:bg-layout-accent-low-background-hover-base", a === 1 && "group-hover/chat-card:bg-layout-accent-low-background-hover-base", !i && "cursor-default", n),
|
|
304
303
|
children: t
|
|
305
304
|
});
|
|
306
305
|
return /* @__PURE__ */ z("header", {
|
|
307
306
|
"data-slot": "chat-card-header",
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
"data-level": a,
|
|
308
|
+
"data-collapsible": i,
|
|
309
|
+
className: I("flex items-start", a === 1 ? "p-card-header-lvl-1" : "px-card-header-lvl-2", e),
|
|
310
|
+
...r,
|
|
311
|
+
children: i ? /* @__PURE__ */ z(b, {
|
|
311
312
|
className: "w-full",
|
|
312
313
|
asChild: !0,
|
|
313
|
-
children:
|
|
314
|
-
}) :
|
|
314
|
+
children: o
|
|
315
|
+
}) : o
|
|
315
316
|
});
|
|
316
317
|
}
|
|
317
318
|
function qn({ className: e, children: t, ...n }) {
|
|
318
319
|
let { level: r } = Y();
|
|
319
320
|
return /* @__PURE__ */ z("div", {
|
|
321
|
+
"data-slot": "chat-card-icon",
|
|
320
322
|
"data-testid": "chat-card-icon",
|
|
323
|
+
"data-level": r,
|
|
321
324
|
className: I("shrink-0", "inline-flex items-center justify-center self-center", "size-[32px]", "bg-avatar-background", "rounded-full overflow-hidden", r === 1 ? "my-[14px]" : "my-4", e),
|
|
322
325
|
...n,
|
|
323
326
|
children: t
|
|
@@ -326,14 +329,16 @@ function qn({ className: e, children: t, ...n }) {
|
|
|
326
329
|
function Jn({ className: e, children: t, ...n }) {
|
|
327
330
|
let { level: r } = Y();
|
|
328
331
|
return /* @__PURE__ */ z("div", {
|
|
332
|
+
"data-slot": "chat-card-header-content",
|
|
329
333
|
"data-testid": "chat-card-header-content",
|
|
334
|
+
"data-level": r,
|
|
330
335
|
className: I("flex-1", "flex flex-col gap-0 items-start justify-center", r === 1 ? "min-h-[60px] py-1.5" : "min-h-[40px] py-4", e),
|
|
331
336
|
...n,
|
|
332
337
|
children: t
|
|
333
338
|
});
|
|
334
339
|
}
|
|
335
340
|
function Yn({ className: e, children: t, ...n }) {
|
|
336
|
-
return /* @__PURE__ */ z(
|
|
341
|
+
return /* @__PURE__ */ z(F, {
|
|
337
342
|
"data-testid": "chat-card-title",
|
|
338
343
|
variant: "body-medium",
|
|
339
344
|
className: I(e),
|
|
@@ -342,7 +347,7 @@ function Yn({ className: e, children: t, ...n }) {
|
|
|
342
347
|
});
|
|
343
348
|
}
|
|
344
349
|
function Xn({ className: e, children: t, ...n }) {
|
|
345
|
-
return /* @__PURE__ */ z(
|
|
350
|
+
return /* @__PURE__ */ z(F, {
|
|
346
351
|
"data-testid": "chat-card-sub-title",
|
|
347
352
|
variant: "body-small-high",
|
|
348
353
|
className: I("text-text-secondary", e),
|
|
@@ -354,7 +359,9 @@ function Zn({ className: e, children: t, ...n }) {
|
|
|
354
359
|
let { level: r } = Y();
|
|
355
360
|
return /* @__PURE__ */ z("div", {
|
|
356
361
|
role: "group",
|
|
362
|
+
"data-slot": "chat-card-actions",
|
|
357
363
|
"data-testid": "chat-card-actions",
|
|
364
|
+
"data-level": r,
|
|
358
365
|
className: I("ml-auto shrink-0", "flex items-center self-center gap-card-header-gap-icon-buttons", "min-h-[32px]", "[&>button]:text-secondary-main!", r === 1 ? "my-[14px]" : "my-4", e),
|
|
359
366
|
...n,
|
|
360
367
|
children: t
|
|
@@ -365,6 +372,7 @@ function Qn({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip:
|
|
|
365
372
|
n && e.stopPropagation(), i?.(e);
|
|
366
373
|
}
|
|
367
374
|
let s = /* @__PURE__ */ z(D, {
|
|
375
|
+
"data-slot": "chat-card-action-button",
|
|
368
376
|
variant: "tertiary",
|
|
369
377
|
size: "sm",
|
|
370
378
|
className: I(e),
|
|
@@ -372,7 +380,7 @@ function Qn({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip:
|
|
|
372
380
|
...a,
|
|
373
381
|
children: t
|
|
374
382
|
});
|
|
375
|
-
return r ? /* @__PURE__ */ z(
|
|
383
|
+
return r ? /* @__PURE__ */ z(P, {
|
|
376
384
|
tooltip: r,
|
|
377
385
|
children: s
|
|
378
386
|
}) : s;
|
|
@@ -380,9 +388,10 @@ function Qn({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip:
|
|
|
380
388
|
function $n({ className: e, ...t }) {
|
|
381
389
|
let { isCollapsible: n } = Y();
|
|
382
390
|
if (n) return /* @__PURE__ */ z(Qn, {
|
|
391
|
+
"data-slot": "chat-card-collapsible-button",
|
|
383
392
|
shouldPreventCollapse: !1,
|
|
384
393
|
isSemantic: !1,
|
|
385
|
-
className: I(
|
|
394
|
+
className: I("transition-transform duration-300", "group-data-[state=open]/collapsible:rotate-180", e),
|
|
386
395
|
...t,
|
|
387
396
|
children: /* @__PURE__ */ z(H, {})
|
|
388
397
|
});
|
|
@@ -391,6 +400,7 @@ function $n({ className: e, ...t }) {
|
|
|
391
400
|
//#region src/components/chat-card/components/chat-card-body.tsx
|
|
392
401
|
function er({ className: e, children: t, ...n }) {
|
|
393
402
|
return /* @__PURE__ */ z("figure", {
|
|
403
|
+
"data-slot": "chat-card-media",
|
|
394
404
|
"data-testid": "chat-card-media",
|
|
395
405
|
className: I("min-h-0 shrink-0 h-[222px]", e),
|
|
396
406
|
...n,
|
|
@@ -399,7 +409,8 @@ function er({ className: e, children: t, ...n }) {
|
|
|
399
409
|
}
|
|
400
410
|
function tr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
401
411
|
let a = r ? e : "div";
|
|
402
|
-
return /* @__PURE__ */ z(
|
|
412
|
+
return /* @__PURE__ */ z(y, {
|
|
413
|
+
"data-slot": "chat-card-body",
|
|
403
414
|
"data-testid": "chat-card-body",
|
|
404
415
|
className: I("flex flex-1 flex-col", "min-h-0", "md:group-data-[collapsible=true]/chat-card:max-h-[90vh]", "overflow-hidden", t),
|
|
405
416
|
asChild: !0,
|
|
@@ -410,6 +421,7 @@ function tr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
|
410
421
|
function nr({ className: t, children: n, asChild: r = !1, hasPadding: i = !0, hasHeaderPadding: a = !0, ...o }) {
|
|
411
422
|
let { level: s } = Y();
|
|
412
423
|
return /* @__PURE__ */ z(r ? e : "div", {
|
|
424
|
+
"data-slot": "chat-card-content",
|
|
413
425
|
"data-testid": "chat-card-content",
|
|
414
426
|
"data-padding": i,
|
|
415
427
|
"data-has-header-padding": a,
|
|
@@ -422,6 +434,7 @@ function nr({ className: t, children: n, asChild: r = !1, hasPadding: i = !0, ha
|
|
|
422
434
|
function rr({ className: e, children: t, ...n }) {
|
|
423
435
|
let { level: r } = Y();
|
|
424
436
|
return /* @__PURE__ */ z("div", {
|
|
437
|
+
"data-slot": "chat-card-preview",
|
|
425
438
|
"data-testid": "chat-card-preview",
|
|
426
439
|
"data-level": r,
|
|
427
440
|
className: I("group-data-[state=open]/collapsible:hidden", "overflow-auto", "pt-0", "data-[level=1]:p-card-slots-lvl-1", "data-[level=2]:p-card-slots-lvl-2", e),
|
|
@@ -443,6 +456,7 @@ function ir({ className: e, children: t, ...n }) {
|
|
|
443
456
|
}
|
|
444
457
|
function ar({ className: e, children: t }) {
|
|
445
458
|
return /* @__PURE__ */ z("div", {
|
|
459
|
+
"data-slot": "chat-card-footer-notes",
|
|
446
460
|
"data-testid": "chat-card-footer-notes",
|
|
447
461
|
className: I("mr-auto shrink-0", "flex flex-col items-start justify-center", "gap-card-footer-gap-left-notes", e),
|
|
448
462
|
children: t
|
|
@@ -450,6 +464,7 @@ function ar({ className: e, children: t }) {
|
|
|
450
464
|
}
|
|
451
465
|
function or({ className: e, children: t }) {
|
|
452
466
|
return /* @__PURE__ */ z("div", {
|
|
467
|
+
"data-slot": "chat-card-footer-price",
|
|
453
468
|
"data-testid": "chat-card-footer-price",
|
|
454
469
|
className: I("flex flex-col items-end justify-center", "gap-card-footer-gap-prices", "shrink-0", e),
|
|
455
470
|
children: t
|
|
@@ -458,6 +473,7 @@ function or({ className: e, children: t }) {
|
|
|
458
473
|
function sr({ className: e, children: t, ...n }) {
|
|
459
474
|
return /* @__PURE__ */ z("div", {
|
|
460
475
|
role: "group",
|
|
476
|
+
"data-slot": "chat-card-footer-actions",
|
|
461
477
|
"data-testid": "chat-card-footer-actions",
|
|
462
478
|
className: I("flex items-center gap-card-footer-gap shrink-0", e),
|
|
463
479
|
...n,
|
|
@@ -469,14 +485,17 @@ function sr({ className: e, children: t, ...n }) {
|
|
|
469
485
|
var cr = a(function({ className: t, children: n, asChild: r, ...i }, a) {
|
|
470
486
|
return /* @__PURE__ */ z(r ? e : "form", {
|
|
471
487
|
ref: a,
|
|
488
|
+
"data-slot": "chat-card-form",
|
|
472
489
|
"data-testid": "chat-card-form",
|
|
473
490
|
className: I("bg-steel-900 border border-steel-700", "rounded-[12px]", "m-8 mb-16 p-[12px]", "overflow-hidden", t),
|
|
474
491
|
...i,
|
|
475
492
|
children: n
|
|
476
493
|
});
|
|
477
494
|
});
|
|
495
|
+
cr.displayName = "ChatCardForm";
|
|
478
496
|
function lr({ className: e, children: t }) {
|
|
479
497
|
return /* @__PURE__ */ z("ul", {
|
|
498
|
+
"data-slot": "chat-card-attributes",
|
|
480
499
|
"data-testid": "chat-card-attributes",
|
|
481
500
|
className: I("flex flex-col justify-start items-start gap-8", "mb-24", e),
|
|
482
501
|
children: t
|
|
@@ -484,6 +503,7 @@ function lr({ className: e, children: t }) {
|
|
|
484
503
|
}
|
|
485
504
|
function ur({ className: e, children: t, ...n }) {
|
|
486
505
|
return /* @__PURE__ */ z("li", {
|
|
506
|
+
"data-slot": "chat-card-attribute",
|
|
487
507
|
"data-testid": "chat-card-attribute-item",
|
|
488
508
|
className: I("grid grid-cols-[66px_1fr] gap-8", "w-full", "min-h-24", e),
|
|
489
509
|
...n,
|
|
@@ -491,10 +511,11 @@ function ur({ className: e, children: t, ...n }) {
|
|
|
491
511
|
});
|
|
492
512
|
}
|
|
493
513
|
function dr({ className: e, children: t, hasPadding: n = !1, ...r }) {
|
|
494
|
-
return /* @__PURE__ */ z(
|
|
514
|
+
return /* @__PURE__ */ z(_, {
|
|
495
515
|
variant: "outlined",
|
|
496
516
|
size: "md",
|
|
497
517
|
color: "info",
|
|
518
|
+
"data-slot": "chat-card-attribute-label",
|
|
498
519
|
"data-has-padding": n,
|
|
499
520
|
className: I("w-full", "data-[has-padding=true]:my-[5px]", e),
|
|
500
521
|
"data-testid": "chat-card-attribute-label",
|
|
@@ -503,7 +524,7 @@ function dr({ className: e, children: t, hasPadding: n = !1, ...r }) {
|
|
|
503
524
|
});
|
|
504
525
|
}
|
|
505
526
|
function fr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
506
|
-
return /* @__PURE__ */ z(r ? e :
|
|
527
|
+
return /* @__PURE__ */ z(r ? e : F, {
|
|
507
528
|
"data-testid": "chat-card-attribute-value",
|
|
508
529
|
variant: "body-sm",
|
|
509
530
|
className: I("flex-1 text-text-secondary", t),
|
|
@@ -513,10 +534,10 @@ function fr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
|
513
534
|
}
|
|
514
535
|
//#endregion
|
|
515
536
|
//#region src/components/chat-card/chat-card.tsx
|
|
516
|
-
var pr = a(function({ className: e, variant: t = "default", level: n = 1, children: r, fullWidth: i = !1, defaultOpen: a = !0, open: o, isRounded: s = !0, isCollapsible: l = !0, isSelected: u = !1, onOpenChange: d, onClick: f, ...
|
|
517
|
-
let _ = o !== void 0, [
|
|
518
|
-
_ ||
|
|
519
|
-
}, [_, d]), C =
|
|
537
|
+
var pr = a(function({ className: e, variant: t = "default", level: n = 1, children: r, fullWidth: i = !1, defaultOpen: a = !0, open: o, isRounded: s = !0, isCollapsible: l = !0, isSelected: u = !1, onOpenChange: d, onClick: f, ...m }, g) {
|
|
538
|
+
let _ = o !== void 0, [y, b] = h(a), x = _ ? o : y, S = c((e) => {
|
|
539
|
+
_ || b(e), d?.(e);
|
|
540
|
+
}, [_, d]), C = p(() => ({
|
|
520
541
|
isCollapsible: l,
|
|
521
542
|
level: n,
|
|
522
543
|
open: x
|
|
@@ -530,14 +551,15 @@ var pr = a(function({ className: e, variant: t = "default", level: n = 1, childr
|
|
|
530
551
|
}
|
|
531
552
|
return /* @__PURE__ */ z(Gn, {
|
|
532
553
|
value: C,
|
|
533
|
-
children: /* @__PURE__ */ z(
|
|
554
|
+
children: /* @__PURE__ */ z(v, {
|
|
534
555
|
isDisabled: !l,
|
|
535
556
|
open: x,
|
|
536
557
|
onOpenChange: S,
|
|
537
558
|
asChild: !0,
|
|
538
559
|
children: /* @__PURE__ */ z("section", {
|
|
539
|
-
ref:
|
|
560
|
+
ref: g,
|
|
540
561
|
role: "region",
|
|
562
|
+
"data-slot": "chat-card",
|
|
541
563
|
"aria-current": u,
|
|
542
564
|
"data-testid": "chat-card",
|
|
543
565
|
"data-variant": t,
|
|
@@ -548,7 +570,7 @@ var pr = a(function({ className: e, variant: t = "default", level: n = 1, childr
|
|
|
548
570
|
"data-collapsible": l,
|
|
549
571
|
onClick: w,
|
|
550
572
|
className: I("group/chat-card", "w-full data-[state=closed]:max-w-(--message-list-content-width) data-[state=closed]:mx-auto", "flex flex-col", "relative overflow-hidden", "border border-solid border-card-border-base", "data-[level=1]:bg-card-background-base", "data-[level=2]:bg-card-background-lvl-2", "data-[full-width=true]:w-full", "data-[level=1]:data-[rounded=true]:rounded-card-lvl-1", "data-[level=2]:data-[rounded=true]:rounded-card-lvl-2", "data-[selected=true]:border-primary-main", "hover:data-[variant=action]:bg-secondary-states-hover", "data-[collapsible=true]:data-[state=closed]:cursor-pointer", e),
|
|
551
|
-
...
|
|
573
|
+
...m,
|
|
552
574
|
children: r
|
|
553
575
|
})
|
|
554
576
|
})
|
|
@@ -558,7 +580,7 @@ pr.displayName = "ChatCard";
|
|
|
558
580
|
//#endregion
|
|
559
581
|
//#region src/components/chat-card/hooks.ts
|
|
560
582
|
function mr({ isEditable: e, defaultEditing: t = !1 }) {
|
|
561
|
-
let [n, r] =
|
|
583
|
+
let [n, r] = h(t);
|
|
562
584
|
function i() {
|
|
563
585
|
return e ? !0 : (console.warn("Chat card is not editable"), !1);
|
|
564
586
|
}
|
|
@@ -601,6 +623,7 @@ function _r({ children: e, defaultEditing: t = !1, isEditable: n = !1 }) {
|
|
|
601
623
|
//#region src/components/chat-card-container/chat-card-container.tsx
|
|
602
624
|
function vr({ children: e, variant: t = "fixed", inline: n = !1, className: r, ...i }) {
|
|
603
625
|
return /* @__PURE__ */ z("div", {
|
|
626
|
+
"data-slot": "chat-card-container",
|
|
604
627
|
"data-testid": "chat-card-container",
|
|
605
628
|
"data-variant": t,
|
|
606
629
|
"data-inline": n,
|
|
@@ -625,15 +648,15 @@ function Cr() {
|
|
|
625
648
|
return e;
|
|
626
649
|
}
|
|
627
650
|
function wr({ asChild: t = !1, children: n, className: r, contentWidth: i = yr, style: a, ...o }) {
|
|
628
|
-
let s = t ? e : "section", { ref: l, width: u, height: d } = L(), [f,
|
|
651
|
+
let s = t ? e : "section", { ref: l, width: u, height: d } = L(), [f, m] = h({
|
|
629
652
|
prompt: "unset",
|
|
630
653
|
welcome: "unset"
|
|
631
|
-
}),
|
|
632
|
-
|
|
654
|
+
}), g = c((e, t) => {
|
|
655
|
+
m((n) => n[e] === t ? n : {
|
|
633
656
|
...n,
|
|
634
657
|
[e]: t
|
|
635
658
|
});
|
|
636
|
-
}, []), _ =
|
|
659
|
+
}, []), _ = p(() => ({ setSlotHeight: g }), [g]), v = p(() => ({
|
|
637
660
|
"--chat-window-width": u === "unset" ? "100%" : `${u}px`,
|
|
638
661
|
"--chat-window-height": d === "unset" ? "100%" : `${d}px`,
|
|
639
662
|
"--message-list-content-width": `min(${i}, var(--chat-window-width))`,
|
|
@@ -651,6 +674,7 @@ function wr({ asChild: t = !1, children: n, className: r, contentWidth: i = yr,
|
|
|
651
674
|
value: _,
|
|
652
675
|
children: /* @__PURE__ */ z(s, {
|
|
653
676
|
ref: l,
|
|
677
|
+
"data-slot": "chat-container",
|
|
654
678
|
"data-testid": "chat-container",
|
|
655
679
|
className: I("relative flex h-full min-h-0 w-full flex-col", r),
|
|
656
680
|
style: v,
|
|
@@ -661,7 +685,7 @@ function wr({ asChild: t = !1, children: n, className: r, contentWidth: i = yr,
|
|
|
661
685
|
}
|
|
662
686
|
function Tr(e) {
|
|
663
687
|
let { setSlotHeight: t } = Cr(), { ref: n, height: r } = L();
|
|
664
|
-
return
|
|
688
|
+
return f(() => (t(e, r), () => t(e, "unset")), [
|
|
665
689
|
e,
|
|
666
690
|
r,
|
|
667
691
|
t
|
|
@@ -671,6 +695,7 @@ function Er({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
|
671
695
|
let a = Tr("prompt");
|
|
672
696
|
return /* @__PURE__ */ z(t ? e : "div", {
|
|
673
697
|
ref: a,
|
|
698
|
+
"data-slot": "chat-container-prompt",
|
|
674
699
|
"data-testid": "chat-container-prompt",
|
|
675
700
|
className: I("shrink-0", r),
|
|
676
701
|
...i,
|
|
@@ -681,6 +706,7 @@ function Dr({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
|
681
706
|
let a = Tr("welcome");
|
|
682
707
|
return /* @__PURE__ */ z(t ? e : "div", {
|
|
683
708
|
ref: a,
|
|
709
|
+
"data-slot": "chat-container-welcome",
|
|
684
710
|
"data-testid": "chat-container-welcome",
|
|
685
711
|
className: I("shrink-0", r),
|
|
686
712
|
...i,
|
|
@@ -690,7 +716,7 @@ function Dr({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
|
690
716
|
//#endregion
|
|
691
717
|
//#region src/components/chat-input/plugins/auto-focus-plugin.tsx
|
|
692
718
|
function Or({ defaultSelection: e = "rootEnd", autoFocus: t, isDisabled: n }) {
|
|
693
|
-
let [r] =
|
|
719
|
+
let [r] = Qe();
|
|
694
720
|
return u(() => {
|
|
695
721
|
t && !n && r.focus(() => {
|
|
696
722
|
let e = document.activeElement, t = r.getRootElement();
|
|
@@ -705,44 +731,44 @@ function Or({ defaultSelection: e = "rootEnd", autoFocus: t, isDisabled: n }) {
|
|
|
705
731
|
}
|
|
706
732
|
//#endregion
|
|
707
733
|
//#region src/components/chat-input/transformers.ts
|
|
708
|
-
var kr =
|
|
734
|
+
var kr = tt, Ar = tt;
|
|
709
735
|
//#endregion
|
|
710
736
|
//#region src/components/chat-input/plugins/hooks.ts
|
|
711
737
|
function jr() {
|
|
712
|
-
let [e] =
|
|
738
|
+
let [e] = Qe();
|
|
713
739
|
return e;
|
|
714
740
|
}
|
|
715
741
|
//#endregion
|
|
716
742
|
//#region src/components/chat-input/plugins/utils.ts
|
|
717
743
|
function Mr() {
|
|
718
|
-
return
|
|
744
|
+
return G().getTextContent();
|
|
719
745
|
}
|
|
720
746
|
function Nr() {
|
|
721
|
-
let e =
|
|
722
|
-
if (e &&
|
|
723
|
-
let t =
|
|
724
|
-
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"),
|
|
747
|
+
let e = G().getLastDescendant();
|
|
748
|
+
if (e && J(e)) {
|
|
749
|
+
let t = it(), n = e.getTextContentSize();
|
|
750
|
+
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"), dt(t);
|
|
725
751
|
} else {
|
|
726
|
-
|
|
727
|
-
let e =
|
|
728
|
-
if (
|
|
729
|
-
let t = e.focus.getNode(), n =
|
|
730
|
-
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type),
|
|
752
|
+
ut();
|
|
753
|
+
let e = K();
|
|
754
|
+
if (q(e)) {
|
|
755
|
+
let t = e.focus.getNode(), n = J(t) ? t.getTextContentSize() : 0;
|
|
756
|
+
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type), dt(e);
|
|
731
757
|
}
|
|
732
758
|
}
|
|
733
759
|
}
|
|
734
760
|
//#endregion
|
|
735
761
|
//#region src/components/chat-input/plugins/controlled-value-plugin.tsx
|
|
736
762
|
function Pr({ value: e }) {
|
|
737
|
-
let t = jr(), n =
|
|
763
|
+
let t = jr(), n = m();
|
|
738
764
|
return u(() => {
|
|
739
765
|
if (!t || e === n.current) return;
|
|
740
766
|
n.current = e;
|
|
741
767
|
let r = "";
|
|
742
768
|
t.getEditorState().read(() => {
|
|
743
|
-
r =
|
|
769
|
+
r = et(kr);
|
|
744
770
|
}), e !== void 0 && e !== r && t.update(() => {
|
|
745
|
-
|
|
771
|
+
W(St), $e(e ?? "", Ar), Nr();
|
|
746
772
|
}, { discrete: !0 });
|
|
747
773
|
}, [t, e]), null;
|
|
748
774
|
}
|
|
@@ -790,7 +816,7 @@ function Rr(e, t, n) {
|
|
|
790
816
|
n.current !== r && (n.current = r, t?.(r));
|
|
791
817
|
}
|
|
792
818
|
function zr({ onHasValueChange: e }) {
|
|
793
|
-
let t = jr(), n =
|
|
819
|
+
let t = jr(), n = m();
|
|
794
820
|
return u(() => {
|
|
795
821
|
if (t) return Rr(t, e, n), t.registerUpdateListener(() => {
|
|
796
822
|
Rr(t, e, n);
|
|
@@ -801,23 +827,23 @@ function zr({ onHasValueChange: e }) {
|
|
|
801
827
|
//#region src/components/chat-input/plugins/markdown-plain-paste-plugin.tsx
|
|
802
828
|
function Br() {
|
|
803
829
|
let e = jr();
|
|
804
|
-
return u(() => e.registerCommand(
|
|
830
|
+
return u(() => e.registerCommand(bt, (t) => {
|
|
805
831
|
let { clipboardData: n } = t;
|
|
806
832
|
if (!n) return !1;
|
|
807
833
|
let r = n.getData("text/plain");
|
|
808
834
|
return r ? (t.preventDefault(), e.update(() => {
|
|
809
|
-
let e =
|
|
810
|
-
if (
|
|
835
|
+
let e = K();
|
|
836
|
+
if (q(e)) {
|
|
811
837
|
e.insertText(r);
|
|
812
838
|
return;
|
|
813
839
|
}
|
|
814
|
-
let t =
|
|
840
|
+
let t = G();
|
|
815
841
|
t.clear(), r.split(/\r?\n/).forEach((e) => {
|
|
816
|
-
let n =
|
|
817
|
-
e.length > 0 && n.append(
|
|
842
|
+
let n = rt();
|
|
843
|
+
e.length > 0 && n.append(at(e)), t.append(n);
|
|
818
844
|
});
|
|
819
845
|
}), !0) : !1;
|
|
820
|
-
},
|
|
846
|
+
}, pt), [e]), null;
|
|
821
847
|
}
|
|
822
848
|
//#endregion
|
|
823
849
|
//#region src/components/chat-input/plugins/value-plugin.tsx
|
|
@@ -825,13 +851,13 @@ function Vr({ onChange: e }) {
|
|
|
825
851
|
let t = c((t, n, r) => {
|
|
826
852
|
if (!r.has("focus") && e) try {
|
|
827
853
|
t.read(() => {
|
|
828
|
-
e(
|
|
854
|
+
e(et(kr));
|
|
829
855
|
});
|
|
830
856
|
} catch (e) {
|
|
831
857
|
console.error("ValuePlugin error:", e);
|
|
832
858
|
}
|
|
833
859
|
}, [e]);
|
|
834
|
-
return /* @__PURE__ */ z(
|
|
860
|
+
return /* @__PURE__ */ z(Ot, { onChange: t });
|
|
835
861
|
}
|
|
836
862
|
//#endregion
|
|
837
863
|
//#region src/components/chat-input/chat-input.tsx
|
|
@@ -845,12 +871,12 @@ var Wr = {
|
|
|
845
871
|
namespace: "chat-input",
|
|
846
872
|
editable: !0,
|
|
847
873
|
nodes: [
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
874
|
+
Xe,
|
|
875
|
+
Ze,
|
|
876
|
+
Ue,
|
|
877
|
+
He,
|
|
878
|
+
Ie,
|
|
879
|
+
Re
|
|
854
880
|
],
|
|
855
881
|
theme: {
|
|
856
882
|
paragraph: "m-0 min-h-[26px]",
|
|
@@ -864,7 +890,7 @@ var Wr = {
|
|
|
864
890
|
console.error("ChatInput Lexical error:", e);
|
|
865
891
|
}
|
|
866
892
|
}, Gr = a(function({ className: e, children: t, initialConfig: n = Wr, ...r }, i) {
|
|
867
|
-
let [a, o] =
|
|
893
|
+
let [a, o] = h(!1), [s, c] = h(!1), [l, u] = h(!1), d = p(() => ({
|
|
868
894
|
hasError: a,
|
|
869
895
|
hasValue: s,
|
|
870
896
|
isFocused: l,
|
|
@@ -878,10 +904,11 @@ var Wr = {
|
|
|
878
904
|
]);
|
|
879
905
|
return /* @__PURE__ */ z(Hr.Provider, {
|
|
880
906
|
value: d,
|
|
881
|
-
children: /* @__PURE__ */ z(
|
|
907
|
+
children: /* @__PURE__ */ z(We, {
|
|
882
908
|
initialConfig: n,
|
|
883
909
|
children: /* @__PURE__ */ z("div", {
|
|
884
910
|
ref: i,
|
|
911
|
+
"data-slot": "chat-input",
|
|
885
912
|
"data-testid": "chat-input",
|
|
886
913
|
"data-focused": l,
|
|
887
914
|
"data-empty": !s,
|
|
@@ -896,29 +923,36 @@ var Wr = {
|
|
|
896
923
|
});
|
|
897
924
|
Gr.displayName = "ChatInput";
|
|
898
925
|
var Kr = a(function({ className: e, children: t, ...n }, r) {
|
|
899
|
-
return /* @__PURE__ */ z(
|
|
926
|
+
return /* @__PURE__ */ z(F, {
|
|
900
927
|
ref: r,
|
|
901
928
|
variant: "body",
|
|
902
929
|
className: I("pointer-events-none absolute inset-0 z-0", "min-h-[26px]", "text-text-tertiary", e),
|
|
930
|
+
asChild: !0,
|
|
903
931
|
...n,
|
|
904
|
-
children:
|
|
932
|
+
children: /* @__PURE__ */ z("p", {
|
|
933
|
+
"data-slot": "chat-input-placeholder",
|
|
934
|
+
children: t
|
|
935
|
+
})
|
|
905
936
|
});
|
|
906
937
|
});
|
|
907
938
|
Kr.displayName = "ChatInputPlaceholder";
|
|
908
939
|
var qr = a(function({ className: e, style: t, placeholderClassName: n, placeholder: r = "Input your message...", children: i, value: a, autoFocus: o = !0, isDisabled: s = !1, isReadOnly: c = !1, onChange: l, onKeyDown: u, ...d }, f) {
|
|
909
|
-
let { setHasValue: p, setIsFocused: m } = Ur();
|
|
940
|
+
let { setHasValue: p, setIsFocused: m } = Ur(), h = c && !s;
|
|
910
941
|
return /* @__PURE__ */ B("div", {
|
|
942
|
+
"data-slot": "chat-input-textarea",
|
|
911
943
|
"data-testid": "chat-input-textarea",
|
|
912
944
|
"data-disabled": s,
|
|
945
|
+
"data-readonly": h,
|
|
913
946
|
"aria-disabled": s,
|
|
914
|
-
"aria-readonly":
|
|
947
|
+
"aria-readonly": h,
|
|
915
948
|
className: I("group/chat-input-textarea", "relative", "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-80 data-[disabled=true]:select-none", "data-[readonly=true]:text-text-secondary"),
|
|
916
949
|
style: t,
|
|
917
950
|
...d,
|
|
918
951
|
children: [
|
|
919
|
-
/* @__PURE__ */ z(
|
|
920
|
-
contentEditable: /* @__PURE__ */ z(
|
|
952
|
+
/* @__PURE__ */ z(Je, {
|
|
953
|
+
contentEditable: /* @__PURE__ */ z(Ge, {
|
|
921
954
|
ref: f,
|
|
955
|
+
"data-slot": "chat-input-editable",
|
|
922
956
|
className: I("min-h-[26px]!", "overflow-y-auto text-wrap outline-none", e),
|
|
923
957
|
"aria-label": "Chat input",
|
|
924
958
|
"aria-placeholder": r,
|
|
@@ -928,9 +962,9 @@ var qr = a(function({ className: e, style: t, placeholderClassName: n, placehold
|
|
|
928
962
|
}),
|
|
929
963
|
onKeyDown: u
|
|
930
964
|
}),
|
|
931
|
-
ErrorBoundary:
|
|
965
|
+
ErrorBoundary: Ke
|
|
932
966
|
}),
|
|
933
|
-
/* @__PURE__ */ z(
|
|
967
|
+
/* @__PURE__ */ z(qe, {}),
|
|
934
968
|
/* @__PURE__ */ z(Fr, {
|
|
935
969
|
isDisabled: s,
|
|
936
970
|
isReadOnly: c
|
|
@@ -958,11 +992,11 @@ function Yr() {
|
|
|
958
992
|
return e;
|
|
959
993
|
}
|
|
960
994
|
function Xr({ children: e, className: t, loadedCount: n, totalCount: r, hasMore: i, isLoading: a = !1, isLoadingMore: o = !1, hasError: s = !1, onLoadMore: l, getItemKey: u, "aria-label": d = "Chat list" }) {
|
|
961
|
-
let f =
|
|
995
|
+
let f = m(null), g = m(null), [_, v] = h(0), [y, b] = h(null), [, x] = h(0), S = c((e) => {
|
|
962
996
|
f.current = e, x((e) => e + 1);
|
|
963
997
|
}, []), C = c(() => {
|
|
964
998
|
v((e) => e + 1);
|
|
965
|
-
}, []), w = i ?? (r != null && n < r), T = n === 0 && !a && !s, E =
|
|
999
|
+
}, []), w = i ?? (r != null && n < r), T = n === 0 && !a && !s, E = p(() => ({
|
|
966
1000
|
loadedCount: n,
|
|
967
1001
|
totalCount: r,
|
|
968
1002
|
hasMore: w,
|
|
@@ -974,7 +1008,7 @@ function Xr({ children: e, className: t, loadedCount: n, totalCount: r, hasMore:
|
|
|
974
1008
|
getItemKey: u,
|
|
975
1009
|
scrollElementRef: f,
|
|
976
1010
|
setScrollElement: S,
|
|
977
|
-
loadMoreContentRef:
|
|
1011
|
+
loadMoreContentRef: g,
|
|
978
1012
|
loadMoreVersion: _,
|
|
979
1013
|
bumpLoadMore: C,
|
|
980
1014
|
skeletonContainer: y,
|
|
@@ -1011,9 +1045,9 @@ function Xr({ children: e, className: t, loadedCount: n, totalCount: r, hasMore:
|
|
|
1011
1045
|
});
|
|
1012
1046
|
}
|
|
1013
1047
|
var Zr = ["w-2/3", "w-1/2"], Qr = ["w-full", "w-4/5"];
|
|
1014
|
-
function $r({ children: e, rows: t = 16, className: n }) {
|
|
1015
|
-
let { isLoading:
|
|
1016
|
-
return !(
|
|
1048
|
+
function $r({ children: e, rows: t = 16, className: n, rowClassName: r }) {
|
|
1049
|
+
let { isLoading: i, loadedCount: a, skeletonContainer: o } = Yr();
|
|
1050
|
+
return !(i && a === 0) || !o ? null : kt(/* @__PURE__ */ z("div", {
|
|
1017
1051
|
"data-slot": "chat-list-skeleton",
|
|
1018
1052
|
"data-testid": "chat-list-skeleton",
|
|
1019
1053
|
role: "status",
|
|
@@ -1022,16 +1056,16 @@ function $r({ children: e, rows: t = 16, className: n }) {
|
|
|
1022
1056
|
className: I("flex min-h-0 flex-1 flex-col gap-4 overflow-hidden", n),
|
|
1023
1057
|
children: e ?? Array.from({ length: t }, (e, t) => /* @__PURE__ */ B("div", {
|
|
1024
1058
|
"data-slot": "chat-list-skeleton-row",
|
|
1025
|
-
className: "flex shrink-0 flex-col gap-4 px-12 py-8",
|
|
1059
|
+
className: I("flex shrink-0 flex-col gap-4 px-12 py-8", r),
|
|
1026
1060
|
children: [/* @__PURE__ */ z("div", {
|
|
1027
1061
|
className: "flex h-20 items-center",
|
|
1028
|
-
children: /* @__PURE__ */ z(
|
|
1062
|
+
children: /* @__PURE__ */ z(ce, { className: I("h-12", Zr[t % 2]) })
|
|
1029
1063
|
}), /* @__PURE__ */ z("div", {
|
|
1030
1064
|
className: "flex h-16 items-center",
|
|
1031
|
-
children: /* @__PURE__ */ z(
|
|
1065
|
+
children: /* @__PURE__ */ z(ce, { className: I("h-10", Qr[t % 2]) })
|
|
1032
1066
|
})]
|
|
1033
1067
|
}, t))
|
|
1034
|
-
}),
|
|
1068
|
+
}), o);
|
|
1035
1069
|
}
|
|
1036
1070
|
function ei({ children: e, className: t }) {
|
|
1037
1071
|
let { isEmpty: n } = Yr();
|
|
@@ -1045,9 +1079,9 @@ function ei({ children: e, className: t }) {
|
|
|
1045
1079
|
children: e
|
|
1046
1080
|
}) : null;
|
|
1047
1081
|
}
|
|
1048
|
-
function ti({ children: e, error: t, className: n }) {
|
|
1049
|
-
let { hasError:
|
|
1050
|
-
return
|
|
1082
|
+
function ti({ children: e, error: t, className: n, messageClassName: r }) {
|
|
1083
|
+
let { hasError: i, loadedCount: a } = Yr();
|
|
1084
|
+
return i && a === 0 ? /* @__PURE__ */ z("div", {
|
|
1051
1085
|
"data-slot": "chat-list-error",
|
|
1052
1086
|
"data-testid": "chat-list-error",
|
|
1053
1087
|
role: "alert",
|
|
@@ -1055,62 +1089,67 @@ function ti({ children: e, error: t, className: n }) {
|
|
|
1055
1089
|
"aria-label": "Error loading chats",
|
|
1056
1090
|
className: I("flex flex-1 items-center justify-center", n),
|
|
1057
1091
|
children: e || /* @__PURE__ */ z("div", {
|
|
1058
|
-
|
|
1092
|
+
"data-slot": "chat-list-error-message",
|
|
1093
|
+
className: I("text-text-error-main", r),
|
|
1059
1094
|
children: t instanceof Error ? t.message : t || "An error occurred"
|
|
1060
1095
|
})
|
|
1061
1096
|
}) : null;
|
|
1062
1097
|
}
|
|
1063
1098
|
function ni({ children: e }) {
|
|
1064
1099
|
let { loadMoreContentRef: t, bumpLoadMore: n } = Yr();
|
|
1065
|
-
return t.current = e ?? null,
|
|
1100
|
+
return t.current = e ?? null, f(() => (n(), () => {
|
|
1066
1101
|
t.current = null, n();
|
|
1067
1102
|
}), [n, t]), null;
|
|
1068
1103
|
}
|
|
1069
1104
|
//#endregion
|
|
1070
1105
|
//#region src/components/chat-list/chat-list-items.tsx
|
|
1071
|
-
var ri = "chat-list-load-more", ii = s(function({ children: e, className: t, listClassName: n,
|
|
1072
|
-
let { loadedCount:
|
|
1073
|
-
count:
|
|
1074
|
-
getScrollElement: () =>
|
|
1075
|
-
estimateSize: () =>
|
|
1076
|
-
overscan:
|
|
1077
|
-
gap:
|
|
1078
|
-
getItemKey:
|
|
1079
|
-
}),
|
|
1106
|
+
var ri = "chat-list-load-more", ii = s(function({ children: e, className: t, listClassName: n, rowClassName: r, estimateSize: i = 54, overscan: a = 6, gap: o = 4 }) {
|
|
1107
|
+
let { loadedCount: s, hasMore: l, isLoading: d, isLoadingMore: f, onLoadMore: p, getItemKey: m, scrollElementRef: h, setScrollElement: g, loadMoreContentRef: _, loadMoreVersion: v, setSkeletonContainer: y } = Yr(), b = v >= 0 ? _.current : null, x = d && s === 0, S = l ? s + 1 : s, C = c((e) => e >= s ? ri : m(e), [m, s]), w = At({
|
|
1108
|
+
count: x ? 0 : S,
|
|
1109
|
+
getScrollElement: () => h.current,
|
|
1110
|
+
estimateSize: () => i,
|
|
1111
|
+
overscan: a,
|
|
1112
|
+
gap: o,
|
|
1113
|
+
getItemKey: C
|
|
1114
|
+
}), T = w.getVirtualItems();
|
|
1080
1115
|
return u(() => {
|
|
1081
|
-
if (
|
|
1082
|
-
let [e] = [...
|
|
1083
|
-
e && e.index >=
|
|
1116
|
+
if (x) return;
|
|
1117
|
+
let [e] = [...T].reverse();
|
|
1118
|
+
e && e.index >= s - 1 && l && !f && p?.();
|
|
1084
1119
|
}, [
|
|
1085
|
-
|
|
1086
|
-
o,
|
|
1120
|
+
T,
|
|
1087
1121
|
s,
|
|
1088
|
-
|
|
1122
|
+
l,
|
|
1089
1123
|
f,
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1124
|
+
p,
|
|
1125
|
+
x
|
|
1126
|
+
]), x ? /* @__PURE__ */ z("div", {
|
|
1127
|
+
ref: y,
|
|
1093
1128
|
"data-slot": "chat-list-items",
|
|
1094
1129
|
"data-testid": "chat-list-items",
|
|
1095
1130
|
className: I("flex min-h-0 flex-1 flex-col overflow-hidden", t)
|
|
1096
|
-
}) : /* @__PURE__ */ z(
|
|
1097
|
-
ref:
|
|
1131
|
+
}) : /* @__PURE__ */ z(oe, {
|
|
1132
|
+
ref: g,
|
|
1098
1133
|
"data-slot": "chat-list-items",
|
|
1099
1134
|
"data-testid": "chat-list-items",
|
|
1100
1135
|
className: I("min-h-0 flex-1", "overflow-auto", t),
|
|
1101
1136
|
children: /* @__PURE__ */ z("ul", {
|
|
1137
|
+
"data-slot": "chat-list-items-list",
|
|
1102
1138
|
role: "list",
|
|
1103
1139
|
"aria-label": "Chats",
|
|
1104
1140
|
className: I("table relative w-full transform-gpu table-fixed", "space-y-[4px]", n),
|
|
1105
|
-
style: { height: `${
|
|
1106
|
-
children:
|
|
1107
|
-
let n = t.index >=
|
|
1141
|
+
style: { height: `${w.getTotalSize()}px` },
|
|
1142
|
+
children: T.map((t) => {
|
|
1143
|
+
let n = t.index >= s;
|
|
1108
1144
|
return /* @__PURE__ */ z("li", {
|
|
1145
|
+
"data-slot": "chat-list-items-row",
|
|
1109
1146
|
"data-index": t.index,
|
|
1110
|
-
|
|
1147
|
+
"data-load-more": n,
|
|
1148
|
+
ref: w.measureElement,
|
|
1111
1149
|
role: n ? "status" : "listitem",
|
|
1112
1150
|
"aria-live": n ? "polite" : void 0,
|
|
1113
|
-
"aria-busy": n ?
|
|
1151
|
+
"aria-busy": n ? f : void 0,
|
|
1152
|
+
className: r,
|
|
1114
1153
|
style: {
|
|
1115
1154
|
position: "absolute",
|
|
1116
1155
|
top: 0,
|
|
@@ -1118,7 +1157,7 @@ var ri = "chat-list-load-more", ii = s(function({ children: e, className: t, lis
|
|
|
1118
1157
|
width: "100%",
|
|
1119
1158
|
transform: `translateY(${t.start}px)`
|
|
1120
1159
|
},
|
|
1121
|
-
children: n ?
|
|
1160
|
+
children: n ? b : e(t.index)
|
|
1122
1161
|
}, t.key);
|
|
1123
1162
|
})
|
|
1124
1163
|
})
|
|
@@ -1145,13 +1184,13 @@ function si() {
|
|
|
1145
1184
|
return e;
|
|
1146
1185
|
}
|
|
1147
1186
|
function ci({ children: e, reportInputHeight: t, resetCompact: n }) {
|
|
1148
|
-
let r =
|
|
1187
|
+
let r = m(null), i = c((e) => {
|
|
1149
1188
|
r.current = e;
|
|
1150
1189
|
}, []), a = c(() => {
|
|
1151
1190
|
r.current = null;
|
|
1152
1191
|
}, []), o = c(() => {
|
|
1153
1192
|
r.current?.();
|
|
1154
|
-
}, []), s =
|
|
1193
|
+
}, []), s = p(() => ({
|
|
1155
1194
|
reportInputHeight: t,
|
|
1156
1195
|
resetCompact: n,
|
|
1157
1196
|
registerFocusInput: i,
|
|
@@ -1190,7 +1229,7 @@ function fi(e) {
|
|
|
1190
1229
|
return e instanceof HTMLElement && !!e.closest(di);
|
|
1191
1230
|
}
|
|
1192
1231
|
var pi = a(function(e, t) {
|
|
1193
|
-
let [n, r] =
|
|
1232
|
+
let [n, r] = h(!0), i = c((e) => {
|
|
1194
1233
|
e > ui && r(!1);
|
|
1195
1234
|
}, []), a = c(() => {
|
|
1196
1235
|
r(!0);
|
|
@@ -1206,29 +1245,34 @@ var pi = a(function(e, t) {
|
|
|
1206
1245
|
});
|
|
1207
1246
|
});
|
|
1208
1247
|
pi.displayName = "ChatPromptBox";
|
|
1209
|
-
var mi = a(function({ className: e,
|
|
1210
|
-
let { focusInput:
|
|
1211
|
-
fi(e.target) ||
|
|
1212
|
-
}, [
|
|
1248
|
+
var mi = a(function({ className: e, innerClassName: t, children: n, onMouseDown: r, ...i }, a) {
|
|
1249
|
+
let { focusInput: o } = si(), s = c((e) => {
|
|
1250
|
+
fi(e.target) || o(), r?.(e);
|
|
1251
|
+
}, [o, r]);
|
|
1213
1252
|
return /* @__PURE__ */ B(Gr, {
|
|
1214
|
-
ref:
|
|
1253
|
+
ref: a,
|
|
1254
|
+
"data-slot": "chat-prompt-box",
|
|
1215
1255
|
className: I("group/chat-prompt-box", "relative overflow-hidden", "cursor-text", "p-px", "rounded-[16px]", "bg-transparent", "hover:bg-promptbox-background-border-base", "data-[focused=true]:bg-promptbox-background-border-base", e),
|
|
1216
|
-
onMouseDown:
|
|
1217
|
-
...
|
|
1256
|
+
onMouseDown: s,
|
|
1257
|
+
...i,
|
|
1218
1258
|
children: [/* @__PURE__ */ z("div", {
|
|
1219
|
-
|
|
1259
|
+
"data-slot": "chat-prompt-box-inner",
|
|
1260
|
+
className: I("rounded-[15px]", "p-[4px]", "bg-[#171A20]", "group-hover/chat-prompt-box:bg-[#252931]", "group-data-[focused=true]/chat-prompt-box:bg-[linear-gradient(var(--color-promptbox-background-hover),var(--color-promptbox-background-hover)),var(--color-promptbox-background-base)]", "group-data-[focused=true]/chat-prompt-box:group-hover/chat-prompt-box:bg-[linear-gradient(var(--color-promptbox-background-hover),var(--color-promptbox-background-hover)),var(--color-promptbox-background-base)]", t),
|
|
1220
1261
|
children: n
|
|
1221
1262
|
}), /* @__PURE__ */ z(hi, {})]
|
|
1222
1263
|
});
|
|
1223
1264
|
});
|
|
1265
|
+
mi.displayName = "ChatPromptBoxContainer";
|
|
1224
1266
|
function hi() {
|
|
1225
1267
|
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", {
|
|
1268
|
+
"data-slot": "chat-prompt-box-glow-top",
|
|
1226
1269
|
className: I("absolute left-1/2 top-[-40px]", "translate-x-[-50%]", "pointer-events-none", "w-[380px] h-[72px]", "opacity-0 group-data-[focused=true]/chat-prompt-box:opacity-50"),
|
|
1227
1270
|
style: {
|
|
1228
1271
|
borderRadius: "380px",
|
|
1229
1272
|
background: "gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.00) 100%)"
|
|
1230
1273
|
}
|
|
1231
1274
|
}), /* @__PURE__ */ z("div", {
|
|
1275
|
+
"data-slot": "chat-prompt-box-glow-bottom",
|
|
1232
1276
|
className: I("absolute left-1/2 -bottom-22", "translate-x-[-50%]", "pointer-events-none", "w-[1082px] h-[172px]", "opacity-0 group-data-[focused=true]/chat-prompt-box:opacity-5"),
|
|
1233
1277
|
style: {
|
|
1234
1278
|
borderRadius: "1082px",
|
|
@@ -1236,79 +1280,91 @@ function hi() {
|
|
|
1236
1280
|
}
|
|
1237
1281
|
})] });
|
|
1238
1282
|
}
|
|
1239
|
-
function gi({
|
|
1283
|
+
function gi({ className: e, children: t, ...n }) {
|
|
1240
1284
|
return /* @__PURE__ */ z("div", {
|
|
1285
|
+
"data-slot": "chat-prompt-box-toolbar",
|
|
1241
1286
|
"data-testid": "chat-prompt-box-toolbar",
|
|
1242
|
-
className: I(
|
|
1243
|
-
|
|
1287
|
+
className: I(e),
|
|
1288
|
+
...n,
|
|
1289
|
+
children: t
|
|
1244
1290
|
});
|
|
1245
1291
|
}
|
|
1246
|
-
function _i({
|
|
1292
|
+
function _i({ className: e, children: t, ...n }) {
|
|
1247
1293
|
return /* @__PURE__ */ z("div", {
|
|
1294
|
+
"data-slot": "chat-prompt-box-content",
|
|
1248
1295
|
"data-testid": "chat-prompt-box-content",
|
|
1249
|
-
className: I("relative", "px-[8px] py-[8px]", "flex flex-row gap-[8px]", "group-data-[compact=false]/chat-prompt-box:pb-[calc(8px+4px+40px)]",
|
|
1250
|
-
|
|
1296
|
+
className: I("relative", "px-[8px] py-[8px]", "flex flex-row gap-[8px]", "group-data-[compact=false]/chat-prompt-box:pb-[calc(8px+4px+40px)]", e),
|
|
1297
|
+
...n,
|
|
1298
|
+
children: t
|
|
1251
1299
|
});
|
|
1252
1300
|
}
|
|
1253
|
-
var vi = a(function({ className: e,
|
|
1254
|
-
let { reportInputHeight:
|
|
1255
|
-
|
|
1256
|
-
typeof
|
|
1257
|
-
}, [
|
|
1258
|
-
|
|
1259
|
-
}, [
|
|
1260
|
-
|
|
1261
|
-
}, [
|
|
1262
|
-
let
|
|
1263
|
-
|
|
1264
|
-
}, [
|
|
1301
|
+
var vi = a(function({ className: e, textareaClassName: t, placeholderClassName: n, children: r, ...i }, a) {
|
|
1302
|
+
let { reportInputHeight: o, resetCompact: s } = si(), { hasValue: l } = Ur(), { ref: u, height: d } = L();
|
|
1303
|
+
f(() => {
|
|
1304
|
+
typeof d == "number" && o(d);
|
|
1305
|
+
}, [d, o]), f(() => () => {
|
|
1306
|
+
s();
|
|
1307
|
+
}, [s]), f(() => {
|
|
1308
|
+
l || s();
|
|
1309
|
+
}, [l, s]);
|
|
1310
|
+
let p = c((e) => {
|
|
1311
|
+
u(e), typeof a == "function" ? a(e) : a && (a.current = e);
|
|
1312
|
+
}, [u, a]);
|
|
1265
1313
|
return /* @__PURE__ */ z("div", {
|
|
1314
|
+
"data-slot": "chat-prompt-box-input",
|
|
1266
1315
|
"data-testid": "chat-prompt-box-input",
|
|
1267
1316
|
className: I("min-h-[40px]", "inline-flex justify-center items-center", "group-data-[compact=false]/chat-prompt-box:items-start", "group-data-[compact=false]/chat-prompt-box:min-h-[48px]", "order-2 grow min-w-0 flex-1", "[&>div]:flex-1 [&>div]:min-w-0", e),
|
|
1268
|
-
children: /* @__PURE__ */
|
|
1269
|
-
ref:
|
|
1270
|
-
className: "max-h-[72px]!",
|
|
1271
|
-
placeholderClassName: I("leading-[24px]!",
|
|
1272
|
-
...
|
|
1273
|
-
children: /* @__PURE__ */ z(li, {})
|
|
1317
|
+
children: /* @__PURE__ */ B(qr, {
|
|
1318
|
+
ref: p,
|
|
1319
|
+
className: I("max-h-[72px]!", t),
|
|
1320
|
+
placeholderClassName: I("leading-[24px]!", n),
|
|
1321
|
+
...i,
|
|
1322
|
+
children: [/* @__PURE__ */ z(li, {}), r]
|
|
1274
1323
|
})
|
|
1275
1324
|
});
|
|
1276
1325
|
});
|
|
1277
1326
|
vi.displayName = "ChatPromptBoxInput";
|
|
1278
|
-
function yi({
|
|
1327
|
+
function yi({ className: e, children: t, ...n }) {
|
|
1279
1328
|
return /* @__PURE__ */ z("div", {
|
|
1329
|
+
"data-slot": "chat-prompt-box-actions-left",
|
|
1280
1330
|
"data-testid": "chat-prompt-box-actions-left",
|
|
1281
1331
|
role: "group",
|
|
1282
|
-
className: I("order-1 shrink-0", "group-data-[compact=false]/chat-prompt-box:absolute", "group-data-[compact=false]/chat-prompt-box:bottom-[8px]", "group-data-[compact=false]/chat-prompt-box:left-[8px]", "flex items-center gap-[8px]", "[grid-area:left]",
|
|
1283
|
-
|
|
1332
|
+
className: I("order-1 shrink-0", "group-data-[compact=false]/chat-prompt-box:absolute", "group-data-[compact=false]/chat-prompt-box:bottom-[8px]", "group-data-[compact=false]/chat-prompt-box:left-[8px]", "flex items-center gap-[8px]", "[grid-area:left]", e),
|
|
1333
|
+
...n,
|
|
1334
|
+
children: t
|
|
1284
1335
|
});
|
|
1285
1336
|
}
|
|
1286
|
-
function bi({
|
|
1337
|
+
function bi({ className: e, children: t, ...n }) {
|
|
1287
1338
|
return /* @__PURE__ */ z("div", {
|
|
1339
|
+
"data-slot": "chat-prompt-box-actions-right",
|
|
1288
1340
|
"data-testid": "chat-prompt-box-actions-right",
|
|
1289
1341
|
role: "group",
|
|
1290
|
-
className: I("order-3 shrink-0", "group-data-[compact=false]/chat-prompt-box:order-3", "group-data-[compact=false]/chat-prompt-box:absolute", "group-data-[compact=false]/chat-prompt-box:bottom-[8px]", "group-data-[compact=false]/chat-prompt-box:right-[8px]", "flex items-center justify-end gap-[8px]", "[grid-area:right]",
|
|
1291
|
-
|
|
1342
|
+
className: I("order-3 shrink-0", "group-data-[compact=false]/chat-prompt-box:order-3", "group-data-[compact=false]/chat-prompt-box:absolute", "group-data-[compact=false]/chat-prompt-box:bottom-[8px]", "group-data-[compact=false]/chat-prompt-box:right-[8px]", "flex items-center justify-end gap-[8px]", "[grid-area:right]", e),
|
|
1343
|
+
...n,
|
|
1344
|
+
children: t
|
|
1292
1345
|
});
|
|
1293
1346
|
}
|
|
1294
1347
|
//#endregion
|
|
1295
1348
|
//#region src/components/chat-message/chat-message.tsx
|
|
1296
1349
|
function xi({ children: e, className: t, isQuestion: n }) {
|
|
1297
1350
|
return /* @__PURE__ */ z("div", {
|
|
1351
|
+
"data-slot": "chat-message",
|
|
1298
1352
|
"data-question": n,
|
|
1299
1353
|
className: I("group/message", "flex flex-col", "data-[question=true]:items-end", "gap-8", t),
|
|
1300
1354
|
children: e
|
|
1301
1355
|
});
|
|
1302
1356
|
}
|
|
1303
|
-
function Si({ children: e }) {
|
|
1357
|
+
function Si({ children: e, className: t }) {
|
|
1304
1358
|
return /* @__PURE__ */ z("div", {
|
|
1359
|
+
"data-slot": "chat-message-content",
|
|
1305
1360
|
"data-bubble": !0,
|
|
1306
|
-
className: I("w-fit", "min-w-message-mobile-min md:min-w-auto", "group-data-[question=true]/message:data-[bubble=true]:p-16", "group-data-[question=true]/message:data-[bubble=true]:rounded-[20px]", "group-data-[question=true]/message:data-[bubble=true]:bg-[#22283499]"),
|
|
1361
|
+
className: I("w-fit", "min-w-message-mobile-min md:min-w-auto", "group-data-[question=true]/message:data-[bubble=true]:p-16", "group-data-[question=true]/message:data-[bubble=true]:rounded-[20px]", "group-data-[question=true]/message:data-[bubble=true]:bg-[#22283499]", t),
|
|
1307
1362
|
children: e
|
|
1308
1363
|
});
|
|
1309
1364
|
}
|
|
1310
1365
|
function Ci({ children: e, className: t }) {
|
|
1311
1366
|
return /* @__PURE__ */ z("div", {
|
|
1367
|
+
"data-slot": "chat-message-actions",
|
|
1312
1368
|
className: I("transition-opacity duration-300", "md:opacity-0 group-hover/message:opacity-100", t),
|
|
1313
1369
|
children: e
|
|
1314
1370
|
});
|
|
@@ -1316,7 +1372,7 @@ function Ci({ children: e, className: t }) {
|
|
|
1316
1372
|
//#endregion
|
|
1317
1373
|
//#region src/contexts/chat-context/utils.ts
|
|
1318
1374
|
function wi() {
|
|
1319
|
-
return `__${
|
|
1375
|
+
return `__${Mt()}__`;
|
|
1320
1376
|
}
|
|
1321
1377
|
//#endregion
|
|
1322
1378
|
//#region src/contexts/chat-context/chat-context.tsx
|
|
@@ -1327,22 +1383,22 @@ function X() {
|
|
|
1327
1383
|
return e;
|
|
1328
1384
|
}
|
|
1329
1385
|
function Ei({ children: e, chatId: t }) {
|
|
1330
|
-
let [n, r] =
|
|
1386
|
+
let [n, r] = h(wi()), [i, a] = h(void 0), o = m(/* @__PURE__ */ new Set()), s = t || n, l = s === n, d = c(() => {
|
|
1331
1387
|
let e = wi();
|
|
1332
1388
|
return r(e), e;
|
|
1333
1389
|
}, [r]), f = c((e) => {
|
|
1334
1390
|
a(e);
|
|
1335
|
-
}, []),
|
|
1391
|
+
}, []), g = c(() => {
|
|
1336
1392
|
a(void 0);
|
|
1337
1393
|
}, []);
|
|
1338
1394
|
u(function() {
|
|
1339
|
-
|
|
1395
|
+
g();
|
|
1340
1396
|
}, [
|
|
1341
1397
|
s,
|
|
1342
1398
|
n,
|
|
1343
|
-
|
|
1399
|
+
g
|
|
1344
1400
|
]);
|
|
1345
|
-
let _ =
|
|
1401
|
+
let _ = p(() => ({
|
|
1346
1402
|
newChatId: n,
|
|
1347
1403
|
chatId: s,
|
|
1348
1404
|
loadedChatIdsRef: o,
|
|
@@ -1350,7 +1406,7 @@ function Ei({ children: e, chatId: t }) {
|
|
|
1350
1406
|
goToNewChat: d,
|
|
1351
1407
|
promptPlaceholder: i,
|
|
1352
1408
|
setPromptPlaceholder: f,
|
|
1353
|
-
clearPromptPlaceholder:
|
|
1409
|
+
clearPromptPlaceholder: g
|
|
1354
1410
|
}), [
|
|
1355
1411
|
s,
|
|
1356
1412
|
o,
|
|
@@ -1359,7 +1415,7 @@ function Ei({ children: e, chatId: t }) {
|
|
|
1359
1415
|
d,
|
|
1360
1416
|
i,
|
|
1361
1417
|
f,
|
|
1362
|
-
|
|
1418
|
+
g
|
|
1363
1419
|
]);
|
|
1364
1420
|
return /* @__PURE__ */ z(Ti.Provider, {
|
|
1365
1421
|
value: _,
|
|
@@ -1375,14 +1431,14 @@ function Ai() {
|
|
|
1375
1431
|
return e;
|
|
1376
1432
|
}
|
|
1377
1433
|
function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
1378
|
-
let [r, i] =
|
|
1434
|
+
let [r, i] = h(!0), [a, o] = h({
|
|
1379
1435
|
isAtBottom: !0,
|
|
1380
1436
|
isSmoothScroll: !1,
|
|
1381
1437
|
hasUserEscaped: !1,
|
|
1382
1438
|
isProgrammaticScroll: !1,
|
|
1383
1439
|
userScrollIntent: !1,
|
|
1384
1440
|
scrollStrategy: "lastItem"
|
|
1385
|
-
}), s =
|
|
1441
|
+
}), s = m(null), l = m(null), u = m(null), d = m(null), f = m(null), g = m(null), _ = m(0), v = m(!0), y = m(!1), b = m(!1), x = m(!1), S = m(!1), C = m(null), w = m(null), T = m("lastItem"), E = m(0), D = m(() => {}), ee = m(() => {}), te = m(() => {}), O = m(() => {});
|
|
1386
1442
|
O.current = c(() => {
|
|
1387
1443
|
n && o({
|
|
1388
1444
|
isAtBottom: v.current,
|
|
@@ -1396,12 +1452,12 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1396
1452
|
let k = c(() => {
|
|
1397
1453
|
d.current?.disconnect(), d.current = null;
|
|
1398
1454
|
}, []);
|
|
1399
|
-
|
|
1455
|
+
te.current = k;
|
|
1400
1456
|
let A = c(() => {
|
|
1401
|
-
|
|
1457
|
+
g.current?.disconnect(), g.current = null;
|
|
1402
1458
|
}, []), ne = c(() => {
|
|
1403
1459
|
f.current?.disconnect(), f.current = null;
|
|
1404
|
-
}, []), re =
|
|
1460
|
+
}, []), re = m(() => {}), j = c(() => {
|
|
1405
1461
|
requestAnimationFrame(() => {
|
|
1406
1462
|
requestAnimationFrame(() => {
|
|
1407
1463
|
x.current = !1, re.current(), O.current();
|
|
@@ -1414,10 +1470,10 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1414
1470
|
C.current = null, S.current = !1, O.current();
|
|
1415
1471
|
}, Oi), O.current();
|
|
1416
1472
|
}, []), ae = c(() => {
|
|
1417
|
-
T.current = "lastItem",
|
|
1473
|
+
T.current = "lastItem", te.current(), O.current();
|
|
1418
1474
|
}, []), N = c((e) => {
|
|
1419
1475
|
b.current !== e && (b.current = e, e && re.current(), O.current());
|
|
1420
|
-
}, []),
|
|
1476
|
+
}, []), oe = c(() => {
|
|
1421
1477
|
if (b.current) return;
|
|
1422
1478
|
x.current = !0, O.current();
|
|
1423
1479
|
let e = y.current ? "smooth" : "instant";
|
|
@@ -1436,8 +1492,8 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1436
1492
|
}), j(), O.current();
|
|
1437
1493
|
});
|
|
1438
1494
|
}, [j]);
|
|
1439
|
-
|
|
1440
|
-
let
|
|
1495
|
+
D.current = oe;
|
|
1496
|
+
let se = c(() => {
|
|
1441
1497
|
let e = s.current;
|
|
1442
1498
|
if (!e) return;
|
|
1443
1499
|
let t = e.scrollHeight;
|
|
@@ -1447,14 +1503,14 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1447
1503
|
behavior: "instant"
|
|
1448
1504
|
}), E.current = e.scrollHeight, j(), O.current();
|
|
1449
1505
|
}));
|
|
1450
|
-
}, [j]),
|
|
1506
|
+
}, [j]), ce = c(() => {
|
|
1451
1507
|
let e = s.current;
|
|
1452
1508
|
if (!e) return;
|
|
1453
1509
|
let t = e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
|
|
1454
|
-
(t || b.current) && (v.current = t, i(t), T.current === "end" && t &&
|
|
1455
|
-
}, [
|
|
1456
|
-
re.current =
|
|
1457
|
-
let
|
|
1510
|
+
(t || b.current) && (v.current = t, i(t), T.current === "end" && t && se(), O.current());
|
|
1511
|
+
}, [se]);
|
|
1512
|
+
re.current = ce;
|
|
1513
|
+
let P = c(() => {
|
|
1458
1514
|
ne();
|
|
1459
1515
|
let e = s.current;
|
|
1460
1516
|
if (!e) return;
|
|
@@ -1462,20 +1518,20 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1462
1518
|
re.current();
|
|
1463
1519
|
});
|
|
1464
1520
|
t.observe(e), f.current = t;
|
|
1465
|
-
}, [ne]),
|
|
1521
|
+
}, [ne]), F = c((e) => {
|
|
1466
1522
|
if (k(), T.current !== "end") return;
|
|
1467
1523
|
let t = new ResizeObserver(() => {
|
|
1468
|
-
T.current === "end" &&
|
|
1524
|
+
T.current === "end" && se();
|
|
1469
1525
|
});
|
|
1470
1526
|
t.observe(e), d.current = t;
|
|
1471
|
-
}, [k,
|
|
1472
|
-
|
|
1473
|
-
let
|
|
1527
|
+
}, [k, se]);
|
|
1528
|
+
ee.current = F;
|
|
1529
|
+
let le = c(() => {
|
|
1474
1530
|
if (!S.current || T.current === "end") return;
|
|
1475
1531
|
T.current = "end", ie();
|
|
1476
1532
|
let e = u.current;
|
|
1477
|
-
e &&
|
|
1478
|
-
}, [ie]),
|
|
1533
|
+
e && ee.current(e), O.current();
|
|
1534
|
+
}, [ie]), ue = c((e) => {
|
|
1479
1535
|
if (!e && !b.current) {
|
|
1480
1536
|
O.current();
|
|
1481
1537
|
return;
|
|
@@ -1484,84 +1540,84 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1484
1540
|
O.current();
|
|
1485
1541
|
return;
|
|
1486
1542
|
}
|
|
1487
|
-
e && (N(!1),
|
|
1488
|
-
}, [
|
|
1543
|
+
e && (N(!1), le()), O.current();
|
|
1544
|
+
}, [le, N]), I = c((e) => {
|
|
1489
1545
|
if (e.target !== s.current) return;
|
|
1490
1546
|
let t = e.target, n = w.current ?? t.scrollTop, r = t.scrollTop;
|
|
1491
1547
|
if (w.current = r, x.current || !S.current) return;
|
|
1492
1548
|
let i = r < n;
|
|
1493
1549
|
if (t.scrollHeight - t.clientHeight - r <= 1) {
|
|
1494
|
-
T.current !== "end" &&
|
|
1550
|
+
T.current !== "end" && ue(!0);
|
|
1495
1551
|
return;
|
|
1496
1552
|
}
|
|
1497
1553
|
i && (N(!0), ae());
|
|
1498
1554
|
}, [
|
|
1499
1555
|
ae,
|
|
1500
|
-
|
|
1556
|
+
ue,
|
|
1501
1557
|
N
|
|
1502
|
-
]),
|
|
1558
|
+
]), L = c((e) => {
|
|
1503
1559
|
let t = s.current;
|
|
1504
1560
|
e.deltaY < 0 && t && t.scrollHeight > t.clientHeight && (N(!0), ae()), M();
|
|
1505
1561
|
}, [
|
|
1506
1562
|
ae,
|
|
1507
1563
|
M,
|
|
1508
1564
|
N
|
|
1509
|
-
]),
|
|
1565
|
+
]), R = c(() => {
|
|
1510
1566
|
M();
|
|
1511
|
-
}, [M]),
|
|
1567
|
+
}, [M]), V = c(() => {
|
|
1512
1568
|
M();
|
|
1513
|
-
}, [M]),
|
|
1569
|
+
}, [M]), de = c(() => {
|
|
1514
1570
|
A();
|
|
1515
1571
|
let e = s.current, t = l.current;
|
|
1516
1572
|
if (!e || !t) return;
|
|
1517
1573
|
let n = new IntersectionObserver(([e]) => {
|
|
1518
|
-
e &&
|
|
1574
|
+
e && ue(e.isIntersecting);
|
|
1519
1575
|
}, {
|
|
1520
1576
|
root: e,
|
|
1521
1577
|
threshold: 0
|
|
1522
1578
|
});
|
|
1523
|
-
n.observe(t),
|
|
1524
|
-
}, [A,
|
|
1525
|
-
s.current && (s.current.removeEventListener("scroll",
|
|
1579
|
+
n.observe(t), g.current = n;
|
|
1580
|
+
}, [A, ue]), H = c((e) => {
|
|
1581
|
+
s.current && (s.current.removeEventListener("scroll", I), s.current.removeEventListener("wheel", L), s.current.removeEventListener("touchstart", R), s.current.removeEventListener("pointerdown", V), ne()), s.current = e, e ? (w.current = e.scrollTop, E.current = e.scrollHeight, e.addEventListener("scroll", I, { passive: !0 }), e.addEventListener("wheel", L, { passive: !0 }), e.addEventListener("touchstart", R, { passive: !0 }), e.addEventListener("pointerdown", V), de(), P(), ce()) : (ie(), A(), ne());
|
|
1526
1582
|
}, [
|
|
1527
|
-
|
|
1528
|
-
|
|
1583
|
+
de,
|
|
1584
|
+
P,
|
|
1529
1585
|
ie,
|
|
1530
1586
|
A,
|
|
1531
1587
|
ne,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
]),
|
|
1538
|
-
l.current = e, e ?
|
|
1539
|
-
}, [
|
|
1588
|
+
V,
|
|
1589
|
+
I,
|
|
1590
|
+
R,
|
|
1591
|
+
L,
|
|
1592
|
+
ce
|
|
1593
|
+
]), fe = c((e) => {
|
|
1594
|
+
l.current = e, e ? de() : A();
|
|
1595
|
+
}, [de, A]), U = c((e) => {
|
|
1540
1596
|
let t = u.current;
|
|
1541
1597
|
if (e === null) {
|
|
1542
1598
|
k(), u.current = null, O.current();
|
|
1543
1599
|
return;
|
|
1544
1600
|
}
|
|
1545
1601
|
if (e === t) {
|
|
1546
|
-
T.current === "end" &&
|
|
1602
|
+
T.current === "end" && F(e);
|
|
1547
1603
|
return;
|
|
1548
1604
|
}
|
|
1549
|
-
k(), u.current = e, N(!1), v.current = !0, i(!0), T.current = "lastItem", e &&
|
|
1605
|
+
k(), u.current = e, N(!1), v.current = !0, i(!0), T.current = "lastItem", e && F(e), O.current();
|
|
1550
1606
|
}, [
|
|
1551
|
-
|
|
1607
|
+
F,
|
|
1552
1608
|
k,
|
|
1553
1609
|
N
|
|
1554
1610
|
]), pe = c((e) => {
|
|
1555
1611
|
if (_.current = e, e < Di) T.current = "lastItem", k();
|
|
1556
1612
|
else if (T.current === "end") {
|
|
1557
1613
|
let e = u.current;
|
|
1558
|
-
e &&
|
|
1614
|
+
e && F(e);
|
|
1559
1615
|
}
|
|
1560
1616
|
O.current();
|
|
1561
|
-
}, [
|
|
1617
|
+
}, [F, k]), me = c(() => {
|
|
1562
1618
|
N(!1), _.current < Di && (T.current = "lastItem", k()), O.current();
|
|
1563
1619
|
}, [k, N]), he = c(() => {
|
|
1564
|
-
me(), M(),
|
|
1620
|
+
me(), M(), le(), x.current = !0, O.current();
|
|
1565
1621
|
let e = y.current ? "smooth" : "instant";
|
|
1566
1622
|
y.current = !0, requestAnimationFrame(() => {
|
|
1567
1623
|
s.current?.scrollTo({
|
|
@@ -1570,24 +1626,24 @@ function ji({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1570
1626
|
}), j(), O.current();
|
|
1571
1627
|
});
|
|
1572
1628
|
}, [
|
|
1573
|
-
|
|
1629
|
+
le,
|
|
1574
1630
|
j,
|
|
1575
1631
|
M,
|
|
1576
1632
|
me
|
|
1577
1633
|
]), ge = c(() => {
|
|
1578
|
-
|
|
1579
|
-
}, [
|
|
1580
|
-
viewportRef:
|
|
1581
|
-
bottomTriggerRef:
|
|
1582
|
-
lastItemRef:
|
|
1634
|
+
oe();
|
|
1635
|
+
}, [oe]), _e = p(() => ({
|
|
1636
|
+
viewportRef: H,
|
|
1637
|
+
bottomTriggerRef: fe,
|
|
1638
|
+
lastItemRef: U,
|
|
1583
1639
|
isAtBottom: r,
|
|
1584
1640
|
setMessageCount: pe,
|
|
1585
1641
|
scrollBottom: he,
|
|
1586
1642
|
scrollToLatest: ge
|
|
1587
1643
|
}), [
|
|
1588
|
-
|
|
1589
|
-
de,
|
|
1644
|
+
H,
|
|
1590
1645
|
fe,
|
|
1646
|
+
U,
|
|
1591
1647
|
r,
|
|
1592
1648
|
pe,
|
|
1593
1649
|
he,
|
|
@@ -1610,12 +1666,13 @@ function Pi() {
|
|
|
1610
1666
|
return e;
|
|
1611
1667
|
}
|
|
1612
1668
|
function Fi({ children: e, className: t, messageCount: n = 0, gap: r = 16 }) {
|
|
1613
|
-
let { setMessageCount: i } = Ai(), a =
|
|
1614
|
-
return
|
|
1669
|
+
let { setMessageCount: i } = Ai(), a = p(() => ({ messageCount: n }), [n]);
|
|
1670
|
+
return f(() => {
|
|
1615
1671
|
i(n);
|
|
1616
1672
|
}, [n, i]), /* @__PURE__ */ z(Mi.Provider, {
|
|
1617
1673
|
value: a,
|
|
1618
1674
|
children: /* @__PURE__ */ z("div", {
|
|
1675
|
+
"data-slot": "chat-messages",
|
|
1619
1676
|
"data-testid": "chat-messages",
|
|
1620
1677
|
className: I("relative flex min-h-0 flex-1 flex-col", t),
|
|
1621
1678
|
style: { "--chat-messages-gap": `${r}px` },
|
|
@@ -1623,29 +1680,33 @@ function Fi({ children: e, className: t, messageCount: n = 0, gap: r = 16 }) {
|
|
|
1623
1680
|
})
|
|
1624
1681
|
});
|
|
1625
1682
|
}
|
|
1626
|
-
function Ii({ children: e, className: t,
|
|
1627
|
-
let { viewportRef:
|
|
1628
|
-
return
|
|
1629
|
-
|
|
1630
|
-
}, [
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1683
|
+
function Ii({ children: e, className: t, scrollAreaClassName: n, viewportClassName: r, bottomTriggerClassName: i }) {
|
|
1684
|
+
let { viewportRef: a, bottomTriggerRef: o, scrollToLatest: s } = Ai(), { messageCount: c } = Pi(), l = p(() => Array.from({ length: c }, (e, t) => t), [c]), u = c - 1;
|
|
1685
|
+
return f(() => {
|
|
1686
|
+
s();
|
|
1687
|
+
}, [c, s]), /* @__PURE__ */ B(jt.Root, {
|
|
1688
|
+
"data-slot": "chat-messages-scroll-area",
|
|
1689
|
+
className: I("min-h-0 flex-1", "relative group/scroll-area", "overflow-y-hidden", "transform-gpu", n),
|
|
1690
|
+
children: [/* @__PURE__ */ z(jt.Viewport, {
|
|
1691
|
+
ref: a,
|
|
1692
|
+
"data-slot": "chat-messages-viewport",
|
|
1693
|
+
className: I("@container-[size]", "will-change-scroll h-full w-full", r),
|
|
1635
1694
|
style: { scrollbarGutter: "stable both-edges" },
|
|
1636
1695
|
children: /* @__PURE__ */ B("ul", {
|
|
1696
|
+
"data-slot": "chat-messages-list",
|
|
1637
1697
|
"data-testid": "chat-messages-list",
|
|
1638
1698
|
role: "log",
|
|
1639
1699
|
"aria-label": "Message list",
|
|
1640
1700
|
"aria-atomic": "false",
|
|
1641
1701
|
className: I("m-0 flex flex-col gap-(--chat-messages-gap) p-0", t),
|
|
1642
|
-
children: [
|
|
1702
|
+
children: [l.map((t) => /* @__PURE__ */ z(Li, {
|
|
1643
1703
|
index: t,
|
|
1644
|
-
isLast: t ===
|
|
1704
|
+
isLast: t === u,
|
|
1645
1705
|
children: e
|
|
1646
1706
|
}, t)), /* @__PURE__ */ z("li", {
|
|
1647
|
-
ref:
|
|
1648
|
-
|
|
1707
|
+
ref: o,
|
|
1708
|
+
"data-slot": "chat-messages-bottom-trigger",
|
|
1709
|
+
className: I("h-px -mt-(--chat-messages-gap)", i),
|
|
1649
1710
|
"aria-hidden": "true"
|
|
1650
1711
|
})]
|
|
1651
1712
|
})
|
|
@@ -1653,15 +1714,19 @@ function Ii({ children: e, className: t, bottomTriggerClassName: n }) {
|
|
|
1653
1714
|
});
|
|
1654
1715
|
}
|
|
1655
1716
|
var Li = s(function({ children: e, index: t, isLast: n }) {
|
|
1656
|
-
return /* @__PURE__ */ z("li", {
|
|
1657
|
-
|
|
1658
|
-
children:
|
|
1659
|
-
|
|
1717
|
+
return /* @__PURE__ */ z("li", {
|
|
1718
|
+
"data-slot": "chat-messages-row",
|
|
1719
|
+
children: /* @__PURE__ */ z(Ni.Provider, {
|
|
1720
|
+
value: n,
|
|
1721
|
+
children: e(t)
|
|
1722
|
+
})
|
|
1723
|
+
});
|
|
1660
1724
|
});
|
|
1661
1725
|
function Ri({ children: e, className: t, ...n }) {
|
|
1662
1726
|
let r = l(Ni), { lastItemRef: i } = Ai();
|
|
1663
1727
|
return /* @__PURE__ */ z("div", {
|
|
1664
1728
|
ref: r ? i : void 0,
|
|
1729
|
+
"data-slot": "chat-message-list-group",
|
|
1665
1730
|
"data-is-last": r,
|
|
1666
1731
|
className: I("flex flex-col gap-(--chat-messages-gap)", "data-[is-last=true]:min-h-[calc(100cqh-var(--chat-messages-gap))]", t),
|
|
1667
1732
|
...n,
|
|
@@ -1669,35 +1734,36 @@ function Ri({ children: e, className: t, ...n }) {
|
|
|
1669
1734
|
});
|
|
1670
1735
|
}
|
|
1671
1736
|
function zi({ className: e, orientation: t = "vertical", ...n }) {
|
|
1672
|
-
return /* @__PURE__ */ z(
|
|
1737
|
+
return /* @__PURE__ */ z(jt.ScrollAreaScrollbar, {
|
|
1673
1738
|
"data-slot": "scroll-area-scrollbar",
|
|
1674
1739
|
orientation: t,
|
|
1675
1740
|
className: I("opacity-0 group-hover/scroll-area:opacity-100", "rounded-[8px]", "bg-scrollbar-track hover:bg-scrollbar-track-hover", "transition-opacity duration-200 ease-in-out", "flextouch-none select-none transition-colors", t === "vertical" && "h-full w-scrollbar border-l border-l-transparent px-4 py-[12px]", t === "horizontal" && "h-scrollbar w-full border-t border-t-transparent px-[12px] py-4", e),
|
|
1676
1741
|
...n,
|
|
1677
|
-
children: /* @__PURE__ */ z(
|
|
1742
|
+
children: /* @__PURE__ */ z(jt.ScrollAreaThumb, {
|
|
1678
1743
|
"data-slot": "scroll-area-thumb",
|
|
1679
1744
|
className: I("relative flex-1 rounded-full", "bg-scrollbar-thumb hover:bg-scrollbar-thumb-hover", t === "vertical" && "w-scrollbar-thumb!", t === "horizontal" && "h-scrollbar-thumb!")
|
|
1680
1745
|
})
|
|
1681
1746
|
});
|
|
1682
1747
|
}
|
|
1683
|
-
var Bi = s(function({ className: e,
|
|
1684
|
-
let { isAtBottom:
|
|
1748
|
+
var Bi = s(function({ className: e, buttonClassName: t, tooltip: n, children: r }) {
|
|
1749
|
+
let { isAtBottom: i, scrollBottom: a } = Ai();
|
|
1685
1750
|
return /* @__PURE__ */ z("div", {
|
|
1751
|
+
"data-slot": "chat-messages-scroll-button",
|
|
1686
1752
|
"data-testid": "chat-message-history-scroll-button",
|
|
1687
|
-
"data-hidden":
|
|
1688
|
-
"aria-hidden":
|
|
1753
|
+
"data-hidden": i,
|
|
1754
|
+
"aria-hidden": i ? !0 : void 0,
|
|
1689
1755
|
className: I("absolute", "px-[12px]", "bottom-0", "right-0 -translate-x-[12px]", "md:right-auto md:left-1/2 md:-translate-x-1/2", "-translate-y-[12px]", "flex items-center justify-center", "transition-opacity duration-200 ease-in-out", "data-[hidden=true]:pointer-events-none", "data-[hidden=true]:opacity-0 data-[hidden=false]:opacity-100", e),
|
|
1690
|
-
children: /* @__PURE__ */ z(
|
|
1691
|
-
tooltip:
|
|
1756
|
+
children: /* @__PURE__ */ z(P, {
|
|
1757
|
+
tooltip: n,
|
|
1692
1758
|
side: "top",
|
|
1693
1759
|
children: /* @__PURE__ */ z(D, {
|
|
1694
|
-
className: "bg-paper-elevation-2",
|
|
1760
|
+
className: I("bg-paper-elevation-2", t),
|
|
1695
1761
|
color: "primary",
|
|
1696
1762
|
size: "md",
|
|
1697
|
-
onClick: () =>
|
|
1763
|
+
onClick: () => a(),
|
|
1698
1764
|
tabIndex: -1,
|
|
1699
|
-
"aria-label":
|
|
1700
|
-
children:
|
|
1765
|
+
"aria-label": n,
|
|
1766
|
+
children: r || /* @__PURE__ */ z(H, {})
|
|
1701
1767
|
})
|
|
1702
1768
|
})
|
|
1703
1769
|
});
|
|
@@ -1707,6 +1773,7 @@ var Bi = s(function({ className: e, tooltip: t, children: n }) {
|
|
|
1707
1773
|
function Vi({ className: e, children: t, isPreview: n, isInteractive: r = !0 }) {
|
|
1708
1774
|
return /* @__PURE__ */ z("div", {
|
|
1709
1775
|
role: "group",
|
|
1776
|
+
"data-slot": "chat-message-attachment-card",
|
|
1710
1777
|
"data-testid": "chat-message-attachment-card",
|
|
1711
1778
|
"data-preview": n,
|
|
1712
1779
|
"data-interactive": r,
|
|
@@ -1716,41 +1783,46 @@ function Vi({ className: e, children: t, isPreview: n, isInteractive: r = !0 })
|
|
|
1716
1783
|
}
|
|
1717
1784
|
function Hi({ className: e, children: t }) {
|
|
1718
1785
|
return /* @__PURE__ */ z("div", {
|
|
1786
|
+
"data-slot": "chat-message-attachment-card-content",
|
|
1719
1787
|
"data-testid": "chat-message-attachment-card-content",
|
|
1720
1788
|
className: I("flex-1", "flex items-center", "overflow-hidden", e),
|
|
1721
1789
|
children: t
|
|
1722
1790
|
});
|
|
1723
1791
|
}
|
|
1724
1792
|
function Ui({ className: e, children: t }) {
|
|
1725
|
-
return /* @__PURE__ */ z(
|
|
1793
|
+
return /* @__PURE__ */ z(F, {
|
|
1726
1794
|
variant: "body-sm",
|
|
1795
|
+
"data-slot": "chat-message-attachment-card-title",
|
|
1727
1796
|
"data-testid": "chat-message-attachment-card-title",
|
|
1728
1797
|
className: I("truncate", e),
|
|
1729
1798
|
children: t
|
|
1730
1799
|
});
|
|
1731
1800
|
}
|
|
1732
|
-
function Wi({ className: e,
|
|
1801
|
+
function Wi({ className: e, imageClassName: t, previewSrc: n }) {
|
|
1733
1802
|
return /* @__PURE__ */ z("figure", {
|
|
1803
|
+
"data-slot": "chat-message-attachment-card-preview",
|
|
1734
1804
|
"data-testid": "chat-message-attachment-card-preview",
|
|
1735
1805
|
className: I("absolute top-0 left-0", "inset-0 w-full h-full", "overflow-hidden rounded-promptbox-attachment", "pointer-events-none", e),
|
|
1736
1806
|
children: /* @__PURE__ */ z("img", {
|
|
1737
|
-
|
|
1807
|
+
"data-slot": "chat-message-attachment-card-preview-image",
|
|
1808
|
+
src: n,
|
|
1738
1809
|
alt: "Preview",
|
|
1739
|
-
className: "w-full h-full object-cover"
|
|
1810
|
+
className: I("w-full h-full object-cover", t)
|
|
1740
1811
|
})
|
|
1741
1812
|
});
|
|
1742
1813
|
}
|
|
1743
|
-
function Gi({ className: e,
|
|
1814
|
+
function Gi({ className: e, buttonClassName: t, onDelete: n }) {
|
|
1744
1815
|
return /* @__PURE__ */ z("div", {
|
|
1745
1816
|
role: "group",
|
|
1817
|
+
"data-slot": "chat-message-attachment-card-actions",
|
|
1746
1818
|
"data-testid": "chat-message-attachment-card-actions",
|
|
1747
1819
|
className: I("absolute top-0 right-0", "translate-x-1/2 -translate-y-1/2", "hidden", "group-data-[interactive=true]/chat-message-attachment-card:group-hover/chat-message-attachment-card:flex", "rounded-overlay-tools-wrapper", "bg-overlay-tools-background-base", e),
|
|
1748
1820
|
children: /* @__PURE__ */ z(D, {
|
|
1749
1821
|
variant: "tertiary",
|
|
1750
1822
|
isSemantic: !1,
|
|
1751
|
-
onClick:
|
|
1823
|
+
onClick: n,
|
|
1752
1824
|
size: "xs",
|
|
1753
|
-
className: I("size-[24px]", "text-icon-button-tertiary-icon",
|
|
1825
|
+
className: I("size-[24px]", "text-icon-button-tertiary-icon", t),
|
|
1754
1826
|
children: /* @__PURE__ */ z(U, {})
|
|
1755
1827
|
})
|
|
1756
1828
|
});
|
|
@@ -1759,33 +1831,34 @@ function Gi({ className: e, onDelete: t }) {
|
|
|
1759
1831
|
//#region src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx
|
|
1760
1832
|
var Ki = {
|
|
1761
1833
|
spreadsheet: {
|
|
1762
|
-
component:
|
|
1834
|
+
component: Fe,
|
|
1763
1835
|
className: "bg-data-d"
|
|
1764
1836
|
},
|
|
1765
1837
|
pdf: {
|
|
1766
|
-
component:
|
|
1838
|
+
component: Ae,
|
|
1767
1839
|
className: "bg-data-a"
|
|
1768
1840
|
},
|
|
1769
1841
|
presentation: {
|
|
1770
|
-
component:
|
|
1842
|
+
component: je,
|
|
1771
1843
|
className: "bg-data-e"
|
|
1772
1844
|
},
|
|
1773
1845
|
document: {
|
|
1774
|
-
component:
|
|
1846
|
+
component: he,
|
|
1775
1847
|
className: "bg-data-c"
|
|
1776
1848
|
},
|
|
1777
1849
|
code: {
|
|
1778
|
-
component:
|
|
1850
|
+
component: pe,
|
|
1779
1851
|
className: "bg-data-f"
|
|
1780
1852
|
},
|
|
1781
1853
|
unknown: {
|
|
1782
|
-
component:
|
|
1854
|
+
component: ge,
|
|
1783
1855
|
className: "bg-data-f"
|
|
1784
1856
|
}
|
|
1785
1857
|
};
|
|
1786
1858
|
function qi({ icon: e, className: t, ...n }) {
|
|
1787
1859
|
let { component: r, className: i } = Ki[e];
|
|
1788
1860
|
return /* @__PURE__ */ z("span", {
|
|
1861
|
+
"data-slot": "chat-message-attachment-card-icon",
|
|
1789
1862
|
"data-testid": "chat-attachment-icon",
|
|
1790
1863
|
"data-icon": e,
|
|
1791
1864
|
className: I("inline-flex items-center justify-center", "rounded-[8px]", "p-8", "size-promptbox-attachment-size-icon-container", "text-icon-fill-inverse", "[&_svg]:size-[24px]", i, t),
|
|
@@ -1808,7 +1881,7 @@ var Ji = {
|
|
|
1808
1881
|
"application/vnd.oasis.opendocument.text": "document"
|
|
1809
1882
|
};
|
|
1810
1883
|
function Yi(e) {
|
|
1811
|
-
let t =
|
|
1884
|
+
let t = Nt.getType(e.name);
|
|
1812
1885
|
return t ? t in Ji ? Ji[t] : t.startsWith("text/") || t.includes("javascript") || t.includes("json") ? "code" : "unknown" : "unknown";
|
|
1813
1886
|
}
|
|
1814
1887
|
//#endregion
|
|
@@ -1819,17 +1892,17 @@ function Xi(e) {
|
|
|
1819
1892
|
//#endregion
|
|
1820
1893
|
//#region src/components/markdown-viewer/hooks.ts
|
|
1821
1894
|
function Zi({ customComponents: e }) {
|
|
1822
|
-
let t =
|
|
1895
|
+
let t = p(() => Object.keys(e).filter((e) => Xi(e) ? !0 : (console.warn(`[MarkdownViewer] Invalid custom component tag: ${e}`), !1)), [e]);
|
|
1823
1896
|
return {
|
|
1824
1897
|
components: e,
|
|
1825
|
-
remarkPlugins:
|
|
1826
|
-
rehypePlugins:
|
|
1827
|
-
...
|
|
1828
|
-
tagNames: [...
|
|
1898
|
+
remarkPlugins: p(() => [...Object.values(It)], []),
|
|
1899
|
+
rehypePlugins: p(() => [...Object.values(Ft), [Lt, {
|
|
1900
|
+
...Rt,
|
|
1901
|
+
tagNames: [...Rt?.tagNames || [], ...t],
|
|
1829
1902
|
protocols: {
|
|
1830
|
-
...
|
|
1903
|
+
...Rt?.protocols,
|
|
1831
1904
|
href: [
|
|
1832
|
-
...
|
|
1905
|
+
...Rt?.protocols?.href ?? [],
|
|
1833
1906
|
"swisper",
|
|
1834
1907
|
"swisper://"
|
|
1835
1908
|
]
|
|
@@ -1839,14 +1912,15 @@ function Zi({ customComponents: e }) {
|
|
|
1839
1912
|
}
|
|
1840
1913
|
//#endregion
|
|
1841
1914
|
//#region src/components/markdown-viewer/markdown-viewer.tsx
|
|
1842
|
-
function Qi({ markdown: e,
|
|
1843
|
-
let { components:
|
|
1844
|
-
return /* @__PURE__ */ z(
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1915
|
+
function Qi({ markdown: e, className: t, isStreaming: n = !1, hasCaret: r = !1, customComponents: i = {} }) {
|
|
1916
|
+
let { components: a, remarkPlugins: o, rehypePlugins: s } = Zi({ customComponents: i });
|
|
1917
|
+
return /* @__PURE__ */ z(Pt, {
|
|
1918
|
+
className: t,
|
|
1919
|
+
caret: r ? "block" : void 0,
|
|
1920
|
+
isAnimating: n,
|
|
1921
|
+
components: a,
|
|
1922
|
+
remarkPlugins: o,
|
|
1923
|
+
rehypePlugins: s,
|
|
1850
1924
|
linkSafety: { enabled: !1 },
|
|
1851
1925
|
remend: { handlers: [{
|
|
1852
1926
|
name: "swi-tag-filter",
|
|
@@ -1878,7 +1952,7 @@ function $i(e, t = "|") {
|
|
|
1878
1952
|
//#endregion
|
|
1879
1953
|
//#region src/components/chat-message-response/chat-message-response.tsx
|
|
1880
1954
|
function ea({ message: e, isStreaming: t }) {
|
|
1881
|
-
let n =
|
|
1955
|
+
let n = p(() => ({}), []);
|
|
1882
1956
|
return /* @__PURE__ */ z(Qi, {
|
|
1883
1957
|
hasCaret: !1,
|
|
1884
1958
|
markdown: e,
|
|
@@ -1887,130 +1961,10 @@ function ea({ message: e, isStreaming: t }) {
|
|
|
1887
1961
|
});
|
|
1888
1962
|
}
|
|
1889
1963
|
//#endregion
|
|
1890
|
-
//#region src/components/chat-message-history/chat-message-history.tsx
|
|
1891
|
-
var ta = i(null);
|
|
1892
|
-
function na() {
|
|
1893
|
-
let e = l(ta);
|
|
1894
|
-
if (!e) throw Error("\"useChatMessageHistoryContext\" must be used within a ChatMessageHistoryContextProvider");
|
|
1895
|
-
return e;
|
|
1896
|
-
}
|
|
1897
|
-
function ra({ children: e, className: t, totalMessages: n, isLoading: r = !1, hasError: i = !1 }) {
|
|
1898
|
-
let a = n === 0, { contentRef: o, scrollRef: s, isAtBottom: c, scrollToBottom: l } = It(), u = m(() => ({
|
|
1899
|
-
isCurrentScrollBottom: c,
|
|
1900
|
-
isLoading: r,
|
|
1901
|
-
isEmpty: a,
|
|
1902
|
-
hasError: i,
|
|
1903
|
-
scrollToLastMessage: l
|
|
1904
|
-
}), [
|
|
1905
|
-
c,
|
|
1906
|
-
r,
|
|
1907
|
-
a,
|
|
1908
|
-
i,
|
|
1909
|
-
l
|
|
1910
|
-
]);
|
|
1911
|
-
return /* @__PURE__ */ z(ta.Provider, {
|
|
1912
|
-
value: u,
|
|
1913
|
-
children: /* @__PURE__ */ z(Ft, {
|
|
1914
|
-
"data-testid": "chat-message-history",
|
|
1915
|
-
className: I("flex", t),
|
|
1916
|
-
initial: "instant",
|
|
1917
|
-
resize: "instant",
|
|
1918
|
-
"aria-label": "Chat message history",
|
|
1919
|
-
"data-loading": r,
|
|
1920
|
-
"data-empty": a,
|
|
1921
|
-
"data-error": i,
|
|
1922
|
-
children: /* @__PURE__ */ B(J.Root, {
|
|
1923
|
-
className: I("flex-1", "relative group/scroll-area", "overflow-y-hidden", "transform-gpu"),
|
|
1924
|
-
children: [/* @__PURE__ */ z(J.Viewport, {
|
|
1925
|
-
ref: s,
|
|
1926
|
-
className: I("will-change-scroll"),
|
|
1927
|
-
style: {
|
|
1928
|
-
height: "100%",
|
|
1929
|
-
width: "100%",
|
|
1930
|
-
scrollbarGutter: "stable both-edges"
|
|
1931
|
-
},
|
|
1932
|
-
children: /* @__PURE__ */ z("div", {
|
|
1933
|
-
ref: o,
|
|
1934
|
-
children: e
|
|
1935
|
-
})
|
|
1936
|
-
}), /* @__PURE__ */ z(ca, { orientation: "vertical" })]
|
|
1937
|
-
})
|
|
1938
|
-
})
|
|
1939
|
-
});
|
|
1940
|
-
}
|
|
1941
|
-
var ia = s(function({ children: e, className: t }) {
|
|
1942
|
-
return /* @__PURE__ */ z("ul", {
|
|
1943
|
-
"data-testid": "chat-message-history-list",
|
|
1944
|
-
role: "log",
|
|
1945
|
-
"aria-label": "Message list",
|
|
1946
|
-
"aria-atomic": "false",
|
|
1947
|
-
className: I("flex flex-col p-0 m-0", "relative gap-16", t),
|
|
1948
|
-
children: e
|
|
1949
|
-
});
|
|
1950
|
-
});
|
|
1951
|
-
function aa({ children: e, className: t }) {
|
|
1952
|
-
let { hasError: n, isLoading: r } = na();
|
|
1953
|
-
return !n && !r ? null : /* @__PURE__ */ z("div", {
|
|
1954
|
-
"data-testid": "chat-message-history-empty-state",
|
|
1955
|
-
role: "status",
|
|
1956
|
-
"aria-live": "polite",
|
|
1957
|
-
"aria-label": "No messages",
|
|
1958
|
-
className: I("flex-1 flex items-center justify-center", t),
|
|
1959
|
-
children: e
|
|
1960
|
-
});
|
|
1961
|
-
}
|
|
1962
|
-
function oa({ children: e, error: t, className: n }) {
|
|
1963
|
-
let { hasError: r, isLoading: i } = na();
|
|
1964
|
-
return r && !i ? null : /* @__PURE__ */ z("div", {
|
|
1965
|
-
"data-testid": "chat-message-history-error-state",
|
|
1966
|
-
role: "alert",
|
|
1967
|
-
"aria-live": "assertive",
|
|
1968
|
-
"aria-label": "Error loading messages",
|
|
1969
|
-
className: I("flex-1 flex items-center justify-center", n),
|
|
1970
|
-
children: e || /* @__PURE__ */ z("div", {
|
|
1971
|
-
className: "text-text-error-main",
|
|
1972
|
-
children: t instanceof Error ? t.message : t || "An error occurred"
|
|
1973
|
-
})
|
|
1974
|
-
});
|
|
1975
|
-
}
|
|
1976
|
-
var sa = s(function({ className: e, tooltip: t }) {
|
|
1977
|
-
let { isCurrentScrollBottom: n, scrollToLastMessage: r } = na();
|
|
1978
|
-
return /* @__PURE__ */ z("div", {
|
|
1979
|
-
"data-testid": "chat-message-history-scroll-button",
|
|
1980
|
-
"data-hidden": n,
|
|
1981
|
-
"aria-hidden": n ? !0 : void 0,
|
|
1982
|
-
className: I("absolute", "px-[12px]", "bottom-0", "right-0 -translate-x-[12px]", "md:right-auto md:left-1/2 md:-translate-x-1/2", "-translate-y-[12px]", "flex items-center justify-center", "transition-opacity duration-200 ease-in-out", "data-[hidden=true]:pointer-events-none", "data-[hidden=true]:opacity-0 data-[hidden=false]:opacity-100", e),
|
|
1983
|
-
children: /* @__PURE__ */ z(N, {
|
|
1984
|
-
tooltip: t,
|
|
1985
|
-
side: "top",
|
|
1986
|
-
children: /* @__PURE__ */ z(D, {
|
|
1987
|
-
className: "bg-paper-elevation-2",
|
|
1988
|
-
color: "primary",
|
|
1989
|
-
size: "md",
|
|
1990
|
-
onClick: () => r(),
|
|
1991
|
-
tabIndex: -1,
|
|
1992
|
-
"aria-label": t,
|
|
1993
|
-
children: /* @__PURE__ */ z(H, {})
|
|
1994
|
-
})
|
|
1995
|
-
})
|
|
1996
|
-
});
|
|
1997
|
-
});
|
|
1998
|
-
function ca({ className: e, orientation: t = "vertical", ...n }) {
|
|
1999
|
-
return /* @__PURE__ */ z(J.ScrollAreaScrollbar, {
|
|
2000
|
-
"data-slot": "scroll-area-scrollbar",
|
|
2001
|
-
orientation: t,
|
|
2002
|
-
className: I("opacity-0 group-hover/scroll-area:opacity-100", "rounded-[8px]", "bg-scrollbar-track hover:bg-scrollbar-track-hover", "transition-opacity duration-200 ease-in-out", "flextouch-none select-none transition-colors", t === "vertical" && "h-full w-scrollbar border-l border-l-transparent px-4 py-[12px]", t === "horizontal" && "h-scrollbar w-full border-t border-t-transparent px-[12px] py-4", e),
|
|
2003
|
-
...n,
|
|
2004
|
-
children: /* @__PURE__ */ z(J.ScrollAreaThumb, {
|
|
2005
|
-
"data-slot": "scroll-area-thumb",
|
|
2006
|
-
className: I("relative flex-1 rounded-full", "bg-scrollbar-thumb hover:bg-scrollbar-thumb-hover", t === "vertical" && "w-scrollbar-thumb!", t === "horizontal" && "h-scrollbar-thumb!")
|
|
2007
|
-
})
|
|
2008
|
-
});
|
|
2009
|
-
}
|
|
2010
|
-
//#endregion
|
|
2011
1964
|
//#region src/components/chat-message-toolbar/chat-message-toolbar.tsx
|
|
2012
|
-
function
|
|
1965
|
+
function ta({ children: e, className: t, reverse: n = !1, ...r }) {
|
|
2013
1966
|
return /* @__PURE__ */ z("div", {
|
|
1967
|
+
"data-slot": "chat-message-toolbar",
|
|
2014
1968
|
"data-testid": "chat-message-toolbar",
|
|
2015
1969
|
"data-reverse": n,
|
|
2016
1970
|
className: I("flex items-center justify-between", "gap-16", "h-24", "data-[reverse=true]:flex-row-reverse", t),
|
|
@@ -2018,129 +1972,148 @@ function la({ children: e, className: t, reverse: n = !1, ...r }) {
|
|
|
2018
1972
|
children: e
|
|
2019
1973
|
});
|
|
2020
1974
|
}
|
|
2021
|
-
function
|
|
1975
|
+
function na({ children: e, className: t, ...n }) {
|
|
2022
1976
|
return /* @__PURE__ */ z("div", {
|
|
1977
|
+
"data-slot": "chat-message-toolbar-actions",
|
|
2023
1978
|
"data-testid": "chat-message-toolbar-actions",
|
|
2024
1979
|
role: "group",
|
|
2025
1980
|
className: I("flex items-center gap-8", t),
|
|
1981
|
+
...n,
|
|
2026
1982
|
children: e
|
|
2027
1983
|
});
|
|
2028
1984
|
}
|
|
2029
|
-
|
|
2030
|
-
let
|
|
1985
|
+
var ra = a(function({ children: e, className: t, tooltip: n, ...r }, i) {
|
|
1986
|
+
let a = /* @__PURE__ */ z(D, {
|
|
1987
|
+
ref: i,
|
|
2031
1988
|
variant: "tertiary",
|
|
2032
1989
|
isSemantic: !1,
|
|
2033
1990
|
size: "xs",
|
|
1991
|
+
"data-slot": "chat-message-toolbar-action-button",
|
|
2034
1992
|
className: I("text-action-active", t),
|
|
2035
1993
|
...r,
|
|
2036
1994
|
children: e
|
|
2037
1995
|
});
|
|
2038
|
-
return n ? /* @__PURE__ */ z(
|
|
1996
|
+
return n ? /* @__PURE__ */ z(P, {
|
|
2039
1997
|
tooltip: n,
|
|
2040
|
-
children:
|
|
2041
|
-
}) :
|
|
2042
|
-
}
|
|
2043
|
-
|
|
1998
|
+
children: a
|
|
1999
|
+
}) : a;
|
|
2000
|
+
});
|
|
2001
|
+
ra.displayName = "ChatMessageToolbarActionButton";
|
|
2002
|
+
function ia({ className: e, children: t, ...n }) {
|
|
2044
2003
|
return /* @__PURE__ */ z("div", {
|
|
2004
|
+
"data-slot": "chat-message-toolbar-timestamp",
|
|
2045
2005
|
className: I("text-action-active", e),
|
|
2006
|
+
...n,
|
|
2046
2007
|
children: t
|
|
2047
2008
|
});
|
|
2048
2009
|
}
|
|
2049
2010
|
//#endregion
|
|
2050
2011
|
//#region src/components/chat-notification-card/utils.ts
|
|
2051
|
-
function
|
|
2012
|
+
function aa(e) {
|
|
2052
2013
|
return new Date(Date.now() + e * 60 * 1e3);
|
|
2053
2014
|
}
|
|
2054
|
-
var
|
|
2055
|
-
function
|
|
2015
|
+
var oa = 60, sa = 1440, ca = 6e4;
|
|
2016
|
+
function la(e, t) {
|
|
2056
2017
|
return `${e} ${t}${e === 1 ? "" : "s"}`;
|
|
2057
2018
|
}
|
|
2058
|
-
function
|
|
2059
|
-
let r = Math.max(0, Math.ceil((e.getTime() - n.getTime()) /
|
|
2060
|
-
return i > 0 && s.push(
|
|
2019
|
+
function ua(e, t = "in", n = /* @__PURE__ */ new Date()) {
|
|
2020
|
+
let r = Math.max(0, Math.ceil((e.getTime() - n.getTime()) / ca)), i = Math.floor(r / sa), a = Math.floor(r % sa / oa), o = r % oa, s = [];
|
|
2021
|
+
return i > 0 && s.push(la(i, "day")), a > 0 && s.push(la(a, "hour")), s.push(la(o, "minute")), [t, ...s].filter(Boolean).join(" ");
|
|
2061
2022
|
}
|
|
2062
2023
|
//#endregion
|
|
2063
2024
|
//#region src/components/chat-notification-card/chat-notification-card.tsx
|
|
2064
|
-
var
|
|
2065
|
-
function
|
|
2066
|
-
let e = l(
|
|
2025
|
+
var da = i(null);
|
|
2026
|
+
function fa() {
|
|
2027
|
+
let e = l(da);
|
|
2067
2028
|
if (!e) throw Error("\"useChatNotificationCardContext\" must be used within a ChatNotificationCard");
|
|
2068
2029
|
return e;
|
|
2069
2030
|
}
|
|
2070
|
-
function
|
|
2071
|
-
let [
|
|
2072
|
-
|
|
2073
|
-
}, [
|
|
2074
|
-
|
|
2075
|
-
}, [
|
|
2076
|
-
isExpanded:
|
|
2077
|
-
setExpanded:
|
|
2078
|
-
toggleExpanded:
|
|
2031
|
+
function pa({ children: e, variant: t = "default", className: n, overlayClassName: r, defaultExpanded: i = !1, expanded: a, onExpandedChange: o, onClick: s }) {
|
|
2032
|
+
let [l, u] = h(i), d = a ?? l, f = c((e) => {
|
|
2033
|
+
a === void 0 && u(e), o?.(e);
|
|
2034
|
+
}, [a, o]), m = c(() => {
|
|
2035
|
+
f(!d);
|
|
2036
|
+
}, [d, f]), g = p(() => ({
|
|
2037
|
+
isExpanded: d,
|
|
2038
|
+
setExpanded: f,
|
|
2039
|
+
toggleExpanded: m
|
|
2079
2040
|
}), [
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2041
|
+
d,
|
|
2042
|
+
f,
|
|
2043
|
+
m
|
|
2083
2044
|
]);
|
|
2084
|
-
return /* @__PURE__ */ z(
|
|
2085
|
-
value:
|
|
2045
|
+
return /* @__PURE__ */ z(da.Provider, {
|
|
2046
|
+
value: g,
|
|
2086
2047
|
children: /* @__PURE__ */ B("div", {
|
|
2087
2048
|
role: "alert",
|
|
2049
|
+
"data-slot": "chat-notification-card",
|
|
2088
2050
|
"data-testid": "chat-notification-card",
|
|
2089
|
-
"data-
|
|
2090
|
-
"
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2051
|
+
"data-variant": t,
|
|
2052
|
+
"data-expanded": d,
|
|
2053
|
+
"aria-expanded": d,
|
|
2054
|
+
className: I("group/chat-notification-card", "relative", "p-[12px]", "rounded-[12px] overflow-hidden", "bg-paper-elevation-2", "flex flex-col gap-8", "bg-paper-elevation-2", "data-[variant=floating]:border data-[variant=floating]:border-component-divider", n),
|
|
2055
|
+
onClick: s,
|
|
2056
|
+
children: [e, /* @__PURE__ */ z("div", {
|
|
2057
|
+
"data-slot": "chat-notification-card-overlay",
|
|
2058
|
+
className: I("absolute inset-0 pointer-events-none bg-secondary-states-hover opacity-0 group-hover/chat-notification-card:opacity-100 transition-opacity duration-200 ease-in-out", r)
|
|
2059
|
+
})]
|
|
2094
2060
|
})
|
|
2095
2061
|
});
|
|
2096
2062
|
}
|
|
2097
|
-
function
|
|
2063
|
+
function ma({ children: e, className: t }) {
|
|
2098
2064
|
return /* @__PURE__ */ z("header", {
|
|
2065
|
+
"data-slot": "chat-notification-card-head",
|
|
2099
2066
|
"data-testid": "chat-notification-card-head",
|
|
2100
2067
|
className: I("grid grid-cols-[minmax(0,1fr)_auto] items-center gap-8", "min-h-[32px]", t),
|
|
2101
2068
|
children: e
|
|
2102
2069
|
});
|
|
2103
2070
|
}
|
|
2104
|
-
function
|
|
2071
|
+
function ha({ children: e, className: t }) {
|
|
2105
2072
|
return /* @__PURE__ */ z("div", {
|
|
2073
|
+
"data-slot": "chat-notification-card-header",
|
|
2106
2074
|
"data-testid": "chat-notification-card-header",
|
|
2107
2075
|
className: I("min-w-0 flex items-center gap-8 overflow-hidden", "text-layout-feedback-info-background-default", t),
|
|
2108
2076
|
children: e
|
|
2109
2077
|
});
|
|
2110
2078
|
}
|
|
2111
|
-
function
|
|
2079
|
+
function ga({ children: e, className: t }) {
|
|
2112
2080
|
return /* @__PURE__ */ z("div", {
|
|
2081
|
+
"data-slot": "chat-notification-card-header-icon",
|
|
2113
2082
|
"data-testid": "chat-notification-card-header-icon",
|
|
2114
2083
|
className: I("shrink-0", "inline-flex items-center justify-center", "pointer-events-none", "[&_svg]:size-[20px]!", t),
|
|
2115
2084
|
children: e
|
|
2116
2085
|
});
|
|
2117
2086
|
}
|
|
2118
|
-
function
|
|
2087
|
+
function _a({ children: e, className: t }) {
|
|
2119
2088
|
return /* @__PURE__ */ z("div", {
|
|
2089
|
+
"data-slot": "chat-notification-card-header-title",
|
|
2120
2090
|
"data-testid": "chat-notification-card-header-title",
|
|
2121
2091
|
className: I("min-w-0 flex flex-1 items-center gap-8 overflow-hidden", t),
|
|
2122
2092
|
children: e
|
|
2123
2093
|
});
|
|
2124
2094
|
}
|
|
2125
|
-
function
|
|
2126
|
-
return /* @__PURE__ */ z(
|
|
2095
|
+
function va({ children: e, className: t }) {
|
|
2096
|
+
return /* @__PURE__ */ z(F, {
|
|
2127
2097
|
variant: "body-sm",
|
|
2128
2098
|
fontWeight: "semibold",
|
|
2099
|
+
"data-slot": "chat-notification-card-header-title-label",
|
|
2129
2100
|
"data-testid": "chat-notification-card-header-title-label",
|
|
2130
2101
|
className: I("min-w-0 truncate", "text-left text-inherit uppercase", t),
|
|
2131
2102
|
asChild: !0,
|
|
2132
2103
|
children: /* @__PURE__ */ z("span", { children: e })
|
|
2133
2104
|
});
|
|
2134
2105
|
}
|
|
2135
|
-
var
|
|
2106
|
+
var ya = {
|
|
2136
2107
|
low: "info",
|
|
2137
2108
|
medium: "warning",
|
|
2138
2109
|
high: "error"
|
|
2139
2110
|
};
|
|
2140
|
-
function
|
|
2141
|
-
let i =
|
|
2142
|
-
return t === "low" ? null : /* @__PURE__ */ z(
|
|
2111
|
+
function ba({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
2112
|
+
let i = ya[t];
|
|
2113
|
+
return t === "low" ? null : /* @__PURE__ */ z(_, {
|
|
2114
|
+
"data-slot": "chat-notification-card-header-status",
|
|
2143
2115
|
"data-testid": "chat-notification-card-header-status",
|
|
2116
|
+
"data-priority": t,
|
|
2144
2117
|
className: I("text-text-secondary", "shrink-0", n),
|
|
2145
2118
|
size: "2xs",
|
|
2146
2119
|
color: i,
|
|
@@ -2149,23 +2122,26 @@ function Oa({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
|
2149
2122
|
children: e
|
|
2150
2123
|
});
|
|
2151
2124
|
}
|
|
2152
|
-
function
|
|
2125
|
+
function xa({ children: e, className: t }) {
|
|
2153
2126
|
return /* @__PURE__ */ z("div", {
|
|
2127
|
+
"data-slot": "chat-notification-card-actions",
|
|
2154
2128
|
"data-testid": "chat-notification-card-actions",
|
|
2155
2129
|
role: "group",
|
|
2156
2130
|
className: I("flex flex-row items-center justify-end", "shrink-0 justify-self-end", t),
|
|
2157
2131
|
children: e
|
|
2158
2132
|
});
|
|
2159
2133
|
}
|
|
2160
|
-
function
|
|
2161
|
-
return /* @__PURE__ */ z(
|
|
2134
|
+
function Sa({ children: e, className: t }) {
|
|
2135
|
+
return /* @__PURE__ */ z(F, {
|
|
2162
2136
|
variant: "caption",
|
|
2137
|
+
"data-slot": "chat-notification-card-timestamp",
|
|
2163
2138
|
"data-testid": "chat-notification-card-timestamp",
|
|
2164
2139
|
className: I("text-text-secondary", "inline-flex px-8", "leading-[32px]", t),
|
|
2165
|
-
|
|
2140
|
+
asChild: !0,
|
|
2141
|
+
children: /* @__PURE__ */ z("span", { children: e })
|
|
2166
2142
|
});
|
|
2167
2143
|
}
|
|
2168
|
-
function
|
|
2144
|
+
function Ca({ children: e, className: t }) {
|
|
2169
2145
|
function n(e) {
|
|
2170
2146
|
e.stopPropagation();
|
|
2171
2147
|
}
|
|
@@ -2173,6 +2149,7 @@ function ja({ children: e, className: t }) {
|
|
|
2173
2149
|
e.stopPropagation();
|
|
2174
2150
|
}
|
|
2175
2151
|
return /* @__PURE__ */ z("div", {
|
|
2152
|
+
"data-slot": "chat-notification-card-buttons",
|
|
2176
2153
|
"data-testid": "chat-notification-card-buttons",
|
|
2177
2154
|
role: "group",
|
|
2178
2155
|
className: I("flex flex-row items-center justify-end", "gap-8", t),
|
|
@@ -2181,81 +2158,91 @@ function ja({ children: e, className: t }) {
|
|
|
2181
2158
|
children: e
|
|
2182
2159
|
});
|
|
2183
2160
|
}
|
|
2184
|
-
var
|
|
2161
|
+
var wa = a(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
2185
2162
|
function a() {
|
|
2186
2163
|
n?.(!t);
|
|
2187
2164
|
}
|
|
2188
2165
|
return /* @__PURE__ */ z(D, {
|
|
2189
2166
|
ref: i,
|
|
2167
|
+
"data-slot": "chat-notification-card-read-action-button",
|
|
2168
|
+
"data-read": t,
|
|
2190
2169
|
"aria-label": "Mark notifications as read",
|
|
2191
2170
|
size: "sm",
|
|
2192
2171
|
variant: "tertiary",
|
|
2193
2172
|
className: e,
|
|
2194
2173
|
onClick: a,
|
|
2195
2174
|
...r,
|
|
2196
|
-
children: z(t ?
|
|
2175
|
+
children: z(t ? Ne : Me, {})
|
|
2197
2176
|
});
|
|
2198
2177
|
});
|
|
2199
|
-
|
|
2200
|
-
var
|
|
2201
|
-
let [
|
|
2178
|
+
wa.displayName = "ChatNotificationCardReadActionButton";
|
|
2179
|
+
var Ta = a(function({ className: e, labelClassName: t, cancelLabelClassName: n, snoozeUntilDate: r, cancelLabel: i = "Cancel", formatDate: a = ua, onCancel: o, onClick: s, onMouseEnter: c, onMouseLeave: l, ...d }, f) {
|
|
2180
|
+
let [p, m] = h(!1), _ = r && r > /* @__PURE__ */ new Date();
|
|
2202
2181
|
u(() => {
|
|
2203
|
-
|
|
2204
|
-
}, [
|
|
2205
|
-
function
|
|
2206
|
-
|
|
2182
|
+
_ || m(!1);
|
|
2183
|
+
}, [_]);
|
|
2184
|
+
function v(e) {
|
|
2185
|
+
m(!0), c?.(e);
|
|
2207
2186
|
}
|
|
2208
|
-
function
|
|
2209
|
-
|
|
2187
|
+
function y(e) {
|
|
2188
|
+
m(!1), l?.(e);
|
|
2210
2189
|
}
|
|
2211
|
-
function
|
|
2212
|
-
|
|
2190
|
+
function b() {
|
|
2191
|
+
m(!1), o?.();
|
|
2213
2192
|
}
|
|
2214
|
-
return
|
|
2215
|
-
ref:
|
|
2216
|
-
"data-
|
|
2217
|
-
|
|
2193
|
+
return _ ? /* @__PURE__ */ B(g, {
|
|
2194
|
+
ref: f,
|
|
2195
|
+
"data-slot": "chat-notification-card-snooze-button",
|
|
2196
|
+
"data-snoozed": "true",
|
|
2197
|
+
"data-hover": p,
|
|
2198
|
+
startIcon: z(p ? U : Pe, {}),
|
|
2218
2199
|
variant: "tertiary",
|
|
2219
2200
|
size: "md",
|
|
2220
|
-
onMouseEnter:
|
|
2221
|
-
onMouseLeave:
|
|
2222
|
-
onClick:
|
|
2201
|
+
onMouseEnter: v,
|
|
2202
|
+
onMouseLeave: y,
|
|
2203
|
+
onClick: b,
|
|
2223
2204
|
className: I("group/snooze-button", "text-chip-outlined-warning-text h-[32px]!", e),
|
|
2224
|
-
...
|
|
2205
|
+
...d,
|
|
2225
2206
|
children: [/* @__PURE__ */ z("span", {
|
|
2226
|
-
|
|
2227
|
-
|
|
2207
|
+
"data-slot": "chat-notification-card-snooze-button-label",
|
|
2208
|
+
className: I("group-data-[hover=true]/snooze-button:opacity-0", "transition-opacity duration-200 ease-in-out", t),
|
|
2209
|
+
children: a(r)
|
|
2228
2210
|
}), /* @__PURE__ */ z("span", {
|
|
2229
|
-
|
|
2230
|
-
|
|
2211
|
+
"data-slot": "chat-notification-card-snooze-button-cancel-label",
|
|
2212
|
+
className: I("absolute left-0 w-full text-center pl-[16px]", "transition-opacity duration-200 ease-in-out", "opacity-0", "group-data-[hover=true]/snooze-button:opacity-100", n),
|
|
2213
|
+
children: i
|
|
2231
2214
|
})]
|
|
2232
2215
|
}) : /* @__PURE__ */ z(D, {
|
|
2233
|
-
ref:
|
|
2216
|
+
ref: f,
|
|
2217
|
+
"data-slot": "chat-notification-card-snooze-button",
|
|
2218
|
+
"data-snoozed": "false",
|
|
2234
2219
|
"aria-label": "Snooze notification",
|
|
2235
2220
|
size: "sm",
|
|
2236
2221
|
variant: "tertiary",
|
|
2237
2222
|
className: I("group/snooze-button", e),
|
|
2238
|
-
onClick:
|
|
2239
|
-
...
|
|
2240
|
-
children: /* @__PURE__ */ z(
|
|
2223
|
+
onClick: s,
|
|
2224
|
+
...d,
|
|
2225
|
+
children: /* @__PURE__ */ z(Pe, {})
|
|
2241
2226
|
});
|
|
2242
2227
|
});
|
|
2243
|
-
|
|
2244
|
-
var
|
|
2228
|
+
Ta.displayName = "ChatNotificationCardSnoozeButton";
|
|
2229
|
+
var Ea = a(function({ className: e, ...t }, n) {
|
|
2245
2230
|
return /* @__PURE__ */ z(D, {
|
|
2246
2231
|
ref: n,
|
|
2232
|
+
"data-slot": "chat-notification-card-delete-button",
|
|
2247
2233
|
"aria-label": "Delete notification",
|
|
2248
2234
|
size: "sm",
|
|
2249
2235
|
variant: "tertiary",
|
|
2250
2236
|
className: e,
|
|
2251
2237
|
...t,
|
|
2252
|
-
children: /* @__PURE__ */ z(
|
|
2238
|
+
children: /* @__PURE__ */ z(me, {})
|
|
2253
2239
|
});
|
|
2254
2240
|
});
|
|
2255
|
-
|
|
2256
|
-
var
|
|
2241
|
+
Ea.displayName = "ChatNotificationCardDeleteButton";
|
|
2242
|
+
var Da = a(function({ className: e, ...t }, n) {
|
|
2257
2243
|
return /* @__PURE__ */ z(D, {
|
|
2258
2244
|
ref: n,
|
|
2245
|
+
"data-slot": "chat-notification-card-close-button",
|
|
2259
2246
|
"aria-label": "Close notification",
|
|
2260
2247
|
size: "sm",
|
|
2261
2248
|
variant: "tertiary",
|
|
@@ -2264,43 +2251,47 @@ var Fa = a(function({ className: e, ...t }, n) {
|
|
|
2264
2251
|
children: /* @__PURE__ */ z(U, {})
|
|
2265
2252
|
});
|
|
2266
2253
|
});
|
|
2267
|
-
|
|
2268
|
-
function
|
|
2254
|
+
Da.displayName = "ChatNotificationCardCloseButton";
|
|
2255
|
+
function Oa({ children: e, className: t }) {
|
|
2269
2256
|
return /* @__PURE__ */ B("div", {
|
|
2257
|
+
"data-slot": "chat-notification-card-content",
|
|
2270
2258
|
"data-testid": "chat-notification-card-content",
|
|
2271
2259
|
className: I("flex flex-col items-start text-left gap-4", "relative pr-[40px]", t),
|
|
2272
|
-
children: [e, /* @__PURE__ */ z(
|
|
2260
|
+
children: [e, /* @__PURE__ */ z(Ma, {})]
|
|
2273
2261
|
});
|
|
2274
2262
|
}
|
|
2275
|
-
function
|
|
2276
|
-
return /* @__PURE__ */ z(
|
|
2263
|
+
function ka({ children: e, className: t }) {
|
|
2264
|
+
return /* @__PURE__ */ z(F, {
|
|
2277
2265
|
variant: "body-sm",
|
|
2278
2266
|
fontWeight: "semibold",
|
|
2267
|
+
"data-slot": "chat-notification-card-content-title",
|
|
2279
2268
|
"data-testid": "chat-notification-card-content-title",
|
|
2280
2269
|
className: I("text-text-primary", "text-left", t),
|
|
2281
2270
|
asChild: !0,
|
|
2282
2271
|
children: /* @__PURE__ */ z("span", { children: e })
|
|
2283
2272
|
});
|
|
2284
2273
|
}
|
|
2285
|
-
function
|
|
2286
|
-
return /* @__PURE__ */ z(
|
|
2274
|
+
function Aa({ children: e, className: t }) {
|
|
2275
|
+
return /* @__PURE__ */ z(F, {
|
|
2287
2276
|
variant: "body-sm",
|
|
2277
|
+
"data-slot": "chat-notification-card-content-description",
|
|
2288
2278
|
"data-testid": "chat-notification-card-content-description",
|
|
2289
2279
|
className: I("text-text-primary", "mt-8", "group-data-[expanded=false]/chat-notification-card:line-clamp-2", "w-full [&>div>*]:wrap-break-word", t),
|
|
2290
2280
|
asChild: !0,
|
|
2291
2281
|
children: /* @__PURE__ */ z("div", { children: e })
|
|
2292
2282
|
});
|
|
2293
2283
|
}
|
|
2294
|
-
function
|
|
2284
|
+
function ja({ children: e, className: t }) {
|
|
2295
2285
|
return /* @__PURE__ */ z("div", {
|
|
2286
|
+
"data-slot": "chat-notification-card-content-actions",
|
|
2296
2287
|
"data-testid": "chat-notification-card-content-actions",
|
|
2297
2288
|
role: "group",
|
|
2298
2289
|
className: I("hidden", "group-data-[expanded=true]/chat-notification-card:flex", "flex-row items-center gap-8", "mt-4", t),
|
|
2299
2290
|
children: e
|
|
2300
2291
|
});
|
|
2301
2292
|
}
|
|
2302
|
-
var
|
|
2303
|
-
let { isExpanded: a, toggleExpanded: o } =
|
|
2293
|
+
var Ma = a(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
2294
|
+
let { isExpanded: a, toggleExpanded: o } = fa();
|
|
2304
2295
|
function s(e) {
|
|
2305
2296
|
e.stopPropagation(), t?.(e);
|
|
2306
2297
|
}
|
|
@@ -2309,6 +2300,7 @@ var Ba = a(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
|
2309
2300
|
}
|
|
2310
2301
|
return /* @__PURE__ */ z(D, {
|
|
2311
2302
|
ref: i,
|
|
2303
|
+
"data-slot": "chat-notification-card-expand-button",
|
|
2312
2304
|
"data-testid": "chat-notification-card-expand-button",
|
|
2313
2305
|
size: "sm",
|
|
2314
2306
|
variant: "tertiary",
|
|
@@ -2317,68 +2309,75 @@ var Ba = a(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
|
2317
2309
|
onMouseDown: s,
|
|
2318
2310
|
onClick: c,
|
|
2319
2311
|
...r,
|
|
2320
|
-
children: z(a ?
|
|
2312
|
+
children: z(a ? fe : H, {})
|
|
2321
2313
|
});
|
|
2322
2314
|
});
|
|
2323
|
-
|
|
2324
|
-
var
|
|
2315
|
+
Ma.displayName = "ChatNotificationCardExpandButton";
|
|
2316
|
+
var Na = ga, Pa = Aa, Fa = Sa;
|
|
2325
2317
|
//#endregion
|
|
2326
2318
|
//#region src/components/chat-notification-popup/chat-notification-popup.tsx
|
|
2327
|
-
function
|
|
2328
|
-
return /* @__PURE__ */ z(
|
|
2319
|
+
function Ia({ children: e, ...t }) {
|
|
2320
|
+
return /* @__PURE__ */ z(M, {
|
|
2329
2321
|
...t,
|
|
2330
2322
|
children: e
|
|
2331
2323
|
});
|
|
2332
2324
|
}
|
|
2333
|
-
var
|
|
2334
|
-
return /* @__PURE__ */ z(
|
|
2335
|
-
ref:
|
|
2336
|
-
|
|
2325
|
+
var La = a(function({ children: e, ...t }, n) {
|
|
2326
|
+
return /* @__PURE__ */ z(N, {
|
|
2327
|
+
ref: n,
|
|
2328
|
+
"data-slot": "chat-notification-popup-trigger",
|
|
2329
|
+
...t,
|
|
2330
|
+
children: e
|
|
2337
2331
|
});
|
|
2338
2332
|
});
|
|
2339
|
-
|
|
2340
|
-
var
|
|
2341
|
-
return /* @__PURE__ */ z(
|
|
2333
|
+
La.displayName = "ChatNotificationPopupTrigger";
|
|
2334
|
+
var Ra = a(function({ children: e, className: t, ...n }, r) {
|
|
2335
|
+
return /* @__PURE__ */ z(ae, {
|
|
2342
2336
|
ref: r,
|
|
2337
|
+
"data-slot": "chat-notification-popup-content",
|
|
2343
2338
|
className: I("md:w-[467px]", t),
|
|
2344
2339
|
...n,
|
|
2345
2340
|
children: e
|
|
2346
2341
|
});
|
|
2347
2342
|
});
|
|
2348
|
-
|
|
2343
|
+
Ra.displayName = "ChatNotificationPopupContent";
|
|
2349
2344
|
//#endregion
|
|
2350
2345
|
//#region src/components/chat-reply/chat-reply.tsx
|
|
2351
|
-
function
|
|
2346
|
+
function za({ className: e, children: t, hasPadding: n = !0 }) {
|
|
2352
2347
|
return /* @__PURE__ */ z("ul", {
|
|
2353
2348
|
"data-testid": "chat-replies",
|
|
2349
|
+
"data-slot": "chat-replies",
|
|
2354
2350
|
"data-padding": n,
|
|
2355
2351
|
className: I("flex flex-col justify-start items-start gap-8", "data-[padding=true]:py-8 data-[padding=true]:px-16", e),
|
|
2356
2352
|
children: t
|
|
2357
2353
|
});
|
|
2358
2354
|
}
|
|
2359
|
-
function
|
|
2355
|
+
function Ba({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
2360
2356
|
return /* @__PURE__ */ z("li", {
|
|
2361
2357
|
"data-testid": "chat-reply",
|
|
2358
|
+
"data-slot": "chat-reply",
|
|
2362
2359
|
"data-multiline": n,
|
|
2363
2360
|
className: I("group/chat-reply", "flex gap-8 w-full min-h-[24px]", "data-[multiline=false]:flex-row items-center", "data-[multiline=true]:flex-wrap items-start", e),
|
|
2364
2361
|
...r,
|
|
2365
2362
|
children: t
|
|
2366
2363
|
});
|
|
2367
2364
|
}
|
|
2368
|
-
function
|
|
2369
|
-
return /* @__PURE__ */ z(
|
|
2365
|
+
function Va({ className: e, children: t, ...n }) {
|
|
2366
|
+
return /* @__PURE__ */ z(_, {
|
|
2370
2367
|
variant: "outlined",
|
|
2371
2368
|
size: "sm",
|
|
2372
2369
|
color: "secondary",
|
|
2373
2370
|
"data-testid": "chat-reply-label",
|
|
2371
|
+
"data-slot": "chat-reply-label",
|
|
2374
2372
|
className: I("shrink-0", e),
|
|
2375
2373
|
...n,
|
|
2376
2374
|
children: t
|
|
2377
2375
|
});
|
|
2378
2376
|
}
|
|
2379
|
-
function
|
|
2380
|
-
return /* @__PURE__ */ z(
|
|
2377
|
+
function Ha({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
2378
|
+
return /* @__PURE__ */ z(F, {
|
|
2381
2379
|
"data-testid": "chat-reply-value",
|
|
2380
|
+
"data-slot": "chat-reply-value",
|
|
2382
2381
|
variant: "body-sm",
|
|
2383
2382
|
className: I("leading-[24px]", "flex flex-1 min-w-0 text-text-secondary", "items-start", "group-data-[multiline=false]/chat-reply:flex-1 truncate", "group-data-[multiline=true]/chat-reply:flex-wrap", "group-data-[multiline=true]/chat-reply:gap-4", e),
|
|
2384
2383
|
asChild: !0,
|
|
@@ -2388,89 +2387,115 @@ function Xa({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
|
2388
2387
|
}
|
|
2389
2388
|
//#endregion
|
|
2390
2389
|
//#region src/components/chat-suggestion/chat-suggestion.tsx
|
|
2391
|
-
var
|
|
2392
|
-
function
|
|
2393
|
-
let e = l(
|
|
2390
|
+
var Ua = i(null);
|
|
2391
|
+
function Wa() {
|
|
2392
|
+
let e = l(Ua);
|
|
2394
2393
|
if (!e) throw Error("\"useChatSuggestionContext\" must be used within a ChatSuggestion");
|
|
2395
2394
|
return e;
|
|
2396
2395
|
}
|
|
2397
|
-
|
|
2398
|
-
return /* @__PURE__ */ z(
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
children:
|
|
2396
|
+
var Ga = a(function({ children: e, className: t, hasLoop: i = !0, ...a }, s) {
|
|
2397
|
+
return /* @__PURE__ */ z(ee, {
|
|
2398
|
+
asChild: !0,
|
|
2399
|
+
hasLoop: i,
|
|
2400
|
+
ref: s,
|
|
2401
|
+
...a,
|
|
2402
|
+
children: /* @__PURE__ */ z("ol", {
|
|
2403
|
+
"data-slot": "chat-suggestions",
|
|
2404
|
+
"data-testid": "chat-suggestions",
|
|
2405
|
+
className: I("m-0 p-0 list-none flex flex-col items-stretch gap-0", t),
|
|
2406
|
+
children: n.map(e, (e, t) => o(e) ? r(e, { index: t }) : e)
|
|
2407
|
+
})
|
|
2404
2408
|
});
|
|
2405
|
-
}
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2409
|
+
});
|
|
2410
|
+
Ga.displayName = "ChatSuggestions";
|
|
2411
|
+
var Ka = a(function({ index: e, children: t, className: n, triggerClassName: r, onHover: i, onMouseEnter: a, ...o }, s) {
|
|
2412
|
+
let c = p(() => ({ index: e }), [e]);
|
|
2413
|
+
function l(e) {
|
|
2414
|
+
a?.(e), i?.();
|
|
2415
|
+
}
|
|
2416
|
+
return /* @__PURE__ */ z(Ua.Provider, {
|
|
2417
|
+
value: c,
|
|
2418
|
+
children: /* @__PURE__ */ B(te, {
|
|
2419
|
+
ref: s,
|
|
2420
|
+
"data-slot": "chat-suggestion",
|
|
2421
|
+
className: le(I("relative items-start gap-0 p-4 text-typography-text-secondary", n), { highlighted: "bg-layout-accent-low-background-hover-default" }),
|
|
2422
|
+
...o,
|
|
2423
|
+
onMouseEnter: l,
|
|
2424
|
+
children: [/* @__PURE__ */ z(A, { className: I("absolute inset-0 rounded-[inherit] outline-none", r) }), t]
|
|
2416
2425
|
})
|
|
2417
2426
|
});
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
|
|
2427
|
+
});
|
|
2428
|
+
Ka.displayName = "ChatSuggestion";
|
|
2429
|
+
function qa({ children: e, className: t, innerClassName: n }) {
|
|
2430
|
+
let { index: r = 0 } = Wa();
|
|
2421
2431
|
return /* @__PURE__ */ z("span", {
|
|
2422
2432
|
"aria-hidden": "true",
|
|
2433
|
+
"data-slot": "chat-suggestion-label-icon",
|
|
2423
2434
|
className: I("inline-flex flex-row justify-center items-center shrink-0 size-auto text-inherit", t),
|
|
2424
2435
|
children: /* @__PURE__ */ z("span", {
|
|
2425
2436
|
"aria-hidden": "true",
|
|
2426
|
-
|
|
2427
|
-
|
|
2437
|
+
"data-slot": "chat-suggestion-label-icon-inner",
|
|
2438
|
+
className: I("size-[32px]", "inline-flex items-center justify-center", "px-8 py-[7px]", "[&_svg]:size-[18px]!", n),
|
|
2439
|
+
children: e || /* @__PURE__ */ z(ie, { children: /* @__PURE__ */ z(F, {
|
|
2428
2440
|
variant: "caption-md",
|
|
2429
|
-
fontWeight: "
|
|
2441
|
+
fontWeight: "semibold",
|
|
2430
2442
|
className: "text-inherit",
|
|
2431
|
-
|
|
2432
|
-
|
|
2443
|
+
asChild: !0,
|
|
2444
|
+
children: /* @__PURE__ */ z("span", { children: r + 1 })
|
|
2445
|
+
}) })
|
|
2433
2446
|
})
|
|
2434
2447
|
});
|
|
2435
2448
|
}
|
|
2436
|
-
function
|
|
2437
|
-
return /* @__PURE__ */ z(
|
|
2449
|
+
function Ja({ children: e, className: t, isMultiline: n = !0 }) {
|
|
2450
|
+
return /* @__PURE__ */ z(F, {
|
|
2438
2451
|
variant: "body-small-low",
|
|
2452
|
+
"data-slot": "chat-suggestion-label",
|
|
2439
2453
|
"data-multiline": n,
|
|
2440
|
-
className: I("gap-0 px-4 my-[7px]", "h-full flex-1 items-center justify-center text-left text-inherit", "data-[multiline=false]:truncate", "data-[multiline=true]:line-clamp-3", t),
|
|
2441
|
-
|
|
2454
|
+
className: I("gap-0 px-4 my-[7px]", "h-full min-w-0 flex-1 items-center justify-center text-left text-inherit", "data-[multiline=false]:truncate", "data-[multiline=true]:line-clamp-3", t),
|
|
2455
|
+
asChild: !0,
|
|
2456
|
+
children: /* @__PURE__ */ z(k, { children: e })
|
|
2442
2457
|
});
|
|
2443
2458
|
}
|
|
2444
|
-
function
|
|
2459
|
+
function Ya({ children: e, className: t }) {
|
|
2445
2460
|
return /* @__PURE__ */ z("div", {
|
|
2446
2461
|
role: "group",
|
|
2447
|
-
|
|
2462
|
+
"data-slot": "chat-suggestion-actions",
|
|
2463
|
+
className: I("shrink-0 flex items-center justify-center gap-8", "self-start", "min-w-[32px] h-[32px]", "pointer-events-none", "*:text-secondary-main", "[&>svg]:size-[18px]!", "opacity-0", "group-data-highlighted/list-item:opacity-100", t),
|
|
2448
2464
|
children: e
|
|
2449
2465
|
});
|
|
2450
2466
|
}
|
|
2467
|
+
var Xa = a(function({ className: e, children: t, ...n }, r) {
|
|
2468
|
+
return /* @__PURE__ */ z(O, {
|
|
2469
|
+
ref: r,
|
|
2470
|
+
className: I("pointer-events-auto", e),
|
|
2471
|
+
...n,
|
|
2472
|
+
children: t
|
|
2473
|
+
});
|
|
2474
|
+
});
|
|
2475
|
+
Xa.displayName = "ChatSuggestionAction";
|
|
2451
2476
|
//#endregion
|
|
2452
2477
|
//#region src/components/chat-thread/chat-thread.tsx
|
|
2453
|
-
function
|
|
2478
|
+
function Za(e, t) {
|
|
2454
2479
|
let n = a((t, n) => e({
|
|
2455
2480
|
...t,
|
|
2456
2481
|
ref: n
|
|
2457
2482
|
}));
|
|
2458
2483
|
return n.displayName = t, n;
|
|
2459
2484
|
}
|
|
2460
|
-
var
|
|
2461
|
-
function
|
|
2485
|
+
var Qa = Za(zt.Viewport, "ChatThreadViewportPrimitive"), $a = Za(zt.Content, "ChatThreadContentPrimitive"), eo = Za(zt.Item, "ChatThreadItemPrimitive");
|
|
2486
|
+
function to(e, t) {
|
|
2462
2487
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
2463
2488
|
}
|
|
2464
|
-
var
|
|
2489
|
+
var no = 12, ro = "--chat-thread-group-min-height", io = {
|
|
2465
2490
|
scrollToEnd: () => !1,
|
|
2466
2491
|
scrollToMessage: () => !1,
|
|
2467
2492
|
scrollToStart: () => !1
|
|
2468
|
-
},
|
|
2469
|
-
function
|
|
2470
|
-
return l(
|
|
2493
|
+
}, ao = i(null);
|
|
2494
|
+
function oo() {
|
|
2495
|
+
return l(ao) ?? io;
|
|
2471
2496
|
}
|
|
2472
|
-
function
|
|
2473
|
-
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } =
|
|
2497
|
+
function so({ children: e }) {
|
|
2498
|
+
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } = Bt(), i = p(() => ({
|
|
2474
2499
|
scrollToEnd: t,
|
|
2475
2500
|
scrollToMessage: n,
|
|
2476
2501
|
scrollToStart: r
|
|
@@ -2479,28 +2504,28 @@ function ho({ children: e }) {
|
|
|
2479
2504
|
n,
|
|
2480
2505
|
r
|
|
2481
2506
|
]);
|
|
2482
|
-
return /* @__PURE__ */ z(
|
|
2507
|
+
return /* @__PURE__ */ z(ao.Provider, {
|
|
2483
2508
|
value: i,
|
|
2484
2509
|
children: e
|
|
2485
2510
|
});
|
|
2486
2511
|
}
|
|
2487
|
-
var
|
|
2488
|
-
function
|
|
2489
|
-
let t = l(
|
|
2512
|
+
var co = i(null);
|
|
2513
|
+
function lo(e) {
|
|
2514
|
+
let t = l(co);
|
|
2490
2515
|
if (!t) throw Error(`[web-chat-ui] <${e}> must be rendered inside <ChatThreadProvider>`);
|
|
2491
2516
|
return t;
|
|
2492
2517
|
}
|
|
2493
|
-
function
|
|
2518
|
+
function uo(e, t, n) {
|
|
2494
2519
|
return {
|
|
2495
2520
|
id: e,
|
|
2496
2521
|
conversationId: t ?? null,
|
|
2497
2522
|
knownGroupIds: n.length === 0 ? null : new Set(n)
|
|
2498
2523
|
};
|
|
2499
2524
|
}
|
|
2500
|
-
function
|
|
2501
|
-
let [u, d] =
|
|
2502
|
-
(u.conversationId !== (t ?? null) || u.knownGroupIds === null != (n.length === 0)) && d(
|
|
2503
|
-
let { knownGroupIds: f } = u,
|
|
2525
|
+
function fo({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1, scrollMode: i = "anchor", autoScroll: a = i === "follow" || !r, defaultScrollPosition: o = "end", scrollPreviousItemPeek: s = 0, scrollMargin: c = no, ...l }) {
|
|
2526
|
+
let [u, d] = h(() => uo(0, t, n));
|
|
2527
|
+
(u.conversationId !== (t ?? null) || u.knownGroupIds === null != (n.length === 0)) && d(uo(u.id + 1, t, n));
|
|
2528
|
+
let { knownGroupIds: f } = u, m = p(() => ({
|
|
2504
2529
|
isStreaming: r,
|
|
2505
2530
|
scrollMargin: c,
|
|
2506
2531
|
scrollMode: i,
|
|
@@ -2511,24 +2536,24 @@ function yo({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1,
|
|
|
2511
2536
|
i,
|
|
2512
2537
|
f
|
|
2513
2538
|
]);
|
|
2514
|
-
return /* @__PURE__ */ z(
|
|
2539
|
+
return /* @__PURE__ */ z(zt.Provider, {
|
|
2515
2540
|
autoScroll: a,
|
|
2516
2541
|
scrollPreviousItemPeek: s,
|
|
2517
2542
|
scrollMargin: c,
|
|
2518
2543
|
defaultScrollPosition: o,
|
|
2519
2544
|
...l,
|
|
2520
|
-
children: /* @__PURE__ */ B(
|
|
2521
|
-
value:
|
|
2522
|
-
children: [i === "follow" && /* @__PURE__ */ z(
|
|
2545
|
+
children: /* @__PURE__ */ B(co.Provider, {
|
|
2546
|
+
value: m,
|
|
2547
|
+
children: [i === "follow" && /* @__PURE__ */ z(po, {
|
|
2523
2548
|
groupIds: n,
|
|
2524
2549
|
knownGroupIds: f
|
|
2525
|
-
}), /* @__PURE__ */ z(
|
|
2550
|
+
}), /* @__PURE__ */ z(so, { children: e })]
|
|
2526
2551
|
})
|
|
2527
2552
|
}, u.id);
|
|
2528
2553
|
}
|
|
2529
|
-
function
|
|
2530
|
-
let { scrollToEnd: n } =
|
|
2531
|
-
return
|
|
2554
|
+
function po({ groupIds: e, knownGroupIds: t }) {
|
|
2555
|
+
let { scrollToEnd: n } = Bt(), r = e.at(-1);
|
|
2556
|
+
return f(() => {
|
|
2532
2557
|
r === void 0 || t === null || t.has(r) || n({ behavior: "auto" });
|
|
2533
2558
|
}, [
|
|
2534
2559
|
r,
|
|
@@ -2536,59 +2561,64 @@ function bo({ groupIds: e, knownGroupIds: t }) {
|
|
|
2536
2561
|
n
|
|
2537
2562
|
]), null;
|
|
2538
2563
|
}
|
|
2539
|
-
var
|
|
2540
|
-
let { isStreaming:
|
|
2541
|
-
|
|
2542
|
-
}, [
|
|
2543
|
-
|
|
2544
|
-
}, [
|
|
2545
|
-
return
|
|
2564
|
+
var mo = a(function({ children: e, className: t, viewportClassName: n, contentClassName: r, viewportRef: i, contentRef: a, scrollButton: o = !0, scrollButtonClassName: s, scrollButtonTooltip: l, isLoading: u = !1, hasError: d = !1, error: f, renderError: p, ...h }, g) {
|
|
2565
|
+
let { isStreaming: _, scrollMargin: v, scrollMode: y } = lo("ChatThread"), b = y === "anchor", x = m(null), S = m(null), C = c((e) => {
|
|
2566
|
+
x.current = e, to(i, e), to(g, e?.parentElement ?? null);
|
|
2567
|
+
}, [i, g]), w = c((e) => {
|
|
2568
|
+
S.current = e, to(a, e);
|
|
2569
|
+
}, [a]);
|
|
2570
|
+
return ho(x, S, v, b), /* @__PURE__ */ B(zt.Root, {
|
|
2571
|
+
"data-slot": "chat-thread",
|
|
2546
2572
|
"data-testid": "chat-thread",
|
|
2547
|
-
"data-scroll-mode":
|
|
2548
|
-
"data-
|
|
2549
|
-
"data-
|
|
2573
|
+
"data-scroll-mode": y,
|
|
2574
|
+
"data-streaming": _,
|
|
2575
|
+
"data-loading": u,
|
|
2576
|
+
"data-error": d,
|
|
2550
2577
|
className: I("relative flex flex-col flex-1 min-h-0 overflow-hidden", t),
|
|
2551
|
-
...
|
|
2578
|
+
...h,
|
|
2552
2579
|
children: [
|
|
2553
|
-
/* @__PURE__ */ z(
|
|
2554
|
-
ref:
|
|
2580
|
+
/* @__PURE__ */ z(Qa, {
|
|
2581
|
+
ref: C,
|
|
2582
|
+
"data-slot": "chat-thread-viewport",
|
|
2555
2583
|
"aria-label": "Chat message history",
|
|
2556
|
-
className: I("size-full overflow-x-hidden overflow-y-auto outline-none", "will-change-scroll transform-gpu",
|
|
2584
|
+
className: I("size-full overflow-x-hidden overflow-y-auto outline-none", "will-change-scroll transform-gpu", b && _ && "scroll-smooth", n),
|
|
2557
2585
|
style: {
|
|
2558
2586
|
scrollbarGutter: "stable both-edges",
|
|
2559
2587
|
scrollbarWidth: "thin",
|
|
2560
2588
|
scrollbarColor: "var(--color-scrollbar-thumb) transparent"
|
|
2561
2589
|
},
|
|
2562
|
-
children: /* @__PURE__ */ z(
|
|
2563
|
-
ref:
|
|
2564
|
-
"
|
|
2590
|
+
children: /* @__PURE__ */ z($a, {
|
|
2591
|
+
ref: w,
|
|
2592
|
+
"data-slot": "chat-thread-content",
|
|
2593
|
+
"aria-busy": _,
|
|
2565
2594
|
"data-testid": "chat-thread-content",
|
|
2566
|
-
className: I("relative flex flex-col gap-16",
|
|
2595
|
+
className: I("relative flex flex-col gap-16", b ? "[&>[data-chat-thread-group]:nth-last-child(2)]:min-h-(--chat-thread-group-min-height)" : "min-h-full justify-end", r),
|
|
2567
2596
|
children: e
|
|
2568
2597
|
})
|
|
2569
2598
|
}),
|
|
2570
|
-
|
|
2571
|
-
error:
|
|
2572
|
-
children:
|
|
2599
|
+
d && !u && /* @__PURE__ */ z(bo, {
|
|
2600
|
+
error: f,
|
|
2601
|
+
children: p?.(f)
|
|
2573
2602
|
}),
|
|
2574
|
-
|
|
2575
|
-
className:
|
|
2576
|
-
tooltip:
|
|
2603
|
+
o && /* @__PURE__ */ z(yo, {
|
|
2604
|
+
className: s,
|
|
2605
|
+
tooltip: l
|
|
2577
2606
|
})
|
|
2578
2607
|
]
|
|
2579
2608
|
});
|
|
2580
2609
|
});
|
|
2581
|
-
|
|
2582
|
-
|
|
2610
|
+
mo.displayName = "ChatThread";
|
|
2611
|
+
function ho(e, t, n, r) {
|
|
2612
|
+
f(() => {
|
|
2583
2613
|
let i = e.current, a = t.current;
|
|
2584
2614
|
if (!i || !a) return;
|
|
2585
2615
|
if (!r) {
|
|
2586
|
-
a.style.removeProperty(
|
|
2616
|
+
a.style.removeProperty(ro);
|
|
2587
2617
|
return;
|
|
2588
2618
|
}
|
|
2589
2619
|
let o = () => {
|
|
2590
2620
|
let { paddingTop: e, paddingBottom: t } = window.getComputedStyle(a), r = i.clientHeight - (Number.parseFloat(e) || 0) - (Number.parseFloat(t) || 0) - n;
|
|
2591
|
-
a.style.setProperty(
|
|
2621
|
+
a.style.setProperty(ro, `${Math.max(0, r)}px`);
|
|
2592
2622
|
};
|
|
2593
2623
|
if (o(), typeof ResizeObserver > "u") return;
|
|
2594
2624
|
let s = new ResizeObserver(o);
|
|
@@ -2600,41 +2630,53 @@ function So(e, t, n, r) {
|
|
|
2600
2630
|
r
|
|
2601
2631
|
]);
|
|
2602
2632
|
}
|
|
2603
|
-
var
|
|
2604
|
-
let { knownGroupIds:
|
|
2605
|
-
return /* @__PURE__ */ z(
|
|
2606
|
-
ref:
|
|
2633
|
+
var go = a(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
2634
|
+
let { knownGroupIds: a, scrollMode: o } = lo("ChatThreadGroup"), s = o === "anchor" && a !== null && !a.has(e);
|
|
2635
|
+
return /* @__PURE__ */ z(eo, {
|
|
2636
|
+
ref: i,
|
|
2607
2637
|
messageId: `chat-thread-group-${e}`,
|
|
2608
|
-
scrollAnchor:
|
|
2638
|
+
scrollAnchor: s,
|
|
2639
|
+
"data-slot": "chat-thread-group",
|
|
2609
2640
|
"data-chat-thread-group": "",
|
|
2610
2641
|
className: I("flex flex-col gap-16 w-full min-h-px mx-auto", t),
|
|
2611
|
-
...
|
|
2642
|
+
...r,
|
|
2643
|
+
children: n
|
|
2612
2644
|
});
|
|
2613
|
-
})
|
|
2645
|
+
});
|
|
2646
|
+
go.displayName = "ChatThreadGroup";
|
|
2647
|
+
var _o = a(function({ messageId: e, children: t, ...n }, r) {
|
|
2614
2648
|
return /* @__PURE__ */ z("div", {
|
|
2615
|
-
ref:
|
|
2649
|
+
ref: r,
|
|
2650
|
+
"data-slot": "chat-thread-question",
|
|
2616
2651
|
"data-chat-thread-question": "",
|
|
2617
2652
|
"data-chat-thread-message-id": e,
|
|
2618
|
-
...
|
|
2653
|
+
...n,
|
|
2654
|
+
children: t
|
|
2619
2655
|
});
|
|
2620
|
-
})
|
|
2656
|
+
});
|
|
2657
|
+
_o.displayName = "ChatThreadQuestion";
|
|
2658
|
+
var vo = a(function({ messageId: e, children: t, ...n }, r) {
|
|
2621
2659
|
return /* @__PURE__ */ z("div", {
|
|
2622
|
-
ref:
|
|
2660
|
+
ref: r,
|
|
2661
|
+
"data-slot": "chat-thread-answer",
|
|
2623
2662
|
"data-chat-thread-answer": "",
|
|
2624
2663
|
"data-chat-thread-message-id": e,
|
|
2625
|
-
...
|
|
2664
|
+
...n,
|
|
2665
|
+
children: t
|
|
2626
2666
|
});
|
|
2627
2667
|
});
|
|
2628
|
-
|
|
2629
|
-
|
|
2668
|
+
vo.displayName = "ChatThreadAnswer";
|
|
2669
|
+
function yo({ className: e, tooltip: t }) {
|
|
2670
|
+
let { end: n } = Vt();
|
|
2630
2671
|
return /* @__PURE__ */ z("div", {
|
|
2672
|
+
"data-slot": "chat-thread-scroll-button",
|
|
2631
2673
|
"data-testid": "chat-message-history-scroll-button",
|
|
2632
2674
|
"data-hidden": !n,
|
|
2633
2675
|
"aria-hidden": !n || void 0,
|
|
2634
2676
|
className: I("absolute", "px-[12px]", "bottom-0", "right-0 -translate-x-[12px]", "md:right-auto md:left-1/2 md:-translate-x-1/2", "-translate-y-[12px]", "flex items-center justify-center", "transition-opacity duration-200 ease-in-out", "data-[hidden=true]:pointer-events-none", "data-[hidden=true]:opacity-0 data-[hidden=false]:opacity-100", e),
|
|
2635
|
-
children: /* @__PURE__ */ z(
|
|
2677
|
+
children: /* @__PURE__ */ z(zt.Button, {
|
|
2636
2678
|
direction: "end",
|
|
2637
|
-
render: ({ inert: e, children: n, ...r }) => /* @__PURE__ */ z(
|
|
2679
|
+
render: ({ inert: e, children: n, ...r }) => /* @__PURE__ */ z(P, {
|
|
2638
2680
|
tooltip: t,
|
|
2639
2681
|
side: "top",
|
|
2640
2682
|
children: /* @__PURE__ */ z(D, {
|
|
@@ -2651,8 +2693,9 @@ function Eo({ className: e, tooltip: t }) {
|
|
|
2651
2693
|
})
|
|
2652
2694
|
});
|
|
2653
2695
|
}
|
|
2654
|
-
function
|
|
2696
|
+
function bo({ children: e, error: t, className: n }) {
|
|
2655
2697
|
return /* @__PURE__ */ z("div", {
|
|
2698
|
+
"data-slot": "chat-thread-error-state",
|
|
2656
2699
|
"data-testid": "chat-message-history-error-state",
|
|
2657
2700
|
role: "alert",
|
|
2658
2701
|
"aria-live": "assertive",
|
|
@@ -2666,43 +2709,46 @@ function Do({ children: e, error: t, className: n }) {
|
|
|
2666
2709
|
}
|
|
2667
2710
|
//#endregion
|
|
2668
2711
|
//#region src/components/canvas-shell/canvas-shell.tsx
|
|
2669
|
-
function
|
|
2712
|
+
function xo({ className: e, children: t, ...n }) {
|
|
2670
2713
|
return /* @__PURE__ */ z("section", {
|
|
2671
2714
|
"data-slot": "canvas-shell",
|
|
2672
|
-
className:
|
|
2673
|
-
...
|
|
2715
|
+
className: I("grid grid-cols-1 grid-rows-[auto_minmax(0,1fr)_auto]", "h-full overflow-hidden", e),
|
|
2716
|
+
...n,
|
|
2717
|
+
children: t
|
|
2674
2718
|
});
|
|
2675
2719
|
}
|
|
2676
|
-
function
|
|
2720
|
+
function So({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
2677
2721
|
return /* @__PURE__ */ z("header", {
|
|
2678
2722
|
"data-slot": "canvas-shell-header",
|
|
2679
|
-
"data-separator":
|
|
2680
|
-
className:
|
|
2681
|
-
...
|
|
2723
|
+
"data-separator": n,
|
|
2724
|
+
className: I("row-start-1", "flex items-center gap-[8px]", "p-[12px] md:p-[16px]", "data-[separator=true]:border-b data-[separator=true]:border-brand-secondary-700", e),
|
|
2725
|
+
...r,
|
|
2726
|
+
children: t
|
|
2682
2727
|
});
|
|
2683
2728
|
}
|
|
2684
|
-
function
|
|
2685
|
-
return /* @__PURE__ */ z(
|
|
2729
|
+
function Co({ className: e, children: t, ...n }) {
|
|
2730
|
+
return /* @__PURE__ */ z(F, {
|
|
2686
2731
|
"data-slot": "canvas-shell-title",
|
|
2687
2732
|
variant: "label-xl",
|
|
2688
2733
|
fontWeight: "normal",
|
|
2689
|
-
className:
|
|
2690
|
-
...
|
|
2734
|
+
className: I("flex-1 min-w-0 truncate", e),
|
|
2735
|
+
...n,
|
|
2736
|
+
children: t
|
|
2691
2737
|
});
|
|
2692
2738
|
}
|
|
2693
|
-
function
|
|
2739
|
+
function wo({ className: e, children: t, ...n }) {
|
|
2694
2740
|
return /* @__PURE__ */ z(D, {
|
|
2695
2741
|
"data-slot": "canvas-shell-close-trigger",
|
|
2696
2742
|
type: "button",
|
|
2697
2743
|
variant: "tertiary",
|
|
2698
2744
|
size: "md",
|
|
2699
2745
|
"aria-label": "Close panel",
|
|
2700
|
-
className:
|
|
2746
|
+
className: I("shrink-0", e),
|
|
2701
2747
|
...n,
|
|
2702
2748
|
children: t || /* @__PURE__ */ z(U, {})
|
|
2703
2749
|
});
|
|
2704
2750
|
}
|
|
2705
|
-
function
|
|
2751
|
+
function To({ className: e, children: t, isFullScreen: n, labels: r, ...i }) {
|
|
2706
2752
|
return /* @__PURE__ */ z(D, {
|
|
2707
2753
|
"data-slot": "canvas-shell-full-screen-trigger",
|
|
2708
2754
|
type: "button",
|
|
@@ -2710,20 +2756,20 @@ function Mo({ className: e, children: t, isFullScreen: n, labels: r, ...i }) {
|
|
|
2710
2756
|
size: "md",
|
|
2711
2757
|
"aria-pressed": n,
|
|
2712
2758
|
"aria-label": n ? r?.exit ?? "Exit full screen" : r?.enter ?? "Full screen",
|
|
2713
|
-
className:
|
|
2759
|
+
className: I("shrink-0 max-md:hidden", e),
|
|
2714
2760
|
...i,
|
|
2715
|
-
children: t || /* @__PURE__ */ z(
|
|
2761
|
+
children: t || /* @__PURE__ */ z(ke, {})
|
|
2716
2762
|
});
|
|
2717
2763
|
}
|
|
2718
|
-
function
|
|
2719
|
-
let [a, o] =
|
|
2764
|
+
function Eo({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i }) {
|
|
2765
|
+
let [a, o] = h(!1);
|
|
2720
2766
|
function s(e) {
|
|
2721
2767
|
o(e), r?.(e);
|
|
2722
2768
|
}
|
|
2723
|
-
return /* @__PURE__ */ B(
|
|
2769
|
+
return /* @__PURE__ */ B(re, {
|
|
2724
2770
|
modal: !1,
|
|
2725
2771
|
onOpenChange: s,
|
|
2726
|
-
children: [/* @__PURE__ */ z(
|
|
2772
|
+
children: [/* @__PURE__ */ z(j, {
|
|
2727
2773
|
asChild: !0,
|
|
2728
2774
|
children: /* @__PURE__ */ z(D, {
|
|
2729
2775
|
"data-slot": "canvas-shell-options-button",
|
|
@@ -2732,181 +2778,42 @@ function No({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i
|
|
|
2732
2778
|
size: "md",
|
|
2733
2779
|
isActive: a,
|
|
2734
2780
|
"aria-label": "More options",
|
|
2735
|
-
className:
|
|
2781
|
+
className: I("shrink-0", e),
|
|
2736
2782
|
...i,
|
|
2737
|
-
children: /* @__PURE__ */ z(
|
|
2783
|
+
children: /* @__PURE__ */ z(Oe, {})
|
|
2738
2784
|
})
|
|
2739
|
-
}), /* @__PURE__ */ z(
|
|
2740
|
-
className:
|
|
2785
|
+
}), /* @__PURE__ */ z(ne, {
|
|
2786
|
+
className: I("w-[200px]", n),
|
|
2741
2787
|
children: t
|
|
2742
2788
|
})]
|
|
2743
2789
|
});
|
|
2744
2790
|
}
|
|
2745
|
-
var
|
|
2746
|
-
function
|
|
2791
|
+
var Do = "px-[12px] md:px-[16px]";
|
|
2792
|
+
function Oo({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, hasScroll: i = !0, ...a }) {
|
|
2747
2793
|
return /* @__PURE__ */ z("div", {
|
|
2748
2794
|
"data-slot": "canvas-shell-content",
|
|
2749
|
-
"data-has-scroll":
|
|
2750
|
-
className:
|
|
2751
|
-
...
|
|
2795
|
+
"data-has-scroll": i,
|
|
2796
|
+
className: I("row-start-2", "relative min-w-0 overflow-hidden", e),
|
|
2797
|
+
...a,
|
|
2752
2798
|
children: /* @__PURE__ */ z("div", {
|
|
2753
2799
|
"data-slot": "canvas-shell-content-body",
|
|
2754
|
-
"data-spacing":
|
|
2755
|
-
className:
|
|
2756
|
-
children:
|
|
2800
|
+
"data-spacing": r,
|
|
2801
|
+
className: I("size-full", "py-[16px]", r && "px-[12px] md:px-[16px]", i ? "overflow-auto" : "overflow-hidden", n),
|
|
2802
|
+
children: t
|
|
2757
2803
|
})
|
|
2758
2804
|
});
|
|
2759
2805
|
}
|
|
2760
|
-
function
|
|
2806
|
+
function ko({ className: e, children: t, ...n }) {
|
|
2761
2807
|
return /* @__PURE__ */ z("footer", {
|
|
2762
2808
|
"data-slot": "canvas-shell-footer",
|
|
2763
|
-
className:
|
|
2764
|
-
...
|
|
2765
|
-
|
|
2766
|
-
}
|
|
2767
|
-
//#endregion
|
|
2768
|
-
//#region src/components/card-item-picker/card-item-picker-context.tsx
|
|
2769
|
-
var Lo = i(null);
|
|
2770
|
-
function Ro() {
|
|
2771
|
-
let e = l(Lo);
|
|
2772
|
-
if (!e) throw Error("useCardItemPickerListContext must be used within a CardItemPickerList");
|
|
2773
|
-
return e;
|
|
2774
|
-
}
|
|
2775
|
-
var zo = i(null);
|
|
2776
|
-
function Bo() {
|
|
2777
|
-
let e = l(zo);
|
|
2778
|
-
if (!e) throw Error("useCardItemPickerRowContext must be used within a CardItemPickerRow");
|
|
2779
|
-
return e;
|
|
2780
|
-
}
|
|
2781
|
-
//#endregion
|
|
2782
|
-
//#region src/components/card-item-picker/card-item-picker-list.tsx
|
|
2783
|
-
function Vo({ value: e, hoveredValue: t = null, onValueChange: n, onHoverChange: r, orientation: i = "vertical", className: a, children: o, ...s }) {
|
|
2784
|
-
let [l, u] = g(null), d = l ?? (e == null ? null : String(e)), f = h(r);
|
|
2785
|
-
f.current = r;
|
|
2786
|
-
let p = h(n);
|
|
2787
|
-
p.current = n;
|
|
2788
|
-
let _ = c((e) => p.current(e), []), v = c((e) => f.current?.(e), []), y = m(() => ({
|
|
2789
|
-
value: e,
|
|
2790
|
-
hoveredValue: t,
|
|
2791
|
-
orientation: i,
|
|
2792
|
-
select: _,
|
|
2793
|
-
hover: v
|
|
2794
|
-
}), [
|
|
2795
|
-
e,
|
|
2796
|
-
t,
|
|
2797
|
-
i,
|
|
2798
|
-
_,
|
|
2799
|
-
v
|
|
2800
|
-
]);
|
|
2801
|
-
return /* @__PURE__ */ z(Lo.Provider, {
|
|
2802
|
-
value: y,
|
|
2803
|
-
children: /* @__PURE__ */ z(Bt.Root, {
|
|
2804
|
-
asChild: !0,
|
|
2805
|
-
orientation: i,
|
|
2806
|
-
currentTabStopId: d,
|
|
2807
|
-
onCurrentTabStopIdChange: u,
|
|
2808
|
-
children: /* @__PURE__ */ z("ul", {
|
|
2809
|
-
...s,
|
|
2810
|
-
role: "listbox",
|
|
2811
|
-
"aria-orientation": i,
|
|
2812
|
-
className: F("flex gap-[4px]", i === "vertical" ? "flex-col" : "flex-row", a),
|
|
2813
|
-
children: o
|
|
2814
|
-
})
|
|
2815
|
-
})
|
|
2816
|
-
});
|
|
2817
|
-
}
|
|
2818
|
-
//#endregion
|
|
2819
|
-
//#region src/components/card-item-picker/card-item-picker-row.tsx
|
|
2820
|
-
var Ho = a(function({ value: e, className: t, children: n, onClick: r, onKeyDown: i, onMouseEnter: a, onMouseLeave: o, ...s }, c) {
|
|
2821
|
-
let l = Ro(), u = d(), [f, p] = g(!1), [h, _] = g(!1), v = l.value === e, y = l.hoveredValue === e, b = m(() => ({
|
|
2822
|
-
isSelected: v,
|
|
2823
|
-
titleId: `${u}-title`,
|
|
2824
|
-
descriptionId: `${u}-description`,
|
|
2825
|
-
registerTitle: () => (p(!0), () => p(!1)),
|
|
2826
|
-
registerDescription: () => (_(!0), () => _(!1))
|
|
2827
|
-
}), [u, v]);
|
|
2828
|
-
function x(t) {
|
|
2829
|
-
i?.(t), !t.defaultPrevented && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), l.select(e));
|
|
2830
|
-
}
|
|
2831
|
-
return /* @__PURE__ */ z(zo.Provider, {
|
|
2832
|
-
value: b,
|
|
2833
|
-
children: /* @__PURE__ */ z(Bt.Item, {
|
|
2834
|
-
asChild: !0,
|
|
2835
|
-
tabStopId: String(e),
|
|
2836
|
-
children: /* @__PURE__ */ z("li", {
|
|
2837
|
-
...s,
|
|
2838
|
-
ref: c,
|
|
2839
|
-
role: "option",
|
|
2840
|
-
"aria-selected": v,
|
|
2841
|
-
"aria-labelledby": f ? b.titleId : void 0,
|
|
2842
|
-
"aria-describedby": h ? b.descriptionId : void 0,
|
|
2843
|
-
"data-selected": v,
|
|
2844
|
-
"data-hovered": y,
|
|
2845
|
-
className: F("relative flex flex-row items-start gap-4", "w-full cursor-pointer rounded-(--st-border-radius-md) p-8", "transition-colors duration-150", "hover:bg-layout-accent-low-background-hover-base", "data-[selected=true]:bg-layout-accent-low-background-pressed-base", "data-[selected=true]:not-focus-visible:ring-1 data-[selected=true]:not-focus-visible:ring-inset", "data-[selected=true]:not-focus-visible:ring-brand-secondary-700", "outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary-focus-visible", t),
|
|
2846
|
-
onClick: (t) => {
|
|
2847
|
-
r?.(t), t.defaultPrevented || l.select(e);
|
|
2848
|
-
},
|
|
2849
|
-
onKeyDown: x,
|
|
2850
|
-
onMouseEnter: (t) => {
|
|
2851
|
-
a?.(t), l.hover(e);
|
|
2852
|
-
},
|
|
2853
|
-
onMouseLeave: (e) => {
|
|
2854
|
-
o?.(e), l.hover(null);
|
|
2855
|
-
},
|
|
2856
|
-
children: n
|
|
2857
|
-
})
|
|
2858
|
-
})
|
|
2859
|
-
});
|
|
2860
|
-
});
|
|
2861
|
-
//#endregion
|
|
2862
|
-
//#region src/components/card-item-picker/card-item-picker-row-parts.tsx
|
|
2863
|
-
function Uo({ className: e, ...t }) {
|
|
2864
|
-
return Bo(), /* @__PURE__ */ z("div", {
|
|
2865
|
-
"aria-hidden": !0,
|
|
2866
|
-
className: F("shrink-0 aspect-square h-[64px] rounded-[4px] overflow-hidden bg-secondary-states-hover", e),
|
|
2867
|
-
...t
|
|
2868
|
-
});
|
|
2869
|
-
}
|
|
2870
|
-
function Wo({ className: e, ...t }) {
|
|
2871
|
-
return Bo(), /* @__PURE__ */ z("div", {
|
|
2872
|
-
className: F("flex-1 min-w-0 flex flex-col", e),
|
|
2873
|
-
...t
|
|
2874
|
-
});
|
|
2875
|
-
}
|
|
2876
|
-
function Go({ children: e, className: t }) {
|
|
2877
|
-
let { titleId: n, registerTitle: r } = Bo();
|
|
2878
|
-
return p(r, [r]), /* @__PURE__ */ z(P, {
|
|
2879
|
-
id: n,
|
|
2880
|
-
variant: "body",
|
|
2881
|
-
fontWeight: "semibold",
|
|
2882
|
-
className: F("line-clamp-1", t),
|
|
2883
|
-
title: e,
|
|
2884
|
-
children: e
|
|
2885
|
-
});
|
|
2886
|
-
}
|
|
2887
|
-
function Ko({ className: e, ...t }) {
|
|
2888
|
-
let { descriptionId: n, registerDescription: r } = Bo();
|
|
2889
|
-
return p(r, [r]), /* @__PURE__ */ z("div", {
|
|
2890
|
-
...t,
|
|
2891
|
-
id: n,
|
|
2892
|
-
className: e
|
|
2893
|
-
});
|
|
2894
|
-
}
|
|
2895
|
-
function qo({ className: e }) {
|
|
2896
|
-
let { isSelected: t } = Bo();
|
|
2897
|
-
return /* @__PURE__ */ z("div", {
|
|
2898
|
-
"aria-hidden": !0,
|
|
2899
|
-
"data-testid": "card-item-picker-row-checkbox",
|
|
2900
|
-
className: F("pointer-events-none absolute top-[8px] right-[8px]", e),
|
|
2901
|
-
children: /* @__PURE__ */ z(v, {
|
|
2902
|
-
checked: t,
|
|
2903
|
-
tabIndex: -1
|
|
2904
|
-
})
|
|
2809
|
+
className: I("row-start-3", "flex items-center justify-end gap-[8px]", "p-[12px] md:p-[16px]", "pb-[20px]", e),
|
|
2810
|
+
...n,
|
|
2811
|
+
children: t
|
|
2905
2812
|
});
|
|
2906
2813
|
}
|
|
2907
2814
|
//#endregion
|
|
2908
2815
|
//#region src/components/new-chat-trigger/new-chat-trigger.tsx
|
|
2909
|
-
var
|
|
2816
|
+
var Ao = a(({ asChild: t = !1, children: n, onClick: r, ...i }, a) => {
|
|
2910
2817
|
let { goToNewChat: o } = X(), s = t ? e : "button";
|
|
2911
2818
|
function c(e) {
|
|
2912
2819
|
r?.(e), o();
|
|
@@ -2919,16 +2826,17 @@ var Jo = a(({ asChild: t = !1, children: n, onClick: r, ...i }, a) => {
|
|
|
2919
2826
|
children: n
|
|
2920
2827
|
});
|
|
2921
2828
|
});
|
|
2922
|
-
|
|
2829
|
+
Ao.displayName = "NewChatTrigger";
|
|
2923
2830
|
//#endregion
|
|
2924
2831
|
//#region src/components/chat-thinking-process/chat-thinking-process.tsx
|
|
2925
|
-
var
|
|
2926
|
-
return /* @__PURE__ */ z(
|
|
2832
|
+
var jo = a(function({ children: e, className: t, defaultOpen: n = !1, isStreaming: r = !1, ...i }, a) {
|
|
2833
|
+
return /* @__PURE__ */ z(v, {
|
|
2927
2834
|
defaultOpen: n,
|
|
2928
2835
|
asChild: !0,
|
|
2929
2836
|
...i,
|
|
2930
2837
|
children: /* @__PURE__ */ z("div", {
|
|
2931
2838
|
ref: a,
|
|
2839
|
+
"data-slot": "chat-thinking-process",
|
|
2932
2840
|
"data-testid": "chat-thinking-process",
|
|
2933
2841
|
"data-streaming": r,
|
|
2934
2842
|
className: I("group/thinking-process", "flex flex-col", t),
|
|
@@ -2936,27 +2844,30 @@ var Yo = a(function({ children: e, className: t, defaultOpen: n = !1, isStreamin
|
|
|
2936
2844
|
})
|
|
2937
2845
|
});
|
|
2938
2846
|
});
|
|
2939
|
-
|
|
2940
|
-
function
|
|
2941
|
-
return /* @__PURE__ */ B(
|
|
2847
|
+
jo.displayName = "ChatThinkingProcess";
|
|
2848
|
+
function Mo({ children: e, className: t, ...n }) {
|
|
2849
|
+
return /* @__PURE__ */ B(b, {
|
|
2850
|
+
"data-slot": "chat-thinking-process-trigger",
|
|
2942
2851
|
"data-testid": "chat-thinking-process-trigger",
|
|
2943
2852
|
className: I("flex w-full items-center gap-4", "cursor-pointer text-left", t),
|
|
2944
2853
|
...n,
|
|
2945
2854
|
children: [e, /* @__PURE__ */ z("style", { children: "\n @keyframes shimmer {\n 100% {\n mask-position: left;\n }\n }\n " })]
|
|
2946
2855
|
});
|
|
2947
2856
|
}
|
|
2948
|
-
function
|
|
2857
|
+
function No({ children: e, className: t, ...n }) {
|
|
2949
2858
|
return /* @__PURE__ */ z("span", {
|
|
2859
|
+
"data-slot": "chat-thinking-process-trigger-icon",
|
|
2950
2860
|
"data-testid": "chat-thinking-process-trigger-icon",
|
|
2951
2861
|
className: I("inline-flex shrink-0 items-center justify-center", t),
|
|
2952
2862
|
...n,
|
|
2953
2863
|
children: e
|
|
2954
2864
|
});
|
|
2955
2865
|
}
|
|
2956
|
-
function
|
|
2957
|
-
return /* @__PURE__ */ z(
|
|
2866
|
+
function Po({ children: e, className: t, ...n }) {
|
|
2867
|
+
return /* @__PURE__ */ z(F, {
|
|
2958
2868
|
asChild: !0,
|
|
2959
2869
|
variant: "body-sm",
|
|
2870
|
+
"data-slot": "chat-thinking-process-trigger-label",
|
|
2960
2871
|
"data-testid": "chat-thinking-process-trigger-label",
|
|
2961
2872
|
className: I("text-text-secondary", "font-semibold", "group-data-[streaming=true]/thinking-process:mask-[linear-gradient(-60deg,#000_30%,rgba(0,0,0,0.2),#192029_70%)]", "group-data-[streaming=true]/thinking-process:mask-size-[300%_100%]", "group-data-[streaming=true]/thinking-process:mask-right", "group-data-[streaming=true]/thinking-process:animate-[shimmer_3.2s_infinite]", t),
|
|
2962
2873
|
children: /* @__PURE__ */ z("span", {
|
|
@@ -2965,8 +2876,9 @@ function Qo({ children: e, className: t, ...n }) {
|
|
|
2965
2876
|
})
|
|
2966
2877
|
});
|
|
2967
2878
|
}
|
|
2968
|
-
function
|
|
2879
|
+
function Fo({ className: e, ...t }) {
|
|
2969
2880
|
return /* @__PURE__ */ z("span", {
|
|
2881
|
+
"data-slot": "chat-thinking-process-trigger-arrow",
|
|
2970
2882
|
"data-testid": "chat-thinking-process-trigger-arrow",
|
|
2971
2883
|
"aria-hidden": !0,
|
|
2972
2884
|
className: I("inline-flex shrink-0 items-center justify-center text-text-secondary", "transition-transform duration-300", "group-data-[state=open]/collapsible:rotate-180", e),
|
|
@@ -2974,8 +2886,8 @@ function $o({ className: e, ...t }) {
|
|
|
2974
2886
|
children: /* @__PURE__ */ z(H, {})
|
|
2975
2887
|
});
|
|
2976
2888
|
}
|
|
2977
|
-
function
|
|
2978
|
-
let { lastItemContent:
|
|
2889
|
+
function Io({ children: e, className: n, itemsClassName: r, rowClassName: i, markerClassName: a, connectorClassName: o, previewClassName: s, hasLastMessagePreview: c = !0, ...l }) {
|
|
2890
|
+
let { lastItemContent: u, lastItemIndex: d } = p(() => {
|
|
2979
2891
|
let n = t.Children.toArray(e);
|
|
2980
2892
|
return {
|
|
2981
2893
|
lastItemContent: n.at(-1),
|
|
@@ -2983,26 +2895,35 @@ function es({ children: e, className: n, itemsClassName: r, hasLastMessagePrevie
|
|
|
2983
2895
|
};
|
|
2984
2896
|
}, [e]);
|
|
2985
2897
|
return /* @__PURE__ */ B("div", {
|
|
2898
|
+
"data-slot": "chat-thinking-process-content",
|
|
2986
2899
|
"data-testid": "chat-thinking-process-content",
|
|
2987
|
-
"data-preview":
|
|
2900
|
+
"data-preview": c,
|
|
2988
2901
|
className: I("pt-8", n),
|
|
2989
|
-
children: [
|
|
2902
|
+
children: [c && u && /* @__PURE__ */ z(Ht, {
|
|
2990
2903
|
mode: "wait",
|
|
2991
|
-
children: /* @__PURE__ */ z(
|
|
2992
|
-
contentId:
|
|
2993
|
-
|
|
2904
|
+
children: /* @__PURE__ */ z(Lo, {
|
|
2905
|
+
contentId: d,
|
|
2906
|
+
className: s,
|
|
2907
|
+
children: u
|
|
2994
2908
|
})
|
|
2995
|
-
}), /* @__PURE__ */ z(
|
|
2909
|
+
}), /* @__PURE__ */ z(y, {
|
|
2910
|
+
"data-slot": "chat-thinking-process-content-items",
|
|
2996
2911
|
"data-testid": "chat-thinking-process-content-items",
|
|
2997
2912
|
className: I("flex flex-col", r),
|
|
2998
|
-
...
|
|
2913
|
+
...l,
|
|
2999
2914
|
children: t.Children.map(e, (e) => /* @__PURE__ */ B("div", {
|
|
3000
|
-
|
|
3001
|
-
|
|
2915
|
+
"data-slot": "chat-thinking-process-content-row",
|
|
2916
|
+
className: I("relative flex gap-8 text-text-secondary text-sm last:pb-0", "pl-8", "last:[&>div:first-child>span:last-child]:hidden", i),
|
|
3002
2917
|
children: [/* @__PURE__ */ B("div", {
|
|
3003
2918
|
className: "relative flex w-8 shrink-0 flex-col items-center self-stretch",
|
|
3004
2919
|
"aria-hidden": !0,
|
|
3005
|
-
children: [/* @__PURE__ */ z("span", {
|
|
2920
|
+
children: [/* @__PURE__ */ z("span", {
|
|
2921
|
+
"data-slot": "chat-thinking-process-content-marker",
|
|
2922
|
+
className: I("mt-[7px] size-[6px] shrink-0 rounded-full bg-text-secondary", a)
|
|
2923
|
+
}), /* @__PURE__ */ z("span", {
|
|
2924
|
+
"data-slot": "chat-thinking-process-content-connector",
|
|
2925
|
+
className: I("absolute top-[16px] bottom-[-4px] left-1/2 w-px -translate-x-1/2 bg-component-divider", o)
|
|
2926
|
+
})]
|
|
3006
2927
|
}), /* @__PURE__ */ z("div", {
|
|
3007
2928
|
className: "min-w-0 flex-1 pb-8",
|
|
3008
2929
|
children: e
|
|
@@ -3011,8 +2932,9 @@ function es({ children: e, className: n, itemsClassName: r, hasLastMessagePrevie
|
|
|
3011
2932
|
})]
|
|
3012
2933
|
});
|
|
3013
2934
|
}
|
|
3014
|
-
function
|
|
3015
|
-
return /* @__PURE__ */ z(
|
|
2935
|
+
function Lo({ children: e, className: t, contentId: n }) {
|
|
2936
|
+
return /* @__PURE__ */ z(Ut.div, {
|
|
2937
|
+
"data-slot": "chat-thinking-process-content-preview",
|
|
3016
2938
|
"data-testid": "chat-thinking-process-content-preview",
|
|
3017
2939
|
initial: { opacity: 0 },
|
|
3018
2940
|
animate: { opacity: .7 },
|
|
@@ -3025,8 +2947,9 @@ function ts({ children: e, className: t, contentId: n }) {
|
|
|
3025
2947
|
children: e
|
|
3026
2948
|
}, n);
|
|
3027
2949
|
}
|
|
3028
|
-
function
|
|
2950
|
+
function Ro({ children: e, className: t, ...n }) {
|
|
3029
2951
|
return /* @__PURE__ */ z("div", {
|
|
2952
|
+
"data-slot": "chat-thinking-process-content-item",
|
|
3030
2953
|
"data-testid": "chat-thinking-process-content-item",
|
|
3031
2954
|
className: I("text-text-secondary text-sm", t),
|
|
3032
2955
|
...n,
|
|
@@ -3035,14 +2958,14 @@ function ns({ children: e, className: t, ...n }) {
|
|
|
3035
2958
|
}
|
|
3036
2959
|
//#endregion
|
|
3037
2960
|
//#region src/components/deprecated-empty-state.ts
|
|
3038
|
-
var
|
|
2961
|
+
var zo = S, Bo = T, Vo = E, Ho = w, Uo = C, Wo = {
|
|
3039
2962
|
paragraph: "editor-paragraph",
|
|
3040
2963
|
text: {
|
|
3041
2964
|
bold: "editor-text-bold",
|
|
3042
2965
|
italic: "editor-text-italic",
|
|
3043
2966
|
underline: "editor-text-underline"
|
|
3044
2967
|
}
|
|
3045
|
-
},
|
|
2968
|
+
}, Go = class e extends gt {
|
|
3046
2969
|
__src;
|
|
3047
2970
|
__altText;
|
|
3048
2971
|
static getType() {
|
|
@@ -3080,7 +3003,7 @@ var rs = w, is = ee, as = te, os = E, ss = T, cs = {
|
|
|
3080
3003
|
return { img: () => ({
|
|
3081
3004
|
conversion: (e) => {
|
|
3082
3005
|
let t = e.getAttribute("src") || "", n = e.getAttribute("alt") || "";
|
|
3083
|
-
return t ? { node:
|
|
3006
|
+
return t ? { node: Ko(t, n) } : null;
|
|
3084
3007
|
},
|
|
3085
3008
|
priority: 0
|
|
3086
3009
|
}) };
|
|
@@ -3095,21 +3018,21 @@ var rs = w, is = ee, as = te, os = E, ss = T, cs = {
|
|
|
3095
3018
|
};
|
|
3096
3019
|
}
|
|
3097
3020
|
static importJSON(e) {
|
|
3098
|
-
return
|
|
3021
|
+
return Ko(e.src, e.altText);
|
|
3099
3022
|
}
|
|
3100
3023
|
isInline() {
|
|
3101
3024
|
return !1;
|
|
3102
3025
|
}
|
|
3103
3026
|
};
|
|
3104
|
-
function
|
|
3105
|
-
return new
|
|
3027
|
+
function Ko(e, t) {
|
|
3028
|
+
return new Go(e, t);
|
|
3106
3029
|
}
|
|
3107
|
-
function
|
|
3108
|
-
return e instanceof
|
|
3030
|
+
function qo(e) {
|
|
3031
|
+
return e instanceof Go;
|
|
3109
3032
|
}
|
|
3110
3033
|
//#endregion
|
|
3111
3034
|
//#region src/components/rich-text-area/transformers.ts
|
|
3112
|
-
function
|
|
3035
|
+
function Jo(e) {
|
|
3113
3036
|
let t = /font-size\s*:\s*([^;]+)/i, n = /font-family\s*:\s*([^;]+)/i, r = /(?<![\w-])color\s*:\s*([^;]+)/i, i = t.exec(e), a = n.exec(e), o = r.exec(e);
|
|
3114
3037
|
return {
|
|
3115
3038
|
fontSize: i ? i[1].trim() : null,
|
|
@@ -3117,139 +3040,139 @@ function fs(e) {
|
|
|
3117
3040
|
color: o ? o[1].trim() : null
|
|
3118
3041
|
};
|
|
3119
3042
|
}
|
|
3120
|
-
var
|
|
3043
|
+
var Yo = {
|
|
3121
3044
|
type: "text-match",
|
|
3122
3045
|
trigger: "",
|
|
3123
3046
|
regExp: /./,
|
|
3124
3047
|
importRegExp: /./,
|
|
3125
3048
|
dependencies: [],
|
|
3126
3049
|
export: (e) => {
|
|
3127
|
-
if (!
|
|
3128
|
-
let t = e.getStyle() ?? "", n = e.getTextContent(), r =
|
|
3050
|
+
if (!J(e)) return null;
|
|
3051
|
+
let t = e.getStyle() ?? "", n = e.getTextContent(), r = Jo(t);
|
|
3129
3052
|
if (r.fontSize || r.fontFamily || r.color) {
|
|
3130
3053
|
let e = "";
|
|
3131
3054
|
return r.fontSize && (e += `font-size: ${r.fontSize};`), r.fontFamily && (e += `font-family: ${r.fontFamily};`), r.color && (e += `color: ${r.color};`), `<span style="${e}">${n}</span>`;
|
|
3132
3055
|
}
|
|
3133
3056
|
return null;
|
|
3134
3057
|
}
|
|
3135
|
-
},
|
|
3058
|
+
}, Xo = {
|
|
3136
3059
|
type: "text-match",
|
|
3137
3060
|
trigger: "",
|
|
3138
3061
|
regExp: /<span\s+style="([^"]+)">(.+?)<\/span>/,
|
|
3139
3062
|
importRegExp: /<span\s+style="([^"]+)">(.+?)<\/span>/,
|
|
3140
3063
|
dependencies: [],
|
|
3141
3064
|
replace: (e, t) => {
|
|
3142
|
-
let [, n, r] = t, i =
|
|
3065
|
+
let [, n, r] = t, i = at(r);
|
|
3143
3066
|
return i.setFormat(e.getFormat()), i.setStyle(n), e.replace(i), i;
|
|
3144
3067
|
}
|
|
3145
|
-
},
|
|
3068
|
+
}, Zo = {
|
|
3146
3069
|
type: "text-match",
|
|
3147
3070
|
trigger: "",
|
|
3148
3071
|
regExp: /<ins>(.*?)<\/ins>/,
|
|
3149
3072
|
importRegExp: /<ins>(.*?)<\/ins>/,
|
|
3150
3073
|
dependencies: [],
|
|
3151
3074
|
replace: (e, t) => {
|
|
3152
|
-
let n =
|
|
3075
|
+
let n = at(t[1]);
|
|
3153
3076
|
return n.setFormat(e.getFormat()), n.hasFormat("underline") || n.toggleFormat("underline"), e.replace(n), n;
|
|
3154
3077
|
},
|
|
3155
|
-
export: (e) => !
|
|
3156
|
-
},
|
|
3078
|
+
export: (e) => !J(e) || !e.hasFormat("underline") ? null : `<ins>${e.getTextContent()}</ins>`
|
|
3079
|
+
}, Qo = (e) => {
|
|
3157
3080
|
let t = /text-align:\s*(\w+)/i.exec(e);
|
|
3158
3081
|
return t ? t[1].trim() : null;
|
|
3159
|
-
},
|
|
3082
|
+
}, $o = {
|
|
3160
3083
|
type: "element",
|
|
3161
3084
|
dependencies: [],
|
|
3162
3085
|
regExp: /<div\s+style="([^"]+)">(.*?)<\/div>/,
|
|
3163
3086
|
replace: (e, t, n) => {
|
|
3164
|
-
let r =
|
|
3087
|
+
let r = Qo(n[1]);
|
|
3165
3088
|
if (!r) return !1;
|
|
3166
3089
|
if (!n[2]) return;
|
|
3167
3090
|
let i = t[0];
|
|
3168
|
-
|
|
3091
|
+
J(i) && i.setTextContent(n[2]), e.setFormat(r), e.append(...t);
|
|
3169
3092
|
},
|
|
3170
3093
|
export: (e, t) => {
|
|
3171
|
-
if (!
|
|
3094
|
+
if (!lt(e)) return null;
|
|
3172
3095
|
let n = e.getFormatType();
|
|
3173
3096
|
return !n || n === "left" ? null : `<div style="text-align: ${n}">${t(e)}</div>`;
|
|
3174
3097
|
}
|
|
3175
|
-
},
|
|
3098
|
+
}, es = {
|
|
3176
3099
|
type: "text-match",
|
|
3177
3100
|
trigger: "",
|
|
3178
3101
|
regExp: /./,
|
|
3179
3102
|
importRegExp: /./,
|
|
3180
|
-
dependencies: [
|
|
3181
|
-
export: (e) =>
|
|
3182
|
-
},
|
|
3103
|
+
dependencies: [Go],
|
|
3104
|
+
export: (e) => qo(e) ? `<img src="${e.__src}" alt="${e.__altText}" />` : null
|
|
3105
|
+
}, ts = {
|
|
3183
3106
|
type: "text-match",
|
|
3184
3107
|
trigger: "",
|
|
3185
3108
|
regExp: /<img\s+src="([^"]+)"\s+alt="([^"]*)"[^>]*\/?>/,
|
|
3186
3109
|
importRegExp: /<img\s+src="([^"]+)"\s+alt="([^"]*)"[^>]*\/?>/,
|
|
3187
|
-
dependencies: [
|
|
3110
|
+
dependencies: [Go],
|
|
3188
3111
|
replace: (e, t) => {
|
|
3189
|
-
let [, n, r] = t, i =
|
|
3112
|
+
let [, n, r] = t, i = Ko(n, r);
|
|
3190
3113
|
e.replace(i);
|
|
3191
3114
|
}
|
|
3192
|
-
},
|
|
3193
|
-
...
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
],
|
|
3199
|
-
...
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3115
|
+
}, ns = [
|
|
3116
|
+
...nt,
|
|
3117
|
+
Yo,
|
|
3118
|
+
Zo,
|
|
3119
|
+
$o,
|
|
3120
|
+
es
|
|
3121
|
+
], rs = [
|
|
3122
|
+
...nt,
|
|
3123
|
+
Xo,
|
|
3124
|
+
Zo,
|
|
3125
|
+
$o,
|
|
3126
|
+
ts
|
|
3204
3127
|
];
|
|
3205
3128
|
//#endregion
|
|
3206
3129
|
//#region src/components/rich-text-area/html-config.ts
|
|
3207
|
-
function
|
|
3130
|
+
function is(e) {
|
|
3208
3131
|
let t = e.nodeName.toLowerCase();
|
|
3209
3132
|
if (t !== "h1" && t !== "h2" && t !== "h3" && t !== "h4" && t !== "h5" && t !== "h6") return null;
|
|
3210
|
-
let n =
|
|
3133
|
+
let n = Ye(t), r = e.getAttribute("style") ?? "";
|
|
3211
3134
|
if (n.setStyle(r), e.style) {
|
|
3212
3135
|
let t = e.style.textAlign;
|
|
3213
|
-
(t === "left" || t === "right" || t === "center" || t === "justify" || t === "start" || t === "end") && n.setFormat(t),
|
|
3136
|
+
(t === "left" || t === "right" || t === "center" || t === "justify" || t === "start" || t === "end") && n.setFormat(t), Dt(e, n);
|
|
3214
3137
|
}
|
|
3215
3138
|
return { node: n };
|
|
3216
3139
|
}
|
|
3217
|
-
function
|
|
3140
|
+
function as(e) {
|
|
3218
3141
|
if (e.getAttribute("__lexicallisttype") === "check" || e.classList.contains("contains-task-list")) return !0;
|
|
3219
|
-
for (let t of e.childNodes) if (
|
|
3142
|
+
for (let t of e.childNodes) if (Et(t) && t.hasAttribute("aria-checked")) return !0;
|
|
3220
3143
|
return !1;
|
|
3221
3144
|
}
|
|
3222
|
-
function
|
|
3145
|
+
function os(e) {
|
|
3223
3146
|
let t = e.nodeName.toLowerCase(), n = null;
|
|
3224
3147
|
if (t === "ol") {
|
|
3225
3148
|
let t = e.start;
|
|
3226
|
-
n =
|
|
3227
|
-
} else t === "ul" && (n =
|
|
3149
|
+
n = Ve("number", t);
|
|
3150
|
+
} else t === "ul" && (n = as(e) ? Ve("check") : Ve("bullet"));
|
|
3228
3151
|
if (!n) return null;
|
|
3229
3152
|
let r = e.getAttribute("style") ?? "";
|
|
3230
3153
|
return n.setStyle(r), { node: n };
|
|
3231
3154
|
}
|
|
3232
|
-
function
|
|
3155
|
+
function ss(e) {
|
|
3233
3156
|
if (e.classList.contains("task-list-item")) {
|
|
3234
3157
|
for (let t of e.children) if (t.tagName === "INPUT") {
|
|
3235
3158
|
let n = t;
|
|
3236
3159
|
if (n.getAttribute("type") === "checkbox") {
|
|
3237
|
-
let t = n.hasAttribute("checked"), r =
|
|
3160
|
+
let t = n.hasAttribute("checked"), r = Be(t), i = e.getAttribute("style") ?? "";
|
|
3238
3161
|
return r.setStyle(i), { node: r };
|
|
3239
3162
|
}
|
|
3240
3163
|
}
|
|
3241
3164
|
}
|
|
3242
|
-
let t = e.getAttribute("aria-checked"), n =
|
|
3165
|
+
let t = e.getAttribute("aria-checked"), n = Be(t === "true" || t !== "false" && void 0), r = e.getAttribute("style") ?? "";
|
|
3243
3166
|
return n.setStyle(r), { node: n };
|
|
3244
3167
|
}
|
|
3245
3168
|
var Z = 4;
|
|
3246
|
-
function
|
|
3247
|
-
let { color: t, fontSize: n, fontFamily: r } =
|
|
3169
|
+
function cs(e) {
|
|
3170
|
+
let { color: t, fontSize: n, fontFamily: r } = Jo(e.getAttribute("style") ?? "");
|
|
3248
3171
|
if (!t && !n && !r) return null;
|
|
3249
3172
|
let i = e.style;
|
|
3250
3173
|
return {
|
|
3251
3174
|
forChild: (e) => {
|
|
3252
|
-
if (!
|
|
3175
|
+
if (!J(e)) return e;
|
|
3253
3176
|
let a = i.fontWeight, o = (i.textDecoration || "").split(" ");
|
|
3254
3177
|
(a === "700" || a === "bold") && !e.hasFormat("bold") && e.toggleFormat("bold"), o.includes("line-through") && !e.hasFormat("strikethrough") && e.toggleFormat("strikethrough"), i.fontStyle === "italic" && !e.hasFormat("italic") && e.toggleFormat("italic"), o.includes("underline") && !e.hasFormat("underline") && e.toggleFormat("underline"), i.verticalAlign === "sub" && !e.hasFormat("subscript") && e.toggleFormat("subscript"), i.verticalAlign === "super" && !e.hasFormat("superscript") && e.toggleFormat("superscript");
|
|
3255
3178
|
let s = "";
|
|
@@ -3258,59 +3181,59 @@ function Es(e) {
|
|
|
3258
3181
|
node: null
|
|
3259
3182
|
};
|
|
3260
3183
|
}
|
|
3261
|
-
var
|
|
3184
|
+
var ls = {
|
|
3262
3185
|
h1: () => ({
|
|
3263
|
-
conversion:
|
|
3186
|
+
conversion: is,
|
|
3264
3187
|
priority: Z
|
|
3265
3188
|
}),
|
|
3266
3189
|
h2: () => ({
|
|
3267
|
-
conversion:
|
|
3190
|
+
conversion: is,
|
|
3268
3191
|
priority: Z
|
|
3269
3192
|
}),
|
|
3270
3193
|
h3: () => ({
|
|
3271
|
-
conversion:
|
|
3194
|
+
conversion: is,
|
|
3272
3195
|
priority: Z
|
|
3273
3196
|
}),
|
|
3274
3197
|
h4: () => ({
|
|
3275
|
-
conversion:
|
|
3198
|
+
conversion: is,
|
|
3276
3199
|
priority: Z
|
|
3277
3200
|
}),
|
|
3278
3201
|
h5: () => ({
|
|
3279
|
-
conversion:
|
|
3202
|
+
conversion: is,
|
|
3280
3203
|
priority: Z
|
|
3281
3204
|
}),
|
|
3282
3205
|
h6: () => ({
|
|
3283
|
-
conversion:
|
|
3206
|
+
conversion: is,
|
|
3284
3207
|
priority: Z
|
|
3285
3208
|
}),
|
|
3286
3209
|
ul: () => ({
|
|
3287
|
-
conversion:
|
|
3210
|
+
conversion: os,
|
|
3288
3211
|
priority: Z
|
|
3289
3212
|
}),
|
|
3290
3213
|
ol: () => ({
|
|
3291
|
-
conversion:
|
|
3214
|
+
conversion: os,
|
|
3292
3215
|
priority: Z
|
|
3293
3216
|
}),
|
|
3294
3217
|
li: () => ({
|
|
3295
|
-
conversion:
|
|
3218
|
+
conversion: ss,
|
|
3296
3219
|
priority: Z
|
|
3297
3220
|
}),
|
|
3298
3221
|
span: () => ({
|
|
3299
|
-
conversion:
|
|
3222
|
+
conversion: cs,
|
|
3300
3223
|
priority: Z
|
|
3301
3224
|
})
|
|
3302
3225
|
};
|
|
3303
|
-
function
|
|
3226
|
+
function us(e) {
|
|
3304
3227
|
return (t, n) => {
|
|
3305
3228
|
let r = e.prototype.exportDOM.call(n, t), i = n.getStyle();
|
|
3306
3229
|
return r.element && i && r.element.setAttribute("style", i), r;
|
|
3307
3230
|
};
|
|
3308
3231
|
}
|
|
3309
|
-
var
|
|
3310
|
-
[
|
|
3311
|
-
[
|
|
3312
|
-
[
|
|
3313
|
-
]),
|
|
3232
|
+
var ds = /* @__PURE__ */ new Map([
|
|
3233
|
+
[Xe, us(Xe)],
|
|
3234
|
+
[Ue, us(Ue)],
|
|
3235
|
+
[He, us(He)]
|
|
3236
|
+
]), fs = class e extends _t {
|
|
3314
3237
|
static getType() {
|
|
3315
3238
|
return "div-block";
|
|
3316
3239
|
}
|
|
@@ -3327,7 +3250,7 @@ var ks = /* @__PURE__ */ new Map([
|
|
|
3327
3250
|
}
|
|
3328
3251
|
static importDOM() {
|
|
3329
3252
|
return { div: () => ({
|
|
3330
|
-
conversion:
|
|
3253
|
+
conversion: ps,
|
|
3331
3254
|
priority: 4
|
|
3332
3255
|
}) };
|
|
3333
3256
|
}
|
|
@@ -3339,7 +3262,7 @@ var ks = /* @__PURE__ */ new Map([
|
|
|
3339
3262
|
} : e;
|
|
3340
3263
|
}
|
|
3341
3264
|
static importJSON(e) {
|
|
3342
|
-
let t =
|
|
3265
|
+
let t = ms().updateFromJSON(e);
|
|
3343
3266
|
return e.style !== void 0 && t.setStyle(e.style), t;
|
|
3344
3267
|
}
|
|
3345
3268
|
updateFromJSON(e) {
|
|
@@ -3348,57 +3271,57 @@ var ks = /* @__PURE__ */ new Map([
|
|
|
3348
3271
|
}
|
|
3349
3272
|
collapseAtStart(e) {
|
|
3350
3273
|
let t = this.getChildren();
|
|
3351
|
-
if (t.length === 0 ||
|
|
3274
|
+
if (t.length === 0 || J(t[0]) && t[0].getTextContent().trim() === "") {
|
|
3352
3275
|
if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
|
|
3353
3276
|
if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
|
|
3354
3277
|
} else {
|
|
3355
|
-
let e =
|
|
3278
|
+
let e = rt();
|
|
3356
3279
|
return e.setFormat(this.getFormatType()), e.setStyle(this.getStyle()), e.setIndent(this.getIndent()), e.setDirection(this.getDirection()), t.forEach((t) => e.append(t)), this.replace(e), !0;
|
|
3357
3280
|
}
|
|
3358
3281
|
return !1;
|
|
3359
3282
|
}
|
|
3360
3283
|
};
|
|
3361
|
-
function
|
|
3362
|
-
let t =
|
|
3284
|
+
function ps(e) {
|
|
3285
|
+
let t = ms(), n = e.getAttribute("style") ?? "";
|
|
3363
3286
|
if (t.setStyle(n), e.style) {
|
|
3364
3287
|
let n = e.style.textAlign;
|
|
3365
|
-
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n),
|
|
3288
|
+
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n), Dt(e, t);
|
|
3366
3289
|
}
|
|
3367
3290
|
return { node: t };
|
|
3368
3291
|
}
|
|
3369
|
-
function
|
|
3370
|
-
return new
|
|
3292
|
+
function ms() {
|
|
3293
|
+
return new fs();
|
|
3371
3294
|
}
|
|
3372
3295
|
//#endregion
|
|
3373
3296
|
//#region src/components/rich-text-area/plugins/value-plugin.tsx
|
|
3374
|
-
function
|
|
3297
|
+
function hs({ onChange: e, source: t = "markdown" }) {
|
|
3375
3298
|
let n = c((n, r, i) => {
|
|
3376
3299
|
if (!i.has("focus") && e) try {
|
|
3377
3300
|
n.read(() => {
|
|
3378
|
-
e(t === "html" ?
|
|
3301
|
+
e(t === "html" ? Jt(r) : et(ns));
|
|
3379
3302
|
});
|
|
3380
3303
|
} catch {}
|
|
3381
3304
|
}, [e, t]);
|
|
3382
|
-
return /* @__PURE__ */ z(
|
|
3305
|
+
return /* @__PURE__ */ z(Ot, { onChange: n });
|
|
3383
3306
|
}
|
|
3384
3307
|
//#endregion
|
|
3385
3308
|
//#region src/components/rich-text-area/hooks.ts
|
|
3386
3309
|
function Q() {
|
|
3387
|
-
let [e] =
|
|
3310
|
+
let [e] = Qe();
|
|
3388
3311
|
return e;
|
|
3389
3312
|
}
|
|
3390
|
-
function
|
|
3391
|
-
let [e] =
|
|
3313
|
+
function gs() {
|
|
3314
|
+
let [e] = Qe();
|
|
3392
3315
|
return c(() => {
|
|
3393
3316
|
let t = "";
|
|
3394
3317
|
return e.getEditorState().read(() => {
|
|
3395
|
-
t =
|
|
3318
|
+
t = K()?.getTextContent() ?? "";
|
|
3396
3319
|
}), t;
|
|
3397
3320
|
}, [e]);
|
|
3398
3321
|
}
|
|
3399
3322
|
//#endregion
|
|
3400
3323
|
//#region src/components/rich-text-area/plugins/disabled-plugin.tsx
|
|
3401
|
-
function
|
|
3324
|
+
function _s({ isDisabled: e }) {
|
|
3402
3325
|
let t = Q();
|
|
3403
3326
|
return u(() => {
|
|
3404
3327
|
t.setEditable(!e);
|
|
@@ -3406,79 +3329,79 @@ function Fs({ isDisabled: e }) {
|
|
|
3406
3329
|
}
|
|
3407
3330
|
//#endregion
|
|
3408
3331
|
//#region src/components/rich-text-area/plugins/controlled-plugin.tsx
|
|
3409
|
-
function
|
|
3410
|
-
let t =
|
|
3411
|
-
return
|
|
3332
|
+
function vs({ controlledRef: e }) {
|
|
3333
|
+
let t = m(null);
|
|
3334
|
+
return d(e, () => ({ focus: () => {
|
|
3412
3335
|
Promise.resolve().then(() => {
|
|
3413
3336
|
t.current?.focus();
|
|
3414
3337
|
});
|
|
3415
|
-
} }), []), /* @__PURE__ */ z(
|
|
3338
|
+
} }), []), /* @__PURE__ */ z(Xt, { editorRef: t });
|
|
3416
3339
|
}
|
|
3417
3340
|
//#endregion
|
|
3418
3341
|
//#region src/components/rich-text-area/utils/index.ts
|
|
3419
|
-
function
|
|
3342
|
+
function ys(e) {
|
|
3420
3343
|
let t = e.getRootElement();
|
|
3421
3344
|
t && (t.scrollTop = t.scrollHeight);
|
|
3422
3345
|
}
|
|
3423
|
-
function
|
|
3424
|
-
let e =
|
|
3425
|
-
if (e &&
|
|
3426
|
-
let t =
|
|
3427
|
-
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"),
|
|
3346
|
+
function bs() {
|
|
3347
|
+
let e = G().getLastDescendant();
|
|
3348
|
+
if (e && J(e)) {
|
|
3349
|
+
let t = it(), n = e.getTextContentSize();
|
|
3350
|
+
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"), dt(t);
|
|
3428
3351
|
} else {
|
|
3429
|
-
|
|
3430
|
-
let e =
|
|
3431
|
-
if (
|
|
3432
|
-
let t = e.focus.getNode(), n =
|
|
3433
|
-
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type),
|
|
3352
|
+
ut();
|
|
3353
|
+
let e = K();
|
|
3354
|
+
if (q(e)) {
|
|
3355
|
+
let t = e.focus.getNode(), n = J(t) ? t.getTextContentSize() : 0;
|
|
3356
|
+
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type), dt(e);
|
|
3434
3357
|
}
|
|
3435
3358
|
}
|
|
3436
3359
|
}
|
|
3437
|
-
function
|
|
3360
|
+
function xs(e, t) {
|
|
3438
3361
|
let n = new DOMParser().parseFromString(t, "text/html");
|
|
3439
|
-
return
|
|
3440
|
-
if (
|
|
3441
|
-
let t =
|
|
3362
|
+
return Yt(e, n).map((e) => {
|
|
3363
|
+
if (J(e)) {
|
|
3364
|
+
let t = rt();
|
|
3442
3365
|
return t.append(e), t;
|
|
3443
3366
|
}
|
|
3444
3367
|
return e;
|
|
3445
3368
|
});
|
|
3446
3369
|
}
|
|
3447
|
-
function
|
|
3448
|
-
let n =
|
|
3449
|
-
n.clear(),
|
|
3370
|
+
function Ss(e, t) {
|
|
3371
|
+
let n = G();
|
|
3372
|
+
n.clear(), xs(e, t).forEach((e) => n.append(e));
|
|
3450
3373
|
}
|
|
3451
|
-
function
|
|
3452
|
-
let n =
|
|
3453
|
-
if (
|
|
3374
|
+
function Cs(e, t) {
|
|
3375
|
+
let n = K(), r = xs(e, t);
|
|
3376
|
+
if (q(n)) n.insertNodes(r);
|
|
3454
3377
|
else {
|
|
3455
|
-
let e =
|
|
3378
|
+
let e = G();
|
|
3456
3379
|
e.clear(), r.forEach((t) => e.append(t));
|
|
3457
3380
|
}
|
|
3458
3381
|
}
|
|
3459
3382
|
//#endregion
|
|
3460
3383
|
//#region src/components/rich-text-area/plugins/controlled-value-plugin.tsx
|
|
3461
|
-
function
|
|
3462
|
-
let n = Q(), r =
|
|
3384
|
+
function ws({ value: e, source: t = "markdown" }) {
|
|
3385
|
+
let n = Q(), r = m(), i = m(!!e?.trim()), a = ue("desktop");
|
|
3463
3386
|
return u(() => {
|
|
3464
3387
|
if (!n || e === r.current) return;
|
|
3465
3388
|
r.current = e;
|
|
3466
3389
|
let o = "";
|
|
3467
3390
|
if (n.getEditorState().read(() => {
|
|
3468
|
-
o = t === "html" ?
|
|
3391
|
+
o = t === "html" ? Jt(n) : et(ns);
|
|
3469
3392
|
}), e !== void 0 && e !== o) {
|
|
3470
3393
|
if (e === "") {
|
|
3471
3394
|
n.update(() => {
|
|
3472
|
-
|
|
3395
|
+
W(St), t === "html" ? G().clear() : $e("", rs), bs();
|
|
3473
3396
|
}, { discrete: !0 }), Promise.resolve().then(() => {
|
|
3474
3397
|
a ? n.focus() : n.blur();
|
|
3475
3398
|
});
|
|
3476
3399
|
return;
|
|
3477
3400
|
}
|
|
3478
3401
|
n.update(() => {
|
|
3479
|
-
|
|
3402
|
+
W(St), t === "html" ? Ss(n, e) : $e(e, rs), bs();
|
|
3480
3403
|
}), i.current && (i.current = !1, Promise.resolve().then(() => {
|
|
3481
|
-
requestAnimationFrame(() =>
|
|
3404
|
+
requestAnimationFrame(() => ys(n));
|
|
3482
3405
|
})), a && Promise.resolve().then(() => {
|
|
3483
3406
|
n.focus();
|
|
3484
3407
|
});
|
|
@@ -3492,7 +3415,7 @@ function Hs({ value: e, source: t = "markdown" }) {
|
|
|
3492
3415
|
}
|
|
3493
3416
|
//#endregion
|
|
3494
3417
|
//#region src/components/rich-text-area/plugins/blur-plugin.tsx
|
|
3495
|
-
function
|
|
3418
|
+
function Ts({ onBlur: e }) {
|
|
3496
3419
|
let t = Q();
|
|
3497
3420
|
return u(() => {
|
|
3498
3421
|
if (!e) return;
|
|
@@ -3508,7 +3431,7 @@ function Us({ onBlur: e }) {
|
|
|
3508
3431
|
}
|
|
3509
3432
|
//#endregion
|
|
3510
3433
|
//#region src/components/rich-text-area/plugins/focus-plugin.tsx
|
|
3511
|
-
function
|
|
3434
|
+
function Es({ onFocusChange: e }) {
|
|
3512
3435
|
let t = Q();
|
|
3513
3436
|
return u(() => {
|
|
3514
3437
|
if (!e) return;
|
|
@@ -3527,91 +3450,91 @@ function Ws({ onFocusChange: e }) {
|
|
|
3527
3450
|
}
|
|
3528
3451
|
//#endregion
|
|
3529
3452
|
//#region src/components/rich-text-area/plugins/image-drop-plugin.tsx
|
|
3530
|
-
var
|
|
3453
|
+
var Ds = wt("INSERT_IMAGE_COMMAND"), Os = "helvetiq:insert-image", ks = class extends CustomEvent {
|
|
3531
3454
|
constructor(e) {
|
|
3532
|
-
super(
|
|
3455
|
+
super(Os, { detail: e });
|
|
3533
3456
|
}
|
|
3534
3457
|
};
|
|
3535
|
-
function
|
|
3458
|
+
function As() {
|
|
3536
3459
|
let e = Q();
|
|
3537
|
-
return u(() => e.registerCommand(
|
|
3538
|
-
let e =
|
|
3539
|
-
|
|
3540
|
-
}), !0),
|
|
3460
|
+
return u(() => e.registerCommand(Ds, (t) => (e.update(() => {
|
|
3461
|
+
let e = Ko(t.src, t.altText);
|
|
3462
|
+
st([e]);
|
|
3463
|
+
}), !0), mt), [e]), u(() => {
|
|
3541
3464
|
if (!e.getRootElement()) return;
|
|
3542
3465
|
function t(t) {
|
|
3543
3466
|
let n = t;
|
|
3544
|
-
e.dispatchCommand(
|
|
3467
|
+
e.dispatchCommand(Ds, n.detail);
|
|
3545
3468
|
}
|
|
3546
|
-
return document.addEventListener(
|
|
3547
|
-
document.removeEventListener(
|
|
3469
|
+
return document.addEventListener(Os, t), () => {
|
|
3470
|
+
document.removeEventListener(Os, t);
|
|
3548
3471
|
};
|
|
3549
3472
|
}, [e]), null;
|
|
3550
3473
|
}
|
|
3551
3474
|
//#endregion
|
|
3552
3475
|
//#region src/components/rich-text-area/plugins/html-paste-plugin.tsx
|
|
3553
|
-
var
|
|
3476
|
+
var js = wt("PASTE_HTML_COMMAND"), Ms = wt("INSERT_HTML_COMMAND"), Ns = "helvetiq:paste-html", Ps = "helvetiq:insert-html", Fs = class extends CustomEvent {
|
|
3554
3477
|
constructor(e) {
|
|
3555
|
-
super(
|
|
3478
|
+
super(Ns, { detail: e });
|
|
3556
3479
|
}
|
|
3557
|
-
},
|
|
3480
|
+
}, Is = class extends CustomEvent {
|
|
3558
3481
|
constructor(e) {
|
|
3559
|
-
super(
|
|
3482
|
+
super(Ps, { detail: e });
|
|
3560
3483
|
}
|
|
3561
3484
|
};
|
|
3562
|
-
function
|
|
3485
|
+
function Ls() {
|
|
3563
3486
|
let e = Q();
|
|
3564
|
-
return u(() => e.registerCommand(
|
|
3565
|
-
let n =
|
|
3487
|
+
return u(() => e.registerCommand(js, (t) => (e.update(() => {
|
|
3488
|
+
let n = G();
|
|
3566
3489
|
n.clear();
|
|
3567
|
-
let r = new DOMParser().parseFromString(t.html, "text/html"), i =
|
|
3490
|
+
let r = new DOMParser().parseFromString(t.html, "text/html"), i = Yt(e, r);
|
|
3568
3491
|
n.append(...i);
|
|
3569
|
-
}), !0),
|
|
3570
|
-
let n = new DOMParser().parseFromString(t.html, "text/html"), r =
|
|
3571
|
-
|
|
3572
|
-
}), !0),
|
|
3492
|
+
}), !0), mt), [e]), u(() => e.registerCommand(Ms, (t) => (e.update(() => {
|
|
3493
|
+
let n = new DOMParser().parseFromString(t.html, "text/html"), r = Yt(e, n);
|
|
3494
|
+
st(r);
|
|
3495
|
+
}), !0), mt), [e]), u(() => {
|
|
3573
3496
|
if (!e.getRootElement()) return;
|
|
3574
3497
|
function t(t) {
|
|
3575
3498
|
let n = t;
|
|
3576
|
-
e.dispatchCommand(
|
|
3499
|
+
e.dispatchCommand(js, n.detail);
|
|
3577
3500
|
}
|
|
3578
3501
|
function n(t) {
|
|
3579
3502
|
let n = t;
|
|
3580
|
-
e.dispatchCommand(
|
|
3503
|
+
e.dispatchCommand(Ms, n.detail);
|
|
3581
3504
|
}
|
|
3582
|
-
return document.addEventListener(
|
|
3583
|
-
document.removeEventListener(
|
|
3505
|
+
return document.addEventListener(Ns, t), document.addEventListener(Ps, n), () => {
|
|
3506
|
+
document.removeEventListener(Ns, t), document.removeEventListener(Ps, n);
|
|
3584
3507
|
};
|
|
3585
3508
|
}, [e]), null;
|
|
3586
3509
|
}
|
|
3587
3510
|
//#endregion
|
|
3588
3511
|
//#region src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx
|
|
3589
|
-
function
|
|
3512
|
+
function Rs() {
|
|
3590
3513
|
let e = Q();
|
|
3591
|
-
return u(() => e.registerCommand(
|
|
3514
|
+
return u(() => e.registerCommand(bt, (t) => {
|
|
3592
3515
|
let { clipboardData: n } = t;
|
|
3593
3516
|
if (!n) return !1;
|
|
3594
3517
|
let r = n.getData("text/plain");
|
|
3595
3518
|
return r ? (t.preventDefault(), e.update(() => {
|
|
3596
|
-
let e =
|
|
3597
|
-
if (
|
|
3519
|
+
let e = K();
|
|
3520
|
+
if (q(e)) {
|
|
3598
3521
|
e.insertText(r);
|
|
3599
3522
|
return;
|
|
3600
3523
|
}
|
|
3601
|
-
let t =
|
|
3524
|
+
let t = G();
|
|
3602
3525
|
t.clear(), r.split(/\r?\n/).forEach((e) => {
|
|
3603
|
-
let n =
|
|
3604
|
-
e.length > 0 && n.append(
|
|
3526
|
+
let n = rt();
|
|
3527
|
+
e.length > 0 && n.append(at(e)), t.append(n);
|
|
3605
3528
|
});
|
|
3606
3529
|
}), !0) : !1;
|
|
3607
|
-
},
|
|
3530
|
+
}, pt), [e]), null;
|
|
3608
3531
|
}
|
|
3609
3532
|
//#endregion
|
|
3610
3533
|
//#region src/components/rich-text-area/plugins/file-attachment-plugin.tsx
|
|
3611
|
-
var
|
|
3612
|
-
function
|
|
3613
|
-
let r = Q(), i =
|
|
3614
|
-
u(() => r.registerCommand(
|
|
3534
|
+
var zs = wt("ATTACH_FILE_COMMAND");
|
|
3535
|
+
function Bs({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
3536
|
+
let r = Q(), i = m(null);
|
|
3537
|
+
u(() => r.registerCommand(zs, () => (i.current?.click(), !0), mt), [r]);
|
|
3615
3538
|
function a(e) {
|
|
3616
3539
|
let r = Array.from(e.target.files ?? []);
|
|
3617
3540
|
if (t) n?.(r);
|
|
@@ -3633,58 +3556,65 @@ function ic({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
|
3633
3556
|
}
|
|
3634
3557
|
//#endregion
|
|
3635
3558
|
//#region src/components/rich-text-area/styled.tsx
|
|
3636
|
-
var
|
|
3637
|
-
ref:
|
|
3559
|
+
var Vs = a(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ z("div", {
|
|
3560
|
+
ref: r,
|
|
3638
3561
|
className: I("w-full resize-none border-none outline-none bg-transparent font-[inherit] text-[inherit] flex items-center [&_.editor-paragraph]:m-0 [&_.editor-paragraph]:min-h-[26px] [&_.editor-text-bold]:font-bold [&_.editor-text-italic]:italic [&_.editor-text-underline]:underline", e),
|
|
3639
|
-
...
|
|
3562
|
+
...n,
|
|
3563
|
+
children: t
|
|
3640
3564
|
}));
|
|
3641
|
-
|
|
3565
|
+
Vs.displayName = "Wrapper";
|
|
3642
3566
|
//#endregion
|
|
3643
3567
|
//#region src/components/rich-text-area/rich-text-area.tsx
|
|
3644
|
-
var
|
|
3568
|
+
var Hs = {
|
|
3645
3569
|
namespace: "helvetiq",
|
|
3646
|
-
theme:
|
|
3570
|
+
theme: Wo,
|
|
3647
3571
|
editable: !0,
|
|
3648
3572
|
nodes: [
|
|
3649
|
-
|
|
3573
|
+
Ue,
|
|
3574
|
+
He,
|
|
3575
|
+
Xe,
|
|
3576
|
+
Ze,
|
|
3577
|
+
Ie,
|
|
3650
3578
|
Re,
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
Pe,
|
|
3655
|
-
ls,
|
|
3656
|
-
As,
|
|
3579
|
+
Go,
|
|
3580
|
+
fs,
|
|
3581
|
+
Kt,
|
|
3657
3582
|
Gt,
|
|
3658
|
-
|
|
3659
|
-
Kt
|
|
3583
|
+
qt
|
|
3660
3584
|
],
|
|
3661
3585
|
html: {
|
|
3662
|
-
import:
|
|
3663
|
-
export:
|
|
3586
|
+
import: ls,
|
|
3587
|
+
export: ds
|
|
3664
3588
|
},
|
|
3665
3589
|
onError: (e) => {
|
|
3666
3590
|
console.error("Lexical error:", e);
|
|
3667
3591
|
}
|
|
3668
3592
|
};
|
|
3669
|
-
function
|
|
3670
|
-
return /* @__PURE__ */ z(
|
|
3671
|
-
initialConfig:
|
|
3672
|
-
children: /* @__PURE__ */ B(
|
|
3593
|
+
function Us({ children: e, name: t, value: n, source: r = "markdown", className: i, containerClassName: a, placeholderClassName: o, placeholder: s = "", isDisabled: c = !1, onChange: l, onBlur: u, onKeyDown: d, onFocusChange: f, forwardedRef: p, ...m }) {
|
|
3594
|
+
return /* @__PURE__ */ z(We, {
|
|
3595
|
+
initialConfig: Hs,
|
|
3596
|
+
children: /* @__PURE__ */ B(Vs, {
|
|
3597
|
+
"data-slot": "rich-text-area",
|
|
3673
3598
|
"data-testid": "rich-text-area",
|
|
3674
3599
|
"aria-disabled": c,
|
|
3675
3600
|
"data-disabled": c,
|
|
3676
3601
|
className: I("relative size-full overflow-hidden", "data-[disabled=true]:opacity-80", "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:select-none", a),
|
|
3677
3602
|
...m,
|
|
3678
3603
|
children: [
|
|
3679
|
-
/* @__PURE__ */ z(
|
|
3680
|
-
contentEditable: /* @__PURE__ */ z(
|
|
3604
|
+
/* @__PURE__ */ z(Je, {
|
|
3605
|
+
contentEditable: /* @__PURE__ */ z(Ge, {
|
|
3606
|
+
"data-slot": "rich-text-area-editable",
|
|
3681
3607
|
className: I("relative inset-0 overflow-y-auto", i),
|
|
3682
3608
|
"data-name": t,
|
|
3683
3609
|
"aria-placeholder": s,
|
|
3684
|
-
placeholder: /* @__PURE__ */ z(
|
|
3610
|
+
placeholder: /* @__PURE__ */ z(F, {
|
|
3685
3611
|
variant: "body",
|
|
3686
3612
|
className: I("absolute left-0 top-0", "text-text-tertiary", "pointer-events-none user-select-none", o),
|
|
3687
|
-
|
|
3613
|
+
asChild: !0,
|
|
3614
|
+
children: /* @__PURE__ */ z("p", {
|
|
3615
|
+
"data-slot": "rich-text-area-placeholder",
|
|
3616
|
+
children: s
|
|
3617
|
+
})
|
|
3688
3618
|
}),
|
|
3689
3619
|
onKeyDownCapture: d,
|
|
3690
3620
|
style: {
|
|
@@ -3692,36 +3622,36 @@ function sc({ children: e, name: t, value: n, source: r = "markdown", className:
|
|
|
3692
3622
|
minHeight: "20px"
|
|
3693
3623
|
}
|
|
3694
3624
|
}),
|
|
3695
|
-
ErrorBoundary:
|
|
3625
|
+
ErrorBoundary: Ke
|
|
3696
3626
|
}),
|
|
3697
|
-
/* @__PURE__ */ z(
|
|
3698
|
-
/* @__PURE__ */ z(
|
|
3627
|
+
/* @__PURE__ */ z(_s, { isDisabled: c }),
|
|
3628
|
+
/* @__PURE__ */ z(ws, {
|
|
3699
3629
|
value: n,
|
|
3700
3630
|
source: r
|
|
3701
3631
|
}),
|
|
3702
|
-
/* @__PURE__ */ z(
|
|
3632
|
+
/* @__PURE__ */ z(hs, {
|
|
3703
3633
|
onChange: l,
|
|
3704
3634
|
source: r
|
|
3705
3635
|
}),
|
|
3706
|
-
/* @__PURE__ */ z(
|
|
3707
|
-
/* @__PURE__ */ z(
|
|
3708
|
-
/* @__PURE__ */ z(
|
|
3709
|
-
/* @__PURE__ */ z(
|
|
3710
|
-
/* @__PURE__ */ z(
|
|
3711
|
-
r === "markdown" && /* @__PURE__ */ z(
|
|
3636
|
+
/* @__PURE__ */ z(Ts, { onBlur: u }),
|
|
3637
|
+
/* @__PURE__ */ z(qe, {}),
|
|
3638
|
+
/* @__PURE__ */ z(vs, { controlledRef: p ?? null }),
|
|
3639
|
+
/* @__PURE__ */ z(Es, { onFocusChange: f }),
|
|
3640
|
+
/* @__PURE__ */ z(Wt, {}),
|
|
3641
|
+
r === "markdown" && /* @__PURE__ */ z(Rs, {}),
|
|
3712
3642
|
e
|
|
3713
3643
|
]
|
|
3714
3644
|
})
|
|
3715
3645
|
});
|
|
3716
3646
|
}
|
|
3717
|
-
var
|
|
3647
|
+
var Ws = a((e, t) => /* @__PURE__ */ z(Us, {
|
|
3718
3648
|
...e,
|
|
3719
3649
|
forwardedRef: t
|
|
3720
3650
|
}));
|
|
3721
|
-
|
|
3651
|
+
Ws.displayName = "RichTextArea";
|
|
3722
3652
|
//#endregion
|
|
3723
3653
|
//#region src/components/rich-text-field/constants.ts
|
|
3724
|
-
var
|
|
3654
|
+
var Gs = "Arial, sans-serif", Ks = [
|
|
3725
3655
|
{
|
|
3726
3656
|
value: "Arial, sans-serif",
|
|
3727
3657
|
label: "Arial"
|
|
@@ -3758,7 +3688,7 @@ var lc = "Arial, sans-serif", uc = [
|
|
|
3758
3688
|
value: "\"Brush Script MT\", cursive",
|
|
3759
3689
|
label: "Brush Script MT"
|
|
3760
3690
|
}
|
|
3761
|
-
],
|
|
3691
|
+
], qs = Gs, Js = [
|
|
3762
3692
|
{
|
|
3763
3693
|
label: "10",
|
|
3764
3694
|
value: "10"
|
|
@@ -3787,11 +3717,11 @@ var lc = "Arial, sans-serif", uc = [
|
|
|
3787
3717
|
label: "48",
|
|
3788
3718
|
value: "48"
|
|
3789
3719
|
}
|
|
3790
|
-
],
|
|
3720
|
+
], Ys = "left", Xs = "#000000";
|
|
3791
3721
|
//#endregion
|
|
3792
3722
|
//#region src/components/rich-text-field/components/toolbar-select.tsx
|
|
3793
|
-
function
|
|
3794
|
-
return /* @__PURE__ */ z(
|
|
3723
|
+
function Zs({ className: e, selectItemClassName: t, ...n }) {
|
|
3724
|
+
return /* @__PURE__ */ z(se, {
|
|
3795
3725
|
fullWidth: !1,
|
|
3796
3726
|
size: "small",
|
|
3797
3727
|
className: I(e),
|
|
@@ -3801,44 +3731,44 @@ function hc({ className: e, selectItemClassName: t, ...n }) {
|
|
|
3801
3731
|
}
|
|
3802
3732
|
//#endregion
|
|
3803
3733
|
//#region src/components/rich-text-field/components/alignment-select.tsx
|
|
3804
|
-
function
|
|
3734
|
+
function Qs(e) {
|
|
3805
3735
|
return e === "center" || e === "right" ? e : e === "end" ? "right" : "left";
|
|
3806
3736
|
}
|
|
3807
|
-
var
|
|
3737
|
+
var $s = {
|
|
3808
3738
|
left: {
|
|
3809
3739
|
label: "Left",
|
|
3810
|
-
icon: /* @__PURE__ */ z(
|
|
3740
|
+
icon: /* @__PURE__ */ z(ve, { fontSize: "inherit" })
|
|
3811
3741
|
},
|
|
3812
3742
|
center: {
|
|
3813
3743
|
label: "Center",
|
|
3814
|
-
icon: /* @__PURE__ */ z(
|
|
3744
|
+
icon: /* @__PURE__ */ z(_e, { fontSize: "inherit" })
|
|
3815
3745
|
},
|
|
3816
3746
|
right: {
|
|
3817
3747
|
label: "Right",
|
|
3818
|
-
icon: /* @__PURE__ */ z(
|
|
3748
|
+
icon: /* @__PURE__ */ z(ye, { fontSize: "inherit" })
|
|
3819
3749
|
}
|
|
3820
3750
|
};
|
|
3821
|
-
function
|
|
3822
|
-
let t = Q(), [n, r] =
|
|
3751
|
+
function ec({ className: e }) {
|
|
3752
|
+
let t = Q(), [n, r] = h(Ys), i = p(() => Object.entries($s).map(([e, { label: t, icon: n }]) => ({
|
|
3823
3753
|
value: e,
|
|
3824
3754
|
label: t,
|
|
3825
3755
|
icon: n
|
|
3826
3756
|
})), []), a = c(() => {
|
|
3827
|
-
let e =
|
|
3828
|
-
if (
|
|
3829
|
-
let t = e.anchor.getNode(), n = t.getParent(), i =
|
|
3830
|
-
|
|
3757
|
+
let e = K();
|
|
3758
|
+
if (q(e)) {
|
|
3759
|
+
let t = e.anchor.getNode(), n = t.getParent(), i = ct(t) ? t : n;
|
|
3760
|
+
ct(i) && r(Qs(i.getFormatType() || "left"));
|
|
3831
3761
|
}
|
|
3832
3762
|
}, []);
|
|
3833
|
-
u(() =>
|
|
3763
|
+
u(() => Qt(t.registerUpdateListener(({ editorState: e }) => {
|
|
3834
3764
|
e.read(() => {
|
|
3835
3765
|
a();
|
|
3836
3766
|
});
|
|
3837
|
-
}), t.registerCommand(
|
|
3767
|
+
}), t.registerCommand(xt, () => (a(), !1), ht)), [t, a]);
|
|
3838
3768
|
function o(e) {
|
|
3839
|
-
t.dispatchCommand(
|
|
3769
|
+
t.dispatchCommand(vt, e);
|
|
3840
3770
|
}
|
|
3841
|
-
return /* @__PURE__ */ z(
|
|
3771
|
+
return /* @__PURE__ */ z(Zs, {
|
|
3842
3772
|
shouldShowOnlyIcon: !0,
|
|
3843
3773
|
options: i,
|
|
3844
3774
|
value: n,
|
|
@@ -3861,91 +3791,91 @@ function $({ className: e, children: t, isActive: n, isDisabled: r = !1, ...i })
|
|
|
3861
3791
|
}
|
|
3862
3792
|
//#endregion
|
|
3863
3793
|
//#region src/components/rich-text-field/components/attachment-button.tsx
|
|
3864
|
-
function
|
|
3794
|
+
function tc(e) {
|
|
3865
3795
|
let t = Q();
|
|
3866
3796
|
function n() {
|
|
3867
|
-
t.dispatchCommand(
|
|
3797
|
+
t.dispatchCommand(zs, void 0);
|
|
3868
3798
|
}
|
|
3869
3799
|
return /* @__PURE__ */ z($, {
|
|
3870
3800
|
"data-testid": "attachment-button",
|
|
3871
3801
|
"aria-label": "Add Attachment",
|
|
3872
3802
|
onClick: n,
|
|
3873
3803
|
...e,
|
|
3874
|
-
children: /* @__PURE__ */ z(
|
|
3804
|
+
children: /* @__PURE__ */ z(de, {})
|
|
3875
3805
|
});
|
|
3876
3806
|
}
|
|
3877
3807
|
//#endregion
|
|
3878
3808
|
//#region src/components/rich-text-field/utils.ts
|
|
3879
|
-
function
|
|
3809
|
+
function nc(e) {
|
|
3880
3810
|
let t;
|
|
3881
|
-
for (let n of
|
|
3882
|
-
return t ||
|
|
3811
|
+
for (let n of rn(e, { silent: !0 })) n.type === "declaration" && n.value && (t ||= {}, t[n.property] = n.value);
|
|
3812
|
+
return t || rc;
|
|
3883
3813
|
}
|
|
3884
|
-
var
|
|
3885
|
-
function
|
|
3886
|
-
return typeof e == "string" ?
|
|
3814
|
+
var rc = Object.freeze({});
|
|
3815
|
+
function ic(e) {
|
|
3816
|
+
return typeof e == "string" ? nc(e) : rc;
|
|
3887
3817
|
}
|
|
3888
|
-
function
|
|
3818
|
+
function ac(e) {
|
|
3889
3819
|
let t = [];
|
|
3890
3820
|
for (let [n, r] of Object.entries(e)) n && r && t.push(`${n}: ${r};`);
|
|
3891
3821
|
return t.sort().join(" ");
|
|
3892
3822
|
}
|
|
3893
|
-
function
|
|
3823
|
+
function oc(e, t) {
|
|
3894
3824
|
return e === t || !e && !t;
|
|
3895
3825
|
}
|
|
3896
|
-
function
|
|
3826
|
+
function sc(e, t) {
|
|
3897
3827
|
if (e === t) return !0;
|
|
3898
|
-
for (let n in e) if (!(n in t &&
|
|
3828
|
+
for (let n in e) if (!(n in t && oc(e[n], t[n]))) return !1;
|
|
3899
3829
|
for (let n in t) if (!(n in e)) return !1;
|
|
3900
3830
|
return !0;
|
|
3901
3831
|
}
|
|
3902
|
-
var
|
|
3903
|
-
isEqual:
|
|
3904
|
-
parse:
|
|
3905
|
-
unparse:
|
|
3832
|
+
var cc = Tt("style", {
|
|
3833
|
+
isEqual: sc,
|
|
3834
|
+
parse: ic,
|
|
3835
|
+
unparse: ac
|
|
3906
3836
|
});
|
|
3907
|
-
function
|
|
3908
|
-
return
|
|
3837
|
+
function lc(e, t) {
|
|
3838
|
+
return ft(e, cc, t);
|
|
3909
3839
|
}
|
|
3910
|
-
function
|
|
3911
|
-
return e ===
|
|
3840
|
+
function uc(e, t) {
|
|
3841
|
+
return e === rc || e === t ? t : {
|
|
3912
3842
|
...e,
|
|
3913
3843
|
...t
|
|
3914
3844
|
};
|
|
3915
3845
|
}
|
|
3916
|
-
|
|
3917
|
-
function
|
|
3918
|
-
let t =
|
|
3846
|
+
wt("PATCH_TEXT_STYLE_COMMAND");
|
|
3847
|
+
function dc(e) {
|
|
3848
|
+
let t = K();
|
|
3919
3849
|
if (!t) {
|
|
3920
|
-
let e =
|
|
3850
|
+
let e = ot();
|
|
3921
3851
|
if (!e) return !1;
|
|
3922
|
-
t = e.clone(),
|
|
3852
|
+
t = e.clone(), dt(t);
|
|
3923
3853
|
}
|
|
3924
|
-
let n = typeof e == "function" ? e : (t) =>
|
|
3925
|
-
if (
|
|
3854
|
+
let n = typeof e == "function" ? e : (t) => uc(t, e);
|
|
3855
|
+
if (q(t) && t.isCollapsed()) {
|
|
3926
3856
|
let e = t.focus.getNode();
|
|
3927
|
-
|
|
3928
|
-
} else
|
|
3857
|
+
J(e) && lc(e, n);
|
|
3858
|
+
} else $t((e) => lc(e, n));
|
|
3929
3859
|
return !0;
|
|
3930
3860
|
}
|
|
3931
|
-
function
|
|
3861
|
+
function fc(e) {
|
|
3932
3862
|
let t = e.anchor, n = e.focus, r = e.anchor.getNode(), i = e.focus.getNode();
|
|
3933
|
-
return r === i ? r : e.isBackward() ?
|
|
3863
|
+
return r === i ? r : e.isBackward() ? tn(n) ? r : i : tn(t) ? r : i;
|
|
3934
3864
|
}
|
|
3935
|
-
var
|
|
3865
|
+
var pc = (e, t, n, r) => {
|
|
3936
3866
|
e.update(() => {
|
|
3937
|
-
if (r &&
|
|
3938
|
-
let e =
|
|
3939
|
-
e !== null &&
|
|
3867
|
+
if (r && W(St), e.isEditable()) {
|
|
3868
|
+
let e = K();
|
|
3869
|
+
e !== null && nn(e, { "font-size": t + "px" });
|
|
3940
3870
|
}
|
|
3941
3871
|
});
|
|
3942
|
-
},
|
|
3943
|
-
function
|
|
3944
|
-
let e = l(
|
|
3872
|
+
}, mc = (e) => e.startsWith("http") ? e : `https://${e}`, hc = i(null);
|
|
3873
|
+
function gc() {
|
|
3874
|
+
let e = l(hc);
|
|
3945
3875
|
if (!e) throw Error("\"useRichTextFieldContext\" must be used within a RichTextFieldContextProvider");
|
|
3946
3876
|
return e;
|
|
3947
3877
|
}
|
|
3948
|
-
function
|
|
3878
|
+
function _c(e) {
|
|
3949
3879
|
let t = e.trim(), n = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);
|
|
3950
3880
|
if (n) {
|
|
3951
3881
|
let e = n[1];
|
|
@@ -3960,52 +3890,52 @@ function Fc(e) {
|
|
|
3960
3890
|
let e = (e) => Math.max(0, Math.min(255, e)), [t, n, i] = r.slice(1, 4).map((t) => e(Number.parseInt(t, 10))), a = (e) => e.toString(16).padStart(2, "0");
|
|
3961
3891
|
return `#${a(t)}${a(n)}${a(i)}`;
|
|
3962
3892
|
}
|
|
3963
|
-
return
|
|
3893
|
+
return Xs;
|
|
3964
3894
|
}
|
|
3965
|
-
function
|
|
3966
|
-
let t = Q(), [n, r] =
|
|
3967
|
-
let e =
|
|
3968
|
-
if (
|
|
3969
|
-
r(
|
|
3970
|
-
let t =
|
|
3971
|
-
a(t ? t.replace("px", "") : "16"), s(e.hasFormat("bold")), d(e.hasFormat("italic")),
|
|
3972
|
-
let n =
|
|
3973
|
-
_(
|
|
3974
|
-
let i =
|
|
3895
|
+
function vc({ children: e }) {
|
|
3896
|
+
let t = Q(), [n, r] = h(qs), [i, a] = h("16"), [o, s] = h(!1), [l, d] = h(!1), [f, m] = h(!1), [g, _] = h(Xs), [v, y] = h(!1), b = c(() => {
|
|
3897
|
+
let e = K();
|
|
3898
|
+
if (q(e)) {
|
|
3899
|
+
r(en(e, "font-family", qs));
|
|
3900
|
+
let t = en(e, "font-size", "16px");
|
|
3901
|
+
a(t ? t.replace("px", "") : "16"), s(e.hasFormat("bold")), d(e.hasFormat("italic")), m(e.hasFormat("underline"));
|
|
3902
|
+
let n = en(e, "color", "#000000") || "#000000";
|
|
3903
|
+
_(_c(n));
|
|
3904
|
+
let i = fc(e), o = i.getParent(), c = Le(o) || Le(i);
|
|
3975
3905
|
y(c);
|
|
3976
3906
|
}
|
|
3977
3907
|
}, []);
|
|
3978
|
-
u(() =>
|
|
3908
|
+
u(() => Qt(t.registerUpdateListener(({ editorState: e }) => {
|
|
3979
3909
|
e.read(() => {
|
|
3980
3910
|
b();
|
|
3981
3911
|
});
|
|
3982
|
-
}), t.registerCommand(
|
|
3912
|
+
}), t.registerCommand(xt, () => (b(), !1), ht)), [t, b]);
|
|
3983
3913
|
let x = c((e) => {
|
|
3984
3914
|
t.update(() => {
|
|
3985
|
-
|
|
3986
|
-
let t =
|
|
3987
|
-
t !== null &&
|
|
3915
|
+
W(Ct);
|
|
3916
|
+
let t = K();
|
|
3917
|
+
t !== null && nn(t, { "font-family": e });
|
|
3988
3918
|
});
|
|
3989
3919
|
}, [t]), S = c((e) => {
|
|
3990
|
-
|
|
3920
|
+
pc(t, e, null, !1);
|
|
3991
3921
|
}, [t]), C = c(() => {
|
|
3992
|
-
t.dispatchCommand(
|
|
3922
|
+
t.dispatchCommand(yt, "bold");
|
|
3993
3923
|
}, [t]), w = c(() => {
|
|
3994
|
-
t.dispatchCommand(
|
|
3924
|
+
t.dispatchCommand(yt, "italic");
|
|
3995
3925
|
}, [t]), T = c(() => {
|
|
3996
|
-
t.dispatchCommand(
|
|
3926
|
+
t.dispatchCommand(yt, "underline");
|
|
3997
3927
|
}, [t]), E = c((e) => {
|
|
3998
3928
|
t.update(() => {
|
|
3999
|
-
|
|
4000
|
-
let t =
|
|
4001
|
-
t !== null &&
|
|
3929
|
+
W(Ct);
|
|
3930
|
+
let t = K();
|
|
3931
|
+
t !== null && nn(t, { color: e });
|
|
4002
3932
|
});
|
|
4003
|
-
}, [t]),
|
|
4004
|
-
v ? (y(!1), t.dispatchCommand(
|
|
4005
|
-
}, [v, y]),
|
|
3933
|
+
}, [t]), D = c(() => {
|
|
3934
|
+
v ? (y(!1), t.dispatchCommand(ze, null)) : (y(!0), t.dispatchCommand(ze, mc("https://")));
|
|
3935
|
+
}, [v, y]), ee = p(() => ({
|
|
4006
3936
|
fontFamily: n,
|
|
4007
3937
|
fontSize: i,
|
|
4008
|
-
textColor:
|
|
3938
|
+
textColor: g,
|
|
4009
3939
|
isBold: o,
|
|
4010
3940
|
isItalic: l,
|
|
4011
3941
|
isUnderline: f,
|
|
@@ -4016,11 +3946,11 @@ function Ic({ children: e }) {
|
|
|
4016
3946
|
onBold: C,
|
|
4017
3947
|
onItalic: w,
|
|
4018
3948
|
onUnderline: T,
|
|
4019
|
-
onLink:
|
|
3949
|
+
onLink: D
|
|
4020
3950
|
}), [
|
|
4021
3951
|
n,
|
|
4022
3952
|
i,
|
|
4023
|
-
|
|
3953
|
+
g,
|
|
4024
3954
|
o,
|
|
4025
3955
|
l,
|
|
4026
3956
|
f,
|
|
@@ -4031,35 +3961,35 @@ function Ic({ children: e }) {
|
|
|
4031
3961
|
C,
|
|
4032
3962
|
w,
|
|
4033
3963
|
T,
|
|
4034
|
-
|
|
3964
|
+
D
|
|
4035
3965
|
]);
|
|
4036
|
-
return /* @__PURE__ */ z(
|
|
4037
|
-
value:
|
|
3966
|
+
return /* @__PURE__ */ z(hc.Provider, {
|
|
3967
|
+
value: ee,
|
|
4038
3968
|
children: e
|
|
4039
3969
|
});
|
|
4040
3970
|
}
|
|
4041
3971
|
//#endregion
|
|
4042
3972
|
//#region src/components/rich-text-field/components/bold-button.tsx
|
|
4043
|
-
function
|
|
4044
|
-
let { isBold: t, onBold: n } =
|
|
3973
|
+
function yc({ ...e }) {
|
|
3974
|
+
let { isBold: t, onBold: n } = gc();
|
|
4045
3975
|
return /* @__PURE__ */ z($, {
|
|
4046
3976
|
"data-testid": "bold-button",
|
|
4047
3977
|
"aria-label": "Format Bold",
|
|
4048
3978
|
isActive: t,
|
|
4049
3979
|
onClick: n,
|
|
4050
3980
|
...e,
|
|
4051
|
-
children: /* @__PURE__ */ z(
|
|
3981
|
+
children: /* @__PURE__ */ z(be, {})
|
|
4052
3982
|
});
|
|
4053
3983
|
}
|
|
4054
3984
|
//#endregion
|
|
4055
3985
|
//#region src/components/rich-text-field/components/clean-format-button.tsx
|
|
4056
|
-
function
|
|
3986
|
+
function bc({ ...e }) {
|
|
4057
3987
|
let t = Q(), n = c(() => {
|
|
4058
3988
|
t.update(() => {
|
|
4059
|
-
let e =
|
|
4060
|
-
if (
|
|
4061
|
-
|
|
4062
|
-
for (let t of e.extract())
|
|
3989
|
+
let e = K();
|
|
3990
|
+
if (q(e)) {
|
|
3991
|
+
dc(() => rc);
|
|
3992
|
+
for (let t of e.extract()) J(t) && (t.setFormat(0), t.setStyle(""), Zt(t).setFormat(""));
|
|
4063
3993
|
}
|
|
4064
3994
|
});
|
|
4065
3995
|
}, [t]);
|
|
@@ -4068,47 +3998,47 @@ function Rc({ ...e }) {
|
|
|
4068
3998
|
"aria-label": "Reset Formatting",
|
|
4069
3999
|
onClick: n,
|
|
4070
4000
|
...e,
|
|
4071
|
-
children: /* @__PURE__ */ z(
|
|
4001
|
+
children: /* @__PURE__ */ z(xe, {})
|
|
4072
4002
|
});
|
|
4073
4003
|
}
|
|
4074
4004
|
//#endregion
|
|
4075
4005
|
//#region src/components/rich-text-field/components/image-button.tsx
|
|
4076
|
-
function
|
|
4006
|
+
function xc({ ...e }) {
|
|
4077
4007
|
return /* @__PURE__ */ z($, {
|
|
4078
4008
|
"data-testid": "image-button",
|
|
4079
4009
|
"aria-label": "Add Image",
|
|
4080
4010
|
...e,
|
|
4081
|
-
children: /* @__PURE__ */ z(
|
|
4011
|
+
children: /* @__PURE__ */ z(Te, {})
|
|
4082
4012
|
});
|
|
4083
4013
|
}
|
|
4084
4014
|
//#endregion
|
|
4085
4015
|
//#region src/components/rich-text-field/components/italic-button.tsx
|
|
4086
|
-
function
|
|
4087
|
-
let { isItalic: t, onItalic: n } =
|
|
4016
|
+
function Sc({ ...e }) {
|
|
4017
|
+
let { isItalic: t, onItalic: n } = gc();
|
|
4088
4018
|
return /* @__PURE__ */ z($, {
|
|
4089
4019
|
"data-testid": "italic-button",
|
|
4090
4020
|
"aria-label": "Format Italics",
|
|
4091
4021
|
isActive: t,
|
|
4092
4022
|
onClick: n,
|
|
4093
4023
|
...e,
|
|
4094
|
-
children: /* @__PURE__ */ z(
|
|
4024
|
+
children: /* @__PURE__ */ z(Ce, {})
|
|
4095
4025
|
});
|
|
4096
4026
|
}
|
|
4097
4027
|
//#endregion
|
|
4098
4028
|
//#region src/components/rich-text-field/components/link-button.tsx
|
|
4099
|
-
function
|
|
4029
|
+
function Cc({ isActive: e, ...t }) {
|
|
4100
4030
|
return /* @__PURE__ */ z($, {
|
|
4101
4031
|
"data-testid": "link-button",
|
|
4102
4032
|
"aria-label": "Add Link",
|
|
4103
4033
|
...t,
|
|
4104
|
-
children: z(e ?
|
|
4034
|
+
children: z(e ? De : Ee, {})
|
|
4105
4035
|
});
|
|
4106
4036
|
}
|
|
4107
4037
|
//#endregion
|
|
4108
4038
|
//#region src/components/rich-text-field/components/size-select.tsx
|
|
4109
|
-
function
|
|
4110
|
-
let { fontSize: t, onFontSize: n } =
|
|
4111
|
-
return /* @__PURE__ */ z(
|
|
4039
|
+
function wc({ className: e }) {
|
|
4040
|
+
let { fontSize: t, onFontSize: n } = gc(), r = p(() => [...Js], []);
|
|
4041
|
+
return /* @__PURE__ */ z(Zs, {
|
|
4112
4042
|
"data-testid": "size-select",
|
|
4113
4043
|
options: r,
|
|
4114
4044
|
value: t,
|
|
@@ -4118,25 +4048,27 @@ function Hc({ className: e }) {
|
|
|
4118
4048
|
}
|
|
4119
4049
|
//#endregion
|
|
4120
4050
|
//#region src/components/rich-text-field/components/text-color-button.tsx
|
|
4121
|
-
function
|
|
4122
|
-
let { textColor:
|
|
4123
|
-
function
|
|
4124
|
-
|
|
4051
|
+
function Tc({ wrapperClassName: e, ...t }) {
|
|
4052
|
+
let { textColor: n, onTextColor: r } = gc(), i = n === Xs;
|
|
4053
|
+
function a(e) {
|
|
4054
|
+
r(e.target.value);
|
|
4125
4055
|
}
|
|
4126
4056
|
return /* @__PURE__ */ B("div", {
|
|
4127
|
-
|
|
4057
|
+
"data-slot": "rich-text-field-text-color",
|
|
4058
|
+
className: I("relative", e),
|
|
4128
4059
|
children: [/* @__PURE__ */ z($, {
|
|
4129
4060
|
"data-testid": "text-color-button",
|
|
4130
4061
|
"aria-label": "Text Color",
|
|
4131
|
-
...
|
|
4062
|
+
...t,
|
|
4132
4063
|
children: /* @__PURE__ */ z("span", {
|
|
4133
|
-
style:
|
|
4134
|
-
children: /* @__PURE__ */ z(
|
|
4064
|
+
style: i ? {} : { color: n },
|
|
4065
|
+
children: /* @__PURE__ */ z(Se, {})
|
|
4135
4066
|
})
|
|
4136
4067
|
}), /* @__PURE__ */ z("input", {
|
|
4137
4068
|
type: "color",
|
|
4138
|
-
|
|
4139
|
-
|
|
4069
|
+
"data-slot": "rich-text-field-text-color-input",
|
|
4070
|
+
value: n,
|
|
4071
|
+
onChange: a,
|
|
4140
4072
|
tabIndex: -1,
|
|
4141
4073
|
style: {
|
|
4142
4074
|
position: "absolute",
|
|
@@ -4151,9 +4083,9 @@ function Uc({ ...e }) {
|
|
|
4151
4083
|
}
|
|
4152
4084
|
//#endregion
|
|
4153
4085
|
//#region src/components/rich-text-field/components/typography-select.tsx
|
|
4154
|
-
function
|
|
4155
|
-
let { fontFamily: t, onFontFamily: n } =
|
|
4156
|
-
return /* @__PURE__ */ z(
|
|
4086
|
+
function Ec({ className: e }) {
|
|
4087
|
+
let { fontFamily: t, onFontFamily: n } = gc(), r = p(() => [...Ks], []);
|
|
4088
|
+
return /* @__PURE__ */ z(Zs, {
|
|
4157
4089
|
"data-testid": "typography-select",
|
|
4158
4090
|
options: r,
|
|
4159
4091
|
value: t,
|
|
@@ -4163,120 +4095,155 @@ function Wc({ className: e }) {
|
|
|
4163
4095
|
}
|
|
4164
4096
|
//#endregion
|
|
4165
4097
|
//#region src/components/rich-text-field/components/underline-button.tsx
|
|
4166
|
-
function
|
|
4167
|
-
let { isUnderline: t, onUnderline: n } =
|
|
4098
|
+
function Dc({ ...e }) {
|
|
4099
|
+
let { isUnderline: t, onUnderline: n } = gc();
|
|
4168
4100
|
return /* @__PURE__ */ z($, {
|
|
4169
4101
|
"data-testid": "underline-button",
|
|
4170
4102
|
"aria-label": "Format Underline",
|
|
4171
4103
|
isActive: t,
|
|
4172
4104
|
onClick: n,
|
|
4173
4105
|
...e,
|
|
4174
|
-
children: /* @__PURE__ */ z(
|
|
4106
|
+
children: /* @__PURE__ */ z(we, {})
|
|
4175
4107
|
});
|
|
4176
4108
|
}
|
|
4177
4109
|
//#endregion
|
|
4178
4110
|
//#region src/components/rich-text-field/components/formatting-toolbar-plugin.tsx
|
|
4179
|
-
var
|
|
4180
|
-
/* @__PURE__ */ z(
|
|
4181
|
-
/* @__PURE__ */ z(
|
|
4182
|
-
/* @__PURE__ */ z(
|
|
4183
|
-
/* @__PURE__ */ z(
|
|
4184
|
-
/* @__PURE__ */ z(
|
|
4185
|
-
/* @__PURE__ */ z(
|
|
4186
|
-
/* @__PURE__ */ z(
|
|
4187
|
-
/* @__PURE__ */ z(
|
|
4188
|
-
/* @__PURE__ */ z(
|
|
4189
|
-
/* @__PURE__ */ z(
|
|
4190
|
-
/* @__PURE__ */ z(
|
|
4191
|
-
/* @__PURE__ */ z(
|
|
4192
|
-
/* @__PURE__ */ z(
|
|
4193
|
-
/* @__PURE__ */ z(
|
|
4194
|
-
/* @__PURE__ */ z(
|
|
4111
|
+
var Oc = ({ hasAttachments: e }) => /* @__PURE__ */ B(R, { children: [
|
|
4112
|
+
/* @__PURE__ */ z(Ec, {}),
|
|
4113
|
+
/* @__PURE__ */ z(wc, {}),
|
|
4114
|
+
/* @__PURE__ */ z(x, { orientation: "vertical" }),
|
|
4115
|
+
/* @__PURE__ */ z(yc, {}),
|
|
4116
|
+
/* @__PURE__ */ z(Sc, {}),
|
|
4117
|
+
/* @__PURE__ */ z(Dc, {}),
|
|
4118
|
+
/* @__PURE__ */ z(Tc, {}),
|
|
4119
|
+
/* @__PURE__ */ z(x, { orientation: "vertical" }),
|
|
4120
|
+
/* @__PURE__ */ z(Cc, { isDisabled: !0 }),
|
|
4121
|
+
/* @__PURE__ */ z(tc, { isDisabled: !e }),
|
|
4122
|
+
/* @__PURE__ */ z(xc, { isDisabled: !0 }),
|
|
4123
|
+
/* @__PURE__ */ z(x, { orientation: "vertical" }),
|
|
4124
|
+
/* @__PURE__ */ z(ec, {}),
|
|
4125
|
+
/* @__PURE__ */ z(x, { orientation: "vertical" }),
|
|
4126
|
+
/* @__PURE__ */ z(bc, {})
|
|
4195
4127
|
] });
|
|
4196
|
-
function
|
|
4128
|
+
function kc({ className: e, children: t = Oc, hasAttachments: n = !1 }) {
|
|
4197
4129
|
return /* @__PURE__ */ z("div", {
|
|
4198
4130
|
"data-testid": "formatting-toolbar",
|
|
4131
|
+
"data-slot": "rich-text-field-toolbar",
|
|
4199
4132
|
className: I("flex items-center gap-[2px]", "px-[16px] py-[8px] overflow-x-auto", "bg-paper-elevation-1 border-b border-divider-border-base", e),
|
|
4200
4133
|
children: t({ hasAttachments: n })
|
|
4201
4134
|
});
|
|
4202
4135
|
}
|
|
4203
4136
|
//#endregion
|
|
4204
4137
|
//#region src/components/rich-text-field/rich-text-field.tsx
|
|
4205
|
-
var
|
|
4138
|
+
var Ac = a(({ children: e, className: t, placeholderClassName: n, containerClassName: r, toolbarPlacement: i = "top", toolbarChildren: a, toolbarClassName: o, isMultipleAttachments: s, enableAttachments: c, acceptedFiles: l, onFileAttach: u, ...d }, f) => {
|
|
4206
4139
|
let p = i === "top";
|
|
4207
|
-
return /* @__PURE__ */ B(
|
|
4140
|
+
return /* @__PURE__ */ B(Ws, {
|
|
4208
4141
|
ref: f,
|
|
4209
4142
|
"data-testid": "rich-text-field",
|
|
4143
|
+
"data-slot": "rich-text-field",
|
|
4210
4144
|
"data-toolbar-placement": i,
|
|
4211
4145
|
placeholderClassName: I("left-(--rich-text-field-editor-padding)", p ? "top-[calc(var(--rich-text-field-toolbar-height)+var(--rich-text-field-editor-padding))]" : "top-rich-text-field-editor-padding", n),
|
|
4212
4146
|
containerClassName: I("h-rich-text-field-height", "rounded-rich-text-field-toolbar", p ? "pt-rich-text-field-toolbar-height" : "pb-rich-text-field-toolbar-height", r),
|
|
4213
4147
|
className: I("p-rich-text-field-editor-padding", "bg-rich-text-field-background", "size-full", t),
|
|
4214
4148
|
...d,
|
|
4215
|
-
children: [/* @__PURE__ */ z(
|
|
4149
|
+
children: [/* @__PURE__ */ z(vc, { children: /* @__PURE__ */ z(kc, {
|
|
4216
4150
|
hasAttachments: c,
|
|
4217
4151
|
className: I("absolute right-0 w-full", p ? "top-0" : "bottom-0", o),
|
|
4218
4152
|
children: a
|
|
4219
|
-
}) }), /* @__PURE__ */ z(
|
|
4153
|
+
}) }), /* @__PURE__ */ z(Bs, {
|
|
4220
4154
|
acceptedFiles: l,
|
|
4221
4155
|
onFileAttach: u,
|
|
4222
4156
|
isMultiple: s
|
|
4223
4157
|
})]
|
|
4224
4158
|
});
|
|
4225
4159
|
});
|
|
4226
|
-
|
|
4160
|
+
Ac.displayName = "RichTextField";
|
|
4227
4161
|
//#endregion
|
|
4228
|
-
//#region src/components/
|
|
4229
|
-
var
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4162
|
+
//#region src/components/topmenu/topmenu.tsx
|
|
4163
|
+
var jc = V("flex shrink-0 items-center justify-end", {
|
|
4164
|
+
variants: {
|
|
4165
|
+
size: {
|
|
4166
|
+
md: ["px-[4px]", "rounded-overlay-tools-wrapper bg-overlay-tools-background-base"],
|
|
4167
|
+
lg: [
|
|
4168
|
+
"h-topmenu-height gap-topmenu-spacing-gap px-topmenu-spacing-padding",
|
|
4169
|
+
"rounded-topmenu-base bg-topmenu-background",
|
|
4170
|
+
"backdrop-blur-xs"
|
|
4171
|
+
]
|
|
4172
|
+
},
|
|
4173
|
+
hasBorder: {
|
|
4174
|
+
true: "",
|
|
4175
|
+
false: ""
|
|
4176
|
+
}
|
|
4177
|
+
},
|
|
4178
|
+
compoundVariants: [{
|
|
4179
|
+
size: "lg",
|
|
4180
|
+
hasBorder: !0,
|
|
4181
|
+
className: "border border-topmenu-border"
|
|
4182
|
+
}],
|
|
4183
|
+
defaultVariants: {
|
|
4184
|
+
size: "lg",
|
|
4185
|
+
hasBorder: !0
|
|
4186
|
+
}
|
|
4187
|
+
});
|
|
4188
|
+
function Mc({ className: e, children: t, ...n }) {
|
|
4189
|
+
return /* @__PURE__ */ z("div", {
|
|
4190
|
+
"data-slot": "topmenu",
|
|
4191
|
+
role: "group",
|
|
4192
|
+
className: I("absolute top-0 right-0", "flex flex-col items-end w-fit", e),
|
|
4193
|
+
...n,
|
|
4194
|
+
children: t
|
|
4195
|
+
});
|
|
4196
|
+
}
|
|
4197
|
+
function Nc({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
4198
|
+
return /* @__PURE__ */ z("div", {
|
|
4199
|
+
"data-slot": "topmenu-actions",
|
|
4200
|
+
"data-size": t ?? "lg",
|
|
4201
|
+
className: I(jc({
|
|
4202
|
+
size: t,
|
|
4203
|
+
hasBorder: n
|
|
4204
|
+
}), e),
|
|
4205
|
+
...i,
|
|
4206
|
+
children: r
|
|
4240
4207
|
});
|
|
4241
4208
|
}
|
|
4242
4209
|
//#endregion
|
|
4243
4210
|
//#region src/domain/actions/constants.ts
|
|
4244
|
-
var
|
|
4211
|
+
var Pc = "swisper";
|
|
4245
4212
|
//#endregion
|
|
4246
4213
|
//#region src/domain/actions/utils/index.ts
|
|
4247
|
-
function
|
|
4248
|
-
let n = `${
|
|
4214
|
+
function Fc(e, t) {
|
|
4215
|
+
let n = `${Pc}://action/${e}`;
|
|
4249
4216
|
return t ? `${n}?${new URLSearchParams(t).toString()}` : n;
|
|
4250
4217
|
}
|
|
4251
|
-
function
|
|
4252
|
-
return `[${t}](${
|
|
4218
|
+
function Ic({ action: e, label: t, params: n }) {
|
|
4219
|
+
return `[${t}](${Fc(e, n)})`;
|
|
4253
4220
|
}
|
|
4254
|
-
function
|
|
4221
|
+
function Lc(e) {
|
|
4255
4222
|
if (!e?.startsWith("swisper://")) return !1;
|
|
4256
4223
|
let t = new URL(e);
|
|
4257
4224
|
return t.protocol === "swisper:" && t.hostname === "action" && t.pathname.startsWith("/") && t.pathname.split("/").length === 2;
|
|
4258
4225
|
}
|
|
4259
|
-
function
|
|
4226
|
+
function Rc(e) {
|
|
4260
4227
|
let t;
|
|
4261
4228
|
try {
|
|
4262
4229
|
t = new URL(e);
|
|
4263
4230
|
} catch {
|
|
4264
4231
|
return null;
|
|
4265
4232
|
}
|
|
4266
|
-
return
|
|
4233
|
+
return Lc(e) ? {
|
|
4267
4234
|
option: t.pathname.replace("/", ""),
|
|
4268
4235
|
payload: Object.fromEntries(t.searchParams.entries())
|
|
4269
4236
|
} : null;
|
|
4270
4237
|
}
|
|
4271
|
-
function
|
|
4238
|
+
function zc(e) {
|
|
4272
4239
|
for (let t of e) if (t.type === "text" && typeof t.value == "string") return t.value;
|
|
4273
4240
|
return null;
|
|
4274
4241
|
}
|
|
4275
|
-
function
|
|
4242
|
+
function Bc(e) {
|
|
4276
4243
|
let t = sn().use(on).use(an).parse(e), n = null;
|
|
4277
4244
|
return cn(t, (e) => {
|
|
4278
4245
|
if (e.type !== "link") return;
|
|
4279
|
-
let t =
|
|
4246
|
+
let t = Rc(e.url), r = zc(e.children);
|
|
4280
4247
|
if (t && r) {
|
|
4281
4248
|
n = {
|
|
4282
4249
|
label: r,
|
|
@@ -4290,23 +4257,23 @@ function rl(e) {
|
|
|
4290
4257
|
}
|
|
4291
4258
|
//#endregion
|
|
4292
4259
|
//#region src/domain/actions/hooks/index.ts
|
|
4293
|
-
function
|
|
4294
|
-
return
|
|
4260
|
+
function Vc(e) {
|
|
4261
|
+
return p(() => e.map((e) => Bc(e) || { label: e }).filter((e) => e !== null), [e]);
|
|
4295
4262
|
}
|
|
4296
4263
|
//#endregion
|
|
4297
4264
|
//#region src/hooks/use-chat-stream-message.ts
|
|
4298
|
-
function
|
|
4265
|
+
function Hc(e) {
|
|
4299
4266
|
return JSON.parse(e);
|
|
4300
4267
|
}
|
|
4301
|
-
function
|
|
4268
|
+
function Uc(e) {
|
|
4302
4269
|
return e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
4303
4270
|
}
|
|
4304
|
-
function
|
|
4271
|
+
function Wc(e, t) {
|
|
4305
4272
|
return e instanceof Error ? e : Error(t);
|
|
4306
4273
|
}
|
|
4307
|
-
function
|
|
4274
|
+
function Gc() {
|
|
4308
4275
|
return { streamMessage: c(async ({ stream: e, abortController: t, timeout: n = 2e4, tokenParser: r, onChunkReceived: i, onAbort: a, onFinish: o, onError: s }) => {
|
|
4309
|
-
let c = r ??
|
|
4276
|
+
let c = r ?? Hc, l, u = !1, d = () => {
|
|
4310
4277
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
4311
4278
|
}, f = (e) => {
|
|
4312
4279
|
u || (u = !0, d(), a?.(e));
|
|
@@ -4333,7 +4300,7 @@ function cl() {
|
|
|
4333
4300
|
}
|
|
4334
4301
|
});
|
|
4335
4302
|
for (t?.signal.addEventListener("abort", () => {
|
|
4336
|
-
let e =
|
|
4303
|
+
let e = Wc(t.signal.reason, "Stream aborted");
|
|
4337
4304
|
f(e);
|
|
4338
4305
|
}, { once: !0 }), p(); !u;) {
|
|
4339
4306
|
let { value: t, done: n } = await e.read(), i = r.decode(t, { stream: !0 });
|
|
@@ -4342,8 +4309,8 @@ function cl() {
|
|
|
4342
4309
|
d(), !u && !t?.signal.aborted && o?.(n);
|
|
4343
4310
|
} catch (e) {
|
|
4344
4311
|
let n = e;
|
|
4345
|
-
if (u || t?.signal.aborted ||
|
|
4346
|
-
u || f(
|
|
4312
|
+
if (u || t?.signal.aborted || Uc(n)) {
|
|
4313
|
+
u || f(Wc(n, "Stream aborted"));
|
|
4347
4314
|
return;
|
|
4348
4315
|
}
|
|
4349
4316
|
t?.abort(n), console.error("Error while reading stream:", n), s?.(n);
|
|
@@ -4352,8 +4319,8 @@ function cl() {
|
|
|
4352
4319
|
}
|
|
4353
4320
|
//#endregion
|
|
4354
4321
|
//#region src/hooks/use-on-chat-changed.ts
|
|
4355
|
-
function
|
|
4356
|
-
let { chatId: t, isNewChat: n } = X(), r =
|
|
4322
|
+
function Kc(e) {
|
|
4323
|
+
let { chatId: t, isNewChat: n } = X(), r = m(n), i = m(t), a = m(e);
|
|
4357
4324
|
a.current = e, r.current = n, u(() => {
|
|
4358
4325
|
i.current !== t && (a.current({
|
|
4359
4326
|
chatId: t,
|
|
@@ -4364,19 +4331,19 @@ function ll(e) {
|
|
|
4364
4331
|
}
|
|
4365
4332
|
//#endregion
|
|
4366
4333
|
//#region src/hooks/use-current-chat-id.ts
|
|
4367
|
-
function
|
|
4334
|
+
function qc() {
|
|
4368
4335
|
let { chatId: e } = X();
|
|
4369
4336
|
return e;
|
|
4370
4337
|
}
|
|
4371
4338
|
//#endregion
|
|
4372
4339
|
//#region src/hooks/use-is-current-chat-new.ts
|
|
4373
|
-
function
|
|
4340
|
+
function Jc() {
|
|
4374
4341
|
let { isNewChat: e } = X();
|
|
4375
4342
|
return e;
|
|
4376
4343
|
}
|
|
4377
4344
|
//#endregion
|
|
4378
4345
|
//#region src/hooks/use-loaded-chat-ids.ts
|
|
4379
|
-
function
|
|
4346
|
+
function Yc() {
|
|
4380
4347
|
let { loadedChatIdsRef: e } = X();
|
|
4381
4348
|
return {
|
|
4382
4349
|
getIsChatLoaded: c((t) => e.current?.has(t) ?? !1, []),
|
|
@@ -4390,7 +4357,7 @@ function fl() {
|
|
|
4390
4357
|
}
|
|
4391
4358
|
//#endregion
|
|
4392
4359
|
//#region src/hooks/use-chat-prompt-placeholder.ts
|
|
4393
|
-
function
|
|
4360
|
+
function Xc() {
|
|
4394
4361
|
let { promptPlaceholder: e, setPromptPlaceholder: t, clearPromptPlaceholder: n } = X();
|
|
4395
4362
|
return {
|
|
4396
4363
|
promptPlaceholder: e,
|
|
@@ -4399,6 +4366,6 @@ function pl() {
|
|
|
4399
4366
|
};
|
|
4400
4367
|
}
|
|
4401
4368
|
//#endregion
|
|
4402
|
-
export {
|
|
4369
|
+
export { Ss as $replaceEditorHTMLContent, Cs as $replaceEditorSelectionHTMLContent, bs as $setSelectionToEnd, ec as AlignmentSelect, tc as AttachmentButton, yc as BoldButton, Pc as CHAT_ACTION_PROTOCOL, xo as CanvasShell, wo as CanvasShellCloseTrigger, Oo as CanvasShellContent, ko as CanvasShellFooter, To as CanvasShellFullScreenTrigger, So as CanvasShellHeader, Eo as CanvasShellOptionsButton, Co as CanvasShellTitle, pr as ChatCard, Qn as ChatCardActionButton, Zn as ChatCardActions, ur as ChatCardAttribute, dr as ChatCardAttributeLabel, fr as ChatCardAttributeValue, lr as ChatCardAttributes, tr as ChatCardBody, $n as ChatCardCollapsibleButton, vr as ChatCardContainer, nr as ChatCardContent, ir as ChatCardFooter, sr as ChatCardFooterActions, ar as ChatCardFooterNotes, or as ChatCardFooterPrice, cr as ChatCardForm, Kn as ChatCardHeader, Jn as ChatCardHeaderContent, qn as ChatCardIcon, pn as ChatCardListLayout, mn as ChatCardListLayoutItems, hn as ChatCardListLayoutShowMore, er as ChatCardMedia, rr as ChatCardPreview, Xn as ChatCardSubTitle, kn as ChatCardThreeColumnLayout, Mn as ChatCardThreeColumnLayoutDetails, An as ChatCardThreeColumnLayoutList, jn as ChatCardThreeColumnLayoutMain, Nn as ChatCardThreeColumnLayoutPanel, Yn as ChatCardTitle, Vn as ChatCardTwoColumnLayout, Hn as ChatCardTwoColumnLayoutAside, Un as ChatCardTwoColumnLayoutMain, wr as ChatContainer, Er as ChatContainerPrompt, Dr as ChatContainerWelcome, ji as ChatConversationProvider, Gr as ChatInput, qr as ChatInputTextarea, Xr as ChatList, ei as ChatListEmptyState, ti as ChatListError, ai as ChatListItem, ii as ChatListItems, ni as ChatListLoadMore, $r as ChatListSkeleton, xi as ChatMessage, Ci as ChatMessageActions, Vi as ChatMessageAttachmentCard, Gi as ChatMessageAttachmentCardActions, Hi as ChatMessageAttachmentCardContent, qi as ChatMessageAttachmentCardIcon, Wi as ChatMessageAttachmentCardPreview, Ui as ChatMessageAttachmentCardTitle, Si as ChatMessageContent, Ri as ChatMessageListGroup, ea as ChatMessageResponse, ta as ChatMessageToolbar, ra as ChatMessageToolbarActionButton, na as ChatMessageToolbarActions, ia as ChatMessageToolbarTimestamp, Fi as ChatMessages, Ii as ChatMessagesList, Bi as ChatMessagesScrollButton, pa as ChatNotificationCard, xa as ChatNotificationCardActions, Ca as ChatNotificationCardButtons, Da as ChatNotificationCardCloseButton, Oa as ChatNotificationCardContent, ja as ChatNotificationCardContentActions, Aa as ChatNotificationCardContentDescription, ka as ChatNotificationCardContentTitle, Ea as ChatNotificationCardDeleteButton, Pa as ChatNotificationCardDescription, Ma as ChatNotificationCardExpandButton, ma as ChatNotificationCardHead, ha as ChatNotificationCardHeader, ga as ChatNotificationCardHeaderIcon, ba as ChatNotificationCardHeaderStatus, _a as ChatNotificationCardHeaderTitle, va as ChatNotificationCardHeaderTitleLabel, Na as ChatNotificationCardIcon, wa as ChatNotificationCardReadActionButton, Ta as ChatNotificationCardSnoozeButton, Fa as ChatNotificationCardTimeStamp, Sa as ChatNotificationCardTimestamp, Ia as ChatNotificationPopup, Ra as ChatNotificationPopupContent, La as ChatNotificationPopupTrigger, pi as ChatPromptBox, yi as ChatPromptBoxActionsLeft, bi as ChatPromptBoxActionsRight, _i as ChatPromptBoxContent, vi as ChatPromptBoxInput, gi as ChatPromptBoxToolbar, Ei as ChatProvider, za as ChatReplies, Ba as ChatReply, Va as ChatReplyLabel, Ha as ChatReplyValue, Ka as ChatSuggestion, Xa as ChatSuggestionAction, Ya as ChatSuggestionActions, Ja as ChatSuggestionLabel, qa as ChatSuggestionLabelIcon, Ga as ChatSuggestions, jo as ChatThinkingProcess, Io as ChatThinkingProcessContent, Ro as ChatThinkingProcessContentItem, Mo as ChatThinkingProcessTrigger, Fo as ChatThinkingProcessTriggerArrow, No as ChatThinkingProcessTriggerIcon, Po as ChatThinkingProcessTriggerLabel, mo as ChatThread, vo as ChatThreadAnswer, bo as ChatThreadErrorState, go as ChatThreadGroup, fo as ChatThreadProvider, _o as ChatThreadQuestion, bc as CleanFormatButton, _r as EditableChatCardContextProvider, zo as EmptyState, Uo as EmptyStateActionRow, Ho as EmptyStateDescription, Bo as EmptyStateIcon, Vo as EmptyStateTitle, kc as FormattingToolbarPlugin, Ls as HtmlPastePlugin, Ms as INSERT_HTML_COMMAND, Ps as INSERT_HTML_EVENT, Ds as INSERT_IMAGE_COMMAND, Os as INSERT_IMAGE_EVENT_NAME, ks as ImageAddedEvent, xc as ImageButton, As as ImageDropPlugin, Is as InsertHtmlEvent, Sc as ItalicButton, Cc as LinkButton, Qi as MarkdownViewer, Ao as NewChatTrigger, js as PASTE_HTML_COMMAND, Ns as PASTE_HTML_EVENT, Fs as PasteHtmlEvent, Ws as RichTextArea, Ac as RichTextField, wc as SizeSelect, Tc as TextColorButton, $ as ToolbarButton, Mc as TopMenu, Nc as TopMenuActions, Ec as TypographySelect, Dc as UnderlineButton, Do as canvasShellContentPadding, wn as chatCardThreeColumnLayoutCardVariants, Sn as chatCardThreeColumnLayoutDetailsVariants, bn as chatCardThreeColumnLayoutListVariants, xn as chatCardThreeColumnLayoutMainVariants, Cn as chatCardThreeColumnLayoutPanelVariants, yn as chatCardThreeColumnLayoutVariants, In as chatCardTwoColumnLayoutAsideVariants, Rn as chatCardTwoColumnLayoutCardVariants, Fn as chatCardTwoColumnLayoutGridVariants, Ln as chatCardTwoColumnLayoutMainVariants, Pn as chatCardTwoColumnLayoutVariants, Ic as createChatActionLink, Bc as extractChatActionFromLink, ua as formatSnoozeDate, Yi as getAttachmentIcon, aa as getSnoozeUntilDate, Lc as isChatActionURL, ys as scrollRichTextAreaToBottom, Vc as useChatActions, fn as useChatCardListLayoutContext, X as useChatContext, Ai as useChatConversationContext, Ur as useChatInputContext, Yr as useChatListContext, Yc as useChatLoadedIds, fa as useChatNotificationCardContext, Xc as useChatPromptPlaceholder, Gc as useChatStreamMessage, Wa as useChatSuggestionContext, oo as useChatThread, Vt as useChatThreadScrollable, qc as useCurrentChatId, mr as useEditChatCard, gr as useEditableChatCardContext, Jc as useIsCurrentChatNew, Kc as useOnChatChanged, Q as useRichTextAreaEditor, gs as useRichTextAreaSelectedText };
|
|
4403
4370
|
|
|
4404
4371
|
//# sourceMappingURL=index.es.js.map
|