chatwoot/app/javascript/shared/helpers
Sivin Varghese 1beaa284c6
feat: inline images in website and email channels (#14516)
# Pull Request Template

## Description

This PR adds support for inline image uploads in the reply editor for
Email and Website (chat widget) channels.

Agents can now insert images inline between text and resize them
directly in the editor by dragging the bottom corner, similar to the
help center editor experience.

Image sizes are preserved through markdown using the `cw_image_width`
URL param and render correctly in both outgoing emails and chat widget
messages.

Agents can also paste copied images directly into Email or Website
replies using **Shift+Cmd+V** (Shift+Ctrl+V on Windows/Linux). The image
gets inserted inline at the cursor position and supports resizing just
like uploaded images. Regular **Cmd+V / Ctrl+V** behavior remains
unchanged and continues to add images as attachments, so both inline and
attachment flows are supported.


### Prosemirror repo PR:
https://github.com/chatwoot/prosemirror-schema/pull/48

Fixes
https://linear.app/chatwoot/issue/CW-7133/inline-images-in-live-chat-and-email

https://linear.app/chatwoot/issue/CW-7225/ghsa-8j9w-jppp-xcfc-html-attribute-injection-via-unvalidated-cw-image

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

### Screencast



https://github.com/user-attachments/assets/a928f852-ab15-413a-9d35-6ea69b718ecf

<img width="414" height="654" alt="image"
src="https://github.com/user-attachments/assets/205e0729-8f2d-4cc5-9c55-7696f032eca4"
/>



## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-06-03 15:05:17 +05:30
..
markdownIt chore: Use markdown-it instead of marked (#6123) 2023-03-03 13:26:54 +05:30
specs feat: UI changes for document auto sync [AI-153] (#14258) 2026-05-11 20:13:29 +05:30
vuex feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
AudioNotificationHelper.js feat: update tool-chain to latest (#7975) 2023-09-27 14:02:34 +05:30
BaseActionCableConnector.js perf: reduce presence update frequency and fix background tab throttling (#13726) 2026-03-09 18:23:44 +05:30
cache.js chore: Add cache to improve widget performance (#11163) 2025-03-24 16:04:49 -07:00
clipboard.js feat: Add the frontend support for MFA (#12372) 2025-09-18 21:16:06 +05:30
colorHelper.js feat: Update public portal colors with new design (#8230) 2023-11-23 08:16:52 +05:30
CustomErrors.js feat: Inline edit support for contact info (#13976) 2026-04-14 16:53:40 +04:00
CustomEventHelper.js feat: Add chatwoot:error sdk event (#3998) 2022-02-21 09:40:11 +05:30
DateHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
documentHelper.js feat: UI changes for document auto sync [AI-153] (#14258) 2026-05-11 20:13:29 +05:30
emoji.js chore: Check for empty strings in name formatter (#5434) 2022-09-14 07:15:04 -07:00
FileHelper.js chore: support PFX filetype in attachment uploads (#14456) 2026-05-22 11:09:27 +05:30
HTMLSanitizer.js fix: Render links with target attribute (#4685) 2022-05-16 11:29:05 +05:30
IntegrationHelper.js feat: Upgrade Dyte apis to v2 (#10706) 2025-02-19 14:47:48 -08:00
KeyboardHelpers.js fix: prevent Ctrl+Enter adding extra line break on send (Windows) (#14077) 2026-04-20 18:16:41 +05:30
localStorage.js feat: Implement reply to for reply editor (#8063) 2023-10-10 19:13:12 +05:30
MessageFormatter.js feat: inline images in website and email channels (#14516) 2026-06-03 15:05:17 +05:30
MessageTypeHelper.js feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
mitt.js chore: Replace eventBus with mitt.js [CW-3275] (#9539) 2024-05-31 15:50:36 +05:30
platform.js fix: prevent Ctrl+Enter adding extra line break on send (Windows) (#14077) 2026-04-20 18:16:41 +05:30
portalHelper.js feat: Sync Popular Articles locale with widget locale (#11754) 2025-06-24 19:52:44 +05:30
ReportsDataHelper.js feat: add Conversation traffic heatmap (#6508) 2023-03-07 09:01:58 +05:30
sanitizeData.js feat: multiple UX improvements to labels (#7358) 2023-06-25 18:49:49 +05:30
sessionStorage.js feat: Prevent saving preferences and status when impersonating (#11164) 2025-05-20 17:34:30 -07:00
timeHelper.js feat(voice): Attach call recordings + show call duration on the bubble (#14344) 2026-05-04 17:14:01 +04:00
Validators.js fix: regex validation not applied for custom text attributes in UI (#14110) 2026-05-05 12:55:53 +05:30