@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
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Shared embeddable Streams components
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script lang="ts">import { getMediaItemImageUrl } from '../../core/media';
|
|
2
|
+
import { Button, ButtonSize } from '../../ui/button';
|
|
3
|
+
import { Image } from '../../ui/image';
|
|
4
|
+
import { LineClamp } from '../../ui/line-clamp';
|
|
5
|
+
import { ProportionalContainer } from '../../ui/proportional-container';
|
|
6
|
+
let { ad, inert = false } = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="ad" inert={inert}>
|
|
10
|
+
<ProportionalContainer ratio={16 / 9}>
|
|
11
|
+
<Image src={getMediaItemImageUrl(ad.media)} alt={ad.title} />
|
|
12
|
+
</ProportionalContainer>
|
|
13
|
+
<div class="ad__body">
|
|
14
|
+
{#if ad.title}
|
|
15
|
+
<p class="ad__title">{ad.title}</p>
|
|
16
|
+
{/if}
|
|
17
|
+
{#if ad.description}
|
|
18
|
+
<p class="ad__description">
|
|
19
|
+
<LineClamp value={ad.description} maxLines={3} />
|
|
20
|
+
</p>
|
|
21
|
+
{/if}
|
|
22
|
+
{#if ad.buttonUrl}
|
|
23
|
+
<div class="ad__button">
|
|
24
|
+
<a href={ad.buttonUrl} target="_blank" class="ad__link">
|
|
25
|
+
<Button size={ButtonSize.Standard}>{ad.buttonText || ad.buttonUrl}</Button>
|
|
26
|
+
</a>
|
|
27
|
+
</div>
|
|
28
|
+
{/if}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<style>@keyframes fadeIn {
|
|
33
|
+
0% {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
50% {
|
|
37
|
+
opacity: 0.4;
|
|
38
|
+
}
|
|
39
|
+
100% {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.ad {
|
|
44
|
+
--_ad--global--font-size: var(--ad--global--font-size, 1rem);
|
|
45
|
+
--_ad--body--horizontal-indent: var(--ad--body--horizontal-indent, 1em);
|
|
46
|
+
--_ad--body--padding-top: var(--ad--body--padding-top, 1em);
|
|
47
|
+
--_ad--body--padding-bottom: var(--ad--body--padding-bottom, 1.25em);
|
|
48
|
+
--_ad--min-height: var(--ad--min-height, 0em);
|
|
49
|
+
--_ad--background: var(--ad--background, #fafafa);
|
|
50
|
+
font-size: var(--_ad--global--font-size);
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
border-radius: 0.25em;
|
|
54
|
+
background: var(--_ad--background);
|
|
55
|
+
min-height: var(--_ad--min-height);
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
width: 100%;
|
|
58
|
+
}
|
|
59
|
+
:global([data-theme="dark"]) .ad {
|
|
60
|
+
--_ad--background: var(--ad--background, #1c1c1c);
|
|
61
|
+
}
|
|
62
|
+
.ad__body {
|
|
63
|
+
padding: var(--_ad--body--padding-top) var(--_ad--body--horizontal-indent) var(--_ad--body--padding-top);
|
|
64
|
+
}
|
|
65
|
+
.ad__title {
|
|
66
|
+
font-size: 0.9375em;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
display: block;
|
|
69
|
+
margin-bottom: 0.8333333333em;
|
|
70
|
+
}
|
|
71
|
+
.ad__description {
|
|
72
|
+
font-size: 0.75em;
|
|
73
|
+
display: block;
|
|
74
|
+
margin-bottom: 1.3333333333em;
|
|
75
|
+
white-space: pre-line;
|
|
76
|
+
word-break: break-word;
|
|
77
|
+
}
|
|
78
|
+
.ad__button {
|
|
79
|
+
margin-top: 1em;
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AdView } from './cmp.ad-view.svelte';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const mapToAdViewModel = (payload) => {
|
|
2
|
+
const media = payload.media[0];
|
|
3
|
+
return {
|
|
4
|
+
id: payload.id,
|
|
5
|
+
title: payload.title,
|
|
6
|
+
description: payload.description,
|
|
7
|
+
buttonText: payload.buttonText,
|
|
8
|
+
buttonUrl: payload.buttonUrl,
|
|
9
|
+
openLinkInNewWindow: payload.openLinkInNewWindow,
|
|
10
|
+
media: {
|
|
11
|
+
url: media.url,
|
|
12
|
+
thumbnailUrl: media.thumbnailUrl,
|
|
13
|
+
type: media.type
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as SchemaTypes from '../../../gql/types';
|
|
2
|
+
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
+
export type AdViewPayloadFragment = {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string | null;
|
|
7
|
+
buttonText: string | null;
|
|
8
|
+
buttonUrl: string | null;
|
|
9
|
+
openLinkInNewWindow: boolean | null;
|
|
10
|
+
type: SchemaTypes.AdType;
|
|
11
|
+
media: Array<{
|
|
12
|
+
type: SchemaTypes.MediaType;
|
|
13
|
+
url: string;
|
|
14
|
+
thumbnailUrl: string | null;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
export declare const AdViewPayloadFragmentDoc: DocumentNode<AdViewPayloadFragment, unknown>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const AdViewPayloadFragmentDoc = {
|
|
2
|
+
kind: 'Document',
|
|
3
|
+
definitions: [
|
|
4
|
+
{
|
|
5
|
+
kind: 'FragmentDefinition',
|
|
6
|
+
name: { kind: 'Name', value: 'AdViewPayloadFragment' },
|
|
7
|
+
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Ad' } },
|
|
8
|
+
selectionSet: {
|
|
9
|
+
kind: 'SelectionSet',
|
|
10
|
+
selections: [
|
|
11
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
12
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
13
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
|
|
14
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'buttonText' } },
|
|
15
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'buttonUrl' } },
|
|
16
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'openLinkInNewWindow' } },
|
|
17
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
18
|
+
{
|
|
19
|
+
kind: 'Field',
|
|
20
|
+
name: { kind: 'Name', value: 'media' },
|
|
21
|
+
selectionSet: {
|
|
22
|
+
kind: 'SelectionSet',
|
|
23
|
+
selections: [
|
|
24
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
25
|
+
{
|
|
26
|
+
kind: 'Field',
|
|
27
|
+
name: { kind: 'Name', value: 'url' },
|
|
28
|
+
arguments: [
|
|
29
|
+
{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } } }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
kind: 'Field',
|
|
34
|
+
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
35
|
+
arguments: [
|
|
36
|
+
{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } } }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MediaItemModel } from '../../core/media';
|
|
2
|
+
export type AdViewModel = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string | null;
|
|
6
|
+
buttonText: string | null;
|
|
7
|
+
buttonUrl: string | null;
|
|
8
|
+
openLinkInNewWindow: boolean | null;
|
|
9
|
+
media: MediaItemModel;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AdType } from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AdType } from './types';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class ContinuationToken {
|
|
2
|
+
canLoadMore: boolean;
|
|
3
|
+
value: string | null;
|
|
4
|
+
private constructor();
|
|
5
|
+
static init(): ContinuationToken;
|
|
6
|
+
static fromPayload(value: string | null): ContinuationToken;
|
|
7
|
+
static preventLoading(): ContinuationToken;
|
|
8
|
+
toString(): string | null;
|
|
9
|
+
toJSON(): string | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class ContinuationToken {
|
|
2
|
+
canLoadMore;
|
|
3
|
+
value;
|
|
4
|
+
constructor(canLoadMore, value) {
|
|
5
|
+
this.canLoadMore = canLoadMore;
|
|
6
|
+
this.value = value;
|
|
7
|
+
}
|
|
8
|
+
static init() {
|
|
9
|
+
// initial state, no data is loaded so far
|
|
10
|
+
return new ContinuationToken(true, null);
|
|
11
|
+
}
|
|
12
|
+
static fromPayload(value) {
|
|
13
|
+
if (value?.length && value.length > 1 && value.length < 5000) {
|
|
14
|
+
// initialized with server response that there is more data, and value is valid
|
|
15
|
+
return new ContinuationToken(true, value);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
// initialized with server response that there is no more data or value is invalid
|
|
19
|
+
return new ContinuationToken(false, null);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
static preventLoading() {
|
|
23
|
+
// additional initilizer, to block further loading
|
|
24
|
+
return new ContinuationToken(false, null);
|
|
25
|
+
}
|
|
26
|
+
toString() {
|
|
27
|
+
return this.value;
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return this.value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CursorResult } from '../cursor-result';
|
|
2
|
+
import { ContinuationToken } from '../continuation-token';
|
|
3
|
+
import type { IDataLoader } from './data-loader';
|
|
4
|
+
export declare class CursorDataLoader<T> implements IDataLoader<T> {
|
|
5
|
+
items: T[];
|
|
6
|
+
continuationToken: ContinuationToken;
|
|
7
|
+
private loadPage;
|
|
8
|
+
private deferred;
|
|
9
|
+
constructor(init: {
|
|
10
|
+
loadPage: (continuationToken: ContinuationToken) => Promise<CursorResult<T> | null>;
|
|
11
|
+
});
|
|
12
|
+
loadMore: () => Promise<T[]>;
|
|
13
|
+
reset(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {} from '../cursor-result';
|
|
2
|
+
import { Deferred } from '../deferred';
|
|
3
|
+
import { ContinuationToken } from '../continuation-token';
|
|
4
|
+
export class CursorDataLoader {
|
|
5
|
+
items = $state([]);
|
|
6
|
+
continuationToken = $state.raw(ContinuationToken.init());
|
|
7
|
+
loadPage;
|
|
8
|
+
deferred = null;
|
|
9
|
+
constructor(init) {
|
|
10
|
+
this.loadPage = init.loadPage;
|
|
11
|
+
}
|
|
12
|
+
loadMore = async () => {
|
|
13
|
+
if (this.deferred) {
|
|
14
|
+
return this.deferred.promise;
|
|
15
|
+
}
|
|
16
|
+
if (!this.continuationToken.canLoadMore) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
this.deferred = new Deferred();
|
|
20
|
+
let result = await this.loadPage(this.continuationToken);
|
|
21
|
+
if (!result) {
|
|
22
|
+
result = { items: [], continuationToken: ContinuationToken.preventLoading() };
|
|
23
|
+
}
|
|
24
|
+
this.continuationToken = result.continuationToken;
|
|
25
|
+
this.items = [...this.items, ...result.items];
|
|
26
|
+
this.deferred.resolve(result.items);
|
|
27
|
+
this.deferred = null;
|
|
28
|
+
return result.items;
|
|
29
|
+
};
|
|
30
|
+
async reset() {
|
|
31
|
+
this.items = [];
|
|
32
|
+
this.continuationToken = ContinuationToken.init();
|
|
33
|
+
await this.loadMore();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CursorDataLoader } from './cursor-data-loader.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createLocalGQLClient: (customFetch?: typeof fetch) => import("@urql/core").Client;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createClient, fetchExchange } from '@urql/core';
|
|
2
|
+
export const createLocalGQLClient = (customFetch) => createClient({
|
|
3
|
+
url: 'https://localhost:5000/graphql',
|
|
4
|
+
requestPolicy: 'network-only',
|
|
5
|
+
fetchOptions: {
|
|
6
|
+
credentials: 'include'
|
|
7
|
+
},
|
|
8
|
+
fetch: customFetch || fetch,
|
|
9
|
+
exchanges: [fetchExchange]
|
|
10
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class ImageHelper {
|
|
2
|
+
static checkIsVertical: (url: string) => Promise<boolean>;
|
|
3
|
+
static computeRatio: (src: string) => Promise<ImageSize | null>;
|
|
4
|
+
static getRatio: (metadata: ImageSize) => number;
|
|
5
|
+
}
|
|
6
|
+
type ImageSize = {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class ImageHelper {
|
|
2
|
+
static checkIsVertical = async (url) => {
|
|
3
|
+
const ratio = await ImageHelper.computeRatio(url);
|
|
4
|
+
if (!ratio) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
return ratio.height >= ratio.width;
|
|
8
|
+
};
|
|
9
|
+
static computeRatio = async (src) => {
|
|
10
|
+
const setRatio = (imageElement, resolveFn) => {
|
|
11
|
+
if (!imageElement || !imageElement.width) {
|
|
12
|
+
resolveFn(null);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
resolveFn({ width: imageElement.width, height: imageElement.height });
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return new Promise((resolve) => {
|
|
19
|
+
const imageElement = new Image();
|
|
20
|
+
imageElement.onload = () => {
|
|
21
|
+
setRatio(imageElement, resolve);
|
|
22
|
+
};
|
|
23
|
+
imageElement.onerror = () => {
|
|
24
|
+
setRatio(null, resolve);
|
|
25
|
+
};
|
|
26
|
+
imageElement.src = src;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
static getRatio = (metadata) => metadata.width / metadata.height;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ImageScale } from './types';
|
|
2
|
+
import MobileDetect from 'mobile-detect';
|
|
3
|
+
export class ImageSizeDetectorService {
|
|
4
|
+
userAgent;
|
|
5
|
+
constructor(userAgent = null) {
|
|
6
|
+
this.userAgent = userAgent;
|
|
7
|
+
}
|
|
8
|
+
getImageSize() {
|
|
9
|
+
if (!this.userAgent) {
|
|
10
|
+
return ImageScale.OriginalEncoded;
|
|
11
|
+
}
|
|
12
|
+
const result = new MobileDetect(this.userAgent);
|
|
13
|
+
return result.mobile() ? ImageScale.Medium : ImageScale.OriginalEncoded;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ImageHelper } from './image-helper';
|
|
2
|
+
export { ImageSizeDetectorService } from './images-size-detector.service';
|
|
3
|
+
export { type MediaItemModel, type MediaItemMetadataModel, type MediaItemWithMetadataModel, MediaType, MediaFormat, ImageScale } from './types';
|
|
4
|
+
export { getMediaItemImageUrl } from './media-item-url.service';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type MediaItemModel = {
|
|
2
|
+
type: MediaType;
|
|
3
|
+
url: string;
|
|
4
|
+
thumbnailUrl: string | null;
|
|
5
|
+
};
|
|
6
|
+
export type MediaItemMetadataModel = {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
export type MediaItemWithMetadataModel = MediaItemModel & {
|
|
11
|
+
metadata: MediaItemMetadataModel;
|
|
12
|
+
};
|
|
13
|
+
export declare enum MediaType {
|
|
14
|
+
Audio = "AUDIO",
|
|
15
|
+
Image = "IMAGE",
|
|
16
|
+
ShortVideo = "SHORT_VIDEO",
|
|
17
|
+
Video = "VIDEO"
|
|
18
|
+
}
|
|
19
|
+
export declare enum MediaFormat {
|
|
20
|
+
W4H3 = "W4H3",
|
|
21
|
+
W16H9 = "W16H9"
|
|
22
|
+
}
|
|
23
|
+
export declare enum ImageScale {
|
|
24
|
+
Big = "BIG",
|
|
25
|
+
Medium = "MEDIUM",
|
|
26
|
+
OriginalEncoded = "ORIGINAL_ENCODED",
|
|
27
|
+
Small = "SMALL"
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var MediaType;
|
|
2
|
+
(function (MediaType) {
|
|
3
|
+
MediaType["Audio"] = "AUDIO";
|
|
4
|
+
MediaType["Image"] = "IMAGE";
|
|
5
|
+
MediaType["ShortVideo"] = "SHORT_VIDEO";
|
|
6
|
+
MediaType["Video"] = "VIDEO";
|
|
7
|
+
})(MediaType || (MediaType = {}));
|
|
8
|
+
export var MediaFormat;
|
|
9
|
+
(function (MediaFormat) {
|
|
10
|
+
MediaFormat["W4H3"] = "W4H3";
|
|
11
|
+
MediaFormat["W16H9"] = "W16H9";
|
|
12
|
+
})(MediaFormat || (MediaFormat = {}));
|
|
13
|
+
export var ImageScale;
|
|
14
|
+
(function (ImageScale) {
|
|
15
|
+
ImageScale["Big"] = "BIG";
|
|
16
|
+
ImageScale["Medium"] = "MEDIUM";
|
|
17
|
+
ImageScale["OriginalEncoded"] = "ORIGINAL_ENCODED";
|
|
18
|
+
ImageScale["Small"] = "SMALL";
|
|
19
|
+
})(ImageScale || (ImageScale = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toastrWarning: (message: string) => void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const toastrWarning = (message) => {
|
|
2
|
+
const toast = document.createElement('div');
|
|
3
|
+
toast.innerHTML = `
|
|
4
|
+
<span>${message}</span>
|
|
5
|
+
<span style="margin-left: auto; cursor: pointer; color: #666;" onclick="this.parentElement.remove()">x</span>
|
|
6
|
+
`;
|
|
7
|
+
Object.assign(toast.style, {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
gap: '8px',
|
|
11
|
+
background: 'white',
|
|
12
|
+
color: 'black',
|
|
13
|
+
borderRadius: '5px',
|
|
14
|
+
padding: '12px 16px',
|
|
15
|
+
boxShadow: '0 2px 10px rgba(0, 0, 0, 0.1)',
|
|
16
|
+
position: 'fixed',
|
|
17
|
+
bottom: '10px',
|
|
18
|
+
right: '10px',
|
|
19
|
+
width: '300px',
|
|
20
|
+
borderLeft: '4px solid #e0a800',
|
|
21
|
+
borderBottom: '4px solid #e0a800',
|
|
22
|
+
zIndex: 1000
|
|
23
|
+
});
|
|
24
|
+
document.body.appendChild(toast);
|
|
25
|
+
setTimeout(() => toast.remove(), 5000);
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { slideHorizontally } from './slide-horizontally';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { slideHorizontally } from './slide-horizontally';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { sineInOut } from 'svelte/easing';
|
|
2
|
+
import type { TransitionConfig } from 'svelte/transition';
|
|
3
|
+
export declare const slideHorizontally: (node: HTMLElement, { delay, duration, easing }?: {
|
|
4
|
+
delay?: number | undefined;
|
|
5
|
+
duration?: number | undefined;
|
|
6
|
+
easing?: typeof sineInOut | undefined;
|
|
7
|
+
}) => TransitionConfig;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { sineInOut } from 'svelte/easing';
|
|
2
|
+
export const slideHorizontally = (node, { delay = 0, duration = 400, easing = sineInOut } = {}) => {
|
|
3
|
+
const style = getComputedStyle(node);
|
|
4
|
+
const isHtmlElement = (node) => node.nodeType === Node.ELEMENT_NODE;
|
|
5
|
+
const children = Array.from(node.children).filter(isHtmlElement);
|
|
6
|
+
children.forEach((child) => {
|
|
7
|
+
const style = getComputedStyle(child);
|
|
8
|
+
child.style.width = style.width;
|
|
9
|
+
child.style.minWidth = style.width;
|
|
10
|
+
child.style.maxWidth = style.maxWidth;
|
|
11
|
+
});
|
|
12
|
+
const opacity = +style.opacity;
|
|
13
|
+
const width = parseFloat(style.width);
|
|
14
|
+
const padding_left = parseFloat(style.paddingLeft);
|
|
15
|
+
const padding_right = parseFloat(style.paddingRight);
|
|
16
|
+
const margin_left = parseFloat(style.marginLeft);
|
|
17
|
+
const margin_right = parseFloat(style.marginRight);
|
|
18
|
+
const border_left_width = parseFloat(style.borderLeftWidth);
|
|
19
|
+
const border_right_width = parseFloat(style.borderRightWidth);
|
|
20
|
+
let initialT = undefined;
|
|
21
|
+
let initialU = undefined;
|
|
22
|
+
return {
|
|
23
|
+
delay,
|
|
24
|
+
duration,
|
|
25
|
+
easing,
|
|
26
|
+
css: (t, u) => {
|
|
27
|
+
if (initialT === undefined) {
|
|
28
|
+
initialT = t;
|
|
29
|
+
}
|
|
30
|
+
if (initialU === undefined) {
|
|
31
|
+
initialU = u;
|
|
32
|
+
}
|
|
33
|
+
return ('overflow: hidden;' +
|
|
34
|
+
`opacity: ${Math.min(t, 1) * opacity};` +
|
|
35
|
+
`width: ${t * width}px;` +
|
|
36
|
+
`min-width: ${t * width}px;` +
|
|
37
|
+
`padding-left: ${t * padding_left}px;` +
|
|
38
|
+
`padding-right: ${t * padding_right}px;` +
|
|
39
|
+
`margin-left: ${t * margin_left}px;` +
|
|
40
|
+
`margin-right: ${t * margin_right}px;` +
|
|
41
|
+
`border-left-width: ${t * border_left_width}px;` +
|
|
42
|
+
`border-right-width: ${t * border_right_width}px;`);
|
|
43
|
+
},
|
|
44
|
+
// Clean up function to remove the wrapper when the transition is done
|
|
45
|
+
tick: (t, u) => {
|
|
46
|
+
if ((initialT === 0 && t === 1) || (initialU === 0 && u === 1)) {
|
|
47
|
+
children.forEach((child) => {
|
|
48
|
+
child.style.width = '';
|
|
49
|
+
child.style.minWidth = '';
|
|
50
|
+
child.style.maxWidth = '';
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|