stream-chat-react 10.6.0 → 10.7.1
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/dist/browser.full-bundle.js +273 -334
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +5 -5
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Attachment/Attachment.d.ts +4 -1
- package/dist/components/Attachment/Attachment.d.ts.map +1 -1
- package/dist/components/Attachment/Attachment.js +20 -18
- package/dist/components/Attachment/AttachmentContainer.d.ts +1 -0
- package/dist/components/Attachment/AttachmentContainer.d.ts.map +1 -1
- package/dist/components/Attachment/AttachmentContainer.js +6 -0
- package/dist/components/Attachment/UnsupportedAttachment.d.ts +8 -0
- package/dist/components/Attachment/UnsupportedAttachment.d.ts.map +1 -0
- package/dist/components/Attachment/UnsupportedAttachment.js +12 -0
- package/dist/components/Attachment/index.d.ts +1 -0
- package/dist/components/Attachment/index.d.ts.map +1 -1
- package/dist/components/Attachment/index.js +1 -0
- package/dist/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/components/Gallery/Gallery.js +2 -1
- package/dist/components/MessageList/hooks/useMessageListElements.d.ts.map +1 -1
- package/dist/components/MessageList/hooks/useMessageListElements.js +1 -4
- package/dist/index.cjs.js +167 -275
- package/dist/index.cjs.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -5
|
@@ -6,9 +6,10 @@ import type { AudioProps } from './Audio';
|
|
|
6
6
|
import type { CardProps } from './Card';
|
|
7
7
|
import type { FileAttachmentProps } from './FileAttachment';
|
|
8
8
|
import type { GalleryProps, ImageProps } from '../Gallery';
|
|
9
|
+
import type { UnsupportedAttachmentProps } from './UnsupportedAttachment';
|
|
9
10
|
import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';
|
|
10
11
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
11
|
-
export declare const ATTACHMENT_GROUPS_ORDER: readonly ["card", "gallery", "image", "media", "audio", "file"];
|
|
12
|
+
export declare const ATTACHMENT_GROUPS_ORDER: readonly ["card", "gallery", "image", "media", "audio", "file", "unsupported"];
|
|
12
13
|
export declare type AttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
13
14
|
/** The message attachments to render, see [attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript) **/
|
|
14
15
|
attachments: StreamAttachment<StreamChatGenerics>[];
|
|
@@ -28,6 +29,8 @@ export declare type AttachmentProps<StreamChatGenerics extends DefaultStreamChat
|
|
|
28
29
|
Image?: React.ComponentType<ImageProps>;
|
|
29
30
|
/** Custom UI component for displaying a media type attachment, defaults to `ReactPlayer` from 'react-player' */
|
|
30
31
|
Media?: React.ComponentType<ReactPlayerProps>;
|
|
32
|
+
/** Custom UI component for displaying unsupported attachment types, defaults to NullComponent */
|
|
33
|
+
UnsupportedAttachment?: React.ComponentType<UnsupportedAttachmentProps>;
|
|
31
34
|
};
|
|
32
35
|
/**
|
|
33
36
|
* A component used for rendering message attachments. By default, the component supports: AttachmentActions, Audio, Card, File, Gallery, Image, and Video
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/Attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAqBlE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAUnE,eAAO,MAAM,uBAAuB,gFAQ1B,CAAC;AAEX,oBAAY,eAAe,CACzB,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,oJAAoJ;IACpJ,WAAW,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACpD,wJAAwJ;IACxJ,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,oOAAoO;IACpO,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACpF,kNAAkN;IAClN,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5D,8MAA8M;IAC9M,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACtC,wNAAwN;IACxN,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACpE,8NAA8N;IAC9N,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAChE,+MAA+M;IAC/M,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACxC,gHAAgH;IAChH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC9C,iGAAiG;IACjG,qBAAqB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;CACzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,+IAiBtB,CAAC"}
|
|
@@ -30,14 +30,14 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
30
30
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
31
|
};
|
|
32
32
|
import React, { useMemo } from 'react';
|
|
33
|
-
import { sanitizeUrl } from '@braintree/sanitize-url';
|
|
34
33
|
import { isAudioAttachment, isFileAttachment, isMediaAttachment, isScrapedContent, isUploadedImage, } from './utils';
|
|
35
|
-
import { AudioContainer, CardContainer, FileContainer, GalleryContainer, ImageContainer, MediaContainer, } from './AttachmentContainer';
|
|
34
|
+
import { AudioContainer, CardContainer, FileContainer, GalleryContainer, ImageContainer, MediaContainer, UnsupportedAttachmentContainer, } from './AttachmentContainer';
|
|
36
35
|
var CONTAINER_MAP = {
|
|
37
36
|
audio: AudioContainer,
|
|
38
37
|
card: CardContainer,
|
|
39
38
|
file: FileContainer,
|
|
40
39
|
media: MediaContainer,
|
|
40
|
+
unsupported: UnsupportedAttachmentContainer,
|
|
41
41
|
};
|
|
42
42
|
export var ATTACHMENT_GROUPS_ORDER = [
|
|
43
43
|
'card',
|
|
@@ -46,6 +46,7 @@ export var ATTACHMENT_GROUPS_ORDER = [
|
|
|
46
46
|
'media',
|
|
47
47
|
'audio',
|
|
48
48
|
'file',
|
|
49
|
+
'unsupported',
|
|
49
50
|
];
|
|
50
51
|
/**
|
|
51
52
|
* A component used for rendering message attachments. By default, the component supports: AttachmentActions, Audio, Card, File, Gallery, Image, and Video
|
|
@@ -57,26 +58,27 @@ export var Attachment = function (props) {
|
|
|
57
58
|
};
|
|
58
59
|
var renderGroupedAttachments = function (_a) {
|
|
59
60
|
var attachments = _a.attachments, rest = __rest(_a, ["attachments"]);
|
|
60
|
-
var uploadedImages =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return acc;
|
|
61
|
+
var uploadedImages = attachments.filter(function (attachment) {
|
|
62
|
+
return isUploadedImage(attachment);
|
|
63
|
+
});
|
|
64
|
+
var containers = attachments
|
|
65
|
+
.filter(function (attachment) { return !isUploadedImage(attachment); })
|
|
66
|
+
.reduce(function (typeMap, attachment) {
|
|
67
|
+
var attachmentType = getAttachmentType(attachment);
|
|
68
|
+
var Container = CONTAINER_MAP[attachmentType];
|
|
69
|
+
typeMap[attachmentType].push(React.createElement(Container, __assign({ key: "".concat(attachmentType, "-").concat(typeMap[attachmentType].length) }, rest, { attachment: attachment })));
|
|
70
|
+
return typeMap;
|
|
73
71
|
}, {
|
|
74
72
|
audio: [],
|
|
75
73
|
card: [],
|
|
76
74
|
file: [],
|
|
77
|
-
gallery: [],
|
|
78
|
-
image: [],
|
|
79
75
|
media: [],
|
|
76
|
+
unsupported: [],
|
|
77
|
+
// not used in reduce
|
|
78
|
+
// eslint-disable-next-line sort-keys
|
|
79
|
+
image: [],
|
|
80
|
+
// eslint-disable-next-line sort-keys
|
|
81
|
+
gallery: [],
|
|
80
82
|
});
|
|
81
83
|
if (uploadedImages.length > 1) {
|
|
82
84
|
containers['gallery'] = [
|
|
@@ -106,5 +108,5 @@ var getAttachmentType = function (attachment) {
|
|
|
106
108
|
else if (isFileAttachment(attachment)) {
|
|
107
109
|
return 'file';
|
|
108
110
|
}
|
|
109
|
-
return
|
|
111
|
+
return 'unsupported';
|
|
110
112
|
};
|
|
@@ -9,4 +9,5 @@ export declare const CardContainer: <StreamChatGenerics extends DefaultStreamCha
|
|
|
9
9
|
export declare const FileContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, File, }: RenderAttachmentProps<StreamChatGenerics>) => JSX.Element | null;
|
|
10
10
|
export declare const AudioContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, Audio, }: RenderAttachmentProps<StreamChatGenerics>) => JSX.Element;
|
|
11
11
|
export declare const MediaContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(props: RenderAttachmentProps<StreamChatGenerics>) => JSX.Element;
|
|
12
|
+
export declare const UnsupportedAttachmentContainer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, UnsupportedAttachment, }: RenderAttachmentProps<StreamChatGenerics>) => JSX.Element;
|
|
12
13
|
//# sourceMappingURL=AttachmentContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/AttachmentContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/AttachmentContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAYpF,OAAO,EACL,wBAAwB,EAGxB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EACV,yBAAyB,EAG1B,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,yBAAyB,oNA+BrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,wMAkBtC,CAAC;AAqBF,eAAO,MAAM,gBAAgB,qKAwC5B,CAAC;AAEF,eAAO,MAAM,cAAc,qJA0C1B,CAAC;AAEF,eAAO,MAAM,aAAa,qJAwBzB,CAAC;AAEF,eAAO,MAAM,aAAa,4KAazB,CAAC;AACF,eAAO,MAAM,cAAc,sKAW1B,CAAC;AAEF,eAAO,MAAM,cAAc,qJAuD1B,CAAC;AAEF,eAAO,MAAM,8BAA8B,sLAS1C,CAAC"}
|
|
@@ -18,6 +18,7 @@ import { Audio as DefaultAudio } from './Audio';
|
|
|
18
18
|
import { Gallery as DefaultGallery, ImageComponent as DefaultImage } from '../Gallery';
|
|
19
19
|
import { Card as DefaultCard } from './Card';
|
|
20
20
|
import { FileAttachment as DefaultFile } from './FileAttachment';
|
|
21
|
+
import { NullComponent as DefaultUnsupportedAttachment } from './UnsupportedAttachment';
|
|
21
22
|
import { isGalleryAttachmentType, isSvgAttachment, } from './utils';
|
|
22
23
|
import { useChannelStateContext } from '../../context/ChannelStateContext';
|
|
23
24
|
export var AttachmentWithinContainer = function (_a) {
|
|
@@ -157,3 +158,8 @@ export var MediaContainer = function (props) {
|
|
|
157
158
|
content,
|
|
158
159
|
React.createElement(AttachmentActionsContainer, __assign({}, props))))) : (React.createElement(AttachmentWithinContainer, { attachment: attachment, componentType: componentType }, content));
|
|
159
160
|
};
|
|
161
|
+
export var UnsupportedAttachmentContainer = function (_a) {
|
|
162
|
+
var attachment = _a.attachment, _b = _a.UnsupportedAttachment, UnsupportedAttachment = _b === void 0 ? DefaultUnsupportedAttachment : _b;
|
|
163
|
+
return (React.createElement(React.Fragment, null,
|
|
164
|
+
React.createElement(UnsupportedAttachment, { attachment: attachment })));
|
|
165
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Attachment } from 'stream-chat';
|
|
2
|
+
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
3
|
+
export declare type UnsupportedAttachmentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
4
|
+
attachment: Attachment<StreamChatGenerics>;
|
|
5
|
+
};
|
|
6
|
+
export declare const UnsupportedAttachment: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ attachment, }: UnsupportedAttachmentProps<StreamChatGenerics>) => JSX.Element;
|
|
7
|
+
export declare const NullComponent: () => null;
|
|
8
|
+
//# sourceMappingURL=UnsupportedAttachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedAttachment.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/UnsupportedAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,oBAAY,0BAA0B,CACpC,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,oKAWjC,CAAC;AAEF,eAAO,MAAM,aAAa,YAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var UnsupportedAttachment = function (_a) {
|
|
3
|
+
var _b;
|
|
4
|
+
var attachment = _a.attachment;
|
|
5
|
+
return (React.createElement("div", null,
|
|
6
|
+
React.createElement("div", null,
|
|
7
|
+
"Unsupported attachment type ",
|
|
8
|
+
React.createElement("strong", null, (_b = attachment.type) !== null && _b !== void 0 ? _b : 'unknown')),
|
|
9
|
+
React.createElement("code", null, JSON.stringify(attachment, null, 4)),
|
|
10
|
+
";"));
|
|
11
|
+
};
|
|
12
|
+
export var NullComponent = function () { return null; };
|
|
@@ -3,6 +3,7 @@ export * from './AttachmentActions';
|
|
|
3
3
|
export * from './AttachmentContainer';
|
|
4
4
|
export * from './Audio';
|
|
5
5
|
export * from './Card';
|
|
6
|
+
export * from './UnsupportedAttachment';
|
|
6
7
|
export * from './FileAttachment';
|
|
7
8
|
export * from './utils';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Attachment/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gallery.d.ts","sourceRoot":"","sources":["../../../src/components/Gallery/Gallery.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,gBAAgB,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Gallery.d.ts","sourceRoot":"","sources":["../../../src/components/Gallery/Gallery.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,gBAAgB,EAAY,MAAM,OAAO,CAAC;AAUzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,oBAAY,YAAY,CACtB,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,MAAM,EAAE,CAAC,CACL;QACE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAChC,GACD,UAAU,CAAC,kBAAkB,CAAC,CACjC,GAAG;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC,EAAE,CAAC;IACtD,SAAS,CAAC,EAAE,gBAAgB,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACtD,CAAC;AAkFF;;GAEG;AACH,eAAO,MAAM,OAAO,4IAA4D,CAAC"}
|
|
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React, { useState } from 'react';
|
|
13
|
+
import { sanitizeUrl } from '@braintree/sanitize-url';
|
|
13
14
|
import clsx from 'clsx';
|
|
14
15
|
import { Modal } from '../Modal';
|
|
15
16
|
import { ModalGallery as DefaultModalGallery } from './ModalGallery';
|
|
@@ -39,7 +40,7 @@ var UnMemoizedGallery = function (props) {
|
|
|
39
40
|
React.createElement("p", null, t('{{ imageCount }} more', {
|
|
40
41
|
imageCount: images.length - countImagesDisplayedInPreview,
|
|
41
42
|
})))) : (React.createElement("button", { className: 'str-chat__gallery-image', "data-testid": 'gallery-image', key: "gallery-image-".concat(i), onClick: function () { return toggleModal(i); } },
|
|
42
|
-
React.createElement("img", __assign({ alt: 'User uploaded content', src: image.previewUrl || image.image_url || image.thumb_url, style: image.style }, ((innerRefs === null || innerRefs === void 0 ? void 0 : innerRefs.current) && { ref: function (r) { return (innerRefs.current[i] = r); } })))));
|
|
43
|
+
React.createElement("img", __assign({ alt: 'User uploaded content', src: sanitizeUrl(image.previewUrl || image.image_url || image.thumb_url), style: image.style }, ((innerRefs === null || innerRefs === void 0 ? void 0 : innerRefs.current) && { ref: function (r) { return (innerRefs.current[i] = r); } })))));
|
|
43
44
|
});
|
|
44
45
|
var className = clsx('str-chat__gallery', {
|
|
45
46
|
'str-chat__gallery--square': images.length > lastImageIndexInPreview,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessageListElements.d.ts","sourceRoot":"","sources":["../../../../src/components/MessageList/hooks/useMessageListElements.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAmB,UAAU,EAAE,MAAM,UAAU,CAAC;AAWvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,aAAK,kBAAkB,GACnB,SAAS,GACT,aAAa,GACb,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,GACT,QAAQ,GACR,YAAY,CAAC;AAEjB,aAAK,2BAA2B,CAC9B,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACtD,oBAAoB,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACjF,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAA;KAAE,CAAC,CAAC;CACpF,CAAC;AAEF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"useMessageListElements.d.ts","sourceRoot":"","sources":["../../../../src/components/MessageList/hooks/useMessageListElements.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAmB,UAAU,EAAE,MAAM,UAAU,CAAC;AAWvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,aAAK,kBAAkB,GACnB,SAAS,GACT,aAAa,GACb,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,GACT,QAAQ,GACR,YAAY,CAAC;AAEjB,aAAK,2BAA2B,CAC9B,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACtD,oBAAoB,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACjF,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAA;KAAE,CAAC,CAAC;CACpF,CAAC;AAEF,eAAO,MAAM,sBAAsB,iKAkGlC,CAAC"}
|
|
@@ -34,7 +34,6 @@ export var useMessageListElements = function (props) {
|
|
|
34
34
|
var lastReceivedId = useMemo(function () { return getLastReceived(enrichedMessages); }, [enrichedMessages]);
|
|
35
35
|
var elements = useMemo(function () {
|
|
36
36
|
return enrichedMessages.map(function (message) {
|
|
37
|
-
var _a;
|
|
38
37
|
if (message.customType === CUSTOM_MESSAGE_TYPE.date &&
|
|
39
38
|
message.date &&
|
|
40
39
|
isDate(message.date)) {
|
|
@@ -46,9 +45,7 @@ export var useMessageListElements = function (props) {
|
|
|
46
45
|
React.createElement(HeaderComponent, null)));
|
|
47
46
|
}
|
|
48
47
|
if (message.type === 'system') {
|
|
49
|
-
return (React.createElement("li", { key:
|
|
50
|
-
message.created_at ||
|
|
51
|
-
'' },
|
|
48
|
+
return (React.createElement("li", { key: message.id || message.created_at },
|
|
52
49
|
React.createElement(MessageSystem, { message: message })));
|
|
53
50
|
}
|
|
54
51
|
var groupStyles = messageGroupStyles[message.id] || '';
|