@swisper.ai/web-chat-ui 0.0.2 → 0.0.5
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 +30 -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-input/plugins/controlled-value-plugin.d.ts +4 -1
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts.map +1 -1
- package/dist/components/chat-input/plugins/value-plugin.d.ts +4 -1
- package/dist/components/chat-input/plugins/value-plugin.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/plugins/controlled-value-plugin.d.ts +4 -1
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts.map +1 -1
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts +4 -1
- package/dist/components/rich-text-area/plugins/value-plugin.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 +1801 -1806
- 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 +16 -10
- 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/__tests__/chat-input.spec.tsx +100 -0
- package/src/components/chat-input/chat-input.json +11 -2
- package/src/components/chat-input/chat-input.stories.tsx +660 -197
- package/src/components/chat-input/chat-input.tsx +39 -5
- package/src/components/chat-input/plugins/controlled-value-plugin.tsx +16 -3
- package/src/components/chat-input/plugins/value-plugin.tsx +19 -4
- 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/__tests__/rich-text-area.spec.tsx +114 -0
- package/src/components/rich-text-area/plugins/controlled-value-plugin.tsx +20 -3
- package/src/components/rich-text-area/plugins/value-plugin.tsx +16 -3
- package/src/components/rich-text-area/rich-text-area.json +7 -4
- package/src/components/rich-text-area/rich-text-area.stories.tsx +597 -41
- package/src/components/rich-text-area/rich-text-area.tsx +27 -4
- 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
|
@@ -8,14 +8,22 @@ import type { CustomMarkdownViewerComponents } from './types';
|
|
|
8
8
|
import 'katex/dist/katex.min.css';
|
|
9
9
|
|
|
10
10
|
export interface MarkdownViewerProps {
|
|
11
|
+
/** The full markdown received so far: GFM, math and `<swi-*>` tags. */
|
|
11
12
|
markdown: Markdown;
|
|
13
|
+
/** Classes merged last onto the root element, e.g. `text-text-secondary` or a different block gap. */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Set while the text is still arriving: animates the last block and shows the caret. */
|
|
12
16
|
isStreaming?: boolean;
|
|
17
|
+
/** Shows a block caret after the last character while `isStreaming` is true. */
|
|
13
18
|
hasCaret?: boolean;
|
|
19
|
+
/** Renderers keyed by tag name: `<swi-*>` tags, or overrides for standard markdown elements. */
|
|
14
20
|
customComponents?: CustomMarkdownViewerComponents;
|
|
15
21
|
}
|
|
16
22
|
|
|
23
|
+
/** Renders markdown through Streamdown, repairing half-received syntax and `<swi-*>` tags as it streams. */
|
|
17
24
|
export function MarkdownViewer({
|
|
18
25
|
markdown,
|
|
26
|
+
className,
|
|
19
27
|
isStreaming = false,
|
|
20
28
|
hasCaret = false,
|
|
21
29
|
customComponents = {},
|
|
@@ -24,6 +32,7 @@ export function MarkdownViewer({
|
|
|
24
32
|
|
|
25
33
|
return (
|
|
26
34
|
<Streamdown
|
|
35
|
+
className={className}
|
|
27
36
|
caret={hasCaret ? 'block' : undefined}
|
|
28
37
|
isAnimating={isStreaming}
|
|
29
38
|
components={components}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A reply draft as the email card stores it in Markdown: bold, italic and a list. */
|
|
2
|
+
export const REPLY_DRAFT_MARKDOWN = `Hi Lena,
|
|
3
|
+
|
|
4
|
+
**Thursday at 14:00** works for me. Before we meet, could you send:
|
|
5
|
+
|
|
6
|
+
- The revised offer
|
|
7
|
+
- The *signed* NDA
|
|
8
|
+
- Last quarter's usage report`;
|
|
9
|
+
|
|
10
|
+
/** An email signature as the integration settings store it: HTML, with a link. */
|
|
11
|
+
export const SIGNATURE_HTML =
|
|
12
|
+
'<p><strong>Noah Keller</strong></p><p>Account Manager · Northwind Trading</p><p><a href="mailto:noah.keller@company.com">noah.keller@company.com</a></p>';
|
|
13
|
+
|
|
14
|
+
/** The line the signature form inserts at the caret from an uploaded HTML file. */
|
|
15
|
+
export const SIGNATURE_DISCLAIMER_HTML =
|
|
16
|
+
'<p>This message is confidential and intended for the addressee only.</p>';
|
|
17
|
+
|
|
18
|
+
/** A small inline logo, so the image plugin has something to insert without a network request. */
|
|
19
|
+
export const SIGNATURE_LOGO = {
|
|
20
|
+
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='24'%3E%3Crect width='96' height='24' rx='4' fill='%2300a9dd'/%3E%3C/svg%3E",
|
|
21
|
+
altText: 'Northwind Trading logo',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** An email body as a document: a heading, paragraphs and a numbered list, in HTML. */
|
|
25
|
+
export const OFFER_EMAIL_HTML =
|
|
26
|
+
'<h2>Revised offer for Northwind Trading</h2><p>Hi Lena,</p><p>Thanks for the call on Tuesday. As agreed, the revised offer covers:</p><ol><li>40 seats on the <strong>Team</strong> plan, billed yearly</li><li>Onboarding for both offices in the first month</li><li>A review of usage after the first quarter, before the contract renews for a further twelve months</li></ol><p>Let me know if anything is missing.</p>';
|
|
27
|
+
|
|
28
|
+
/** The sentence the writer selected before asking the writing assistant to change it. */
|
|
29
|
+
export const SCRIBE_SELECTION =
|
|
30
|
+
'Thanks for the call on Tuesday. As agreed, the revised offer covers 40 seats on the Team plan, billed yearly, and onboarding for both offices in the first month.';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controlled-value wiring for RichTextArea: which `value` renders replace the content. Typing,
|
|
3
|
+
* formatting and keyboard behaviour are play stories; these tests exist because a parent's render
|
|
4
|
+
* can land after later keystrokes, and that timing cannot be forced in a browser run.
|
|
5
|
+
*/
|
|
6
|
+
import { EditorRefPlugin } from '@lexical/react/LexicalEditorRefPlugin';
|
|
7
|
+
import { act, cleanup, render, screen } from '@testing-library/react';
|
|
8
|
+
import { $createParagraphNode, $createTextNode, $getRoot, type LexicalEditor } from 'lexical';
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
10
|
+
|
|
11
|
+
import { RichTextArea, type RichTextAreaProps } from '../rich-text-area';
|
|
12
|
+
|
|
13
|
+
/** The Lexical editor of the rendered tree, so a test can edit the content the way a keystroke does. */
|
|
14
|
+
const editorRef: { current: LexicalEditor | null } = { current: null };
|
|
15
|
+
|
|
16
|
+
/** A controlled Markdown editor; `value` is whatever the parent last rendered. */
|
|
17
|
+
function editorTree(overrides: Partial<RichTextAreaProps> = {}) {
|
|
18
|
+
return (
|
|
19
|
+
<RichTextArea value="" onChange={vi.fn()} {...overrides}>
|
|
20
|
+
<EditorRefPlugin editorRef={editorRef} />
|
|
21
|
+
</RichTextArea>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Leaves the editor holding `text`, as it is after the user typed up to there. */
|
|
26
|
+
function typeUpTo(text: string) {
|
|
27
|
+
act(() => {
|
|
28
|
+
editorRef.current?.update(
|
|
29
|
+
() => {
|
|
30
|
+
const paragraph = $createParagraphNode();
|
|
31
|
+
paragraph.append($createTextNode(text));
|
|
32
|
+
$getRoot().clear().append(paragraph);
|
|
33
|
+
},
|
|
34
|
+
{ discrete: true },
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Lets the editor commit the content a new `value` gave it; that update is not synchronous. */
|
|
40
|
+
async function settle() {
|
|
41
|
+
await act(async () => {
|
|
42
|
+
await Promise.resolve();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// The editor reads the desktop breakpoint token to decide whether to refocus, and no stylesheet
|
|
47
|
+
// is loaded here.
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
document.documentElement.style.setProperty('--breakpoint-lg', '1024px');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
afterEach(() => {
|
|
53
|
+
cleanup();
|
|
54
|
+
vi.restoreAllMocks();
|
|
55
|
+
document.documentElement.style.removeProperty('--breakpoint-lg');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('a value the parent renders', () => {
|
|
59
|
+
// The parent echoes every `onChange` value back as `value`, and its render can land after the
|
|
60
|
+
// next keystrokes. The plugin used to apply that stale echo, so "Make" typed quickly became "Ma".
|
|
61
|
+
test('keeps what was typed since when it is a late echo of an earlier edit', async () => {
|
|
62
|
+
const onChange = vi.fn();
|
|
63
|
+
const { rerender } = render(editorTree({ onChange }));
|
|
64
|
+
|
|
65
|
+
typeUpTo('Ma');
|
|
66
|
+
typeUpTo('Make');
|
|
67
|
+
expect(onChange).toHaveBeenCalledWith('Ma');
|
|
68
|
+
|
|
69
|
+
rerender(editorTree({ onChange, value: 'Ma' }));
|
|
70
|
+
await settle();
|
|
71
|
+
expect(screen.getByRole('textbox').textContent).toBe('Make');
|
|
72
|
+
|
|
73
|
+
rerender(editorTree({ onChange, value: 'Make' }));
|
|
74
|
+
await settle();
|
|
75
|
+
expect(screen.getByRole('textbox').textContent).toBe('Make');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('replaces the content when the editor never emitted it', async () => {
|
|
79
|
+
const { rerender } = render(editorTree());
|
|
80
|
+
|
|
81
|
+
typeUpTo('Make');
|
|
82
|
+
rerender(editorTree({ value: 'Keep the greeting' }));
|
|
83
|
+
await settle();
|
|
84
|
+
|
|
85
|
+
expect(screen.getByRole('textbox').textContent).toBe('Keep the greeting');
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// An earlier edit is an echo only until the parent has caught up. After that the same string is
|
|
89
|
+
// the parent's own change: an undo, or a reset to a draft.
|
|
90
|
+
test('replaces the content with an earlier edit once the parent has caught up', async () => {
|
|
91
|
+
const { rerender } = render(editorTree());
|
|
92
|
+
|
|
93
|
+
typeUpTo('Ma');
|
|
94
|
+
typeUpTo('Make');
|
|
95
|
+
rerender(editorTree({ value: 'Make' }));
|
|
96
|
+
await settle();
|
|
97
|
+
rerender(editorTree({ value: 'Ma' }));
|
|
98
|
+
await settle();
|
|
99
|
+
|
|
100
|
+
expect(screen.getByRole('textbox').textContent).toBe('Ma');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('clears the content when it becomes empty', async () => {
|
|
104
|
+
const { rerender } = render(editorTree());
|
|
105
|
+
|
|
106
|
+
typeUpTo('Make');
|
|
107
|
+
rerender(editorTree({ value: 'Make' }));
|
|
108
|
+
await settle();
|
|
109
|
+
rerender(editorTree({ value: '' }));
|
|
110
|
+
await settle();
|
|
111
|
+
|
|
112
|
+
expect(screen.getByRole('textbox').textContent).toBe('');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $generateHtmlFromNodes } from '@lexical/html';
|
|
2
2
|
import { $convertToMarkdownString, $convertFromMarkdownString } from '@lexical/markdown';
|
|
3
3
|
import { $getRoot, $addUpdateTag, SKIP_DOM_SELECTION_TAG } from 'lexical';
|
|
4
|
-
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { type MutableRefObject, useEffect, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import { useIsResolution } from '@swisper.ai/ui';
|
|
7
7
|
|
|
@@ -16,9 +16,15 @@ import {
|
|
|
16
16
|
interface ControlledValuePluginProps {
|
|
17
17
|
value?: string;
|
|
18
18
|
source?: 'html' | 'markdown';
|
|
19
|
+
/** The values `ValuePlugin` gave to `onChange` that the parent has not rendered back yet. */
|
|
20
|
+
emittedValuesRef?: MutableRefObject<string[]>;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
export function ControlledValuePlugin({
|
|
23
|
+
export function ControlledValuePlugin({
|
|
24
|
+
value,
|
|
25
|
+
source = 'markdown',
|
|
26
|
+
emittedValuesRef,
|
|
27
|
+
}: ControlledValuePluginProps) {
|
|
22
28
|
const editor = useRichTextAreaEditor();
|
|
23
29
|
const previousValueRef = useRef<string | undefined>();
|
|
24
30
|
const shouldScrollOnInitialValueRef = useRef(Boolean(value?.trim()));
|
|
@@ -35,6 +41,17 @@ export function ControlledValuePlugin({ value, source = 'markdown' }: Controlled
|
|
|
35
41
|
|
|
36
42
|
previousValueRef.current = value;
|
|
37
43
|
|
|
44
|
+
// The parent renders back each value `onChange` gave it, and that render can land after later
|
|
45
|
+
// keystrokes. Such a value is an echo of an older edit, not a change to apply: applying it
|
|
46
|
+
// would drop what was typed since.
|
|
47
|
+
if (emittedValuesRef && value !== undefined) {
|
|
48
|
+
const echoIndex = emittedValuesRef.current.lastIndexOf(value);
|
|
49
|
+
emittedValuesRef.current.splice(0, echoIndex === -1 ? Infinity : echoIndex + 1);
|
|
50
|
+
if (echoIndex !== -1) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
let currentValue = '';
|
|
39
56
|
editor.getEditorState().read(() => {
|
|
40
57
|
currentValue =
|
|
@@ -95,7 +112,7 @@ export function ControlledValuePlugin({ value, source = 'markdown' }: Controlled
|
|
|
95
112
|
});
|
|
96
113
|
}
|
|
97
114
|
}
|
|
98
|
-
}, [editor, value, source, isDesktop]);
|
|
115
|
+
}, [editor, value, source, isDesktop, emittedValuesRef]);
|
|
99
116
|
|
|
100
117
|
return null;
|
|
101
118
|
}
|
|
@@ -2,18 +2,23 @@ import { $generateHtmlFromNodes } from '@lexical/html';
|
|
|
2
2
|
import { $convertToMarkdownString } from '@lexical/markdown';
|
|
3
3
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
4
4
|
import { type EditorState, type LexicalEditor } from 'lexical';
|
|
5
|
-
import { useCallback } from 'react';
|
|
5
|
+
import { type MutableRefObject, useCallback } from 'react';
|
|
6
6
|
|
|
7
7
|
import { EXPORT_TRANSFORMERS } from '../transformers';
|
|
8
8
|
|
|
9
9
|
export { MARKDOWN_TRANSFORMERS } from '../transformers';
|
|
10
10
|
|
|
11
|
+
/** How many emitted values to remember; a parent that never echoes them back must not grow the list. */
|
|
12
|
+
const MAX_EMITTED_VALUES = 50;
|
|
13
|
+
|
|
11
14
|
interface ValuePluginProps {
|
|
12
15
|
onChange?: (value: string) => void;
|
|
13
16
|
source?: 'html' | 'markdown';
|
|
17
|
+
/** Receives every value given to `onChange`, so `ControlledValuePlugin` can tell an echo of one. */
|
|
18
|
+
emittedValuesRef?: MutableRefObject<string[]>;
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
export function ValuePlugin({ onChange, source = 'markdown' }: ValuePluginProps) {
|
|
21
|
+
export function ValuePlugin({ onChange, source = 'markdown', emittedValuesRef }: ValuePluginProps) {
|
|
17
22
|
const handleChange = useCallback(
|
|
18
23
|
(editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => {
|
|
19
24
|
if (tags.has('focus')) {
|
|
@@ -31,6 +36,14 @@ export function ValuePlugin({ onChange, source = 'markdown' }: ValuePluginProps)
|
|
|
31
36
|
? $generateHtmlFromNodes(editor)
|
|
32
37
|
: $convertToMarkdownString(EXPORT_TRANSFORMERS);
|
|
33
38
|
|
|
39
|
+
if (emittedValuesRef) {
|
|
40
|
+
emittedValuesRef.current.push(value);
|
|
41
|
+
emittedValuesRef.current.splice(
|
|
42
|
+
0,
|
|
43
|
+
emittedValuesRef.current.length - MAX_EMITTED_VALUES,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
34
47
|
onChange(value);
|
|
35
48
|
});
|
|
36
49
|
} catch (error) {
|
|
@@ -39,7 +52,7 @@ export function ValuePlugin({ onChange, source = 'markdown' }: ValuePluginProps)
|
|
|
39
52
|
}
|
|
40
53
|
}
|
|
41
54
|
},
|
|
42
|
-
[onChange, source],
|
|
55
|
+
[onChange, source, emittedValuesRef],
|
|
43
56
|
);
|
|
44
57
|
|
|
45
58
|
return <OnChangePlugin onChange={handleChange} />;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"$schema": "../../../../int-eslint-config/schemas/component.schema.json",
|
|
3
3
|
"component": "rich-text-area",
|
|
4
4
|
"purpose": "Toolbar-less Lexical rich-text editor whose value is Markdown or HTML, with lists, headings, quotes, code, links, images and tables, and a children slot for extra Lexical plugins; the base that web-chat-ui/rich-text-field builds on.",
|
|
5
|
+
"anatomy": ["import { RichTextArea } from '@swisper.ai/web-chat-ui';", "", "<RichTextArea />"],
|
|
5
6
|
"useWhen": [
|
|
6
7
|
"Editing formatted text stored as Markdown or HTML without a visible formatting toolbar",
|
|
7
8
|
"Building a custom editor surface that adds its own Lexical plugins (image drop, HTML paste, a custom toolbar) as children",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
],
|
|
23
24
|
"keyboard": [
|
|
24
25
|
"Lexical rich-text keyboard handling: Ctrl/Cmd+B, I and U toggle bold, italic and underline; Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z undo and redo",
|
|
25
|
-
"onKeyDown runs in the capture phase on the editable element, before Lexical handles the key, so
|
|
26
|
+
"onKeyDown runs in the capture phase on the editable element, before Lexical handles the key; calling event.stopPropagation() there keeps the key from Lexical, so Enter adds no line (event.preventDefault() alone does not)"
|
|
26
27
|
],
|
|
27
28
|
"aria": [
|
|
28
29
|
"The editable element has role=textbox and aria-placeholder set to the placeholder; it gets aria-readonly when isDisabled",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"rules": [
|
|
41
42
|
"source sets the format of both value and onChange: markdown uses the Lexical Markdown transformers plus inline HTML for font size, family and colour (<span style>), underline (<ins>), alignment (<div style=\"text-align\">) and images (<img>); html uses Lexical's HTML import and export",
|
|
42
43
|
"value is controlled one-way: when it changes and differs from the editor's current serialisation, the content is replaced and the caret moves to the end; value '' clears the editor",
|
|
44
|
+
"A value that onChange already emitted and the parent renders back late is not applied, so a slow parent render cannot drop what was typed since; the same string replaces the content again once the parent has caught up",
|
|
43
45
|
"The first non-empty value scrolls the editor to the bottom, so a long preset draft opens at its end",
|
|
44
46
|
"onChange fires with the full serialised content on every edit, but not for focus-only updates",
|
|
45
47
|
"With source=markdown, paste inserts the clipboard's plain text (at the caret, or replacing the content line by line without a selection); with source=html, Lexical's default paste keeps rich content",
|
|
@@ -47,7 +49,8 @@
|
|
|
47
49
|
"children render inside the Lexical composer, so they can use useRichTextAreaEditor and useRichTextAreaSelectedText; ImageDropPlugin and HtmlPastePlugin are exported for this",
|
|
48
50
|
"ImageDropPlugin inserts an image when an ImageAddedEvent is dispatched on document; HtmlPastePlugin replaces the content on a PasteHtmlEvent and inserts at the caret on an InsertHtmlEvent",
|
|
49
51
|
"name is written to the editable element as data-name; it does not create a form field",
|
|
50
|
-
"className styles the editable content area, containerClassName the outer wrapper and placeholderClassName the absolutely positioned placeholder"
|
|
52
|
+
"className styles the editable content area (data-slot=rich-text-area-editable), containerClassName the outer wrapper (data-slot=rich-text-area) and placeholderClassName the absolutely positioned placeholder (data-slot=rich-text-area-placeholder)",
|
|
53
|
+
"The wrapper carries data-disabled=\"true\" while isDisabled, so a parent can style the disabled state with data-[disabled=true]:"
|
|
51
54
|
]
|
|
52
55
|
},
|
|
53
56
|
"composition": {
|
|
@@ -84,8 +87,8 @@
|
|
|
84
87
|
},
|
|
85
88
|
{
|
|
86
89
|
"condition": "Enter should submit instead of adding a line",
|
|
87
|
-
"decision": "Handle onKeyDown: on Enter without Shift, call event.preventDefault() and submit",
|
|
88
|
-
"reason": "onKeyDown runs in the capture phase, before Lexical inserts the paragraph"
|
|
90
|
+
"decision": "Handle onKeyDown: on Enter without Shift, call event.preventDefault() and event.stopPropagation(), then submit",
|
|
91
|
+
"reason": "onKeyDown runs in the capture phase, before Lexical inserts the paragraph; Lexical ignores preventDefault, so the event has to be stopped before it reaches the editor"
|
|
89
92
|
}
|
|
90
93
|
],
|
|
91
94
|
"relatedComponents": [
|