@streamscloud/embeddable 15.1.0-1770823267010 → 16.0.0
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/ads/ad-card/cmp.ad-card.svelte +13 -13
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +12 -12
- package/dist/core/graphql.d.ts +1 -1
- package/dist/core/graphql.js +4 -9
- package/dist/core/media/index.d.ts +0 -2
- package/dist/core/media/index.js +0 -2
- package/dist/external-api/data-providers/internal-short-video-player-items-provider.d.ts +1 -1
- package/dist/external-api/data-providers/internal-short-video-player-items-provider.js +2 -2
- package/dist/external-api/data-providers/internal-streams-player-data-provider.js +2 -2
- package/dist/external-api/media-page/index.d.ts +1 -1
- package/dist/external-api/short-videos-player/index.d.ts +1 -1
- package/dist/external-api/streams-player/index.d.ts +1 -1
- package/dist/media-center/media-center/cmp.media-center-proxy.svelte +4 -4
- package/dist/media-center/media-center/cmp.media-center-proxy.svelte.d.ts +14 -13
- package/dist/media-center/media-center/discover/community-features-localization.d.ts +4 -6
- package/dist/media-center/media-center/discover/community-features-localization.js +12 -10
- package/dist/media-center/media-center/discover/community-features.svelte +7 -7
- package/dist/media-center/media-center/discover/community-features.svelte.d.ts +8 -13
- package/dist/media-center/media-center/discover/discover-header.svelte +11 -11
- package/dist/media-center/media-center/discover/discover-header.svelte.d.ts +6 -13
- package/dist/media-center/media-center/discover/discover-view-handler.svelte.js +1 -1
- package/dist/media-center/media-center/discover/discover-view-localization.d.ts +2 -5
- package/dist/media-center/media-center/discover/discover-view-localization.js +6 -8
- package/dist/media-center/media-center/discover/discover-view.svelte +3 -4
- package/dist/media-center/media-center/discover/discover-view.svelte.d.ts +11 -12
- package/dist/media-center/media-center/footer/media-center-footer.svelte +6 -6
- package/dist/media-center/media-center/footer/media-center-footer.svelte.d.ts +6 -13
- package/dist/media-center/media-center/handlers/media-center-settings-handler.svelte.d.ts +1 -1
- package/dist/media-center/media-center/header/media-center-header-localization.d.ts +2 -4
- package/dist/media-center/media-center/header/media-center-header-localization.js +12 -12
- package/dist/media-center/media-center/header/media-center-header-mobile.svelte +7 -7
- package/dist/media-center/media-center/header/media-center-header-mobile.svelte.d.ts +8 -12
- package/dist/media-center/media-center/header/media-center-header.svelte +10 -10
- package/dist/media-center/media-center/header/media-center-header.svelte.d.ts +10 -12
- package/dist/media-center/media-center/media-center-context.svelte.d.ts +1 -1
- package/dist/media-center/media-center/media-center-context.svelte.js +1 -1
- package/dist/media-center/media-center/media-center-settings.svelte.d.ts +1 -1
- package/dist/media-center/media-center/media-center-view.svelte +3 -3
- package/dist/media-center/media-center/media-center-view.svelte.d.ts +8 -13
- package/dist/media-center/media-center/menu/category-following-wrapper.svelte +4 -4
- package/dist/media-center/media-center/menu/category-following-wrapper.svelte.d.ts +10 -13
- package/dist/media-center/media-center/menu/menu-localization.d.ts +5 -8
- package/dist/media-center/media-center/menu/menu-localization.js +15 -14
- package/dist/media-center/media-center/menu/menu.svelte +12 -12
- package/dist/media-center/media-center/menu/menu.svelte.d.ts +11 -12
- package/dist/media-center/media-center/moments/cmp.moments-circle.svelte +4 -4
- package/dist/media-center/media-center/moments/cmp.moments-circle.svelte.d.ts +6 -13
- package/dist/media-center/media-center/moments/moments-feed-handler.svelte.d.ts +1 -1
- package/dist/media-center/media-center/moments/moments-feed-handler.svelte.js +1 -1
- package/dist/media-center/media-center/moments/moments-state.svelte.d.ts +1 -1
- package/dist/media-center/media-center/posts-feed/feed-providers-generator.d.ts +1 -1
- package/dist/media-center/media-center/posts-feed/feed-providers-generator.js +2 -2
- package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.d.ts +1 -1
- package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.js +2 -2
- package/dist/media-center/media-center/streams-feed/feed-providers-generator.js +2 -2
- package/dist/media-center/media-center/streams-feed/streams-feed-handler.svelte.js +1 -1
- package/dist/media-center/media-center/streams-in-category/streams-in-category-panel.svelte.d.ts +9 -12
- package/dist/media-center/media-center/types.d.ts +2 -2
- package/dist/media-page/cmp.media-page.svelte +1 -3
- package/dist/media-page/cmp.media-page.svelte.d.ts +10 -13
- package/dist/media-page/index.d.ts +2 -2
- package/dist/posts/attachments/cmp.attachments.svelte +1 -3
- package/dist/posts/attachments/cmp.attachments.svelte.d.ts +13 -12
- package/dist/posts/controls/post-actions-handler.svelte.d.ts +1 -1
- package/dist/posts/controls/post-actions-handler.svelte.js +1 -1
- package/dist/posts/post-viewer/attachments-horizontal.svelte +7 -7
- package/dist/posts/post-viewer/attachments-horizontal.svelte.d.ts +15 -12
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +6 -6
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +21 -12
- package/dist/posts/post-viewer/heading.svelte +5 -6
- package/dist/posts/post-viewer/heading.svelte.d.ts +10 -13
- package/dist/posts/post-viewer/media/post-media.svelte +10 -10
- package/dist/posts/post-viewer/media/post-media.svelte.d.ts +10 -12
- package/dist/posts/post-viewer/post-texts.svelte +5 -5
- package/dist/posts/post-viewer/post-texts.svelte.d.ts +10 -13
- package/dist/posts/post-viewer/post-viewer-localization.d.ts +2 -5
- package/dist/posts/post-viewer/post-viewer-localization.js +6 -8
- package/dist/posts/posts-player/cmp.posts-player.svelte.d.ts +21 -12
- package/dist/posts/posts-player/index.d.ts +1 -1
- package/dist/posts/posts-player/posts-player-proxy.svelte +5 -1
- package/dist/posts/posts-player/posts-player-proxy.svelte.d.ts +23 -12
- package/dist/posts/posts-player/posts-player-view.svelte +33 -28
- package/dist/posts/posts-player/posts-player-view.svelte.d.ts +4 -14
- package/dist/posts/posts-player/types.d.ts +2 -2
- package/dist/products/price-helper.js +1 -1
- package/dist/products/product-card/cmp.product-card.svelte +12 -12
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +13 -12
- package/dist/products/product-card/product-card-localization.d.ts +1 -3
- package/dist/products/product-card/product-card-localization.js +3 -4
- package/dist/short-videos/short-video-card/cmp.short-video-card.svelte +15 -15
- package/dist/short-videos/short-video-card/cmp.short-video-card.svelte.d.ts +8 -12
- package/dist/short-videos/short-video-card/localization.d.ts +1 -3
- package/dist/short-videos/short-video-card/localization.js +3 -4
- package/dist/streams/layout/cmp.layout.svelte +2 -2
- package/dist/streams/layout/cmp.layout.svelte.d.ts +11 -12
- package/dist/streams/layout/cmp.slot-content.svelte +4 -4
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +12 -12
- package/dist/streams/layout/cmp.slot.svelte.d.ts +13 -13
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte.d.ts +6 -13
- package/dist/streams/layout/element-views/cmp.button-stream-element.svelte.d.ts +9 -13
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +2 -3
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +10 -13
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +12 -13
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte.d.ts +8 -13
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +8 -13
- package/dist/streams/layout/element-views/cmp.products-slider-stream-element.svelte +4 -9
- package/dist/streams/layout/element-views/cmp.products-slider-stream-element.svelte.d.ts +10 -13
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +1 -4
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +10 -12
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte.d.ts +8 -13
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +7 -13
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +7 -8
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +14 -12
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte +5 -5
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +8 -13
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +5 -5
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +8 -13
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +6 -13
- package/dist/streams/layout/element-views/price-element-view.svelte +6 -6
- package/dist/streams/layout/element-views/price-element-view.svelte.d.ts +13 -12
- package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +2 -5
- package/dist/streams/layout/element-views/price-stream-element-localization.js +6 -8
- package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +1 -3
- package/dist/streams/layout/element-views/stock-stream-element-localization.js +3 -4
- package/dist/streams/layout/index.js +1 -1
- package/dist/streams/layout/serializer.svelte.js +5 -6
- package/dist/streams/layout/styles-transformer.js +1 -1
- package/dist/streams/stream-card/cmp.stream-card.svelte +3 -3
- package/dist/streams/stream-card/cmp.stream-card.svelte.d.ts +9 -12
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +5 -7
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +19 -12
- package/dist/streams/streams-player/cmp.streams-player.svelte.d.ts +24 -12
- package/dist/streams/streams-player/index.d.ts +1 -1
- package/dist/streams/streams-player/stream-overview.svelte +4 -4
- package/dist/streams/streams-player/stream-overview.svelte.d.ts +9 -12
- package/dist/streams/streams-player/stream-player-localization.d.ts +1 -4
- package/dist/streams/streams-player/stream-player-localization.js +3 -6
- package/dist/streams/streams-player/streams-player-buffer.svelte.d.ts +1 -1
- package/dist/streams/streams-player/streams-player-buffer.svelte.js +1 -1
- package/dist/streams/streams-player/streams-player-proxy.svelte +5 -1
- package/dist/streams/streams-player/streams-player-proxy.svelte.d.ts +26 -12
- package/dist/streams/streams-player/streams-player-view.svelte +70 -66
- package/dist/streams/streams-player/streams-player-view.svelte.d.ts +4 -14
- package/dist/streams/streams-player/types.d.ts +1 -1
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +4 -4
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +11 -12
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +11 -12
- package/dist/ui/media-items-gallery/types.js +2 -1
- package/dist/ui/player/player/cmp.player.svelte +18 -16
- package/dist/ui/player/player/cmp.player.svelte.d.ts +31 -17
- package/dist/ui/player/player/controls-and-attachments.svelte +15 -20
- package/dist/ui/player/player/controls-and-attachments.svelte.d.ts +28 -17
- package/dist/ui/player/player/overview-panel.svelte +26 -24
- package/dist/ui/player/player/overview-panel.svelte.d.ts +12 -12
- package/dist/ui/player/player/player-config.svelte.d.ts +4 -4
- package/dist/ui/player/player/player-config.svelte.js +3 -3
- package/dist/ui/player/player/player-settings.svelte.d.ts +1 -1
- package/dist/ui/player/progress/cmp.chunks-progress.svelte.d.ts +8 -13
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte +9 -3
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte.d.ts +12 -13
- package/dist/ui/shadow-dom/colors.scss +2 -2
- package/package.json +12 -13
- package/dist/core/actions/horizontal-wheel-scroll.d.ts +0 -5
- package/dist/core/actions/horizontal-wheel-scroll.js +0 -20
- package/dist/core/actions/index.d.ts +0 -2
- package/dist/core/actions/index.js +0 -2
- package/dist/core/actions/swallow-touch.d.ts +0 -2
- package/dist/core/actions/swallow-touch.js +0 -17
- package/dist/core/browser.d.ts +0 -1
- package/dist/core/browser.js +0 -1
- package/dist/core/continuation-token.d.ts +0 -1
- package/dist/core/continuation-token.js +0 -1
- package/dist/core/cursor-result.d.ts +0 -1
- package/dist/core/cursor-result.js +0 -1
- package/dist/core/data-loaders/index.d.ts +0 -2
- package/dist/core/data-loaders/index.js +0 -1
- package/dist/core/deferred.d.ts +0 -1
- package/dist/core/deferred.js +0 -1
- package/dist/core/document.event-handlers.d.ts +0 -2
- package/dist/core/document.event-handlers.js +0 -8
- package/dist/core/image-preloader.d.ts +0 -1
- package/dist/core/image-preloader.js +0 -10
- package/dist/core/locale.d.ts +0 -4
- package/dist/core/locale.js +0 -1
- package/dist/core/media/images-size-detector.service.d.ts +0 -6
- package/dist/core/media/images-size-detector.service.js +0 -15
- package/dist/core/toastr.d.ts +0 -1
- package/dist/core/toastr.js +0 -1
- package/dist/core/transitions/index.d.ts +0 -1
- package/dist/core/transitions/index.js +0 -1
- package/dist/core/utils/compact-number.d.ts +0 -8
- package/dist/core/utils/compact-number.js +0 -48
- package/dist/core/utils/date-helper.d.ts +0 -1
- package/dist/core/utils/date-helper.js +0 -1
- package/dist/core/utils/html-helper.d.ts +0 -1
- package/dist/core/utils/html-helper.js +0 -1
- package/dist/core/utils/index.d.ts +0 -1
- package/dist/core/utils/index.js +0 -1
- package/dist/core/utils/string-generator.d.ts +0 -1
- package/dist/core/utils/string-generator.js +0 -1
- package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +0 -5
- package/dist/streams/layout/element-views/short-video-stream-element-localization.js +0 -7
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +0 -5
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +0 -7
- package/dist/ui/button/index.d.ts +0 -3
- package/dist/ui/button/index.js +0 -1
- package/dist/ui/card-actions/card-action-container.d.ts +0 -2
- package/dist/ui/card-actions/card-action-container.js +0 -17
- package/dist/ui/card-actions/cmp.card-action.svelte +0 -28
- package/dist/ui/card-actions/cmp.card-action.svelte.d.ts +0 -14
- package/dist/ui/card-actions/cmp.card-actions.svelte +0 -60
- package/dist/ui/card-actions/cmp.card-actions.svelte.d.ts +0 -14
- package/dist/ui/card-actions/index.d.ts +0 -4
- package/dist/ui/card-actions/index.js +0 -3
- package/dist/ui/card-actions/types.d.ts +0 -9
- package/dist/ui/card-actions/types.js +0 -1
- package/dist/ui/dropdown/cmp.dropdown.svelte +0 -173
- package/dist/ui/dropdown/cmp.dropdown.svelte.d.ts +0 -14
- package/dist/ui/dropdown/dropdown-ignore.d.ts +0 -6
- package/dist/ui/dropdown/dropdown-ignore.js +0 -11
- package/dist/ui/dropdown/index.d.ts +0 -3
- package/dist/ui/dropdown/index.js +0 -2
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte +0 -5
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte.d.ts +0 -14
- package/dist/ui/dynamic-component/index.d.ts +0 -2
- package/dist/ui/dynamic-component/index.js +0 -2
- package/dist/ui/dynamic-component/types.svelte.d.ts +0 -11
- package/dist/ui/dynamic-component/types.svelte.js +0 -13
- package/dist/ui/icon/index.d.ts +0 -2
- package/dist/ui/icon/index.js +0 -1
- package/dist/ui/icon/types.d.ts +0 -1
- package/dist/ui/icon/types.js +0 -1
- package/dist/ui/image/index.d.ts +0 -1
- package/dist/ui/image/index.js +0 -1
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte +0 -75
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte.d.ts +0 -14
- package/dist/ui/infinite-scrolling/index.d.ts +0 -1
- package/dist/ui/infinite-scrolling/index.js +0 -1
- package/dist/ui/line-clamp/cmp.line-clamp-auto.svelte +0 -119
- package/dist/ui/line-clamp/cmp.line-clamp-auto.svelte.d.ts +0 -14
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +0 -84
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +0 -14
- package/dist/ui/line-clamp/index.d.ts +0 -2
- package/dist/ui/line-clamp/index.js +0 -2
- package/dist/ui/line-clamp/line-clamp-localization.d.ts +0 -6
- package/dist/ui/line-clamp/line-clamp-localization.js +0 -19
- package/dist/ui/line-clamp/line-clamp-types.d.ts +0 -3
- package/dist/ui/line-clamp/line-clamp-types.js +0 -1
- package/dist/ui/line-clamp/line-clamp-utils.d.ts +0 -8
- package/dist/ui/line-clamp/line-clamp-utils.js +0 -33
- package/dist/ui/loading/cmp.loading.svelte +0 -80
- package/dist/ui/loading/cmp.loading.svelte.d.ts +0 -14
- package/dist/ui/loading/index.d.ts +0 -1
- package/dist/ui/loading/index.js +0 -1
- package/dist/ui/media-playback/index.d.ts +0 -2
- package/dist/ui/media-playback/index.js +0 -2
- package/dist/ui/media-playback/playback-manager.svelte.d.ts +0 -25
- package/dist/ui/media-playback/playback-manager.svelte.js +0 -62
- package/dist/ui/media-playback/volume-manager.svelte.d.ts +0 -10
- package/dist/ui/media-playback/volume-manager.svelte.js +0 -27
- package/dist/ui/player/button/cmp.mobile-player-buttons.svelte +0 -37
- package/dist/ui/player/button/cmp.mobile-player-buttons.svelte.d.ts +0 -14
- package/dist/ui/player/button/cmp.player-buttons.svelte +0 -127
- package/dist/ui/player/button/cmp.player-buttons.svelte.d.ts +0 -14
- package/dist/ui/player/button/cmp.responsive-player-buttons.svelte +0 -32
- package/dist/ui/player/button/cmp.responsive-player-buttons.svelte.d.ts +0 -14
- package/dist/ui/player/button/index.d.ts +0 -4
- package/dist/ui/player/button/index.js +0 -3
- package/dist/ui/player/button/types.d.ts +0 -7
- package/dist/ui/player/button/types.js +0 -1
- package/dist/ui/player/providers/chunks-player-buffer/index.d.ts +0 -2
- package/dist/ui/player/providers/chunks-player-buffer/index.js +0 -2
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk-item.svelte.d.ts +0 -9
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk-item.svelte.js +0 -9
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk.svelte.d.ts +0 -30
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk.svelte.js +0 -73
- package/dist/ui/player/providers/chunks-player-buffer/player-chunks-manager.svelte.d.ts +0 -23
- package/dist/ui/player/providers/chunks-player-buffer/player-chunks-manager.svelte.js +0 -220
- package/dist/ui/player/providers/default-chunks-player-buffer.svelte.d.ts +0 -23
- package/dist/ui/player/providers/default-chunks-player-buffer.svelte.js +0 -71
- package/dist/ui/player/providers/default-feed-player-buffer.svelte.d.ts +0 -29
- package/dist/ui/player/providers/default-feed-player-buffer.svelte.js +0 -121
- package/dist/ui/player/providers/index.d.ts +0 -3
- package/dist/ui/player/providers/index.js +0 -2
- package/dist/ui/player/providers/service.d.ts +0 -2
- package/dist/ui/player/providers/service.js +0 -13
- package/dist/ui/player/providers/types.d.ts +0 -54
- package/dist/ui/player/providers/types.js +0 -1
- package/dist/ui/player/slider/cmp.player-slider.svelte +0 -207
- package/dist/ui/player/slider/cmp.player-slider.svelte.d.ts +0 -24
- package/dist/ui/player/slider/index.d.ts +0 -2
- package/dist/ui/player/slider/index.js +0 -2
- package/dist/ui/player/slider/prevent-slider-scroll.d.ts +0 -5
- package/dist/ui/player/slider/prevent-slider-scroll.js +0 -11
- package/dist/ui/player/slider/types.d.ts +0 -16
- package/dist/ui/player/slider/types.js +0 -1
- package/dist/ui/player/slider/wheel-gestures-adapter.d.ts +0 -17
- package/dist/ui/player/slider/wheel-gestures-adapter.js +0 -79
- package/dist/ui/player/slider-horizontal/cmp.slider.svelte +0 -413
- package/dist/ui/player/slider-horizontal/cmp.slider.svelte.d.ts +0 -14
- package/dist/ui/player/slider-horizontal/index.d.ts +0 -2
- package/dist/ui/player/slider-horizontal/index.js +0 -2
- package/dist/ui/player/slider-horizontal/slider-localization.d.ts +0 -5
- package/dist/ui/player/slider-horizontal/slider-localization.js +0 -13
- package/dist/ui/player/slider-horizontal/types.d.ts +0 -11
- package/dist/ui/player/slider-horizontal/types.js +0 -8
- package/dist/ui/player/utils/index.d.ts +0 -1
- package/dist/ui/player/utils/index.js +0 -1
- package/dist/ui/player/utils/touch-synchronizer.d.ts +0 -7
- package/dist/ui/player/utils/touch-synchronizer.js +0 -21
- package/dist/ui/progress/cmp.progress.svelte +0 -29
- package/dist/ui/progress/cmp.progress.svelte.d.ts +0 -14
- package/dist/ui/progress/index.d.ts +0 -1
- package/dist/ui/progress/index.js +0 -1
- package/dist/ui/proportional-container/cmp.proportional-container.svelte +0 -25
- package/dist/ui/proportional-container/cmp.proportional-container.svelte.d.ts +0 -14
- package/dist/ui/proportional-container/index.d.ts +0 -1
- package/dist/ui/proportional-container/index.js +0 -1
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +0 -156
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +0 -14
- package/dist/ui/seek-bar/index.d.ts +0 -1
- package/dist/ui/seek-bar/index.js +0 -1
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +0 -113
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +0 -14
- package/dist/ui/swipe-indicator/index.d.ts +0 -1
- package/dist/ui/swipe-indicator/index.js +0 -1
- package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +0 -5
- package/dist/ui/swipe-indicator/swipe-indicator-localization.js +0 -13
- package/dist/ui/time-ago/cmp.time-ago.svelte +0 -69
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +0 -14
- package/dist/ui/time-ago/index.d.ts +0 -1
- package/dist/ui/time-ago/index.js +0 -1
- package/dist/ui/time-ago/time-ago-localization.d.ts +0 -12
- package/dist/ui/time-ago/time-ago-localization.js +0 -55
- package/dist/ui/video/cmp.video.svelte +0 -376
- package/dist/ui/video/cmp.video.svelte.d.ts +0 -14
- package/dist/ui/video/index.d.ts +0 -2
- package/dist/ui/video/index.js +0 -2
- package/dist/ui/video/types.d.ts +0 -4
- package/dist/ui/video/types.js +0 -5
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { Icon } from '../../icon';
|
|
2
|
-
let { actions, scaleEffect = false, zoom = 1 } = $props();
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
{#if actions.length === 1}
|
|
6
|
-
{@const action = actions[0]}
|
|
7
|
-
<button
|
|
8
|
-
type="button"
|
|
9
|
-
class="player-button"
|
|
10
|
-
style:zoom={zoom}
|
|
11
|
-
class:player-button--scale-effect={scaleEffect}
|
|
12
|
-
disabled={action.disabled}
|
|
13
|
-
onclick={action.callback}>
|
|
14
|
-
<span class="player-button__icon">
|
|
15
|
-
<Icon src={action.icon} color={action.iconColor} />
|
|
16
|
-
</span>
|
|
17
|
-
</button>
|
|
18
|
-
{:else if actions.length > 1}
|
|
19
|
-
<div class="player-buttons" style:zoom={zoom}>
|
|
20
|
-
{#each actions as action (action.icon)}
|
|
21
|
-
<button
|
|
22
|
-
type="button"
|
|
23
|
-
class="player-buttons__action"
|
|
24
|
-
class:player-buttons__action--scale-effect={scaleEffect}
|
|
25
|
-
disabled={action.disabled}
|
|
26
|
-
onclick={action.callback}>
|
|
27
|
-
<span class="player-buttons__action-icon">
|
|
28
|
-
<Icon src={action.icon} color={action.iconColor} />
|
|
29
|
-
</span>
|
|
30
|
-
</button>
|
|
31
|
-
{/each}
|
|
32
|
-
</div>
|
|
33
|
-
{/if}
|
|
34
|
-
|
|
35
|
-
<style>.player-button {
|
|
36
|
-
--_player-button--color: var(--player-button--color, rgb(from light-dark(#272727, #000000) r g b / 95%));
|
|
37
|
-
--_player-button--color--inactive: var(--player-button--color--inactive, rgb(from var(--_player-button--color) r g b / 60%));
|
|
38
|
-
--_player-button--icon-scale: 1;
|
|
39
|
-
pointer-events: auto;
|
|
40
|
-
padding: 0.625rem;
|
|
41
|
-
display: flex;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
align-items: center;
|
|
44
|
-
background-color: var(--_player-button--color--inactive);
|
|
45
|
-
transition: background-color 0.5s;
|
|
46
|
-
border-radius: 50%;
|
|
47
|
-
color: var(--sc-mc-color--text-white);
|
|
48
|
-
--icon--color: var(--sc-mc-color--icon-overlay);
|
|
49
|
-
--icon--size: 1.75rem;
|
|
50
|
-
}
|
|
51
|
-
.player-button:hover:not(:disabled) {
|
|
52
|
-
background-color: var(--_player-button--color);
|
|
53
|
-
}
|
|
54
|
-
.player-button:disabled {
|
|
55
|
-
opacity: 0.5;
|
|
56
|
-
cursor: default;
|
|
57
|
-
}
|
|
58
|
-
.player-button--scale-effect:hover:not(:disabled) {
|
|
59
|
-
--_player-button--icon-scale: 1.2;
|
|
60
|
-
}
|
|
61
|
-
.player-button__icon {
|
|
62
|
-
display: block;
|
|
63
|
-
transform: scale(var(--_player-button--icon-scale));
|
|
64
|
-
transition: 0.3s;
|
|
65
|
-
}
|
|
66
|
-
.player-button {
|
|
67
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
68
|
-
}
|
|
69
|
-
@container (width < 576px) {
|
|
70
|
-
.player-button {
|
|
71
|
-
padding: 0.5rem;
|
|
72
|
-
--icon--size: 1.5rem;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.player-buttons {
|
|
77
|
-
--_player-button--color: var(--player-button--color, rgb(from light-dark(#272727, #000000) r g b / 95%));
|
|
78
|
-
--_player-button--color--inactive: var(--player-button--color--inactive, rgb(from var(--_player-button--color) r g b / 60%));
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
display: flex;
|
|
81
|
-
flex-direction: column;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
border-radius: 1.25rem;
|
|
84
|
-
background: var(--_player-button--color--inactive);
|
|
85
|
-
padding: 0.4375rem 0.0625rem;
|
|
86
|
-
pointer-events: auto;
|
|
87
|
-
}
|
|
88
|
-
.player-buttons__action {
|
|
89
|
-
--_player-button--icon-scale: 1;
|
|
90
|
-
display: flex;
|
|
91
|
-
justify-content: center;
|
|
92
|
-
align-items: center;
|
|
93
|
-
padding: 0.5625rem;
|
|
94
|
-
border-radius: 1.25rem;
|
|
95
|
-
color: var(--sc-mc-color--text-white);
|
|
96
|
-
--icon--color: var(--sc-mc-color--icon-overlay);
|
|
97
|
-
--icon--size: 1.75rem;
|
|
98
|
-
transition: background-color 0.5s;
|
|
99
|
-
}
|
|
100
|
-
.player-buttons__action:hover:not(:disabled) {
|
|
101
|
-
background-color: var(--_player-button--color);
|
|
102
|
-
}
|
|
103
|
-
.player-buttons__action:disabled {
|
|
104
|
-
opacity: 0.5;
|
|
105
|
-
cursor: default;
|
|
106
|
-
}
|
|
107
|
-
.player-buttons__action--scale-effect:hover:not(:disabled) {
|
|
108
|
-
--_player-button--icon-scale: 1.2;
|
|
109
|
-
background-color: transparent;
|
|
110
|
-
}
|
|
111
|
-
.player-buttons__action-icon {
|
|
112
|
-
display: block;
|
|
113
|
-
transform: scale(var(--_player-button--icon-scale));
|
|
114
|
-
transition: 0.3s;
|
|
115
|
-
}
|
|
116
|
-
.player-buttons {
|
|
117
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
118
|
-
}
|
|
119
|
-
@container (width < 576px) {
|
|
120
|
-
.player-buttons {
|
|
121
|
-
border-radius: 0.9375rem;
|
|
122
|
-
padding: 0.25rem 0.0625rem;
|
|
123
|
-
}
|
|
124
|
-
.player-buttons__action {
|
|
125
|
-
--icon--size: 1.5rem;
|
|
126
|
-
}
|
|
127
|
-
}</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: Record<string, never>;
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
export type CmpProps = typeof __propDef.props;
|
|
10
|
-
export type CmpEvents = typeof __propDef.events;
|
|
11
|
-
export type CmpSlots = typeof __propDef.slots;
|
|
12
|
-
export default class Cmp extends SvelteComponentTyped<CmpProps, CmpEvents, CmpSlots> {
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { default as MobilePlayerButtons } from './cmp.mobile-player-buttons.svelte';
|
|
2
|
-
import { default as PlayerButtons } from './cmp.player-buttons.svelte';
|
|
3
|
-
let { scaleEffect = false, actions } = $props();
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<div class="desktop-controls">
|
|
7
|
-
<PlayerButtons actions={actions} scaleEffect={scaleEffect} />
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div class="mobile-controls">
|
|
11
|
-
<MobilePlayerButtons actions={actions} />
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<style>.desktop-controls {
|
|
15
|
-
display: contents;
|
|
16
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
17
|
-
}
|
|
18
|
-
@container (width < 576px) {
|
|
19
|
-
.desktop-controls {
|
|
20
|
-
display: none;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.mobile-controls {
|
|
25
|
-
display: none;
|
|
26
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
27
|
-
}
|
|
28
|
-
@container (width < 576px) {
|
|
29
|
-
.mobile-controls {
|
|
30
|
-
display: contents;
|
|
31
|
-
}
|
|
32
|
-
}</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: Record<string, never>;
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
export type CmpProps = typeof __propDef.props;
|
|
10
|
-
export type CmpEvents = typeof __propDef.events;
|
|
11
|
-
export type CmpSlots = typeof __propDef.slots;
|
|
12
|
-
export default class Cmp extends SvelteComponentTyped<CmpProps, CmpEvents, CmpSlots> {
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as PlayerButtons } from './cmp.player-buttons.svelte';
|
|
2
|
-
export { default as MobilePlayerButtons } from './cmp.mobile-player-buttons.svelte';
|
|
3
|
-
export { default as ResponsivePlayerButtons } from './cmp.responsive-player-buttons.svelte';
|
|
4
|
-
export type { PlayerButtonDef } from './types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PlayerChunkItem } from './player-chunk-item.svelte';
|
|
2
|
-
import type { WithId } from '../types';
|
|
3
|
-
export declare class PlayerChunk<TItem extends WithId, TChunk extends WithId> {
|
|
4
|
-
readonly model: TChunk;
|
|
5
|
-
readonly items: TItem[];
|
|
6
|
-
readonly chunkItems: PlayerChunkItem<TItem>[];
|
|
7
|
-
readonly activeChunkItem: PlayerChunkItem<TItem>;
|
|
8
|
-
private _chunkItems;
|
|
9
|
-
private _activeItemIndex;
|
|
10
|
-
private _fetchDeferred;
|
|
11
|
-
private _itemsLoader;
|
|
12
|
-
constructor(data: {
|
|
13
|
-
chunk: TChunk;
|
|
14
|
-
provider: {
|
|
15
|
-
loadChunkItems: (chunkId: string, continuationToken: string | null | undefined) => Promise<{
|
|
16
|
-
items: TItem[];
|
|
17
|
-
continuationToken: string | null;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
callbacks?: {
|
|
21
|
-
onChunkFullyLoaded: (chunk: PlayerChunk<TItem, TChunk>) => void;
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
get isLoading(): boolean;
|
|
25
|
-
get canLoadMore(): any;
|
|
26
|
-
get activeItemIndex(): number;
|
|
27
|
-
loadMore: () => any;
|
|
28
|
-
setActiveItemIndex: (index: number) => Promise<void>;
|
|
29
|
-
mutateChunkItems: (items: PlayerChunkItem<TItem>[]) => void;
|
|
30
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ContinuationToken } from '../../../../core/continuation-token';
|
|
2
|
-
import { CursorDataLoader } from '../../../../core/data-loaders';
|
|
3
|
-
import { Deferred } from '../../../../core/deferred';
|
|
4
|
-
import { PlayerChunkItem } from './player-chunk-item.svelte';
|
|
5
|
-
export class PlayerChunk {
|
|
6
|
-
model;
|
|
7
|
-
items = $derived.by(() => this._chunkItems.map((i) => i.model));
|
|
8
|
-
chunkItems = $derived.by(() => this._chunkItems);
|
|
9
|
-
activeChunkItem = $derived.by(() => this._chunkItems[this._activeItemIndex] ?? null);
|
|
10
|
-
_chunkItems = $state.raw([]);
|
|
11
|
-
_activeItemIndex = $state(0);
|
|
12
|
-
_fetchDeferred = $state.raw(null);
|
|
13
|
-
_itemsLoader;
|
|
14
|
-
constructor(data) {
|
|
15
|
-
const { chunk, provider, callbacks } = data;
|
|
16
|
-
this.model = chunk;
|
|
17
|
-
this._itemsLoader = new CursorDataLoader({
|
|
18
|
-
loadPage: async (continuationToken) => {
|
|
19
|
-
if (this._fetchDeferred) {
|
|
20
|
-
return await this._fetchDeferred.promise;
|
|
21
|
-
}
|
|
22
|
-
if (!this.canLoadMore) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
this._fetchDeferred = new Deferred();
|
|
27
|
-
const itemsResult = await provider.loadChunkItems(this.model.id, continuationToken.toNextChunkString());
|
|
28
|
-
const newItems = itemsResult.items;
|
|
29
|
-
this._chunkItems = [
|
|
30
|
-
...this._chunkItems,
|
|
31
|
-
...newItems.map((item) => new PlayerChunkItem({
|
|
32
|
-
model: item,
|
|
33
|
-
chunkId: this.model.id
|
|
34
|
-
}))
|
|
35
|
-
];
|
|
36
|
-
const continuationTokenResult = ContinuationToken.fromPayload(itemsResult.continuationToken);
|
|
37
|
-
if (!continuationTokenResult.canLoadMore) {
|
|
38
|
-
callbacks?.onChunkFullyLoaded(this);
|
|
39
|
-
}
|
|
40
|
-
const result = {
|
|
41
|
-
items: newItems,
|
|
42
|
-
continuationToken: continuationTokenResult
|
|
43
|
-
};
|
|
44
|
-
this._fetchDeferred.resolve(result);
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
this._fetchDeferred?.resolve(null);
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
finally {
|
|
52
|
-
this._fetchDeferred = null;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
get isLoading() {
|
|
58
|
-
return !!this._fetchDeferred;
|
|
59
|
-
}
|
|
60
|
-
get canLoadMore() {
|
|
61
|
-
return this._itemsLoader.continuationToken.canLoadMore;
|
|
62
|
-
}
|
|
63
|
-
get activeItemIndex() {
|
|
64
|
-
return this._activeItemIndex;
|
|
65
|
-
}
|
|
66
|
-
loadMore = () => this._itemsLoader.loadMore();
|
|
67
|
-
setActiveItemIndex = async (index) => {
|
|
68
|
-
this._activeItemIndex = index;
|
|
69
|
-
};
|
|
70
|
-
mutateChunkItems = (items) => {
|
|
71
|
-
this._chunkItems = items;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PlayerChunk } from './player-chunk.svelte';
|
|
2
|
-
import type { IChunksPlayerDataProvider, WithId } from '../types';
|
|
3
|
-
export declare class PlayerChunksManager<TItem extends WithId, TChunk extends WithId> {
|
|
4
|
-
private provider;
|
|
5
|
-
private _activeChunkIndex;
|
|
6
|
-
private _loadedChunks;
|
|
7
|
-
private _warmUpDeferred;
|
|
8
|
-
constructor(provider: IChunksPlayerDataProvider<TItem, TChunk>);
|
|
9
|
-
get activeChunk(): PlayerChunk<TItem, TChunk>;
|
|
10
|
-
get loadedChunks(): PlayerChunk<TItem, TChunk>[];
|
|
11
|
-
get isLoading(): boolean;
|
|
12
|
-
get flattenedChunkItems(): TItem[];
|
|
13
|
-
get flattenedActiveChunkItemIndex(): number;
|
|
14
|
-
tryActivateItemById: (id: string) => boolean;
|
|
15
|
-
removeItemById: (id: string) => boolean;
|
|
16
|
-
removeChunkById: (id: string) => boolean | undefined;
|
|
17
|
-
initialize: () => Promise<void>;
|
|
18
|
-
setActiveChunkIndex: (index: number, chunkItemIndex: number) => Promise<void>;
|
|
19
|
-
activateItemAtFlattenedIndex: (index: number) => Promise<void>;
|
|
20
|
-
warmUp: () => Promise<any>;
|
|
21
|
-
reset: () => Promise<void>;
|
|
22
|
-
private warmUpSequentially;
|
|
23
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { Deferred } from '../../../../core/deferred';
|
|
2
|
-
import { PlayerChunk } from './player-chunk.svelte';
|
|
3
|
-
const ITEMS_BUFFER_SIZE = 10;
|
|
4
|
-
// Configuration: if true, always start from first item when switching chunks
|
|
5
|
-
// if false, activate the exact item at its position in the new chunk
|
|
6
|
-
const START_FROM_FIRST_ITEM_ON_CHUNK_SWITCH = true;
|
|
7
|
-
export class PlayerChunksManager {
|
|
8
|
-
provider;
|
|
9
|
-
_activeChunkIndex = $state(-1);
|
|
10
|
-
_loadedChunks = $state.raw([]);
|
|
11
|
-
_warmUpDeferred = $state.raw(null);
|
|
12
|
-
constructor(provider) {
|
|
13
|
-
this.provider = provider;
|
|
14
|
-
}
|
|
15
|
-
get activeChunk() {
|
|
16
|
-
return this._loadedChunks[this._activeChunkIndex] ?? null;
|
|
17
|
-
}
|
|
18
|
-
get loadedChunks() {
|
|
19
|
-
return this._loadedChunks;
|
|
20
|
-
}
|
|
21
|
-
get isLoading() {
|
|
22
|
-
return this._warmUpDeferred !== null || this._loadedChunks.some((c) => c.isLoading);
|
|
23
|
-
}
|
|
24
|
-
get flattenedChunkItems() {
|
|
25
|
-
return this._loadedChunks.reduce((acc, chunk) => {
|
|
26
|
-
acc.push(...chunk.items);
|
|
27
|
-
return acc;
|
|
28
|
-
}, []);
|
|
29
|
-
}
|
|
30
|
-
get flattenedActiveChunkItemIndex() {
|
|
31
|
-
if (!this.activeChunk || !this.activeChunk.activeChunkItem) {
|
|
32
|
-
return -1;
|
|
33
|
-
}
|
|
34
|
-
let itemsBeforeActiveChunk = 0;
|
|
35
|
-
for (let i = 0; i < this._activeChunkIndex; i++) {
|
|
36
|
-
itemsBeforeActiveChunk += this._loadedChunks[i].items.length;
|
|
37
|
-
}
|
|
38
|
-
return itemsBeforeActiveChunk + this.activeChunk.activeItemIndex;
|
|
39
|
-
}
|
|
40
|
-
tryActivateItemById = (id) => {
|
|
41
|
-
const chunkWithItemIndex = this._loadedChunks.findIndex((chunk) => chunk.items.some((item) => item.id === id));
|
|
42
|
-
const chunkWithItem = this._loadedChunks[chunkWithItemIndex];
|
|
43
|
-
if (!chunkWithItem) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const itemIndex = chunkWithItem.items.findIndex((item) => item.id === id);
|
|
47
|
-
this.setActiveChunkIndex(chunkWithItemIndex, itemIndex);
|
|
48
|
-
return true;
|
|
49
|
-
};
|
|
50
|
-
removeItemById = (id) => {
|
|
51
|
-
const itemIndex = this.flattenedChunkItems.findIndex((item) => item.id === id);
|
|
52
|
-
if (itemIndex === -1) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
const currentItem = this.flattenedChunkItems[this.flattenedActiveChunkItemIndex];
|
|
56
|
-
// Find next item to activate BEFORE removing (if removing current item)
|
|
57
|
-
let nextItemId = currentItem?.id;
|
|
58
|
-
if (this.flattenedActiveChunkItemIndex === itemIndex) {
|
|
59
|
-
// Try next item
|
|
60
|
-
if (itemIndex + 1 < this.flattenedChunkItems.length) {
|
|
61
|
-
nextItemId = this.flattenedChunkItems[itemIndex + 1].id;
|
|
62
|
-
}
|
|
63
|
-
// Try previous item
|
|
64
|
-
else if (itemIndex > 0) {
|
|
65
|
-
nextItemId = this.flattenedChunkItems[itemIndex - 1].id;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
// No items left
|
|
69
|
-
nextItemId = null;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Remove item from chunks
|
|
73
|
-
this._loadedChunks.forEach((chunk) => {
|
|
74
|
-
if (chunk.chunkItems.some((i) => i.model.id === id)) {
|
|
75
|
-
chunk.mutateChunkItems(chunk.chunkItems.filter((i) => i.model.id !== id));
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
if (nextItemId) {
|
|
79
|
-
this.tryActivateItemById(nextItemId);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this._activeChunkIndex = -1;
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
85
|
-
};
|
|
86
|
-
removeChunkById = (id) => {
|
|
87
|
-
const chunkIndex = this._loadedChunks.findIndex((chunk) => chunk.model.id === id);
|
|
88
|
-
if (chunkIndex === -1) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
const isActiveChunk = this._activeChunkIndex === chunkIndex;
|
|
92
|
-
let newActiveChunkIndex = this._activeChunkIndex;
|
|
93
|
-
this._loadedChunks.splice(chunkIndex, 1);
|
|
94
|
-
if (this._loadedChunks.length === 0) {
|
|
95
|
-
this._activeChunkIndex = -1;
|
|
96
|
-
this.provider.onEndReached?.();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (isActiveChunk) {
|
|
100
|
-
if (chunkIndex < this._loadedChunks.length) {
|
|
101
|
-
newActiveChunkIndex = chunkIndex;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
newActiveChunkIndex = this._loadedChunks.length - 1;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else if (this._activeChunkIndex > chunkIndex) {
|
|
108
|
-
newActiveChunkIndex--;
|
|
109
|
-
}
|
|
110
|
-
this.setActiveChunkIndex(newActiveChunkIndex, 0);
|
|
111
|
-
return true;
|
|
112
|
-
};
|
|
113
|
-
initialize = async () => {
|
|
114
|
-
this._loadedChunks = this.provider.initialData.prefetchedChunks.map((chunk) => new PlayerChunk({ chunk, provider: { loadChunkItems: this.provider.loadChunkItems } }));
|
|
115
|
-
await this.warmUp();
|
|
116
|
-
if (this._loadedChunks.length === 0 || this.flattenedChunkItems.length === 0) {
|
|
117
|
-
this.provider.onEndReached?.();
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const firstFilledChunkIndex = this._loadedChunks.findIndex((c) => c.items.length > 0);
|
|
121
|
-
const initialStartItemIndex = firstFilledChunkIndex === 0 && this.provider.initialData.startItemIndex && this.provider.initialData.startItemIndex > 0
|
|
122
|
-
? this.provider.initialData.startItemIndex
|
|
123
|
-
: 0;
|
|
124
|
-
this.setActiveChunkIndex(firstFilledChunkIndex, initialStartItemIndex);
|
|
125
|
-
};
|
|
126
|
-
setActiveChunkIndex = async (index, chunkItemIndex) => {
|
|
127
|
-
this._activeChunkIndex = index;
|
|
128
|
-
this.activeChunk.setActiveItemIndex(chunkItemIndex);
|
|
129
|
-
// Don't wait for warm up to be finished, it runs in the background
|
|
130
|
-
this.warmUp();
|
|
131
|
-
};
|
|
132
|
-
activateItemAtFlattenedIndex = async (index) => {
|
|
133
|
-
const activeChunkId = this.activeChunk?.model.id;
|
|
134
|
-
const flattenedItems = this.loadedChunks.flatMap((x) => x.chunkItems);
|
|
135
|
-
const nextItem = flattenedItems[index];
|
|
136
|
-
if (!nextItem) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (nextItem.chunkId !== activeChunkId) {
|
|
140
|
-
const nextChunkIndex = this.loadedChunks.findIndex((c) => c.model.id === nextItem.chunkId);
|
|
141
|
-
if (nextChunkIndex === -1) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const itemIndexInChunk = START_FROM_FIRST_ITEM_ON_CHUNK_SWITCH ? 0 : this.loadedChunks[nextChunkIndex].chunkItems.indexOf(nextItem);
|
|
145
|
-
this.setActiveChunkIndex(nextChunkIndex, itemIndexInChunk);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
this.activeChunk.setActiveItemIndex(this.activeChunk.chunkItems.indexOf(nextItem));
|
|
149
|
-
// Don't wait for warm up to be finished, it runs in the background
|
|
150
|
-
this.warmUp();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
warmUp = async () => {
|
|
154
|
-
if (this._warmUpDeferred) {
|
|
155
|
-
return this._warmUpDeferred.promise;
|
|
156
|
-
}
|
|
157
|
-
this._warmUpDeferred = new Deferred();
|
|
158
|
-
try {
|
|
159
|
-
await this.warmUpSequentially();
|
|
160
|
-
}
|
|
161
|
-
finally {
|
|
162
|
-
this._warmUpDeferred.resolve();
|
|
163
|
-
this._warmUpDeferred = null;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
reset = async () => {
|
|
167
|
-
this._activeChunkIndex = -1;
|
|
168
|
-
this._loadedChunks = [];
|
|
169
|
-
this._warmUpDeferred = null;
|
|
170
|
-
await this.warmUp();
|
|
171
|
-
};
|
|
172
|
-
warmUpSequentially = async () => {
|
|
173
|
-
const startChunkIndex = Math.max(0, this._activeChunkIndex);
|
|
174
|
-
// Calculate how many items we need ahead of current position
|
|
175
|
-
const getItemsAhead = () => {
|
|
176
|
-
const currentFlatIndex = this.flattenedActiveChunkItemIndex;
|
|
177
|
-
const totalItems = this.flattenedChunkItems.length;
|
|
178
|
-
return totalItems - currentFlatIndex - 1; // -1 because current item doesn't count
|
|
179
|
-
};
|
|
180
|
-
while (getItemsAhead() < ITEMS_BUFFER_SIZE) {
|
|
181
|
-
// Find first non-fully-loaded chunk starting from active
|
|
182
|
-
let targetChunkIndex = -1;
|
|
183
|
-
for (let i = startChunkIndex; i < this._loadedChunks.length; i++) {
|
|
184
|
-
if (this._loadedChunks[i].canLoadMore) {
|
|
185
|
-
targetChunkIndex = i;
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// If all chunks are fully loaded, load more chunks
|
|
190
|
-
if (targetChunkIndex === -1) {
|
|
191
|
-
const result = await this.provider.loadMoreChunks();
|
|
192
|
-
if (result.length === 0) {
|
|
193
|
-
// No more chunks available
|
|
194
|
-
break;
|
|
195
|
-
}
|
|
196
|
-
this._loadedChunks = [
|
|
197
|
-
...this._loadedChunks,
|
|
198
|
-
...result.map((chunk) => new PlayerChunk({
|
|
199
|
-
chunk,
|
|
200
|
-
provider: { loadChunkItems: this.provider.loadChunkItems }
|
|
201
|
-
}))
|
|
202
|
-
];
|
|
203
|
-
continue; // Re-check for chunks to fill
|
|
204
|
-
}
|
|
205
|
-
// Load one page from target chunk
|
|
206
|
-
const chunk = this._loadedChunks[targetChunkIndex];
|
|
207
|
-
const itemsBefore = chunk.items.length;
|
|
208
|
-
await chunk.loadMore();
|
|
209
|
-
const itemsAfter = chunk.items.length;
|
|
210
|
-
// If chunk became fully loaded but added no items, continue to next chunk
|
|
211
|
-
if (itemsAfter === itemsBefore && !chunk.canLoadMore) {
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
// If no progress made and chunk is not fully loaded, something went wrong
|
|
215
|
-
if (itemsAfter === itemsBefore && chunk.canLoadMore) {
|
|
216
|
-
break; // Avoid infinite loop
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { IChunksPlayerBuffer, IChunksPlayerDataProvider, WithId } from './types';
|
|
2
|
-
export declare class DefaultChunksPlayerBuffer<TItem extends WithId, TChunk extends WithId> implements IChunksPlayerBuffer<TItem> {
|
|
3
|
-
readonly kind = "chunks";
|
|
4
|
-
readonly loaded: TItem[];
|
|
5
|
-
readonly currentIndex: number;
|
|
6
|
-
readonly current: TItem | null;
|
|
7
|
-
readonly canLoadNext: boolean;
|
|
8
|
-
readonly canLoadPrevious: boolean;
|
|
9
|
-
readonly navigationDisabled: boolean;
|
|
10
|
-
readonly animationDuration = 500;
|
|
11
|
-
private _playerChunksManager;
|
|
12
|
-
private _onEndReachedFn;
|
|
13
|
-
constructor(provider: IChunksPlayerDataProvider<TItem, TChunk>);
|
|
14
|
-
get activeChunk(): import("./chunks-player-buffer").PlayerChunk<TItem, TChunk>;
|
|
15
|
-
setActiveChunkItemIndex: (index: number) => void;
|
|
16
|
-
tryActivateItemById: (id: string) => boolean;
|
|
17
|
-
removeChunkById: (id: string) => boolean | undefined;
|
|
18
|
-
removeItemById: (id: string) => boolean;
|
|
19
|
-
loadNext: () => Promise<void>;
|
|
20
|
-
loadPrevious: () => Promise<void>;
|
|
21
|
-
reset: () => void;
|
|
22
|
-
ensureWarmedUp: () => Promise<void>;
|
|
23
|
-
}
|