@cloudflare/realtimekit-ui 1.1.0-staging.4 → 1.1.0-staging.6
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/loader.cjs.js +1 -1
- package/dist/cjs/realtimekit-ui.cjs.js +1 -1
- package/dist/cjs/rtk-ai-transcriptions.cjs.entry.js +1 -1
- package/dist/cjs/rtk-audio-grid.cjs.entry.js +1 -1
- package/dist/cjs/rtk-audio-visualizer_4.cjs.entry.js +1 -1
- package/dist/cjs/rtk-avatar_24.cjs.entry.js +255 -232
- package/dist/cjs/rtk-breakout-room-manager_3.cjs.entry.js +4 -4
- package/dist/cjs/rtk-breakout-rooms-manager_9.cjs.entry.js +8 -8
- package/dist/cjs/rtk-channel-creator.cjs.entry.js +2 -2
- package/dist/cjs/rtk-channel-details.cjs.entry.js +1 -1
- package/dist/cjs/rtk-channel-selector-ui.cjs.entry.js +2 -2
- package/dist/cjs/rtk-chat-message.cjs.entry.js +2 -2
- package/dist/cjs/rtk-chat-messages-ui.cjs.entry.js +3 -3
- package/dist/cjs/rtk-chat-search-results.cjs.entry.js +1 -1
- package/dist/cjs/rtk-chat-toggle.cjs.entry.js +27 -22
- package/dist/cjs/rtk-clock.cjs.entry.js +3 -3
- package/dist/cjs/rtk-controlbar.cjs.entry.js +1 -1
- package/dist/cjs/rtk-debugger-toggle.cjs.entry.js +1 -1
- package/dist/cjs/rtk-file-dropzone.cjs.entry.js +1 -1
- package/dist/cjs/rtk-file-message_3.cjs.entry.js +8 -8
- package/dist/cjs/rtk-header.cjs.entry.js +1 -1
- package/dist/cjs/rtk-idle-screen.cjs.entry.js +1 -1
- package/dist/cjs/rtk-image-viewer.cjs.entry.js +1 -1
- package/dist/cjs/rtk-information-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/rtk-leave-button.cjs.entry.js +1 -1
- package/dist/cjs/rtk-message-list-view.cjs.entry.js +3 -3
- package/dist/cjs/rtk-more-toggle.cjs.entry.js +2 -2
- package/dist/cjs/rtk-notification.cjs.entry.js +2 -2
- package/dist/cjs/rtk-participant-setup.cjs.entry.js +2 -2
- package/dist/cjs/rtk-participant_2.cjs.entry.js +14 -14
- package/dist/cjs/rtk-participants-audio.cjs.entry.js +1 -1
- package/dist/cjs/rtk-participants-stage-list_4.cjs.entry.js +1 -1
- package/dist/cjs/rtk-plugins_2.cjs.entry.js +4 -4
- package/dist/cjs/rtk-poll_2.cjs.entry.js +3 -3
- package/dist/cjs/rtk-recording-indicator.cjs.entry.js +1 -1
- package/dist/cjs/rtk-screenshare-view.cjs.entry.js +5 -5
- package/dist/cjs/rtk-settings-toggle.cjs.entry.js +1 -1
- package/dist/cjs/rtk-spotlight-grid.cjs.entry.js +2 -2
- package/dist/cjs/rtk-stage.cjs.entry.js +1 -1
- package/dist/cjs/rtk-transcript.cjs.entry.js +1 -1
- package/dist/cjs/rtk-waiting-screen.cjs.entry.js +1 -1
- package/dist/collection/components/rtk-ai-transcriptions/rtk-ai-transcriptions.js +1 -1
- package/dist/collection/components/rtk-audio-grid/rtk-audio-grid.js +1 -1
- package/dist/collection/components/rtk-breakout-room-participants/rtk-breakout-room-participants.js +2 -2
- package/dist/collection/components/rtk-broadcast-message-modal/rtk-broadcast-message-modal.js +2 -2
- package/dist/collection/components/rtk-channel-creator/rtk-channel-creator.js +2 -2
- package/dist/collection/components/rtk-channel-details/rtk-channel-details.js +1 -1
- package/dist/collection/components/rtk-channel-selector-ui/rtk-channel-selector-ui.js +2 -2
- package/dist/collection/components/rtk-chat-message/rtk-chat-message.js +2 -2
- package/dist/collection/components/rtk-chat-messages-ui/rtk-chat-messages-ui.js +3 -3
- package/dist/collection/components/rtk-chat-messages-ui-paginated/rtk-chat-messages-ui-paginated.js +1 -1
- package/dist/collection/components/rtk-chat-search-results/rtk-chat-search-results.js +1 -1
- package/dist/collection/components/rtk-chat-toggle/rtk-chat-toggle.css +1 -1
- package/dist/collection/components/rtk-chat-toggle/rtk-chat-toggle.js +27 -26
- package/dist/collection/components/rtk-clock/rtk-clock.js +3 -3
- package/dist/collection/components/rtk-confirmation-modal/rtk-confirmation-modal.js +1 -1
- package/dist/collection/components/rtk-controlbar/rtk-controlbar.js +1 -1
- package/dist/collection/components/rtk-counter/rtk-counter.js +2 -2
- package/dist/collection/components/rtk-debugger-toggle/rtk-debugger-toggle.js +1 -1
- package/dist/collection/components/rtk-draft-attachment-view/rtk-draft-attachment-view.js +1 -1
- package/dist/collection/components/rtk-emoji-picker/rtk-emoji-picker.js +1 -1
- package/dist/collection/components/rtk-emoji-picker-button/rtk-emoji-picker-button.js +1 -1
- package/dist/collection/components/rtk-file-dropzone/rtk-file-dropzone.js +1 -1
- package/dist/collection/components/rtk-file-message/rtk-file-message.js +2 -2
- package/dist/collection/components/rtk-file-message-view/rtk-file-message-view.js +1 -1
- package/dist/collection/components/rtk-file-picker-button/rtk-file-picker-button.js +1 -1
- package/dist/collection/components/rtk-header/rtk-header.js +1 -1
- package/dist/collection/components/rtk-idle-screen/rtk-idle-screen.js +1 -1
- package/dist/collection/components/rtk-image-message/rtk-image-message.js +4 -4
- package/dist/collection/components/rtk-image-message-view/rtk-image-message-view.js +3 -3
- package/dist/collection/components/rtk-image-viewer/rtk-image-viewer.js +1 -1
- package/dist/collection/components/rtk-information-tooltip/rtk-information-tooltip.js +1 -1
- package/dist/collection/components/rtk-leave-button/rtk-leave-button.js +1 -1
- package/dist/collection/components/rtk-leave-meeting/rtk-leave-meeting.js +2 -2
- package/dist/collection/components/rtk-markdown-view/rtk-markdown-view.js +1 -1
- package/dist/collection/components/rtk-menu/rtk-menu.js +2 -2
- package/dist/collection/components/rtk-menu-item/rtk-menu-item.js +1 -1
- package/dist/collection/components/rtk-menu-list/rtk-menu-list.js +1 -1
- package/dist/collection/components/rtk-message-list-view/rtk-message-list-view.js +3 -3
- package/dist/collection/components/rtk-more-toggle/rtk-more-toggle.js +2 -2
- package/dist/collection/components/rtk-mute-all-confirmation/rtk-mute-all-confirmation.js +1 -1
- package/dist/collection/components/rtk-notification/rtk-notification.js +2 -2
- package/dist/collection/components/rtk-overlay-modal/rtk-overlay-modal.js +1 -1
- package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.css +5 -5
- package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.js +285 -256
- package/dist/collection/components/rtk-participant/rtk-participant.js +12 -12
- package/dist/collection/components/rtk-participant-setup/rtk-participant-setup.js +2 -2
- package/dist/collection/components/rtk-participants-audio/rtk-participants-audio.js +1 -1
- package/dist/collection/components/rtk-participants-stage-list/rtk-participants-stage-list.js +1 -1
- package/dist/collection/components/rtk-permissions-message/rtk-permissions-message.js +1 -1
- package/dist/collection/components/rtk-plugins/rtk-plugins.js +1 -1
- package/dist/collection/components/rtk-poll/rtk-poll.js +1 -1
- package/dist/collection/components/rtk-poll-form/rtk-poll-form.js +2 -2
- package/dist/collection/components/rtk-polls/rtk-polls.js +3 -3
- package/dist/collection/components/rtk-recording-indicator/rtk-recording-indicator.js +1 -1
- package/dist/collection/components/rtk-screenshare-view/rtk-screenshare-view.js +5 -5
- package/dist/collection/components/rtk-settings-toggle/rtk-settings-toggle.js +1 -1
- package/dist/collection/components/rtk-spinner/rtk-spinner.js +1 -1
- package/dist/collection/components/rtk-spotlight-grid/rtk-spotlight-grid.js +2 -2
- package/dist/collection/components/rtk-stage/rtk-stage.js +1 -1
- package/dist/collection/components/rtk-switch/rtk-switch.js +1 -1
- package/dist/collection/components/rtk-text-composer-view/rtk-text-composer-view.js +1 -1
- package/dist/collection/components/rtk-text-message/rtk-text-message.js +2 -2
- package/dist/collection/components/rtk-text-message-view/rtk-text-message-view.js +1 -1
- package/dist/collection/components/rtk-tooltip/rtk-tooltip.js +1 -1
- package/dist/collection/components/rtk-transcript/rtk-transcript.js +1 -1
- package/dist/collection/components/rtk-virtualized-list/rtk-virtualized-participant-list.js +2 -2
- package/dist/collection/components/rtk-waiting-screen/rtk-waiting-screen.js +1 -1
- package/dist/components/{p-8479343e.js → p-00bb4abb.js} +6 -6
- package/dist/components/{p-12ae623e.js → p-02b840f8.js} +3 -3
- package/dist/components/{p-20290ade.js → p-0b2b3442.js} +2 -2
- package/dist/components/{p-b74221b4.js → p-0e5cc539.js} +2 -2
- package/dist/components/{p-7b344a65.js → p-0f2de0f8.js} +5 -5
- package/dist/components/{p-b30f3c49.js → p-107e55c1.js} +1 -1
- package/dist/components/{p-7965a1a6.js → p-1a9e3806.js} +1 -1
- package/dist/components/{p-e31889d3.js → p-1f5a4682.js} +2 -2
- package/dist/components/{p-b9b8697d.js → p-2309fb19.js} +2 -2
- package/dist/components/{p-95e51bef.js → p-241a8245.js} +1 -1
- package/dist/components/{p-402db72e.js → p-2447a26f.js} +2 -2
- package/dist/components/{p-4a84c913.js → p-28170a8d.js} +9 -9
- package/dist/components/{p-86f18b68.js → p-294cda89.js} +3 -3
- package/dist/components/{p-cd790a43.js → p-2a65883d.js} +1 -1
- package/dist/components/{p-020800ee.js → p-39e8b34a.js} +1 -1
- package/dist/components/{p-8f381eef.js → p-3e58e0f3.js} +1 -1
- package/dist/components/{p-c8583d9b.js → p-43d6a221.js} +2 -2
- package/dist/components/{p-828db489.js → p-45220ce9.js} +2 -2
- package/dist/components/{p-011adf66.js → p-46d99dd9.js} +2 -2
- package/dist/components/{p-578d73e5.js → p-48acb953.js} +1 -1
- package/dist/components/{p-89cfd513.js → p-4902c5cf.js} +1 -1
- package/dist/components/{p-40589702.js → p-4aede34c.js} +1 -1
- package/dist/components/{p-0e80bae4.js → p-4e5a54c2.js} +10 -10
- package/dist/components/{p-5b66b8f3.js → p-4ebf9684.js} +1 -1
- package/dist/components/{p-28d51137.js → p-540d8eb9.js} +1 -1
- package/dist/components/{p-4bfb4f60.js → p-5476e3f3.js} +2 -2
- package/dist/components/{p-40b1fef2.js → p-5669b6e7.js} +4 -4
- package/dist/components/{p-9d40e041.js → p-598dc3f2.js} +2 -2
- package/dist/components/{p-ea6b5bf5.js → p-616ae7ab.js} +2 -2
- package/dist/components/{p-9c3ca56e.js → p-6739a399.js} +2 -2
- package/dist/components/{p-597543af.js → p-713c7ed7.js} +3 -3
- package/dist/components/{p-966273a8.js → p-7148ec6a.js} +1 -1
- package/dist/components/{p-ce77fdfc.js → p-761c0e78.js} +1 -1
- package/dist/components/{p-a0a0867a.js → p-7f489600.js} +1 -1
- package/dist/components/{p-520dccab.js → p-819cb785.js} +1 -1
- package/dist/components/{p-9936031d.js → p-85872241.js} +20 -20
- package/dist/components/{p-2e3c0084.js → p-89025409.js} +3 -3
- package/dist/components/{p-bed61d79.js → p-8cfdac0d.js} +5 -5
- package/dist/components/{p-757856f4.js → p-8d6b21d5.js} +3 -3
- package/dist/components/{p-35af8a84.js → p-a25f3aca.js} +2 -2
- package/dist/components/{p-5f0f8967.js → p-a51db0d6.js} +16 -16
- package/dist/components/{p-c544502e.js → p-a73665b4.js} +4 -4
- package/dist/components/{p-b3447e0c.js → p-a8a6496d.js} +1 -1
- package/dist/components/{p-5739b5f1.js → p-af3b99f4.js} +2 -2
- package/dist/components/{p-53332481.js → p-b6781e91.js} +12 -12
- package/dist/components/{p-11a16ac3.js → p-bb4983b8.js} +2 -2
- package/dist/components/{p-3a1dbc0d.js → p-c334f0e5.js} +2 -2
- package/dist/components/{p-d2ce1170.js → p-cf8f725b.js} +1 -1
- package/dist/components/{p-157c1dc9.js → p-d765dbe4.js} +6 -6
- package/dist/components/{p-2eb35b99.js → p-da9018ea.js} +6 -6
- package/dist/components/{p-0ca31fce.js → p-dc3143c0.js} +2 -2
- package/dist/components/{p-ab842e10.js → p-e0510925.js} +1 -1
- package/dist/components/p-e7e2156a.js +375 -0
- package/dist/components/{p-09d1805e.js → p-eeb37b16.js} +1 -1
- package/dist/components/{p-d3588666.js → p-fa476519.js} +5 -5
- package/dist/components/{p-85990be7.js → p-fb836f65.js} +1 -1
- package/dist/components/{p-668f57d0.js → p-fb900e8f.js} +2 -2
- package/dist/components/rtk-ai-toggle.js +2 -2
- package/dist/components/rtk-ai-transcriptions.js +1 -1
- package/dist/components/rtk-ai.js +1 -1
- package/dist/components/rtk-audio-grid.js +1 -1
- package/dist/components/rtk-audio-tile.js +2 -2
- package/dist/components/rtk-avatar.js +1 -1
- package/dist/components/rtk-breakout-room-manager.js +1 -1
- package/dist/components/rtk-breakout-room-participants.js +1 -1
- package/dist/components/rtk-breakout-rooms-manager.js +1 -1
- package/dist/components/rtk-breakout-rooms-toggle.js +2 -2
- package/dist/components/rtk-broadcast-message-modal.js +1 -1
- package/dist/components/rtk-camera-toggle.js +3 -3
- package/dist/components/rtk-caption-toggle.js +2 -2
- package/dist/components/rtk-channel-creator.js +4 -4
- package/dist/components/rtk-channel-details.js +1 -1
- package/dist/components/rtk-channel-header.js +4 -4
- package/dist/components/rtk-channel-selector-ui.js +4 -4
- package/dist/components/rtk-channel-selector-view.js +1 -1
- package/dist/components/rtk-chat-composer-ui.js +4 -4
- package/dist/components/rtk-chat-composer-view.js +1 -1
- package/dist/components/rtk-chat-message.js +1 -1
- package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
- package/dist/components/rtk-chat-messages-ui.js +14 -14
- package/dist/components/rtk-chat-search-results.js +11 -11
- package/dist/components/rtk-chat-toggle.js +30 -26
- package/dist/components/rtk-chat.js +1 -1
- package/dist/components/rtk-clock.js +3 -3
- package/dist/components/rtk-confirmation-modal.js +1 -1
- package/dist/components/rtk-controlbar-button.js +1 -1
- package/dist/components/rtk-controlbar.js +1 -1
- package/dist/components/rtk-counter.js +1 -1
- package/dist/components/rtk-debugger-toggle.js +3 -3
- package/dist/components/rtk-dialog-manager.js +13 -13
- package/dist/components/rtk-draft-attachment-view.js +1 -1
- package/dist/components/rtk-emoji-picker-button.js +1 -1
- package/dist/components/rtk-emoji-picker.js +1 -1
- package/dist/components/rtk-file-dropzone.js +1 -1
- package/dist/components/rtk-file-message-view.js +1 -1
- package/dist/components/rtk-file-message.js +1 -1
- package/dist/components/rtk-file-picker-button.js +1 -1
- package/dist/components/rtk-fullscreen-toggle.js +1 -1
- package/dist/components/rtk-grid-pagination.js +1 -1
- package/dist/components/rtk-grid.js +4 -4
- package/dist/components/rtk-header.js +1 -1
- package/dist/components/rtk-idle-screen.js +2 -2
- package/dist/components/rtk-image-message-view.js +1 -1
- package/dist/components/rtk-image-message.js +1 -1
- package/dist/components/rtk-image-viewer.js +1 -1
- package/dist/components/rtk-information-tooltip.js +1 -1
- package/dist/components/rtk-leave-button.js +3 -3
- package/dist/components/rtk-leave-meeting.js +1 -1
- package/dist/components/rtk-livestream-player.js +1 -1
- package/dist/components/rtk-livestream-toggle.js +2 -2
- package/dist/components/rtk-markdown-view.js +1 -1
- package/dist/components/rtk-meeting-title.js +1 -1
- package/dist/components/rtk-meeting.js +21 -21
- package/dist/components/rtk-menu-item.js +1 -1
- package/dist/components/rtk-menu-list.js +1 -1
- package/dist/components/rtk-menu.js +1 -1
- package/dist/components/rtk-message-list-view.js +4 -4
- package/dist/components/rtk-message-view.js +1 -1
- package/dist/components/rtk-mic-toggle.js +3 -3
- package/dist/components/rtk-mixed-grid.js +3 -3
- package/dist/components/rtk-more-toggle.js +4 -4
- package/dist/components/rtk-mute-all-button.js +3 -3
- package/dist/components/rtk-mute-all-confirmation.js +1 -1
- package/dist/components/rtk-notification.js +1 -1
- package/dist/components/rtk-notifications.js +1 -1
- package/dist/components/rtk-overlay-modal.js +1 -1
- package/dist/components/rtk-paginated-list.js +1 -1
- package/dist/components/rtk-participant-setup.js +2 -2
- package/dist/components/rtk-participant.js +1 -1
- package/dist/components/rtk-participants-audio.js +1 -1
- package/dist/components/rtk-participants-stage-list.js +1 -1
- package/dist/components/rtk-participants-stage-queue.js +1 -1
- package/dist/components/rtk-participants-toggle.js +2 -2
- package/dist/components/rtk-participants-viewer-list.js +1 -1
- package/dist/components/rtk-participants-waiting-list.js +1 -1
- package/dist/components/rtk-participants.js +11 -11
- package/dist/components/rtk-permissions-message.js +1 -1
- package/dist/components/rtk-pip-toggle.js +2 -2
- package/dist/components/rtk-plugins-toggle.js +2 -2
- package/dist/components/rtk-plugins.js +1 -1
- package/dist/components/rtk-poll-form.js +1 -1
- package/dist/components/rtk-poll.js +1 -1
- package/dist/components/rtk-polls-toggle.js +2 -2
- package/dist/components/rtk-polls.js +1 -1
- package/dist/components/rtk-recording-indicator.js +1 -1
- package/dist/components/rtk-recording-toggle.js +2 -2
- package/dist/components/rtk-screen-share-toggle.js +3 -3
- package/dist/components/rtk-screenshare-view.js +6 -6
- package/dist/components/rtk-settings-audio.js +1 -1
- package/dist/components/rtk-settings-toggle.js +3 -3
- package/dist/components/rtk-settings-video.js +1 -1
- package/dist/components/rtk-settings.js +3 -3
- package/dist/components/rtk-setup-screen.js +1 -1
- package/dist/components/rtk-sidebar.js +5 -5
- package/dist/components/rtk-spinner.js +1 -1
- package/dist/components/rtk-spotlight-grid.js +2 -2
- package/dist/components/rtk-spotlight-indicator.js +1 -1
- package/dist/components/rtk-stage-toggle.js +3 -3
- package/dist/components/rtk-stage.js +1 -1
- package/dist/components/rtk-switch.js +1 -1
- package/dist/components/rtk-tab-bar.js +1 -1
- package/dist/components/rtk-text-composer-view.js +1 -1
- package/dist/components/rtk-text-message-view.js +1 -1
- package/dist/components/rtk-text-message.js +1 -1
- package/dist/components/rtk-tooltip.js +1 -1
- package/dist/components/rtk-transcript.js +1 -1
- package/dist/components/rtk-transcripts.js +1 -1
- package/dist/components/rtk-virtualized-participant-list.js +1 -1
- package/dist/components/rtk-waiting-screen.js +1 -1
- package/dist/docs/docs-components.json +44 -33
- package/dist/esm/loader.js +383 -354
- package/dist/esm/realtimekit-ui.js +1 -1
- package/dist/esm/rtk-ai-transcriptions.entry.js +1 -1
- package/dist/esm/rtk-audio-grid.entry.js +1 -1
- package/dist/esm/rtk-audio-visualizer_4.entry.js +1 -1
- package/dist/esm/rtk-avatar_24.entry.js +255 -232
- package/dist/esm/rtk-breakout-room-manager_3.entry.js +4 -4
- package/dist/esm/rtk-breakout-rooms-manager_9.entry.js +8 -8
- package/dist/esm/rtk-channel-creator.entry.js +2 -2
- package/dist/esm/rtk-channel-details.entry.js +1 -1
- package/dist/esm/rtk-channel-selector-ui.entry.js +2 -2
- package/dist/esm/rtk-chat-message.entry.js +2 -2
- package/dist/esm/rtk-chat-messages-ui.entry.js +3 -3
- package/dist/esm/rtk-chat-search-results.entry.js +1 -1
- package/dist/esm/rtk-chat-toggle.entry.js +27 -22
- package/dist/esm/rtk-clock.entry.js +3 -3
- package/dist/esm/rtk-controlbar.entry.js +1 -1
- package/dist/esm/rtk-debugger-toggle.entry.js +1 -1
- package/dist/esm/rtk-file-dropzone.entry.js +1 -1
- package/dist/esm/rtk-file-message_3.entry.js +8 -8
- package/dist/esm/rtk-header.entry.js +1 -1
- package/dist/esm/rtk-idle-screen.entry.js +1 -1
- package/dist/esm/rtk-image-viewer.entry.js +1 -1
- package/dist/esm/rtk-information-tooltip.entry.js +1 -1
- package/dist/esm/rtk-leave-button.entry.js +1 -1
- package/dist/esm/rtk-message-list-view.entry.js +3 -3
- package/dist/esm/rtk-more-toggle.entry.js +2 -2
- package/dist/esm/rtk-notification.entry.js +2 -2
- package/dist/esm/rtk-participant-setup.entry.js +2 -2
- package/dist/esm/rtk-participant_2.entry.js +14 -14
- package/dist/esm/rtk-participants-audio.entry.js +1 -1
- package/dist/esm/rtk-participants-stage-list_4.entry.js +1 -1
- package/dist/esm/rtk-plugins_2.entry.js +4 -4
- package/dist/esm/rtk-poll_2.entry.js +3 -3
- package/dist/esm/rtk-recording-indicator.entry.js +1 -1
- package/dist/esm/rtk-screenshare-view.entry.js +5 -5
- package/dist/esm/rtk-settings-toggle.entry.js +1 -1
- package/dist/esm/rtk-spotlight-grid.entry.js +2 -2
- package/dist/esm/rtk-stage.entry.js +1 -1
- package/dist/esm/rtk-transcript.entry.js +1 -1
- package/dist/esm/rtk-waiting-screen.entry.js +1 -1
- package/dist/realtimekit-ui/{p-7660a4c1.entry.js → p-00445029.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-bb369808.entry.js → p-02c6b025.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-0fed7daa.entry.js → p-0baa78d7.entry.js} +1 -1
- package/dist/realtimekit-ui/p-19587963.entry.js +1 -0
- package/dist/realtimekit-ui/{p-0e2d6b1b.entry.js → p-1fe6003b.entry.js} +1 -1
- package/dist/realtimekit-ui/p-21d4bb9c.entry.js +1 -0
- package/dist/realtimekit-ui/{p-87f3b9a6.entry.js → p-2441260e.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-4822dc9f.entry.js → p-322957ed.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-f42c50db.entry.js → p-323d1aa4.entry.js} +1 -1
- package/dist/realtimekit-ui/p-421e4c6f.entry.js +1 -0
- package/dist/realtimekit-ui/{p-39410e81.entry.js → p-44d69c6b.entry.js} +1 -1
- package/dist/realtimekit-ui/p-48c87789.entry.js +1 -0
- package/dist/realtimekit-ui/{p-cea6c6ac.entry.js → p-53680d55.entry.js} +1 -1
- package/dist/realtimekit-ui/p-54a88fdf.entry.js +1 -0
- package/dist/realtimekit-ui/{p-9cab7a57.entry.js → p-5892c1e0.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-73f489be.entry.js → p-612a8d25.entry.js} +1 -1
- package/dist/realtimekit-ui/p-64206b62.entry.js +1 -0
- package/dist/realtimekit-ui/{p-a62e84f9.entry.js → p-67ead213.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-f2ce302b.entry.js → p-6896e819.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-fea05f1c.entry.js → p-7a9a226e.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-9cad5a6d.entry.js → p-80e51a73.entry.js} +1 -1
- package/dist/realtimekit-ui/p-820dad23.entry.js +1 -0
- package/dist/realtimekit-ui/{p-61d3e2d4.entry.js → p-85b3c0c4.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-0c071f00.entry.js → p-8778b3e6.entry.js} +1 -1
- package/dist/realtimekit-ui/p-a1408db4.entry.js +1 -0
- package/dist/realtimekit-ui/{p-c50f4cab.entry.js → p-a67e2a25.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-3e12d77a.entry.js → p-a680da64.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-bd226f59.entry.js → p-a7172c2d.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-cda80e2c.entry.js → p-a852e0cf.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-9dcd9e30.entry.js → p-ac6c8ebe.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-1dfe0269.entry.js → p-b25f7d7b.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-2c71cc53.entry.js → p-b51e813e.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-dded6ad0.entry.js → p-be5bdd0a.entry.js} +1 -1
- package/dist/realtimekit-ui/p-c5f704a3.entry.js +1 -0
- package/dist/realtimekit-ui/{p-d7a78f65.entry.js → p-cc226b51.entry.js} +1 -1
- package/dist/realtimekit-ui/{p-a25bb0ad.entry.js → p-cda276d6.entry.js} +1 -1
- package/dist/realtimekit-ui/p-d880fb69.entry.js +1 -0
- package/dist/realtimekit-ui/{p-a867b984.entry.js → p-f6c82f1b.entry.js} +1 -1
- package/dist/realtimekit-ui/p-fa86682c.entry.js +1 -0
- package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
- package/dist/types/components/rtk-chat-toggle/rtk-chat-toggle.d.ts +4 -6
- package/dist/types/components/rtk-paginated-list/rtk-paginated-list.d.ts +68 -53
- package/dist/types/components.d.ts +9 -5
- package/package.json +1 -1
- package/dist/components/p-78f91ffe.js +0 -357
- package/dist/realtimekit-ui/p-02889d02.entry.js +0 -1
- package/dist/realtimekit-ui/p-09fb29e7.entry.js +0 -1
- package/dist/realtimekit-ui/p-260fc2ed.entry.js +0 -1
- package/dist/realtimekit-ui/p-32211408.entry.js +0 -1
- package/dist/realtimekit-ui/p-48c76360.entry.js +0 -1
- package/dist/realtimekit-ui/p-4d31d165.entry.js +0 -1
- package/dist/realtimekit-ui/p-51c72bc8.entry.js +0 -1
- package/dist/realtimekit-ui/p-b58dc07c.entry.js +0 -1
- package/dist/realtimekit-ui/p-c96e2a96.entry.js +0 -1
- package/dist/realtimekit-ui/p-d194317d.entry.js +0 -1
- package/dist/realtimekit-ui/p-ff9bc5b0.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,275 @@ 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 {
|
|
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
|
-
/**
|
|
31
|
-
* This gets disabled when the user scrolls up and the bottom node
|
|
32
|
-
* is not visible anymore.
|
|
33
|
-
*/
|
|
34
|
-
this.shouldRenderNewNodes = true;
|
|
35
66
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
+
// if there are no pages, load the first page
|
|
96
|
+
if (this.pages.length < 1) {
|
|
97
|
+
// update old timer to 1ms ahead of the latest message as we subtract this value to avoid loading duplicate messages when scrolling
|
|
98
|
+
this.oldTS = node.timeMs + 1;
|
|
99
|
+
this.loadPrevPage();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// append messages to the page if page has not reached full capacity
|
|
103
|
+
if (this.pages[0].length < this.pageSize) {
|
|
104
|
+
this.pages[0].unshift(node);
|
|
105
|
+
this.newTS = node.timeMs;
|
|
106
|
+
this.rerender();
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// if page is at full capacity, load next page
|
|
110
|
+
this.loadNextPage();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
68
113
|
}
|
|
69
|
-
|
|
70
|
-
this.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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();
|
|
114
|
+
// If autoscroll is enabled, this method will scroll to the bottom
|
|
115
|
+
if (this.autoScroll) {
|
|
116
|
+
this.shouldScrollToBottom = true;
|
|
117
|
+
this.scrollToBottom();
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.showNewMessagesCTR = true;
|
|
80
121
|
}
|
|
81
122
|
}
|
|
123
|
+
// this method is called recursively based on shouldScrollToBottom (see scrollEnd listener)
|
|
124
|
+
scrollToBottom() {
|
|
125
|
+
this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
|
|
126
|
+
}
|
|
82
127
|
/**
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
128
|
+
* Deletes a node anywhere from the list
|
|
129
|
+
* @param {string} id - The id of the node to delete
|
|
130
|
+
* */
|
|
131
|
+
async onNodeDelete(id) {
|
|
132
|
+
// Iterate only over pages that have content (not empty)
|
|
133
|
+
for (let i = this.pages.length - 1; i > this.firstEmptyIndex; i--) {
|
|
134
|
+
const index = this.pages[i].findIndex((node) => node.id === id);
|
|
135
|
+
// message in view
|
|
136
|
+
if (index !== -1) {
|
|
137
|
+
// delete message
|
|
138
|
+
this.pages[i].splice(index, 1);
|
|
139
|
+
// if we are on the first page and it's now empty, we need to go back to initial state
|
|
140
|
+
if (i === 0 && this.pages[i].length === 0) {
|
|
141
|
+
this.pages.shift();
|
|
142
|
+
this.firstEmptyIndex = -1;
|
|
143
|
+
}
|
|
144
|
+
else if (i === this.firstEmptyIndex + 1) {
|
|
145
|
+
// if newest page is empty, update first empty index
|
|
146
|
+
if (this.pages[i].length === 0)
|
|
147
|
+
this.firstEmptyIndex++;
|
|
148
|
+
// update timestamp, first empty index could be -1, so we need to cap it at 0
|
|
149
|
+
this.newTS = this.pages[Math.max(this.firstEmptyIndex, 0)][0].timeMs;
|
|
150
|
+
}
|
|
151
|
+
else if (i === this.firstEmptyIndex + this.pagesAllowed) {
|
|
152
|
+
// if oldest page is empty, remove it
|
|
153
|
+
if (this.pages[i].length === 0)
|
|
154
|
+
this.pages.pop();
|
|
155
|
+
// update timestamp
|
|
156
|
+
const lastPage = this.pages[this.firstEmptyIndex + this.pagesAllowed];
|
|
157
|
+
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
158
|
+
}
|
|
159
|
+
this.rerender();
|
|
91
160
|
}
|
|
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
161
|
}
|
|
102
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Updates a new node anywhere in the list
|
|
165
|
+
* @param {string} _id - The id of the node to update
|
|
166
|
+
* @param {DataNode} _node - The updated data node
|
|
167
|
+
* */
|
|
168
|
+
async onNodeUpdate(_id, _node) { }
|
|
169
|
+
rerender() {
|
|
170
|
+
this.rerenderBoolean = !this.rerenderBoolean;
|
|
171
|
+
}
|
|
103
172
|
connectedCallback() {
|
|
104
173
|
this.rerender = debounce(this.rerender.bind(this), 50, { maxWait: 200 });
|
|
105
|
-
this.autoScroll = true;
|
|
106
174
|
this.intersectionObserver = new IntersectionObserver((entries) => {
|
|
107
|
-
writeTask(() => {
|
|
175
|
+
writeTask(async () => {
|
|
108
176
|
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
177
|
if (entry.target.id === 'top-scroll' && entry.isIntersecting) {
|
|
116
|
-
this.
|
|
178
|
+
this.isLoadingTop = true;
|
|
179
|
+
await this.loadPrevPage();
|
|
180
|
+
this.isLoadingTop = false;
|
|
117
181
|
}
|
|
118
182
|
}
|
|
119
183
|
});
|
|
120
184
|
});
|
|
121
185
|
}
|
|
122
|
-
disconnectedCallback() {
|
|
123
|
-
this.intersectionObserver.disconnect();
|
|
124
|
-
}
|
|
125
186
|
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
187
|
this.observe(this.$topRef);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
188
|
+
if (this.$containerRef) {
|
|
189
|
+
this.$containerRef.onscrollend = async () => {
|
|
190
|
+
/**
|
|
191
|
+
* Load new page if:
|
|
192
|
+
* if there are nodes to load at the bottom (maxTS > newTS)
|
|
193
|
+
* or if there are pages to fill at the bottom (firstEmptyIndex > -1)
|
|
194
|
+
*/
|
|
195
|
+
if (this.isAtBottom() && (this.maxTS > this.newTS || this.firstEmptyIndex > -1)) {
|
|
196
|
+
this.isLoadingBottom = true;
|
|
197
|
+
await this.loadNextPage();
|
|
198
|
+
this.isLoadingBottom = false;
|
|
199
|
+
if (this.shouldScrollToBottom)
|
|
200
|
+
this.scrollToBottom();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
144
204
|
}
|
|
145
|
-
|
|
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)
|
|
205
|
+
async loadPrevPage() {
|
|
206
|
+
if (this.isLoading)
|
|
153
207
|
return;
|
|
154
208
|
/**
|
|
155
|
-
*
|
|
209
|
+
* NOTE(ikabra): this case also runs on initial load
|
|
210
|
+
* if scrolling up ->
|
|
211
|
+
* fetch older messages and push to the end of the array
|
|
212
|
+
* cleanup 1st non empty page from the array if length exceeds pagesAllowed
|
|
156
213
|
*/
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
214
|
+
// if no old timestamp, it means we are at initial state
|
|
215
|
+
if (!this.oldTS)
|
|
216
|
+
this.oldTS = new Date().getTime();
|
|
217
|
+
// load data
|
|
218
|
+
this.isLoading = true;
|
|
219
|
+
const data = await this.fetchData(this.oldTS - 1, this.pageSize, true);
|
|
220
|
+
this.isLoading = false;
|
|
221
|
+
// no more old messages to show, we are at the top of the page
|
|
222
|
+
if (!data.length)
|
|
223
|
+
return;
|
|
224
|
+
// add old data to the end of the array
|
|
225
|
+
this.pages.push(data);
|
|
226
|
+
// clear old pages when we reach the limit
|
|
227
|
+
if (this.pages.length > this.pagesAllowed) {
|
|
228
|
+
this.pages[this.pages.length - this.pagesAllowed - 1] = [];
|
|
229
|
+
/**
|
|
230
|
+
* find last non empty page in range (this.pages.length, this.firstEmptyIndex)
|
|
231
|
+
* we are doing this because any of the middle pages in the currently rendered pages
|
|
232
|
+
* could be empty as we allow deleting messages.
|
|
233
|
+
* This helps us set the first empty index correctly.
|
|
234
|
+
*/
|
|
235
|
+
for (let i = this.firstEmptyIndex + 1; i < this.pages.length; i++) {
|
|
236
|
+
if (this.pages[i].length > 0)
|
|
237
|
+
break;
|
|
238
|
+
this.firstEmptyIndex = i;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// update the old timestamp
|
|
242
|
+
const lastPage = this.pages[this.pages.length - 1];
|
|
243
|
+
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
244
|
+
// update the new timestamp
|
|
245
|
+
this.newTS = this.pages[this.firstEmptyIndex + 1][0].timeMs;
|
|
246
|
+
this.rerender();
|
|
163
247
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
this.
|
|
248
|
+
async loadNextPage() {
|
|
249
|
+
if (this.isLoading)
|
|
250
|
+
return;
|
|
251
|
+
// new timestamp needs to be assigned by loadPrevPage method
|
|
252
|
+
if (!this.newTS) {
|
|
253
|
+
this.showNewMessagesCTR = false;
|
|
254
|
+
this.shouldScrollToBottom = false;
|
|
171
255
|
return;
|
|
172
256
|
}
|
|
173
|
-
|
|
174
|
-
|
|
257
|
+
// load data
|
|
258
|
+
this.isLoading = true;
|
|
259
|
+
const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
|
|
260
|
+
this.isLoading = false;
|
|
261
|
+
// no more new messages to load
|
|
262
|
+
if (!data.length) {
|
|
263
|
+
this.showNewMessagesCTR = false;
|
|
264
|
+
this.shouldScrollToBottom = false;
|
|
265
|
+
// remove extra pages from the start if any (could be due to users deleting messages)
|
|
266
|
+
this.pages = this.pages.filter((page) => page.length > 0);
|
|
267
|
+
this.firstEmptyIndex = -1;
|
|
175
268
|
return;
|
|
176
269
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
}
|
|
270
|
+
// when filling empty pages
|
|
271
|
+
if (this.firstEmptyIndex > -1) {
|
|
272
|
+
this.pages[this.firstEmptyIndex] = data.reverse();
|
|
201
273
|
}
|
|
202
274
|
else {
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
}
|
|
275
|
+
// when already at the bottom and loading messages in realtime
|
|
276
|
+
this.pages.unshift(data.reverse());
|
|
219
277
|
}
|
|
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;
|
|
278
|
+
if (this.pages.length > this.pagesAllowed) {
|
|
279
|
+
this.pages.pop();
|
|
235
280
|
}
|
|
236
|
-
|
|
237
|
-
|
|
281
|
+
// smallest value for firstEmptyIndex can be -1, so we cap the index at 0
|
|
282
|
+
this.newTS = this.pages[Math.max(0, this.firstEmptyIndex)][0].timeMs;
|
|
283
|
+
// remove all empty pages from the end
|
|
284
|
+
for (let i = this.pages.length - 1; i > this.firstEmptyIndex; i--) {
|
|
285
|
+
if (this.pages[i].length > 0)
|
|
286
|
+
break;
|
|
287
|
+
// if page is empty, remove it
|
|
288
|
+
this.pages.pop();
|
|
238
289
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
onPageRendered([]);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
data.forEach((node) => this.addNodeToRender(node, reversed));
|
|
290
|
+
// update the old timestamp
|
|
291
|
+
const lastPage = this.pages[this.pages.length - 1];
|
|
292
|
+
this.oldTS = lastPage[lastPage.length - 1].timeMs;
|
|
293
|
+
// when scrolling too fast scroll a bit to the top to be able to load new messages when you scroll down
|
|
294
|
+
if (this.$containerRef.scrollTop === 0)
|
|
295
|
+
this.$containerRef.scrollTop = -60;
|
|
296
|
+
// smallest value for this index can be -1 (indicates we are at the bottom of the page).
|
|
297
|
+
this.firstEmptyIndex = Math.max(-1, this.firstEmptyIndex - 1);
|
|
252
298
|
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
299
|
}
|
|
275
300
|
render() {
|
|
276
|
-
var _a;
|
|
277
301
|
/**
|
|
278
302
|
* div.container is flex=column-reverse
|
|
279
303
|
* which is why div#bottom-scroll comes before div#top-scroll
|
|
280
|
-
* div.page-wrapper prevents reversal of messages
|
|
281
304
|
*/
|
|
282
|
-
return (h(Host, { key: '
|
|
305
|
+
return (h(Host, { key: '9bf695bccf42f2dd43b04725a855b6b77a4062fd' }, h("div", { key: '7c6805ed8b5e831ea6d932cfb5dc3ecf3d312775', class: "scrollbar container", part: "container", ref: (el) => (this.$containerRef = el) }, h("div", { key: 'eb6c68f97385b5a14a94ab2dc0abff4836f016f3', class: { 'show-new-messages-ctr': true, active: this.showNewMessagesCTR } }, h("rtk-button", { key: 'd1f04db290a9e4128ca58c9bd20b2146a7fc8f12', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => {
|
|
306
|
+
this.shouldScrollToBottom = true;
|
|
307
|
+
this.scrollToBottom();
|
|
308
|
+
} }, h("rtk-icon", { key: '71d8a85911513bb4069578a63ae45f21ac53554c', icon: this.iconPack.chevron_down }))), h("div", { key: 'b1aa46b8163431df6060163d7c5a87eb1ebcffa3', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && this.pages.length > 0 && h("rtk-spinner", { key: 'a3de0e7b8ca1ac505a596d86c0b8ecafee5fabba', size: "sm" }), this.isLoading && this.pages.length < 1 && h("rtk-spinner", { key: '21fa3a4091d3f1311f5d575c277859602718338c', 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: '7e018af534e7cd0be3345ca9ad9c8f0a7ab7cc3f', size: "sm" }), h("div", { key: '6c877368fc03c884338402bbcd878929cd4034fb', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
|
|
283
309
|
}
|
|
284
310
|
static get is() { return "rtk-paginated-list"; }
|
|
285
311
|
static get encapsulation() { return "shadow"; }
|
|
@@ -333,6 +359,26 @@ export class RtkPaginatedList {
|
|
|
333
359
|
"attribute": "pages-allowed",
|
|
334
360
|
"reflect": false
|
|
335
361
|
},
|
|
362
|
+
"emptyListLabel": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"mutable": false,
|
|
365
|
+
"complexType": {
|
|
366
|
+
"original": "string",
|
|
367
|
+
"resolved": "string",
|
|
368
|
+
"references": {}
|
|
369
|
+
},
|
|
370
|
+
"required": false,
|
|
371
|
+
"optional": false,
|
|
372
|
+
"docs": {
|
|
373
|
+
"tags": [],
|
|
374
|
+
"text": "label to show when empty"
|
|
375
|
+
},
|
|
376
|
+
"getter": false,
|
|
377
|
+
"setter": false,
|
|
378
|
+
"attribute": "empty-list-label",
|
|
379
|
+
"reflect": false,
|
|
380
|
+
"defaultValue": "null"
|
|
381
|
+
},
|
|
336
382
|
"fetchData": {
|
|
337
383
|
"type": "unknown",
|
|
338
384
|
"mutable": false,
|
|
@@ -463,39 +509,16 @@ export class RtkPaginatedList {
|
|
|
463
509
|
"getter": false,
|
|
464
510
|
"setter": false,
|
|
465
511
|
"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
512
|
}
|
|
487
513
|
};
|
|
488
514
|
}
|
|
489
515
|
static get states() {
|
|
490
516
|
return {
|
|
517
|
+
"rerenderBoolean": {},
|
|
518
|
+
"showEmptyListLabel": {},
|
|
491
519
|
"isLoading": {},
|
|
492
520
|
"isLoadingTop": {},
|
|
493
|
-
"isLoadingBottom": {}
|
|
494
|
-
"hasMoreDataAtTop": {},
|
|
495
|
-
"rerenderBoolean": {},
|
|
496
|
-
"shouldRenderNewNodes": {},
|
|
497
|
-
"hasNewNodesToRender": {},
|
|
498
|
-
"showEmptyListLabel": {}
|
|
521
|
+
"isLoadingBottom": {}
|
|
499
522
|
};
|
|
500
523
|
}
|
|
501
524
|
static get methods() {
|
|
@@ -506,7 +529,7 @@ export class RtkPaginatedList {
|
|
|
506
529
|
"parameters": [{
|
|
507
530
|
"name": "node",
|
|
508
531
|
"type": "DataNode",
|
|
509
|
-
"docs": ""
|
|
532
|
+
"docs": "- The data node to add to the beginning of the list"
|
|
510
533
|
}],
|
|
511
534
|
"references": {
|
|
512
535
|
"Promise": {
|
|
@@ -522,17 +545,20 @@ export class RtkPaginatedList {
|
|
|
522
545
|
"return": "Promise<void>"
|
|
523
546
|
},
|
|
524
547
|
"docs": {
|
|
525
|
-
"text": "
|
|
526
|
-
"tags": [
|
|
548
|
+
"text": "Adds a new node to the beginning of the paginated list",
|
|
549
|
+
"tags": [{
|
|
550
|
+
"name": "param",
|
|
551
|
+
"text": "node - The data node to add to the beginning of the list"
|
|
552
|
+
}]
|
|
527
553
|
}
|
|
528
554
|
},
|
|
529
555
|
"onNodeDelete": {
|
|
530
556
|
"complexType": {
|
|
531
|
-
"signature": "(
|
|
557
|
+
"signature": "(id: string) => Promise<void>",
|
|
532
558
|
"parameters": [{
|
|
533
|
-
"name": "
|
|
559
|
+
"name": "id",
|
|
534
560
|
"type": "string",
|
|
535
|
-
"docs": ""
|
|
561
|
+
"docs": "- The id of the node to delete"
|
|
536
562
|
}],
|
|
537
563
|
"references": {
|
|
538
564
|
"Promise": {
|
|
@@ -543,21 +569,24 @@ export class RtkPaginatedList {
|
|
|
543
569
|
"return": "Promise<void>"
|
|
544
570
|
},
|
|
545
571
|
"docs": {
|
|
546
|
-
"text": "
|
|
547
|
-
"tags": [
|
|
572
|
+
"text": "Deletes a node anywhere from the list",
|
|
573
|
+
"tags": [{
|
|
574
|
+
"name": "param",
|
|
575
|
+
"text": "id - The id of the node to delete"
|
|
576
|
+
}]
|
|
548
577
|
}
|
|
549
578
|
},
|
|
550
579
|
"onNodeUpdate": {
|
|
551
580
|
"complexType": {
|
|
552
|
-
"signature": "(
|
|
581
|
+
"signature": "(_id: string, _node: DataNode) => Promise<void>",
|
|
553
582
|
"parameters": [{
|
|
554
|
-
"name": "
|
|
583
|
+
"name": "_id",
|
|
555
584
|
"type": "string",
|
|
556
|
-
"docs": ""
|
|
585
|
+
"docs": "- The id of the node to update"
|
|
557
586
|
}, {
|
|
558
|
-
"name": "
|
|
587
|
+
"name": "_node",
|
|
559
588
|
"type": "DataNode",
|
|
560
|
-
"docs": ""
|
|
589
|
+
"docs": "- The updated data node"
|
|
561
590
|
}],
|
|
562
591
|
"references": {
|
|
563
592
|
"Promise": {
|
|
@@ -573,18 +602,18 @@ export class RtkPaginatedList {
|
|
|
573
602
|
"return": "Promise<void>"
|
|
574
603
|
},
|
|
575
604
|
"docs": {
|
|
576
|
-
"text": "
|
|
577
|
-
"tags": [
|
|
605
|
+
"text": "Updates a new node anywhere in the list",
|
|
606
|
+
"tags": [{
|
|
607
|
+
"name": "param",
|
|
608
|
+
"text": "_id - The id of the node to update"
|
|
609
|
+
}, {
|
|
610
|
+
"name": "param",
|
|
611
|
+
"text": "_node - The updated data node"
|
|
612
|
+
}]
|
|
578
613
|
}
|
|
579
614
|
}
|
|
580
615
|
};
|
|
581
616
|
}
|
|
582
|
-
static get watchers() {
|
|
583
|
-
return [{
|
|
584
|
-
"propName": "selectedItemId",
|
|
585
|
-
"methodName": "onItemChanged"
|
|
586
|
-
}];
|
|
587
|
-
}
|
|
588
617
|
}
|
|
589
618
|
__decorate([
|
|
590
619
|
SyncWithStore()
|