@cloudflare/realtimekit-ui 1.1.0-staging.7 → 1.1.0-staging.9
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.js +1 -1
- package/dist/cjs/rtk-avatar_24.cjs.entry.js +130 -87
- package/dist/collection/components/rtk-chat/rtk-chat.js +16 -2
- package/dist/collection/components/rtk-chat-messages-ui-paginated/rtk-chat-messages-ui-paginated.js +35 -15
- package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.js +104 -75
- package/dist/components/{p-1d16490e.js → p-b64798ac.js} +18 -4
- package/dist/components/{p-7be71567.js → p-c0db1a83.js} +16 -16
- package/dist/components/{p-7f8d9afc.js → p-fbc02b1f.js} +99 -70
- package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
- package/dist/components/rtk-chat-search-results.js +1 -1
- package/dist/components/rtk-chat.js +1 -1
- package/dist/components/rtk-meeting.js +3 -3
- package/dist/components/rtk-paginated-list.js +1 -1
- package/dist/docs/docs-components.json +29 -9
- package/dist/esm/loader.js +130 -87
- package/dist/esm/rtk-avatar_24.entry.js +130 -87
- package/dist/realtimekit-ui/p-ea21ec0c.entry.js +1 -0
- package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
- package/dist/types/components/rtk-chat/rtk-chat.d.ts +1 -0
- package/dist/types/components/rtk-chat-messages-ui-paginated/rtk-chat-messages-ui-paginated.d.ts +2 -0
- package/dist/types/components/rtk-paginated-list/rtk-paginated-list.d.ts +4 -4
- package/dist/types/components.d.ts +8 -3
- package/package.json +1 -1
- package/dist/realtimekit-ui/p-25c13ff8.entry.js +0 -1
package/dist/esm/loader.js
CHANGED
|
@@ -11045,6 +11045,13 @@ const RtkChat = class {
|
|
|
11045
11045
|
const message = event.detail;
|
|
11046
11046
|
this.meeting.chat.deleteMessage(message.id);
|
|
11047
11047
|
};
|
|
11048
|
+
this.onMessageEdit = (event) => {
|
|
11049
|
+
const message = event.detail;
|
|
11050
|
+
if (message.type !== 'text')
|
|
11051
|
+
return;
|
|
11052
|
+
this.replyMessage = null;
|
|
11053
|
+
this.editingMessage = message;
|
|
11054
|
+
};
|
|
11048
11055
|
this.getPrivateChatRecipients = () => {
|
|
11049
11056
|
const participants = this.getFilteredParticipants().map((participant) => {
|
|
11050
11057
|
const key = generateChatGroupKey([participant.userId, this.meeting.self.userId]);
|
|
@@ -11229,14 +11236,21 @@ const RtkChat = class {
|
|
|
11229
11236
|
const uiProps = { iconPack: this.iconPack, t: this.t, size: this.size };
|
|
11230
11237
|
const message = this.editingMessage ? this.editingMessage.message : '';
|
|
11231
11238
|
const quotedMessage = this.replyMessage ? this.replyMessage.message : '';
|
|
11232
|
-
|
|
11239
|
+
const draftStorageKey = this.selectedChannelId
|
|
11240
|
+
? `rtk-chat-draft-${this.selectedChannelId}`
|
|
11241
|
+
: 'rtk-chat-draft';
|
|
11242
|
+
const editStorageKey = this.editingMessage
|
|
11243
|
+
? `rtk-chat-edit-${(_a = this.selectedChannelId) !== null && _a !== void 0 ? _a : 'no-channel'}-${this.editingMessage.id}`
|
|
11244
|
+
: 'rtk-chat-edit';
|
|
11245
|
+
const storageKey = this.editingMessage ? editStorageKey : draftStorageKey;
|
|
11246
|
+
return (h("rtk-chat-composer-view", Object.assign({ message: message, storageKey: storageKey, quotedMessage: quotedMessage, isEditing: !!this.editingMessage, canSendTextMessage: this.isTextMessagingAllowed(), canSendFiles: this.isFileMessagingAllowed(), disableEmojiPicker: this.overrides.disableEmojiPicker, maxLength: this.meeting.chat.maxTextLimit, rateLimits: this.meeting.chat.rateLimits, inputTextPlaceholder: this.t('chat.message_placeholder'), onNewMessage: this.onNewMessageHandler, onEditMessage: this.onEditMessageHandler, onEditCancel: this.onEditCancel, onQuotedMessageDismiss: this.onQuotedMessageDismiss }, uiProps), h("slot", { name: "chat-addon", slot: "chat-addon" })));
|
|
11233
11247
|
}
|
|
11234
11248
|
render() {
|
|
11235
11249
|
var _a;
|
|
11236
11250
|
if (!this.meeting) {
|
|
11237
11251
|
return null;
|
|
11238
11252
|
}
|
|
11239
|
-
return (h(Host, null, h("div", { class: "chat-container" }, h("div", { class: "chat" }, this.isFileMessagingAllowed() && (h("div", { id: "dropzone", class: { active: this.dropzoneActivated }, part: "dropzone" }, h("rtk-icon", { icon: this.iconPack.attach }), h("p", null, this.t('chat.send_attachment')))), this.renderPinnedMessagesHeader(), this.isPrivateChatSupported() && (h("rtk-channel-selector-view", { channels: this.getPrivateChatRecipients(), selectedChannelId: ((_a = this.selectedParticipant) === null || _a === void 0 ? void 0 : _a.userId) || 'everyone', onChannelChange: this.updateRecipients, t: this.t, viewAs: "dropdown" })), h("rtk-chat-messages-ui-paginated", { meeting: this.meeting, onPinMessage: this.onPinMessage, onDeleteMessage: this.onDeleteMessage, size: this.size, iconPack: this.iconPack, t: this.t }), this.renderComposerUI()))));
|
|
11253
|
+
return (h(Host, null, h("div", { class: "chat-container" }, h("div", { class: "chat" }, this.isFileMessagingAllowed() && (h("div", { id: "dropzone", class: { active: this.dropzoneActivated }, part: "dropzone" }, h("rtk-icon", { icon: this.iconPack.attach }), h("p", null, this.t('chat.send_attachment')))), this.renderPinnedMessagesHeader(), this.isPrivateChatSupported() && (h("rtk-channel-selector-view", { channels: this.getPrivateChatRecipients(), selectedChannelId: ((_a = this.selectedParticipant) === null || _a === void 0 ? void 0 : _a.userId) || 'everyone', onChannelChange: this.updateRecipients, t: this.t, viewAs: "dropdown" })), h("rtk-chat-messages-ui-paginated", { meeting: this.meeting, onPinMessage: this.onPinMessage, onEditMessage: this.onMessageEdit, onDeleteMessage: this.onDeleteMessage, size: this.size, iconPack: this.iconPack, t: this.t }), this.renderComposerUI()))));
|
|
11240
11254
|
}
|
|
11241
11255
|
get host() { return getElement(this); }
|
|
11242
11256
|
static get watchers() { return {
|
|
@@ -11479,6 +11493,7 @@ const RtkChatMessagesUiPaginated = class {
|
|
|
11479
11493
|
registerInstance(this, hostRef);
|
|
11480
11494
|
this.editMessageInit = createEvent(this, "editMessageInit", 7);
|
|
11481
11495
|
this.onPinMessage = createEvent(this, "pinMessage", 7);
|
|
11496
|
+
this.onEditMessage = createEvent(this, "editMessage", 7);
|
|
11482
11497
|
this.onDeleteMessage = createEvent(this, "deleteMessage", 7);
|
|
11483
11498
|
this.stateUpdate = createEvent(this, "rtkStateUpdate", 7);
|
|
11484
11499
|
/** Icon pack */
|
|
@@ -11529,22 +11544,18 @@ const RtkChatMessagesUiPaginated = class {
|
|
|
11529
11544
|
};
|
|
11530
11545
|
this.getMessageActions = (message) => {
|
|
11531
11546
|
const actions = [];
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
const canDelete = message.userId === this.meeting.self.userId;
|
|
11540
|
-
if (this.meeting.self.permissions.pinParticipant) {
|
|
11547
|
+
const messageBelongsToSelf = message.userId === this.meeting.self.userId;
|
|
11548
|
+
actions.push({
|
|
11549
|
+
id: 'pin_message',
|
|
11550
|
+
label: message.pinned ? this.t('unpin') : this.t('pin'),
|
|
11551
|
+
icon: this.iconPack.pin,
|
|
11552
|
+
});
|
|
11553
|
+
if (messageBelongsToSelf) {
|
|
11541
11554
|
actions.push({
|
|
11542
|
-
id: '
|
|
11543
|
-
label:
|
|
11544
|
-
icon: this.iconPack.
|
|
11555
|
+
id: 'edit_message',
|
|
11556
|
+
label: this.t('chat.edit_msg'),
|
|
11557
|
+
icon: this.iconPack.edit,
|
|
11545
11558
|
});
|
|
11546
|
-
}
|
|
11547
|
-
if (canDelete) {
|
|
11548
11559
|
actions.push({
|
|
11549
11560
|
id: 'delete_message',
|
|
11550
11561
|
label: this.t('chat.delete_msg'),
|
|
@@ -11558,6 +11569,9 @@ const RtkChatMessagesUiPaginated = class {
|
|
|
11558
11569
|
case 'pin_message':
|
|
11559
11570
|
this.onPinMessage.emit(message);
|
|
11560
11571
|
break;
|
|
11572
|
+
case 'edit_message':
|
|
11573
|
+
this.onEditMessage.emit(message);
|
|
11574
|
+
break;
|
|
11561
11575
|
case 'delete_message':
|
|
11562
11576
|
this.onDeleteMessage.emit(message);
|
|
11563
11577
|
break;
|
|
@@ -11634,7 +11648,7 @@ const RtkChatMessagesUiPaginated = class {
|
|
|
11634
11648
|
this.lastReadMessageIndex = -1;
|
|
11635
11649
|
}
|
|
11636
11650
|
render() {
|
|
11637
|
-
return (h(Host, { key: '
|
|
11651
|
+
return (h(Host, { key: '55b594d1fad2c164a70b71e297f63273ece0bc4f' }, h("rtk-paginated-list", { key: '1554ee896643feec72a02672f156f95c988813ce', ref: (el) => (this.$paginatedListRef = el), pageSize: this.pageSize, pagesAllowed: 3, fetchData: this.getChatMessages, createNodes: this.createChatNodes, selectedItemId: this.selectedChannelId, emptyListLabel: this.t('chat.empty_channel') }, h("slot", { key: '03aeb2069b87cb217b9759cabd3835c9bac81f11' }))));
|
|
11638
11652
|
}
|
|
11639
11653
|
get host() { return getElement(this); }
|
|
11640
11654
|
static get watchers() { return {
|
|
@@ -12657,12 +12671,18 @@ const RtkPaginatedList = class {
|
|
|
12657
12671
|
* @param {DataNode} node - The data node to add to the beginning of the list
|
|
12658
12672
|
*/
|
|
12659
12673
|
async onNewNode(node) {
|
|
12660
|
-
// if there are no pages,
|
|
12674
|
+
// if there are no pages, append to the first page
|
|
12661
12675
|
if (this.pages.length < 1) {
|
|
12662
|
-
this.oldTS = node.timeMs
|
|
12663
|
-
this.
|
|
12676
|
+
this.oldTS = node.timeMs;
|
|
12677
|
+
this.pages.unshift([node]);
|
|
12678
|
+
this.newTS = node.timeMs;
|
|
12679
|
+
this.maxTS = node.timeMs;
|
|
12680
|
+
this.rerender();
|
|
12681
|
+
if (this.autoScroll)
|
|
12682
|
+
this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
|
|
12664
12683
|
}
|
|
12665
|
-
else {
|
|
12684
|
+
else if (this.maxTS === this.newTS) {
|
|
12685
|
+
this.maxTS = node.timeMs;
|
|
12666
12686
|
// append messages to the page if page has not reached full capacity
|
|
12667
12687
|
if (this.pages[0].length < this.pageSize) {
|
|
12668
12688
|
this.pages[0].unshift(node);
|
|
@@ -12671,14 +12691,25 @@ const RtkPaginatedList = class {
|
|
|
12671
12691
|
}
|
|
12672
12692
|
else {
|
|
12673
12693
|
// if page is at full capacity, load next page
|
|
12674
|
-
this.
|
|
12694
|
+
this.pages.unshift([node]);
|
|
12695
|
+
this.newTS = node.timeMs;
|
|
12696
|
+
// remove pages if out of bounds
|
|
12697
|
+
if (this.pages.length > this.pagesAllowed)
|
|
12698
|
+
this.pages.pop();
|
|
12699
|
+
// update timestamps
|
|
12700
|
+
const lastPage = this.pages[this.pages.length - 1];
|
|
12701
|
+
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
12702
|
+
this.newTS = this.pages[0][0].timeMs;
|
|
12703
|
+
this.rerender();
|
|
12675
12704
|
}
|
|
12705
|
+
if (this.autoScroll)
|
|
12706
|
+
this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
|
|
12676
12707
|
}
|
|
12677
|
-
|
|
12678
|
-
|
|
12679
|
-
|
|
12680
|
-
this.scrollToBottom();
|
|
12708
|
+
else {
|
|
12709
|
+
if (this.autoScroll)
|
|
12710
|
+
this.scrollToBottom();
|
|
12681
12711
|
}
|
|
12712
|
+
this.pendingScrollAnchor = null;
|
|
12682
12713
|
}
|
|
12683
12714
|
/**
|
|
12684
12715
|
* Deletes a node anywhere from the list
|
|
@@ -12686,7 +12717,6 @@ const RtkPaginatedList = class {
|
|
|
12686
12717
|
* */
|
|
12687
12718
|
async onNodeDelete(id) {
|
|
12688
12719
|
var _a, _b;
|
|
12689
|
-
let didDelete = false;
|
|
12690
12720
|
for (let i = this.pages.length - 1; i >= 0; i--) {
|
|
12691
12721
|
const index = this.pages[i].findIndex((node) => node.id === id);
|
|
12692
12722
|
// if message not found, move on
|
|
@@ -12697,24 +12727,35 @@ const RtkPaginatedList = class {
|
|
|
12697
12727
|
// if page is empty, delete it
|
|
12698
12728
|
if (this.pages[i].length === 0)
|
|
12699
12729
|
this.pages.splice(i, 1);
|
|
12700
|
-
|
|
12730
|
+
// update timestamps
|
|
12731
|
+
const firstPage = this.pages[0];
|
|
12732
|
+
const lastPage = this.pages[this.pages.length - 1];
|
|
12733
|
+
this.newTS = (_a = firstPage === null || firstPage === void 0 ? void 0 : firstPage[0]) === null || _a === void 0 ? void 0 : _a.timeMs;
|
|
12734
|
+
this.oldTS = (_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage[lastPage.length - 1]) === null || _b === void 0 ? void 0 : _b.timeMs;
|
|
12735
|
+
// if I have deleted the latest message, update maxTS
|
|
12736
|
+
if (index === 0 && i === 0)
|
|
12737
|
+
this.maxTS = this.newTS;
|
|
12738
|
+
this.rerender();
|
|
12701
12739
|
break;
|
|
12702
12740
|
}
|
|
12703
|
-
if (!didDelete)
|
|
12704
|
-
return;
|
|
12705
|
-
// update timestamps
|
|
12706
|
-
const firstPage = this.pages[0];
|
|
12707
|
-
const lastPage = this.pages[this.pages.length - 1];
|
|
12708
|
-
this.newTS = (_a = firstPage === null || firstPage === void 0 ? void 0 : firstPage[0]) === null || _a === void 0 ? void 0 : _a.timeMs;
|
|
12709
|
-
this.oldTS = (_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage[lastPage.length - 1]) === null || _b === void 0 ? void 0 : _b.timeMs;
|
|
12710
|
-
this.rerender();
|
|
12711
12741
|
}
|
|
12712
12742
|
/**
|
|
12713
12743
|
* Updates a new node anywhere in the list
|
|
12714
|
-
* @param {string}
|
|
12715
|
-
* @param {DataNode}
|
|
12744
|
+
* @param {string} id - The id of the node to update
|
|
12745
|
+
* @param {DataNode} node - The updated data node
|
|
12716
12746
|
* */
|
|
12717
|
-
async onNodeUpdate(
|
|
12747
|
+
async onNodeUpdate(id, node) {
|
|
12748
|
+
for (let i = this.pages.length - 1; i >= 0; i--) {
|
|
12749
|
+
const index = this.pages[i].findIndex((node) => node.id === id);
|
|
12750
|
+
// if message not found, move on
|
|
12751
|
+
if (index === -1)
|
|
12752
|
+
continue;
|
|
12753
|
+
// edit message
|
|
12754
|
+
this.pages[i][index] = node;
|
|
12755
|
+
this.rerender();
|
|
12756
|
+
break;
|
|
12757
|
+
}
|
|
12758
|
+
}
|
|
12718
12759
|
connectedCallback() {
|
|
12719
12760
|
this.rerender = debounce$1(this.rerender.bind(this), 50, { maxWait: 200 });
|
|
12720
12761
|
}
|
|
@@ -12723,6 +12764,10 @@ const RtkPaginatedList = class {
|
|
|
12723
12764
|
this.loadPrevPage();
|
|
12724
12765
|
if (this.$containerRef) {
|
|
12725
12766
|
this.$containerRef.onscrollend = async () => {
|
|
12767
|
+
// do not do anything if we are scrolling to bottom
|
|
12768
|
+
if (this.shouldScrollToBottom)
|
|
12769
|
+
return;
|
|
12770
|
+
// handle top and bottom scroll
|
|
12726
12771
|
if (this.isInView(this.$bottomRef)) {
|
|
12727
12772
|
await this.loadNextPage();
|
|
12728
12773
|
}
|
|
@@ -12765,6 +12810,8 @@ const RtkPaginatedList = class {
|
|
|
12765
12810
|
const lastPage = this.pages[this.pages.length - 1];
|
|
12766
12811
|
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
12767
12812
|
this.newTS = this.pages[0][0].timeMs;
|
|
12813
|
+
if (!this.maxTS)
|
|
12814
|
+
this.maxTS = this.newTS;
|
|
12768
12815
|
this.rerender();
|
|
12769
12816
|
// fix scroll position
|
|
12770
12817
|
if (scrollAnchor)
|
|
@@ -12772,53 +12819,47 @@ const RtkPaginatedList = class {
|
|
|
12772
12819
|
}
|
|
12773
12820
|
async loadNextPage() {
|
|
12774
12821
|
if (this.isLoading)
|
|
12775
|
-
return;
|
|
12822
|
+
return [];
|
|
12776
12823
|
// Do nothing. New timestamp needs to be assigned by loadPrevPage method
|
|
12777
12824
|
if (!this.newTS) {
|
|
12778
12825
|
this.showNewMessagesCTR = false;
|
|
12779
|
-
|
|
12780
|
-
return;
|
|
12826
|
+
return [];
|
|
12781
12827
|
}
|
|
12782
|
-
// for autoscroll or scroll to bottom button
|
|
12783
|
-
const maxAutoLoads = 200;
|
|
12784
|
-
let loads = 0;
|
|
12785
|
-
let prevNewTS = this.newTS;
|
|
12786
12828
|
this.isLoading = true;
|
|
12787
12829
|
this.isLoadingBottom = true;
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
break;
|
|
12798
|
-
}
|
|
12799
|
-
// load new messages and append to the start
|
|
12800
|
-
this.pages.unshift(data.reverse());
|
|
12801
|
-
// remove pages if out of bounds
|
|
12802
|
-
if (this.pages.length > this.pagesAllowed)
|
|
12803
|
-
this.pages.pop();
|
|
12804
|
-
// update timestamps
|
|
12805
|
-
const lastPage = this.pages[this.pages.length - 1];
|
|
12806
|
-
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
12807
|
-
this.newTS = this.pages[0][0].timeMs;
|
|
12808
|
-
this.rerender();
|
|
12809
|
-
this.pendingScrollAnchor = scrollAnchor;
|
|
12810
|
-
if (!this.shouldScrollToBottom)
|
|
12811
|
-
break;
|
|
12812
|
-
// if should scroll to bottom then retrigger
|
|
12813
|
-
await this.waitForNextFrame();
|
|
12814
|
-
this.scrollToBottom();
|
|
12815
|
-
await this.waitForNextFrame();
|
|
12816
|
-
// if no new messages, break
|
|
12817
|
-
if (this.newTS === prevNewTS)
|
|
12818
|
-
break;
|
|
12819
|
-
prevNewTS = this.newTS;
|
|
12820
|
-
loads++;
|
|
12830
|
+
const scrollAnchor = this.getScrollAnchor('bottom');
|
|
12831
|
+
const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
|
|
12832
|
+
this.isLoading = false;
|
|
12833
|
+
this.isLoadingBottom = false;
|
|
12834
|
+
// no more new messages to load
|
|
12835
|
+
if (!data.length) {
|
|
12836
|
+
this.maxTS = this.newTS;
|
|
12837
|
+
this.showNewMessagesCTR = false;
|
|
12838
|
+
return [];
|
|
12821
12839
|
}
|
|
12840
|
+
// load new messages and append to the start
|
|
12841
|
+
const incoming = [...data].reverse();
|
|
12842
|
+
if (this.pages.length === 0)
|
|
12843
|
+
this.pages.unshift([]);
|
|
12844
|
+
const firstPage = this.pages[0];
|
|
12845
|
+
const spaceInFirstPage = this.pageSize - firstPage.length;
|
|
12846
|
+
if (spaceInFirstPage > 0) {
|
|
12847
|
+
const toFill = incoming.splice(0, spaceInFirstPage);
|
|
12848
|
+
firstPage.unshift(...toFill);
|
|
12849
|
+
}
|
|
12850
|
+
while (incoming.length > 0) {
|
|
12851
|
+
this.pages.unshift(incoming.splice(0, this.pageSize));
|
|
12852
|
+
}
|
|
12853
|
+
// remove pages if out of bounds
|
|
12854
|
+
if (this.pages.length > this.pagesAllowed)
|
|
12855
|
+
this.pages.pop();
|
|
12856
|
+
// update timestamps
|
|
12857
|
+
const lastPage = this.pages[this.pages.length - 1];
|
|
12858
|
+
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
12859
|
+
this.newTS = this.pages[0][0].timeMs;
|
|
12860
|
+
this.rerender();
|
|
12861
|
+
this.pendingScrollAnchor = scrollAnchor;
|
|
12862
|
+
return data;
|
|
12822
12863
|
}
|
|
12823
12864
|
// Find the element that is closest to the top/bottom of the container
|
|
12824
12865
|
getScrollAnchor(edge = 'top') {
|
|
@@ -12874,11 +12915,14 @@ const RtkPaginatedList = class {
|
|
|
12874
12915
|
}
|
|
12875
12916
|
}
|
|
12876
12917
|
// this method is called recursively based on shouldScrollToBottom (see loadNextPage)
|
|
12877
|
-
scrollToBottom() {
|
|
12878
|
-
this
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12918
|
+
async scrollToBottom() {
|
|
12919
|
+
this.shouldScrollToBottom = true;
|
|
12920
|
+
while (this.shouldScrollToBottom) {
|
|
12921
|
+
const response = await this.loadNextPage();
|
|
12922
|
+
this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
|
|
12923
|
+
if (response.length === 0)
|
|
12924
|
+
this.shouldScrollToBottom = false;
|
|
12925
|
+
}
|
|
12882
12926
|
}
|
|
12883
12927
|
rerender() {
|
|
12884
12928
|
this.rerenderBoolean = !this.rerenderBoolean;
|
|
@@ -12887,10 +12931,9 @@ const RtkPaginatedList = class {
|
|
|
12887
12931
|
/**
|
|
12888
12932
|
* div.container is flex=column-reversewhich is why div#bottom-scroll comes before div#top-scroll
|
|
12889
12933
|
*/
|
|
12890
|
-
return (h(Host, { key: '
|
|
12891
|
-
this.shouldScrollToBottom = true;
|
|
12934
|
+
return (h(Host, { key: '3e7a77a4254ea0c75513edeaf72a5a77cee0e913' }, h("div", { key: 'f61e72e7a447048fe17ed8321a077841f991bfc5', class: "scrollbar container", part: "container", ref: (el) => (this.$containerRef = el) }, h("div", { key: '9efd0543b48b5ad5e147a763d258f7ef1a5024c5', class: { 'show-new-messages-ctr': true, active: this.showNewMessagesCTR } }, h("rtk-button", { key: '4b9bfda38538ceb89f31f317ddcb15d24f75ae8e', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => {
|
|
12892
12935
|
this.scrollToBottom();
|
|
12893
|
-
} }, h("rtk-icon", { key: '
|
|
12936
|
+
} }, h("rtk-icon", { key: 'fbcbc895940c8046916a2382806fb403e83a0a53', icon: this.iconPack.chevron_down }))), h("div", { key: 'fe2e51385216cba1905c75db783f037953e4831e', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && this.pages.length > 0 && h("rtk-spinner", { key: '548899e797bbf139526208df3c7696b5859cc884', size: "sm" }), this.isLoading && this.pages.length < 1 && h("rtk-spinner", { key: '6353d5970e284369c274c28fc3c774d03fd555cc', size: "lg" }), !this.isLoading && this.pages.flat().length === 0 ? (h("div", { class: "empty-list" }, this.t('list.empty'))) : (h("div", { class: "page-wrapper" }, this.pages.map((page, pageIndex) => (h("div", { class: "page", "data-page-index": pageIndex }, this.createNodes([...page].reverse())))))), this.isLoadingTop && this.pages.length > 0 && h("rtk-spinner", { key: 'ff7b4e80f27610c0b73b63ea32fa5331b0cf4630', size: "sm" }), h("div", { key: '8729bf082cde39f7b154fa5816a70b6fb2c7f7df', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
|
|
12894
12937
|
}
|
|
12895
12938
|
};
|
|
12896
12939
|
__decorate$2$8([
|