Skip to content

v7.4.0

Choose a tag to compare

@aanshisingh-cometchat aanshisingh-cometchat released this 01 Dec 17:26
· 1 commit to v7 since this release
3cf1506

New

  • Added full right-to-left (RTL) support. Layouts, menus and directional icons mirror when the page is right to left (<html dir="rtl">) or the kit is set to RTL, while text keeps its own direction.
  • Added the CometChatLayoutDirection setting ('auto', 'ltr', 'rtl'). Set it for the whole kit with UIKitSettingsBuilder.setLayoutDirection(...) or <CometChatProvider layoutDirection>, change it at runtime with CometChatUIKit.setLayoutDirection(...) after init(), or set it per component with the layoutDirection prop. The default, 'auto', follows the page's dir.
  • Added Arabic (ar) as a built-in language; regional variants such as ar-SA use it too. Added CometChatLocalize.getDirection(language?), which returns 'rtl' for any language written in a right-to-left script (Arabic, Hebrew, Persian, Urdu and others), so an app can set <html dir> from its language.
  • Added plural forms for group member counts, thread reply counts and last-seen times ("عضوان", "منذ دقيقتين"), with new translation keys (group_member_count_*, thread_reply_count_*, thread_view_reply_count_*, last_seen_minutes_ago_*, last_seen_hours_ago_*). English reads as before, and an app's own overrides of the old count words are kept until it overrides the new keys.
  • Added CometChatUIKit.getLayoutDirection(), UIKitSettings.getLayoutDirection(), CometChatMediaRecorder.Strip (with CometChatMediaRecorderStripProps) and a dir prop on CometChatActionBubble.
  • Added the .cometchat-icon--mirror class, which flips a directional icon in RTL layouts, and the CSS variables --cometchat-language-direction and --cometchat-layout-start.

Enhancements

  • Improved number display so that dates, times, counts, audio and video durations, the recording timer and file sizes use Arabic-Indic digits in Arabic, and file sizes use Arabic units ("١:٠٥", "٢٫٥٠ ميغابايت"). File sizes read the new keys file_size_b, file_size_kb, file_size_mb and file_size_gb. CometChatLocalize.getDateLocaleLanguage() now returns 'ar-u-nu-arab' for 'ar'; regional tags such as 'ar-EG' are returned as they are.
  • Improved mixed-direction text so that messages, mentions, names, file names and numbers keep their reading order, and the composer and text fields take the direction of the text typed in them. A preview with no letters ("123 + 456 = 579") and code blocks in AI replies read left to right.
  • Improved the kit's own labels so that they read in the UI language's direction, keeping English punctuation and numbers in place in an RTL layout ("2 Members", "You:"). The kit's root carries data-cometchat-language-direction for this; an app that gives the kit right-to-left strings under an English language code should set the kit's language to the right one.
  • Improved popovers, tooltips, context menus and the emoji, reaction and mention pickers so that they open on the correct side and stay on screen near both edges. A popover above or below its trigger also stays horizontally inside the trigger's nearest stacking-context ancestor, such as a card or panel, and the composer's link popover is placed against the composer.
  • Kept audio and video players, the voice recorder and the call screen left to right in RTL layouts. The voice recorder's controls, recording view and preview now sit inside a new .cometchat-media-recorder__strip element, so a child selector such as .cometchat-media-recorder--inline > .cometchat-media-recorder__waveform needs the strip in between.
  • Translated the typing indicator ("typing", "{name} and {count} others are typing"), "Just now" and the AM/PM in the message header's last-seen time, the incoming call's Accept and Decline buttons, and the audio player's "Loading...".
  • Improved screen reader labels so that a message bubble is announced with its translated type ("Bob, Image", "Bob, Poll") instead of the SDK type. Tests that select bubbles by accessible name may need updating.
  • Updated a regional language with no strings of its own to read its base language before the fallback language (ar-SA reads ar, pt-BR reads pt), and Traditional Chinese (zh-HK, zh-MO, zh-Hant) to read zh-tw.
  • Updated text bubbles to take their own direction (dir="auto"), so a message that starts with Arabic reads right to left even in a left-to-right app. Each composer line likewise takes the direction of its own text; what is sent is unchanged.
  • Updated names in the typing indicator and in file, poll, call and search items, and the message header's last-seen date, to sit in <bdi> elements so they keep their own order. Class selectors still match, but element selectors such as span.cometchat-typing-indicator__name and tests that compare textContent may need updating.
  • Updated localized text with names, such as getMessageSubtitle(), to wrap names in the invisible isolate characters U+2068 and U+2069 when a name or the text is right to left or the kit is set to RTL. Remove them before comparing strings: text.replace(/[��]/g, '').
  • Updated the kit's stylesheets to use CSS logical properties. To mirror custom overrides in RTL layouts, write logical properties too (margin-inline-start, inset-inline-end, text-align: start); physical ones still apply in left-to-right layouts as before.
  • Updated the full-screen image and video viewer to show its date in the kit's language and timezone, with a short month name and no seconds.
  • Updated list-item subtitles that are too long to end with "…".
  • Increased the kit's gzipped entry size to about 755 kB, mostly from the Arabic translation (about 11 kB), which ships with the other bundled languages, and from the direction handling.

Fixes

  • Fixed the missed and incoming call icons being swapped in call logs.
  • Fixed a context menu's submenu opening outside its container, where a neighbouring panel could cover it. Submenus with useParentContainer now also stay inside the container's left and right edges in left-to-right layouts.
  • Fixed custom date patterns with D, M, h or m showing NaN in locales that write Arabic-Indic digits, such as ar-EG and fa.