@streamscloud/embeddable 2.1.1 → 2.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/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 +32 -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 +17 -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,47 @@
|
|
|
1
|
+
import { Currency } from '../core/enums';
|
|
2
|
+
import { Utils } from '../core/utils';
|
|
3
|
+
export const toPriceRepresentation = (amount, currency, includeCurrency = true) => {
|
|
4
|
+
const formatNumber = (value) => {
|
|
5
|
+
const noDecimals = Number.isInteger(value);
|
|
6
|
+
const options = {
|
|
7
|
+
minimumFractionDigits: noDecimals ? 0 : 2,
|
|
8
|
+
maximumFractionDigits: noDecimals ? 0 : 2
|
|
9
|
+
};
|
|
10
|
+
return value.toLocaleString('no-NO', options);
|
|
11
|
+
};
|
|
12
|
+
switch (currency) {
|
|
13
|
+
case Currency.Eur: {
|
|
14
|
+
const value = formatNumber(amount);
|
|
15
|
+
return includeCurrency ? `€ ${value}` : value;
|
|
16
|
+
}
|
|
17
|
+
case Currency.Nok: {
|
|
18
|
+
const formattedValue = Number.isInteger(amount) ? `${amount},-` : formatNumber(amount);
|
|
19
|
+
return includeCurrency ? `kr ${formatNumber(amount)}` : formattedValue;
|
|
20
|
+
}
|
|
21
|
+
case Currency.Usd: {
|
|
22
|
+
const value = formatNumber(amount);
|
|
23
|
+
return includeCurrency ? `€ ${value}` : value;
|
|
24
|
+
}
|
|
25
|
+
default: {
|
|
26
|
+
Utils.assertUnreachable(currency);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export const shouldUseSalePrice = (price, salePrice, effectiveDateFrom, effectiveDateTo) => {
|
|
31
|
+
if (!isSalePriceEffective(salePrice, effectiveDateFrom, effectiveDateTo)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return price !== salePrice;
|
|
35
|
+
};
|
|
36
|
+
export const isSalePriceEffective = (salePrice, effectiveDateFrom, effectiveDateTo) => {
|
|
37
|
+
if (!salePrice) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (!effectiveDateFrom && !effectiveDateTo) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
const now = Date.now();
|
|
44
|
+
const fromDate = effectiveDateFrom && new Date(effectiveDateFrom);
|
|
45
|
+
const toDate = effectiveDateTo && new Date(effectiveDateTo);
|
|
46
|
+
return (!fromDate || now >= fromDate.getTime()) && (!toDate || now < toDate.getTime());
|
|
47
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script lang="ts">import { Button, ButtonSize } from '../../ui/button';
|
|
2
|
+
import { Image } from '../../ui/image';
|
|
3
|
+
import { LineClamp } from '../../ui/line-clamp';
|
|
4
|
+
import { ProportionalContainer } from '../../ui/proportional-container';
|
|
5
|
+
let { ad } = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class="short-video-ad-viewer">
|
|
9
|
+
<ProportionalContainer ratio={16 / 9}>
|
|
10
|
+
<Image src={ad.image} alt={ad.title} />
|
|
11
|
+
</ProportionalContainer>
|
|
12
|
+
<div class="short-video-ad-viewer__body">
|
|
13
|
+
{#if ad.title}
|
|
14
|
+
<p class="short-video-ad-viewer__title">{ad.title}</p>
|
|
15
|
+
{/if}
|
|
16
|
+
{#if ad.description}
|
|
17
|
+
<p class="short-video-ad-viewer__description">
|
|
18
|
+
<LineClamp value={ad.description} maxLines={3} />
|
|
19
|
+
</p>
|
|
20
|
+
{/if}
|
|
21
|
+
{#if ad.buttonUrl}
|
|
22
|
+
<div class="short-video-ad-viewer__button">
|
|
23
|
+
<a href={ad.buttonUrl} target="_blank" class="short-video-ad-viewer__link">
|
|
24
|
+
<Button size={ButtonSize.Standard}>{ad.buttonText || ad.buttonUrl}</Button>
|
|
25
|
+
</a>
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
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
|
+
.short-video-ad-viewer {
|
|
43
|
+
--_short-video-ad-viewer--background: var(--short-video-ad-viewer--background, #2e2e2e);
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
border-radius: 0.25em;
|
|
47
|
+
background: var(--_short-video-ad-viewer--background);
|
|
48
|
+
min-height: 0;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
.short-video-ad-viewer__body {
|
|
53
|
+
padding: 1em 1em 1.25em;
|
|
54
|
+
}
|
|
55
|
+
.short-video-ad-viewer__title {
|
|
56
|
+
color: #ffffff;
|
|
57
|
+
font-size: 0.9375em;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
display: block;
|
|
60
|
+
margin-bottom: 0.6666666667em;
|
|
61
|
+
}
|
|
62
|
+
.short-video-ad-viewer__description {
|
|
63
|
+
color: #ffffff;
|
|
64
|
+
font-size: 0.75em;
|
|
65
|
+
display: block;
|
|
66
|
+
margin-bottom: 1.3333333333em;
|
|
67
|
+
white-space: pre-line;
|
|
68
|
+
word-break: break-word;
|
|
69
|
+
}
|
|
70
|
+
.short-video-ad-viewer__button {
|
|
71
|
+
margin-top: 1em;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
}</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">import { Icon, IconColor } from '../../ui/icon';
|
|
2
|
+
import { ImageRounded } from '../../ui/image';
|
|
3
|
+
import IconTargetArrow from '@fluentui/svg-icons/icons/target_arrow_20_regular.svg';
|
|
4
|
+
let { model } = $props();
|
|
5
|
+
const attachmentsToShow = $derived.by(() => {
|
|
6
|
+
const products = model.products.filter((p) => !!p.image).map((p) => ({ isAd: false, image: p.image, link: p.link }));
|
|
7
|
+
const ads = (model.ad ? [model.ad] : []).filter((a) => !!a.image).map((a) => ({ isAd: true, image: a.image, link: a.buttonUrl }));
|
|
8
|
+
return [...products, ...ads];
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="attachments-inline-container">
|
|
13
|
+
<div class="attachments-inline">
|
|
14
|
+
{#each attachmentsToShow as attachment (attachment)}
|
|
15
|
+
<div class="attachments-inline__item" onclick={() => attachment.link && window.open(attachment.link, '_blank')} onkeydown={() => {}} role="none">
|
|
16
|
+
<ImageRounded src={attachment.image} alt="" />
|
|
17
|
+
{#if attachment.isAd}
|
|
18
|
+
<div class="attachments-inline__item-icon">
|
|
19
|
+
<Icon src={IconTargetArrow} color={IconColor.White} />
|
|
20
|
+
</div>
|
|
21
|
+
{/if}
|
|
22
|
+
</div>
|
|
23
|
+
{/each}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<style>@keyframes fadeIn {
|
|
28
|
+
0% {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
50% {
|
|
32
|
+
opacity: 0.4;
|
|
33
|
+
}
|
|
34
|
+
100% {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.attachments-inline-container {
|
|
39
|
+
flex: 1;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
justify-content: flex-end;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.attachments-inline {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 0.5rem;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
height: 100%;
|
|
53
|
+
justify-content: flex-end;
|
|
54
|
+
}
|
|
55
|
+
.attachments-inline__item {
|
|
56
|
+
--image--rounded--width: 3.125rem;
|
|
57
|
+
--image--rounded--height: 3.75rem;
|
|
58
|
+
--image--rounded--inner--border-width: 0;
|
|
59
|
+
--image--rounded--outer--border-radius: 0.25rem;
|
|
60
|
+
--image--rounded--outer--border-width: 1px;
|
|
61
|
+
--image--rounded--outer--border-color: #f3f4f6;
|
|
62
|
+
position: relative;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
.attachments-inline__item-icon {
|
|
66
|
+
position: absolute;
|
|
67
|
+
bottom: 2px;
|
|
68
|
+
right: 2px;
|
|
69
|
+
--icon--size: 1rem;
|
|
70
|
+
}</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts">import { default as ShortVideoAdViewer } from './cmp.ad.svelte';
|
|
2
|
+
import { default as ShortVideoProductViewer } from './cmp.product.svelte';
|
|
3
|
+
import { ShortVideoAttachmentsLocalizationSvelte } from './short-video-attachments-localization.svelte';
|
|
4
|
+
import {} from './types';
|
|
5
|
+
let { shortVideo, localization: localizationInit, on } = $props();
|
|
6
|
+
const localization = $derived(new ShortVideoAttachmentsLocalizationSvelte(localizationInit));
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
{#if shortVideo.products.length || shortVideo.ad}
|
|
10
|
+
<div class="short-video-attachments">
|
|
11
|
+
{#if shortVideo.products.length}
|
|
12
|
+
<div class="short-video-attachments__section-header">{localization.productsSection}</div>
|
|
13
|
+
<div class="short-video-attachments__products">
|
|
14
|
+
{#each shortVideo.products as product (product.id)}
|
|
15
|
+
<ShortVideoProductViewer product={product} localization={localization.productLocalization} on={on} />
|
|
16
|
+
{/each}
|
|
17
|
+
</div>
|
|
18
|
+
{/if}
|
|
19
|
+
|
|
20
|
+
{#if shortVideo.ad}
|
|
21
|
+
<div class="short-video-attachments__section-header">{localization.offersSection}</div>
|
|
22
|
+
<div class="short-video-attachments__offer">
|
|
23
|
+
<ShortVideoAdViewer ad={shortVideo.ad} />
|
|
24
|
+
</div>
|
|
25
|
+
{/if}
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
|
|
29
|
+
<style>@keyframes fadeIn {
|
|
30
|
+
0% {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
50% {
|
|
34
|
+
opacity: 0.4;
|
|
35
|
+
}
|
|
36
|
+
100% {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.short-video-attachments {
|
|
41
|
+
--_short-video-attachments--margin-vertical: var(--short-video-attachments--margin-vertical, 0);
|
|
42
|
+
--_short-video-attachments--spacing-vertical: var(--short-video-attachments--spacing-vertical, 1.25rem);
|
|
43
|
+
--_short-video-attachments--spacing-horizontal: var(--short-video-attachments--spacing-horizontal, 1rem);
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: var(--_short-video-attachments--spacing-vertical);
|
|
47
|
+
padding: var(--_short-video-attachments--margin-vertical) 0;
|
|
48
|
+
}
|
|
49
|
+
.short-video-attachments__section-header {
|
|
50
|
+
color: #d1d5db;
|
|
51
|
+
font-size: 1rem;
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
line-height: 1.2;
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
margin-bottom: 0.5rem;
|
|
57
|
+
padding: 0.5625rem var(--_short-video-attachments--spacing-horizontal) 0;
|
|
58
|
+
}
|
|
59
|
+
.short-video-attachments__products {
|
|
60
|
+
padding: 0 var(--_short-video-attachments--spacing-horizontal);
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
63
|
+
grid-column-gap: var(--_short-video-attachments--spacing-horizontal);
|
|
64
|
+
grid-row-gap: var(--_short-video-attachments--spacing-vertical);
|
|
65
|
+
}
|
|
66
|
+
.short-video-attachments__offer {
|
|
67
|
+
padding: 0 var(--_short-video-attachments--spacing-horizontal);
|
|
68
|
+
}</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IShortVideoAttachmentsLocalization } from './short-video-attachments-localization.svelte';
|
|
2
|
+
import { type ShortVideoViewerModel } from './types';
|
|
3
|
+
type Props = {
|
|
4
|
+
shortVideo: ShortVideoViewerModel;
|
|
5
|
+
localization?: IShortVideoAttachmentsLocalization;
|
|
6
|
+
on?: {
|
|
7
|
+
productClick?: (productId: string) => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
12
|
+
export default Cmp;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<script lang="ts">import { toPriceRepresentation } from '../../products/price-helper';
|
|
2
|
+
import { ImageRounded } from '../../ui/image';
|
|
3
|
+
import { ProportionalContainer } from '../../ui/proportional-container';
|
|
4
|
+
import { ShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
5
|
+
let { product, fitToContainer = false, localization: localizationInit, on } = $props();
|
|
6
|
+
const localization = $derived(new ShortVideoProductLocalization(localizationInit));
|
|
7
|
+
const handleProductClick = (event) => {
|
|
8
|
+
if (!product.link) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
event.stopPropagation();
|
|
13
|
+
if (on === null || on === void 0 ? void 0 : on.productClick) {
|
|
14
|
+
on.productClick(product.id);
|
|
15
|
+
}
|
|
16
|
+
window.open(product.link, '_blank', 'noopener noreferrer');
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="short-video-product-viewer">
|
|
21
|
+
{#if fitToContainer}
|
|
22
|
+
<div class="short-video-product-viewer__image">
|
|
23
|
+
<ImageRounded src={product.image} noBorders={true} />
|
|
24
|
+
</div>
|
|
25
|
+
{:else}
|
|
26
|
+
<ProportionalContainer ratio={4 / 5}>
|
|
27
|
+
<ImageRounded src={product.image} noBorders={true} />
|
|
28
|
+
</ProportionalContainer>
|
|
29
|
+
{/if}
|
|
30
|
+
<div class="short-video-product-viewer__name">{product.title}</div>
|
|
31
|
+
<div class="short-video-product-viewer__price">
|
|
32
|
+
<div class="product-price">
|
|
33
|
+
{#if !product.salePrice}
|
|
34
|
+
<div class="product-price__price">{toPriceRepresentation(product.price, product.currency)}</div>
|
|
35
|
+
{:else}
|
|
36
|
+
<div class="product-price__before-price">
|
|
37
|
+
{#if localization.beforeNowPrefix}
|
|
38
|
+
{localization.beforeNowPrefix}
|
|
39
|
+
{/if}
|
|
40
|
+
{toPriceRepresentation(product.price, product.currency)}
|
|
41
|
+
</div>
|
|
42
|
+
<div class="product-price__price product-price__price--sale">
|
|
43
|
+
{toPriceRepresentation(product.salePrice, product.currency)}
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
{#if product.link}
|
|
50
|
+
<a href={product.link} onclick={handleProductClick} target="_blank" rel="noopener noreferrer" class="short-video-product-viewer__link" aria-label="none"
|
|
51
|
+
> </a>
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<style>@keyframes fadeIn {
|
|
56
|
+
0% {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
}
|
|
59
|
+
50% {
|
|
60
|
+
opacity: 0.4;
|
|
61
|
+
}
|
|
62
|
+
100% {
|
|
63
|
+
opacity: 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
.short-video-product-viewer {
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: auto;
|
|
69
|
+
position: relative;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
container-type: inline-size;
|
|
73
|
+
--image--object-fit: contain;
|
|
74
|
+
--image--rounded--outer--border-radius: 0.25em;
|
|
75
|
+
--image--rounded--inner--border-color: transparent;
|
|
76
|
+
--image--rounded--outer--border-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
.short-video-product-viewer__image {
|
|
79
|
+
flex: 1;
|
|
80
|
+
min-height: 0;
|
|
81
|
+
}
|
|
82
|
+
.short-video-product-viewer__name {
|
|
83
|
+
width: 100%;
|
|
84
|
+
font-weight: 500;
|
|
85
|
+
font-size: 0.9375rem;
|
|
86
|
+
color: #ffffff;
|
|
87
|
+
margin-top: 0.5rem;
|
|
88
|
+
padding: 0 0.3125rem;
|
|
89
|
+
text-align: center;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
width: 100%;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
95
|
+
}
|
|
96
|
+
@container (width < 300px) {
|
|
97
|
+
.short-video-product-viewer__name {
|
|
98
|
+
font-size: 0.75rem;
|
|
99
|
+
margin-top: 0.3125rem;
|
|
100
|
+
padding: 0 0.25rem;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
.short-video-product-viewer__price {
|
|
104
|
+
padding-top: 0.3125rem;
|
|
105
|
+
margin-top: auto;
|
|
106
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
107
|
+
}
|
|
108
|
+
@container (width < 300px) {
|
|
109
|
+
.short-video-product-viewer__price {
|
|
110
|
+
padding-top: 0.25rem;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.short-video-product-viewer__link {
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 0;
|
|
116
|
+
left: 0;
|
|
117
|
+
width: 100%;
|
|
118
|
+
height: 100%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.product-price {
|
|
122
|
+
width: 100%;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
gap: 0.4375rem;
|
|
126
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
127
|
+
}
|
|
128
|
+
@container (width < 300px) {
|
|
129
|
+
.product-price {
|
|
130
|
+
gap: 0.3125rem;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
.product-price__before-price {
|
|
134
|
+
width: 100%;
|
|
135
|
+
color: #e5e7eb;
|
|
136
|
+
text-decoration: line-through;
|
|
137
|
+
font-size: 0.75rem;
|
|
138
|
+
font-weight: 500;
|
|
139
|
+
text-align: center;
|
|
140
|
+
text-overflow: ellipsis;
|
|
141
|
+
width: 100%;
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
145
|
+
}
|
|
146
|
+
@container (width < 300px) {
|
|
147
|
+
.product-price__before-price {
|
|
148
|
+
font-size: 0.625em;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
.product-price__price {
|
|
152
|
+
width: 100%;
|
|
153
|
+
font-size: 1.0625em;
|
|
154
|
+
color: #ffffff;
|
|
155
|
+
font-weight: 800;
|
|
156
|
+
margin-top: auto;
|
|
157
|
+
text-align: center;
|
|
158
|
+
text-overflow: ellipsis;
|
|
159
|
+
width: 100%;
|
|
160
|
+
white-space: nowrap;
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
163
|
+
}
|
|
164
|
+
@container (width < 300px) {
|
|
165
|
+
.product-price__price {
|
|
166
|
+
font-size: 0.9375em;
|
|
167
|
+
}
|
|
168
|
+
}</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
2
|
+
import type { ShortVideoViewerProductModel } from './types';
|
|
3
|
+
type Props = {
|
|
4
|
+
product: ShortVideoViewerProductModel;
|
|
5
|
+
fitToContainer?: boolean;
|
|
6
|
+
localization?: IShortVideoProductLocalization;
|
|
7
|
+
on?: {
|
|
8
|
+
productClick?: (productId: string) => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
13
|
+
export default Cmp;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script lang="ts">import { slideHorizontally } from '../../core/transitions';
|
|
2
|
+
import { default as ShortVideoAttachments } from './cmp.attachments.svelte';
|
|
3
|
+
import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
|
|
4
|
+
import { ShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
5
|
+
import {} from './types';
|
|
6
|
+
let { shortVideo, collapsed, localization: localizationInit, on } = $props();
|
|
7
|
+
const localization = $derived(new ShortVideoDetailsLocalization(localizationInit));
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{#if !collapsed}
|
|
11
|
+
<div class="short-video-details" transition:slideHorizontally|local data-theme="dark">
|
|
12
|
+
<div class="short-video-details__sliding-container">
|
|
13
|
+
<div class="short-video-details__content">
|
|
14
|
+
<div class="short-video-details__heading">
|
|
15
|
+
<ShortVideoHeading
|
|
16
|
+
model={shortVideo.heading}
|
|
17
|
+
localization={{ viewsCount: localization.viewsCount, timeAgoLocalization: localization.timeAgoLocalization }} />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
{#if shortVideo.text}
|
|
21
|
+
<p class="short-video-details__text">
|
|
22
|
+
{shortVideo.text}
|
|
23
|
+
</p>
|
|
24
|
+
{/if}
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="short-video-details__section-splitter"></div>
|
|
28
|
+
|
|
29
|
+
<ShortVideoAttachments shortVideo={shortVideo} localization={localization.attachmentsLocalization} on={on} />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
{/if}
|
|
33
|
+
|
|
34
|
+
<style>@keyframes fadeIn {
|
|
35
|
+
0% {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
50% {
|
|
39
|
+
opacity: 0.4;
|
|
40
|
+
}
|
|
41
|
+
100% {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.short-video-details {
|
|
46
|
+
--_short-video-details--padding-horizontal: 1rem;
|
|
47
|
+
--short-video-attachments--margin-vertical: 1.25rem;
|
|
48
|
+
--short-video-attachments--spacing-horizontal: var(--_short-video-details--padding-horizontal);
|
|
49
|
+
background: #1c1c1c;
|
|
50
|
+
height: 100%;
|
|
51
|
+
min-height: 100%;
|
|
52
|
+
max-height: 100%;
|
|
53
|
+
width: 25rem;
|
|
54
|
+
min-width: 25rem;
|
|
55
|
+
max-width: 25rem;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
min-height: 0;
|
|
59
|
+
padding-bottom: 0.9375rem;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
scrollbar-color: transparent transparent;
|
|
62
|
+
scrollbar-width: thin;
|
|
63
|
+
--custom-scrollbar-color: #999999;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 0;
|
|
66
|
+
right: 0;
|
|
67
|
+
height: 100%;
|
|
68
|
+
z-index: 1;
|
|
69
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
70
|
+
}
|
|
71
|
+
.short-video-details::-webkit-scrollbar {
|
|
72
|
+
width: 3px;
|
|
73
|
+
height: 3px;
|
|
74
|
+
background: var(--custom-scrollbar-background, transparent);
|
|
75
|
+
visibility: hidden;
|
|
76
|
+
}
|
|
77
|
+
.short-video-details::-webkit-scrollbar-thumb {
|
|
78
|
+
background: transparent;
|
|
79
|
+
}
|
|
80
|
+
.short-video-details:hover {
|
|
81
|
+
scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
|
|
82
|
+
scrollbar-width: thin;
|
|
83
|
+
}
|
|
84
|
+
.short-video-details:hover::-webkit-scrollbar {
|
|
85
|
+
width: 3px;
|
|
86
|
+
height: 3px;
|
|
87
|
+
background: var(--custom-scrollbar-background, transparent);
|
|
88
|
+
visibility: hidden;
|
|
89
|
+
}
|
|
90
|
+
.short-video-details:hover::-webkit-scrollbar-thumb {
|
|
91
|
+
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
92
|
+
}
|
|
93
|
+
.short-video-details__sliding-container {
|
|
94
|
+
flex: 1;
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
min-height: 0;
|
|
98
|
+
}
|
|
99
|
+
@container (width < 576px) {
|
|
100
|
+
.short-video-details {
|
|
101
|
+
width: 100%;
|
|
102
|
+
min-width: 100%;
|
|
103
|
+
max-width: 100%;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
.short-video-details__content {
|
|
107
|
+
padding: 1.5rem var(--_short-video-details--padding-horizontal) 0.875rem;
|
|
108
|
+
margin-bottom: 0.875rem;
|
|
109
|
+
}
|
|
110
|
+
.short-video-details__heading {
|
|
111
|
+
--short-video-heading--padding: 0 1.875rem 1.25rem 0;
|
|
112
|
+
}
|
|
113
|
+
.short-video-details__text {
|
|
114
|
+
color: #d1d5db;
|
|
115
|
+
font-size: 0.9375rem;
|
|
116
|
+
line-height: 1.125rem;
|
|
117
|
+
font-weight: 400;
|
|
118
|
+
white-space: pre-line;
|
|
119
|
+
word-break: break-word;
|
|
120
|
+
margin-bottom: 0.4375rem;
|
|
121
|
+
}
|
|
122
|
+
.short-video-details__section-splitter {
|
|
123
|
+
border-bottom: 1px solid #4b5563;
|
|
124
|
+
}</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
2
|
+
import { type ShortVideoViewerModel } from './types';
|
|
3
|
+
type Props = {
|
|
4
|
+
shortVideo: ShortVideoViewerModel;
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
localization?: IShortVideoDetailsLocalization;
|
|
7
|
+
on?: {
|
|
8
|
+
productClick?: (productId: string) => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
13
|
+
export default Cmp;
|