@ohos-ports/stream-chat-angular 0.0.0-stage → 7.2.0-beta.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/README.md +139 -2
- package/assets/i18n/en.d.ts +157 -0
- package/assets/version.d.ts +1 -0
- package/esm2022/assets/i18n/en.mjs +158 -0
- package/esm2022/assets/version.mjs +2 -0
- package/esm2022/lib/attachment-configuration.service.mjs +182 -0
- package/esm2022/lib/attachment-list/attachment-list.component.mjs +232 -0
- package/esm2022/lib/attachment-preview-list/attachment-preview-list.component.mjs +55 -0
- package/esm2022/lib/attachment.service.mjs +481 -0
- package/esm2022/lib/avatar/avatar.component.mjs +160 -0
- package/esm2022/lib/avatar-placeholder/avatar-placeholder.component.mjs +66 -0
- package/esm2022/lib/channel/channel.component.mjs +45 -0
- package/esm2022/lib/channel-header/channel-header.component.mjs +72 -0
- package/esm2022/lib/channel-list/channel-list.component.mjs +47 -0
- package/esm2022/lib/channel-preview/channel-preview.component.mjs +158 -0
- package/esm2022/lib/channel-query.mjs +77 -0
- package/esm2022/lib/channel.service.mjs +1576 -0
- package/esm2022/lib/chat-client.service.mjs +233 -0
- package/esm2022/lib/custom-templates.service.mjs +258 -0
- package/esm2022/lib/date-parser.service.mjs +51 -0
- package/esm2022/lib/file-utils.mjs +35 -0
- package/esm2022/lib/format-duration.mjs +16 -0
- package/esm2022/lib/get-channel-display-text.mjs +14 -0
- package/esm2022/lib/get-message-translation.mjs +12 -0
- package/esm2022/lib/icon/icon-placeholder/icon-placeholder.component.mjs +28 -0
- package/esm2022/lib/icon/icon.component.mjs +17 -0
- package/esm2022/lib/icon/icon.module.mjs +37 -0
- package/esm2022/lib/icon/loading-indicator/loading-indicator.component.mjs +15 -0
- package/esm2022/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.mjs +20 -0
- package/esm2022/lib/injection-tokens.mjs +3 -0
- package/esm2022/lib/is-image-attachment.mjs +6 -0
- package/esm2022/lib/is-on-separate-date.mjs +11 -0
- package/esm2022/lib/is-safari.mjs +2 -0
- package/esm2022/lib/list-users.mjs +12 -0
- package/esm2022/lib/message/message.component.mjs +501 -0
- package/esm2022/lib/message-actions-box/message-actions-box.component.mjs +123 -0
- package/esm2022/lib/message-actions.service.mjs +191 -0
- package/esm2022/lib/message-blocked/message-blocked.component.mjs +25 -0
- package/esm2022/lib/message-bounce-prompt/message-bounce-prompt.component.mjs +71 -0
- package/esm2022/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.mjs +333 -0
- package/esm2022/lib/message-input/emoji-input.service.mjs +23 -0
- package/esm2022/lib/message-input/message-input-config.service.mjs +50 -0
- package/esm2022/lib/message-input/message-input.component.mjs +626 -0
- package/esm2022/lib/message-input/textarea/textarea.component.mjs +113 -0
- package/esm2022/lib/message-input/textarea.directive.mjs +93 -0
- package/esm2022/lib/message-input/textarea.interface.mjs +2 -0
- package/esm2022/lib/message-input/voice-recorder.service.mjs +27 -0
- package/esm2022/lib/message-list/group-styles.mjs +52 -0
- package/esm2022/lib/message-list/message-list.component.mjs +717 -0
- package/esm2022/lib/message-preview.mjs +22 -0
- package/esm2022/lib/message-reactions/message-reactions.component.mjs +168 -0
- package/esm2022/lib/message-reactions-selector/message-reactions-selector.component.mjs +61 -0
- package/esm2022/lib/message-reactions.service.mjs +70 -0
- package/esm2022/lib/message-text/message-text.component.mjs +141 -0
- package/esm2022/lib/message.service.mjs +43 -0
- package/esm2022/lib/modal/modal.component.mjs +69 -0
- package/esm2022/lib/modal/stream-modal.module.mjs +19 -0
- package/esm2022/lib/notification/notification.component.mjs +20 -0
- package/esm2022/lib/notification-list/notification-list.component.mjs +36 -0
- package/esm2022/lib/notification-list/stream-notification.module.mjs +20 -0
- package/esm2022/lib/notification.service.mjs +79 -0
- package/esm2022/lib/paginated-list/paginated-list.component.mjs +94 -0
- package/esm2022/lib/paginated-list/stream-paginated-list.module.mjs +20 -0
- package/esm2022/lib/parse-date.mjs +27 -0
- package/esm2022/lib/polls/base-poll.component.mjs +87 -0
- package/esm2022/lib/polls/poll/poll.component.mjs +34 -0
- package/esm2022/lib/polls/poll-actions/add-option/add-option.component.mjs +67 -0
- package/esm2022/lib/polls/poll-actions/poll-actions.component.mjs +137 -0
- package/esm2022/lib/polls/poll-actions/poll-answers-list/poll-answers-list.component.mjs +82 -0
- package/esm2022/lib/polls/poll-actions/poll-results/poll-results-list/poll-results-list.component.mjs +63 -0
- package/esm2022/lib/polls/poll-actions/poll-results/poll-vote/poll-vote.component.mjs +33 -0
- package/esm2022/lib/polls/poll-actions/poll-results/poll-vote-results-list/poll-vote-results-list.component.mjs +82 -0
- package/esm2022/lib/polls/poll-actions/upsert-answer/upsert-answer.component.mjs +60 -0
- package/esm2022/lib/polls/poll-composer/poll-composer.component.mjs +134 -0
- package/esm2022/lib/polls/poll-composer/validators.mjs +18 -0
- package/esm2022/lib/polls/poll-header/poll-header.component.mjs +80 -0
- package/esm2022/lib/polls/poll-option-selector/poll-option-selector.component.mjs +137 -0
- package/esm2022/lib/polls/poll-options-list/poll-options-list.component.mjs +39 -0
- package/esm2022/lib/polls/poll-preview/poll-preview.component.mjs +31 -0
- package/esm2022/lib/polls/stream-polls.module.mjs +107 -0
- package/esm2022/lib/polls/unique.validator.mjs +13 -0
- package/esm2022/lib/read-by.mjs +13 -0
- package/esm2022/lib/stream-autocomplete-textarea.module.mjs +33 -0
- package/esm2022/lib/stream-avatar.module.mjs +20 -0
- package/esm2022/lib/stream-chat.module.mjs +163 -0
- package/esm2022/lib/stream-i18n.service.mjs +34 -0
- package/esm2022/lib/stream-textarea.module.mjs +31 -0
- package/esm2022/lib/theme.service.mjs +23 -0
- package/esm2022/lib/thread/thread.component.mjs +51 -0
- package/esm2022/lib/transliteration.service.mjs +24 -0
- package/esm2022/lib/types-custom.mjs +2 -0
- package/esm2022/lib/types.mjs +2 -0
- package/esm2022/lib/user-list/user-list.component.mjs +47 -0
- package/esm2022/lib/virtualized-list.service.mjs +271 -0
- package/esm2022/lib/virtualized-message-list.service.mjs +73 -0
- package/esm2022/lib/voice-recorder/amplitude-recorder.service.mjs +119 -0
- package/esm2022/lib/voice-recorder/audio-recorder.service.mjs +79 -0
- package/esm2022/lib/voice-recorder/media-recorder.mjs +190 -0
- package/esm2022/lib/voice-recorder/mp3-transcoder.mjs +61 -0
- package/esm2022/lib/voice-recorder/transcoder.service.mjs +121 -0
- package/esm2022/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.mjs +35 -0
- package/esm2022/lib/voice-recorder/voice-recorder.component.mjs +80 -0
- package/esm2022/lib/voice-recorder/voice-recorder.module.mjs +34 -0
- package/esm2022/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.mjs +112 -0
- package/esm2022/lib/voice-recording/voice-recording.component.mjs +91 -0
- package/esm2022/lib/voice-recording/voice-recording.module.mjs +21 -0
- package/esm2022/lib/wave-form-sampler.mjs +72 -0
- package/esm2022/public-api.mjs +104 -0
- package/esm2022/stream-chat-angular.mjs +5 -0
- package/esm2022/stream-chat.mjs +2 -0
- package/fesm2022/stream-chat-angular.mjs +10363 -0
- package/fesm2022/stream-chat-angular.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/attachment-configuration.service.d.ts +58 -0
- package/lib/attachment-list/attachment-list.component.d.ts +76 -0
- package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +37 -0
- package/lib/attachment.service.d.ts +104 -0
- package/lib/avatar/avatar.component.d.ts +64 -0
- package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +48 -0
- package/lib/channel/channel.component.d.ts +22 -0
- package/lib/channel-header/channel-header.component.d.ts +36 -0
- package/lib/channel-list/channel-list.component.d.ts +30 -0
- package/lib/channel-preview/channel-preview.component.d.ts +46 -0
- package/lib/channel-query.d.ts +26 -0
- package/lib/channel.service.d.ts +482 -0
- package/lib/chat-client.service.d.ts +91 -0
- package/lib/custom-templates.service.d.ts +258 -0
- package/lib/date-parser.service.d.ts +39 -0
- package/lib/file-utils.d.ts +9 -0
- package/lib/format-duration.d.ts +1 -0
- package/lib/get-channel-display-text.d.ts +2 -0
- package/lib/get-message-translation.d.ts +3 -0
- package/lib/icon/icon-placeholder/icon-placeholder.component.d.ts +20 -0
- package/lib/icon/icon.component.d.ts +14 -0
- package/lib/icon/icon.module.d.ts +11 -0
- package/lib/icon/loading-indicator/loading-indicator.component.d.ts +9 -0
- package/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.d.ts +11 -0
- package/lib/injection-tokens.d.ts +3 -0
- package/lib/is-image-attachment.d.ts +2 -0
- package/lib/is-on-separate-date.d.ts +1 -0
- package/lib/is-safari.d.ts +1 -0
- package/lib/list-users.d.ts +2 -0
- package/lib/message/message.component.d.ts +126 -0
- package/lib/message-actions-box/message-actions-box.component.d.ts +49 -0
- package/lib/message-actions.service.d.ts +49 -0
- package/lib/message-blocked/message-blocked.component.d.ts +17 -0
- package/lib/message-bounce-prompt/message-bounce-prompt.component.d.ts +28 -0
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +98 -0
- package/lib/message-input/emoji-input.service.d.ts +14 -0
- package/lib/message-input/message-input-config.service.d.ts +54 -0
- package/lib/message-input/message-input.component.d.ts +189 -0
- package/lib/message-input/textarea/textarea.component.d.ts +55 -0
- package/lib/message-input/textarea.directive.d.ts +24 -0
- package/lib/message-input/textarea.interface.d.ts +14 -0
- package/lib/message-input/voice-recorder.service.d.ts +19 -0
- package/lib/message-list/group-styles.d.ts +3 -0
- package/lib/message-list/message-list.component.d.ts +146 -0
- package/lib/message-preview.d.ts +2 -0
- package/lib/message-reactions/message-reactions.component.d.ts +69 -0
- package/lib/message-reactions-selector/message-reactions-selector.component.d.ts +35 -0
- package/lib/message-reactions.service.d.ts +50 -0
- package/lib/message-text/message-text.component.d.ts +45 -0
- package/lib/message.service.d.ts +38 -0
- package/lib/modal/modal.component.d.ts +29 -0
- package/lib/modal/stream-modal.module.d.ts +9 -0
- package/lib/notification/notification.component.d.ts +19 -0
- package/lib/notification-list/notification-list.component.d.ts +23 -0
- package/lib/notification-list/stream-notification.module.d.ts +10 -0
- package/lib/notification.service.d.ts +38 -0
- package/lib/paginated-list/paginated-list.component.d.ts +45 -0
- package/lib/paginated-list/stream-paginated-list.module.d.ts +10 -0
- package/lib/parse-date.d.ts +1 -0
- package/lib/polls/base-poll.component.d.ts +43 -0
- package/lib/polls/poll/poll.component.d.ts +12 -0
- package/lib/polls/poll-actions/add-option/add-option.component.d.ts +22 -0
- package/lib/polls/poll-actions/poll-actions.component.d.ts +50 -0
- package/lib/polls/poll-actions/poll-answers-list/poll-answers-list.component.d.ts +25 -0
- package/lib/polls/poll-actions/poll-results/poll-results-list/poll-results-list.component.d.ts +22 -0
- package/lib/polls/poll-actions/poll-results/poll-vote/poll-vote.component.d.ts +20 -0
- package/lib/polls/poll-actions/poll-results/poll-vote-results-list/poll-vote-results-list.component.d.ts +24 -0
- package/lib/polls/poll-actions/upsert-answer/upsert-answer.component.d.ts +27 -0
- package/lib/polls/poll-composer/poll-composer.component.d.ts +43 -0
- package/lib/polls/poll-composer/validators.d.ts +3 -0
- package/lib/polls/poll-header/poll-header.component.d.ts +19 -0
- package/lib/polls/poll-option-selector/poll-option-selector.component.d.ts +27 -0
- package/lib/polls/poll-options-list/poll-options-list.component.d.ts +17 -0
- package/lib/polls/poll-preview/poll-preview.component.d.ts +13 -0
- package/lib/polls/stream-polls.module.d.ts +26 -0
- package/lib/polls/unique.validator.d.ts +2 -0
- package/lib/read-by.d.ts +2 -0
- package/lib/stream-autocomplete-textarea.module.d.ts +11 -0
- package/lib/stream-avatar.module.d.ts +10 -0
- package/lib/stream-chat.module.d.ts +35 -0
- package/lib/stream-i18n.service.d.ts +19 -0
- package/lib/stream-textarea.module.d.ts +9 -0
- package/lib/theme.service.d.ts +14 -0
- package/lib/thread/thread.component.d.ts +26 -0
- package/lib/transliteration.service.d.ts +15 -0
- package/lib/types-custom.d.ts +16 -0
- package/lib/types.d.ts +365 -0
- package/lib/user-list/user-list.component.d.ts +29 -0
- package/lib/virtualized-list.service.d.ts +58 -0
- package/lib/virtualized-message-list.service.d.ts +15 -0
- package/lib/voice-recorder/amplitude-recorder.service.d.ts +71 -0
- package/lib/voice-recorder/audio-recorder.service.d.ts +46 -0
- package/lib/voice-recorder/media-recorder.d.ts +46 -0
- package/lib/voice-recorder/mp3-transcoder.d.ts +1 -0
- package/lib/voice-recorder/transcoder.service.d.ts +40 -0
- package/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.d.ts +21 -0
- package/lib/voice-recorder/voice-recorder.component.d.ts +30 -0
- package/lib/voice-recorder/voice-recorder.module.d.ts +12 -0
- package/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.d.ts +36 -0
- package/lib/voice-recording/voice-recording.component.d.ts +29 -0
- package/lib/voice-recording/voice-recording.module.d.ts +11 -0
- package/lib/wave-form-sampler.d.ts +1 -0
- package/package.json +62 -4
- package/public-api.d.ts +99 -0
- package/src/assets/assets/EmojiOneColor.woff2 +0 -0
- package/src/assets/assets/NotoColorEmoji-flags.woff2 +0 -0
- package/src/assets/assets/icons/stream-chat-icons.eot +0 -0
- package/src/assets/assets/icons/stream-chat-icons.svg +50 -0
- package/src/assets/assets/icons/stream-chat-icons.ttf +0 -0
- package/src/assets/assets/icons/stream-chat-icons.woff +0 -0
- package/src/assets/assets/icons/stream-chat-icons.woff2 +0 -0
- package/src/assets/i18n/en.ts +184 -0
- package/src/assets/styles/css/emoji-mart.css +1 -0
- package/src/assets/styles/css/emoji-replacement.css +1 -0
- package/src/assets/styles/css/index.css +1 -0
- package/src/assets/styles/css/index.layout.css +1 -0
- package/src/assets/styles/scss/AIStateIndicator/AIStateIndicator-layout.scss +3 -0
- package/src/assets/styles/scss/AIStateIndicator/AIStateIndicator-theme.scss +7 -0
- package/src/assets/styles/scss/AttachmentList/AttachmentList-layout.scss +701 -0
- package/src/assets/styles/scss/AttachmentList/AttachmentList-theme.scss +605 -0
- package/src/assets/styles/scss/AttachmentPreviewList/AttachmentPreviewList-layout.scss +141 -0
- package/src/assets/styles/scss/AttachmentPreviewList/AttachmentPreviewList-theme.scss +190 -0
- package/src/assets/styles/scss/AudioRecorder/AudioRecorder-layout.scss +139 -0
- package/src/assets/styles/scss/AudioRecorder/AudioRecorder-theme.scss +61 -0
- package/src/assets/styles/scss/Autocomplete/Autocomplete-layout.scss +94 -0
- package/src/assets/styles/scss/Autocomplete/Autocomplete-theme.scss +220 -0
- package/src/assets/styles/scss/Avatar/Avatar-layout.scss +137 -0
- package/src/assets/styles/scss/Avatar/Avatar-theme.scss +64 -0
- package/src/assets/styles/scss/BaseImage/BaseImage-layout.scss +21 -0
- package/src/assets/styles/scss/BaseImage/BaseImage-theme.scss +35 -0
- package/src/assets/styles/scss/BaseImage/index.scss +2 -0
- package/src/assets/styles/scss/Channel/Channel-layout.scss +141 -0
- package/src/assets/styles/scss/Channel/Channel-theme.scss +100 -0
- package/src/assets/styles/scss/ChannelHeader/ChannelHeader-layout.scss +27 -0
- package/src/assets/styles/scss/ChannelHeader/ChannelHeader-theme.scss +43 -0
- package/src/assets/styles/scss/ChannelList/ChannelList-layout.scss +65 -0
- package/src/assets/styles/scss/ChannelList/ChannelList-theme.scss +89 -0
- package/src/assets/styles/scss/ChannelPreview/ChannelPreview-layout.scss +126 -0
- package/src/assets/styles/scss/ChannelPreview/ChannelPreview-theme.scss +148 -0
- package/src/assets/styles/scss/ChannelSearch/ChannelSearch-layout.scss +122 -0
- package/src/assets/styles/scss/ChannelSearch/ChannelSearch-theme.scss +238 -0
- package/src/assets/styles/scss/ChatView/ChatView-layout.scss +43 -0
- package/src/assets/styles/scss/ChatView/ChatView-theme.scss +32 -0
- package/src/assets/styles/scss/Dialog/Dialog-layout.scss +70 -0
- package/src/assets/styles/scss/Dialog/Dialog-theme.scss +103 -0
- package/src/assets/styles/scss/DragAndDropContainer/DragAndDropContainer-layout.scss +5 -0
- package/src/assets/styles/scss/DragAndDropContainer/DragAndDropContainer-theme.scss +47 -0
- package/src/assets/styles/scss/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
- package/src/assets/styles/scss/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
- package/src/assets/styles/scss/EditMessageForm/EditMessageForm-layout.scss +51 -0
- package/src/assets/styles/scss/EditMessageForm/EditMessageForm-theme.scss +50 -0
- package/src/assets/styles/scss/Form/Form-layout.scss +49 -0
- package/src/assets/styles/scss/Form/Form-theme.scss +82 -0
- package/src/assets/styles/scss/Icon/Icon-layout.scss +98 -0
- package/src/assets/styles/scss/Icon/Icon-theme.scss +17 -0
- package/src/assets/styles/scss/ImageCarousel/ImageCarousel-layout.scss +51 -0
- package/src/assets/styles/scss/ImageCarousel/ImageCarousel-theme.scss +30 -0
- package/src/assets/styles/scss/InfiniteScrollPaginator/InfiniteScrollPaginator-layout.scss +4 -0
- package/src/assets/styles/scss/LinkPreview/LinkPreview-layout.scss +67 -0
- package/src/assets/styles/scss/LinkPreview/LinkPreview-theme.scss +32 -0
- package/src/assets/styles/scss/LinkPreview/index.scss +2 -0
- package/src/assets/styles/scss/LoadingIndicator/LoadingIndicator-layout.scss +64 -0
- package/src/assets/styles/scss/LoadingIndicator/LoadingIndicator-theme.scss +14 -0
- package/src/assets/styles/scss/Location/Location-layout.scss +52 -0
- package/src/assets/styles/scss/Location/Location-theme.scss +32 -0
- package/src/assets/styles/scss/Message/Message-layout.scss +605 -0
- package/src/assets/styles/scss/Message/Message-theme.scss +483 -0
- package/src/assets/styles/scss/MessageActionsBox/MessageActionsBox-layout.scss +20 -0
- package/src/assets/styles/scss/MessageActionsBox/MessageActionsBox-theme.scss +85 -0
- package/src/assets/styles/scss/MessageBouncePrompt/MessageBouncePrompt-layout.scss +19 -0
- package/src/assets/styles/scss/MessageBouncePrompt/MessageBouncePrompt-theme.scss +51 -0
- package/src/assets/styles/scss/MessageInput/MessageInput-layout.scss +268 -0
- package/src/assets/styles/scss/MessageInput/MessageInput-theme.scss +359 -0
- package/src/assets/styles/scss/MessageList/MessageList-layout.scss +65 -0
- package/src/assets/styles/scss/MessageList/MessageList-theme.scss +107 -0
- package/src/assets/styles/scss/MessageList/VirtualizedMessageList-layout.scss +57 -0
- package/src/assets/styles/scss/MessageList/VirtualizedMessageList-theme.scss +41 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactions-layout.scss +143 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactions-theme.scss +92 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactionsSelector-layout.scss +86 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactionsSelector-theme.scss +94 -0
- package/src/assets/styles/scss/Modal/Modal-layout.scss +74 -0
- package/src/assets/styles/scss/Modal/Modal-theme.scss +109 -0
- package/src/assets/styles/scss/Notification/MessageNotification-layout.scss +12 -0
- package/src/assets/styles/scss/Notification/MessageNotification-theme.scss +34 -0
- package/src/assets/styles/scss/Notification/Notification-layout.scss +7 -0
- package/src/assets/styles/scss/Notification/Notification-theme.scss +32 -0
- package/src/assets/styles/scss/Notification/NotificationList-layout.scss +11 -0
- package/src/assets/styles/scss/Notification/NotificationList-theme.scss +31 -0
- package/src/assets/styles/scss/Poll/Poll-layout.scss +489 -0
- package/src/assets/styles/scss/Poll/Poll-theme.scss +178 -0
- package/src/assets/styles/scss/Search/Search-layout.scss +148 -0
- package/src/assets/styles/scss/Search/Search-theme.scss +222 -0
- package/src/assets/styles/scss/Thread/Thread-layout.scss +65 -0
- package/src/assets/styles/scss/Thread/Thread-theme.scss +82 -0
- package/src/assets/styles/scss/ThreadList/ThreadList-layout.scss +152 -0
- package/src/assets/styles/scss/ThreadList/ThreadList-theme.scss +75 -0
- package/src/assets/styles/scss/Tooltip/Tooltip-layout.scss +10 -0
- package/src/assets/styles/scss/Tooltip/Tooltip-theme.scss +36 -0
- package/src/assets/styles/scss/TypingIndicator/TypingIndicator-layout.scss +31 -0
- package/src/assets/styles/scss/TypingIndicator/TypingIndicator-theme.scss +68 -0
- package/src/assets/styles/scss/UnreadCountBadge/UnreadCountBadge-layout.scss +49 -0
- package/src/assets/styles/scss/UnreadCountBadge/UnreadCountBadge-theme.scss +11 -0
- package/src/assets/styles/scss/_base.scss +65 -0
- package/src/assets/styles/scss/_emoji-replacement.scss +45 -0
- package/src/assets/styles/scss/_global-layout-variables.scss +65 -0
- package/src/assets/styles/scss/_global-theme-variables.scss +173 -0
- package/src/assets/styles/scss/_icons.scss +36 -0
- package/src/assets/styles/scss/_palette-variables.scss +55 -0
- package/src/assets/styles/scss/_utils.scss +212 -0
- package/src/assets/styles/scss/_variables.scss +2 -0
- package/src/assets/styles/scss/common/CTAButton/CTAButton-layout.scss +4 -0
- package/src/assets/styles/scss/common/CTAButton/CTAButton-theme.scss +42 -0
- package/src/assets/styles/scss/common/CircleFAButton/CircleFAButton-layout.scss +14 -0
- package/src/assets/styles/scss/common/CircleFAButton/CircleFAButton-theme.scss +35 -0
- package/src/assets/styles/scss/index.layout.scss +49 -0
- package/src/assets/styles/scss/index.scss +50 -0
- package/src/assets/styles/scss/vendor/emoji-mart.scss +514 -0
- package/src/assets/styles/scss/vendor/react-image-gallery.scss +258 -0
- package/src/assets/version.ts +1 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
|
+
import type { Attachment, Channel, ChannelFilters, ChannelMemberResponse, CommandResponse, CustomMessageData, FormatMessageResponse, MessageResponseBase, ReactionGroupResponse, ReactionResponse, User, UserResponse } from 'stream-chat';
|
|
4
|
+
import { AttachmentService } from './attachment.service';
|
|
5
|
+
import { Icon } from './icon/icon.component';
|
|
6
|
+
export type UnknownType = Record<string, unknown>;
|
|
7
|
+
export type CustomTrigger = {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
componentProps: UnknownType;
|
|
10
|
+
data: UnknownType;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type StreamMessage = FormatMessageResponse & {
|
|
14
|
+
readBy: UserResponse[];
|
|
15
|
+
translation?: string;
|
|
16
|
+
errorStatusCode?: number;
|
|
17
|
+
quoted_message?: MessageResponseBase & {
|
|
18
|
+
translation?: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type AttachmentUploadErrorReason = 'file-size' | 'file-extension' | 'unknown';
|
|
22
|
+
export type AttachmentUpload = {
|
|
23
|
+
file: File;
|
|
24
|
+
state: 'error' | 'success' | 'uploading';
|
|
25
|
+
errorReason?: AttachmentUploadErrorReason;
|
|
26
|
+
errorExtraInfo?: {
|
|
27
|
+
param: string;
|
|
28
|
+
}[];
|
|
29
|
+
url?: string;
|
|
30
|
+
type: 'image' | 'file' | 'video' | 'voiceRecording';
|
|
31
|
+
previewUri?: string | ArrayBuffer;
|
|
32
|
+
thumb_url?: string;
|
|
33
|
+
extraData?: Partial<Attachment>;
|
|
34
|
+
fromAttachment?: Attachment;
|
|
35
|
+
};
|
|
36
|
+
export type MentionAutcompleteListItemContext = {
|
|
37
|
+
item: MentionAutcompleteListItem;
|
|
38
|
+
};
|
|
39
|
+
export type CommandAutocompleteListItemContext = {
|
|
40
|
+
item: ComandAutocompleteListItem;
|
|
41
|
+
};
|
|
42
|
+
export type MentionAutcompleteListItem = (ChannelMemberResponse | UserResponse) & {
|
|
43
|
+
autocompleteLabel: string;
|
|
44
|
+
};
|
|
45
|
+
export type ComandAutocompleteListItem = CommandResponse & {
|
|
46
|
+
autocompleteLabel: string;
|
|
47
|
+
};
|
|
48
|
+
export type NotificationType = 'success' | 'error' | 'info';
|
|
49
|
+
export type NotificationPayload<T = object> = {
|
|
50
|
+
id: string;
|
|
51
|
+
type: NotificationType;
|
|
52
|
+
text?: string;
|
|
53
|
+
translateParams?: object;
|
|
54
|
+
template?: TemplateRef<T>;
|
|
55
|
+
templateContext?: T;
|
|
56
|
+
dismissFn: () => void;
|
|
57
|
+
};
|
|
58
|
+
export type ChannelPreviewContext = {
|
|
59
|
+
channel: Channel;
|
|
60
|
+
};
|
|
61
|
+
export type ChannelPreviewInfoContext = ChannelPreviewContext & {
|
|
62
|
+
latestMessage?: StreamMessage;
|
|
63
|
+
/**
|
|
64
|
+
* The text of the latest message, or some meta information (for example: "Nothing yet")
|
|
65
|
+
*/
|
|
66
|
+
latestMessageText: string;
|
|
67
|
+
/**
|
|
68
|
+
* The title of the channel, or the name of the channel members
|
|
69
|
+
*/
|
|
70
|
+
channelDisplayTitle: string;
|
|
71
|
+
/**
|
|
72
|
+
* The status of the last message (only available if the last message was sent by the current user)
|
|
73
|
+
*/
|
|
74
|
+
latestMessageStatus?: 'delivered' | 'read';
|
|
75
|
+
/**
|
|
76
|
+
* The time of the last message (formatted to a user-friendly string)
|
|
77
|
+
*/
|
|
78
|
+
latestMessageTime?: string;
|
|
79
|
+
unreadCount: number;
|
|
80
|
+
};
|
|
81
|
+
export type MentionTemplateContext = {
|
|
82
|
+
content: string;
|
|
83
|
+
user: UserResponse;
|
|
84
|
+
};
|
|
85
|
+
export type EmojiPickerContext = {
|
|
86
|
+
emojiInput$: Subject<string>;
|
|
87
|
+
};
|
|
88
|
+
export type TypingIndicatorContext = {
|
|
89
|
+
usersTyping$: Observable<UserResponse[]>;
|
|
90
|
+
};
|
|
91
|
+
export type MessageContext = {
|
|
92
|
+
message: StreamMessage | undefined;
|
|
93
|
+
enabledMessageActions: string[];
|
|
94
|
+
isLastSentMessage: boolean | undefined;
|
|
95
|
+
mode: 'thread' | 'main';
|
|
96
|
+
isHighlighted: boolean;
|
|
97
|
+
customActions: CustomMessageActionItem[];
|
|
98
|
+
scroll$?: Observable<void>;
|
|
99
|
+
};
|
|
100
|
+
export type ChannelActionsContext = {
|
|
101
|
+
channel: Channel;
|
|
102
|
+
};
|
|
103
|
+
export type CustomAttachmentListContext = {
|
|
104
|
+
messageId: string;
|
|
105
|
+
attachments: Attachment[];
|
|
106
|
+
parentMessageId?: string;
|
|
107
|
+
};
|
|
108
|
+
export type AttachmentListContext = CustomAttachmentListContext & {
|
|
109
|
+
imageModalStateChangeHandler?: (state: 'opened' | 'closed') => void;
|
|
110
|
+
};
|
|
111
|
+
export type AvatarType = 'channel' | 'user';
|
|
112
|
+
export type AvatarLocation = 'channel-preview' | 'channel-header' | 'message-sender' | 'message-reader' | 'quoted-message-sender' | 'autocomplete-item' | 'typing-indicator' | 'poll-voter'
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated this will be renamed to user-list in the next major release
|
|
115
|
+
*/
|
|
116
|
+
| 'reaction';
|
|
117
|
+
export type AvatarContext = {
|
|
118
|
+
name: string | undefined;
|
|
119
|
+
imageUrl: string | undefined;
|
|
120
|
+
type: AvatarType | undefined;
|
|
121
|
+
location: AvatarLocation | undefined;
|
|
122
|
+
channel?: Channel;
|
|
123
|
+
user?: User;
|
|
124
|
+
initialsType?: 'first-letter-of-first-word' | 'first-letter-of-each-word';
|
|
125
|
+
showOnlineIndicator?: boolean;
|
|
126
|
+
};
|
|
127
|
+
export type AttachmentPreviewListContext = {
|
|
128
|
+
attachmentUploads$: Observable<AttachmentUpload[]> | undefined;
|
|
129
|
+
retryUploadHandler: (f: File) => void;
|
|
130
|
+
deleteUploadHandler: (u: AttachmentUpload) => void;
|
|
131
|
+
service: AttachmentService;
|
|
132
|
+
};
|
|
133
|
+
export type IconContext = {
|
|
134
|
+
icon: Icon | undefined;
|
|
135
|
+
};
|
|
136
|
+
export type MessageActionsBoxContext = {
|
|
137
|
+
isMine: boolean;
|
|
138
|
+
message: StreamMessage | undefined;
|
|
139
|
+
enabledActions: string[];
|
|
140
|
+
messageTextHtmlElement: HTMLElement | undefined;
|
|
141
|
+
};
|
|
142
|
+
export type MessageActionHandlerExtraParams = {
|
|
143
|
+
isMine: boolean;
|
|
144
|
+
messageTextHtmlElement?: HTMLElement;
|
|
145
|
+
};
|
|
146
|
+
export type MessageActionHandler = (message: StreamMessage, params: MessageActionHandlerExtraParams) => void;
|
|
147
|
+
export type MessageActionBoxItemContext = {
|
|
148
|
+
actionName: string;
|
|
149
|
+
actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string;
|
|
150
|
+
message: StreamMessage;
|
|
151
|
+
actionHandlerExtraParams: MessageActionHandlerExtraParams;
|
|
152
|
+
actionHandler: MessageActionHandler;
|
|
153
|
+
};
|
|
154
|
+
export type MessageReactionActionItem = {
|
|
155
|
+
actionName: 'react';
|
|
156
|
+
isVisible: (enabledActions: string[], isMine: boolean, message: StreamMessage) => boolean;
|
|
157
|
+
};
|
|
158
|
+
type MessageActionItemBase = {
|
|
159
|
+
actionLabelOrTranslationKey: ((message: StreamMessage) => string) | string;
|
|
160
|
+
isVisible: (enabledActions: string[], isMine: boolean, message: StreamMessage) => boolean;
|
|
161
|
+
actionHandler: MessageActionHandler;
|
|
162
|
+
};
|
|
163
|
+
export type MessageActionItem = MessageActionItemBase & {
|
|
164
|
+
actionName: 'quote' | 'pin' | 'flag' | 'edit' | 'delete' | 'mark-unread' | 'thread-reply' | 'copy-message-text';
|
|
165
|
+
};
|
|
166
|
+
export type CustomMessageActionItem = MessageActionItemBase & {
|
|
167
|
+
actionName: string;
|
|
168
|
+
};
|
|
169
|
+
export type MessageReactionsSelectorContext = {
|
|
170
|
+
messageId: string | undefined;
|
|
171
|
+
ownReactions: ReactionResponse[];
|
|
172
|
+
};
|
|
173
|
+
export type MessageReactionsContext = {
|
|
174
|
+
messageId: string | undefined;
|
|
175
|
+
/** @deprecated use `messageReactionGroups` */
|
|
176
|
+
messageReactionCounts: {
|
|
177
|
+
[key in MessageReactionType]?: number;
|
|
178
|
+
};
|
|
179
|
+
/** @deprecated you can fetch the reactions using [`chatService.chatClient.queryReactions()`](/chat/docs/javascript/send_reaction/&q=queryReactions#query-reactions) */
|
|
180
|
+
latestReactions: ReactionResponse[];
|
|
181
|
+
ownReactions: ReactionResponse[];
|
|
182
|
+
messageReactionGroups: {
|
|
183
|
+
[key in MessageReactionType]: ReactionGroupResponse;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
export type ModalContext = {
|
|
187
|
+
isOpen: boolean;
|
|
188
|
+
isOpenChangeHandler: (isOpen: boolean) => void;
|
|
189
|
+
content: TemplateRef<void>;
|
|
190
|
+
};
|
|
191
|
+
export type NotificationContext = {
|
|
192
|
+
type: NotificationType | undefined;
|
|
193
|
+
content: TemplateRef<void> | undefined;
|
|
194
|
+
};
|
|
195
|
+
export type ThreadHeaderContext = {
|
|
196
|
+
parentMessage: StreamMessage | undefined;
|
|
197
|
+
closeThreadHandler: () => void;
|
|
198
|
+
};
|
|
199
|
+
export type MessageReactionType = string;
|
|
200
|
+
export type AttachmentConfigration = {
|
|
201
|
+
url: string;
|
|
202
|
+
height: string;
|
|
203
|
+
width: string;
|
|
204
|
+
};
|
|
205
|
+
export type ImageAttachmentConfiguration = AttachmentConfigration & {
|
|
206
|
+
originalHeight: number;
|
|
207
|
+
originalWidth: number;
|
|
208
|
+
};
|
|
209
|
+
export type VideoAttachmentConfiguration = ImageAttachmentConfiguration & {
|
|
210
|
+
thumbUrl?: string;
|
|
211
|
+
};
|
|
212
|
+
export type DeliveredStatusContext = {
|
|
213
|
+
message: StreamMessage;
|
|
214
|
+
};
|
|
215
|
+
export type SendingStatusContext = {
|
|
216
|
+
message: StreamMessage;
|
|
217
|
+
};
|
|
218
|
+
export type CustomMetadataContext = {
|
|
219
|
+
message: StreamMessage;
|
|
220
|
+
};
|
|
221
|
+
export type ReadStatusContext = {
|
|
222
|
+
message: StreamMessage;
|
|
223
|
+
readByText: string;
|
|
224
|
+
};
|
|
225
|
+
export type ChannelHeaderInfoContext = {
|
|
226
|
+
channel: Channel;
|
|
227
|
+
};
|
|
228
|
+
export type CustomAttachmentUploadContext = {
|
|
229
|
+
isMultipleFileUploadEnabled: boolean | undefined;
|
|
230
|
+
attachmentService: AttachmentService;
|
|
231
|
+
};
|
|
232
|
+
export type AttachmentContext = {
|
|
233
|
+
attachment: Attachment;
|
|
234
|
+
};
|
|
235
|
+
export type GalleryAttachmentContext = {
|
|
236
|
+
attachment: GalleryAttachment;
|
|
237
|
+
};
|
|
238
|
+
export type SystemMessageContext = MessageContext & {
|
|
239
|
+
parsedDate: string | undefined;
|
|
240
|
+
};
|
|
241
|
+
export type DateSeparatorContext = {
|
|
242
|
+
date: Date;
|
|
243
|
+
parsedDate: string;
|
|
244
|
+
};
|
|
245
|
+
export type UnreadMessagesIndicatorContext = {
|
|
246
|
+
unreadCount: number;
|
|
247
|
+
};
|
|
248
|
+
export type UnreadMessagesNotificationContext = UnreadMessagesIndicatorContext & {
|
|
249
|
+
onJump: () => void;
|
|
250
|
+
onDismiss: () => void;
|
|
251
|
+
};
|
|
252
|
+
export type ChannelQueryState = {
|
|
253
|
+
state: 'in-progress' | 'success' | 'error';
|
|
254
|
+
error?: unknown;
|
|
255
|
+
};
|
|
256
|
+
export type MessageInput = {
|
|
257
|
+
text: string;
|
|
258
|
+
attachments: Attachment[];
|
|
259
|
+
mentionedUsers: UserResponse[];
|
|
260
|
+
parentId: string | undefined;
|
|
261
|
+
quotedMessageId: string | undefined;
|
|
262
|
+
customData: undefined | CustomMessageData;
|
|
263
|
+
pollId: string | undefined;
|
|
264
|
+
};
|
|
265
|
+
export type OffsetNextPageConfiguration = {
|
|
266
|
+
type: 'offset';
|
|
267
|
+
offset: number;
|
|
268
|
+
};
|
|
269
|
+
export type FiltertNextPageConfiguration = {
|
|
270
|
+
type: 'filter';
|
|
271
|
+
paginationFilter: ChannelFilters;
|
|
272
|
+
};
|
|
273
|
+
export type NextPageConfiguration = OffsetNextPageConfiguration | FiltertNextPageConfiguration | undefined;
|
|
274
|
+
export type MessageReactionClickDetails = {
|
|
275
|
+
messageId: string;
|
|
276
|
+
reactionType: string;
|
|
277
|
+
};
|
|
278
|
+
export type MessageActionsClickDetails = MessageActionsBoxContext & {
|
|
279
|
+
customActions: CustomMessageActionItem[];
|
|
280
|
+
};
|
|
281
|
+
export type GroupStyleOptions = {
|
|
282
|
+
noGroupByUser?: boolean;
|
|
283
|
+
lastReadMessageId?: string;
|
|
284
|
+
noGroupByReadState?: boolean;
|
|
285
|
+
};
|
|
286
|
+
export type ChannelQueryType = 'first-page' | 'next-page' | 'recover-state';
|
|
287
|
+
export type ChannelQueryResult = {
|
|
288
|
+
channels: Channel[];
|
|
289
|
+
hasMorePage: boolean;
|
|
290
|
+
};
|
|
291
|
+
export type VirtualizedListScrollPosition = 'top' | 'bottom' | 'middle';
|
|
292
|
+
export type VirtualizedListQueryState = {
|
|
293
|
+
state: 'loading-top' | 'loading-bottom' | 'success' | 'error';
|
|
294
|
+
error?: unknown;
|
|
295
|
+
};
|
|
296
|
+
export type VirtualizedListQueryDirection = 'top' | 'bottom';
|
|
297
|
+
export type VirtualizedListVerticalItemPosition = 'top' | 'bottom' | 'middle';
|
|
298
|
+
export type AudioRecording = MediaRecording & {
|
|
299
|
+
waveform_data: number[];
|
|
300
|
+
};
|
|
301
|
+
export type MediaRecording = {
|
|
302
|
+
recording: File;
|
|
303
|
+
duration: number;
|
|
304
|
+
mime_type: string;
|
|
305
|
+
asset_url: string | ArrayBuffer | undefined;
|
|
306
|
+
};
|
|
307
|
+
export type CustomAttachmentPreviewListContext = {
|
|
308
|
+
service: AttachmentService;
|
|
309
|
+
};
|
|
310
|
+
export type ThreadReplyButtonContext = {
|
|
311
|
+
message: StreamMessage;
|
|
312
|
+
};
|
|
313
|
+
export type CustomAutocompleteItemContext = {
|
|
314
|
+
item: CustomAutocompleteItem;
|
|
315
|
+
};
|
|
316
|
+
export type CustomAutocompleteItem = {
|
|
317
|
+
/**
|
|
318
|
+
* This is the text that will be inserted into the message input once a user selects an option (appended after the trigger character)
|
|
319
|
+
*/
|
|
320
|
+
autocompleteLabel: string;
|
|
321
|
+
};
|
|
322
|
+
export type CustomAutocomplete = {
|
|
323
|
+
/**
|
|
324
|
+
* The character that will trigger the autocomplete (for example #)
|
|
325
|
+
*
|
|
326
|
+
* The SDK supports @ and / by default, so you can't use those
|
|
327
|
+
*/
|
|
328
|
+
triggerCharacter: string;
|
|
329
|
+
/**
|
|
330
|
+
* The HTML template to display an item in the autocomplete list
|
|
331
|
+
*/
|
|
332
|
+
templateRef: TemplateRef<{
|
|
333
|
+
item: CustomAutocompleteItem;
|
|
334
|
+
}>;
|
|
335
|
+
/**
|
|
336
|
+
* Set to `true` if space characters can be part of the `autocompleteLabel`
|
|
337
|
+
*/
|
|
338
|
+
allowSpace: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* The options to choose from
|
|
341
|
+
*
|
|
342
|
+
* In case you want to use dynamic/server-side filtering, use `updateOptions` instead
|
|
343
|
+
*/
|
|
344
|
+
options: CustomAutocompleteItem[];
|
|
345
|
+
/**
|
|
346
|
+
* If you want to have dynamic/server-side filtering provide a method that will be called any time the autocomplete options should be filtered
|
|
347
|
+
* @param searchTerm the text to filter by (without the trigger character), can be an empty string
|
|
348
|
+
* @returns a promise that will resolve to the options, you should take care of error handling
|
|
349
|
+
*/
|
|
350
|
+
updateOptions?: (searchTerm: string) => Promise<CustomAutocompleteItem[]>;
|
|
351
|
+
};
|
|
352
|
+
export type MessageTextContext = {
|
|
353
|
+
message: StreamMessage | undefined | MessageResponseBase;
|
|
354
|
+
isQuoted: boolean;
|
|
355
|
+
shouldTranslate: boolean;
|
|
356
|
+
};
|
|
357
|
+
export type GalleryAttachment = {
|
|
358
|
+
type: 'gallery';
|
|
359
|
+
images: Attachment[];
|
|
360
|
+
};
|
|
361
|
+
export type MessageBlockedContext = {
|
|
362
|
+
message: StreamMessage;
|
|
363
|
+
isMyMessage: boolean;
|
|
364
|
+
};
|
|
365
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { UserResponse } from 'stream-chat';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* The `UserListComponent` can display a list of Stream users with pagination
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserListComponent {
|
|
8
|
+
/**
|
|
9
|
+
* The users to display
|
|
10
|
+
*/
|
|
11
|
+
users: UserResponse[];
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, the loading indicator will be displayed
|
|
14
|
+
*/
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If `false` the component won't ask for more data vua the `loadMore` output
|
|
18
|
+
*/
|
|
19
|
+
hasMore: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The component will signal via this output when more items should be fetched
|
|
22
|
+
*
|
|
23
|
+
* The new items should be appended to the `items` array
|
|
24
|
+
*/
|
|
25
|
+
readonly loadMore: EventEmitter<void>;
|
|
26
|
+
trackByUserId(_: number, item: UserResponse): string;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserListComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UserListComponent, "stream-user-list", never, { "users": { "alias": "users"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "hasMore": { "alias": "hasMore"; "required": false; }; }, { "loadMore": "loadMore"; }, never, never, false, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
2
|
+
import { VirtualizedListQueryDirection, VirtualizedListQueryState, VirtualizedListScrollPosition, VirtualizedListVerticalItemPosition } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The `VirtualizedListService` removes items from a list that are not currently displayed. This is a high-level overview of how it works:
|
|
5
|
+
* - Create a new instance for each list that needs virtualization
|
|
6
|
+
* - Input: Provide a reactive stream that emits all items in the list
|
|
7
|
+
* - Input: Provide a reactive stream that emit the current scroll position (top, middle or bottom)
|
|
8
|
+
* - Input: maximum number of items that are allowed in the list (in practice the service can make the virtualized list half this number, you should take this into account when choosing the value)
|
|
9
|
+
* - Output: The service will emit the current list of displayed items via the virtualized items reactive stream
|
|
10
|
+
* - For simplicity, the service won't track the height of the items, nor it needs an exact scroll location -> this is how removing items work:
|
|
11
|
+
* - If scroll location is bottom/top items around the current bottom/top item will be emitted in the virtualized items stream
|
|
12
|
+
* - If scroll location is middle, the service won't remove items, if new items are received, those will be appended to the virtualized list (this means that in theory the list can grow very big if a lot of new items are received while the user is scrolled somewhere, this is a trade-off for the simplicity of no height tracking)
|
|
13
|
+
* - Since there is no height tracking, you should make sure to provide a maximum number that is big enough to fill the biggest expected screen size twice
|
|
14
|
+
* - If the user scrolls to the bottom/top and there are no more local items to show, the service will trigger a query to load more items
|
|
15
|
+
* - Input: you should provide the page size to use, in order for the service to determine if loading is necessary
|
|
16
|
+
*
|
|
17
|
+
* The `VirtualizedMessageListService` provides an implementation for the message list component.
|
|
18
|
+
*/
|
|
19
|
+
export declare abstract class VirtualizedListService<T> {
|
|
20
|
+
private allItems$;
|
|
21
|
+
private scrollPosition$;
|
|
22
|
+
readonly jumpToItem$?: Observable<{
|
|
23
|
+
item: Partial<T> | undefined;
|
|
24
|
+
position?: VirtualizedListVerticalItemPosition | undefined;
|
|
25
|
+
}> | undefined;
|
|
26
|
+
readonly pageSize: number;
|
|
27
|
+
readonly maxItemCount: number;
|
|
28
|
+
/**
|
|
29
|
+
* The items that should be currently displayed, a subset of all items
|
|
30
|
+
*/
|
|
31
|
+
virtualizedItems$: Observable<T[]>;
|
|
32
|
+
/**
|
|
33
|
+
* The result of the last query used to load more items
|
|
34
|
+
*/
|
|
35
|
+
queryState$: Observable<VirtualizedListQueryState>;
|
|
36
|
+
protected queryStateSubject: BehaviorSubject<VirtualizedListQueryState>;
|
|
37
|
+
protected bufferOnTop: number;
|
|
38
|
+
protected bufferOnBottom: number;
|
|
39
|
+
protected loadFromBuffer$: Subject<void>;
|
|
40
|
+
private virtualizedItemsSubject;
|
|
41
|
+
private subscriptions;
|
|
42
|
+
constructor(allItems$: Observable<T[]>, scrollPosition$: Observable<VirtualizedListScrollPosition>, jumpToItem$?: Observable<{
|
|
43
|
+
item: Partial<T> | undefined;
|
|
44
|
+
position?: VirtualizedListVerticalItemPosition | undefined;
|
|
45
|
+
}> | undefined, pageSize?: number, maxItemCount?: number);
|
|
46
|
+
/**
|
|
47
|
+
* The current value of virtualized items
|
|
48
|
+
*/
|
|
49
|
+
get virtualizedItems(): T[];
|
|
50
|
+
/**
|
|
51
|
+
* Remove all subscriptions, call this once you're done using an instance of this service
|
|
52
|
+
*/
|
|
53
|
+
dispose(): void;
|
|
54
|
+
protected loadMoreFromBuffer(_: VirtualizedListQueryDirection): void;
|
|
55
|
+
private loadMore;
|
|
56
|
+
protected abstract isEqual: (t1: T, t2: T) => boolean;
|
|
57
|
+
protected abstract query: (direction: VirtualizedListQueryDirection) => Promise<unknown>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChannelService } from './channel.service';
|
|
2
|
+
import { VirtualizedListQueryDirection, VirtualizedListScrollPosition, StreamMessage } from './types';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { VirtualizedListService } from './virtualized-list.service';
|
|
5
|
+
/**
|
|
6
|
+
* The `VirtualizedMessageListService` removes messages from the message list that are currently not in view
|
|
7
|
+
*/
|
|
8
|
+
export declare class VirtualizedMessageListService extends VirtualizedListService<StreamMessage> {
|
|
9
|
+
readonly mode: 'thread' | 'main';
|
|
10
|
+
private channelService;
|
|
11
|
+
constructor(mode: 'thread' | 'main', scrollPosition$: Observable<VirtualizedListScrollPosition>, channelService: ChannelService);
|
|
12
|
+
protected loadMoreFromBuffer(direction: VirtualizedListQueryDirection): void;
|
|
13
|
+
protected isEqual: (t1: StreamMessage, t2: StreamMessage) => boolean;
|
|
14
|
+
protected query: (direction: VirtualizedListQueryDirection) => Promise<void> | Promise<import("stream-chat").QueryChannelAPIResponse>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ChatClientService } from '../chat-client.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* fftSize
|
|
6
|
+
* An unsigned integer, representing the window size of the FFT, given in number of samples.
|
|
7
|
+
* A higher value will result in more details in the frequency domain but fewer details
|
|
8
|
+
* in the amplitude domain.
|
|
9
|
+
*
|
|
10
|
+
* Must be a power of 2 between 2^5 and 2^15, so one of: 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, and 32768.
|
|
11
|
+
* Defaults to 32.
|
|
12
|
+
*
|
|
13
|
+
* maxDecibels
|
|
14
|
+
* A double, representing the maximum decibel value for scaling the FFT analysis data,
|
|
15
|
+
* where 0 dB is the loudest possible sound, -10 dB is a 10th of that, etc.
|
|
16
|
+
* The default value is -30 dB.
|
|
17
|
+
*
|
|
18
|
+
* minDecibels
|
|
19
|
+
* A double, representing the minimum decibel value for scaling the FFT analysis data,
|
|
20
|
+
* where 0 dB is the loudest possible sound, -10 dB is a 10th of that, etc.
|
|
21
|
+
* The default value is -100 dB.
|
|
22
|
+
*/
|
|
23
|
+
export type AmplitudeAnalyserConfig = Pick<AnalyserNode, 'fftSize' | 'maxDecibels' | 'minDecibels'>;
|
|
24
|
+
export type AmplitudeRecorderConfig = {
|
|
25
|
+
analyserConfig: AmplitudeAnalyserConfig;
|
|
26
|
+
sampleCount: number;
|
|
27
|
+
samplingFrequencyMs: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const DEFAULT_AMPLITUDE_RECORDER_CONFIG: AmplitudeRecorderConfig;
|
|
30
|
+
/**
|
|
31
|
+
* The `AmplitudeRecorderService` is a utility service used to create amplitude values for voice recordings, making it possible to display a wave bar
|
|
32
|
+
*/
|
|
33
|
+
export declare class AmplitudeRecorderService {
|
|
34
|
+
private chatService;
|
|
35
|
+
config: AmplitudeRecorderConfig;
|
|
36
|
+
amplitudes$: Observable<number[]>;
|
|
37
|
+
error$: Observable<Error | undefined>;
|
|
38
|
+
private amplitudesSubject;
|
|
39
|
+
private errorSubject;
|
|
40
|
+
private audioContext;
|
|
41
|
+
private analyserNode;
|
|
42
|
+
private microphone;
|
|
43
|
+
private stream;
|
|
44
|
+
private amplitudeSamplingInterval;
|
|
45
|
+
constructor(chatService: ChatClientService);
|
|
46
|
+
/**
|
|
47
|
+
* The recorded amplitudes
|
|
48
|
+
*/
|
|
49
|
+
get amplitudes(): number[];
|
|
50
|
+
/**
|
|
51
|
+
* Start amplitude recording for the given media stream
|
|
52
|
+
* @param stream
|
|
53
|
+
*/
|
|
54
|
+
start: (stream: MediaStream) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Temporarily pause amplitude recording, recording can be resumed with `resume`
|
|
57
|
+
*/
|
|
58
|
+
pause(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Resume amplited recording after it was pasued
|
|
61
|
+
*/
|
|
62
|
+
resume(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Stop the amplitude recording and frees up used resources
|
|
65
|
+
*/
|
|
66
|
+
stop(): void;
|
|
67
|
+
private init;
|
|
68
|
+
private logError;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AmplitudeRecorderService, never>;
|
|
70
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AmplitudeRecorderService>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AmplitudeRecorderService } from './amplitude-recorder.service';
|
|
2
|
+
import { MediaRecorderConfig, MultimediaRecorder } from './media-recorder';
|
|
3
|
+
import { NotificationService } from '../notification.service';
|
|
4
|
+
import { ChatClientService } from '../chat-client.service';
|
|
5
|
+
import { TranscoderService } from './transcoder.service';
|
|
6
|
+
import { AudioRecording, MediaRecording } from '../types';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* The `AudioRecorderService` can record an audio file, the SDK uses this to record a voice message
|
|
10
|
+
*/
|
|
11
|
+
export declare class AudioRecorderService extends MultimediaRecorder<Omit<AudioRecording, keyof MediaRecording>> {
|
|
12
|
+
private amplitudeRecorder;
|
|
13
|
+
/**
|
|
14
|
+
* Due to browser restrictions the following config is used:
|
|
15
|
+
* - In Safari we record in audio/mp4
|
|
16
|
+
* - For all other browsers we use audio/webm (which is then transcoded to wav)
|
|
17
|
+
*/
|
|
18
|
+
config: MediaRecorderConfig;
|
|
19
|
+
constructor(notificationService: NotificationService, chatService: ChatClientService, transcoder: TranscoderService, amplitudeRecorder: AmplitudeRecorderService);
|
|
20
|
+
protected enrichWithExtraData(): {
|
|
21
|
+
waveform_data: number[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Start audio recording
|
|
25
|
+
*/
|
|
26
|
+
start(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Pause audio recording, it can be restarted using `resume`
|
|
29
|
+
*/
|
|
30
|
+
pause(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Resume a previously paused recording
|
|
33
|
+
*/
|
|
34
|
+
resume(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Stop the recording and free up used resources
|
|
37
|
+
* @param options
|
|
38
|
+
* @param options.cancel if this is `true` no recording will be created, but resources will be freed
|
|
39
|
+
* @returns the recording
|
|
40
|
+
*/
|
|
41
|
+
stop(options?: {
|
|
42
|
+
cancel: boolean;
|
|
43
|
+
}): Promise<MediaRecording & Omit<AudioRecording, keyof MediaRecording>>;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AudioRecorderService, never>;
|
|
45
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AudioRecorderService>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
2
|
+
import { NotificationService } from '../notification.service';
|
|
3
|
+
import { ChatClientService } from '../chat-client.service';
|
|
4
|
+
import { TranscoderService } from './transcoder.service';
|
|
5
|
+
import { MediaRecording } from '../types';
|
|
6
|
+
export type MediaRecorderConfig = Omit<MediaRecorderOptions, 'mimeType'> & Required<Pick<MediaRecorderOptions, 'mimeType'>>;
|
|
7
|
+
export declare enum MediaRecordingState {
|
|
8
|
+
PAUSED = "paused",
|
|
9
|
+
RECORDING = "recording",
|
|
10
|
+
STOPPED = "stopped",
|
|
11
|
+
ERROR = "error"
|
|
12
|
+
}
|
|
13
|
+
export type MediaRecordingTitleOptions = {
|
|
14
|
+
mimeType: string;
|
|
15
|
+
};
|
|
16
|
+
export declare abstract class MultimediaRecorder<T = null> {
|
|
17
|
+
protected notificationService: NotificationService;
|
|
18
|
+
protected chatService: ChatClientService;
|
|
19
|
+
private transcoder;
|
|
20
|
+
abstract config: MediaRecorderConfig;
|
|
21
|
+
customGenerateRecordingTitle: ((options: MediaRecordingTitleOptions) => string) | undefined;
|
|
22
|
+
recordingState$: Observable<MediaRecordingState>;
|
|
23
|
+
recording$: Observable<(MediaRecording & T) | undefined>;
|
|
24
|
+
protected recordingSubject: BehaviorSubject<(MediaRecording & T) | undefined>;
|
|
25
|
+
protected mediaRecorder: MediaRecorder | undefined;
|
|
26
|
+
protected startTime: number | undefined;
|
|
27
|
+
protected recordedChunkDurations: number[];
|
|
28
|
+
private recordingStateSubject;
|
|
29
|
+
constructor(notificationService: NotificationService, chatService: ChatClientService, transcoder: TranscoderService);
|
|
30
|
+
get durationMs(): number;
|
|
31
|
+
get mediaType(): string;
|
|
32
|
+
get isRecording(): boolean;
|
|
33
|
+
generateRecordingTitle: (mimeType: string) => string;
|
|
34
|
+
makeRecording(blob: Blob): Promise<File | undefined>;
|
|
35
|
+
handleErrorEvent: (e: Event) => void;
|
|
36
|
+
handleDataavailableEvent: (e: BlobEvent) => void;
|
|
37
|
+
get recordingState(): MediaRecordingState;
|
|
38
|
+
start(): Promise<void>;
|
|
39
|
+
pause(): void;
|
|
40
|
+
resume(): void;
|
|
41
|
+
stop(options?: {
|
|
42
|
+
cancel: boolean;
|
|
43
|
+
}): Promise<MediaRecording & T>;
|
|
44
|
+
protected abstract enrichWithExtraData(): T;
|
|
45
|
+
protected logError(error: Error): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodeWebmToMp3(blob: Blob, lameJs: any): Promise<Blob>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export type TranscoderConfig = {
|
|
3
|
+
sampleRate: number;
|
|
4
|
+
};
|
|
5
|
+
export type TranscodeParams = TranscoderConfig & {
|
|
6
|
+
blob: Blob;
|
|
7
|
+
};
|
|
8
|
+
type WriteWaveHeaderParams = {
|
|
9
|
+
arrayBuffer: ArrayBuffer;
|
|
10
|
+
channelCount: number;
|
|
11
|
+
sampleRate: number;
|
|
12
|
+
};
|
|
13
|
+
type WriteAudioDataParams = {
|
|
14
|
+
arrayBuffer: ArrayBuffer;
|
|
15
|
+
dataByChannel: Float32Array[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The `TranscoderService` is used to transcibe audio recording to a format that's supported by all major browsers. The SDK uses this to create voice messages.
|
|
19
|
+
*
|
|
20
|
+
* If you want to use your own transcoder you can provide a `customTranscoder`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class TranscoderService {
|
|
23
|
+
config: TranscoderConfig;
|
|
24
|
+
customTranscoder?: (blob: Blob) => Blob | Promise<Blob>;
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* The default transcoder will leave audio/mp4 files as is, and transcode webm files to wav. If you want to customize this, you can provide your own transcoder using the `customTranscoder` field
|
|
28
|
+
* @param blob
|
|
29
|
+
* @returns the transcoded file
|
|
30
|
+
*/
|
|
31
|
+
transcode(blob: Blob): Promise<Blob>;
|
|
32
|
+
protected renderAudio(audioBuffer: AudioBuffer, sampleRate: number): Promise<AudioBuffer>;
|
|
33
|
+
protected toAudioBuffer(blob: Blob): Promise<AudioBuffer>;
|
|
34
|
+
protected writeWavAudioData({ arrayBuffer, dataByChannel, }: WriteAudioDataParams): void;
|
|
35
|
+
protected writeWavHeader({ arrayBuffer, channelCount, sampleRate, }: WriteWaveHeaderParams): void;
|
|
36
|
+
protected splitDataByChannel: (audioBuffer: AudioBuffer) => Float32Array[];
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranscoderService, never>;
|
|
38
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TranscoderService>;
|
|
39
|
+
}
|
|
40
|
+
export {};
|