@progress/kendo-angular-conversational-ui 24.0.0-develop.16 → 24.0.0-develop.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -467,6 +467,8 @@ export declare class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
467
467
  private _cachedContextMenuActions;
468
468
  private _lastContextMenuActionsReference;
469
469
  private _previousMessagesLength;
470
+ private _previousLastMessageId;
471
+ private _hasProcessedMessages;
470
472
  private _pendingScrollAction;
471
473
  private _scrollHandledBeforePaint;
472
474
  private _lastNewMessageId;
@@ -215,8 +215,8 @@ const packageMetadata = {
215
215
  productName: 'Kendo UI for Angular',
216
216
  productCode: 'KENDOUIANGULAR',
217
217
  productCodes: ['KENDOUIANGULAR'],
218
- publishDate: 1777884265,
219
- version: '24.0.0-develop.16',
218
+ publishDate: 1777970062,
219
+ version: '24.0.0-develop.18',
220
220
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
221
221
  };
222
222
 
@@ -3050,7 +3050,7 @@ class ScrollAnchorDirective {
3050
3050
  const bottomScrollTop = Math.max(0, container.scrollHeight - container.clientHeight);
3051
3051
  const finalScrollTop = Math.min(targetScrollTop, bottomScrollTop);
3052
3052
  if (finalScrollTop > container.scrollTop) {
3053
- container.scrollTo({ top: finalScrollTop, behavior: 'smooth' });
3053
+ container.scrollTo({ top: finalScrollTop, behavior: this._endlessMode ? 'auto' : 'smooth' });
3054
3054
  }
3055
3055
  this._thresholdScrollCap = targetScrollTop;
3056
3056
  this._streamingFollow = true;
@@ -9473,6 +9473,8 @@ class ChatComponent {
9473
9473
  _cachedContextMenuActions = [];
9474
9474
  _lastContextMenuActionsReference = null;
9475
9475
  _previousMessagesLength = 0;
9476
+ _previousLastMessageId = null;
9477
+ _hasProcessedMessages = false;
9476
9478
  _pendingScrollAction = null;
9477
9479
  _scrollHandledBeforePaint = false;
9478
9480
  _lastNewMessageId = null;
@@ -9675,7 +9677,7 @@ class ChatComponent {
9675
9677
  this.anchor?.recordScrollHeight();
9676
9678
  this.anchor?.setAriaLive('off');
9677
9679
  const reqStart = Math.max(0, this.startIndex - this.pageSize);
9678
- this.loadMore.emit({ startIndex: reqStart, endIndex: this.startIndex });
9680
+ this.loadMore.emit({ startIndex: reqStart, endIndex: this.endIndex });
9679
9681
  return;
9680
9682
  }
9681
9683
  const range = this.endlessState.extendUp();
@@ -9705,7 +9707,7 @@ class ChatComponent {
9705
9707
  this.endlessState.isLoading = true;
9706
9708
  this.anchor?.setAriaLive('off');
9707
9709
  const reqEnd = Math.min(this.total, this.endIndex + this.pageSize);
9708
- this.loadMore.emit({ startIndex: this.endIndex, endIndex: reqEnd });
9710
+ this.loadMore.emit({ startIndex: this.startIndex, endIndex: reqEnd });
9709
9711
  return;
9710
9712
  }
9711
9713
  const range = this.endlessState.extendDown();
@@ -9871,14 +9873,18 @@ class ChatComponent {
9871
9873
  const prevLength = this._previousMessagesLength;
9872
9874
  const hasNoMessages = !messages;
9873
9875
  const hasNoNewMessages = messages && messages.length <= prevLength;
9874
- const isInitialLoad = prevLength === 0;
9875
- if (hasNoMessages || hasNoNewMessages || isInitialLoad) {
9876
+ const isInitialLoad = prevLength === 0 && !this._hasProcessedMessages;
9877
+ const lastMessage = messages?.length > 0 ? messages[messages.length - 1] : null;
9878
+ const currentLastId = lastMessage?.id ?? null;
9879
+ const isLastMessageReplaced = messages?.length === prevLength
9880
+ && currentLastId !== this._previousLastMessageId
9881
+ && this._previousLastMessageId !== null && currentLastId !== null;
9882
+ if (hasNoMessages || (hasNoNewMessages && !isLastMessageReplaced) || isInitialLoad) {
9876
9883
  this._pendingScrollAction = null;
9877
9884
  this._lastNewMessageId = null;
9878
9885
  return;
9879
9886
  }
9880
- const lastMessage = messages[messages.length - 1];
9881
- this._lastNewMessageId = lastMessage?.id ?? null;
9887
+ this._lastNewMessageId = currentLastId;
9882
9888
  const isAuthor = this.isOwnMessage(lastMessage);
9883
9889
  if (isAuthor) {
9884
9890
  this._pendingScrollAction = 'author';
@@ -9890,7 +9896,7 @@ class ChatComponent {
9890
9896
  }
9891
9897
  const distance = this.anchor.getDistanceFromBottom();
9892
9898
  const threshold = this.anchor.getAutoScrollThresholdPx();
9893
- const isNearBottom = distance <= threshold || this.anchor.isFollowingThreshold;
9899
+ const isNearBottom = distance <= Math.max(threshold, scrollButtonThreshold);
9894
9900
  this._pendingScrollAction = isNearBottom ? 'receiver' : null;
9895
9901
  }
9896
9902
  getLastNewMessageElement() {
@@ -9928,7 +9934,10 @@ class ChatComponent {
9928
9934
  }
9929
9935
  handleMessagesChange() {
9930
9936
  if (this.scrollMode !== 'endless') {
9931
- this._previousMessagesLength = this.processedMessages?.length || 0;
9937
+ const msgs = this.processedMessages;
9938
+ this._previousMessagesLength = msgs?.length || 0;
9939
+ this._previousLastMessageId = msgs?.length > 0 ? msgs[msgs.length - 1]?.id ?? null : null;
9940
+ this._hasProcessedMessages = true;
9932
9941
  return;
9933
9942
  }
9934
9943
  const allMessages = this.processedMessages || [];
@@ -9952,6 +9961,8 @@ class ChatComponent {
9952
9961
  this.endlessState.init(allMessages.length, this.pageSize);
9953
9962
  }
9954
9963
  this._previousMessagesLength = allMessages.length;
9964
+ this._previousLastMessageId = allMessages.length > 0 ? allMessages[allMessages.length - 1]?.id ?? null : null;
9965
+ this._hasProcessedMessages = true;
9955
9966
  }
9956
9967
  handleRemoteMessagesChange() {
9957
9968
  const wasLoading = this.endlessState.isLoading;
@@ -9975,7 +9986,7 @@ class ChatComponent {
9975
9986
  }));
9976
9987
  }
9977
9988
  }
9978
- else if (isInitialBatch) {
9989
+ else if (isInitialBatch && !this._pendingScrollAction) {
9979
9990
  this.autoScroll = true;
9980
9991
  this.subs.add(this.zone.onStable.pipe(take(1)).subscribe(() => {
9981
9992
  this.anchor?.scrollToBottom();
@@ -9989,6 +10000,12 @@ class ChatComponent {
9989
10000
  }
9990
10001
  }
9991
10002
  this._previousMessagesLength = currentLength;
10003
+ this._previousLastMessageId = currentLength > 0
10004
+ ? this.processedMessages[currentLength - 1]?.id ?? null
10005
+ : null;
10006
+ if (currentLength > 0) {
10007
+ this._hasProcessedMessages = true;
10008
+ }
9992
10009
  }
9993
10010
  handleRemoteReferencedMessageClick(messageId) {
9994
10011
  const messageEl = this.chatService.messageElementsMap.get(messageId);
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1777884265,
11
- "version": "24.0.0-develop.16",
10
+ "publishDate": 1777970062,
11
+ "version": "24.0.0-develop.18",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-conversational-ui",
3
- "version": "24.0.0-develop.16",
3
+ "version": "24.0.0-develop.18",
4
4
  "description": "Kendo UI for Angular Conversational UI components",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -91,7 +91,7 @@
91
91
  "package": {
92
92
  "productName": "Kendo UI for Angular",
93
93
  "productCode": "KENDOUIANGULAR",
94
- "publishDate": 1777884265,
94
+ "publishDate": 1777970062,
95
95
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
96
96
  }
97
97
  },
@@ -101,22 +101,22 @@
101
101
  "@angular/core": "19 - 21",
102
102
  "@angular/platform-browser": "19 - 21",
103
103
  "@progress/kendo-licensing": "^1.11.0",
104
- "@progress/kendo-angular-buttons": "24.0.0-develop.16",
105
- "@progress/kendo-angular-inputs": "24.0.0-develop.16",
106
- "@progress/kendo-angular-layout": "24.0.0-develop.16",
107
- "@progress/kendo-angular-icons": "24.0.0-develop.16",
108
- "@progress/kendo-angular-common": "24.0.0-develop.16",
109
- "@progress/kendo-angular-intl": "24.0.0-develop.16",
110
- "@progress/kendo-angular-l10n": "24.0.0-develop.16",
111
- "@progress/kendo-angular-menu": "24.0.0-develop.16",
112
- "@progress/kendo-angular-popup": "24.0.0-develop.16",
113
- "@progress/kendo-angular-toolbar": "24.0.0-develop.16",
114
- "@progress/kendo-angular-upload": "24.0.0-develop.16",
104
+ "@progress/kendo-angular-buttons": "24.0.0-develop.18",
105
+ "@progress/kendo-angular-inputs": "24.0.0-develop.18",
106
+ "@progress/kendo-angular-layout": "24.0.0-develop.18",
107
+ "@progress/kendo-angular-icons": "24.0.0-develop.18",
108
+ "@progress/kendo-angular-common": "24.0.0-develop.18",
109
+ "@progress/kendo-angular-intl": "24.0.0-develop.18",
110
+ "@progress/kendo-angular-l10n": "24.0.0-develop.18",
111
+ "@progress/kendo-angular-menu": "24.0.0-develop.18",
112
+ "@progress/kendo-angular-popup": "24.0.0-develop.18",
113
+ "@progress/kendo-angular-toolbar": "24.0.0-develop.18",
114
+ "@progress/kendo-angular-upload": "24.0.0-develop.18",
115
115
  "rxjs": "^6.5.3 || ^7.0.0"
116
116
  },
117
117
  "dependencies": {
118
118
  "tslib": "^2.3.1",
119
- "@progress/kendo-angular-schematics": "24.0.0-develop.16"
119
+ "@progress/kendo-angular-schematics": "24.0.0-develop.18"
120
120
  },
121
121
  "schematics": "./schematics/collection.json",
122
122
  "module": "fesm2022/progress-kendo-angular-conversational-ui.mjs",