@streamscloud/embeddable 2.1.1 → 2.1.3
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/core/continuation-token.d.ts +10 -0
- package/dist/core/continuation-token.js +32 -0
- package/dist/core/cursor-result.d.ts +9 -0
- package/dist/core/cursor-result.js +1 -0
- package/dist/core/data-loaders/cursor-data-loader.svelte.d.ts +14 -0
- package/dist/core/data-loaders/cursor-data-loader.svelte.js +35 -0
- package/dist/core/data-loaders/data-loader.d.ts +4 -0
- package/dist/core/data-loaders/data-loader.js +1 -0
- package/dist/core/data-loaders/index.d.ts +2 -0
- package/dist/core/data-loaders/index.js +1 -0
- package/dist/core/deferred.d.ts +6 -0
- package/dist/core/deferred.js +13 -0
- package/dist/core/enums.d.ts +33 -0
- package/dist/core/enums.js +39 -0
- package/dist/core/graphql.d.ts +1 -0
- package/dist/core/graphql.js +10 -0
- package/dist/core/media/image-helper.d.ts +10 -0
- package/dist/core/media/image-helper.js +30 -0
- package/dist/core/media/images-size-detector.service.d.ts +6 -0
- package/dist/core/media/images-size-detector.service.js +15 -0
- package/dist/core/media/index.d.ts +4 -0
- package/dist/core/media/index.js +4 -0
- package/dist/core/media/media-item-url.service.d.ts +2 -0
- package/dist/core/media/media-item-url.service.js +3 -0
- package/dist/core/media/types.d.ts +13 -0
- package/dist/core/media/types.js +1 -0
- package/dist/core/toastr.d.ts +1 -0
- package/dist/core/toastr.js +26 -0
- package/dist/core/transitions/index.d.ts +1 -0
- package/dist/core/transitions/index.js +1 -0
- package/dist/core/transitions/slide-horizontally.d.ts +7 -0
- package/dist/core/transitions/slide-horizontally.js +55 -0
- package/dist/core/utils/array-helper.d.ts +23 -0
- package/dist/core/utils/array-helper.js +148 -0
- package/dist/core/utils/date-helper.d.ts +29 -0
- package/dist/core/utils/date-helper.js +146 -0
- package/dist/core/utils/dom-helper.d.ts +12 -0
- package/dist/core/utils/dom-helper.js +76 -0
- package/dist/core/utils/html-helper.d.ts +40 -0
- package/dist/core/utils/html-helper.js +97 -0
- package/dist/core/utils/index.d.ts +3 -0
- package/dist/core/utils/index.js +3 -0
- package/dist/core/utils/number-helper.d.ts +6 -0
- package/dist/core/utils/number-helper.js +28 -0
- package/dist/core/utils/string-generator.d.ts +2 -0
- package/dist/core/utils/string-generator.js +15 -0
- package/dist/core/utils/string-helper.d.ts +10 -0
- package/dist/core/utils/string-helper.js +53 -0
- package/dist/core/utils/url-helper.d.ts +3 -0
- package/dist/core/utils/url-helper.js +13 -0
- package/dist/core/utils/utils.d.ts +28 -0
- package/dist/core/utils/utils.js +100 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/products/price-helper.d.ts +4 -0
- package/dist/products/price-helper.js +47 -0
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte +74 -0
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte.d.ts +7 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +70 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte.d.ts +7 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +68 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +12 -0
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +168 -0
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +13 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +124 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +13 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +86 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +9 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +133 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +15 -0
- package/dist/short-videos/short-video-viewer/description.svelte +46 -0
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +9 -0
- package/dist/short-videos/short-video-viewer/index.d.ts +9 -0
- package/dist/short-videos/short-video-viewer/index.js +6 -0
- package/dist/short-videos/short-video-viewer/mapper.d.ts +3 -0
- package/dist/short-videos/short-video-viewer/mapper.js +56 -0
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +56 -0
- package/dist/short-videos/short-video-viewer/operations.generated.js +151 -0
- package/dist/short-videos/short-video-viewer/operations.graphql +53 -0
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.d.ts +12 -0
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.d.ts +13 -0
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.d.ts +7 -0
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +11 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +13 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/types.d.ts +40 -0
- package/dist/short-videos/short-video-viewer/types.js +1 -0
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +12 -0
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +26 -0
- package/dist/short-videos/short-videos-player/action-button.svelte +38 -0
- package/dist/short-videos/short-videos-player/action-button.svelte.d.ts +10 -0
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +91 -0
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +13 -0
- package/dist/short-videos/short-videos-player/controls.svelte +222 -0
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +15 -0
- package/dist/short-videos/short-videos-player/index.d.ts +31 -0
- package/dist/short-videos/short-videos-player/index.js +40 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +8 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +6 -0
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +16 -0
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +25 -0
- package/dist/streams/layout/cmp.layout.svelte +34 -0
- package/dist/streams/layout/cmp.layout.svelte.d.ts +9 -0
- package/dist/streams/layout/cmp.slot-content.svelte +77 -0
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +13 -0
- package/dist/streams/layout/cmp.slot.svelte +26 -0
- package/dist/streams/layout/cmp.slot.svelte.d.ts +9 -0
- package/dist/streams/layout/component.d.ts +6 -0
- package/dist/streams/layout/component.js +1 -0
- package/dist/streams/layout/css-values.d.ts +10 -0
- package/dist/streams/layout/css-values.js +1 -0
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +16 -0
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +11 -0
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +38 -0
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +30 -0
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +97 -0
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +11 -0
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +6 -0
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +10 -0
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte +45 -0
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +68 -0
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +16 -0
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte +23 -0
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +8 -0
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +7 -0
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -0
- package/dist/streams/layout/element-views/data-by-key-accessor.js +55 -0
- package/dist/streams/layout/element-views/index.d.ts +11 -0
- package/dist/streams/layout/element-views/index.js +9 -0
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +8 -0
- package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +8 -0
- package/dist/streams/layout/element-views/stream-element-localization.svelte.js +6 -0
- package/dist/streams/layout/elements.d.ts +51 -0
- package/dist/streams/layout/elements.js +1 -0
- package/dist/streams/layout/enums.d.ts +45 -0
- package/dist/streams/layout/enums.js +54 -0
- package/dist/streams/layout/index.d.ts +19 -0
- package/dist/streams/layout/index.js +15 -0
- package/dist/streams/layout/layout.d.ts +13 -0
- package/dist/streams/layout/layout.js +1 -0
- package/dist/streams/layout/models/index.d.ts +6 -0
- package/dist/streams/layout/models/index.js +1 -0
- package/dist/streams/layout/models/mapper.d.ts +3 -0
- package/dist/streams/layout/models/mapper.js +62 -0
- package/dist/streams/layout/models/stream-layout-blob-model.d.ts +4 -0
- package/dist/streams/layout/models/stream-layout-blob-model.js +1 -0
- package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +6 -0
- package/dist/streams/layout/models/stream-layout-media-item-model.js +1 -0
- package/dist/streams/layout/models/stream-layout-post-header-model.d.ts +11 -0
- package/dist/streams/layout/models/stream-layout-post-header-model.js +1 -0
- package/dist/streams/layout/models/stream-layout-product-model.d.ts +19 -0
- package/dist/streams/layout/models/stream-layout-product-model.js +1 -0
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +31 -0
- package/dist/streams/layout/models/stream-layout-short-video-model.js +1 -0
- package/dist/streams/layout/serializer.d.ts +3 -0
- package/dist/streams/layout/serializer.js +6 -0
- package/dist/streams/layout/slot-data-input.d.ts +14 -0
- package/dist/streams/layout/slot-data-input.js +1 -0
- package/dist/streams/layout/slot-data.d.ts +18 -0
- package/dist/streams/layout/slot-data.js +1 -0
- package/dist/streams/layout/slot.d.ts +16 -0
- package/dist/streams/layout/slot.js +1 -0
- package/dist/streams/layout/styles-transformer.d.ts +13 -0
- package/dist/streams/layout/styles-transformer.js +140 -0
- package/dist/streams/layout/styles.d.ts +43 -0
- package/dist/streams/layout/styles.js +1 -0
- package/dist/streams/layout/type-guards.d.ts +8 -0
- package/dist/streams/layout/type-guards.js +21 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +13 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +11 -0
- package/dist/streams/stream-page-viewer/index.d.ts +2 -0
- package/dist/streams/stream-page-viewer/index.js +1 -0
- package/dist/streams/stream-page-viewer/mapper.d.ts +3 -0
- package/dist/streams/stream-page-viewer/mapper.js +22 -0
- package/dist/streams/stream-page-viewer/operations.generated.d.ts +10 -0
- package/dist/streams/stream-page-viewer/operations.generated.js +27 -0
- package/dist/streams/stream-page-viewer/operations.graphql +8 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +13 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +10 -0
- package/dist/streams/stream-page-viewer/types.d.ts +18 -0
- package/dist/streams/stream-page-viewer/types.js +1 -0
- package/dist/streams/stream-player/action-button.svelte +38 -0
- package/dist/streams/stream-player/action-button.svelte.d.ts +10 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +164 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +19 -0
- package/dist/streams/stream-player/controls.svelte +236 -0
- package/dist/streams/stream-player/controls.svelte.d.ts +15 -0
- package/dist/streams/stream-player/index.d.ts +37 -0
- package/dist/streams/stream-player/index.js +50 -0
- package/dist/streams/stream-player/mapper.d.ts +3 -0
- package/dist/streams/stream-player/mapper.js +15 -0
- package/dist/streams/stream-player/operations.generated.d.ts +65 -0
- package/dist/streams/stream-player/operations.generated.js +196 -0
- package/dist/streams/stream-player/operations.graphql +35 -0
- package/dist/streams/stream-player/stream-overview.svelte +239 -0
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +17 -0
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +25 -0
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +84 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +12 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.js +10 -0
- package/dist/streams/stream-player/types.d.ts +12 -0
- package/dist/streams/stream-player/types.js +1 -0
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +17 -0
- package/dist/streams/stream-player/ui-manager.svelte.js +26 -0
- package/dist/ui/button/cmp.button.svelte +10 -0
- package/dist/ui/button/cmp.button.svelte.d.ts +16 -0
- package/dist/ui/button/index.d.ts +2 -0
- package/dist/ui/button/index.js +2 -0
- package/dist/ui/button/resources/button-base.svelte +84 -0
- package/dist/ui/button/resources/button-base.svelte.d.ts +13 -0
- package/dist/ui/button/resources/button-theme.svelte +204 -0
- package/dist/ui/button/resources/button-theme.svelte.d.ts +10 -0
- package/dist/ui/button/resources/button-types.d.ts +21 -0
- package/dist/ui/button/resources/button-types.js +23 -0
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte +5 -0
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte.d.ts +7 -0
- package/dist/ui/dynamic-component/index.d.ts +2 -0
- package/dist/ui/dynamic-component/index.js +2 -0
- package/dist/ui/dynamic-component/types.svelte.d.ts +11 -0
- package/dist/ui/dynamic-component/types.svelte.js +13 -0
- package/dist/ui/icon/cmp.icon.svelte +113 -0
- package/dist/ui/icon/cmp.icon.svelte.d.ts +8 -0
- package/dist/ui/icon/index.d.ts +2 -0
- package/dist/ui/icon/index.js +2 -0
- package/dist/ui/icon/types.d.ts +9 -0
- package/dist/ui/icon/types.js +10 -0
- package/dist/ui/image/cmp.image-round.svelte +41 -0
- package/dist/ui/image/cmp.image-round.svelte.d.ts +11 -0
- package/dist/ui/image/cmp.image-rounded.svelte +71 -0
- package/dist/ui/image/cmp.image-rounded.svelte.d.ts +11 -0
- package/dist/ui/image/cmp.image-stub.svelte +34 -0
- package/dist/ui/image/cmp.image-stub.svelte.d.ts +18 -0
- package/dist/ui/image/cmp.image.svelte +82 -0
- package/dist/ui/image/cmp.image.svelte.d.ts +13 -0
- package/dist/ui/image/image-state.d.ts +6 -0
- package/dist/ui/image/image-state.js +17 -0
- package/dist/ui/image/index.d.ts +4 -0
- package/dist/ui/image/index.js +4 -0
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte +84 -0
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte.d.ts +11 -0
- package/dist/ui/infinite-scrolling/index.d.ts +1 -0
- package/dist/ui/infinite-scrolling/index.js +1 -0
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +89 -0
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +12 -0
- package/dist/ui/line-clamp/index.d.ts +2 -0
- package/dist/ui/line-clamp/index.js +2 -0
- package/dist/ui/line-clamp/line-clamp-localization.svelte.d.ts +9 -0
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +15 -0
- package/dist/ui/line-clamp/line-clamp-types.d.ts +3 -0
- package/dist/ui/line-clamp/line-clamp-types.js +1 -0
- package/dist/ui/line-clamp/line-clamp-utils.d.ts +8 -0
- package/dist/ui/line-clamp/line-clamp-utils.js +33 -0
- package/dist/ui/loading/cmp.loading.svelte +97 -0
- package/dist/ui/loading/cmp.loading.svelte.d.ts +9 -0
- package/dist/ui/loading/index.d.ts +1 -0
- package/dist/ui/loading/index.js +1 -0
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +91 -0
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +13 -0
- package/dist/ui/media-item-view/index.d.ts +1 -0
- package/dist/ui/media-item-view/index.js +1 -0
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +278 -0
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +13 -0
- package/dist/ui/media-items-gallery/index.d.ts +1 -0
- package/dist/ui/media-items-gallery/index.js +1 -0
- package/dist/ui/media-items-gallery/types.d.ts +12 -0
- package/dist/ui/media-items-gallery/types.js +35 -0
- package/dist/ui/media-playback/index.d.ts +2 -0
- package/dist/ui/media-playback/index.js +2 -0
- package/dist/ui/media-playback/playback-manager.svelte.d.ts +25 -0
- package/dist/ui/media-playback/playback-manager.svelte.js +62 -0
- package/dist/ui/media-playback/volume-manager.svelte.d.ts +10 -0
- package/dist/ui/media-playback/volume-manager.svelte.js +27 -0
- package/dist/ui/player/cmp.player-slider.svelte +161 -0
- package/dist/ui/player/cmp.player-slider.svelte.d.ts +33 -0
- package/dist/ui/player/index.d.ts +4 -0
- package/dist/ui/player/index.js +3 -0
- package/dist/ui/player/player-buffer.svelte.d.ts +28 -0
- package/dist/ui/player/player-buffer.svelte.js +64 -0
- package/dist/ui/player/prevent-slider-scroll.d.ts +5 -0
- package/dist/ui/player/prevent-slider-scroll.js +11 -0
- package/dist/ui/player/types.d.ts +14 -0
- package/dist/ui/player/types.js +1 -0
- package/dist/ui/progress/cmp.progress.svelte +37 -0
- package/dist/ui/progress/cmp.progress.svelte.d.ts +6 -0
- package/dist/ui/progress/index.d.ts +1 -0
- package/dist/ui/progress/index.js +1 -0
- package/dist/ui/proportional-container/cmp.proportional-container.svelte +39 -0
- package/dist/ui/proportional-container/cmp.proportional-container.svelte.d.ts +8 -0
- package/dist/ui/proportional-container/index.d.ts +1 -0
- package/dist/ui/proportional-container/index.js +1 -0
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +63 -0
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +12 -0
- package/dist/ui/seek-bar/index.d.ts +1 -0
- package/dist/ui/seek-bar/index.js +1 -0
- package/dist/ui/shadow-dom/_normalize.scss +350 -0
- package/dist/ui/shadow-dom/_reset.scss +189 -0
- package/dist/ui/shadow-dom/index.d.ts +1 -0
- package/dist/ui/shadow-dom/index.js +1 -0
- package/dist/ui/shadow-dom/shadow-host.d.ts +11 -0
- package/dist/ui/shadow-dom/shadow-host.js +45 -0
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte +120 -0
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte.d.ts +18 -0
- package/dist/ui/spotlight-layout/index.d.ts +1 -0
- package/dist/ui/spotlight-layout/index.js +1 -0
- package/dist/ui/time-ago/cmp.time-ago.svelte +69 -0
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +9 -0
- package/dist/ui/time-ago/index.d.ts +2 -0
- package/dist/ui/time-ago/index.js +1 -0
- package/dist/ui/time-ago/time-ago-localization.svelte.d.ts +21 -0
- package/dist/ui/time-ago/time-ago-localization.svelte.js +39 -0
- package/dist/ui/video/cmp.video.svelte +377 -0
- package/dist/ui/video/cmp.video.svelte.d.ts +24 -0
- package/dist/ui/video/index.d.ts +1 -0
- package/dist/ui/video/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
2
|
+
import type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization.svelte';
|
|
3
|
+
export interface IShortVideoDetailsLocalization {
|
|
4
|
+
viewsCount?: (count: number) => string;
|
|
5
|
+
timeAgoLocalization?: ITimeAgoLocalization;
|
|
6
|
+
attachmentsLocalization?: IShortVideoAttachmentsLocalization;
|
|
7
|
+
}
|
|
8
|
+
export declare class ShortVideoDetailsLocalization {
|
|
9
|
+
viewsCount: (count: number) => string;
|
|
10
|
+
timeAgoLocalization: ITimeAgoLocalization | undefined;
|
|
11
|
+
attachmentsLocalization: IShortVideoAttachmentsLocalization | undefined;
|
|
12
|
+
constructor(init?: IShortVideoDetailsLocalization);
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ShortVideoDetailsLocalization {
|
|
2
|
+
viewsCount = $state((count) => (count === 1 ? '1 view' : `${count} views`));
|
|
3
|
+
timeAgoLocalization = $state(undefined);
|
|
4
|
+
attachmentsLocalization = $state(undefined);
|
|
5
|
+
constructor(init) {
|
|
6
|
+
this.viewsCount = init?.viewsCount ? init.viewsCount : this.viewsCount;
|
|
7
|
+
this.timeAgoLocalization = init?.timeAgoLocalization;
|
|
8
|
+
this.attachmentsLocalization = init?.attachmentsLocalization;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
2
|
+
import type { IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
3
|
+
export interface IShortVideoViewerLocalization {
|
|
4
|
+
viewsCount?: (count: number) => string;
|
|
5
|
+
timeAgoLocalization?: ITimeAgoLocalization;
|
|
6
|
+
productLocalization?: IShortVideoProductLocalization;
|
|
7
|
+
}
|
|
8
|
+
export declare class ShortVideoViewerLocalization {
|
|
9
|
+
viewsCount: (count: number) => string;
|
|
10
|
+
timeAgoLocalization: ITimeAgoLocalization | undefined;
|
|
11
|
+
productLocalization: IShortVideoProductLocalization | undefined;
|
|
12
|
+
constructor(init?: IShortVideoViewerLocalization);
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ShortVideoViewerLocalization {
|
|
2
|
+
viewsCount = $state((count) => (count === 1 ? '1 view' : `${count} views`));
|
|
3
|
+
timeAgoLocalization = $state(undefined);
|
|
4
|
+
productLocalization = $state(undefined);
|
|
5
|
+
constructor(init) {
|
|
6
|
+
this.viewsCount = init?.viewsCount ? init.viewsCount : this.viewsCount;
|
|
7
|
+
this.timeAgoLocalization = init?.timeAgoLocalization;
|
|
8
|
+
this.productLocalization = init?.productLocalization;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Currency } from '../../core/enums';
|
|
2
|
+
export type ShortVideoViewerModel = {
|
|
3
|
+
id: string;
|
|
4
|
+
media: {
|
|
5
|
+
isImage: true;
|
|
6
|
+
url: string;
|
|
7
|
+
} | {
|
|
8
|
+
isImage: false;
|
|
9
|
+
url: string;
|
|
10
|
+
thumbnailUrl: string;
|
|
11
|
+
};
|
|
12
|
+
text?: string | null;
|
|
13
|
+
heading: ShortVideoViewerHeadingModel;
|
|
14
|
+
products: ShortVideoViewerProductModel[];
|
|
15
|
+
ad: ShortVideoViewerAdModel | null;
|
|
16
|
+
};
|
|
17
|
+
export type ShortVideoViewerHeadingModel = {
|
|
18
|
+
image: string | null;
|
|
19
|
+
name: string;
|
|
20
|
+
displayDate: string;
|
|
21
|
+
viewsCount: number;
|
|
22
|
+
};
|
|
23
|
+
export type ShortVideoViewerAdModel = {
|
|
24
|
+
id: string;
|
|
25
|
+
image: string | null;
|
|
26
|
+
title: string;
|
|
27
|
+
description: string | null;
|
|
28
|
+
buttonText: string | null;
|
|
29
|
+
buttonUrl: string | null;
|
|
30
|
+
openLinkInNewWindow: boolean | null;
|
|
31
|
+
};
|
|
32
|
+
export type ShortVideoViewerProductModel = {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
image: string | null;
|
|
36
|
+
link: string | null;
|
|
37
|
+
price: number;
|
|
38
|
+
currency: Currency;
|
|
39
|
+
salePrice: number | null;
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class ShortVideoViewerUiManager {
|
|
2
|
+
readonly globalCssVariables: string;
|
|
3
|
+
readonly showActionsInsideFrame: boolean;
|
|
4
|
+
readonly showAttachments: boolean;
|
|
5
|
+
private readonly buttonSize;
|
|
6
|
+
private actionsPanelWidth;
|
|
7
|
+
private availableSideSpace;
|
|
8
|
+
private canShowAttachments;
|
|
9
|
+
updateActionsPanelWidth: (value: number) => void;
|
|
10
|
+
updateAvailableSideSpace: (value: number) => void;
|
|
11
|
+
updateCanShowAttachments: (value: boolean) => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class ShortVideoViewerUiManager {
|
|
2
|
+
globalCssVariables = $derived.by(() => {
|
|
3
|
+
const values = [`--_short-video-viewer--button--size: ${this.buttonSize}px`];
|
|
4
|
+
return values.join(';');
|
|
5
|
+
});
|
|
6
|
+
showActionsInsideFrame = $derived.by(() => {
|
|
7
|
+
return this.actionsPanelWidth + 40 > this.availableSideSpace;
|
|
8
|
+
});
|
|
9
|
+
showAttachments = $derived.by(() => {
|
|
10
|
+
return this.canShowAttachments;
|
|
11
|
+
});
|
|
12
|
+
buttonSize = 40;
|
|
13
|
+
actionsPanelWidth = $state(0);
|
|
14
|
+
availableSideSpace = $state(0);
|
|
15
|
+
// is provided from the calling side
|
|
16
|
+
canShowAttachments = $state(true);
|
|
17
|
+
updateActionsPanelWidth = (value) => {
|
|
18
|
+
this.actionsPanelWidth = value;
|
|
19
|
+
};
|
|
20
|
+
updateAvailableSideSpace = (value) => {
|
|
21
|
+
this.availableSideSpace = value;
|
|
22
|
+
};
|
|
23
|
+
updateCanShowAttachments = (value) => {
|
|
24
|
+
this.canShowAttachments = value;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">let { children, on } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<button type="button" class="action-button" onclick={() => on.click()}>
|
|
6
|
+
{@render children()}
|
|
7
|
+
</button>
|
|
8
|
+
|
|
9
|
+
<style>@keyframes fadeIn {
|
|
10
|
+
0% {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
}
|
|
13
|
+
50% {
|
|
14
|
+
opacity: 0.4;
|
|
15
|
+
}
|
|
16
|
+
100% {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.action-button {
|
|
21
|
+
--_short-videos-player--action-button--size: var(--short-videos-player--action-button--size);
|
|
22
|
+
--_short-videos-player--action-button--background: var(--action-button-background, #1c1c1c);
|
|
23
|
+
width: var(--_short-videos-player--action-button--size);
|
|
24
|
+
min-width: var(--_short-videos-player--action-button--size);
|
|
25
|
+
max-width: var(--_short-videos-player--action-button--size);
|
|
26
|
+
height: var(--_short-videos-player--action-button--size);
|
|
27
|
+
min-height: var(--_short-videos-player--action-button--size);
|
|
28
|
+
max-height: var(--_short-videos-player--action-button--size);
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
line-height: 0;
|
|
33
|
+
background: var(--_short-videos-player--action-button--background);
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
--icon--size: 1.25rem;
|
|
36
|
+
z-index: 1;
|
|
37
|
+
color: #ffffff;
|
|
38
|
+
}</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Props = {
|
|
3
|
+
on: {
|
|
4
|
+
click: () => void;
|
|
5
|
+
};
|
|
6
|
+
children: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const ActionButton: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type ActionButton = ReturnType<typeof ActionButton>;
|
|
10
|
+
export default ActionButton;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script lang="ts">var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { ShortVideoViewer } from '../short-video-viewer';
|
|
11
|
+
import { PlayerBuffer, PlayerSlider } from '../../ui/player';
|
|
12
|
+
import { SpotlightLayout } from '../../ui/spotlight-layout';
|
|
13
|
+
import { default as Controls } from './controls.svelte';
|
|
14
|
+
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
15
|
+
import { ShortVideosPlayerUiManager } from './ui-manager.svelte';
|
|
16
|
+
import { onDestroy, onMount } from 'svelte';
|
|
17
|
+
let { shortVideosProvider, localization: localizationInit, on } = $props();
|
|
18
|
+
const localization = $derived(new ShortVideosPlayerLocalization(localizationInit));
|
|
19
|
+
const buffer = $derived(new PlayerBuffer(shortVideosProvider));
|
|
20
|
+
const uiManager = new ShortVideosPlayerUiManager();
|
|
21
|
+
onMount(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
uiManager.detailsCollapsed = window && window.innerWidth < window.innerHeight;
|
|
23
|
+
}));
|
|
24
|
+
onDestroy(() => {
|
|
25
|
+
// end tracking the short video
|
|
26
|
+
});
|
|
27
|
+
const handleDimensionsChanged = (dimensions) => {
|
|
28
|
+
uiManager.updateDimensions({
|
|
29
|
+
mainViewColumnWidth: dimensions.mainSceneWidth,
|
|
30
|
+
viewTotalWidth: dimensions.totalWidth
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div class="short-videos-player-container">
|
|
36
|
+
<div class="short-videos-player" style={uiManager.globalCssVariables}>
|
|
37
|
+
{#if buffer}
|
|
38
|
+
<SpotlightLayout ratio={9 / 16} on={{ dimensionsChanged: handleDimensionsChanged }}>
|
|
39
|
+
<div class="short-videos-player__content">
|
|
40
|
+
<PlayerSlider buffer={buffer}>
|
|
41
|
+
{#snippet children({ item })}
|
|
42
|
+
<ShortVideoViewer model={item} autoplay="on-appearance" showAttachments={uiManager.showShortVideoOverlay} />
|
|
43
|
+
{/snippet}
|
|
44
|
+
</PlayerSlider>
|
|
45
|
+
</div>
|
|
46
|
+
</SpotlightLayout>
|
|
47
|
+
<Controls buffer={buffer} uiManager={uiManager} localization={localization} on={{ closePlayer: () => on?.closePlayer?.() }} />
|
|
48
|
+
{/if}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<style>@keyframes fadeIn {
|
|
53
|
+
0% {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
50% {
|
|
57
|
+
opacity: 0.4;
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
.short-videos-player-container {
|
|
64
|
+
width: 100%;
|
|
65
|
+
min-width: 100%;
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
min-height: 100%;
|
|
69
|
+
max-height: 100%;
|
|
70
|
+
container-type: inline-size;
|
|
71
|
+
display: flex;
|
|
72
|
+
position: relative;
|
|
73
|
+
background: #000000;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.short-videos-player {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex: 1;
|
|
79
|
+
padding: 0.625rem 0;
|
|
80
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
81
|
+
}
|
|
82
|
+
@container (width < 576px) {
|
|
83
|
+
.short-videos-player {
|
|
84
|
+
padding: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
.short-videos-player__content {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
--short-video-viewer--actions-panel--bottom: 5rem;
|
|
91
|
+
}</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ShortVideoViewerModel } from '../short-video-viewer';
|
|
2
|
+
import { type PlayerItemsProvider } from '../../ui/player';
|
|
3
|
+
import { type IShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
4
|
+
type Props = {
|
|
5
|
+
shortVideosProvider: PlayerItemsProvider<ShortVideoViewerModel>;
|
|
6
|
+
localization?: IShortVideosPlayerLocalization;
|
|
7
|
+
on?: {
|
|
8
|
+
closePlayer?: () => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
13
|
+
export default Cmp;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<script lang="ts">import { ShortVideoDetails, ShortVideoViewerAttachments, ShortVideoViewerAttachmentsInline } from '../short-video-viewer';
|
|
2
|
+
import { Icon } from '../../ui/icon';
|
|
3
|
+
import { MediaVolumeManager } from '../../ui/media-playback';
|
|
4
|
+
import { default as ActionButton } from './action-button.svelte';
|
|
5
|
+
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte.js';
|
|
6
|
+
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg';
|
|
7
|
+
import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_20_regular.svg';
|
|
8
|
+
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_20_regular.svg';
|
|
9
|
+
import IconPanelRightGallery from '@fluentui/svg-icons/icons/panel_right_gallery_20_regular.svg';
|
|
10
|
+
import IconSpeaker2 from '@fluentui/svg-icons/icons/speaker_2_20_regular.svg';
|
|
11
|
+
import IconSpeakerMute from '@fluentui/svg-icons/icons/speaker_mute_20_regular.svg';
|
|
12
|
+
let { buffer, uiManager, localization, on } = $props();
|
|
13
|
+
const toggleMuted = () => {
|
|
14
|
+
MediaVolumeManager.isMuted = !MediaVolumeManager.isMuted;
|
|
15
|
+
};
|
|
16
|
+
const shortVideo = $derived(buffer.current);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div class="short-videos-player-controls">
|
|
20
|
+
<div class="short-videos-player-controls__left">
|
|
21
|
+
{#if shortVideo && uiManager.detailsCollapsed && !uiManager.showShortVideoOverlay}
|
|
22
|
+
<div class="short-videos-player-controls__short-video-overlay">
|
|
23
|
+
<div class="short-videos-player-controls__short-video-attachments-inline">
|
|
24
|
+
<ShortVideoViewerAttachmentsInline model={shortVideo} />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
<div class="short-videos-player-controls__navigation-buttons">
|
|
29
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
30
|
+
<Icon src={IconChevronUp} />
|
|
31
|
+
</button>
|
|
32
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
33
|
+
<Icon src={IconChevronDown} />
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="short-videos-player-controls__right">
|
|
38
|
+
{#if shortVideo}
|
|
39
|
+
<div class="short-videos-player-controls__short-video-attachments">
|
|
40
|
+
<ShortVideoViewerAttachments shortVideo={shortVideo} localization={localization.shortVideoDetailsLocalization?.attachmentsLocalization} />
|
|
41
|
+
</div>
|
|
42
|
+
{/if}
|
|
43
|
+
<div class="short-videos-player-controls__controls">
|
|
44
|
+
{#if shortVideo}
|
|
45
|
+
<ActionButton on={{ click: toggleMuted }}>
|
|
46
|
+
{#if MediaVolumeManager.isMuted}
|
|
47
|
+
<Icon src={IconSpeakerMute} />
|
|
48
|
+
{:else}
|
|
49
|
+
<Icon src={IconSpeaker2} />
|
|
50
|
+
{/if}
|
|
51
|
+
</ActionButton>
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
{#if shortVideo && !uiManager.isMobileView}
|
|
58
|
+
<ShortVideoDetails shortVideo={shortVideo} collapsed={uiManager.detailsCollapsed} localization={localization.shortVideoDetailsLocalization} />
|
|
59
|
+
<div class="toggle-collapsed-button">
|
|
60
|
+
<ActionButton on={{ click: () => (uiManager.detailsCollapsed = !uiManager.detailsCollapsed) }}>
|
|
61
|
+
<Icon src={IconPanelRightGallery} />
|
|
62
|
+
</ActionButton>
|
|
63
|
+
</div>
|
|
64
|
+
{/if}
|
|
65
|
+
<button type="button" class="close-button navigation-button" onclick={on.closePlayer}>
|
|
66
|
+
<Icon src={IconDismiss} />
|
|
67
|
+
</button>
|
|
68
|
+
|
|
69
|
+
<style>@keyframes fadeIn {
|
|
70
|
+
0% {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
}
|
|
73
|
+
50% {
|
|
74
|
+
opacity: 0.4;
|
|
75
|
+
}
|
|
76
|
+
100% {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.close-button {
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: var(--short-videos-player--controls--offset-vertical);
|
|
83
|
+
right: var(--short-videos-player--controls--offset-horizontal);
|
|
84
|
+
z-index: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.toggle-collapsed-button {
|
|
88
|
+
position: absolute;
|
|
89
|
+
bottom: var(--short-videos-player--controls--offset-vertical);
|
|
90
|
+
right: var(--short-videos-player--controls--offset-horizontal);
|
|
91
|
+
z-index: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.short-videos-player-controls {
|
|
95
|
+
position: absolute;
|
|
96
|
+
top: 0;
|
|
97
|
+
right: 0;
|
|
98
|
+
height: 100%;
|
|
99
|
+
width: var(--short-videos-player--sidebar--available-space);
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
gap: 2.5rem;
|
|
103
|
+
padding: var(--short-videos-player--controls--offset-vertical) var(--short-videos-player--controls--offset-horizontal);
|
|
104
|
+
container-type: inline-size;
|
|
105
|
+
}
|
|
106
|
+
.short-videos-player-controls__left {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
gap: 2.5rem;
|
|
110
|
+
justify-content: flex-end;
|
|
111
|
+
}
|
|
112
|
+
.short-videos-player-controls__right {
|
|
113
|
+
flex: 1;
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
align-items: flex-end;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
padding-top: 3.75rem;
|
|
119
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
120
|
+
}
|
|
121
|
+
@container (width < 9.375rem) {
|
|
122
|
+
.short-videos-player-controls__right {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
.short-videos-player-controls__short-video-overlay {
|
|
127
|
+
gap: 2.5rem;
|
|
128
|
+
display: flex;
|
|
129
|
+
flex: 1;
|
|
130
|
+
min-height: 0;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
align-items: flex-start;
|
|
133
|
+
justify-content: flex-end;
|
|
134
|
+
--short-video-viewer--interactions--icon--size: var(--short-videos-player--navigation-button--size);
|
|
135
|
+
--short-video-viewer--interactions--background--color: #1c1c1c;
|
|
136
|
+
--short-video-viewer--interactions--counter--color: #f3f4f6;
|
|
137
|
+
--short-video-viewer--interactions--icon--font-color: #f3f4f6;
|
|
138
|
+
}
|
|
139
|
+
.short-videos-player-controls__short-video-attachments-inline {
|
|
140
|
+
display: none;
|
|
141
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
142
|
+
}
|
|
143
|
+
@container (width < calc(21.875rem + 3.75rem)) {
|
|
144
|
+
.short-videos-player-controls__short-video-attachments-inline {
|
|
145
|
+
display: contents;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.short-videos-player-controls__short-video-attachments {
|
|
149
|
+
flex: 1;
|
|
150
|
+
overflow-x: hidden;
|
|
151
|
+
overflow-y: auto;
|
|
152
|
+
scrollbar-color: transparent transparent;
|
|
153
|
+
scrollbar-width: thin;
|
|
154
|
+
width: 21.875rem;
|
|
155
|
+
max-width: 21.875rem;
|
|
156
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
157
|
+
}
|
|
158
|
+
.short-videos-player-controls__short-video-attachments::-webkit-scrollbar {
|
|
159
|
+
width: 3px;
|
|
160
|
+
height: 3px;
|
|
161
|
+
background: var(--custom-scrollbar-background, transparent);
|
|
162
|
+
visibility: hidden;
|
|
163
|
+
}
|
|
164
|
+
.short-videos-player-controls__short-video-attachments::-webkit-scrollbar-thumb {
|
|
165
|
+
background: transparent;
|
|
166
|
+
}
|
|
167
|
+
.short-videos-player-controls__short-video-attachments:hover {
|
|
168
|
+
scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
|
|
169
|
+
scrollbar-width: thin;
|
|
170
|
+
}
|
|
171
|
+
.short-videos-player-controls__short-video-attachments:hover::-webkit-scrollbar {
|
|
172
|
+
width: 3px;
|
|
173
|
+
height: 3px;
|
|
174
|
+
background: var(--custom-scrollbar-background, transparent);
|
|
175
|
+
visibility: hidden;
|
|
176
|
+
}
|
|
177
|
+
.short-videos-player-controls__short-video-attachments:hover::-webkit-scrollbar-thumb {
|
|
178
|
+
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
179
|
+
}
|
|
180
|
+
@container (width < calc(21.875rem + 3.75rem)) {
|
|
181
|
+
.short-videos-player-controls__short-video-attachments {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
.short-videos-player-controls__navigation-buttons {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
gap: 1rem;
|
|
189
|
+
margin-bottom: 0.625rem;
|
|
190
|
+
z-index: 1;
|
|
191
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
192
|
+
}
|
|
193
|
+
@container (width < 6.25rem) {
|
|
194
|
+
.short-videos-player-controls__navigation-buttons {
|
|
195
|
+
visibility: hidden;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
.short-videos-player-controls__controls {
|
|
199
|
+
display: flex;
|
|
200
|
+
margin-top: auto;
|
|
201
|
+
gap: 1rem;
|
|
202
|
+
align-self: flex-start;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.navigation-button {
|
|
206
|
+
width: var(--short-videos-player--navigation-button--size);
|
|
207
|
+
min-width: var(--short-videos-player--navigation-button--size);
|
|
208
|
+
max-width: var(--short-videos-player--navigation-button--size);
|
|
209
|
+
height: var(--short-videos-player--navigation-button--size);
|
|
210
|
+
min-height: var(--short-videos-player--navigation-button--size);
|
|
211
|
+
max-height: var(--short-videos-player--navigation-button--size);
|
|
212
|
+
background-color: #000000;
|
|
213
|
+
border: 1px solid #1c1c1c;
|
|
214
|
+
border-radius: 50%;
|
|
215
|
+
text-align: center;
|
|
216
|
+
--icon--color: #ffffff;
|
|
217
|
+
--icon--stroke-width: 0.6;
|
|
218
|
+
}
|
|
219
|
+
.navigation-button:disabled {
|
|
220
|
+
opacity: 0.5;
|
|
221
|
+
cursor: default;
|
|
222
|
+
}</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ShortVideoViewerModel } from '../short-video-viewer';
|
|
2
|
+
import type { IPlayerBuffer } from '../../ui/player';
|
|
3
|
+
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte.js';
|
|
4
|
+
import type { ShortVideosPlayerUiManager } from './ui-manager.svelte';
|
|
5
|
+
type Props = {
|
|
6
|
+
buffer: IPlayerBuffer<ShortVideoViewerModel>;
|
|
7
|
+
uiManager: ShortVideosPlayerUiManager;
|
|
8
|
+
localization: ShortVideosPlayerLocalization;
|
|
9
|
+
on: {
|
|
10
|
+
closePlayer: () => void;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare const Controls: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type Controls = ReturnType<typeof Controls>;
|
|
15
|
+
export default Controls;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ShortVideoViewerModel } from '../short-video-viewer';
|
|
2
|
+
import type { PlayerItemsProvider } from '../../ui/player';
|
|
3
|
+
import type { IShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
4
|
+
export type { IShortVideosPlayerLocalization };
|
|
5
|
+
/**
|
|
6
|
+
* Opens the short videos player modal with the specified provider and optional localization.
|
|
7
|
+
*
|
|
8
|
+
* @param init - Configuration options.
|
|
9
|
+
* @param {PlayerItemsProvider<ShortVideoViewerModel>} init.shortVideosProvider - The provider instance supplying short video items to the player.
|
|
10
|
+
* @param {IShortVideosPlayerLocalization} [init.localization] - Optional localization settings for the player UI.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { openShortVideosPlayer } from '@streamscloud/embeddable/short-videos-player';
|
|
15
|
+
*
|
|
16
|
+
* openShortVideosPlayer({
|
|
17
|
+
* shortVideosProvider: myShortVideosProvider,
|
|
18
|
+
* localization: {
|
|
19
|
+
* next: 'Next',
|
|
20
|
+
* previous: 'Previous'
|
|
21
|
+
* }
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const openShortVideosPlayer: (init: {
|
|
26
|
+
shortVideosProvider: PlayerItemsProvider<ShortVideoViewerModel>;
|
|
27
|
+
localization?: IShortVideosPlayerLocalization;
|
|
28
|
+
on?: {
|
|
29
|
+
playerClosed?: () => void;
|
|
30
|
+
};
|
|
31
|
+
}) => void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ShadowHost } from '../../ui/shadow-dom';
|
|
2
|
+
import { default as ShortVideosPlayer } from './cmp.short-videos-player.svelte';
|
|
3
|
+
import { mount } from 'svelte';
|
|
4
|
+
/**
|
|
5
|
+
* Opens the short videos player modal with the specified provider and optional localization.
|
|
6
|
+
*
|
|
7
|
+
* @param init - Configuration options.
|
|
8
|
+
* @param {PlayerItemsProvider<ShortVideoViewerModel>} init.shortVideosProvider - The provider instance supplying short video items to the player.
|
|
9
|
+
* @param {IShortVideosPlayerLocalization} [init.localization] - Optional localization settings for the player UI.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { openShortVideosPlayer } from '@streamscloud/embeddable/short-videos-player';
|
|
14
|
+
*
|
|
15
|
+
* openShortVideosPlayer({
|
|
16
|
+
* shortVideosProvider: myShortVideosProvider,
|
|
17
|
+
* localization: {
|
|
18
|
+
* next: 'Next',
|
|
19
|
+
* previous: 'Previous'
|
|
20
|
+
* }
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export const openShortVideosPlayer = (init) => {
|
|
25
|
+
const { shortVideosProvider, localization } = init;
|
|
26
|
+
const shadowHost = new ShadowHost({ onClosed: () => init.on?.playerClosed?.() });
|
|
27
|
+
mount(ShortVideosPlayer, {
|
|
28
|
+
target: shadowHost.shadowRoot,
|
|
29
|
+
props: {
|
|
30
|
+
shortVideosProvider,
|
|
31
|
+
localization,
|
|
32
|
+
on: {
|
|
33
|
+
closePlayer: () => {
|
|
34
|
+
shadowHost.remove();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
shadowHost.attachToBody();
|
|
40
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IShortVideoDetailsLocalization } from '../short-video-viewer';
|
|
2
|
+
export interface IShortVideosPlayerLocalization {
|
|
3
|
+
shortVideoDetailsLocalization?: IShortVideoDetailsLocalization;
|
|
4
|
+
}
|
|
5
|
+
export declare class ShortVideosPlayerLocalization {
|
|
6
|
+
shortVideoDetailsLocalization: IShortVideoDetailsLocalization | undefined;
|
|
7
|
+
constructor(init?: IShortVideosPlayerLocalization);
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class ShortVideosPlayerUiManager {
|
|
2
|
+
detailsCollapsed: boolean;
|
|
3
|
+
globalCssVariables: string;
|
|
4
|
+
isMobileView: boolean;
|
|
5
|
+
showShortVideoOverlay: boolean;
|
|
6
|
+
private readonly actionButtonSize;
|
|
7
|
+
private readonly navigationButtonSize;
|
|
8
|
+
private readonly controlsOffsetHorizontal;
|
|
9
|
+
private readonly controlsOffsetVertical;
|
|
10
|
+
private viewTotalWidth;
|
|
11
|
+
private mainViewColumnWidth;
|
|
12
|
+
updateDimensions: (dimensions: {
|
|
13
|
+
viewTotalWidth: number;
|
|
14
|
+
mainViewColumnWidth: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|