@cometchat/chat-uikit-react 5.0.16 → 5.0.18

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.
@@ -61,13 +61,11 @@ export declare class CometChatUIKitUtility {
61
61
  */
62
62
  static checkMessageForExtensionsData: (message: CometChat.BaseMessage | null, extensionKey: string) => (object & MessageExtensionType) | undefined;
63
63
  /**
64
- * Sanitizes an HTML string by escaping tags not matching the whitelist.
65
- *
66
- * @param htmlString - The HTML string to sanitize.
67
- * @param whitelistRegExes - A list of regular expressions to match allowed tags.
68
- * @returns The sanitized HTML string.
64
+ * Process and sanitize text to escape dangerous HTML while preserving mention formatting
65
+ * @param text The text string that may contain HTML and mentions
66
+ * @returns Sanitized string with dangerous HTML escaped but mentions preserved
69
67
  */
70
- static sanitizeHtml(htmlString: string, whitelistRegExes: RegExp[]): string;
68
+ static sanitizeText(text: string): string;
71
69
  static convertBlobToWav: (audioBlob: {
72
70
  arrayBuffer: () => any;
73
71
  }) => Promise<{
@@ -74,6 +74,11 @@ export declare class UIKitSettings {
74
74
  * @type {ExtensionsDataSource}
75
75
  */
76
76
  readonly callingExtension?: CallingExtension;
77
+ /**
78
+ * Storage mode for persisting data.
79
+ * @type {CometChat.StorageMode}
80
+ */
81
+ readonly storageMode: CometChat.StorageMode;
77
82
  /**
78
83
  * Private constructor to initialize the settings using the provided builder.
79
84
  * @param {UIKitSettingsBuilder} builder - The builder instance containing the settings configuration.
@@ -135,6 +140,11 @@ export declare class UIKitSettings {
135
140
  * @returns {ExtensionsDataSource[]}
136
141
  */
137
142
  getCallsExtension(): ExtensionsDataSource;
143
+ /**
144
+ * Retrieves the storage mode.
145
+ * @returns {CometChat.StorageMode} The storage mode.
146
+ */
147
+ getStorageMode(): CometChat.StorageMode;
138
148
  }
139
149
  export declare class UIKitSettingsBuilder {
140
150
  /**
@@ -203,6 +213,11 @@ export declare class UIKitSettingsBuilder {
203
213
  * @type {string}
204
214
  */
205
215
  clientHost?: string;
216
+ /**
217
+ * Storage mode for persisting data.
218
+ * @type {CometChat.StorageMode}
219
+ */
220
+ storageMode?: CometChat.StorageMode;
206
221
  /**
207
222
  * Builds and returns an instance of UIKitSettings.
208
223
  * @returns {UIKitSettings} A new instance of UIKitSettings with the specified configuration.
@@ -279,4 +294,10 @@ export declare class UIKitSettingsBuilder {
279
294
  * @returns {UIKitSettingsBuilder} The builder instance.
280
295
  */
281
296
  setCallsExtension(callingExtension: CallingExtension): UIKitSettingsBuilder;
297
+ /**
298
+ * Sets the storage mode.
299
+ * @param {CometChat.StorageMode} storageMode - The storage mode.
300
+ * @returns {UIKitSettingsBuilder} The builder instance.
301
+ */
302
+ setStorageMode(storageMode: CometChat.StorageMode): UIKitSettingsBuilder;
282
303
  }
@@ -2,5 +2,5 @@ import { CometChatTextFormatter } from "../../../formatters/CometChatFormatters/
2
2
  export declare const useCometChatTextBubble: (props: {
3
3
  textFormatters: Array<CometChatTextFormatter>;
4
4
  }) => {
5
- pasteHtml: (textElement: HTMLElement, text: string) => void;
5
+ appendTextInHtml: (textElement: HTMLElement, text: string) => void;
6
6
  };
@@ -6,6 +6,11 @@ export declare class CometChatUIKitConstants {
6
6
  call: string;
7
7
  interactive: string;
8
8
  }>;
9
+ static mimeTypes: Readonly<{
10
+ audio: "audio/*, .aac, .aif, .aiff, .caf, .mp3, .mp4, .wav, .m4a, .wma, .flac, .alac, .oga, .ra, .ram, .mid, .midi, .mka, .opus, .ac3, .amr, .ape, .dts, .wv, .tta, .pcm, .snd, .au, .cda, .vox, .m4b, .m3u, .pls, .ogg";
11
+ video: "video/*, .mov, .mp4, .m4v, .avi, .mpg, .mpeg, .m2ts, .mts, .3gp, .3g2, .flv, .wmv, .vob, .ts, .webm, .f4v, .f4a, .f4b, .swf, .rm, .rmvb, .divx, .xvid, .mxf, .asf, .amv, .smv, .avchd, .qt";
12
+ image: "image/*, .heic, .heif, .jpg, .jpeg, .png, .gif, .bmp, .tiff, .tif, .psd, .svg, .ico, .raw, .dng, .eps, .webp, .jfif, .jp2, .jpf, .jpx, .jpm, .mj2, .hdr, .exr, .pbm, .pgm, .ppm, .pnm, .tga, .dds, .svgz, .djvu, .ai, .cdr";
13
+ }>;
9
14
  static MessageTypes: Readonly<{
10
15
  text: string;
11
16
  file: string;
@@ -16,7 +16,6 @@ export declare const currentAudioPlayer: {
16
16
  * Function to stop current media playback.
17
17
  */
18
18
  export declare function closeCurrentMediaPlayer(pauseAudio?: boolean): void;
19
- export declare function sanitizeHtml(htmlString: string, whitelistRegExes: RegExp[]): string;
20
19
  export declare function isMessageSentByMe(message: CometChat.BaseMessage, loggedInUser: CometChat.User): boolean;
21
20
  /**
22
21
  * Function to check if the current browser is safari.
@@ -51,8 +50,9 @@ export declare function fireClickEvent(): void;
51
50
  export declare const decodeHTML: (input: string) => string;
52
51
  export declare const sanitizeHtmlStringToFragment: (html: string, textFormatterArray?: CometChatTextFormatter[]) => DocumentFragment;
53
52
  /**
54
- * Sanitizes HTML content to only allow span tags while keeping everything else as plain text
55
- * Also removes any script or executable content
56
- */
57
- export declare const sanitizeToSpanOnly: (htmlString: string, regexPatterns: RegExp[][]) => string;
53
+ * @function shouldShowCustomMimeTypes
54
+ * @description Returns true if the device is running either iOS (iPhone, iPad, iPod) or macOS.
55
+ * @returns {boolean} True if the device is an Apple device (iOS or macOS), false otherwise.
56
+ */
57
+ export declare const shouldShowCustomMimeTypes: () => boolean;
58
58
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cometchat/chat-uikit-react",
3
- "version": "5.0.16",
3
+ "version": "5.0.18",
4
4
  "description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
5
5
  "author": "CometChat",
6
6
  "exports": {
@@ -8,7 +8,7 @@
8
8
  "./css-variables.css": "./dist/styles/css-variables.css"
9
9
  },
10
10
  "dependencies": {
11
- "@cometchat/chat-sdk-javascript": "^4.1.1",
11
+ "@cometchat/chat-sdk-javascript": "^4.1.3",
12
12
  "@rollup/plugin-json": "^6.1.0",
13
13
  "rxjs": "^7.8.1"
14
14
  },