Skip to content

Commit af48fe4

Browse files
authored
Merge pull request #696 from GetStream/6.x.x-rc
6.x.x rc
2 parents 1151578 + 3cffdb1 commit af48fe4

File tree

62 files changed

+1478
-1072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1478
-1072
lines changed

.github/workflows/workflow.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ on:
33
push:
44
branches:
55
- master
6-
- angular-19
7-
- test-update
8-
- fix-voice-recording
6+
- 6.x.x-rc
97
pull_request:
108
branches:
119
- master
12-
- 5.x.x-beta
10+
- 6.x.x-rc
1311
jobs:
1412
workflow:
1513
runs-on: ubuntu-latest

package-lock.json

Lines changed: 756 additions & 198 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "stream-chat-angular",
33
"version": "0.0.0",
4+
"watch": {
5+
"remove-stream-chat-augmentation": "dist/stream-chat-angular/stream-chat.d.ts.map"
6+
},
47
"scripts": {
58
"prepare": "husky install",
69
"postinstall": "npm run config:dev & npm run copy-css",
@@ -14,8 +17,14 @@
1417
"prestart:dev:customizations-example": "npm run config:dev",
1518
"start:dev:customizations-example": "rm -rf dist & npm run watch & (wait-on dist && ng serve customizations-example --host 0.0.0.0)",
1619
"build": "ng build stream-chat-angular",
20+
"postbuild": "npm run remove-stream-chat-augmentation",
21+
"delete-stream-chat-declaration": "rm -f dist/stream-chat-angular/stream-chat.d.ts",
22+
"delete-stream-chat-declaration-map": "rm -f dist/stream-chat-angular/stream-chat.d.ts.map",
23+
"remove-stream-chat-reference": "replace '/// <reference path=\"stream-chat.d.ts\" />' '' dist/stream-chat-angular/public-api.d.ts",
24+
"remove-stream-chat-augmentation": "npm run delete-stream-chat-declaration && npm run delete-stream-chat-declaration-map && npm run remove-stream-chat-reference",
1725
"build:prod": "npm run copy-css && ng build stream-chat-angular --configuration production",
18-
"watch": "ng build stream-chat-angular --watch --configuration development",
26+
"postbuild:prod": "npm run remove-stream-chat-augmentation",
27+
"watch": "ng build stream-chat-angular --watch --configuration development & npm-watch",
1928
"test": "rm -rf dist & npm run watch & (wait-on dist && ng run stream-chat-angular:test)",
2029
"test:ci": "ng run stream-chat-angular:test --browsers ChromeHeadlessCustom --watch false",
2130
"lint": "ng lint",
@@ -26,10 +35,10 @@
2635
"preanalyze:sample-app": "npm run build:sample-app",
2736
"analyze:sample-app": "webpack-bundle-analyzer dist/sample-app/stats.json",
2837
"copy-css": "rm -rf projects/stream-chat-angular/src/assets/styles && copyfiles --up 5 \"node_modules/@stream-io/stream-chat-css/dist/v2/**/*\" projects/stream-chat-angular/src/assets/styles && copyfiles --up 5 \"node_modules/@stream-io/stream-chat-css/dist/assets/**/*\" projects/stream-chat-angular/src/assets/assets",
29-
"generate-docs": "npm run typedoc:services && npm run typedoc:components && npm run copy-docs:v5",
38+
"generate-docs": "npm run typedoc:services && npm run typedoc:components && npm run copy-docs:v6",
3039
"typedoc:services": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-plugin-reference-excluder --cleanOutputDir true --excludeConstructors true --hideBreadcrumbs true --hideInPageTOC true --excludePrivate true --out temp-service-docs --exclude '!**/*service.ts' --excludeNotDocumented --tsconfig projects/stream-chat-angular/tsconfig.lib.json projects/stream-chat-angular/src/public-api.ts",
3140
"typedoc:components": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-plugin-reference-excluder --cleanOutputDir true --excludeConstructors true --sort source-order --hideBreadcrumbs true --hideInPageTOC true --excludePrivate true --excludeNotDocumented --out temp-component-docs --exclude '!**/*component.ts' --tsconfig projects/stream-chat-angular/tsconfig.lib.json projects/stream-chat-angular/src/public-api.ts",
32-
"copy-docs:v5": "ts-node copy-generated-service-docs.ts ../docs/data/docs/chat-sdk/angular/v5-latest/06-services & (ts-node remove-generated-component-docs-content ../docs/data/docs/chat-sdk/angular/v5-latest/05-components && ts-node copy-generated-component-docs.ts ../docs/data/docs/chat-sdk/angular/v5-latest/05-components)"
41+
"copy-docs:v6": "ts-node copy-generated-service-docs.ts ../docs/data/docs/chat-sdk/angular/06-services & (ts-node remove-generated-component-docs-content ../docs/data/docs/chat-sdk/angular/05-components && ts-node copy-generated-component-docs.ts ../docs/data/docs/chat-sdk/angular/05-components)"
3342
},
3443
"lint-staged": {
3544
"**/*": [
@@ -41,19 +50,9 @@
4150
"branches": [
4251
"master",
4352
{
44-
"name": "test-update",
45-
"prerelease": true,
46-
"channel": "beta"
47-
},
48-
{
49-
"name": "fix-voice-recording",
50-
"prerelease": true,
51-
"channel": "beta"
52-
},
53-
{
54-
"name": "5.x.x-beta",
55-
"prerelease": true,
56-
"channel": "beta"
53+
"name": "6.x.x-rc",
54+
"prerelease": "rc",
55+
"channel": "rc"
5756
}
5857
],
5958
"dryRun": false,
@@ -125,10 +124,12 @@
125124
"emoji-regex": "^10.3.0",
126125
"fix-webm-duration": "^1.0.6",
127126
"ngx-float-ui": "^15.0.0",
127+
"npm-watch": "^0.13.0",
128128
"pretty-bytes": "^6.1.1",
129+
"replace": "^1.2.2",
129130
"rxjs": "~7.4.0",
130131
"starwars-names": "^1.6.0",
131-
"stream-chat": "^8.60.0",
132+
"stream-chat": "9.0.0",
132133
"ts-node": "^10.9.2",
133134
"tslib": "^2.3.0",
134135
"uuid": "^9.0.1",

projects/customizations-example/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
let-latestMessageText="latestMessageText"
257257
let-latestMessage="latestMessage"
258258
>
259-
<div>Channel title: {{ channel.title }}</div>
259+
<div>Channel title: {{ channel.name }}</div>
260260
<div>Display title: {{ channelDisplayTitle }}</div>
261261
<div>Unread count: {{ unreadCount }}</div>
262262
<div>Latest message text: {{ latestMessageText }}</div>

projects/customizations-example/src/app/message-action/message-action.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, Input } from '@angular/core';
22
import {
3-
DefaultStreamChatGenerics,
43
MessageActionHandlerExtraParams,
54
StreamMessage,
65
} from 'stream-chat-angular';
@@ -13,9 +12,9 @@ import {
1312
export class MessageActionComponent {
1413
@Input() actionName!: 'quote' | 'pin' | 'flag' | 'edit' | 'delete';
1514
@Input() actionLabelOrTranslationKey!:
16-
| ((m: StreamMessage<DefaultStreamChatGenerics>) => string)
15+
| ((m: StreamMessage) => string)
1716
| string;
18-
@Input() message!: StreamMessage<DefaultStreamChatGenerics>;
17+
@Input() message!: StreamMessage;
1918
@Input() extraParams!: MessageActionHandlerExtraParams;
2019
@Input() actionHandler!: (
2120
message: StreamMessage,
@@ -36,9 +35,7 @@ export class MessageActionComponent {
3635
}
3736

3837
getActionLabel(
39-
actionLabelOrTranslationKey:
40-
| ((m: StreamMessage<DefaultStreamChatGenerics>) => string)
41-
| string
38+
actionLabelOrTranslationKey: ((m: StreamMessage) => string) | string
4239
) {
4340
return typeof actionLabelOrTranslationKey === 'string'
4441
? actionLabelOrTranslationKey

projects/customizations-example/src/app/message-text/message-text.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import { Component, Input } from '@angular/core';
2-
import { MessageResponseBase } from 'stream-chat';
3-
import { DefaultStreamChatGenerics, StreamMessage } from 'stream-chat-angular';
2+
import { StreamMessage } from 'stream-chat-angular';
43

54
@Component({
65
selector: 'app-message-text',
76
templateUrl: './message-text.component.html',
87
styleUrls: ['./message-text.component.scss'],
98
})
109
export class MessageTextComponent {
11-
@Input() message:
12-
| StreamMessage<DefaultStreamChatGenerics>
13-
| undefined
14-
| MessageResponseBase<DefaultStreamChatGenerics>;
10+
@Input() message: StreamMessage | undefined | StreamMessage['quoted_message'];
1511
@Input() isQuoted: boolean = false;
1612
@Input() shouldTranslate: boolean = false;
1713
isExpanded = false;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { DefaultAttachmentData, DefaultChannelData } from 'stream-chat-angular';
2+
3+
declare module 'stream-chat' {
4+
interface CustomChannelData extends DefaultChannelData {}
5+
6+
interface CustomAttachmentData extends DefaultAttachmentData {}
7+
}

projects/stream-chat-angular/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stream-chat-angular",
3-
"version": "5.14.0",
3+
"version": "6.0.0-rc.8",
44
"description": "Angular components to create chat conversations or livestream style chat",
55
"author": "GetStream",
66
"homepage": "https://getstream.io/chat/",
@@ -20,9 +20,9 @@
2020
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
2121
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
2222
"@breezystack/lamejs": "^1.2.7",
23-
"@ngx-translate/core": "^14.0.0 || ^15.0.0",
23+
"@ngx-translate/core": "^14.0.0 || ^15.0.0 || ^16.0.0",
2424
"rxjs": "^7.4.0",
25-
"stream-chat": "^8.60.0"
25+
"stream-chat": "^9.0.0"
2626
},
2727
"peerDependenciesMeta": {
2828
"@breezystack/lamejs": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = '5.14.0';
1+
export const version = '6.0.0-rc.8';

projects/stream-chat-angular/src/lib/attachment-configuration.service.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('AttachmentConfigurationService', () => {
7070
const spy = jasmine.createSpy();
7171
service.customImageAttachmentConfigurationHandler = spy;
7272
const attachment: Attachment = {
73-
img_url: 'http://url/to/img',
73+
image_url: 'http://url/to/img',
7474
thumb_url: 'different/url',
7575
};
7676
const htmlElement = {
@@ -88,7 +88,7 @@ describe('AttachmentConfigurationService', () => {
8888

8989
it('should provide the correct configuration for gallery image attachments', () => {
9090
const attachment: Attachment = {
91-
img_url: 'http://url/to/img',
91+
image_url: 'http://url/to/img',
9292
};
9393
const htmlElement = {
9494
'max-width': '300px',
@@ -112,7 +112,7 @@ describe('AttachmentConfigurationService', () => {
112112

113113
it('should provide the correct configuration for image attachments inside the carousel', () => {
114114
const attachment: Attachment = {
115-
img_url: 'http://url/to/img',
115+
image_url: 'http://url/to/img',
116116
};
117117
const htmlElement = {
118118
'max-width': 'none',
@@ -191,7 +191,7 @@ describe('AttachmentConfigurationService', () => {
191191
const spy = jasmine.createSpy();
192192
service.customVideoAttachmentConfigurationHandler = spy;
193193
const attachment: Attachment = {
194-
img_url: 'http://url/to/video',
194+
image_url: 'http://url/to/video',
195195
thumb_url: 'different/url',
196196
};
197197
const htmlElement = {
@@ -348,7 +348,7 @@ describe('AttachmentConfigurationService', () => {
348348

349349
it('should provide integer values for image resize and make sure that each dimension is at least the size restriction', () => {
350350
const attachment = {
351-
img_url: 'http://url/to/img?ow=3534&oh=4417',
351+
image_url: 'http://url/to/img?ow=3534&oh=4417',
352352
};
353353
const htmlElement = {
354354
'max-width': '300px',

projects/stream-chat-angular/src/lib/attachment-configuration.service.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
22
import { Attachment } from 'stream-chat';
33
import {
44
AttachmentConfigration,
5-
DefaultStreamChatGenerics,
65
ImageAttachmentConfiguration,
76
VideoAttachmentConfiguration,
87
} from './types';
@@ -13,35 +12,33 @@ import {
1312
@Injectable({
1413
providedIn: 'root',
1514
})
16-
export class AttachmentConfigurationService<
17-
T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
18-
> {
15+
export class AttachmentConfigurationService {
1916
/**
2017
* A custom handler can be provided to override the default image attachment (images uploaded from files) configuration. By default the SDK uses fixed image height (a size that's known before image is loaded), if you override that with dynamic image height (for example: height: 100%) the scrolling logic inside the message list can break.
2118
*/
2219
customImageAttachmentConfigurationHandler?: (
23-
a: Attachment<T>,
20+
a: Attachment,
2421
type: 'gallery' | 'single' | 'carousel',
2522
containerElement: HTMLElement
2623
) => ImageAttachmentConfiguration;
2724
/**
2825
* A custom handler can be provided to override the default video attachment (videos uploaded from files) configuration. By default the SDK uses fixed height (a size that's known before video is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
2926
*/
3027
customVideoAttachmentConfigurationHandler?: (
31-
a: Attachment<T>,
28+
a: Attachment,
3229
containerElement: HTMLElement
3330
) => VideoAttachmentConfiguration;
3431
/**
3532
* A custom handler can be provided to override the default giphy attachment (GIFs sent with the /giphy command) configuration. By default the SDK uses fixed height (a size that's known before the GIF is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
3633
*/
3734
customGiphyAttachmentConfigurationHandler?: (
38-
a: Attachment<T>
35+
a: Attachment
3936
) => AttachmentConfigration;
4037
/**
4138
* A custom handler can be provided to override the default scraped image attachment (images found in links inside messages) configuration. By default the SDK uses fixed height (a size that's known before image is loaded), if you override that with dynamic height (for example: height: 100%) the scrolling logic inside the message list can break.
4239
*/
4340
customScrapedImageAttachmentConfigurationHandler?: (
44-
a: Attachment<T>
41+
a: Attachment
4542
) => AttachmentConfigration;
4643
/**
4744
* You can turn on/off thumbnail generation for video attachments
@@ -55,7 +52,7 @@ export class AttachmentConfigurationService<
5552
* @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.
5653
*/
5754
getImageAttachmentConfiguration(
58-
attachment: Attachment<T>,
55+
attachment: Attachment,
5956
location: 'gallery' | 'single' | 'carousel',
6057
element: HTMLElement
6158
): ImageAttachmentConfiguration {
@@ -68,10 +65,8 @@ export class AttachmentConfigurationService<
6865
}
6966

7067
const defaultOriginalDimension = 1000000;
71-
const urlString = (attachment.img_url ||
72-
attachment.thumb_url ||
73-
attachment.image_url ||
74-
'') as string;
68+
const urlString =
69+
attachment.img_url || attachment.thumb_url || attachment.image_url || '';
7570
let url: URL;
7671
try {
7772
url = new URL(urlString);
@@ -121,7 +116,7 @@ export class AttachmentConfigurationService<
121116
* @param element The default resizing logics reads the height/max-height and max-width propperties of this element and reduces file size based on the given values. File size reduction is done by Stream's CDN.
122117
*/
123118
getVideoAttachmentConfiguration(
124-
attachment: Attachment<T>,
119+
attachment: Attachment,
125120
element: HTMLElement
126121
): VideoAttachmentConfiguration {
127122
if (this.customVideoAttachmentConfigurationHandler) {
@@ -178,7 +173,7 @@ export class AttachmentConfigurationService<
178173
* @param attachment The attachment to configure
179174
*/
180175
getGiphyAttachmentConfiguration(
181-
attachment: Attachment<T>
176+
attachment: Attachment
182177
): AttachmentConfigration {
183178
if (this.customGiphyAttachmentConfigurationHandler) {
184179
return this.customGiphyAttachmentConfigurationHandler(attachment);
@@ -198,7 +193,7 @@ export class AttachmentConfigurationService<
198193
* @param attachment The attachment to configure
199194
*/
200195
getScrapedImageAttachmentConfiguration(
201-
attachment: Attachment<T>
196+
attachment: Attachment
202197
): AttachmentConfigration {
203198
if (this.customScrapedImageAttachmentConfigurationHandler) {
204199
return this.customScrapedImageAttachmentConfigurationHandler(attachment);

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
isVoiceMessage(attachment)
2222
"
2323
[class.str-chat__message-attachment-with-actions]="
24-
attachment.actions && attachment.actions.length > 0
24+
!isGalleryType(attachment) &&
25+
attachment.actions &&
26+
attachment.actions.length > 0
2527
"
2628
[class.str-chat__message-attachment--svg-image]="isSvg(attachment)"
2729
>
@@ -406,7 +408,13 @@
406408
</div>
407409
</ng-template>
408410
</ng-container>
409-
<ng-container *ngIf="attachment.actions && attachment.actions.length > 0">
411+
<ng-container
412+
*ngIf="
413+
!isGalleryType(attachment) &&
414+
attachment.actions &&
415+
attachment.actions.length > 0
416+
"
417+
>
410418
<ng-container
411419
*ngTemplateOutlet="
412420
(customTemplatesService.attachmentActionsTemplate$ | async) ||

0 commit comments

Comments
 (0)