<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ### Summary by CodeRabbit - New Feature: Updated WhatsApp logo with a new design and color scheme. - New Feature: Added a help button in the UI linking to documentation, enhancing user guidance. - New Feature: Introduced an alert message indicating that the WhatsApp integration is in beta testing. - New Feature: Implemented a button to open WhatsApp Web directly from the application, improving user convenience. - Refactor: Adjusted the retrieval of `contactPhoneNumber` in `receiveMessagePreview` function for better data structure compatibility. - Refactor: Optimized the initialization and management of the WhatsApp session in `startWhatsAppPreview`. - Refactor: Improved the `parseButtonsReply` function by refining condition checks. - Refactor: Enhanced the readability of serialized rich text in `convertRichTextToWhatsAppText` by introducing newline characters. - Bug Fix: Ensured preservation of `contact` information when resuming the WhatsApp flow in `resumeWhatsAppFlow`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
10 lines
298 B
TypeScript
10 lines
298 B
TypeScript
import { TElement } from '@udecode/plate-common'
|
|
import { serialize } from 'remark-slate'
|
|
|
|
export const convertRichTextToWhatsAppText = (richText: TElement[]): string =>
|
|
richText
|
|
.map((chunk) =>
|
|
serialize(chunk)?.replaceAll('**', '*').replaceAll('&#39;', "'")
|
|
)
|
|
.join('\n')
|