@streamscloud/embeddable 15.1.0 → 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 +18 -29
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +0 -2
- 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/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 +10 -21
- package/dist/media-center/media-center/discover/community-features.svelte.d.ts +0 -2
- package/dist/media-center/media-center/discover/discover-header.svelte +14 -25
- package/dist/media-center/media-center/discover/discover-view-handler.svelte.d.ts +1 -1
- 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 +6 -19
- package/dist/media-center/media-center/footer/media-center-footer.svelte +7 -18
- 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 +8 -19
- package/dist/media-center/media-center/header/media-center-header-mobile.svelte.d.ts +0 -2
- package/dist/media-center/media-center/header/media-center-header.svelte +12 -23
- 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 +4 -15
- package/dist/media-center/media-center/menu/category-following-wrapper.svelte +5 -16
- 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 +15 -26
- package/dist/media-center/media-center/moments/cmp.moments-circle.svelte +6 -17
- 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 +2 -2
- 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.d.ts +1 -1
- 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 +1 -12
- package/dist/media-center/media-center/types.d.ts +2 -2
- package/dist/media-page/index.d.ts +2 -2
- package/dist/posts/attachments/cmp.attachments.svelte +2 -15
- package/dist/posts/attachments/cmp.attachments.svelte.d.ts +0 -2
- package/dist/posts/controls/post-actions-handler.svelte.d.ts +1 -1
- package/dist/posts/controls/post-actions-handler.svelte.js +2 -3
- package/dist/posts/post-viewer/attachments-horizontal.svelte +10 -21
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +7 -18
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +1 -3
- package/dist/posts/post-viewer/heading.svelte +8 -20
- package/dist/posts/post-viewer/media/post-media.svelte +11 -22
- package/dist/posts/post-viewer/media/post-media.svelte.d.ts +0 -2
- package/dist/posts/post-viewer/post-texts.svelte +6 -17
- 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 +2 -2
- 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 +2 -2
- package/dist/posts/posts-player/posts-player-view.svelte +34 -30
- 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 +16 -30
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +0 -2
- 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 +19 -35
- package/dist/short-videos/short-video-card/cmp.short-video-card.svelte.d.ts +0 -2
- 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 +3 -14
- package/dist/streams/layout/cmp.slot-content.svelte +5 -16
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +0 -2
- package/dist/streams/layout/cmp.slot.svelte +1 -12
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +2 -2
- 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 +0 -2
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +1 -12
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +3 -14
- 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 +0 -2
- 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 +0 -2
- 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 +0 -2
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte +3 -14
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +3 -14
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +0 -2
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +7 -8
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +0 -2
- 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 +0 -2
- 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 +0 -2
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +1 -12
- package/dist/streams/layout/element-views/price-element-view.svelte +7 -18
- 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.d.ts +1 -1
- package/dist/streams/layout/index.js +1 -1
- package/dist/streams/layout/serializer.svelte.js +5 -6
- package/dist/streams/layout/styles-transformer.d.ts +3 -3
- package/dist/streams/layout/styles-transformer.js +1 -1
- package/dist/streams/stream-card/cmp.stream-card.svelte +6 -20
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +6 -19
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +1 -3
- package/dist/streams/streams-player/cmp.streams-player.svelte.d.ts +1 -1
- package/dist/streams/streams-player/index.d.ts +1 -1
- package/dist/streams/streams-player/stream-overview.svelte +5 -16
- 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 +1 -1
- package/dist/streams/streams-player/streams-player-view.svelte +71 -79
- package/dist/streams/streams-player/types.d.ts +1 -1
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +5 -16
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +2 -16
- package/dist/ui/media-items-gallery/types.js +2 -1
- package/dist/ui/player/player/cmp.player.svelte +19 -28
- package/dist/ui/player/player/cmp.player.svelte.d.ts +1 -1
- package/dist/ui/player/player/controls-and-attachments.svelte +16 -32
- package/dist/ui/player/player/controls-and-attachments.svelte.d.ts +1 -1
- package/dist/ui/player/player/overview-panel.svelte +27 -36
- 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 +1 -12
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte +9 -14
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte.d.ts +2 -0
- package/dist/ui/shadow-dom/colors.scss +2 -2
- package/dist/ui/shadow-dom/shadow-root-service.js +2 -2
- package/package.json +13 -25
- 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 -11
- package/dist/core/continuation-token.js +0 -35
- package/dist/core/cursor-result.d.ts +0 -9
- package/dist/core/cursor-result.js +0 -1
- package/dist/core/data-loaders/cursor-data-loader.svelte.d.ts +0 -14
- package/dist/core/data-loaders/cursor-data-loader.svelte.js +0 -35
- package/dist/core/data-loaders/data-loader.d.ts +0 -4
- package/dist/core/data-loaders/data-loader.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 -6
- package/dist/core/deferred.js +0 -13
- 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/image-helper.d.ts +0 -10
- package/dist/core/media/image-helper.js +0 -30
- 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 -26
- package/dist/core/transitions/index.d.ts +0 -1
- package/dist/core/transitions/index.js +0 -1
- package/dist/core/transitions/slide-horizontally.d.ts +0 -7
- package/dist/core/transitions/slide-horizontally.js +0 -55
- package/dist/core/utils/array-helper.d.ts +0 -23
- package/dist/core/utils/array-helper.js +0 -148
- 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 -29
- package/dist/core/utils/date-helper.js +0 -146
- package/dist/core/utils/dom-helper.d.ts +0 -12
- package/dist/core/utils/dom-helper.js +0 -76
- package/dist/core/utils/html-helper.d.ts +0 -42
- package/dist/core/utils/html-helper.js +0 -104
- package/dist/core/utils/index.d.ts +0 -3
- package/dist/core/utils/index.js +0 -3
- package/dist/core/utils/number-helper.d.ts +0 -6
- package/dist/core/utils/number-helper.js +0 -28
- package/dist/core/utils/string-generator.d.ts +0 -2
- package/dist/core/utils/string-generator.js +0 -15
- package/dist/core/utils/string-helper.d.ts +0 -10
- package/dist/core/utils/string-helper.js +0 -53
- package/dist/core/utils/url-helper.d.ts +0 -3
- package/dist/core/utils/url-helper.js +0 -13
- package/dist/core/utils/utils.d.ts +0 -29
- package/dist/core/utils/utils.js +0 -104
- 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/cmp.button.svelte +0 -10
- package/dist/ui/button/cmp.button.svelte.d.ts +0 -16
- package/dist/ui/button/cmp.options-button.svelte +0 -123
- package/dist/ui/button/cmp.options-button.svelte.d.ts +0 -20
- package/dist/ui/button/index.d.ts +0 -3
- package/dist/ui/button/index.js +0 -3
- package/dist/ui/button/resources/button-base.svelte +0 -84
- package/dist/ui/button/resources/button-base.svelte.d.ts +0 -13
- package/dist/ui/button/resources/button-theme.svelte +0 -53
- package/dist/ui/button/resources/button-theme.svelte.d.ts +0 -10
- package/dist/ui/button/resources/button-types.d.ts +0 -20
- package/dist/ui/button/resources/button-types.js +0 -22
- 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 -10
- package/dist/ui/card-actions/cmp.card-actions.svelte +0 -71
- package/dist/ui/card-actions/cmp.card-actions.svelte.d.ts +0 -9
- 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 -184
- package/dist/ui/dropdown/cmp.dropdown.svelte.d.ts +0 -23
- 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 -7
- 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/cmp.icon.svelte +0 -75
- package/dist/ui/icon/cmp.icon.svelte.d.ts +0 -8
- package/dist/ui/icon/index.d.ts +0 -2
- package/dist/ui/icon/index.js +0 -2
- package/dist/ui/icon/types.d.ts +0 -9
- package/dist/ui/icon/types.js +0 -10
- package/dist/ui/image/cmp.image-round.svelte +0 -41
- package/dist/ui/image/cmp.image-round.svelte.d.ts +0 -11
- package/dist/ui/image/cmp.image-rounded.svelte +0 -64
- package/dist/ui/image/cmp.image-rounded.svelte.d.ts +0 -11
- package/dist/ui/image/cmp.image-stub.svelte +0 -31
- package/dist/ui/image/cmp.image-stub.svelte.d.ts +0 -18
- package/dist/ui/image/cmp.image.svelte +0 -79
- package/dist/ui/image/cmp.image.svelte.d.ts +0 -13
- package/dist/ui/image/image-state.d.ts +0 -6
- package/dist/ui/image/image-state.js +0 -17
- package/dist/ui/image/index.d.ts +0 -4
- package/dist/ui/image/index.js +0 -4
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte +0 -75
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte.d.ts +0 -11
- 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 -10
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +0 -84
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +0 -11
- 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 -94
- package/dist/ui/loading/cmp.loading.svelte.d.ts +0 -9
- 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 -7
- package/dist/ui/player/button/cmp.player-buttons.svelte +0 -127
- package/dist/ui/player/button/cmp.player-buttons.svelte.d.ts +0 -9
- 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 -8
- 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 -218
- package/dist/ui/player/slider/cmp.player-slider.svelte.d.ts +0 -34
- 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 -424
- package/dist/ui/player/slider-horizontal/cmp.slider.svelte.d.ts +0 -31
- 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 -40
- package/dist/ui/progress/cmp.progress.svelte.d.ts +0 -6
- 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 -39
- package/dist/ui/proportional-container/cmp.proportional-container.svelte.d.ts +0 -8
- 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 -167
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +0 -15
- package/dist/ui/seek-bar/index.d.ts +0 -1
- package/dist/ui/seek-bar/index.js +0 -1
- package/dist/ui/shadow-dom/normalize-shadow.css +0 -350
- package/dist/ui/shadow-dom/reset-shadow.css +0 -176
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +0 -124
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +0 -8
- 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 -9
- 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 -387
- package/dist/ui/video/cmp.video.svelte.d.ts +0 -27
- 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,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
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Utils } from '../../../core/utils';
|
|
2
|
-
import { PlayerChunksManager } from './chunks-player-buffer';
|
|
3
|
-
export class DefaultChunksPlayerBuffer {
|
|
4
|
-
kind = 'chunks';
|
|
5
|
-
loaded = $derived.by(() => this._playerChunksManager.flattenedChunkItems);
|
|
6
|
-
currentIndex = $derived.by(() => this._playerChunksManager.flattenedActiveChunkItemIndex);
|
|
7
|
-
current = $derived(this.currentIndex >= 0 ? this.loaded[this.currentIndex] : null);
|
|
8
|
-
canLoadNext = $derived.by(() => {
|
|
9
|
-
if (this.loaded.length && this.currentIndex < this.loaded.length - 1) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
// Check if manager is still loading
|
|
13
|
-
if (this._playerChunksManager.isLoading) {
|
|
14
|
-
return false; // Don't trigger onEndReached while loading
|
|
15
|
-
}
|
|
16
|
-
return !!this._onEndReachedFn;
|
|
17
|
-
});
|
|
18
|
-
canLoadPrevious = $derived(this.currentIndex > 0);
|
|
19
|
-
navigationDisabled = $derived(!this.canLoadNext && !this.canLoadPrevious);
|
|
20
|
-
animationDuration = 500;
|
|
21
|
-
_playerChunksManager;
|
|
22
|
-
_onEndReachedFn;
|
|
23
|
-
constructor(provider) {
|
|
24
|
-
this._onEndReachedFn = provider.onEndReached;
|
|
25
|
-
// Throttle navigation methods
|
|
26
|
-
this.loadNext = Utils.throttle(this.loadNext, this.animationDuration);
|
|
27
|
-
this.loadPrevious = Utils.throttle(this.loadPrevious, this.animationDuration);
|
|
28
|
-
this._playerChunksManager = new PlayerChunksManager(provider);
|
|
29
|
-
this._playerChunksManager.initialize();
|
|
30
|
-
}
|
|
31
|
-
get activeChunk() {
|
|
32
|
-
return this._playerChunksManager.activeChunk;
|
|
33
|
-
}
|
|
34
|
-
setActiveChunkItemIndex = (index) => {
|
|
35
|
-
if (!this.activeChunk) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
this.activeChunk.setActiveItemIndex(index);
|
|
39
|
-
};
|
|
40
|
-
tryActivateItemById = (id) => {
|
|
41
|
-
return this._playerChunksManager.tryActivateItemById(id);
|
|
42
|
-
};
|
|
43
|
-
removeChunkById = (id) => {
|
|
44
|
-
return this._playerChunksManager.removeChunkById(id);
|
|
45
|
-
};
|
|
46
|
-
removeItemById = (id) => {
|
|
47
|
-
return this._playerChunksManager.removeItemById(id);
|
|
48
|
-
};
|
|
49
|
-
loadNext = async () => {
|
|
50
|
-
if (!this.canLoadNext) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (this.currentIndex < this.loaded.length - 1) {
|
|
54
|
-
this._playerChunksManager.activateItemAtFlattenedIndex(this.currentIndex + 1);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
this._onEndReachedFn?.();
|
|
58
|
-
};
|
|
59
|
-
loadPrevious = async () => {
|
|
60
|
-
if (!this.canLoadPrevious) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
this._playerChunksManager.activateItemAtFlattenedIndex(this.currentIndex - 1);
|
|
64
|
-
};
|
|
65
|
-
reset = () => {
|
|
66
|
-
this._playerChunksManager.reset();
|
|
67
|
-
};
|
|
68
|
-
ensureWarmedUp = async () => {
|
|
69
|
-
await this._playerChunksManager.warmUp();
|
|
70
|
-
};
|
|
71
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { IFeedPlayerBuffer, IFeedPlayerDataProvider, WithId } from './types';
|
|
2
|
-
export declare class DefaultFeedPlayerBuffer<T extends WithId> implements IFeedPlayerBuffer<T> {
|
|
3
|
-
readonly kind = "feed";
|
|
4
|
-
readonly loaded: (T & {
|
|
5
|
-
mediaIndex?: number;
|
|
6
|
-
})[];
|
|
7
|
-
readonly currentIndex: number;
|
|
8
|
-
readonly current: (T & {
|
|
9
|
-
mediaIndex?: number;
|
|
10
|
-
}) | null;
|
|
11
|
-
readonly canLoadNext: boolean;
|
|
12
|
-
readonly canLoadPrevious: boolean;
|
|
13
|
-
readonly navigationDisabled: boolean;
|
|
14
|
-
readonly animationDuration = 500;
|
|
15
|
-
private _currentIndex;
|
|
16
|
-
private _loaded;
|
|
17
|
-
private _loadMoreFn;
|
|
18
|
-
private _fetchDeferred;
|
|
19
|
-
private _onEndReachedFn;
|
|
20
|
-
constructor(provider: IFeedPlayerDataProvider<T>);
|
|
21
|
-
tryActivateItemById: (id: string) => boolean;
|
|
22
|
-
removeItemById: (id: string) => boolean;
|
|
23
|
-
loadNext: () => Promise<void>;
|
|
24
|
-
loadPrevious: () => Promise<void>;
|
|
25
|
-
reset: () => void;
|
|
26
|
-
ensureWarmedUp: () => Promise<void>;
|
|
27
|
-
private initializeBuffer;
|
|
28
|
-
private warmUpBuffer;
|
|
29
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Deferred } from '../../../core/deferred';
|
|
2
|
-
import { Utils } from '../../../core/utils';
|
|
3
|
-
const BUFFER_SIZE = 5;
|
|
4
|
-
export class DefaultFeedPlayerBuffer {
|
|
5
|
-
kind = 'feed';
|
|
6
|
-
loaded = $derived.by(() => this._loaded);
|
|
7
|
-
currentIndex = $derived.by(() => this._currentIndex);
|
|
8
|
-
current = $derived(this.currentIndex >= 0 ? this.loaded[this.currentIndex] : null);
|
|
9
|
-
canLoadNext = $derived.by(() => {
|
|
10
|
-
if (this.loaded.length && this.currentIndex < this.loaded.length - 1) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
return !this._fetchDeferred && !!this._onEndReachedFn;
|
|
14
|
-
});
|
|
15
|
-
canLoadPrevious = $derived(this.currentIndex > 0);
|
|
16
|
-
navigationDisabled = $derived(!this.canLoadNext && !this.canLoadPrevious);
|
|
17
|
-
animationDuration = 500;
|
|
18
|
-
_currentIndex = $state(-1);
|
|
19
|
-
_loaded = $state.raw([]);
|
|
20
|
-
_loadMoreFn;
|
|
21
|
-
_fetchDeferred = $state.raw(null);
|
|
22
|
-
_onEndReachedFn;
|
|
23
|
-
constructor(provider) {
|
|
24
|
-
this._onEndReachedFn = provider.onEndReached;
|
|
25
|
-
this._loadMoreFn = provider.loadMore;
|
|
26
|
-
// Throttle navigation methods
|
|
27
|
-
this.loadNext = Utils.throttle(this.loadNext, this.animationDuration);
|
|
28
|
-
this.loadPrevious = Utils.throttle(this.loadPrevious, this.animationDuration);
|
|
29
|
-
this.initializeBuffer({ initialData: provider.initialData });
|
|
30
|
-
}
|
|
31
|
-
tryActivateItemById = (id) => {
|
|
32
|
-
const itemIndex = this._loaded.findIndex((item) => item.id === id);
|
|
33
|
-
if (itemIndex === -1) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
this._currentIndex = itemIndex;
|
|
37
|
-
return true;
|
|
38
|
-
};
|
|
39
|
-
removeItemById = (id) => {
|
|
40
|
-
const itemIndex = this._loaded.findIndex((item) => item.id === id);
|
|
41
|
-
if (itemIndex === -1) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
this._loaded = this._loaded.filter((item) => item.id !== id);
|
|
45
|
-
if (itemIndex < this._currentIndex) {
|
|
46
|
-
this._currentIndex--;
|
|
47
|
-
}
|
|
48
|
-
else if (itemIndex === this._currentIndex) {
|
|
49
|
-
if (this._currentIndex >= this._loaded.length) {
|
|
50
|
-
this._currentIndex = this._loaded.length - 1;
|
|
51
|
-
}
|
|
52
|
-
// Otherwise keep the same index (activates next item)
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
};
|
|
56
|
-
loadNext = async () => {
|
|
57
|
-
if (!this.canLoadNext) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (this.currentIndex < this.loaded.length - 1) {
|
|
61
|
-
++this._currentIndex;
|
|
62
|
-
await this.warmUpBuffer();
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
this._onEndReachedFn?.();
|
|
66
|
-
};
|
|
67
|
-
loadPrevious = async () => {
|
|
68
|
-
if (!this.canLoadPrevious) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
--this._currentIndex;
|
|
72
|
-
};
|
|
73
|
-
reset = () => {
|
|
74
|
-
this._loaded = [];
|
|
75
|
-
this._currentIndex = -1;
|
|
76
|
-
this._fetchDeferred = null;
|
|
77
|
-
this.warmUpBuffer();
|
|
78
|
-
};
|
|
79
|
-
ensureWarmedUp = async () => {
|
|
80
|
-
await this.warmUpBuffer();
|
|
81
|
-
};
|
|
82
|
-
initializeBuffer = async (options) => {
|
|
83
|
-
const { initialData } = options;
|
|
84
|
-
const handleInitialized = () => {
|
|
85
|
-
const startIndex = initialData.startIndex >= 0 ? initialData.startIndex : 0;
|
|
86
|
-
this._currentIndex = Math.min(startIndex, this._loaded.length - 1);
|
|
87
|
-
const hasCustomMediaIndex = initialData.startMediaIndex && initialData.startMediaIndex > 0;
|
|
88
|
-
const activeItem = this._loaded[this._currentIndex];
|
|
89
|
-
if (activeItem && hasCustomMediaIndex) {
|
|
90
|
-
activeItem.mediaIndex = initialData.startMediaIndex;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
this._loaded = initialData.prefetchedItems;
|
|
94
|
-
const considerInitialized = this._loaded.length > 0;
|
|
95
|
-
if (considerInitialized) {
|
|
96
|
-
handleInitialized();
|
|
97
|
-
}
|
|
98
|
-
await this.warmUpBuffer();
|
|
99
|
-
if (!considerInitialized) {
|
|
100
|
-
handleInitialized();
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
warmUpBuffer = async () => {
|
|
104
|
-
// Early return if buffer is sufficient or already loading
|
|
105
|
-
if (this._fetchDeferred) {
|
|
106
|
-
return this._fetchDeferred.promise;
|
|
107
|
-
}
|
|
108
|
-
if (this._loaded.length >= this.currentIndex + BUFFER_SIZE) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
this._fetchDeferred = new Deferred();
|
|
112
|
-
try {
|
|
113
|
-
const result = await this._loadMoreFn();
|
|
114
|
-
this._loaded = [...this._loaded, ...result];
|
|
115
|
-
}
|
|
116
|
-
finally {
|
|
117
|
-
this._fetchDeferred.resolve();
|
|
118
|
-
this._fetchDeferred = null;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type { IPlayerBuffer, IPlayerDataProvider, IFeedPlayerDataProvider, IChunksPlayerDataProvider } from './types';
|
|
2
|
-
export { DefaultFeedPlayerBuffer } from './default-feed-player-buffer.svelte';
|
|
3
|
-
export { DefaultChunksPlayerBuffer } from './default-chunks-player-buffer.svelte';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Utils } from '../../../core/utils';
|
|
2
|
-
import { DefaultChunksPlayerBuffer } from './default-chunks-player-buffer.svelte';
|
|
3
|
-
import { DefaultFeedPlayerBuffer } from './default-feed-player-buffer.svelte';
|
|
4
|
-
export const initBufferFromProvider = (provider) => {
|
|
5
|
-
switch (provider.kind) {
|
|
6
|
-
case 'feed':
|
|
7
|
-
return new DefaultFeedPlayerBuffer(provider);
|
|
8
|
-
case 'chunks':
|
|
9
|
-
return new DefaultChunksPlayerBuffer(provider);
|
|
10
|
-
default:
|
|
11
|
-
Utils.assertUnreachable(provider);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export type IPlayerDataProvider<T extends WithId> = IFeedPlayerDataProvider<T> | IChunksPlayerDataProvider<T>;
|
|
2
|
-
export interface IFeedPlayerDataProvider<T extends WithId> {
|
|
3
|
-
kind: 'feed';
|
|
4
|
-
initialData: {
|
|
5
|
-
prefetchedItems: T[];
|
|
6
|
-
startIndex: number;
|
|
7
|
-
startMediaIndex?: number;
|
|
8
|
-
};
|
|
9
|
-
loadMore: () => Promise<T[]>;
|
|
10
|
-
onEndReached?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export interface IChunksPlayerDataProvider<TItem extends WithId, TChunk extends WithId = WithId> {
|
|
13
|
-
kind: 'chunks';
|
|
14
|
-
initialData: {
|
|
15
|
-
prefetchedChunks: TChunk[];
|
|
16
|
-
startItemIndex?: number;
|
|
17
|
-
};
|
|
18
|
-
loadMoreChunks: () => Promise<TChunk[]>;
|
|
19
|
-
loadChunkItems: (chunkId: string, continuationToken: string | null | undefined) => Promise<{
|
|
20
|
-
items: TItem[];
|
|
21
|
-
continuationToken: string | null;
|
|
22
|
-
}>;
|
|
23
|
-
onEndReached?: () => void;
|
|
24
|
-
}
|
|
25
|
-
export type IPlayerBuffer<T extends WithId> = IFeedPlayerBuffer<T> | IChunksPlayerBuffer<T>;
|
|
26
|
-
export interface IPlayerBufferBase<T extends WithId> {
|
|
27
|
-
readonly kind: 'feed' | 'chunks';
|
|
28
|
-
readonly current: TExtended<T> | null;
|
|
29
|
-
readonly loaded: TExtended<T>[];
|
|
30
|
-
readonly currentIndex: number;
|
|
31
|
-
readonly canLoadNext: boolean;
|
|
32
|
-
readonly canLoadPrevious: boolean;
|
|
33
|
-
readonly navigationDisabled: boolean;
|
|
34
|
-
readonly animationDuration: number;
|
|
35
|
-
loadNext: () => void;
|
|
36
|
-
loadPrevious: () => void;
|
|
37
|
-
reset: () => void;
|
|
38
|
-
ensureWarmedUp: () => Promise<void>;
|
|
39
|
-
tryActivateItemById: (id: string) => boolean;
|
|
40
|
-
removeItemById: (id: string) => void;
|
|
41
|
-
}
|
|
42
|
-
type TExtended<T> = T & {
|
|
43
|
-
mediaIndex?: number;
|
|
44
|
-
};
|
|
45
|
-
export interface IFeedPlayerBuffer<T extends WithId> extends IPlayerBufferBase<T> {
|
|
46
|
-
readonly kind: 'feed';
|
|
47
|
-
}
|
|
48
|
-
export interface IChunksPlayerBuffer<T extends WithId> extends IPlayerBufferBase<T> {
|
|
49
|
-
readonly kind: 'chunks';
|
|
50
|
-
}
|
|
51
|
-
export type WithId = {
|
|
52
|
-
id: string;
|
|
53
|
-
};
|
|
54
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|