@streamscloud/embeddable 1.1.2
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/README.md +1 -0
- package/dist/advertising/ad-view/cmp.ad-view.svelte +82 -0
- package/dist/advertising/ad-view/cmp.ad-view.svelte.d.ts +8 -0
- package/dist/advertising/ad-view/index.d.ts +2 -0
- package/dist/advertising/ad-view/index.js +1 -0
- package/dist/advertising/ad-view/mapper.d.ts +3 -0
- package/dist/advertising/ad-view/mapper.js +16 -0
- package/dist/advertising/ad-view/operations.generated.d.ts +17 -0
- package/dist/advertising/ad-view/operations.generated.js +46 -0
- package/dist/advertising/ad-view/operations.graphql +14 -0
- package/dist/advertising/ad-view/types.d.ts +10 -0
- package/dist/advertising/ad-view/types.js +1 -0
- package/dist/advertising/index.d.ts +1 -0
- package/dist/advertising/index.js +1 -0
- package/dist/advertising/types.d.ts +5 -0
- package/dist/advertising/types.js +6 -0
- 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/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 +2 -0
- package/dist/core/media/types.d.ts +28 -0
- package/dist/core/media/types.js +19 -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 +4 -0
- package/dist/index.js +4 -0
- package/dist/products/index.d.ts +1 -0
- package/dist/products/index.js +1 -0
- package/dist/products/price-helper.d.ts +4 -0
- package/dist/products/price-helper.js +36 -0
- package/dist/products/product-card/cmp.product-card.svelte +121 -0
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +10 -0
- package/dist/products/product-card/index.d.ts +3 -0
- package/dist/products/product-card/index.js +3 -0
- package/dist/products/product-card/mapper.d.ts +3 -0
- package/dist/products/product-card/mapper.js +14 -0
- package/dist/products/product-card/operations.generated.d.ts +22 -0
- package/dist/products/product-card/operations.generated.js +65 -0
- package/dist/products/product-card/operations.graphql +19 -0
- package/dist/products/product-card/product-card-localization.svelte.d.ts +7 -0
- package/dist/products/product-card/product-card-localization.svelte.js +11 -0
- package/dist/products/product-card/types.d.ts +10 -0
- package/dist/products/product-card/types.js +1 -0
- package/dist/products/types.d.ts +5 -0
- package/dist/products/types.js +6 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +71 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +7 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +145 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +10 -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 +12 -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 +6 -0
- package/dist/short-videos/short-video-viewer/index.js +4 -0
- package/dist/short-videos/short-video-viewer/mapper.d.ts +3 -0
- package/dist/short-videos/short-video-viewer/mapper.js +28 -0
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +56 -0
- package/dist/short-videos/short-video-viewer/operations.generated.js +187 -0
- package/dist/short-videos/short-video-viewer/operations.graphql +26 -0
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.d.ts +14 -0
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +21 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +10 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +13 -0
- package/dist/short-videos/short-video-viewer/types.d.ts +17 -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 +215 -0
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +15 -0
- package/dist/short-videos/short-videos-player/index.d.ts +2 -0
- package/dist/short-videos/short-videos-player/index.js +1 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +14 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +21 -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/short-videos/short-videos-player-modal/cmp.short-videos-player-modal.svelte +485 -0
- package/dist/short-videos/short-videos-player-modal/cmp.short-videos-player-modal.svelte.d.ts +3 -0
- package/dist/short-videos/short-videos-player-modal/index.d.ts +79 -0
- package/dist/short-videos/short-videos-player-modal/index.js +78 -0
- package/dist/short-videos/short-videos-player-modal/short-videos-player-modal-state.svelte.d.ts +16 -0
- package/dist/short-videos/short-videos-player-modal/short-videos-player-modal-state.svelte.js +13 -0
- package/dist/streams/components/cmp.stream-page-component.svelte +16 -0
- package/dist/streams/components/cmp.stream-page-component.svelte.d.ts +10 -0
- package/dist/streams/components/components.factory.d.ts +22 -0
- package/dist/streams/components/components.factory.js +34 -0
- package/dist/streams/components/images/cmp.images-component.svelte +7 -0
- package/dist/streams/components/images/cmp.images-component.svelte.d.ts +7 -0
- package/dist/streams/components/images/index.d.ts +2 -0
- package/dist/streams/components/images/index.js +1 -0
- package/dist/streams/components/images/types.d.ts +8 -0
- package/dist/streams/components/images/types.js +5 -0
- package/dist/streams/components/index.d.ts +7 -0
- package/dist/streams/components/index.js +6 -0
- package/dist/streams/components/mapper.d.ts +3 -0
- package/dist/streams/components/mapper.js +43 -0
- package/dist/streams/components/operations.generated.d.ts +178 -0
- package/dist/streams/components/operations.generated.js +653 -0
- package/dist/streams/components/operations.graphql +35 -0
- package/dist/streams/components/product/cmp.product-component.svelte +148 -0
- package/dist/streams/components/product/cmp.product-component.svelte.d.ts +8 -0
- package/dist/streams/components/product/index.d.ts +3 -0
- package/dist/streams/components/product/index.js +2 -0
- package/dist/streams/components/product/mapper.d.ts +3 -0
- package/dist/streams/components/product/mapper.js +14 -0
- package/dist/streams/components/product/operations.generated.d.ts +22 -0
- package/dist/streams/components/product/operations.generated.js +53 -0
- package/dist/streams/components/product/operations.graphql +19 -0
- package/dist/streams/components/product/types.d.ts +10 -0
- package/dist/streams/components/product/types.js +1 -0
- package/dist/streams/components/short-video/cmp.short-video-component.svelte +9 -0
- package/dist/streams/components/short-video/cmp.short-video-component.svelte.d.ts +10 -0
- package/dist/streams/components/short-video/index.d.ts +3 -0
- package/dist/streams/components/short-video/index.js +2 -0
- package/dist/streams/components/short-video/mapper.d.ts +3 -0
- package/dist/streams/components/short-video/mapper.js +4 -0
- package/dist/streams/components/short-video/operations.generated.d.ts +56 -0
- package/dist/streams/components/short-video/operations.generated.js +193 -0
- package/dist/streams/components/short-video/operations.graphql +3 -0
- package/dist/streams/components/short-video/types.d.ts +2 -0
- package/dist/streams/components/short-video/types.js +1 -0
- package/dist/streams/components/stream-components-localization.svelte.d.ts +10 -0
- package/dist/streams/components/stream-components-localization.svelte.js +13 -0
- package/dist/streams/components/types.d.ts +27 -0
- package/dist/streams/components/types.js +6 -0
- package/dist/streams/slots/cmp.stream-component-slot.svelte +35 -0
- package/dist/streams/slots/cmp.stream-component-slot.svelte.d.ts +9 -0
- package/dist/streams/slots/index.d.ts +3 -0
- package/dist/streams/slots/index.js +2 -0
- package/dist/streams/slots/mapper.d.ts +3 -0
- package/dist/streams/slots/mapper.js +18 -0
- package/dist/streams/slots/operations.generated.d.ts +17 -0
- package/dist/streams/slots/operations.generated.js +34 -0
- package/dist/streams/slots/operations.graphql +14 -0
- package/dist/streams/slots/styles-transformer.d.ts +6 -0
- package/dist/streams/slots/styles-transformer.js +12 -0
- package/dist/streams/slots/types.d.ts +16 -0
- package/dist/streams/slots/types.js +1 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +47 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +9 -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 +23 -0
- package/dist/streams/stream-page-viewer/operations.generated.d.ts +113 -0
- package/dist/streams/stream-page-viewer/operations.generated.js +400 -0
- package/dist/streams/stream-page-viewer/operations.graphql +13 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +10 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +13 -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 +141 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +16 -0
- package/dist/streams/stream-player/controls.svelte +222 -0
- package/dist/streams/stream-player/controls.svelte.d.ts +14 -0
- package/dist/streams/stream-player/index.d.ts +2 -0
- package/dist/streams/stream-player/index.js +1 -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 +161 -0
- package/dist/streams/stream-player/operations.generated.js +559 -0
- package/dist/streams/stream-player/operations.graphql +32 -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 +18 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.js +29 -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/streams/stream-player-modal/cmp.stream-player-modal.svelte +486 -0
- package/dist/streams/stream-player-modal/cmp.stream-player-modal.svelte.d.ts +3 -0
- package/dist/streams/stream-player-modal/index.d.ts +79 -0
- package/dist/streams/stream-player-modal/index.js +78 -0
- package/dist/streams/stream-player-modal/stream-player-modal-state.svelte.d.ts +17 -0
- package/dist/streams/stream-player-modal/stream-player-modal-state.svelte.js +14 -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 +90 -0
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +12 -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 +277 -0
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +12 -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/cmp.shadow-dom.svelte +26 -0
- package/dist/ui/shadow-dom/cmp.shadow-dom.svelte.d.ts +7 -0
- package/dist/ui/shadow-dom/index.d.ts +1 -0
- package/dist/ui/shadow-dom/index.js +1 -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 +89 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<script lang="ts">import { Utils } from '../../core/utils';
|
|
2
|
+
import { isScrollingPrevented } from './prevent-slider-scroll';
|
|
3
|
+
import { onDestroy, onMount } from 'svelte';
|
|
4
|
+
let { buffer, children } = $props();
|
|
5
|
+
let slidesRef;
|
|
6
|
+
let sliderHeight = $state(0);
|
|
7
|
+
let swipeTransition = $state(0);
|
|
8
|
+
let cssAnimationDuration = $state(buffer.animationDuration * 0.75);
|
|
9
|
+
let resizeObserver;
|
|
10
|
+
let activeIndex = $state.raw(buffer.currentIndex);
|
|
11
|
+
const actualTransition = $derived(-sliderHeight * activeIndex);
|
|
12
|
+
const onKeyPress = (e) => {
|
|
13
|
+
if (e.key === 'ArrowUp' || e.key === 'PageUp') {
|
|
14
|
+
buffer.loadPrevious();
|
|
15
|
+
}
|
|
16
|
+
if (e.key === 'ArrowDown' || e.key === 'PageDown') {
|
|
17
|
+
buffer.loadNext();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
$effect(() => {
|
|
21
|
+
if (buffer.currentIndex >= 0 && activeIndex >= 0 && Math.abs(activeIndex - buffer.currentIndex) === 1) {
|
|
22
|
+
slidesRef.classList.toggle('animate', true);
|
|
23
|
+
}
|
|
24
|
+
activeIndex = buffer.currentIndex;
|
|
25
|
+
});
|
|
26
|
+
onMount(() => {
|
|
27
|
+
let touchStartY = 0;
|
|
28
|
+
let touchMoveY = 0;
|
|
29
|
+
let touchStartTime = 0;
|
|
30
|
+
window.addEventListener(`keydown`, onKeyPress);
|
|
31
|
+
slidesRef.addEventListener('touchstart', (e) => {
|
|
32
|
+
// The movement gets all janky if there's a transition on the elements.
|
|
33
|
+
slidesRef.classList.toggle('animate', false);
|
|
34
|
+
touchStartY = e.changedTouches[0].screenY;
|
|
35
|
+
touchStartTime = Date.now();
|
|
36
|
+
});
|
|
37
|
+
slidesRef.addEventListener('touchmove', (e) => {
|
|
38
|
+
const newPosition = e.changedTouches[0].screenY;
|
|
39
|
+
const diff = newPosition - touchStartY;
|
|
40
|
+
if ((diff > 0 && buffer.canLoadPrevious) || (diff < 0 && buffer.canLoadNext)) {
|
|
41
|
+
touchMoveY = diff;
|
|
42
|
+
swipeTransition = diff + actualTransition;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
slidesRef.addEventListener('touchend', () => {
|
|
46
|
+
slidesRef.classList.toggle('animate', true);
|
|
47
|
+
const reset = () => {
|
|
48
|
+
swipeTransition = 0;
|
|
49
|
+
touchMoveY = 0;
|
|
50
|
+
};
|
|
51
|
+
const isFastSwipe = Date.now() - touchStartTime < 300;
|
|
52
|
+
if (!touchMoveY || (!isFastSwipe && Math.abs(touchMoveY) < sliderHeight / 6)) {
|
|
53
|
+
return reset();
|
|
54
|
+
}
|
|
55
|
+
if (touchMoveY > 0) {
|
|
56
|
+
buffer.loadPrevious();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
buffer.loadNext();
|
|
60
|
+
}
|
|
61
|
+
reset();
|
|
62
|
+
});
|
|
63
|
+
slidesRef.addEventListener('wheel', Utils.throttle((e) => {
|
|
64
|
+
const checkCanHandleWheel = (node) => {
|
|
65
|
+
while (node && node !== slidesRef) {
|
|
66
|
+
if (isScrollingPrevented(node)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
node = node.parentElement;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
};
|
|
73
|
+
if (!checkCanHandleWheel(e.target)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (e.deltaY > 0 && buffer.canLoadNext) {
|
|
77
|
+
buffer.loadNext();
|
|
78
|
+
}
|
|
79
|
+
if (e.deltaY < 0 && buffer.canLoadPrevious) {
|
|
80
|
+
buffer.loadPrevious();
|
|
81
|
+
}
|
|
82
|
+
}, buffer.animationDuration + 250));
|
|
83
|
+
slidesRef.addEventListener('transitionend', (e) => {
|
|
84
|
+
if (e.target !== slidesRef) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
slidesRef.classList.toggle('animate', false);
|
|
88
|
+
});
|
|
89
|
+
sliderHeight = slidesRef.clientHeight;
|
|
90
|
+
resizeObserver = new ResizeObserver(() => {
|
|
91
|
+
sliderHeight = slidesRef.clientHeight;
|
|
92
|
+
});
|
|
93
|
+
resizeObserver.observe(slidesRef);
|
|
94
|
+
});
|
|
95
|
+
onDestroy(() => {
|
|
96
|
+
if (resizeObserver) {
|
|
97
|
+
resizeObserver.disconnect();
|
|
98
|
+
}
|
|
99
|
+
window.removeEventListener('keydown', onKeyPress);
|
|
100
|
+
});
|
|
101
|
+
const styles = $derived.by(() => {
|
|
102
|
+
const values = [
|
|
103
|
+
`transform: translateY(${swipeTransition || actualTransition}px)`,
|
|
104
|
+
`--_player-slider--animation: ${cssAnimationDuration}ms ease-out transform`
|
|
105
|
+
];
|
|
106
|
+
return values.join(';');
|
|
107
|
+
});
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<div class="player-slider">
|
|
111
|
+
<div class="player-slider__slides" bind:this={slidesRef} style={styles}>
|
|
112
|
+
{#each buffer.loaded as item, index (item)}
|
|
113
|
+
<div class="player-slider__slide">
|
|
114
|
+
{@render children({ item, active: index === activeIndex })}
|
|
115
|
+
</div>
|
|
116
|
+
{/each}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<style>@keyframes fadeIn {
|
|
121
|
+
0% {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
}
|
|
124
|
+
50% {
|
|
125
|
+
opacity: 0.4;
|
|
126
|
+
}
|
|
127
|
+
100% {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.player-slider {
|
|
132
|
+
position: relative;
|
|
133
|
+
overflow: clip;
|
|
134
|
+
height: 100%;
|
|
135
|
+
width: 100%;
|
|
136
|
+
min-width: 100%;
|
|
137
|
+
max-width: 100%;
|
|
138
|
+
}
|
|
139
|
+
.player-slider__slides {
|
|
140
|
+
height: 100%;
|
|
141
|
+
min-height: 100%;
|
|
142
|
+
max-height: 100%;
|
|
143
|
+
width: 100%;
|
|
144
|
+
min-width: 100%;
|
|
145
|
+
max-width: 100%;
|
|
146
|
+
}
|
|
147
|
+
.player-slider__slides:global(.animate) {
|
|
148
|
+
transition: var(--_player-slider--animation);
|
|
149
|
+
}
|
|
150
|
+
.player-slider__slide {
|
|
151
|
+
display: flex;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
align-items: center;
|
|
154
|
+
position: relative;
|
|
155
|
+
height: 100%;
|
|
156
|
+
min-height: 100%;
|
|
157
|
+
max-height: 100%;
|
|
158
|
+
width: 100%;
|
|
159
|
+
min-width: 100%;
|
|
160
|
+
max-width: 100%;
|
|
161
|
+
}</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IPlayerBuffer } from './types';
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
3
|
+
declare class __sveltets_Render<T extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}> {
|
|
6
|
+
props(): {
|
|
7
|
+
buffer: IPlayerBuffer<T>;
|
|
8
|
+
children: Snippet<[{
|
|
9
|
+
item: T;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
}]>;
|
|
12
|
+
};
|
|
13
|
+
events(): {};
|
|
14
|
+
slots(): {};
|
|
15
|
+
bindings(): "";
|
|
16
|
+
exports(): {};
|
|
17
|
+
}
|
|
18
|
+
interface $$IsomorphicComponent {
|
|
19
|
+
new <T extends {
|
|
20
|
+
id: string;
|
|
21
|
+
}>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
22
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
23
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
24
|
+
<T extends {
|
|
25
|
+
id: string;
|
|
26
|
+
}>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
27
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
28
|
+
}
|
|
29
|
+
declare const Cmp: $$IsomorphicComponent;
|
|
30
|
+
type Cmp<T extends {
|
|
31
|
+
id: string;
|
|
32
|
+
}> = InstanceType<typeof Cmp<T>>;
|
|
33
|
+
export default Cmp;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IPlayerBuffer } from './types';
|
|
2
|
+
export declare class PlayerBuffer<T extends {
|
|
3
|
+
id: string;
|
|
4
|
+
}> implements IPlayerBuffer<T> {
|
|
5
|
+
readonly loaded: T[];
|
|
6
|
+
readonly currentIndex: number;
|
|
7
|
+
readonly current: T | null;
|
|
8
|
+
readonly canLoadNext: boolean;
|
|
9
|
+
readonly canLoadPrevious: boolean;
|
|
10
|
+
readonly navigationDisabled: boolean;
|
|
11
|
+
readonly animationDuration = 1200;
|
|
12
|
+
private _currentIndex;
|
|
13
|
+
private _loaded;
|
|
14
|
+
private loadMoreFn;
|
|
15
|
+
private isLoading;
|
|
16
|
+
constructor(provider: PlayerItemsProvider<T>);
|
|
17
|
+
loadNext: () => Promise<void>;
|
|
18
|
+
loadPrevious: () => Promise<void>;
|
|
19
|
+
reset: () => void;
|
|
20
|
+
private warmUpBuffer;
|
|
21
|
+
}
|
|
22
|
+
export type PlayerItemsProvider<T> = {
|
|
23
|
+
initialData: {
|
|
24
|
+
prefetchedItems: T[];
|
|
25
|
+
startIndex: number;
|
|
26
|
+
};
|
|
27
|
+
loadMore(): Promise<T[]>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Utils } from '../../core/utils';
|
|
2
|
+
export class PlayerBuffer {
|
|
3
|
+
loaded = $derived.by(() => this._loaded);
|
|
4
|
+
currentIndex = $derived.by(() => this._currentIndex);
|
|
5
|
+
current = $derived(this.currentIndex >= 0 ? this.loaded[this.currentIndex] : null);
|
|
6
|
+
canLoadNext = $derived(this.currentIndex < this.loaded.length - 1);
|
|
7
|
+
canLoadPrevious = $derived(this.currentIndex > 0);
|
|
8
|
+
navigationDisabled = $derived(!this.canLoadNext && !this.canLoadPrevious);
|
|
9
|
+
animationDuration = 1200;
|
|
10
|
+
_currentIndex = $state(-1);
|
|
11
|
+
_loaded = $state.raw([]);
|
|
12
|
+
loadMoreFn;
|
|
13
|
+
isLoading = false;
|
|
14
|
+
constructor(provider) {
|
|
15
|
+
this.loadMoreFn = provider.loadMore;
|
|
16
|
+
this._loaded = provider.initialData.prefetchedItems;
|
|
17
|
+
this._currentIndex = this._loaded.length
|
|
18
|
+
? provider.initialData.startIndex >= this._loaded.length
|
|
19
|
+
? this._loaded.length - 1
|
|
20
|
+
: provider.initialData.startIndex
|
|
21
|
+
: -1;
|
|
22
|
+
this.warmUpBuffer();
|
|
23
|
+
this.loadNext = Utils.throttle(this.loadNext, this.animationDuration);
|
|
24
|
+
this.loadPrevious = Utils.throttle(this.loadPrevious, this.animationDuration);
|
|
25
|
+
}
|
|
26
|
+
loadNext = async () => {
|
|
27
|
+
if (!this.canLoadNext) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
++this._currentIndex;
|
|
31
|
+
this.warmUpBuffer();
|
|
32
|
+
};
|
|
33
|
+
loadPrevious = async () => {
|
|
34
|
+
if (!this.canLoadPrevious) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
--this._currentIndex;
|
|
38
|
+
};
|
|
39
|
+
reset = () => {
|
|
40
|
+
this._loaded = [];
|
|
41
|
+
this._currentIndex = -1;
|
|
42
|
+
this.isLoading = false;
|
|
43
|
+
this.warmUpBuffer();
|
|
44
|
+
};
|
|
45
|
+
warmUpBuffer = async () => {
|
|
46
|
+
const bufferSize = 5;
|
|
47
|
+
if (this._loaded.length >= this.currentIndex + bufferSize || this.isLoading) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.isLoading = true;
|
|
51
|
+
try {
|
|
52
|
+
const result = await this.loadMoreFn();
|
|
53
|
+
this._loaded = [...this._loaded, ...result];
|
|
54
|
+
if (this.currentIndex < 0) {
|
|
55
|
+
if (this._loaded.length > 0) {
|
|
56
|
+
this._currentIndex = 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
this.isLoading = false;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @type {import('svelte/action').Action} */
|
|
2
|
+
export const preventSliderScroll = (node, value = true) => {
|
|
3
|
+
node.dataset[preventScrollingAttrubute] = value.toString();
|
|
4
|
+
return {
|
|
5
|
+
destroy() {
|
|
6
|
+
// the node has been removed from the DOM
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export const isScrollingPrevented = (node) => node.dataset[preventScrollingAttrubute] === 'true';
|
|
11
|
+
const preventScrollingAttrubute = 'preventPlayerScrolling';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IPlayerBuffer<T extends {
|
|
2
|
+
id: string;
|
|
3
|
+
}> {
|
|
4
|
+
readonly current: T | null;
|
|
5
|
+
readonly currentIndex: number;
|
|
6
|
+
readonly loaded: T[];
|
|
7
|
+
readonly canLoadNext: boolean;
|
|
8
|
+
readonly canLoadPrevious: boolean;
|
|
9
|
+
readonly navigationDisabled: boolean;
|
|
10
|
+
readonly animationDuration: number;
|
|
11
|
+
loadNext: () => void;
|
|
12
|
+
loadPrevious: () => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">let { value } = $props();
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<div class="progress">
|
|
5
|
+
<span class="progress__value" class:progress__value--animated={value > 0.01 && value < 0.96} style="width: {`${100 * (value <= 1 ? value : 1)}%`}">
|
|
6
|
+
|
|
7
|
+
</span>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<style>@keyframes fadeIn {
|
|
11
|
+
0% {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
50% {
|
|
15
|
+
opacity: 0.4;
|
|
16
|
+
}
|
|
17
|
+
100% {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.progress {
|
|
22
|
+
--_progress--height: var(--progress--height, 0.25em);
|
|
23
|
+
--_progress--back-color: var(--progress--back-color, #b0b0b0);
|
|
24
|
+
--_progress--front-color: var(--progress--front-color, #ffffff);
|
|
25
|
+
width: 100%;
|
|
26
|
+
background: var(--_progress--back-color);
|
|
27
|
+
height: var(--_progress--height);
|
|
28
|
+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25) inset;
|
|
29
|
+
}
|
|
30
|
+
.progress__value {
|
|
31
|
+
background: var(--_progress--front-color);
|
|
32
|
+
display: inline-block;
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
.progress__value--animated {
|
|
36
|
+
transition: width 600ms;
|
|
37
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Progress } from './cmp.progress.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Progress } from './cmp.progress.svelte';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">let { ratio, children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="proportional-container" style={ratio ? `--proportional-container--ratio: ${ratio};` : undefined}>
|
|
6
|
+
<div class="proportional-container__placer">
|
|
7
|
+
{@render children?.()}
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<style>@keyframes fadeIn {
|
|
12
|
+
0% {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
50% {
|
|
16
|
+
opacity: 0.4;
|
|
17
|
+
}
|
|
18
|
+
100% {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.proportional-container {
|
|
23
|
+
--_proportional-container--ratio: var(--proportional-container--ratio, 1);
|
|
24
|
+
--_proportional-container--height: var(--proportional-container--height, auto);
|
|
25
|
+
--_proportional-container--width: var(--proportional-container--width, 100%);
|
|
26
|
+
width: var(--_proportional-container--width);
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
height: var(--_proportional-container--height);
|
|
29
|
+
max-height: 100%;
|
|
30
|
+
aspect-ratio: var(--_proportional-container--ratio);
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
.proportional-container__placer {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProportionalContainer } from './cmp.proportional-container.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProportionalContainer } from './cmp.proportional-container.svelte';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts">let { value, on } = $props();
|
|
2
|
+
let progressRef;
|
|
3
|
+
let valueRef;
|
|
4
|
+
const handleSeek = (e) => {
|
|
5
|
+
e.stopPropagation();
|
|
6
|
+
const { left, width } = progressRef.getBoundingClientRect();
|
|
7
|
+
const x = e.clientX - left;
|
|
8
|
+
const percent = x / width;
|
|
9
|
+
value = percent;
|
|
10
|
+
valueRef.style.transition = 'none';
|
|
11
|
+
valueRef.style.width = `${100 * percent}%`;
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
valueRef.style.transition = '';
|
|
14
|
+
}, 0);
|
|
15
|
+
on === null || on === void 0 ? void 0 : on.seek(percent);
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div class="seek-bar" onclick={handleSeek} onkeydown={() => ({})} role="none">
|
|
20
|
+
<div class="seek-bar__container" bind:this={progressRef}>
|
|
21
|
+
<span
|
|
22
|
+
class="seek-bar__value"
|
|
23
|
+
class:seek-bar__value--animate={value > 0.001 && value < 0.96}
|
|
24
|
+
style="width: {`${100 * (value <= 1 ? value : 1)}%`}"
|
|
25
|
+
bind:this={valueRef}>
|
|
26
|
+
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>@keyframes fadeIn {
|
|
32
|
+
0% {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
50% {
|
|
36
|
+
opacity: 0.4;
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
.seek-bar {
|
|
43
|
+
--_seek-bar--height: var(--seek-bar--height, 0.25em);
|
|
44
|
+
--_seek-bar--back-color: var(--seek-bar--back-color, #b0b0b0);
|
|
45
|
+
--_seek-bar--front-color: var(--seek-bar--front-color, #ffffff);
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
}
|
|
48
|
+
.seek-bar__container {
|
|
49
|
+
width: 100%;
|
|
50
|
+
background: var(--_seek-bar--back-color);
|
|
51
|
+
height: var(--_seek-bar--height);
|
|
52
|
+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25) inset;
|
|
53
|
+
border-radius: calc(var(--_seek-bar--height) / 2);
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
}
|
|
56
|
+
.seek-bar__value {
|
|
57
|
+
background: var(--_seek-bar--front-color);
|
|
58
|
+
display: inline-block;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
.seek-bar__value--animate {
|
|
62
|
+
transition: width 500ms;
|
|
63
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SeekBar } from './cmp.seek-bar.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SeekBar } from './cmp.seek-bar.svelte';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">import { DynamicComponent, DynamicComponentModel } from '../dynamic-component';
|
|
2
|
+
import normalize from 'styles/_normalize.scss?raw';
|
|
3
|
+
import reset from 'styles/_reset.scss?raw';
|
|
4
|
+
import { mount, onMount } from 'svelte';
|
|
5
|
+
let { model } = $props();
|
|
6
|
+
let shadowRoot;
|
|
7
|
+
let host;
|
|
8
|
+
onMount(() => {
|
|
9
|
+
shadowRoot = host.attachShadow({ mode: 'open' });
|
|
10
|
+
const styleElement = document.createElement('style');
|
|
11
|
+
styleElement.textContent = normalize + reset;
|
|
12
|
+
shadowRoot.appendChild(styleElement);
|
|
13
|
+
mount(DynamicComponent, { target: shadowRoot, props: { model } });
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="host" bind:this={host}></div>
|
|
18
|
+
|
|
19
|
+
<style>.host {
|
|
20
|
+
display: contents;
|
|
21
|
+
position: fixed;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
bottom: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ShadowDom } from './cmp.shadow-dom.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ShadowDom } from './cmp.shadow-dom.svelte';
|