@cloudflare/realtimekit-ui 1.1.0-staging.3 → 1.1.0-staging.5

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.
Files changed (394) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/realtimekit-ui.cjs.js +1 -1
  4. package/dist/cjs/rtk-ai-transcriptions.cjs.entry.js +1 -1
  5. package/dist/cjs/rtk-audio-grid.cjs.entry.js +1 -1
  6. package/dist/cjs/rtk-audio-visualizer_4.cjs.entry.js +1 -1
  7. package/dist/cjs/rtk-avatar_24.cjs.entry.js +267 -247
  8. package/dist/cjs/rtk-breakout-room-manager_3.cjs.entry.js +4 -4
  9. package/dist/cjs/rtk-breakout-rooms-manager_9.cjs.entry.js +9 -9
  10. package/dist/cjs/rtk-channel-creator.cjs.entry.js +2 -2
  11. package/dist/cjs/rtk-channel-details.cjs.entry.js +1 -1
  12. package/dist/cjs/rtk-channel-selector-ui.cjs.entry.js +2 -2
  13. package/dist/cjs/rtk-chat-message.cjs.entry.js +2 -2
  14. package/dist/cjs/rtk-chat-messages-ui.cjs.entry.js +3 -3
  15. package/dist/cjs/rtk-chat-search-results.cjs.entry.js +1 -1
  16. package/dist/cjs/rtk-chat-toggle.cjs.entry.js +27 -22
  17. package/dist/cjs/rtk-clock.cjs.entry.js +3 -3
  18. package/dist/cjs/rtk-controlbar.cjs.entry.js +1 -1
  19. package/dist/cjs/rtk-debugger-toggle.cjs.entry.js +1 -1
  20. package/dist/cjs/rtk-file-dropzone.cjs.entry.js +1 -1
  21. package/dist/cjs/rtk-file-message_3.cjs.entry.js +8 -8
  22. package/dist/cjs/rtk-header.cjs.entry.js +1 -1
  23. package/dist/cjs/rtk-idle-screen.cjs.entry.js +1 -1
  24. package/dist/cjs/rtk-image-viewer.cjs.entry.js +1 -1
  25. package/dist/cjs/rtk-information-tooltip.cjs.entry.js +1 -1
  26. package/dist/cjs/rtk-leave-button.cjs.entry.js +1 -1
  27. package/dist/cjs/rtk-message-list-view.cjs.entry.js +3 -3
  28. package/dist/cjs/rtk-more-toggle.cjs.entry.js +2 -2
  29. package/dist/cjs/rtk-name-tag.cjs.entry.js +1 -1
  30. package/dist/cjs/rtk-notification.cjs.entry.js +2 -2
  31. package/dist/cjs/rtk-participant-setup.cjs.entry.js +2 -2
  32. package/dist/cjs/rtk-participant_2.cjs.entry.js +14 -14
  33. package/dist/cjs/rtk-participants-audio.cjs.entry.js +1 -1
  34. package/dist/cjs/rtk-participants-stage-list_4.cjs.entry.js +1 -1
  35. package/dist/cjs/rtk-plugins_2.cjs.entry.js +4 -4
  36. package/dist/cjs/rtk-poll_2.cjs.entry.js +3 -3
  37. package/dist/cjs/rtk-recording-indicator.cjs.entry.js +1 -1
  38. package/dist/cjs/rtk-screenshare-view.cjs.entry.js +5 -5
  39. package/dist/cjs/rtk-settings-toggle.cjs.entry.js +1 -1
  40. package/dist/cjs/rtk-spotlight-grid.cjs.entry.js +2 -2
  41. package/dist/cjs/rtk-stage.cjs.entry.js +1 -1
  42. package/dist/cjs/rtk-transcript.cjs.entry.js +1 -1
  43. package/dist/cjs/rtk-waiting-screen.cjs.entry.js +1 -1
  44. package/dist/collection/components/rtk-ai-transcriptions/rtk-ai-transcriptions.js +1 -1
  45. package/dist/collection/components/rtk-audio-grid/rtk-audio-grid.js +1 -1
  46. package/dist/collection/components/rtk-breakout-room-participants/rtk-breakout-room-participants.js +2 -2
  47. package/dist/collection/components/rtk-broadcast-message-modal/rtk-broadcast-message-modal.js +2 -2
  48. package/dist/collection/components/rtk-channel-creator/rtk-channel-creator.js +2 -2
  49. package/dist/collection/components/rtk-channel-details/rtk-channel-details.js +1 -1
  50. package/dist/collection/components/rtk-channel-selector-ui/rtk-channel-selector-ui.js +2 -2
  51. package/dist/collection/components/rtk-channel-selector-view/rtk-channel-selector-view.css +29 -29
  52. package/dist/collection/components/rtk-channel-selector-view/rtk-channel-selector-view.js +2 -2
  53. package/dist/collection/components/rtk-chat/rtk-chat.css +45 -8
  54. package/dist/collection/components/rtk-chat/rtk-chat.js +15 -7
  55. package/dist/collection/components/rtk-chat-message/rtk-chat-message.js +2 -2
  56. package/dist/collection/components/rtk-chat-messages-ui/rtk-chat-messages-ui.js +3 -3
  57. package/dist/collection/components/rtk-chat-messages-ui-paginated/rtk-chat-messages-ui-paginated.js +3 -3
  58. package/dist/collection/components/rtk-chat-search-results/rtk-chat-search-results.js +1 -1
  59. package/dist/collection/components/rtk-chat-toggle/rtk-chat-toggle.css +1 -1
  60. package/dist/collection/components/rtk-chat-toggle/rtk-chat-toggle.js +27 -26
  61. package/dist/collection/components/rtk-clock/rtk-clock.js +3 -3
  62. package/dist/collection/components/rtk-confirmation-modal/rtk-confirmation-modal.js +1 -1
  63. package/dist/collection/components/rtk-controlbar/rtk-controlbar.js +1 -1
  64. package/dist/collection/components/rtk-counter/rtk-counter.js +2 -2
  65. package/dist/collection/components/rtk-debugger-toggle/rtk-debugger-toggle.js +1 -1
  66. package/dist/collection/components/rtk-draft-attachment-view/rtk-draft-attachment-view.js +1 -1
  67. package/dist/collection/components/rtk-emoji-picker/rtk-emoji-picker.js +1 -1
  68. package/dist/collection/components/rtk-emoji-picker-button/rtk-emoji-picker-button.js +1 -1
  69. package/dist/collection/components/rtk-file-dropzone/rtk-file-dropzone.js +1 -1
  70. package/dist/collection/components/rtk-file-message/rtk-file-message.js +2 -2
  71. package/dist/collection/components/rtk-file-message-view/rtk-file-message-view.js +1 -1
  72. package/dist/collection/components/rtk-file-picker-button/rtk-file-picker-button.js +1 -1
  73. package/dist/collection/components/rtk-header/rtk-header.js +1 -1
  74. package/dist/collection/components/rtk-idle-screen/rtk-idle-screen.js +1 -1
  75. package/dist/collection/components/rtk-image-message/rtk-image-message.js +4 -4
  76. package/dist/collection/components/rtk-image-message-view/rtk-image-message-view.js +3 -3
  77. package/dist/collection/components/rtk-image-viewer/rtk-image-viewer.js +1 -1
  78. package/dist/collection/components/rtk-information-tooltip/rtk-information-tooltip.js +1 -1
  79. package/dist/collection/components/rtk-join-stage/rtk-join-stage.js +1 -1
  80. package/dist/collection/components/rtk-leave-button/rtk-leave-button.js +1 -1
  81. package/dist/collection/components/rtk-leave-meeting/rtk-leave-meeting.js +2 -2
  82. package/dist/collection/components/rtk-markdown-view/rtk-markdown-view.js +1 -1
  83. package/dist/collection/components/rtk-menu/rtk-menu.js +2 -2
  84. package/dist/collection/components/rtk-menu-item/rtk-menu-item.js +1 -1
  85. package/dist/collection/components/rtk-menu-list/rtk-menu-list.js +1 -1
  86. package/dist/collection/components/rtk-message-list-view/rtk-message-list-view.js +3 -3
  87. package/dist/collection/components/rtk-message-view/rtk-message-view.css +5 -1
  88. package/dist/collection/components/rtk-message-view/rtk-message-view.js +23 -1
  89. package/dist/collection/components/rtk-more-toggle/rtk-more-toggle.js +2 -2
  90. package/dist/collection/components/rtk-mute-all-confirmation/rtk-mute-all-confirmation.js +1 -1
  91. package/dist/collection/components/rtk-name-tag/rtk-name-tag.js +1 -1
  92. package/dist/collection/components/rtk-notification/rtk-notification.js +2 -2
  93. package/dist/collection/components/rtk-overlay-modal/rtk-overlay-modal.js +1 -1
  94. package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.css +5 -5
  95. package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.js +272 -256
  96. package/dist/collection/components/rtk-participant/rtk-participant.js +12 -12
  97. package/dist/collection/components/rtk-participant-setup/rtk-participant-setup.js +2 -2
  98. package/dist/collection/components/rtk-participants-audio/rtk-participants-audio.js +1 -1
  99. package/dist/collection/components/rtk-participants-stage-list/rtk-participants-stage-list.js +1 -1
  100. package/dist/collection/components/rtk-permissions-message/rtk-permissions-message.js +1 -1
  101. package/dist/collection/components/rtk-plugins/rtk-plugins.js +1 -1
  102. package/dist/collection/components/rtk-poll/rtk-poll.js +1 -1
  103. package/dist/collection/components/rtk-poll-form/rtk-poll-form.js +2 -2
  104. package/dist/collection/components/rtk-polls/rtk-polls.js +3 -3
  105. package/dist/collection/components/rtk-recording-indicator/rtk-recording-indicator.js +1 -1
  106. package/dist/collection/components/rtk-screenshare-view/rtk-screenshare-view.js +5 -5
  107. package/dist/collection/components/rtk-settings-toggle/rtk-settings-toggle.js +1 -1
  108. package/dist/collection/components/rtk-spinner/rtk-spinner.js +1 -1
  109. package/dist/collection/components/rtk-spotlight-grid/rtk-spotlight-grid.js +2 -2
  110. package/dist/collection/components/rtk-stage/rtk-stage.js +1 -1
  111. package/dist/collection/components/rtk-switch/rtk-switch.js +1 -1
  112. package/dist/collection/components/rtk-text-composer-view/rtk-text-composer-view.js +1 -1
  113. package/dist/collection/components/rtk-text-message/rtk-text-message.js +2 -2
  114. package/dist/collection/components/rtk-text-message-view/rtk-text-message-view.js +1 -1
  115. package/dist/collection/components/rtk-tooltip/rtk-tooltip.js +1 -1
  116. package/dist/collection/components/rtk-transcript/rtk-transcript.js +1 -1
  117. package/dist/collection/components/rtk-virtualized-list/rtk-virtualized-participant-list.js +2 -2
  118. package/dist/collection/components/rtk-waiting-screen/rtk-waiting-screen.js +1 -1
  119. package/dist/components/{p-9f7b9764.js → p-00bb4abb.js} +6 -6
  120. package/dist/components/{p-5248ee44.js → p-02b840f8.js} +3 -3
  121. package/dist/components/{p-a54ac879.js → p-0b2b3442.js} +2 -2
  122. package/dist/components/p-0d472019.js +362 -0
  123. package/dist/components/{p-94ba6c49.js → p-0e5cc539.js} +2 -2
  124. package/dist/components/{p-8901c589.js → p-0f2de0f8.js} +10 -7
  125. package/dist/components/{p-3a3650bd.js → p-107e55c1.js} +1 -1
  126. package/dist/components/{p-e62d961a.js → p-1a9e3806.js} +1 -1
  127. package/dist/components/{p-1da75fdd.js → p-1f5a4682.js} +2 -2
  128. package/dist/components/{p-bb55fa0c.js → p-2309fb19.js} +2 -2
  129. package/dist/components/{p-ff320cbb.js → p-241a8245.js} +1 -1
  130. package/dist/components/{p-93069a8c.js → p-2447a26f.js} +2 -2
  131. package/dist/components/{p-3bc68ec4.js → p-28170a8d.js} +9 -9
  132. package/dist/components/{p-ffe562b1.js → p-294cda89.js} +3 -3
  133. package/dist/components/{p-9c88019e.js → p-2a65883d.js} +1 -1
  134. package/dist/components/{p-d9845780.js → p-32c6e86d.js} +36 -28
  135. package/dist/components/{p-0c512fd1.js → p-39e8b34a.js} +1 -1
  136. package/dist/components/{p-ff8753e8.js → p-3e58e0f3.js} +1 -1
  137. package/dist/components/{p-2e6987aa.js → p-43d6a221.js} +2 -2
  138. package/dist/components/{p-7e8d976d.js → p-45220ce9.js} +2 -2
  139. package/dist/components/{p-962c2e24.js → p-46d99dd9.js} +2 -2
  140. package/dist/components/{p-9ff37f98.js → p-48acb953.js} +1 -1
  141. package/dist/components/{p-d9b1945a.js → p-4902c5cf.js} +1 -1
  142. package/dist/components/{p-5ac9b786.js → p-4aede34c.js} +1 -1
  143. package/dist/components/{p-6366df1e.js → p-4e5a54c2.js} +10 -10
  144. package/dist/components/{p-8b4e32b7.js → p-4ebf9684.js} +1 -1
  145. package/dist/components/{p-94bd91b3.js → p-540d8eb9.js} +1 -1
  146. package/dist/components/{p-ad7cabcc.js → p-5476e3f3.js} +2 -2
  147. package/dist/components/{p-471a529a.js → p-5669b6e7.js} +4 -4
  148. package/dist/components/{p-626c7a5f.js → p-598dc3f2.js} +2 -2
  149. package/dist/components/{p-c36a303c.js → p-616ae7ab.js} +2 -2
  150. package/dist/components/{p-a94b2e67.js → p-6739a399.js} +2 -2
  151. package/dist/components/{p-ad331530.js → p-6c9a833e.js} +1 -1
  152. package/dist/components/{p-1614fe8f.js → p-713c7ed7.js} +3 -3
  153. package/dist/components/{p-222454dc.js → p-7148ec6a.js} +1 -1
  154. package/dist/components/{p-ef493e1b.js → p-761c0e78.js} +1 -1
  155. package/dist/components/{p-3b6af603.js → p-7f489600.js} +1 -1
  156. package/dist/components/{p-0e8ff1cc.js → p-819cb785.js} +1 -1
  157. package/dist/components/{p-68af4225.js → p-89025409.js} +3 -3
  158. package/dist/components/{p-7a04f0cc.js → p-8cfdac0d.js} +5 -5
  159. package/dist/components/{p-41224895.js → p-8d6b21d5.js} +3 -3
  160. package/dist/components/{p-6c20da11.js → p-a25f3aca.js} +2 -2
  161. package/dist/components/{p-d0c5e808.js → p-a51db0d6.js} +16 -16
  162. package/dist/components/{p-a48e2cf0.js → p-a73665b4.js} +7 -7
  163. package/dist/components/{p-a24156ce.js → p-a8a6496d.js} +1 -1
  164. package/dist/components/{p-b58a185f.js → p-ae376177.js} +14 -14
  165. package/dist/components/{p-01c968b1.js → p-af3b99f4.js} +2 -2
  166. package/dist/components/{p-d81ba93a.js → p-bb4983b8.js} +2 -2
  167. package/dist/components/{p-c2b64e33.js → p-c334f0e5.js} +2 -2
  168. package/dist/components/{p-88bef213.js → p-cf8f725b.js} +1 -1
  169. package/dist/components/{p-d6146a96.js → p-d765dbe4.js} +6 -6
  170. package/dist/components/{p-6523d14b.js → p-da9018ea.js} +6 -6
  171. package/dist/components/{p-0d582365.js → p-dc3143c0.js} +2 -2
  172. package/dist/components/{p-58b56794.js → p-e0510925.js} +1 -1
  173. package/dist/components/{p-5e67d672.js → p-eeb37b16.js} +1 -1
  174. package/dist/components/{p-f2a47b5b.js → p-fa476519.js} +5 -5
  175. package/dist/components/{p-fa8f6b4a.js → p-fb836f65.js} +1 -1
  176. package/dist/components/{p-ba788f9e.js → p-fb900e8f.js} +2 -2
  177. package/dist/components/{p-262671ff.js → p-fef53de3.js} +1 -1
  178. package/dist/components/rtk-ai-toggle.js +2 -2
  179. package/dist/components/rtk-ai-transcriptions.js +1 -1
  180. package/dist/components/rtk-ai.js +1 -1
  181. package/dist/components/rtk-audio-grid.js +1 -1
  182. package/dist/components/rtk-audio-tile.js +3 -3
  183. package/dist/components/rtk-avatar.js +1 -1
  184. package/dist/components/rtk-breakout-room-manager.js +1 -1
  185. package/dist/components/rtk-breakout-room-participants.js +1 -1
  186. package/dist/components/rtk-breakout-rooms-manager.js +1 -1
  187. package/dist/components/rtk-breakout-rooms-toggle.js +2 -2
  188. package/dist/components/rtk-broadcast-message-modal.js +1 -1
  189. package/dist/components/rtk-camera-toggle.js +3 -3
  190. package/dist/components/rtk-caption-toggle.js +2 -2
  191. package/dist/components/rtk-channel-creator.js +4 -4
  192. package/dist/components/rtk-channel-details.js +1 -1
  193. package/dist/components/rtk-channel-header.js +4 -4
  194. package/dist/components/rtk-channel-selector-ui.js +4 -4
  195. package/dist/components/rtk-channel-selector-view.js +1 -1
  196. package/dist/components/rtk-chat-composer-ui.js +4 -4
  197. package/dist/components/rtk-chat-composer-view.js +1 -1
  198. package/dist/components/rtk-chat-message.js +1 -1
  199. package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
  200. package/dist/components/rtk-chat-messages-ui.js +14 -14
  201. package/dist/components/rtk-chat-search-results.js +11 -11
  202. package/dist/components/rtk-chat-toggle.js +30 -26
  203. package/dist/components/rtk-chat.js +1 -1
  204. package/dist/components/rtk-clock.js +3 -3
  205. package/dist/components/rtk-confirmation-modal.js +1 -1
  206. package/dist/components/rtk-controlbar-button.js +1 -1
  207. package/dist/components/rtk-controlbar.js +1 -1
  208. package/dist/components/rtk-counter.js +1 -1
  209. package/dist/components/rtk-debugger-toggle.js +3 -3
  210. package/dist/components/rtk-dialog-manager.js +14 -14
  211. package/dist/components/rtk-draft-attachment-view.js +1 -1
  212. package/dist/components/rtk-emoji-picker-button.js +1 -1
  213. package/dist/components/rtk-emoji-picker.js +1 -1
  214. package/dist/components/rtk-file-dropzone.js +1 -1
  215. package/dist/components/rtk-file-message-view.js +1 -1
  216. package/dist/components/rtk-file-message.js +1 -1
  217. package/dist/components/rtk-file-picker-button.js +1 -1
  218. package/dist/components/rtk-fullscreen-toggle.js +1 -1
  219. package/dist/components/rtk-grid-pagination.js +1 -1
  220. package/dist/components/rtk-grid.js +4 -4
  221. package/dist/components/rtk-header.js +1 -1
  222. package/dist/components/rtk-idle-screen.js +2 -2
  223. package/dist/components/rtk-image-message-view.js +1 -1
  224. package/dist/components/rtk-image-message.js +1 -1
  225. package/dist/components/rtk-image-viewer.js +1 -1
  226. package/dist/components/rtk-information-tooltip.js +1 -1
  227. package/dist/components/rtk-join-stage.js +1 -1
  228. package/dist/components/rtk-leave-button.js +3 -3
  229. package/dist/components/rtk-leave-meeting.js +1 -1
  230. package/dist/components/rtk-livestream-player.js +1 -1
  231. package/dist/components/rtk-livestream-toggle.js +2 -2
  232. package/dist/components/rtk-markdown-view.js +1 -1
  233. package/dist/components/rtk-meeting-title.js +1 -1
  234. package/dist/components/rtk-meeting.js +21 -21
  235. package/dist/components/rtk-menu-item.js +1 -1
  236. package/dist/components/rtk-menu-list.js +1 -1
  237. package/dist/components/rtk-menu.js +1 -1
  238. package/dist/components/rtk-message-list-view.js +4 -4
  239. package/dist/components/rtk-message-view.js +1 -1
  240. package/dist/components/rtk-mic-toggle.js +3 -3
  241. package/dist/components/rtk-mixed-grid.js +3 -3
  242. package/dist/components/rtk-more-toggle.js +4 -4
  243. package/dist/components/rtk-mute-all-button.js +3 -3
  244. package/dist/components/rtk-mute-all-confirmation.js +1 -1
  245. package/dist/components/rtk-name-tag.js +1 -1
  246. package/dist/components/rtk-notification.js +1 -1
  247. package/dist/components/rtk-notifications.js +1 -1
  248. package/dist/components/rtk-overlay-modal.js +1 -1
  249. package/dist/components/rtk-paginated-list.js +1 -1
  250. package/dist/components/rtk-participant-setup.js +2 -2
  251. package/dist/components/rtk-participant.js +1 -1
  252. package/dist/components/rtk-participants-audio.js +1 -1
  253. package/dist/components/rtk-participants-stage-list.js +1 -1
  254. package/dist/components/rtk-participants-stage-queue.js +1 -1
  255. package/dist/components/rtk-participants-toggle.js +2 -2
  256. package/dist/components/rtk-participants-viewer-list.js +1 -1
  257. package/dist/components/rtk-participants-waiting-list.js +1 -1
  258. package/dist/components/rtk-participants.js +11 -11
  259. package/dist/components/rtk-permissions-message.js +1 -1
  260. package/dist/components/rtk-pip-toggle.js +2 -2
  261. package/dist/components/rtk-plugins-toggle.js +2 -2
  262. package/dist/components/rtk-plugins.js +1 -1
  263. package/dist/components/rtk-poll-form.js +1 -1
  264. package/dist/components/rtk-poll.js +1 -1
  265. package/dist/components/rtk-polls-toggle.js +2 -2
  266. package/dist/components/rtk-polls.js +1 -1
  267. package/dist/components/rtk-recording-indicator.js +1 -1
  268. package/dist/components/rtk-recording-toggle.js +2 -2
  269. package/dist/components/rtk-screen-share-toggle.js +3 -3
  270. package/dist/components/rtk-screenshare-view.js +6 -6
  271. package/dist/components/rtk-settings-audio.js +1 -1
  272. package/dist/components/rtk-settings-toggle.js +3 -3
  273. package/dist/components/rtk-settings-video.js +1 -1
  274. package/dist/components/rtk-settings.js +3 -3
  275. package/dist/components/rtk-setup-screen.js +1 -1
  276. package/dist/components/rtk-sidebar.js +5 -5
  277. package/dist/components/rtk-spinner.js +1 -1
  278. package/dist/components/rtk-spotlight-grid.js +2 -2
  279. package/dist/components/rtk-spotlight-indicator.js +1 -1
  280. package/dist/components/rtk-stage-toggle.js +3 -3
  281. package/dist/components/rtk-stage.js +1 -1
  282. package/dist/components/rtk-switch.js +1 -1
  283. package/dist/components/rtk-tab-bar.js +1 -1
  284. package/dist/components/rtk-text-composer-view.js +1 -1
  285. package/dist/components/rtk-text-message-view.js +1 -1
  286. package/dist/components/rtk-text-message.js +1 -1
  287. package/dist/components/rtk-tooltip.js +1 -1
  288. package/dist/components/rtk-transcript.js +1 -1
  289. package/dist/components/rtk-transcripts.js +1 -1
  290. package/dist/components/rtk-virtualized-participant-list.js +1 -1
  291. package/dist/components/rtk-waiting-screen.js +1 -1
  292. package/dist/docs/docs-components.json +88 -66
  293. package/dist/docs/docs-vscode.json +4 -0
  294. package/dist/esm/loader.js +397 -371
  295. package/dist/esm/realtimekit-ui.js +1 -1
  296. package/dist/esm/rtk-ai-transcriptions.entry.js +1 -1
  297. package/dist/esm/rtk-audio-grid.entry.js +1 -1
  298. package/dist/esm/rtk-audio-visualizer_4.entry.js +1 -1
  299. package/dist/esm/rtk-avatar_24.entry.js +267 -247
  300. package/dist/esm/rtk-breakout-room-manager_3.entry.js +4 -4
  301. package/dist/esm/rtk-breakout-rooms-manager_9.entry.js +9 -9
  302. package/dist/esm/rtk-channel-creator.entry.js +2 -2
  303. package/dist/esm/rtk-channel-details.entry.js +1 -1
  304. package/dist/esm/rtk-channel-selector-ui.entry.js +2 -2
  305. package/dist/esm/rtk-chat-message.entry.js +2 -2
  306. package/dist/esm/rtk-chat-messages-ui.entry.js +3 -3
  307. package/dist/esm/rtk-chat-search-results.entry.js +1 -1
  308. package/dist/esm/rtk-chat-toggle.entry.js +27 -22
  309. package/dist/esm/rtk-clock.entry.js +3 -3
  310. package/dist/esm/rtk-controlbar.entry.js +1 -1
  311. package/dist/esm/rtk-debugger-toggle.entry.js +1 -1
  312. package/dist/esm/rtk-file-dropzone.entry.js +1 -1
  313. package/dist/esm/rtk-file-message_3.entry.js +8 -8
  314. package/dist/esm/rtk-header.entry.js +1 -1
  315. package/dist/esm/rtk-idle-screen.entry.js +1 -1
  316. package/dist/esm/rtk-image-viewer.entry.js +1 -1
  317. package/dist/esm/rtk-information-tooltip.entry.js +1 -1
  318. package/dist/esm/rtk-leave-button.entry.js +1 -1
  319. package/dist/esm/rtk-message-list-view.entry.js +3 -3
  320. package/dist/esm/rtk-more-toggle.entry.js +2 -2
  321. package/dist/esm/rtk-name-tag.entry.js +1 -1
  322. package/dist/esm/rtk-notification.entry.js +2 -2
  323. package/dist/esm/rtk-participant-setup.entry.js +2 -2
  324. package/dist/esm/rtk-participant_2.entry.js +14 -14
  325. package/dist/esm/rtk-participants-audio.entry.js +1 -1
  326. package/dist/esm/rtk-participants-stage-list_4.entry.js +1 -1
  327. package/dist/esm/rtk-plugins_2.entry.js +4 -4
  328. package/dist/esm/rtk-poll_2.entry.js +3 -3
  329. package/dist/esm/rtk-recording-indicator.entry.js +1 -1
  330. package/dist/esm/rtk-screenshare-view.entry.js +5 -5
  331. package/dist/esm/rtk-settings-toggle.entry.js +1 -1
  332. package/dist/esm/rtk-spotlight-grid.entry.js +2 -2
  333. package/dist/esm/rtk-stage.entry.js +1 -1
  334. package/dist/esm/rtk-transcript.entry.js +1 -1
  335. package/dist/esm/rtk-waiting-screen.entry.js +1 -1
  336. package/dist/realtimekit-ui/{p-d2a92f27.entry.js → p-00445029.entry.js} +1 -1
  337. package/dist/realtimekit-ui/{p-42989f41.entry.js → p-02c6b025.entry.js} +1 -1
  338. package/dist/realtimekit-ui/{p-af6436dd.entry.js → p-0baa78d7.entry.js} +1 -1
  339. package/dist/realtimekit-ui/{p-6ba99cc3.entry.js → p-1fe6003b.entry.js} +1 -1
  340. package/dist/realtimekit-ui/p-21d4bb9c.entry.js +1 -0
  341. package/dist/realtimekit-ui/{p-ed34d8a1.entry.js → p-23784be6.entry.js} +1 -1
  342. package/dist/realtimekit-ui/{p-f19668ba.entry.js → p-2441260e.entry.js} +1 -1
  343. package/dist/realtimekit-ui/p-322957ed.entry.js +1 -0
  344. package/dist/realtimekit-ui/{p-9ac1b986.entry.js → p-323d1aa4.entry.js} +1 -1
  345. package/dist/realtimekit-ui/p-44d69c6b.entry.js +1 -0
  346. package/dist/realtimekit-ui/p-48c87789.entry.js +1 -0
  347. package/dist/realtimekit-ui/{p-c43c2382.entry.js → p-53680d55.entry.js} +1 -1
  348. package/dist/realtimekit-ui/{p-5ebc57f8.entry.js → p-54a88fdf.entry.js} +1 -1
  349. package/dist/realtimekit-ui/{p-beedd1b5.entry.js → p-5892c1e0.entry.js} +1 -1
  350. package/dist/realtimekit-ui/{p-b64eae39.entry.js → p-612a8d25.entry.js} +1 -1
  351. package/dist/realtimekit-ui/{p-6437ff4e.entry.js → p-64206b62.entry.js} +1 -1
  352. package/dist/realtimekit-ui/{p-2f9211b9.entry.js → p-67ead213.entry.js} +1 -1
  353. package/dist/realtimekit-ui/{p-29c11bdb.entry.js → p-6896e819.entry.js} +1 -1
  354. package/dist/realtimekit-ui/{p-73a56e4f.entry.js → p-7a9a226e.entry.js} +1 -1
  355. package/dist/realtimekit-ui/{p-298befae.entry.js → p-80e51a73.entry.js} +1 -1
  356. package/dist/realtimekit-ui/p-820dad23.entry.js +1 -0
  357. package/dist/realtimekit-ui/p-83db4de1.entry.js +1 -0
  358. package/dist/realtimekit-ui/{p-844143f8.entry.js → p-85b3c0c4.entry.js} +1 -1
  359. package/dist/realtimekit-ui/{p-b4975a33.entry.js → p-8778b3e6.entry.js} +1 -1
  360. package/dist/realtimekit-ui/{p-447ffea0.entry.js → p-a1408db4.entry.js} +1 -1
  361. package/dist/realtimekit-ui/{p-1a78c129.entry.js → p-a67e2a25.entry.js} +1 -1
  362. package/dist/realtimekit-ui/{p-3d5ebc77.entry.js → p-a680da64.entry.js} +1 -1
  363. package/dist/realtimekit-ui/{p-b6cee65a.entry.js → p-a7172c2d.entry.js} +1 -1
  364. package/dist/realtimekit-ui/{p-78968008.entry.js → p-a852e0cf.entry.js} +1 -1
  365. package/dist/realtimekit-ui/{p-503371f7.entry.js → p-ac6c8ebe.entry.js} +1 -1
  366. package/dist/realtimekit-ui/{p-132fca40.entry.js → p-b25f7d7b.entry.js} +1 -1
  367. package/dist/realtimekit-ui/p-b51e813e.entry.js +1 -0
  368. package/dist/realtimekit-ui/{p-f6918dd7.entry.js → p-be5bdd0a.entry.js} +1 -1
  369. package/dist/realtimekit-ui/p-c5f704a3.entry.js +1 -0
  370. package/dist/realtimekit-ui/{p-a849f2b3.entry.js → p-cc226b51.entry.js} +1 -1
  371. package/dist/realtimekit-ui/{p-6928aa8e.entry.js → p-cda276d6.entry.js} +1 -1
  372. package/dist/realtimekit-ui/p-d880fb69.entry.js +1 -0
  373. package/dist/realtimekit-ui/p-f457ae6f.entry.js +1 -0
  374. package/dist/realtimekit-ui/{p-3482a231.entry.js → p-f6c82f1b.entry.js} +1 -1
  375. package/dist/realtimekit-ui/p-fa86682c.entry.js +1 -0
  376. package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
  377. package/dist/types/components/rtk-chat/rtk-chat.d.ts +1 -1
  378. package/dist/types/components/rtk-chat-toggle/rtk-chat-toggle.d.ts +4 -6
  379. package/dist/types/components/rtk-message-view/rtk-message-view.d.ts +2 -0
  380. package/dist/types/components/rtk-paginated-list/rtk-paginated-list.d.ts +68 -53
  381. package/dist/types/components.d.ts +17 -5
  382. package/package.json +1 -1
  383. package/dist/components/p-8e160343.js +0 -357
  384. package/dist/realtimekit-ui/p-02889d02.entry.js +0 -1
  385. package/dist/realtimekit-ui/p-0485834f.entry.js +0 -1
  386. package/dist/realtimekit-ui/p-190523f5.entry.js +0 -1
  387. package/dist/realtimekit-ui/p-2f6fd6de.entry.js +0 -1
  388. package/dist/realtimekit-ui/p-3a4e302b.entry.js +0 -1
  389. package/dist/realtimekit-ui/p-93e9fb59.entry.js +0 -1
  390. package/dist/realtimekit-ui/p-a9cb6a16.entry.js +0 -1
  391. package/dist/realtimekit-ui/p-bf234650.entry.js +0 -1
  392. package/dist/realtimekit-ui/p-ce5a911d.entry.js +0 -1
  393. package/dist/realtimekit-ui/p-d5144f9d.entry.js +0 -1
  394. package/dist/realtimekit-ui/p-db831ab6.entry.js +0 -1
@@ -1,3 +1,31 @@
1
+ /**
2
+ * HOW INFINITE SCROLL WORKS:
3
+ *
4
+ * We use intersectionObserver to scroll up.
5
+ * We use scrollEnd listener to scroll down.
6
+ *
7
+ * Why?
8
+ * intersectionObserver doesn't work reliably for 2 way scrolling but has great ux,
9
+ * so we use it to smoothly scroll up.
10
+ *
11
+ * We have empty divs at the top and bottom ($topRef, $bottomRef)
12
+ * which act as triggers to tell that we have reached the top or end of our messages and need to fetch new messages,
13
+ *
14
+ * When scrolling up, we can't remove pages as intersectionObserver relies on
15
+ * the index of dom elements to work properly.
16
+ * So instead, we fetch older messages and push them to the end of the 2d array
17
+ * if length exceeds pagesAllowed, we free up the pages and keep the first empty index in memory (firstEmptyIndex).
18
+ *
19
+ * For scrolling down, when scroll ends we see if the bottomRef is in view.
20
+ * If yes, we fetch the new page and insert it at the firstEmptyIndex.
21
+ * We update timestamps & firstEmptyIndex, then we rerender.
22
+ *
23
+ * If we have exceeded our page allowance we delete old pages.
24
+ *
25
+ * In this case deleting pages is okay as we are not relying on the index of dom elements to detect page end.
26
+ *
27
+ * This also simplifies the code because when a user scrolls up we do not need to manage a lastEmptyIndex.
28
+ */
1
29
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
30
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
31
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -9,277 +37,262 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
9
37
  return c > 3 && r && Object.defineProperty(target, key, r), r;
10
38
  };
11
39
  import { Host, h, writeTask } from "@stencil/core";
12
- import { debounce } from "lodash-es";
13
40
  import { defaultIconPack } from "../../lib/icons";
14
41
  import { useLanguage } from "../../lib/lang";
15
42
  import { SyncWithStore } from "../../utils/sync-with-store";
16
- import { smoothScrollToBottom } from "../../utils/scroll";
43
+ import { debounce } from "lodash-es";
17
44
  export class RtkPaginatedList {
18
45
  constructor() {
46
+ /**
47
+ * when scrolling up, we can't remove pages as intersectionObserver relies on
48
+ * the index of dom elements to stay stable.
49
+ * So, instead we free up the pages and keep the last empty index in memory.
50
+ */
51
+ this.firstEmptyIndex = -1;
52
+ this.maxTS = 0;
53
+ // the length of pages will always be pageSize + 2
54
+ this.pages = [];
55
+ /** label to show when empty */
56
+ this.emptyListLabel = null;
57
+ this.rerenderBoolean = false;
58
+ this.showEmptyListLabel = false;
19
59
  /** Icon pack */
20
60
  this.iconPack = defaultIconPack;
21
61
  /** Language */
22
62
  this.t = useLanguage();
23
- /** label to show when empty */
24
- this.emptyListLabel = null;
25
63
  this.isLoading = false;
26
64
  this.isLoadingTop = false;
27
65
  this.isLoadingBottom = false;
28
- this.hasMoreDataAtTop = false;
29
- this.rerenderBoolean = false;
30
66
  /**
31
- * This gets disabled when the user scrolls up and the bottom node
32
- * is not visible anymore.
33
- */
34
- this.shouldRenderNewNodes = true;
35
- /**
36
- * This gets disabled when the user scrolls up and the bottom node
37
- * is not visible anymore.
38
- */
39
- this.hasNewNodesToRender = false;
40
- this.showEmptyListLabel = false;
41
- /**
42
- * This is a private variable not a state
43
- * since we want to debounce rerenders
44
- *
45
- * A list of pages where each page contains a number of Nodes
46
- * [
47
- * [Node 1, Node 2, Node 3.... Node N],
48
- * [Node 1, Node 2, Node 3.... Node N],
49
- * ]
50
- */
51
- this.pagesToRender = [[]];
52
- this.currentTime = () => {
53
- return new Date().getTime();
54
- };
67
+ * Even when auto scroll is enabled, we only want to scroll if a new realtime message has arrived.
68
+ * This variable tells us if we should respect auto scroll after a new page has been loaded.
69
+ * It is also used by the scroll to bottom button.
70
+ * */
71
+ this.shouldScrollToBottom = false;
72
+ /** UI Indicator for the "scroll to bottom" button.
73
+ * Toggles on when a new node is added and autoscroll is disabled.
74
+ * Toggles off when all nodes are loaded */
75
+ this.showNewMessagesCTR = false;
55
76
  this.observe = (el) => {
56
77
  if (!el)
57
78
  return;
58
79
  this.intersectionObserver.observe(el);
59
80
  };
81
+ this.isAtBottom = () => {
82
+ const rect = this.$bottomRef.getBoundingClientRect();
83
+ return rect.top >= 0 && rect.bottom <= window.innerHeight;
84
+ };
60
85
  }
61
86
  /**
62
- * On a new node created
87
+ * Adds a new node to the beginning of the paginated list
88
+ * @param {DataNode} node - The data node to add to the beginning of the list
63
89
  */
64
90
  async onNewNode(node) {
65
- if (!this.shouldRenderNewNodes) {
66
- this.hasNewNodesToRender = true;
67
- return;
91
+ // Always update the maxTS. New messages will load on scroll till the end cursor (newTS) reaches this value.
92
+ this.maxTS = Math.max(this.maxTS, node.timeMs);
93
+ // if we are at the bottom of the page
94
+ if (this.firstEmptyIndex === -1) {
95
+ // append messages to the page if page has not reached full capacity
96
+ if (this.pages[0].length < this.pageSize) {
97
+ this.pages[0].unshift(node);
98
+ this.newTS = node.timeMs;
99
+ this.rerender();
100
+ }
101
+ else {
102
+ // if page is at full capacity, load next page
103
+ this.loadNextPage();
104
+ }
68
105
  }
69
- this.addNodeToRender(node, false);
70
- this.rerender();
71
- }
72
- /**
73
- * On node deleted
74
- */
75
- async onNodeDelete(key) {
76
- const oldLength = this.pagesToRender.flat().length;
77
- this.pagesToRender = this.pagesToRender.map((page) => page.filter((item) => item.id !== key));
78
- if (oldLength !== this.pagesToRender.flat().length) {
79
- this.rerender();
106
+ // If autoscroll is enabled, this method will scroll to the bottom
107
+ if (this.autoScroll) {
108
+ this.shouldScrollToBottom = true;
109
+ this.scrollToBottom();
80
110
  }
111
+ else {
112
+ this.showNewMessagesCTR = true;
113
+ }
114
+ }
115
+ // this method is called recursively based on shouldScrollToBottom (see scrollEnd listener)
116
+ scrollToBottom() {
117
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
81
118
  }
82
119
  /**
83
- * On node updated
84
- */
85
- async onNodeUpdate(key, newItem) {
86
- let shouldRerender = false;
87
- this.pagesToRender = this.pagesToRender.map((page) => page.map((item) => {
88
- if (item.id === key) {
89
- shouldRerender = true;
90
- return newItem;
120
+ * Deletes a node anywhere from the list
121
+ * @param {string} id - The id of the node to delete
122
+ * */
123
+ async onNodeDelete(id) {
124
+ // Iterate only over pages that have content (not empty)
125
+ for (let i = this.pages.length - 1; i > this.firstEmptyIndex; i--) {
126
+ const index = this.pages[i].findIndex((node) => node.id === id);
127
+ // message in view
128
+ if (index !== -1) {
129
+ // delete message
130
+ this.pages[i].splice(index, 1);
131
+ if (i === this.firstEmptyIndex + 1) {
132
+ // if newest page is empty, update first empty index
133
+ if (this.pages[i].length === 0)
134
+ this.firstEmptyIndex++;
135
+ // update timestamp, first empty index could be -1, so we need to cap it at 0
136
+ this.newTS = this.pages[Math.max(this.firstEmptyIndex, 0)][0].timeMs;
137
+ }
138
+ else if (i === this.firstEmptyIndex + this.pagesAllowed) {
139
+ // if oldest page is empty, remove it
140
+ if (this.pages[i].length === 0)
141
+ this.pages.pop();
142
+ // update timestamp
143
+ const lastPage = this.pages[this.firstEmptyIndex + this.pagesAllowed];
144
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
145
+ }
146
+ this.rerender();
91
147
  }
92
- return item;
93
- }));
94
- if (shouldRerender)
95
- this.rerender();
96
- }
97
- onItemChanged(newItemId, oldItemId) {
98
- if (newItemId !== oldItemId) {
99
- this.pagesToRender = [[]];
100
- this.loadFirstPage().then(() => this.rerender());
101
148
  }
102
149
  }
150
+ /**
151
+ * Updates a new node anywhere in the list
152
+ * @param {string} _id - The id of the node to update
153
+ * @param {DataNode} _node - The updated data node
154
+ * */
155
+ async onNodeUpdate(_id, _node) { }
156
+ rerender() {
157
+ this.rerenderBoolean = !this.rerenderBoolean;
158
+ }
103
159
  connectedCallback() {
104
160
  this.rerender = debounce(this.rerender.bind(this), 50, { maxWait: 200 });
105
- this.autoScroll = true;
106
161
  this.intersectionObserver = new IntersectionObserver((entries) => {
107
- writeTask(() => {
162
+ writeTask(async () => {
108
163
  for (const entry of entries) {
109
- if (entry.target.id === 'bottom-scroll') {
110
- if (entry.isIntersecting)
111
- this.loadBottom();
112
- else
113
- this.shouldRenderNewNodes = false;
114
- }
115
164
  if (entry.target.id === 'top-scroll' && entry.isIntersecting) {
116
- this.loadTop();
165
+ this.isLoadingTop = true;
166
+ await this.loadPrevPage();
167
+ this.isLoadingTop = false;
117
168
  }
118
169
  }
119
170
  });
120
171
  });
121
172
  }
122
- disconnectedCallback() {
123
- this.intersectionObserver.disconnect();
124
- }
125
173
  componentDidLoad() {
126
- /**
127
- * Adding observes here so that on the first render we scroll down
128
- * and shouldRenderNewNodes remains true
129
- */
130
- this.loadFirstPage();
131
174
  this.observe(this.$topRef);
132
- this.observe(this.$bottomRef);
133
- }
134
- componentDidRender() {
135
- if (this.shouldRenderNewNodes && this.autoScroll)
136
- smoothScrollToBottom(this.$paginatedList);
137
- }
138
- loadFirstPage() {
139
- return this.loadPage(this.currentTime(), this.pageSize, true, (data) => {
140
- if (data.length === 0) {
141
- this.showEmptyListLabel = true;
142
- }
143
- });
175
+ if (this.$containerRef) {
176
+ this.$containerRef.onscrollend = async () => {
177
+ /**
178
+ * Load new page if:
179
+ * if there are nodes to load at the bottom (maxTS > newTS)
180
+ * or if there are pages to fill at the bottom (firstEmptyIndex > -1)
181
+ */
182
+ if (this.isAtBottom() && (this.maxTS > this.newTS || this.firstEmptyIndex > -1)) {
183
+ this.isLoadingBottom = true;
184
+ await this.loadNextPage();
185
+ this.isLoadingBottom = false;
186
+ if (this.shouldScrollToBottom)
187
+ this.scrollToBottom();
188
+ }
189
+ };
190
+ }
144
191
  }
145
- loadTop() {
146
- /**
147
- * If there is only one unfilled page or no page, no need to check
148
- * for top since it will be empty
149
- */
150
- if (this.pagesToRender.length === 0)
151
- return;
152
- if (this.pagesToRender.length === 1 && this.pagesToRender[0].length < this.pageSize)
192
+ async loadPrevPage() {
193
+ if (this.isLoading)
153
194
  return;
154
195
  /**
155
- * TODO: Make this more flexible currently this only works with chat
196
+ * NOTE(ikabra): this case also runs on initial load
197
+ * if scrolling up ->
198
+ * fetch older messages and push to the end of the array
199
+ * cleanup 1st non empty page from the array if length exceeds pagesAllowed
156
200
  */
157
- const oldestVNode = this.pagesToRender[0][0];
158
- const oldestTimestamp = oldestVNode.timeMs;
159
- // TODO: scrollIntoView
160
- const onPageRendered = () => { }; // oldestVNode.$elm$?.scrollIntoView();
161
- this.isLoadingTop = true;
162
- this.loadPage(oldestTimestamp - 1, this.pageSize, true, onPageRendered, 'top');
201
+ // if no old timestamp, it means we are at initial state
202
+ if (!this.oldTS)
203
+ this.oldTS = new Date().getTime();
204
+ // load data
205
+ this.isLoading = true;
206
+ const data = await this.fetchData(this.oldTS - 1, this.pageSize, true);
207
+ this.isLoading = false;
208
+ // no more old messages to show, we are at the top of the page
209
+ if (!data.length)
210
+ return;
211
+ // add old data to the end of the array
212
+ this.pages.push(data);
213
+ // clear old pages when we reach the limit
214
+ if (this.pages.length > this.pagesAllowed) {
215
+ this.pages[this.pages.length - this.pagesAllowed - 1] = [];
216
+ /**
217
+ * find last non empty page in range (this.pages.length, this.firstEmptyIndex)
218
+ * we are doing this because any of the middle pages in the currently rendered pages
219
+ * could be empty as we allow deleting messages.
220
+ * This helps us set the first empty index correctly.
221
+ */
222
+ for (let i = this.firstEmptyIndex + 1; i < this.pages.length; i++) {
223
+ if (this.pages[i].length > 0)
224
+ break;
225
+ this.firstEmptyIndex = i;
226
+ }
227
+ }
228
+ // update the old timestamp
229
+ const lastPage = this.pages[this.pages.length - 1];
230
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
231
+ // update the new timestamp
232
+ this.newTS = this.pages[this.firstEmptyIndex + 1][0].timeMs;
233
+ this.rerender();
163
234
  }
164
- loadBottom() {
165
- /**
166
- * If there is only one unfilled page or no page, no need to check
167
- * for top since it will be empty
168
- */
169
- if (this.pagesToRender.length === 0) {
170
- this.shouldRenderNewNodes = true;
235
+ async loadNextPage() {
236
+ if (this.isLoading)
237
+ return;
238
+ // new timestamp needs to be assigned by loadPrevPage method
239
+ if (!this.newTS) {
240
+ this.showNewMessagesCTR = false;
241
+ this.shouldScrollToBottom = false;
171
242
  return;
172
243
  }
173
- if (this.pagesToRender.length === 1 && this.pagesToRender[0].length < this.pageSize) {
174
- this.shouldRenderNewNodes = true;
244
+ // load data
245
+ this.isLoading = true;
246
+ const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
247
+ this.isLoading = false;
248
+ // no more new messages to load
249
+ if (!data.length) {
250
+ this.showNewMessagesCTR = false;
251
+ this.shouldScrollToBottom = false;
252
+ // remove extra pages from the start if any (could be due to users deleting messages)
253
+ this.pages = this.pages.filter((page) => page.length > 0);
254
+ this.firstEmptyIndex = -1;
175
255
  return;
176
256
  }
177
- const newestVNode = this.pagesToRender.at(-1).at(-1);
178
- const newestTimestamp = newestVNode.timeMs;
179
- // TODO: scrollIntoView
180
- const onPageRendered = () => smoothScrollToBottom(this.$paginatedList);
181
- this.isLoadingBottom = true;
182
- this.loadPage(newestTimestamp + 1, this.pageSize, false, onPageRendered, 'bottom');
183
- }
184
- addNodeToRender(node, addToStart) {
185
- if (addToStart) {
186
- const firstPage = this.pagesToRender[0];
187
- if (firstPage && (firstPage === null || firstPage === void 0 ? void 0 : firstPage.length) < this.pageSize) {
188
- /**
189
- * If first page is not full then just add to that page
190
- */
191
- firstPage.unshift(node);
192
- }
193
- else {
194
- /**
195
- * If first page is full then add a new page to the start
196
- */
197
- const newPage = [node];
198
- this.pagesToRender.unshift(newPage);
199
- this.removeLastPageIfNeeded(false);
200
- }
257
+ // when filling empty pages
258
+ if (this.firstEmptyIndex > -1) {
259
+ this.pages[this.firstEmptyIndex] = data.reverse();
201
260
  }
202
261
  else {
203
- const [lastPage] = this.pagesToRender.slice(-1);
204
- if (lastPage && (lastPage === null || lastPage === void 0 ? void 0 : lastPage.length) < this.pageSize) {
205
- /**
206
- * If last page is not full then just add it
207
- */
208
- lastPage.push(node);
209
- }
210
- else {
211
- /**
212
- * If last page is full add a new page with just
213
- * this node
214
- */
215
- const newPage = [node];
216
- this.pagesToRender.push(newPage);
217
- this.removeLastPageIfNeeded(true);
218
- }
262
+ // when already at the bottom and loading messages in realtime
263
+ this.pages.unshift(data.reverse());
219
264
  }
220
- }
221
- /**
222
- * @param start
223
- * @param end
224
- * @param reversed Defines whether to add the page at the beginning or the end
225
- * @param onPageLoaded Callback for when all new nodes are rendered
226
- * @param direction Indicates if loading from 'top' or 'bottom'
227
- */
228
- async loadPage(timestamp, size, reversed, onPageRendered = () => { }, direction) {
229
- this.isLoading = true;
230
- const data = (await this.fetchData(timestamp, size, reversed));
231
- this.isLoading = false;
232
- if (direction === 'top') {
233
- this.isLoadingTop = false;
234
- this.hasMoreDataAtTop = (data === null || data === void 0 ? void 0 : data.length) > 0;
265
+ if (this.pages.length > this.pagesAllowed) {
266
+ this.pages.pop();
235
267
  }
236
- if (direction === 'bottom') {
237
- this.isLoadingBottom = false;
238
- }
239
- if (!(data === null || data === void 0 ? void 0 : data.length)) {
240
- /**
241
- * While scrolling down if there were no new items found
242
- * then start rendering new nodes;
243
- */
244
- if (!reversed) {
245
- this.hasNewNodesToRender = false;
246
- this.shouldRenderNewNodes = true;
247
- }
248
- onPageRendered([]);
249
- return;
268
+ // smallest value for firstEmptyIndex can be -1, so we cap the index at 0
269
+ this.newTS = this.pages[Math.max(0, this.firstEmptyIndex)][0].timeMs;
270
+ // remove all empty pages from the end
271
+ for (let i = this.pages.length - 1; i > this.firstEmptyIndex; i--) {
272
+ if (this.pages[i].length > 0)
273
+ break;
274
+ // if page is empty, remove it
275
+ this.pages.pop();
250
276
  }
251
- data.forEach((node) => this.addNodeToRender(node, reversed));
277
+ // update the old timestamp
278
+ const lastPage = this.pages[this.pages.length - 1];
279
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
280
+ // when scrolling too fast scroll a bit to the top to be able to load new messages when you scroll down
281
+ if (this.$containerRef.scrollTop === 0)
282
+ this.$containerRef.scrollTop = -60;
283
+ // smallest value for this index can be -1 (indicates we are at the bottom of the page).
284
+ this.firstEmptyIndex = Math.max(-1, this.firstEmptyIndex - 1);
252
285
  this.rerender();
253
- onPageRendered(data);
254
- }
255
- rerender() {
256
- this.rerenderBoolean = !this.rerenderBoolean;
257
- }
258
- removeLastPageIfNeeded(removeFromStart) {
259
- if (this.pagesToRender.length > this.pagesAllowed) {
260
- if (removeFromStart)
261
- this.pagesToRender.shift();
262
- else
263
- this.pagesToRender.pop();
264
- }
265
- }
266
- onDownArrowClicked() {
267
- /**
268
- * Load the freshest pages
269
- */
270
- this.loadBottom();
271
- }
272
- onLoadMoreOnTopClicked() {
273
- this.loadTop();
274
286
  }
275
287
  render() {
276
- var _a;
277
288
  /**
278
289
  * div.container is flex=column-reverse
279
290
  * which is why div#bottom-scroll comes before div#top-scroll
280
- * div.page-wrapper prevents reversal of messages
281
291
  */
282
- return (h(Host, { key: '23e10f12b079213650cf9c947d30650ba8c95a4d' }, h("div", { key: 'b5406069fd69ff117b19d437184c38b3c7d2fc28', class: "scrollbar container", part: "container", ref: (el) => (this.$paginatedList = el) }, h("div", { key: '7be947f2409ff810e0d10beea53ace8fdec334ce', class: { 'show-new-messages-ctr': true, active: !this.shouldRenderNewNodes } }, h("rtk-button", { key: '45c43d6ca1cc39376334dffa10f3f2c137d65add', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => this.onDownArrowClicked() }, h("rtk-icon", { key: '519b0db80f7d16cc4d03983e227d4897a5868ec9', icon: this.iconPack.chevron_down }))), h("div", { key: '53691e3943b90ef9e422c8da8f5facaa23f01920', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && h("rtk-spinner", { key: '2a393cb0bbb07c356144464dcc7c597f5cc9771b', size: "sm" }), this.isLoading && this.pagesToRender.flat().length === 0 && h("rtk-spinner", { key: '4ce03be69368db0d6d0d4ad079b14f2c7d93f26d', size: "lg" }), this.pagesToRender.flat().length === 0 && this.showEmptyListLabel ? (h("div", { class: "empty-list" }, (_a = this.emptyListLabel) !== null && _a !== void 0 ? _a : this.t('list.empty'))) : (h("div", { class: "page-wrapper" }, this.pagesToRender.map((page) => this.createNodes(page)))), this.hasMoreDataAtTop && !this.isLoadingTop && (h("div", { key: '5c85806854687efe098e4bd6d06d109060445378', class: "load-more-on-top-container" }, h("rtk-button", { key: '6d73a030fad5ba133aa2841b2feb196646592ada', class: "load-more-icon", kind: "icon", variant: "secondary", part: "load-more-icon", onClick: () => this.onLoadMoreOnTopClicked() }, h("rtk-icon", { key: '61a4f376749938df280e5c734dd3fa8a9b0b7201', icon: this.iconPack.chevron_up })))), this.isLoadingTop && h("rtk-spinner", { key: '3e55b99c60ed7bc2cd937091a33663dd19c9ca68', size: "sm" }), h("div", { key: 'a69e0a3a26d295783f4f729b33770b206ab5d46b', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
292
+ return (h(Host, { key: '91ac7d0ca3fb720259945ffaa97f465b34c694fa' }, h("div", { key: '33896c19ecc4359ae163c65b5c71b9f17673e765', class: "scrollbar container", part: "container", ref: (el) => (this.$containerRef = el) }, h("div", { key: 'e26a5ef3979ec132277b9598afc17ea65683f6c8', class: { 'show-new-messages-ctr': true, active: this.showNewMessagesCTR } }, h("rtk-button", { key: 'e769a8f54a298af456552733dc9de27d059e5138', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => {
293
+ this.shouldScrollToBottom = true;
294
+ this.scrollToBottom();
295
+ } }, h("rtk-icon", { key: '6fb4cbc2247eb971004a94926b95ebd0f90ab0fd', icon: this.iconPack.chevron_down }))), h("div", { key: 'e91dd8f25012e4509e0ff3cb4d6b65aa9467d427', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && this.pages.length > 0 && h("rtk-spinner", { key: '199c0ccffd57716bd5a05dcef8610113d3c58d3d', size: "sm" }), this.isLoading && this.pages.length < 1 && h("rtk-spinner", { key: 'b8a3e08a25b2bc1d50b5a9b1b2deda802ae5eb28', 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: '2cb56b4f70d37548fd9aa71b961559b43c54a922', size: "sm" }), h("div", { key: '4b183c49bfe60fd63af40e02b9b46215c08bb484', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
283
296
  }
284
297
  static get is() { return "rtk-paginated-list"; }
285
298
  static get encapsulation() { return "shadow"; }
@@ -333,6 +346,26 @@ export class RtkPaginatedList {
333
346
  "attribute": "pages-allowed",
334
347
  "reflect": false
335
348
  },
349
+ "emptyListLabel": {
350
+ "type": "string",
351
+ "mutable": false,
352
+ "complexType": {
353
+ "original": "string",
354
+ "resolved": "string",
355
+ "references": {}
356
+ },
357
+ "required": false,
358
+ "optional": false,
359
+ "docs": {
360
+ "tags": [],
361
+ "text": "label to show when empty"
362
+ },
363
+ "getter": false,
364
+ "setter": false,
365
+ "attribute": "empty-list-label",
366
+ "reflect": false,
367
+ "defaultValue": "null"
368
+ },
336
369
  "fetchData": {
337
370
  "type": "unknown",
338
371
  "mutable": false,
@@ -463,39 +496,16 @@ export class RtkPaginatedList {
463
496
  "getter": false,
464
497
  "setter": false,
465
498
  "defaultValue": "useLanguage()"
466
- },
467
- "emptyListLabel": {
468
- "type": "string",
469
- "mutable": false,
470
- "complexType": {
471
- "original": "string",
472
- "resolved": "string",
473
- "references": {}
474
- },
475
- "required": false,
476
- "optional": false,
477
- "docs": {
478
- "tags": [],
479
- "text": "label to show when empty"
480
- },
481
- "getter": false,
482
- "setter": false,
483
- "attribute": "empty-list-label",
484
- "reflect": false,
485
- "defaultValue": "null"
486
499
  }
487
500
  };
488
501
  }
489
502
  static get states() {
490
503
  return {
504
+ "rerenderBoolean": {},
505
+ "showEmptyListLabel": {},
491
506
  "isLoading": {},
492
507
  "isLoadingTop": {},
493
- "isLoadingBottom": {},
494
- "hasMoreDataAtTop": {},
495
- "rerenderBoolean": {},
496
- "shouldRenderNewNodes": {},
497
- "hasNewNodesToRender": {},
498
- "showEmptyListLabel": {}
508
+ "isLoadingBottom": {}
499
509
  };
500
510
  }
501
511
  static get methods() {
@@ -506,7 +516,7 @@ export class RtkPaginatedList {
506
516
  "parameters": [{
507
517
  "name": "node",
508
518
  "type": "DataNode",
509
- "docs": ""
519
+ "docs": "- The data node to add to the beginning of the list"
510
520
  }],
511
521
  "references": {
512
522
  "Promise": {
@@ -522,17 +532,20 @@ export class RtkPaginatedList {
522
532
  "return": "Promise<void>"
523
533
  },
524
534
  "docs": {
525
- "text": "On a new node created",
526
- "tags": []
535
+ "text": "Adds a new node to the beginning of the paginated list",
536
+ "tags": [{
537
+ "name": "param",
538
+ "text": "node - The data node to add to the beginning of the list"
539
+ }]
527
540
  }
528
541
  },
529
542
  "onNodeDelete": {
530
543
  "complexType": {
531
- "signature": "(key: string) => Promise<void>",
544
+ "signature": "(id: string) => Promise<void>",
532
545
  "parameters": [{
533
- "name": "key",
546
+ "name": "id",
534
547
  "type": "string",
535
- "docs": ""
548
+ "docs": "- The id of the node to delete"
536
549
  }],
537
550
  "references": {
538
551
  "Promise": {
@@ -543,21 +556,24 @@ export class RtkPaginatedList {
543
556
  "return": "Promise<void>"
544
557
  },
545
558
  "docs": {
546
- "text": "On node deleted",
547
- "tags": []
559
+ "text": "Deletes a node anywhere from the list",
560
+ "tags": [{
561
+ "name": "param",
562
+ "text": "id - The id of the node to delete"
563
+ }]
548
564
  }
549
565
  },
550
566
  "onNodeUpdate": {
551
567
  "complexType": {
552
- "signature": "(key: string, newItem: DataNode) => Promise<void>",
568
+ "signature": "(_id: string, _node: DataNode) => Promise<void>",
553
569
  "parameters": [{
554
- "name": "key",
570
+ "name": "_id",
555
571
  "type": "string",
556
- "docs": ""
572
+ "docs": "- The id of the node to update"
557
573
  }, {
558
- "name": "newItem",
574
+ "name": "_node",
559
575
  "type": "DataNode",
560
- "docs": ""
576
+ "docs": "- The updated data node"
561
577
  }],
562
578
  "references": {
563
579
  "Promise": {
@@ -573,18 +589,18 @@ export class RtkPaginatedList {
573
589
  "return": "Promise<void>"
574
590
  },
575
591
  "docs": {
576
- "text": "On node updated",
577
- "tags": []
592
+ "text": "Updates a new node anywhere in the list",
593
+ "tags": [{
594
+ "name": "param",
595
+ "text": "_id - The id of the node to update"
596
+ }, {
597
+ "name": "param",
598
+ "text": "_node - The updated data node"
599
+ }]
578
600
  }
579
601
  }
580
602
  };
581
603
  }
582
- static get watchers() {
583
- return [{
584
- "propName": "selectedItemId",
585
- "methodName": "onItemChanged"
586
- }];
587
- }
588
604
  }
589
605
  __decorate([
590
606
  SyncWithStore()