@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.
@@ -503,6 +503,13 @@ const RtkChat = class {
503
503
  const message = event.detail;
504
504
  this.meeting.chat.deleteMessage(message.id);
505
505
  };
506
+ this.onMessageEdit = (event) => {
507
+ const message = event.detail;
508
+ if (message.type !== 'text')
509
+ return;
510
+ this.replyMessage = null;
511
+ this.editingMessage = message;
512
+ };
506
513
  this.getPrivateChatRecipients = () => {
507
514
  const participants = this.getFilteredParticipants().map((participant) => {
508
515
  const key = generateChatGroupKey([participant.userId, this.meeting.self.userId]);
@@ -687,14 +694,21 @@ const RtkChat = class {
687
694
  const uiProps = { iconPack: this.iconPack, t: this.t, size: this.size };
688
695
  const message = this.editingMessage ? this.editingMessage.message : '';
689
696
  const quotedMessage = this.replyMessage ? this.replyMessage.message : '';
690
- return (h("rtk-chat-composer-view", Object.assign({ message: message, storageKey: (_a = this.selectedChannelId) !== null && _a !== void 0 ? _a : `draft-${this.selectedChannelId}`, 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" })));
697
+ const draftStorageKey = this.selectedChannelId
698
+ ? `rtk-chat-draft-${this.selectedChannelId}`
699
+ : 'rtk-chat-draft';
700
+ const editStorageKey = this.editingMessage
701
+ ? `rtk-chat-edit-${(_a = this.selectedChannelId) !== null && _a !== void 0 ? _a : 'no-channel'}-${this.editingMessage.id}`
702
+ : 'rtk-chat-edit';
703
+ const storageKey = this.editingMessage ? editStorageKey : draftStorageKey;
704
+ 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" })));
691
705
  }
692
706
  render() {
693
707
  var _a;
694
708
  if (!this.meeting) {
695
709
  return null;
696
710
  }
697
- 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()))));
711
+ 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()))));
698
712
  }
699
713
  get host() { return getElement(this); }
700
714
  static get watchers() { return {
@@ -937,6 +951,7 @@ const RtkChatMessagesUiPaginated = class {
937
951
  registerInstance(this, hostRef);
938
952
  this.editMessageInit = createEvent(this, "editMessageInit", 7);
939
953
  this.onPinMessage = createEvent(this, "pinMessage", 7);
954
+ this.onEditMessage = createEvent(this, "editMessage", 7);
940
955
  this.onDeleteMessage = createEvent(this, "deleteMessage", 7);
941
956
  this.stateUpdate = createEvent(this, "rtkStateUpdate", 7);
942
957
  /** Icon pack */
@@ -987,22 +1002,18 @@ const RtkChatMessagesUiPaginated = class {
987
1002
  };
988
1003
  this.getMessageActions = (message) => {
989
1004
  const actions = [];
990
- // const isSelf = this.meeting.self.userId === message.userId;
991
- // const chatMessagePermissions = this.meeting.self.permissions?.chatMessage;
992
- // const canEdit =
993
- // chatMessagePermissions === undefined
994
- // ? isSelf
995
- // : chatMessagePermissions.canEdit === 'ALL' ||
996
- // (chatMessagePermissions.canEdit === 'SELF' && isSelf);
997
- const canDelete = message.userId === this.meeting.self.userId;
998
- if (this.meeting.self.permissions.pinParticipant) {
1005
+ const messageBelongsToSelf = message.userId === this.meeting.self.userId;
1006
+ actions.push({
1007
+ id: 'pin_message',
1008
+ label: message.pinned ? this.t('unpin') : this.t('pin'),
1009
+ icon: this.iconPack.pin,
1010
+ });
1011
+ if (messageBelongsToSelf) {
999
1012
  actions.push({
1000
- id: 'pin_message',
1001
- label: message.pinned ? this.t('unpin') : this.t('pin'),
1002
- icon: this.iconPack.pin,
1013
+ id: 'edit_message',
1014
+ label: this.t('chat.edit_msg'),
1015
+ icon: this.iconPack.edit,
1003
1016
  });
1004
- }
1005
- if (canDelete) {
1006
1017
  actions.push({
1007
1018
  id: 'delete_message',
1008
1019
  label: this.t('chat.delete_msg'),
@@ -1016,6 +1027,9 @@ const RtkChatMessagesUiPaginated = class {
1016
1027
  case 'pin_message':
1017
1028
  this.onPinMessage.emit(message);
1018
1029
  break;
1030
+ case 'edit_message':
1031
+ this.onEditMessage.emit(message);
1032
+ break;
1019
1033
  case 'delete_message':
1020
1034
  this.onDeleteMessage.emit(message);
1021
1035
  break;
@@ -1092,7 +1106,7 @@ const RtkChatMessagesUiPaginated = class {
1092
1106
  this.lastReadMessageIndex = -1;
1093
1107
  }
1094
1108
  render() {
1095
- return (h(Host, { key: 'c710da6e2fda420146905a2ed75d3444dd6d2c0b' }, h("rtk-paginated-list", { key: '51a36437e38e9c0242cca34bfda39f6d8309bee3', 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: '69b54a41263510b425ce3e39af055321c4e2deb8' }))));
1109
+ 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' }))));
1096
1110
  }
1097
1111
  get host() { return getElement(this); }
1098
1112
  static get watchers() { return {
@@ -2121,12 +2135,18 @@ const RtkPaginatedList = class {
2121
2135
  * @param {DataNode} node - The data node to add to the beginning of the list
2122
2136
  */
2123
2137
  async onNewNode(node) {
2124
- // if there are no pages, load the first page
2138
+ // if there are no pages, append to the first page
2125
2139
  if (this.pages.length < 1) {
2126
- this.oldTS = node.timeMs + 1;
2127
- this.loadPrevPage();
2140
+ this.oldTS = node.timeMs;
2141
+ this.pages.unshift([node]);
2142
+ this.newTS = node.timeMs;
2143
+ this.maxTS = node.timeMs;
2144
+ this.rerender();
2145
+ if (this.autoScroll)
2146
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
2128
2147
  }
2129
- else {
2148
+ else if (this.maxTS === this.newTS) {
2149
+ this.maxTS = node.timeMs;
2130
2150
  // append messages to the page if page has not reached full capacity
2131
2151
  if (this.pages[0].length < this.pageSize) {
2132
2152
  this.pages[0].unshift(node);
@@ -2135,14 +2155,25 @@ const RtkPaginatedList = class {
2135
2155
  }
2136
2156
  else {
2137
2157
  // if page is at full capacity, load next page
2138
- this.loadNextPage();
2158
+ this.pages.unshift([node]);
2159
+ this.newTS = node.timeMs;
2160
+ // remove pages if out of bounds
2161
+ if (this.pages.length > this.pagesAllowed)
2162
+ this.pages.pop();
2163
+ // update timestamps
2164
+ const lastPage = this.pages[this.pages.length - 1];
2165
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
2166
+ this.newTS = this.pages[0][0].timeMs;
2167
+ this.rerender();
2139
2168
  }
2169
+ if (this.autoScroll)
2170
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
2140
2171
  }
2141
- // If autoscroll is enabled, scroll to the bottom
2142
- if (this.autoScroll) {
2143
- this.shouldScrollToBottom = true;
2144
- this.scrollToBottom();
2172
+ else {
2173
+ if (this.autoScroll)
2174
+ this.scrollToBottom();
2145
2175
  }
2176
+ this.pendingScrollAnchor = null;
2146
2177
  }
2147
2178
  /**
2148
2179
  * Deletes a node anywhere from the list
@@ -2150,7 +2181,6 @@ const RtkPaginatedList = class {
2150
2181
  * */
2151
2182
  async onNodeDelete(id) {
2152
2183
  var _a, _b;
2153
- let didDelete = false;
2154
2184
  for (let i = this.pages.length - 1; i >= 0; i--) {
2155
2185
  const index = this.pages[i].findIndex((node) => node.id === id);
2156
2186
  // if message not found, move on
@@ -2161,24 +2191,35 @@ const RtkPaginatedList = class {
2161
2191
  // if page is empty, delete it
2162
2192
  if (this.pages[i].length === 0)
2163
2193
  this.pages.splice(i, 1);
2164
- didDelete = true;
2194
+ // update timestamps
2195
+ const firstPage = this.pages[0];
2196
+ const lastPage = this.pages[this.pages.length - 1];
2197
+ this.newTS = (_a = firstPage === null || firstPage === void 0 ? void 0 : firstPage[0]) === null || _a === void 0 ? void 0 : _a.timeMs;
2198
+ this.oldTS = (_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage[lastPage.length - 1]) === null || _b === void 0 ? void 0 : _b.timeMs;
2199
+ // if I have deleted the latest message, update maxTS
2200
+ if (index === 0 && i === 0)
2201
+ this.maxTS = this.newTS;
2202
+ this.rerender();
2165
2203
  break;
2166
2204
  }
2167
- if (!didDelete)
2168
- return;
2169
- // update timestamps
2170
- const firstPage = this.pages[0];
2171
- const lastPage = this.pages[this.pages.length - 1];
2172
- this.newTS = (_a = firstPage === null || firstPage === void 0 ? void 0 : firstPage[0]) === null || _a === void 0 ? void 0 : _a.timeMs;
2173
- this.oldTS = (_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage[lastPage.length - 1]) === null || _b === void 0 ? void 0 : _b.timeMs;
2174
- this.rerender();
2175
2205
  }
2176
2206
  /**
2177
2207
  * Updates a new node anywhere in the list
2178
- * @param {string} _id - The id of the node to update
2179
- * @param {DataNode} _node - The updated data node
2208
+ * @param {string} id - The id of the node to update
2209
+ * @param {DataNode} node - The updated data node
2180
2210
  * */
2181
- async onNodeUpdate(_id, _node) { }
2211
+ async onNodeUpdate(id, node) {
2212
+ for (let i = this.pages.length - 1; i >= 0; i--) {
2213
+ const index = this.pages[i].findIndex((node) => node.id === id);
2214
+ // if message not found, move on
2215
+ if (index === -1)
2216
+ continue;
2217
+ // edit message
2218
+ this.pages[i][index] = node;
2219
+ this.rerender();
2220
+ break;
2221
+ }
2222
+ }
2182
2223
  connectedCallback() {
2183
2224
  this.rerender = debounce(this.rerender.bind(this), 50, { maxWait: 200 });
2184
2225
  }
@@ -2187,6 +2228,10 @@ const RtkPaginatedList = class {
2187
2228
  this.loadPrevPage();
2188
2229
  if (this.$containerRef) {
2189
2230
  this.$containerRef.onscrollend = async () => {
2231
+ // do not do anything if we are scrolling to bottom
2232
+ if (this.shouldScrollToBottom)
2233
+ return;
2234
+ // handle top and bottom scroll
2190
2235
  if (this.isInView(this.$bottomRef)) {
2191
2236
  await this.loadNextPage();
2192
2237
  }
@@ -2229,6 +2274,8 @@ const RtkPaginatedList = class {
2229
2274
  const lastPage = this.pages[this.pages.length - 1];
2230
2275
  this.oldTS = lastPage[lastPage.length - 1].timeMs;
2231
2276
  this.newTS = this.pages[0][0].timeMs;
2277
+ if (!this.maxTS)
2278
+ this.maxTS = this.newTS;
2232
2279
  this.rerender();
2233
2280
  // fix scroll position
2234
2281
  if (scrollAnchor)
@@ -2236,53 +2283,47 @@ const RtkPaginatedList = class {
2236
2283
  }
2237
2284
  async loadNextPage() {
2238
2285
  if (this.isLoading)
2239
- return;
2286
+ return [];
2240
2287
  // Do nothing. New timestamp needs to be assigned by loadPrevPage method
2241
2288
  if (!this.newTS) {
2242
2289
  this.showNewMessagesCTR = false;
2243
- this.shouldScrollToBottom = false;
2244
- return;
2290
+ return [];
2245
2291
  }
2246
- // for autoscroll or scroll to bottom button
2247
- const maxAutoLoads = 200;
2248
- let loads = 0;
2249
- let prevNewTS = this.newTS;
2250
2292
  this.isLoading = true;
2251
2293
  this.isLoadingBottom = true;
2252
- while (loads < maxAutoLoads) {
2253
- const scrollAnchor = this.getScrollAnchor('bottom');
2254
- const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
2255
- this.isLoading = false;
2256
- this.isLoadingBottom = false;
2257
- // no more new messages to load
2258
- if (!data.length) {
2259
- this.showNewMessagesCTR = false;
2260
- this.shouldScrollToBottom = false;
2261
- break;
2262
- }
2263
- // load new messages and append to the start
2264
- this.pages.unshift(data.reverse());
2265
- // remove pages if out of bounds
2266
- if (this.pages.length > this.pagesAllowed)
2267
- this.pages.pop();
2268
- // update timestamps
2269
- const lastPage = this.pages[this.pages.length - 1];
2270
- this.oldTS = lastPage[lastPage.length - 1].timeMs;
2271
- this.newTS = this.pages[0][0].timeMs;
2272
- this.rerender();
2273
- this.pendingScrollAnchor = scrollAnchor;
2274
- if (!this.shouldScrollToBottom)
2275
- break;
2276
- // if should scroll to bottom then retrigger
2277
- await this.waitForNextFrame();
2278
- this.scrollToBottom();
2279
- await this.waitForNextFrame();
2280
- // if no new messages, break
2281
- if (this.newTS === prevNewTS)
2282
- break;
2283
- prevNewTS = this.newTS;
2284
- loads++;
2294
+ const scrollAnchor = this.getScrollAnchor('bottom');
2295
+ const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
2296
+ this.isLoading = false;
2297
+ this.isLoadingBottom = false;
2298
+ // no more new messages to load
2299
+ if (!data.length) {
2300
+ this.maxTS = this.newTS;
2301
+ this.showNewMessagesCTR = false;
2302
+ return [];
2303
+ }
2304
+ // load new messages and append to the start
2305
+ const incoming = [...data].reverse();
2306
+ if (this.pages.length === 0)
2307
+ this.pages.unshift([]);
2308
+ const firstPage = this.pages[0];
2309
+ const spaceInFirstPage = this.pageSize - firstPage.length;
2310
+ if (spaceInFirstPage > 0) {
2311
+ const toFill = incoming.splice(0, spaceInFirstPage);
2312
+ firstPage.unshift(...toFill);
2313
+ }
2314
+ while (incoming.length > 0) {
2315
+ this.pages.unshift(incoming.splice(0, this.pageSize));
2285
2316
  }
2317
+ // remove pages if out of bounds
2318
+ if (this.pages.length > this.pagesAllowed)
2319
+ this.pages.pop();
2320
+ // update timestamps
2321
+ const lastPage = this.pages[this.pages.length - 1];
2322
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
2323
+ this.newTS = this.pages[0][0].timeMs;
2324
+ this.rerender();
2325
+ this.pendingScrollAnchor = scrollAnchor;
2326
+ return data;
2286
2327
  }
2287
2328
  // Find the element that is closest to the top/bottom of the container
2288
2329
  getScrollAnchor(edge = 'top') {
@@ -2338,11 +2379,14 @@ const RtkPaginatedList = class {
2338
2379
  }
2339
2380
  }
2340
2381
  // this method is called recursively based on shouldScrollToBottom (see loadNextPage)
2341
- scrollToBottom() {
2342
- this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
2343
- }
2344
- waitForNextFrame() {
2345
- return new Promise((resolve) => requestAnimationFrame(() => resolve()));
2382
+ async scrollToBottom() {
2383
+ this.shouldScrollToBottom = true;
2384
+ while (this.shouldScrollToBottom) {
2385
+ const response = await this.loadNextPage();
2386
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
2387
+ if (response.length === 0)
2388
+ this.shouldScrollToBottom = false;
2389
+ }
2346
2390
  }
2347
2391
  rerender() {
2348
2392
  this.rerenderBoolean = !this.rerenderBoolean;
@@ -2351,10 +2395,9 @@ const RtkPaginatedList = class {
2351
2395
  /**
2352
2396
  * div.container is flex=column-reversewhich is why div#bottom-scroll comes before div#top-scroll
2353
2397
  */
2354
- return (h(Host, { key: 'e0f806cccdcba162d0c834476863b34630cb1a1e' }, h("div", { key: '6d54d50ed703a59df8d26399499533e3cb0d70fe', class: "scrollbar container", part: "container", ref: (el) => (this.$containerRef = el) }, h("div", { key: '4e9fcbed725fb55d9fbb67eca94b0e770662d51b', class: { 'show-new-messages-ctr': true, active: this.showNewMessagesCTR } }, h("rtk-button", { key: '7db0236d35db3fb9856fea7a4f62c1fbd421829e', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => {
2355
- this.shouldScrollToBottom = true;
2398
+ 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: () => {
2356
2399
  this.scrollToBottom();
2357
- } }, h("rtk-icon", { key: '6e247e86029560601080e0b4d6dcfccbd90fcdd6', icon: this.iconPack.chevron_down }))), h("div", { key: '01d1ba7eacc67ece70b805fb2dfb493cdf1c9d23', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && this.pages.length > 0 && h("rtk-spinner", { key: '24391bfc34914675cbfd0c287332bfdf3f5f5000', size: "sm" }), this.isLoading && this.pages.length < 1 && h("rtk-spinner", { key: 'e6c2cb44fce52ca54c9f1e543d91a29648745408', 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: 'd90a15494bcd7ec6c9c7ffc5e9a55054252a4258', size: "sm" }), h("div", { key: '2a65f98c3c4e6f2510c6cf1b4e2bcf1e607a7552', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
2400
+ } }, 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) }))));
2358
2401
  }
2359
2402
  };
2360
2403
  __decorate$2([