Skip to content

Commit

Permalink
update CSS version
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Sep 18, 2023
1 parent 0121d3c commit 5b653c9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@popperjs/core": "^2.11.5",
"@stream-io/stream-chat-css": "3.12.0",
"@stream-io/stream-chat-css": "3.14.1",
"@stream-io/transliterate": "^1.5.2",
"angular-mentions": "^1.4.0",
"dayjs": "^1.10.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ export class AutocompleteTextareaComponent
@HostBinding()
get class() {
return `str-chat__textarea str-chat__message-textarea-angular-host ${
(this.value.includes(' ') ||
!this.value.startsWith(this.commandTriggerChar) ||
this.value.lastIndexOf(this.commandTriggerChar) !== 0) &&
this.value.lastIndexOf(this.commandTriggerChar) >
this.value.lastIndexOf(this.mentionTriggerChar)
this.areSlashCommandsHidden
? 'str-chat__message-textarea-angular-host--autocomplete-hidden'
: ''
}`;
Expand Down Expand Up @@ -225,6 +221,12 @@ export class AutocompleteTextareaComponent
item: MentionAutcompleteListItem,
triggerChar = ''
) {
if (
triggerChar === this.commandTriggerChar &&
this.areSlashCommandsHidden
) {
return this.commandTriggerChar;
}
if (triggerChar === this.mentionTriggerChar) {
this.mentionedUsers.push((item.user ? item.user : item) as UserResponse);
this.userMentions.next([...this.mentionedUsers]);
Expand Down Expand Up @@ -254,6 +256,7 @@ export class AutocompleteTextareaComponent
}

enterHit(event: Event) {
console.log(event);

Check failure on line 259 in projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts

View workflow job for this annotation

GitHub Actions / workflow (16.x)

Unexpected console statement
if (this.inputMode === 'desktop') {
event.preventDefault();
this.updateMentionedUsersFromText();
Expand Down Expand Up @@ -318,4 +321,14 @@ export class AutocompleteTextareaComponent
this.mentionedUsers = updatedMentionedUsers;
}
}

private get areSlashCommandsHidden() {
return (
(this.value.includes(' ') ||
!this.value.startsWith(this.commandTriggerChar) ||
this.value.lastIndexOf(this.commandTriggerChar) !== 0) &&
this.value.lastIndexOf(this.commandTriggerChar) >
this.value.lastIndexOf(this.mentionTriggerChar)
);
}
}

0 comments on commit 5b653c9

Please sign in to comment.