@swisper.ai/web-chat-ui 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +251 -0
- package/dist/components/canvas-shell/canvas-shell.d.ts +64 -0
- package/dist/components/canvas-shell/canvas-shell.d.ts.map +1 -0
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts +26 -0
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts.map +1 -0
- package/dist/components/canvas-shell/index.d.ts +2 -0
- package/dist/components/canvas-shell/index.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-context.d.ts +21 -0
- package/dist/components/card-item-picker/card-item-picker-context.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-list.d.ts +24 -0
- package/dist/components/card-item-picker/card-item-picker-list.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts +28 -0
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-row.d.ts +12 -0
- package/dist/components/card-item-picker/card-item-picker-row.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts +19 -0
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts.map +1 -0
- package/dist/components/card-item-picker/index.d.ts +9 -0
- package/dist/components/card-item-picker/index.d.ts.map +1 -0
- package/dist/components/chat-card/chat-card.d.ts +4 -0
- package/dist/components/chat-card/chat-card.d.ts.map +1 -0
- package/dist/components/chat-card/chat-card.stories.d.ts +11 -0
- package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts +22 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts +20 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-form.d.ts +28 -0
- package/dist/components/chat-card/components/chat-card-form.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-header.d.ts +36 -0
- package/dist/components/chat-card/components/chat-card-header.d.ts.map +1 -0
- package/dist/components/chat-card/components/index.d.ts +5 -0
- package/dist/components/chat-card/components/index.d.ts.map +1 -0
- package/dist/components/chat-card/context.d.ts +13 -0
- package/dist/components/chat-card/context.d.ts.map +1 -0
- package/dist/components/chat-card/contexts.d.ts +16 -0
- package/dist/components/chat-card/contexts.d.ts.map +1 -0
- package/dist/components/chat-card/hooks.d.ts +13 -0
- package/dist/components/chat-card/hooks.d.ts.map +1 -0
- package/dist/components/chat-card/index.d.ts +6 -0
- package/dist/components/chat-card/index.d.ts.map +1 -0
- package/dist/components/chat-card/types.d.ts +21 -0
- package/dist/components/chat-card/types.d.ts.map +1 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts +43 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts.map +1 -0
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts +17 -0
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -0
- package/dist/components/chat-card-container/index.d.ts +3 -0
- package/dist/components/chat-card-container/index.d.ts.map +1 -0
- package/dist/components/chat-container/chat-container.d.ts +51 -0
- package/dist/components/chat-container/chat-container.d.ts.map +1 -0
- package/dist/components/chat-container/chat-container.stories.d.ts +21 -0
- package/dist/components/chat-container/chat-container.stories.d.ts.map +1 -0
- package/dist/components/chat-container/index.d.ts +3 -0
- package/dist/components/chat-container/index.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.d.ts +35 -0
- package/dist/components/chat-input/chat-input.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.stories.d.ts +14 -0
- package/dist/components/chat-input/chat-input.stories.d.ts.map +1 -0
- package/dist/components/chat-input/index.d.ts +3 -0
- package/dist/components/chat-input/index.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/auto-focus-plugin.d.ts +8 -0
- package/dist/components/chat-input/plugins/auto-focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/disabled-plugin.d.ts +7 -0
- package/dist/components/chat-input/plugins/disabled-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/focus-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/has-value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/has-value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/hooks.d.ts +2 -0
- package/dist/components/chat-input/plugins/hooks.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/index.d.ts +8 -0
- package/dist/components/chat-input/plugins/index.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/markdown-plain-paste-plugin.d.ts +2 -0
- package/dist/components/chat-input/plugins/markdown-plain-paste-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/utils.d.ts +4 -0
- package/dist/components/chat-input/plugins/utils.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/transformers.d.ts +3 -0
- package/dist/components/chat-input/transformers.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list-item.d.ts +8 -0
- package/dist/components/chat-list/chat-list-item.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list-items.d.ts +11 -0
- package/dist/components/chat-list/chat-list-items.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.d.ts +63 -0
- package/dist/components/chat-list/chat-list.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.stories.d.ts +13 -0
- package/dist/components/chat-list/chat-list.stories.d.ts.map +1 -0
- package/dist/components/chat-list/index.d.ts +4 -0
- package/dist/components/chat-list/index.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.d.ts +17 -0
- package/dist/components/chat-message/chat-message.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.stories.d.ts +11 -0
- package/dist/components/chat-message/chat-message.stories.d.ts.map +1 -0
- package/dist/components/chat-message/index.d.ts +2 -0
- package/dist/components/chat-message/index.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts +9 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts +30 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts +11 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/index.d.ts +4 -0
- package/dist/components/chat-message-attachment-card/index.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts +5 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts.map +1 -0
- package/dist/components/chat-message-history/chat-message-history.d.ts +48 -0
- package/dist/components/chat-message-history/chat-message-history.d.ts.map +1 -0
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts +7 -0
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts.map +1 -0
- package/dist/components/chat-message-history/index.d.ts +2 -0
- package/dist/components/chat-message-history/index.d.ts.map +1 -0
- package/dist/components/chat-message-response/chat-message-response.d.ts +7 -0
- package/dist/components/chat-message-response/chat-message-response.d.ts.map +1 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts +7 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts.map +1 -0
- package/dist/components/chat-message-response/index.d.ts +2 -0
- package/dist/components/chat-message-response/index.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts +25 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts +7 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/index.d.ts +2 -0
- package/dist/components/chat-message-toolbar/index.d.ts.map +1 -0
- package/dist/components/chat-messages/chat-messages.d.ts +24 -0
- package/dist/components/chat-messages/chat-messages.d.ts.map +1 -0
- package/dist/components/chat-messages/chat-messages.stories.d.ts +8 -0
- package/dist/components/chat-messages/chat-messages.stories.d.ts.map +1 -0
- package/dist/components/chat-messages/index.d.ts +2 -0
- package/dist/components/chat-messages/index.d.ts.map +1 -0
- package/dist/components/chat-notification-card/chat-notification-card.d.ts +114 -0
- package/dist/components/chat-notification-card/chat-notification-card.d.ts.map +1 -0
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts +10 -0
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts.map +1 -0
- package/dist/components/chat-notification-card/index.d.ts +4 -0
- package/dist/components/chat-notification-card/index.d.ts.map +1 -0
- package/dist/components/chat-notification-card/types.d.ts +2 -0
- package/dist/components/chat-notification-card/types.d.ts.map +1 -0
- package/dist/components/chat-notification-card/utils.d.ts +3 -0
- package/dist/components/chat-notification-card/utils.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts +12 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts +8 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/index.d.ts +2 -0
- package/dist/components/chat-notification-popup/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts +17 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-focus-plugin.d.ts +2 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +27 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts +9 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/index.d.ts.map +1 -0
- package/dist/components/chat-reply/chat-reply.d.ts +23 -0
- package/dist/components/chat-reply/chat-reply.d.ts.map +1 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts +7 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts.map +1 -0
- package/dist/components/chat-reply/index.d.ts +2 -0
- package/dist/components/chat-reply/index.d.ts.map +1 -0
- package/dist/components/chat-suggestion/chat-suggestion.d.ts +37 -0
- package/dist/components/chat-suggestion/chat-suggestion.d.ts.map +1 -0
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts +9 -0
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts.map +1 -0
- package/dist/components/chat-suggestion/index.d.ts +2 -0
- package/dist/components/chat-suggestion/index.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +47 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +10 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/index.d.ts +2 -0
- package/dist/components/chat-thinking-process/index.d.ts.map +1 -0
- package/dist/components/chat-thread/chat-thread.d.ts +78 -0
- package/dist/components/chat-thread/chat-thread.d.ts.map +1 -0
- package/dist/components/chat-thread/chat-thread.stories.d.ts +14 -0
- package/dist/components/chat-thread/chat-thread.stories.d.ts.map +1 -0
- package/dist/components/chat-thread/index.d.ts +2 -0
- package/dist/components/chat-thread/index.d.ts.map +1 -0
- package/dist/components/deprecated-empty-state.d.ts +22 -0
- package/dist/components/deprecated-empty-state.d.ts.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/markdown-viewer/hooks.d.ts +9 -0
- package/dist/components/markdown-viewer/hooks.d.ts.map +1 -0
- package/dist/components/markdown-viewer/index.d.ts +3 -0
- package/dist/components/markdown-viewer/index.d.ts.map +1 -0
- package/dist/components/markdown-viewer/markdown-viewer.d.ts +10 -0
- package/dist/components/markdown-viewer/markdown-viewer.d.ts.map +1 -0
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts +9 -0
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts.map +1 -0
- package/dist/components/markdown-viewer/types.d.ts +9 -0
- package/dist/components/markdown-viewer/types.d.ts.map +1 -0
- package/dist/components/markdown-viewer/utils.d.ts +3 -0
- package/dist/components/markdown-viewer/utils.d.ts.map +1 -0
- package/dist/components/new-chat-trigger/index.d.ts +2 -0
- package/dist/components/new-chat-trigger/index.d.ts.map +1 -0
- package/dist/components/new-chat-trigger/new-chat-trigger.d.ts +8 -0
- package/dist/components/new-chat-trigger/new-chat-trigger.d.ts.map +1 -0
- package/dist/components/rich-text-area/constants/index.d.ts +3 -0
- package/dist/components/rich-text-area/constants/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/hooks.d.ts +3 -0
- package/dist/components/rich-text-area/hooks.d.ts.map +1 -0
- package/dist/components/rich-text-area/html-config.d.ts +4 -0
- package/dist/components/rich-text-area/html-config.d.ts.map +1 -0
- package/dist/components/rich-text-area/index.d.ts +7 -0
- package/dist/components/rich-text-area/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/nodes/div-block-node.d.ts +18 -0
- package/dist/components/rich-text-area/nodes/div-block-node.d.ts.map +1 -0
- package/dist/components/rich-text-area/nodes/image-node.d.ts +24 -0
- package/dist/components/rich-text-area/nodes/image-node.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/blur-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/blur-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/controlled-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/controlled-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/disabled-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/disabled-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/file-attachment-plugin.d.ts +10 -0
- package/dist/components/rich-text-area/plugins/file-attachment-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/focus-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/focus-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/html-paste-plugin.d.ts +19 -0
- package/dist/components/rich-text-area/plugins/html-paste-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/image-drop-plugin.d.ts +12 -0
- package/dist/components/rich-text-area/plugins/image-drop-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/index.d.ts +11 -0
- package/dist/components/rich-text-area/plugins/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/markdown-plain-paste-plugin.d.ts +2 -0
- package/dist/components/rich-text-area/plugins/markdown-plain-paste-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts +20 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts.map +1 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts +7 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts.map +1 -0
- package/dist/components/rich-text-area/styled.d.ts +3 -0
- package/dist/components/rich-text-area/styled.d.ts.map +1 -0
- package/dist/components/rich-text-area/transformers.d.ts +16 -0
- package/dist/components/rich-text-area/transformers.d.ts.map +1 -0
- package/dist/components/rich-text-area/types.d.ts +8 -0
- package/dist/components/rich-text-area/types.d.ts.map +1 -0
- package/dist/components/rich-text-area/utils/index.d.ts +6 -0
- package/dist/components/rich-text-area/utils/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/alignment-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/alignment-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/attachment-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/attachment-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/bold-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/bold-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/clean-format-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/clean-format-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts +11 -0
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/image-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/image-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/index.d.ts +14 -0
- package/dist/components/rich-text-field/components/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/italic-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/italic-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/link-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/link-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/size-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/size-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/text-color-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/text-color-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/toolbar-button.d.ts +6 -0
- package/dist/components/rich-text-field/components/toolbar-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/toolbar-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/toolbar-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/typography-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/typography-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/underline-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/underline-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/constants.d.ts +57 -0
- package/dist/components/rich-text-field/constants.d.ts.map +1 -0
- package/dist/components/rich-text-field/context.d.ts +26 -0
- package/dist/components/rich-text-field/context.d.ts.map +1 -0
- package/dist/components/rich-text-field/index.d.ts +3 -0
- package/dist/components/rich-text-field/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts +17 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts.map +1 -0
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts +10 -0
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -0
- package/dist/components/rich-text-field/utils.d.ts +1759 -0
- package/dist/components/rich-text-field/utils.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/spinner.d.ts +9 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.stories.d.ts +8 -0
- package/dist/components/spinner/spinner.stories.d.ts.map +1 -0
- package/dist/contexts/chat-context/chat-context.d.ts +20 -0
- package/dist/contexts/chat-context/chat-context.d.ts.map +1 -0
- package/dist/contexts/chat-context/index.d.ts +2 -0
- package/dist/contexts/chat-context/index.d.ts.map +1 -0
- package/dist/contexts/chat-context/utils.d.ts +3 -0
- package/dist/contexts/chat-context/utils.d.ts.map +1 -0
- package/dist/contexts/chat-conversation-context/chat-conversation-context.d.ts +20 -0
- package/dist/contexts/chat-conversation-context/chat-conversation-context.d.ts.map +1 -0
- package/dist/contexts/chat-conversation-context/index.d.ts +2 -0
- package/dist/contexts/chat-conversation-context/index.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/docs/agent.stories.d.ts +41 -0
- package/dist/docs/agent.stories.d.ts.map +1 -0
- package/dist/docs/chat-panel.d.ts +33 -0
- package/dist/docs/chat-panel.d.ts.map +1 -0
- package/dist/docs/chatbot-panel.d.ts +20 -0
- package/dist/docs/chatbot-panel.d.ts.map +1 -0
- package/dist/docs/chatbot.stories.d.ts +11 -0
- package/dist/docs/chatbot.stories.d.ts.map +1 -0
- package/dist/domain/actions/constants.d.ts +2 -0
- package/dist/domain/actions/constants.d.ts.map +1 -0
- package/dist/domain/actions/hooks/index.d.ts +3 -0
- package/dist/domain/actions/hooks/index.d.ts.map +1 -0
- package/dist/domain/actions/index.d.ts +5 -0
- package/dist/domain/actions/index.d.ts.map +1 -0
- package/dist/domain/actions/types.d.ts +7 -0
- package/dist/domain/actions/types.d.ts.map +1 -0
- package/dist/domain/actions/utils/index.d.ts +11 -0
- package/dist/domain/actions/utils/index.d.ts.map +1 -0
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-chat-prompt-placeholder.d.ts +6 -0
- package/dist/hooks/use-chat-prompt-placeholder.d.ts.map +1 -0
- package/dist/hooks/use-chat-stream-message.d.ts +42 -0
- package/dist/hooks/use-chat-stream-message.d.ts.map +1 -0
- package/dist/hooks/use-current-chat-id.d.ts +2 -0
- package/dist/hooks/use-current-chat-id.d.ts.map +1 -0
- package/dist/hooks/use-is-current-chat-new.d.ts +2 -0
- package/dist/hooks/use-is-current-chat-new.d.ts.map +1 -0
- package/dist/hooks/use-loaded-chat-ids.d.ts +9 -0
- package/dist/hooks/use-loaded-chat-ids.d.ts.map +1 -0
- package/dist/hooks/use-on-chat-changed.d.ts +9 -0
- package/dist/hooks/use-on-chat-changed.d.ts.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +4404 -0
- package/dist/index.es.js.map +1 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +95 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +24 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-list-layout/index.d.ts +3 -0
- package/dist/layouts/chat-card-list-layout/index.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts +84 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts +45 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +37 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts +81 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/index.d.ts +5 -0
- package/dist/layouts/chat-card-three-column-layout/index.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +31 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts +12 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +19 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts +35 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/index.d.ts +4 -0
- package/dist/layouts/chat-card-two-column-layout/index.d.ts.map +1 -0
- package/dist/layouts/index.d.ts +4 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/use-streaming-markdown.d.ts +18 -0
- package/dist/utils/use-streaming-markdown.d.ts.map +1 -0
- package/package.json +155 -0
- package/src/__tests__/setup.ts +5 -0
- package/src/components/canvas-shell/canvas-shell.json +126 -0
- package/src/components/canvas-shell/canvas-shell.stories.tsx +194 -0
- package/src/components/canvas-shell/canvas-shell.test.tsx +205 -0
- package/src/components/canvas-shell/canvas-shell.tsx +250 -0
- package/src/components/canvas-shell/index.ts +19 -0
- package/src/components/card-item-picker/__tests__/card-item-picker.spec.tsx +279 -0
- package/src/components/card-item-picker/card-item-picker-context.tsx +44 -0
- package/src/components/card-item-picker/card-item-picker-list.tsx +95 -0
- package/src/components/card-item-picker/card-item-picker-row-parts.tsx +96 -0
- package/src/components/card-item-picker/card-item-picker-row.tsx +109 -0
- package/src/components/card-item-picker/card-item-picker.json +147 -0
- package/src/components/card-item-picker/card-item-picker.stories.tsx +158 -0
- package/src/components/card-item-picker/index.ts +24 -0
- package/src/components/chat-card/__tests__/chat-card.spec.tsx +118 -0
- package/src/components/chat-card/chat-card.json +162 -0
- package/src/components/chat-card/chat-card.stories.tsx +349 -0
- package/src/components/chat-card/chat-card.tsx +106 -0
- package/src/components/chat-card/components/chat-card-body.tsx +115 -0
- package/src/components/chat-card/components/chat-card-footer.tsx +95 -0
- package/src/components/chat-card/components/chat-card-form.tsx +120 -0
- package/src/components/chat-card/components/chat-card-header.tsx +240 -0
- package/src/components/chat-card/components/index.ts +4 -0
- package/src/components/chat-card/context.tsx +34 -0
- package/src/components/chat-card/contexts.tsx +42 -0
- package/src/components/chat-card/hooks.ts +51 -0
- package/src/components/chat-card/index.ts +5 -0
- package/src/components/chat-card/types.ts +23 -0
- package/src/components/chat-card-container/chat-card-container.json +84 -0
- package/src/components/chat-card-container/chat-card-container.stories.tsx +149 -0
- package/src/components/chat-card-container/chat-card-container.tsx +75 -0
- package/src/components/chat-card-container/index.ts +2 -0
- package/src/components/chat-container/chat-container.json +93 -0
- package/src/components/chat-container/chat-container.stories.tsx +179 -0
- package/src/components/chat-container/chat-container.tsx +231 -0
- package/src/components/chat-container/index.ts +2 -0
- package/src/components/chat-input/chat-input.json +106 -0
- package/src/components/chat-input/chat-input.stories.tsx +291 -0
- package/src/components/chat-input/chat-input.tsx +220 -0
- package/src/components/chat-input/index.ts +2 -0
- package/src/components/chat-input/plugins/auto-focus-plugin.tsx +43 -0
- package/src/components/chat-input/plugins/controlled-value-plugin.tsx +47 -0
- package/src/components/chat-input/plugins/disabled-plugin.tsx +18 -0
- package/src/components/chat-input/plugins/focus-plugin.tsx +44 -0
- package/src/components/chat-input/plugins/has-value-plugin.tsx +51 -0
- package/src/components/chat-input/plugins/hooks.ts +7 -0
- package/src/components/chat-input/plugins/index.ts +7 -0
- package/src/components/chat-input/plugins/markdown-plain-paste-plugin.tsx +63 -0
- package/src/components/chat-input/plugins/utils.ts +48 -0
- package/src/components/chat-input/plugins/value-plugin.tsx +35 -0
- package/src/components/chat-input/transformers.ts +4 -0
- package/src/components/chat-list/chat-list-item.tsx +33 -0
- package/src/components/chat-list/chat-list-items.tsx +144 -0
- package/src/components/chat-list/chat-list.json +117 -0
- package/src/components/chat-list/chat-list.stories.tsx +332 -0
- package/src/components/chat-list/chat-list.tsx +278 -0
- package/src/components/chat-list/index.ts +18 -0
- package/src/components/chat-message/chat-message.json +105 -0
- package/src/components/chat-message/chat-message.stories.tsx +95 -0
- package/src/components/chat-message/chat-message.tsx +66 -0
- package/src/components/chat-message/index.ts +1 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx +74 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.json +110 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx +131 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.tsx +142 -0
- package/src/components/chat-message-attachment-card/index.ts +12 -0
- package/src/components/chat-message-attachment-card/utils.ts +41 -0
- package/src/components/chat-message-history/chat-message-history.json +99 -0
- package/src/components/chat-message-history/chat-message-history.stories.tsx +136 -0
- package/src/components/chat-message-history/chat-message-history.tsx +277 -0
- package/src/components/chat-message-history/index.ts +13 -0
- package/src/components/chat-message-response/chat-message-response.json +68 -0
- package/src/components/chat-message-response/chat-message-response.stories.tsx +63 -0
- package/src/components/chat-message-response/chat-message-response.tsx +24 -0
- package/src/components/chat-message-response/index.ts +1 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.json +100 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx +62 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.tsx +97 -0
- package/src/components/chat-message-toolbar/index.ts +6 -0
- package/src/components/chat-messages/chat-messages.json +95 -0
- package/src/components/chat-messages/chat-messages.stories.tsx +284 -0
- package/src/components/chat-messages/chat-messages.tsx +264 -0
- package/src/components/chat-messages/index.ts +10 -0
- package/src/components/chat-notification-card/chat-notification-card.json +135 -0
- package/src/components/chat-notification-card/chat-notification-card.stories.tsx +290 -0
- package/src/components/chat-notification-card/chat-notification-card.tsx +684 -0
- package/src/components/chat-notification-card/index.ts +3 -0
- package/src/components/chat-notification-card/types.ts +1 -0
- package/src/components/chat-notification-card/utils.ts +34 -0
- package/src/components/chat-notification-popup/chat-notification-popup.json +97 -0
- package/src/components/chat-notification-popup/chat-notification-popup.stories.tsx +80 -0
- package/src/components/chat-notification-popup/chat-notification-popup.tsx +36 -0
- package/src/components/chat-notification-popup/index.ts +1 -0
- package/src/components/chat-prompt-box/chat-prompt-box-context.tsx +62 -0
- package/src/components/chat-prompt-box/chat-prompt-box-focus-plugin.tsx +22 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +106 -0
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +117 -0
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +296 -0
- package/src/components/chat-prompt-box/index.ts +16 -0
- package/src/components/chat-reply/chat-reply.json +79 -0
- package/src/components/chat-reply/chat-reply.stories.tsx +72 -0
- package/src/components/chat-reply/chat-reply.tsx +103 -0
- package/src/components/chat-reply/index.ts +1 -0
- package/src/components/chat-suggestion/chat-suggestion.json +108 -0
- package/src/components/chat-suggestion/chat-suggestion.stories.tsx +147 -0
- package/src/components/chat-suggestion/chat-suggestion.tsx +184 -0
- package/src/components/chat-suggestion/index.ts +8 -0
- package/src/components/chat-thinking-process/chat-thinking-process.json +110 -0
- package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +202 -0
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +268 -0
- package/src/components/chat-thinking-process/index.ts +9 -0
- package/src/components/chat-thread/__tests__/chat-thread.spec.tsx +385 -0
- package/src/components/chat-thread/chat-thread.json +120 -0
- package/src/components/chat-thread/chat-thread.stories.tsx +218 -0
- package/src/components/chat-thread/chat-thread.tsx +549 -0
- package/src/components/chat-thread/index.ts +18 -0
- package/src/components/deprecated-empty-state.ts +39 -0
- package/src/components/index.ts +26 -0
- package/src/components/markdown-viewer/hooks.ts +59 -0
- package/src/components/markdown-viewer/index.ts +2 -0
- package/src/components/markdown-viewer/markdown-viewer.json +84 -0
- package/src/components/markdown-viewer/markdown-viewer.stories.tsx +110 -0
- package/src/components/markdown-viewer/markdown-viewer.tsx +95 -0
- package/src/components/markdown-viewer/types.ts +10 -0
- package/src/components/markdown-viewer/utils.ts +5 -0
- package/src/components/new-chat-trigger/index.ts +1 -0
- package/src/components/new-chat-trigger/new-chat-trigger.tsx +29 -0
- package/src/components/rich-text-area/constants/index.ts +10 -0
- package/src/components/rich-text-area/hooks.ts +24 -0
- package/src/components/rich-text-area/html-config.ts +195 -0
- package/src/components/rich-text-area/index.ts +6 -0
- package/src/components/rich-text-area/nodes/div-block-node.tsx +145 -0
- package/src/components/rich-text-area/nodes/image-node.tsx +100 -0
- package/src/components/rich-text-area/plugins/blur-plugin.tsx +36 -0
- package/src/components/rich-text-area/plugins/controlled-plugin.tsx +23 -0
- package/src/components/rich-text-area/plugins/controlled-value-plugin.tsx +101 -0
- package/src/components/rich-text-area/plugins/disabled-plugin.tsx +17 -0
- package/src/components/rich-text-area/plugins/file-attachment-plugin.tsx +57 -0
- package/src/components/rich-text-area/plugins/focus-plugin.tsx +44 -0
- package/src/components/rich-text-area/plugins/html-paste-plugin.tsx +104 -0
- package/src/components/rich-text-area/plugins/image-drop-plugin.tsx +56 -0
- package/src/components/rich-text-area/plugins/index.ts +10 -0
- package/src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx +63 -0
- package/src/components/rich-text-area/plugins/value-plugin.tsx +46 -0
- package/src/components/rich-text-area/rich-text-area.json +102 -0
- package/src/components/rich-text-area/rich-text-area.stories.tsx +140 -0
- package/src/components/rich-text-area/rich-text-area.tsx +156 -0
- package/src/components/rich-text-area/styled.tsx +20 -0
- package/src/components/rich-text-area/transformers.ts +175 -0
- package/src/components/rich-text-area/types.ts +8 -0
- package/src/components/rich-text-area/utils/index.ts +77 -0
- package/src/components/rich-text-field/components/alignment-select.tsx +103 -0
- package/src/components/rich-text-field/components/attachment-button.tsx +25 -0
- package/src/components/rich-text-field/components/bold-button.tsx +21 -0
- package/src/components/rich-text-field/components/clean-format-button.tsx +44 -0
- package/src/components/rich-text-field/components/formatting-toolbar-plugin.tsx +69 -0
- package/src/components/rich-text-field/components/image-button.tsx +11 -0
- package/src/components/rich-text-field/components/index.ts +14 -0
- package/src/components/rich-text-field/components/italic-button.tsx +21 -0
- package/src/components/rich-text-field/components/link-button.tsx +11 -0
- package/src/components/rich-text-field/components/size-select.tsx +27 -0
- package/src/components/rich-text-field/components/text-color-button.tsx +41 -0
- package/src/components/rich-text-field/components/toolbar-button.tsx +27 -0
- package/src/components/rich-text-field/components/toolbar-select.tsx +19 -0
- package/src/components/rich-text-field/components/typography-select.tsx +27 -0
- package/src/components/rich-text-field/components/underline-button.tsx +21 -0
- package/src/components/rich-text-field/constants.ts +33 -0
- package/src/components/rich-text-field/context.tsx +251 -0
- package/src/components/rich-text-field/index.tsx +6 -0
- package/src/components/rich-text-field/rich-text-field.json +118 -0
- package/src/components/rich-text-field/rich-text-field.stories.tsx +218 -0
- package/src/components/rich-text-field/rich-text-field.tsx +93 -0
- package/src/components/rich-text-field/utils.ts +532 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/spinner/spinner.json +73 -0
- package/src/components/spinner/spinner.stories.tsx +41 -0
- package/src/components/spinner/spinner.tsx +32 -0
- package/src/contexts/chat-context/chat-context.tsx +97 -0
- package/src/contexts/chat-context/index.ts +1 -0
- package/src/contexts/chat-context/utils.ts +7 -0
- package/src/contexts/chat-conversation-context/chat-conversation-context.tsx +608 -0
- package/src/contexts/chat-conversation-context/index.ts +1 -0
- package/src/contexts/index.ts +2 -0
- package/src/docs/agent.stories.tsx +567 -0
- package/src/docs/chat-panel.tsx +174 -0
- package/src/docs/chatbot-panel.tsx +381 -0
- package/src/docs/chatbot.mdx +144 -0
- package/src/docs/chatbot.stories.tsx +63 -0
- package/src/domain/actions/constants.ts +1 -0
- package/src/domain/actions/hooks/index.ts +22 -0
- package/src/domain/actions/index.ts +4 -0
- package/src/domain/actions/types.ts +6 -0
- package/src/domain/actions/utils/index.ts +112 -0
- package/src/domain/index.ts +1 -0
- package/src/hooks/index.tsx +10 -0
- package/src/hooks/use-chat-prompt-placeholder.ts +7 -0
- package/src/hooks/use-chat-stream-message.ts +189 -0
- package/src/hooks/use-current-chat-id.ts +6 -0
- package/src/hooks/use-is-current-chat-new.ts +6 -0
- package/src/hooks/use-loaded-chat-ids.ts +32 -0
- package/src/hooks/use-on-chat-changed.ts +33 -0
- package/src/index.css +1 -0
- package/src/index.ts +6 -0
- package/src/layouts/chat-card-list-layout/__tests__/chat-card-list-layout.spec.tsx +204 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +116 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +190 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +250 -0
- package/src/layouts/chat-card-list-layout/index.ts +11 -0
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.sizing.test.ts +73 -0
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx +282 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +131 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts +78 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +273 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx +291 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts +135 -0
- package/src/layouts/chat-card-three-column-layout/index.ts +24 -0
- package/src/layouts/chat-card-two-column-layout/__tests__/chat-card-two-column-layout.spec.tsx +109 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +97 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.ts +21 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +138 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +132 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.ts +65 -0
- package/src/layouts/chat-card-two-column-layout/index.ts +17 -0
- package/src/layouts/index.ts +3 -0
- package/src/types.ts +29 -0
- package/src/utils/use-streaming-markdown.ts +113 -0
- package/tailwind.css +7 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SelectField, type SelectFieldProps } from '@swisper.ai/ui';
|
|
2
|
+
import { cn } from '@swisper.ai/web-core';
|
|
3
|
+
|
|
4
|
+
export interface ToolbarSelectProps extends SelectFieldProps {}
|
|
5
|
+
|
|
6
|
+
export function ToolbarSelect({ className, selectItemClassName, ...rest }: ToolbarSelectProps) {
|
|
7
|
+
return (
|
|
8
|
+
<SelectField
|
|
9
|
+
fullWidth={false}
|
|
10
|
+
size="small"
|
|
11
|
+
className={cn(className)}
|
|
12
|
+
labelClassName={'border-none group-data-[state=open]/select:bg-secondary-states-hover!'}
|
|
13
|
+
// chevronIconClassName={cn('text-secondary-main')}
|
|
14
|
+
// selectItemClassName={cn('[&_svg]:size-[20px]', selectItemClassName)}
|
|
15
|
+
// iconClassName={cn('h-16')}
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@swisper.ai/web-core';
|
|
4
|
+
|
|
5
|
+
import { FONT_FAMILY_OPTIONS } from '../constants';
|
|
6
|
+
import { useRichTextFieldContext } from '../context';
|
|
7
|
+
|
|
8
|
+
import { ToolbarSelect } from './toolbar-select';
|
|
9
|
+
|
|
10
|
+
export interface TypographySelectProps {
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function TypographySelect({ className }: TypographySelectProps) {
|
|
15
|
+
const { fontFamily, onFontFamily } = useRichTextFieldContext();
|
|
16
|
+
const options = useMemo(() => [...FONT_FAMILY_OPTIONS], []);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<ToolbarSelect
|
|
20
|
+
data-testid="typography-select"
|
|
21
|
+
options={options}
|
|
22
|
+
value={fontFamily}
|
|
23
|
+
onChange={onFontFamily}
|
|
24
|
+
className={cn('w-[90px]', className)}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FormatUnderlineIcon } from '@swisper.ai/icons';
|
|
2
|
+
|
|
3
|
+
import { useRichTextFieldContext } from '../context';
|
|
4
|
+
|
|
5
|
+
import { ToolbarButton, type ToolbarButtonProps } from './toolbar-button';
|
|
6
|
+
|
|
7
|
+
export function UnderlineButton({ ...props }: ToolbarButtonProps) {
|
|
8
|
+
const { isUnderline, onUnderline } = useRichTextFieldContext();
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<ToolbarButton
|
|
12
|
+
data-testid="underline-button"
|
|
13
|
+
aria-label="Format Underline"
|
|
14
|
+
isActive={isUnderline}
|
|
15
|
+
onClick={onUnderline}
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
<FormatUnderlineIcon />
|
|
19
|
+
</ToolbarButton>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const DEFAULT_FONT_FAMILY = 'Arial, sans-serif' as const;
|
|
2
|
+
|
|
3
|
+
export const FONT_FAMILY_OPTIONS = [
|
|
4
|
+
{ value: 'Arial, sans-serif', label: 'Arial' },
|
|
5
|
+
{ value: 'Verdana, sans-serif', label: 'Verdana' },
|
|
6
|
+
{ value: 'Tahoma, sans-serif', label: 'Tahoma' },
|
|
7
|
+
{ value: '"Trebuchet MS", sans-serif', label: 'Trebuchet MS' },
|
|
8
|
+
{ value: '"Times New Roman", serif', label: 'Times New Roman' },
|
|
9
|
+
{ value: 'Georgia, serif', label: 'Georgia' },
|
|
10
|
+
{ value: 'Garamond, serif', label: 'Garamond' },
|
|
11
|
+
{ value: '"Courier New", monospace', label: 'Courier New' },
|
|
12
|
+
{ value: '"Brush Script MT", cursive', label: 'Brush Script MT' },
|
|
13
|
+
] as const;
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_FONT_FAMILY_VALUE = DEFAULT_FONT_FAMILY;
|
|
16
|
+
|
|
17
|
+
export const DEFAULT_FONT_SIZE = '16';
|
|
18
|
+
|
|
19
|
+
export const FONT_SIZE_OPTIONS = [
|
|
20
|
+
{ label: '10', value: '10' },
|
|
21
|
+
{ label: '12', value: '12' },
|
|
22
|
+
{ label: '16', value: '16' },
|
|
23
|
+
{ label: '20', value: '20' },
|
|
24
|
+
{ label: '24', value: '24' },
|
|
25
|
+
{ label: '34', value: '34' },
|
|
26
|
+
{ label: '48', value: '48' },
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
29
|
+
export const ALIGNMENT_OPTIONS = ['left', 'center', 'right'] as const;
|
|
30
|
+
|
|
31
|
+
export const DEFAULT_ALIGNMENT = 'left' as const;
|
|
32
|
+
|
|
33
|
+
export const DEFAULT_TEXT_COLOR = '#000000' as const;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
2
|
+
import { $getSelectionStyleValueForProperty, $patchStyleText } from '@lexical/selection';
|
|
3
|
+
import { mergeRegister } from '@lexical/utils';
|
|
4
|
+
import {
|
|
5
|
+
$getSelection,
|
|
6
|
+
$isRangeSelection,
|
|
7
|
+
SELECTION_CHANGE_COMMAND,
|
|
8
|
+
COMMAND_PRIORITY_LOW,
|
|
9
|
+
FORMAT_TEXT_COMMAND,
|
|
10
|
+
$addUpdateTag,
|
|
11
|
+
SKIP_SELECTION_FOCUS_TAG,
|
|
12
|
+
} from 'lexical';
|
|
13
|
+
import type { ReactNode } from 'react';
|
|
14
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
15
|
+
|
|
16
|
+
import { useRichTextAreaEditor } from '../rich-text-area/hooks';
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
type ALIGNMENT_OPTIONS,
|
|
20
|
+
DEFAULT_FONT_FAMILY_VALUE,
|
|
21
|
+
DEFAULT_FONT_SIZE,
|
|
22
|
+
DEFAULT_TEXT_COLOR,
|
|
23
|
+
} from './constants';
|
|
24
|
+
import { updateFontSizeInSelection, getSelectedNode } from './utils';
|
|
25
|
+
|
|
26
|
+
export type RichTextFieldAlignment = (typeof ALIGNMENT_OPTIONS)[number];
|
|
27
|
+
|
|
28
|
+
export interface RichTextFieldContextValue {
|
|
29
|
+
fontFamily: string;
|
|
30
|
+
fontSize: string;
|
|
31
|
+
textColor: string;
|
|
32
|
+
isBold: boolean;
|
|
33
|
+
isItalic: boolean;
|
|
34
|
+
isUnderline: boolean;
|
|
35
|
+
isLink: boolean;
|
|
36
|
+
onFontFamily: (value: string) => void;
|
|
37
|
+
onFontSize: (value: string) => void;
|
|
38
|
+
onTextColor: (value: string) => void;
|
|
39
|
+
onBold: () => void;
|
|
40
|
+
onItalic: () => void;
|
|
41
|
+
onUnderline: () => void;
|
|
42
|
+
onLink: () => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const sanitizeUrl = (url: string) => {
|
|
46
|
+
return url.startsWith('http') ? url : `https://${url}`;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const RichTextFieldContext = createContext<RichTextFieldContextValue>(null!);
|
|
50
|
+
|
|
51
|
+
export function useRichTextFieldContext() {
|
|
52
|
+
const context = useContext(RichTextFieldContext);
|
|
53
|
+
|
|
54
|
+
if (!context) {
|
|
55
|
+
throw new Error('"useRichTextFieldContext" must be used within a RichTextFieldContextProvider');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return context;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface RichTextFieldContextProviderProps {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function normalizeColorToHex(color: string): string {
|
|
66
|
+
const trimmed = color.trim();
|
|
67
|
+
|
|
68
|
+
// hex #rgb or #rrggbb
|
|
69
|
+
const hexMatch = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(trimmed);
|
|
70
|
+
if (hexMatch) {
|
|
71
|
+
const value = hexMatch[1];
|
|
72
|
+
if (value.length === 3) {
|
|
73
|
+
const [r, g, b] = value;
|
|
74
|
+
return `#${r}${r}${g}${g}${b}${b}`.toLowerCase();
|
|
75
|
+
}
|
|
76
|
+
return `#${value.toLowerCase()}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// rgb(...) or rgba(...)
|
|
80
|
+
const rgbMatch = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})/i.exec(trimmed);
|
|
81
|
+
if (rgbMatch) {
|
|
82
|
+
const clamp = (n: number) => Math.max(0, Math.min(255, n));
|
|
83
|
+
const [r, g, b] = rgbMatch.slice(1, 4).map((v) => clamp(Number.parseInt(v, 10)));
|
|
84
|
+
const toHex = (n: number) => n.toString(16).padStart(2, '0');
|
|
85
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return DEFAULT_TEXT_COLOR;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function RichTextFieldContextProvider({ children }: RichTextFieldContextProviderProps) {
|
|
92
|
+
const editor = useRichTextAreaEditor();
|
|
93
|
+
|
|
94
|
+
const [fontFamily, setFontFamily] = useState<string>(DEFAULT_FONT_FAMILY_VALUE);
|
|
95
|
+
const [fontSize, setFontSize] = useState<string>(DEFAULT_FONT_SIZE);
|
|
96
|
+
const [isBold, setIsBold] = useState(false);
|
|
97
|
+
const [isItalic, setIsItalic] = useState(false);
|
|
98
|
+
const [isUnderline, setIsUnderline] = useState(false);
|
|
99
|
+
const [textColor, setTextColor] = useState<string>(DEFAULT_TEXT_COLOR);
|
|
100
|
+
const [isLink, setIsLink] = useState(false);
|
|
101
|
+
|
|
102
|
+
const $updateToolbar = useCallback(() => {
|
|
103
|
+
const selection = $getSelection();
|
|
104
|
+
if ($isRangeSelection(selection)) {
|
|
105
|
+
// font family
|
|
106
|
+
setFontFamily(
|
|
107
|
+
$getSelectionStyleValueForProperty(selection, 'font-family', DEFAULT_FONT_FAMILY_VALUE),
|
|
108
|
+
);
|
|
109
|
+
// font size
|
|
110
|
+
const fontSize = $getSelectionStyleValueForProperty(
|
|
111
|
+
selection,
|
|
112
|
+
'font-size',
|
|
113
|
+
DEFAULT_FONT_SIZE + 'px',
|
|
114
|
+
);
|
|
115
|
+
setFontSize(fontSize ? fontSize.replace('px', '') : DEFAULT_FONT_SIZE);
|
|
116
|
+
// bold
|
|
117
|
+
setIsBold(selection.hasFormat('bold'));
|
|
118
|
+
// italic
|
|
119
|
+
setIsItalic(selection.hasFormat('italic'));
|
|
120
|
+
// underline
|
|
121
|
+
setIsUnderline(selection.hasFormat('underline'));
|
|
122
|
+
// text-color
|
|
123
|
+
const rawColor =
|
|
124
|
+
$getSelectionStyleValueForProperty(selection, 'color', DEFAULT_TEXT_COLOR) ||
|
|
125
|
+
DEFAULT_TEXT_COLOR;
|
|
126
|
+
setTextColor(normalizeColorToHex(rawColor));
|
|
127
|
+
// link
|
|
128
|
+
const node = getSelectedNode(selection);
|
|
129
|
+
const parent = node.getParent();
|
|
130
|
+
const isLink = $isLinkNode(parent) || $isLinkNode(node);
|
|
131
|
+
setIsLink(isLink);
|
|
132
|
+
}
|
|
133
|
+
}, []);
|
|
134
|
+
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
return mergeRegister(
|
|
137
|
+
editor.registerUpdateListener(({ editorState }) => {
|
|
138
|
+
editorState.read(() => {
|
|
139
|
+
$updateToolbar();
|
|
140
|
+
});
|
|
141
|
+
}),
|
|
142
|
+
|
|
143
|
+
editor.registerCommand(
|
|
144
|
+
SELECTION_CHANGE_COMMAND,
|
|
145
|
+
() => {
|
|
146
|
+
$updateToolbar();
|
|
147
|
+
return false;
|
|
148
|
+
},
|
|
149
|
+
COMMAND_PRIORITY_LOW,
|
|
150
|
+
),
|
|
151
|
+
);
|
|
152
|
+
}, [editor, $updateToolbar]);
|
|
153
|
+
|
|
154
|
+
const onFontFamily = useCallback(
|
|
155
|
+
(value: string) => {
|
|
156
|
+
editor.update(() => {
|
|
157
|
+
$addUpdateTag(SKIP_SELECTION_FOCUS_TAG);
|
|
158
|
+
const selection = $getSelection();
|
|
159
|
+
if (selection !== null) {
|
|
160
|
+
$patchStyleText(selection, {
|
|
161
|
+
['font-family']: value,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
[editor],
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const onFontSize = useCallback(
|
|
170
|
+
(value: string) => {
|
|
171
|
+
updateFontSizeInSelection(editor, value, null, false);
|
|
172
|
+
},
|
|
173
|
+
[editor],
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
const onBold = useCallback(() => {
|
|
177
|
+
editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold');
|
|
178
|
+
}, [editor]);
|
|
179
|
+
|
|
180
|
+
const onItalic = useCallback(() => {
|
|
181
|
+
editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic');
|
|
182
|
+
}, [editor]);
|
|
183
|
+
|
|
184
|
+
const onUnderline = useCallback(() => {
|
|
185
|
+
editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline');
|
|
186
|
+
}, [editor]);
|
|
187
|
+
|
|
188
|
+
const onTextColor = useCallback(
|
|
189
|
+
(value: string) => {
|
|
190
|
+
editor.update(() => {
|
|
191
|
+
$addUpdateTag(SKIP_SELECTION_FOCUS_TAG);
|
|
192
|
+
const selection = $getSelection();
|
|
193
|
+
if (selection !== null) {
|
|
194
|
+
$patchStyleText(selection, {
|
|
195
|
+
color: value,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
[editor],
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const onLink = useCallback(() => {
|
|
204
|
+
if (!isLink) {
|
|
205
|
+
setIsLink(true);
|
|
206
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, sanitizeUrl('https://'));
|
|
207
|
+
} else {
|
|
208
|
+
setIsLink(false);
|
|
209
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
210
|
+
}
|
|
211
|
+
}, [isLink, setIsLink]);
|
|
212
|
+
|
|
213
|
+
const contextValue = useMemo<RichTextFieldContextValue>(
|
|
214
|
+
() => ({
|
|
215
|
+
fontFamily,
|
|
216
|
+
fontSize,
|
|
217
|
+
textColor,
|
|
218
|
+
isBold,
|
|
219
|
+
isItalic,
|
|
220
|
+
isUnderline,
|
|
221
|
+
isLink,
|
|
222
|
+
onFontFamily,
|
|
223
|
+
onFontSize,
|
|
224
|
+
onTextColor,
|
|
225
|
+
onBold,
|
|
226
|
+
onItalic,
|
|
227
|
+
onUnderline,
|
|
228
|
+
onLink,
|
|
229
|
+
}),
|
|
230
|
+
[
|
|
231
|
+
fontFamily,
|
|
232
|
+
fontSize,
|
|
233
|
+
textColor,
|
|
234
|
+
isBold,
|
|
235
|
+
isItalic,
|
|
236
|
+
isUnderline,
|
|
237
|
+
isLink,
|
|
238
|
+
onFontFamily,
|
|
239
|
+
onFontSize,
|
|
240
|
+
onTextColor,
|
|
241
|
+
onBold,
|
|
242
|
+
onItalic,
|
|
243
|
+
onUnderline,
|
|
244
|
+
onLink,
|
|
245
|
+
],
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
return (
|
|
249
|
+
<RichTextFieldContext.Provider value={contextValue}>{children}</RichTextFieldContext.Provider>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../../int-eslint-config/schemas/component.schema.json",
|
|
3
|
+
"component": "rich-text-field",
|
|
4
|
+
"purpose": "Fixed-height rich-text editor with a formatting toolbar (typeface, size, bold, italic, underline, colour, attachment, alignment, clear formatting) above or below the text, built on web-chat-ui/rich-text-area.",
|
|
5
|
+
"useWhen": [
|
|
6
|
+
"Users write formatted long-form text such as an email reply or a note, and need visible formatting controls",
|
|
7
|
+
"Files are attached to the text through a toolbar button",
|
|
8
|
+
"The toolbar needs a custom set of controls built from the exported toolbar buttons and selects"
|
|
9
|
+
],
|
|
10
|
+
"avoidWhen": [
|
|
11
|
+
"Formatting without a visible toolbar, or a fully custom editor surface — use web-chat-ui/rich-text-area",
|
|
12
|
+
"A chat composer for questions to the assistant — use web-chat-ui/chat-prompt-box",
|
|
13
|
+
"Plain text with a label, helper and error text — use ui/text-area"
|
|
14
|
+
],
|
|
15
|
+
"uxPrinciples": [
|
|
16
|
+
"Show only the controls the content can keep: a toolbar control whose result is lost on save misleads the user.",
|
|
17
|
+
"Keep the toolbar next to the text it formats; place it at the bottom when the field sits under the content it replies to."
|
|
18
|
+
],
|
|
19
|
+
"accessibility": {
|
|
20
|
+
"required": [
|
|
21
|
+
"Label the field from the surrounding layout: it has no label or aria-label prop, and the placeholder is not an accessible name",
|
|
22
|
+
"Custom toolbarChildren must give every icon-only control an aria-label; the built-in buttons already do (\"Format Bold\", \"Text Color\", \"Add Attachment\", \"Reset Formatting\")"
|
|
23
|
+
],
|
|
24
|
+
"keyboard": [
|
|
25
|
+
"Tab moves through the toolbar controls and the editor in DOM order",
|
|
26
|
+
"In the text, Ctrl/Cmd+B, I and U toggle bold, italic and underline, and Ctrl/Cmd+Z undoes",
|
|
27
|
+
"The colour picker input is not in the tab order (tabIndex=-1); colour can only be changed with the pointer"
|
|
28
|
+
],
|
|
29
|
+
"aria": [
|
|
30
|
+
"Toolbar buttons are ui/icon-button with aria-label; bold, italic and underline reflect the selection through isActive",
|
|
31
|
+
"The editable element has role=textbox and aria-placeholder; it gets aria-readonly when isDisabled",
|
|
32
|
+
"The toolbar container has no role=toolbar, and the typeface, size and alignment selects are rendered without an accessible name (ui/select-field with an empty label)"
|
|
33
|
+
],
|
|
34
|
+
"focus": [
|
|
35
|
+
"Typeface and colour changes apply to the selection without moving focus back into the text",
|
|
36
|
+
"isDisabled makes the text non-editable and removes it from the tab order; the toolbar controls stay enabled"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"behaviour": {
|
|
40
|
+
"states": ["empty", "has value", "focused", "disabled"],
|
|
41
|
+
"rules": [
|
|
42
|
+
"Takes every RichTextArea prop: source sets the format of value and onChange (Markdown with inline HTML for styles, or HTML); value is controlled one-way",
|
|
43
|
+
"toolbarPlacement puts the toolbar inside the field above or below the text; the editor padding and placeholder offset follow it",
|
|
44
|
+
"The default toolbar shows typeface, size, bold, italic, underline, text colour, link, attachment, image, alignment and clear formatting; link and image are always disabled, and attachment is disabled unless enableAttachments is true",
|
|
45
|
+
"Toolbar state follows the selection: the selects and the bold, italic and underline buttons show the format at the caret",
|
|
46
|
+
"Typeface, size and colour are written as inline styles on the selected text; alignment applies to the selected block",
|
|
47
|
+
"The attachment button opens a hidden file picker limited to acceptedFiles; onFileAttach receives the picked files, and only the first file unless isMultipleAttachments is true",
|
|
48
|
+
"toolbarChildren replaces the default controls; it is a function receiving { hasAttachments } (the enableAttachments value) and returning the toolbar content",
|
|
49
|
+
"children is accepted for type compatibility but not rendered; pass toolbar content through toolbarChildren",
|
|
50
|
+
"The field has a fixed height from the rich-text-field-height token and the text scrolls inside it; override it with containerClassName"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"composition": {
|
|
54
|
+
"allowedParents": [],
|
|
55
|
+
"allowedChildren": [
|
|
56
|
+
"web-chat-ui/TypographySelect",
|
|
57
|
+
"web-chat-ui/SizeSelect",
|
|
58
|
+
"web-chat-ui/BoldButton",
|
|
59
|
+
"web-chat-ui/ItalicButton",
|
|
60
|
+
"web-chat-ui/UnderlineButton",
|
|
61
|
+
"web-chat-ui/TextColorButton",
|
|
62
|
+
"web-chat-ui/LinkButton",
|
|
63
|
+
"web-chat-ui/AttachmentButton",
|
|
64
|
+
"web-chat-ui/ImageButton",
|
|
65
|
+
"web-chat-ui/AlignmentSelect",
|
|
66
|
+
"web-chat-ui/CleanFormatButton",
|
|
67
|
+
"web-chat-ui/ToolbarButton",
|
|
68
|
+
"ui/divider"
|
|
69
|
+
],
|
|
70
|
+
"avoidCombinations": [
|
|
71
|
+
"Toolbar buttons outside a RichTextField's toolbarChildren — they read the field's formatting context and the editor and throw elsewhere",
|
|
72
|
+
"Enabling attachments without onFileAttach — the picker opens but the files go nowhere",
|
|
73
|
+
"Passing toolbar content as children — it is ignored; use toolbarChildren"
|
|
74
|
+
],
|
|
75
|
+
"contexts": ["reply composer", "form section", "dialog body"]
|
|
76
|
+
},
|
|
77
|
+
"content": {
|
|
78
|
+
"labelRules": [
|
|
79
|
+
"Placeholder: a short instruction in sentence case naming what to write, e.g. \"Write a reply\""
|
|
80
|
+
],
|
|
81
|
+
"helperTextRules": [],
|
|
82
|
+
"errorRules": []
|
|
83
|
+
},
|
|
84
|
+
"aiDecisionRules": [
|
|
85
|
+
{
|
|
86
|
+
"condition": "The field accepts attachments",
|
|
87
|
+
"decision": "Set enableAttachments, acceptedFiles and onFileAttach together, and isMultipleAttachments when several files are allowed",
|
|
88
|
+
"reason": "enableAttachments only enables the button; acceptedFiles filters the picker and onFileAttach receives the files"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"condition": "Only some formatting applies (e.g. no typefaces or colours)",
|
|
92
|
+
"decision": "Pass toolbarChildren with just the needed exported buttons and selects, separated by a vertical ui/divider",
|
|
93
|
+
"reason": "The default toolbar shows every control, including always-disabled link and image buttons"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"condition": "The formatted text must keep typefaces, sizes, colours or tables when stored",
|
|
97
|
+
"decision": "Use source=\"html\"",
|
|
98
|
+
"reason": "Markdown keeps styles only as inline HTML and has no tables; HTML keeps all of them"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"relatedComponents": [
|
|
102
|
+
"web-chat-ui/rich-text-area",
|
|
103
|
+
"web-chat-ui/chat-prompt-box",
|
|
104
|
+
"ui/text-area",
|
|
105
|
+
"ui/icon-button"
|
|
106
|
+
],
|
|
107
|
+
"tokenReferences": {
|
|
108
|
+
"source": "packages/design-system/src/tailwind.css",
|
|
109
|
+
"categories": [
|
|
110
|
+
"--spacing-rich-text-field-height",
|
|
111
|
+
"--spacing-rich-text-field-toolbar-height",
|
|
112
|
+
"--spacing-rich-text-field-editor-padding",
|
|
113
|
+
"--radius-rich-text-field-toolbar",
|
|
114
|
+
"--color-rich-text-field-background"
|
|
115
|
+
],
|
|
116
|
+
"rule": "Size and colour the field through the rich-text-field tokens (h-rich-text-field-height, bg-rich-text-field-background); do not hardcode heights or paddings, because the placeholder offset is computed from the same tokens."
|
|
117
|
+
}
|
|
118
|
+
}
|