@streamscloud/embeddable 2.0.4 → 2.1.1
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/package.json +1 -1
- package/dist/core/continuation-token.d.ts +0 -10
- package/dist/core/continuation-token.js +0 -32
- package/dist/core/cursor-result.d.ts +0 -9
- package/dist/core/cursor-result.js +0 -1
- package/dist/core/data-loaders/cursor-data-loader.svelte.d.ts +0 -14
- package/dist/core/data-loaders/cursor-data-loader.svelte.js +0 -35
- package/dist/core/data-loaders/data-loader.d.ts +0 -4
- package/dist/core/data-loaders/data-loader.js +0 -1
- package/dist/core/data-loaders/index.d.ts +0 -2
- package/dist/core/data-loaders/index.js +0 -1
- package/dist/core/deferred.d.ts +0 -6
- package/dist/core/deferred.js +0 -13
- package/dist/core/enums.d.ts +0 -33
- package/dist/core/enums.js +0 -39
- package/dist/core/graphql.d.ts +0 -1
- package/dist/core/graphql.js +0 -10
- package/dist/core/media/image-helper.d.ts +0 -10
- package/dist/core/media/image-helper.js +0 -30
- package/dist/core/media/images-size-detector.service.d.ts +0 -6
- package/dist/core/media/images-size-detector.service.js +0 -15
- package/dist/core/media/index.d.ts +0 -4
- package/dist/core/media/index.js +0 -4
- package/dist/core/media/media-item-url.service.d.ts +0 -2
- package/dist/core/media/media-item-url.service.js +0 -3
- package/dist/core/media/types.d.ts +0 -13
- package/dist/core/media/types.js +0 -1
- package/dist/core/toastr.d.ts +0 -1
- package/dist/core/toastr.js +0 -26
- package/dist/core/transitions/index.d.ts +0 -1
- package/dist/core/transitions/index.js +0 -1
- package/dist/core/transitions/slide-horizontally.d.ts +0 -7
- package/dist/core/transitions/slide-horizontally.js +0 -55
- package/dist/core/utils/array-helper.d.ts +0 -23
- package/dist/core/utils/array-helper.js +0 -148
- package/dist/core/utils/date-helper.d.ts +0 -29
- package/dist/core/utils/date-helper.js +0 -146
- package/dist/core/utils/dom-helper.d.ts +0 -12
- package/dist/core/utils/dom-helper.js +0 -76
- package/dist/core/utils/html-helper.d.ts +0 -40
- package/dist/core/utils/html-helper.js +0 -97
- package/dist/core/utils/index.d.ts +0 -3
- package/dist/core/utils/index.js +0 -3
- package/dist/core/utils/number-helper.d.ts +0 -6
- package/dist/core/utils/number-helper.js +0 -28
- package/dist/core/utils/string-generator.d.ts +0 -2
- package/dist/core/utils/string-generator.js +0 -15
- package/dist/core/utils/string-helper.d.ts +0 -10
- package/dist/core/utils/string-helper.js +0 -53
- package/dist/core/utils/url-helper.d.ts +0 -3
- package/dist/core/utils/url-helper.js +0 -13
- package/dist/core/utils/utils.d.ts +0 -28
- package/dist/core/utils/utils.js +0 -100
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/products/price-helper.d.ts +0 -4
- package/dist/products/price-helper.js +0 -47
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte +0 -74
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte.d.ts +0 -7
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +0 -70
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte.d.ts +0 -7
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +0 -68
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +0 -156
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +0 -10
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +0 -124
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +0 -10
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +0 -86
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +0 -133
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +0 -12
- package/dist/short-videos/short-video-viewer/description.svelte +0 -46
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/index.js +0 -6
- package/dist/short-videos/short-video-viewer/mapper.d.ts +0 -3
- package/dist/short-videos/short-video-viewer/mapper.js +0 -56
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +0 -56
- package/dist/short-videos/short-video-viewer/operations.generated.js +0 -151
- package/dist/short-videos/short-video-viewer/operations.graphql +0 -53
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.d.ts +0 -12
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.d.ts +0 -13
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.d.ts +0 -7
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +0 -11
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +0 -13
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/types.d.ts +0 -40
- package/dist/short-videos/short-video-viewer/types.js +0 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +0 -12
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +0 -26
- package/dist/short-videos/short-videos-player/action-button.svelte +0 -38
- package/dist/short-videos/short-videos-player/action-button.svelte.d.ts +0 -10
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +0 -91
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +0 -13
- package/dist/short-videos/short-videos-player/controls.svelte +0 -222
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +0 -15
- package/dist/short-videos/short-videos-player/index.d.ts +0 -28
- package/dist/short-videos/short-videos-player/index.js +0 -40
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +0 -8
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +0 -6
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +0 -16
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +0 -25
- package/dist/streams/layout/cmp.layout.svelte +0 -34
- package/dist/streams/layout/cmp.layout.svelte.d.ts +0 -9
- package/dist/streams/layout/cmp.slot-content.svelte +0 -32
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +0 -9
- package/dist/streams/layout/cmp.slot.svelte +0 -26
- package/dist/streams/layout/cmp.slot.svelte.d.ts +0 -9
- package/dist/streams/layout/component.d.ts +0 -6
- package/dist/streams/layout/component.js +0 -1
- package/dist/streams/layout/css-values.d.ts +0 -10
- package/dist/streams/layout/css-values.js +0 -1
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +0 -16
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +0 -11
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +0 -38
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +0 -30
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +0 -97
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +0 -11
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +0 -6
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte +0 -45
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +0 -60
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +0 -13
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte +0 -23
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +0 -8
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +0 -3
- package/dist/streams/layout/element-views/data-by-key-accessor.js +0 -55
- package/dist/streams/layout/element-views/index.d.ts +0 -11
- package/dist/streams/layout/element-views/index.js +0 -9
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +0 -8
- package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +0 -8
- package/dist/streams/layout/element-views/stream-element-localization.svelte.js +0 -6
- package/dist/streams/layout/elements.d.ts +0 -51
- package/dist/streams/layout/elements.js +0 -1
- package/dist/streams/layout/enums.d.ts +0 -45
- package/dist/streams/layout/enums.js +0 -54
- package/dist/streams/layout/index.d.ts +0 -19
- package/dist/streams/layout/index.js +0 -15
- package/dist/streams/layout/layout.d.ts +0 -13
- package/dist/streams/layout/layout.js +0 -1
- package/dist/streams/layout/models/index.d.ts +0 -6
- package/dist/streams/layout/models/index.js +0 -1
- package/dist/streams/layout/models/mapper.d.ts +0 -3
- package/dist/streams/layout/models/mapper.js +0 -62
- package/dist/streams/layout/models/stream-layout-blob-model.d.ts +0 -4
- package/dist/streams/layout/models/stream-layout-blob-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +0 -6
- package/dist/streams/layout/models/stream-layout-media-item-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-post-header-model.d.ts +0 -11
- package/dist/streams/layout/models/stream-layout-post-header-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-product-model.d.ts +0 -19
- package/dist/streams/layout/models/stream-layout-product-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +0 -31
- package/dist/streams/layout/models/stream-layout-short-video-model.js +0 -1
- package/dist/streams/layout/serializer.d.ts +0 -3
- package/dist/streams/layout/serializer.js +0 -6
- package/dist/streams/layout/slot-data-input.d.ts +0 -14
- package/dist/streams/layout/slot-data-input.js +0 -1
- package/dist/streams/layout/slot-data.d.ts +0 -18
- package/dist/streams/layout/slot-data.js +0 -1
- package/dist/streams/layout/slot.d.ts +0 -16
- package/dist/streams/layout/slot.js +0 -1
- package/dist/streams/layout/styles-transformer.d.ts +0 -13
- package/dist/streams/layout/styles-transformer.js +0 -140
- package/dist/streams/layout/styles.d.ts +0 -43
- package/dist/streams/layout/styles.js +0 -1
- package/dist/streams/layout/type-guards.d.ts +0 -8
- package/dist/streams/layout/type-guards.js +0 -21
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +0 -13
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -7
- package/dist/streams/stream-page-viewer/index.d.ts +0 -2
- package/dist/streams/stream-page-viewer/index.js +0 -1
- package/dist/streams/stream-page-viewer/mapper.d.ts +0 -3
- package/dist/streams/stream-page-viewer/mapper.js +0 -22
- package/dist/streams/stream-page-viewer/operations.generated.d.ts +0 -10
- package/dist/streams/stream-page-viewer/operations.generated.js +0 -27
- package/dist/streams/stream-page-viewer/operations.graphql +0 -8
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +0 -13
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +0 -10
- package/dist/streams/stream-page-viewer/types.d.ts +0 -18
- package/dist/streams/stream-page-viewer/types.js +0 -1
- package/dist/streams/stream-player/action-button.svelte +0 -38
- package/dist/streams/stream-player/action-button.svelte.d.ts +0 -10
- package/dist/streams/stream-player/cmp.stream-player.svelte +0 -149
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +0 -17
- package/dist/streams/stream-player/controls.svelte +0 -230
- package/dist/streams/stream-player/controls.svelte.d.ts +0 -14
- package/dist/streams/stream-player/index.d.ts +0 -36
- package/dist/streams/stream-player/index.js +0 -50
- package/dist/streams/stream-player/mapper.d.ts +0 -3
- package/dist/streams/stream-player/mapper.js +0 -15
- package/dist/streams/stream-player/operations.generated.d.ts +0 -65
- package/dist/streams/stream-player/operations.generated.js +0 -196
- package/dist/streams/stream-player/operations.graphql +0 -35
- package/dist/streams/stream-player/stream-overview.svelte +0 -239
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +0 -17
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +0 -25
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +0 -84
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +0 -12
- package/dist/streams/stream-player/stream-player-localization.svelte.js +0 -10
- package/dist/streams/stream-player/types.d.ts +0 -12
- package/dist/streams/stream-player/types.js +0 -1
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +0 -17
- package/dist/streams/stream-player/ui-manager.svelte.js +0 -26
- package/dist/ui/button/cmp.button.svelte +0 -10
- package/dist/ui/button/cmp.button.svelte.d.ts +0 -16
- package/dist/ui/button/index.d.ts +0 -2
- package/dist/ui/button/index.js +0 -2
- package/dist/ui/button/resources/button-base.svelte +0 -84
- package/dist/ui/button/resources/button-base.svelte.d.ts +0 -13
- package/dist/ui/button/resources/button-theme.svelte +0 -204
- package/dist/ui/button/resources/button-theme.svelte.d.ts +0 -10
- package/dist/ui/button/resources/button-types.d.ts +0 -21
- package/dist/ui/button/resources/button-types.js +0 -23
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte +0 -5
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte.d.ts +0 -7
- package/dist/ui/dynamic-component/index.d.ts +0 -2
- package/dist/ui/dynamic-component/index.js +0 -2
- package/dist/ui/dynamic-component/types.svelte.d.ts +0 -11
- package/dist/ui/dynamic-component/types.svelte.js +0 -13
- package/dist/ui/icon/cmp.icon.svelte +0 -113
- package/dist/ui/icon/cmp.icon.svelte.d.ts +0 -8
- package/dist/ui/icon/index.d.ts +0 -2
- package/dist/ui/icon/index.js +0 -2
- package/dist/ui/icon/types.d.ts +0 -9
- package/dist/ui/icon/types.js +0 -10
- package/dist/ui/image/cmp.image-round.svelte +0 -41
- package/dist/ui/image/cmp.image-round.svelte.d.ts +0 -11
- package/dist/ui/image/cmp.image-rounded.svelte +0 -71
- package/dist/ui/image/cmp.image-rounded.svelte.d.ts +0 -11
- package/dist/ui/image/cmp.image-stub.svelte +0 -34
- package/dist/ui/image/cmp.image-stub.svelte.d.ts +0 -18
- package/dist/ui/image/cmp.image.svelte +0 -82
- package/dist/ui/image/cmp.image.svelte.d.ts +0 -13
- package/dist/ui/image/image-state.d.ts +0 -6
- package/dist/ui/image/image-state.js +0 -17
- package/dist/ui/image/index.d.ts +0 -4
- package/dist/ui/image/index.js +0 -4
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte +0 -84
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte.d.ts +0 -11
- package/dist/ui/infinite-scrolling/index.d.ts +0 -1
- package/dist/ui/infinite-scrolling/index.js +0 -1
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +0 -89
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +0 -12
- package/dist/ui/line-clamp/index.d.ts +0 -2
- package/dist/ui/line-clamp/index.js +0 -2
- package/dist/ui/line-clamp/line-clamp-localization.svelte.d.ts +0 -9
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +0 -15
- package/dist/ui/line-clamp/line-clamp-types.d.ts +0 -3
- package/dist/ui/line-clamp/line-clamp-types.js +0 -1
- package/dist/ui/line-clamp/line-clamp-utils.d.ts +0 -8
- package/dist/ui/line-clamp/line-clamp-utils.js +0 -33
- package/dist/ui/loading/cmp.loading.svelte +0 -97
- package/dist/ui/loading/cmp.loading.svelte.d.ts +0 -9
- package/dist/ui/loading/index.d.ts +0 -1
- package/dist/ui/loading/index.js +0 -1
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +0 -91
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +0 -13
- package/dist/ui/media-item-view/index.d.ts +0 -1
- package/dist/ui/media-item-view/index.js +0 -1
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +0 -278
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +0 -13
- package/dist/ui/media-items-gallery/index.d.ts +0 -1
- package/dist/ui/media-items-gallery/index.js +0 -1
- package/dist/ui/media-items-gallery/types.d.ts +0 -12
- package/dist/ui/media-items-gallery/types.js +0 -35
- package/dist/ui/media-playback/index.d.ts +0 -2
- package/dist/ui/media-playback/index.js +0 -2
- package/dist/ui/media-playback/playback-manager.svelte.d.ts +0 -25
- package/dist/ui/media-playback/playback-manager.svelte.js +0 -62
- package/dist/ui/media-playback/volume-manager.svelte.d.ts +0 -10
- package/dist/ui/media-playback/volume-manager.svelte.js +0 -27
- package/dist/ui/player/cmp.player-slider.svelte +0 -161
- package/dist/ui/player/cmp.player-slider.svelte.d.ts +0 -33
- package/dist/ui/player/index.d.ts +0 -4
- package/dist/ui/player/index.js +0 -3
- package/dist/ui/player/player-buffer.svelte.d.ts +0 -28
- package/dist/ui/player/player-buffer.svelte.js +0 -64
- package/dist/ui/player/prevent-slider-scroll.d.ts +0 -5
- package/dist/ui/player/prevent-slider-scroll.js +0 -11
- package/dist/ui/player/types.d.ts +0 -14
- package/dist/ui/player/types.js +0 -1
- package/dist/ui/progress/cmp.progress.svelte +0 -37
- package/dist/ui/progress/cmp.progress.svelte.d.ts +0 -6
- package/dist/ui/progress/index.d.ts +0 -1
- package/dist/ui/progress/index.js +0 -1
- package/dist/ui/proportional-container/cmp.proportional-container.svelte +0 -39
- package/dist/ui/proportional-container/cmp.proportional-container.svelte.d.ts +0 -8
- package/dist/ui/proportional-container/index.d.ts +0 -1
- package/dist/ui/proportional-container/index.js +0 -1
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +0 -63
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +0 -12
- package/dist/ui/seek-bar/index.d.ts +0 -1
- package/dist/ui/seek-bar/index.js +0 -1
- package/dist/ui/shadow-dom/_normalize.scss +0 -350
- package/dist/ui/shadow-dom/_reset.scss +0 -189
- package/dist/ui/shadow-dom/index.d.ts +0 -1
- package/dist/ui/shadow-dom/index.js +0 -1
- package/dist/ui/shadow-dom/shadow-host.d.ts +0 -8
- package/dist/ui/shadow-dom/shadow-host.js +0 -40
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte +0 -120
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte.d.ts +0 -18
- package/dist/ui/spotlight-layout/index.d.ts +0 -1
- package/dist/ui/spotlight-layout/index.js +0 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte +0 -69
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +0 -9
- package/dist/ui/time-ago/index.d.ts +0 -2
- package/dist/ui/time-ago/index.js +0 -1
- package/dist/ui/time-ago/time-ago-localization.svelte.d.ts +0 -21
- package/dist/ui/time-ago/time-ago-localization.svelte.js +0 -39
- package/dist/ui/video/cmp.video.svelte +0 -377
- package/dist/ui/video/cmp.video.svelte.d.ts +0 -24
- package/dist/ui/video/index.d.ts +0 -1
- package/dist/ui/video/index.js +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
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>
|
|
@@ -1,70 +0,0 @@
|
|
|
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>
|
|
@@ -1,68 +0,0 @@
|
|
|
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 } = $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} />
|
|
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>
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
};
|
|
7
|
-
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type Cmp = ReturnType<typeof Cmp>;
|
|
9
|
-
export default Cmp;
|
|
@@ -1,156 +0,0 @@
|
|
|
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 } = $props();
|
|
6
|
-
const localization = $derived(new ShortVideoProductLocalization(localizationInit));
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<div class="short-video-product-viewer">
|
|
10
|
-
{#if fitToContainer}
|
|
11
|
-
<div class="short-video-product-viewer__image">
|
|
12
|
-
<ImageRounded src={product.image} noBorders={true} />
|
|
13
|
-
</div>
|
|
14
|
-
{:else}
|
|
15
|
-
<ProportionalContainer ratio={4 / 5}>
|
|
16
|
-
<ImageRounded src={product.image} noBorders={true} />
|
|
17
|
-
</ProportionalContainer>
|
|
18
|
-
{/if}
|
|
19
|
-
<div class="short-video-product-viewer__name">{product.title}</div>
|
|
20
|
-
<div class="short-video-product-viewer__price">
|
|
21
|
-
<div class="product-price">
|
|
22
|
-
{#if !product.salePrice}
|
|
23
|
-
<div class="product-price__price">{toPriceRepresentation(product.price, product.currency)}</div>
|
|
24
|
-
{:else}
|
|
25
|
-
<div class="product-price__before-price">
|
|
26
|
-
{#if localization.beforeNowPrefix}
|
|
27
|
-
{localization.beforeNowPrefix}
|
|
28
|
-
{/if}
|
|
29
|
-
{toPriceRepresentation(product.price, product.currency)}
|
|
30
|
-
</div>
|
|
31
|
-
<div class="product-price__price product-price__price--sale">
|
|
32
|
-
{toPriceRepresentation(product.salePrice, product.currency)}
|
|
33
|
-
</div>
|
|
34
|
-
{/if}
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
{#if product.link}
|
|
39
|
-
<a href={product.link} target="_blank" rel="noopener noreferrer" class="short-video-product-viewer__link" aria-label="none"> </a>
|
|
40
|
-
{/if}
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<style>@keyframes fadeIn {
|
|
44
|
-
0% {
|
|
45
|
-
opacity: 1;
|
|
46
|
-
}
|
|
47
|
-
50% {
|
|
48
|
-
opacity: 0.4;
|
|
49
|
-
}
|
|
50
|
-
100% {
|
|
51
|
-
opacity: 1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
.short-video-product-viewer {
|
|
55
|
-
width: 100%;
|
|
56
|
-
height: auto;
|
|
57
|
-
position: relative;
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
container-type: inline-size;
|
|
61
|
-
--image--object-fit: contain;
|
|
62
|
-
--image--rounded--outer--border-radius: 0.25em;
|
|
63
|
-
--image--rounded--inner--border-color: transparent;
|
|
64
|
-
--image--rounded--outer--border-color: transparent;
|
|
65
|
-
}
|
|
66
|
-
.short-video-product-viewer__image {
|
|
67
|
-
flex: 1;
|
|
68
|
-
min-height: 0;
|
|
69
|
-
}
|
|
70
|
-
.short-video-product-viewer__name {
|
|
71
|
-
width: 100%;
|
|
72
|
-
font-weight: 500;
|
|
73
|
-
font-size: 0.9375rem;
|
|
74
|
-
color: #ffffff;
|
|
75
|
-
margin-top: 0.5rem;
|
|
76
|
-
padding: 0 0.3125rem;
|
|
77
|
-
text-align: center;
|
|
78
|
-
text-overflow: ellipsis;
|
|
79
|
-
width: 100%;
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
overflow: hidden;
|
|
82
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
83
|
-
}
|
|
84
|
-
@container (width < 300px) {
|
|
85
|
-
.short-video-product-viewer__name {
|
|
86
|
-
font-size: 0.75rem;
|
|
87
|
-
margin-top: 0.3125rem;
|
|
88
|
-
padding: 0 0.25rem;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
.short-video-product-viewer__price {
|
|
92
|
-
padding-top: 0.3125rem;
|
|
93
|
-
margin-top: auto;
|
|
94
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
95
|
-
}
|
|
96
|
-
@container (width < 300px) {
|
|
97
|
-
.short-video-product-viewer__price {
|
|
98
|
-
padding-top: 0.25rem;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
.short-video-product-viewer__link {
|
|
102
|
-
position: absolute;
|
|
103
|
-
top: 0;
|
|
104
|
-
left: 0;
|
|
105
|
-
width: 100%;
|
|
106
|
-
height: 100%;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.product-price {
|
|
110
|
-
width: 100%;
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
gap: 0.4375rem;
|
|
114
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
115
|
-
}
|
|
116
|
-
@container (width < 300px) {
|
|
117
|
-
.product-price {
|
|
118
|
-
gap: 0.3125rem;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
.product-price__before-price {
|
|
122
|
-
width: 100%;
|
|
123
|
-
color: #e5e7eb;
|
|
124
|
-
text-decoration: line-through;
|
|
125
|
-
font-size: 0.75rem;
|
|
126
|
-
font-weight: 500;
|
|
127
|
-
text-align: center;
|
|
128
|
-
text-overflow: ellipsis;
|
|
129
|
-
width: 100%;
|
|
130
|
-
white-space: nowrap;
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
133
|
-
}
|
|
134
|
-
@container (width < 300px) {
|
|
135
|
-
.product-price__before-price {
|
|
136
|
-
font-size: 0.625em;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
.product-price__price {
|
|
140
|
-
width: 100%;
|
|
141
|
-
font-size: 1.0625em;
|
|
142
|
-
color: #ffffff;
|
|
143
|
-
font-weight: 800;
|
|
144
|
-
margin-top: auto;
|
|
145
|
-
text-align: center;
|
|
146
|
-
text-overflow: ellipsis;
|
|
147
|
-
width: 100%;
|
|
148
|
-
white-space: nowrap;
|
|
149
|
-
overflow: hidden;
|
|
150
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
151
|
-
}
|
|
152
|
-
@container (width < 300px) {
|
|
153
|
-
.product-price__price {
|
|
154
|
-
font-size: 0.9375em;
|
|
155
|
-
}
|
|
156
|
-
}</style>
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
};
|
|
8
|
-
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
9
|
-
type Cmp = ReturnType<typeof Cmp>;
|
|
10
|
-
export default Cmp;
|
|
@@ -1,124 +0,0 @@
|
|
|
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 } = $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} />
|
|
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>
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
};
|
|
8
|
-
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
9
|
-
type Cmp = ReturnType<typeof Cmp>;
|
|
10
|
-
export default Cmp;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { ImageRound } from '../../ui/image';
|
|
2
|
-
import { TimeAgo } from '../../ui/time-ago';
|
|
3
|
-
import { ShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
4
|
-
let { model, localization: localizationInit } = $props();
|
|
5
|
-
const localization = $derived(new ShortVideoViewerLocalization(localizationInit));
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<div class="short-video-heading">
|
|
9
|
-
<div class="short-video-heading__source-image">
|
|
10
|
-
<ImageRound src={model.image} alt={`${model.name} profilbilde`} noBorders={true} />
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<div class="short-video-heading__info">
|
|
14
|
-
<div class="short-video-heading__source-name">{model.name}</div>
|
|
15
|
-
<p class="short-video-heading__metadata">
|
|
16
|
-
<TimeAgo date={model.displayDate} localization={localization.timeAgoLocalization} />
|
|
17
|
-
{#if Number.isInteger(model.viewsCount)}
|
|
18
|
-
<span>·</span>
|
|
19
|
-
{localization.viewsCount(model.viewsCount)}
|
|
20
|
-
{/if}
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<style>@keyframes fadeIn {
|
|
26
|
-
0% {
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
50% {
|
|
30
|
-
opacity: 0.4;
|
|
31
|
-
}
|
|
32
|
-
100% {
|
|
33
|
-
opacity: 1;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
.short-video-heading {
|
|
37
|
-
--_short-video-heading--container--font-size: var(--short-video-heading--container--font-size, 1em);
|
|
38
|
-
--_short-video-heading--text--color: var(--short-video-heading--text--color, #374151);
|
|
39
|
-
--_short-video-heading--meta--color: var(--short-video-heading--meta--color, #6b7280);
|
|
40
|
-
--_short-video-heading--padding: var(--short-video-heading--padding, 0);
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
padding: var(--_short-video-heading--padding);
|
|
44
|
-
min-width: 0;
|
|
45
|
-
font-size: var(--_short-video-heading--container--font-size);
|
|
46
|
-
}
|
|
47
|
-
.short-video-heading__source-image {
|
|
48
|
-
width: 2em;
|
|
49
|
-
min-width: 2em;
|
|
50
|
-
max-width: 2em;
|
|
51
|
-
height: 2em;
|
|
52
|
-
min-height: 2em;
|
|
53
|
-
max-height: 2em;
|
|
54
|
-
margin-right: 0.625em;
|
|
55
|
-
--image--rounded--outer--border-radius: 0.5em;
|
|
56
|
-
--image--rounded--inner--border-width: 0;
|
|
57
|
-
--rounded-img-background: none;
|
|
58
|
-
}
|
|
59
|
-
.short-video-heading__info {
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
min-width: 0;
|
|
63
|
-
}
|
|
64
|
-
.short-video-heading__source-name {
|
|
65
|
-
font-size: 0.75em;
|
|
66
|
-
line-height: 1.25em;
|
|
67
|
-
font-weight: 500;
|
|
68
|
-
color: var(--_short-video-heading--text--color);
|
|
69
|
-
text-overflow: ellipsis;
|
|
70
|
-
width: 100%;
|
|
71
|
-
white-space: nowrap;
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
}
|
|
74
|
-
:global([data-theme="dark"]) .short-video-heading__source-name {
|
|
75
|
-
--_short-video-heading--text--color: var(--short-video-heading--text--color, #ffffff);
|
|
76
|
-
}
|
|
77
|
-
.short-video-heading__metadata {
|
|
78
|
-
margin: 0;
|
|
79
|
-
font-size: 0.625em;
|
|
80
|
-
line-height: 1.2em;
|
|
81
|
-
font-weight: 400;
|
|
82
|
-
color: var(--_short-video-heading--meta--color);
|
|
83
|
-
}
|
|
84
|
-
:global([data-theme="dark"]) .short-video-heading__metadata {
|
|
85
|
-
--_short-video-heading--meta--color: var(--short-video-heading--meta--color, #d1d5db);
|
|
86
|
-
}</style>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type IShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
2
|
-
import type { ShortVideoViewerHeadingModel } from './types';
|
|
3
|
-
type Props = {
|
|
4
|
-
model: ShortVideoViewerHeadingModel;
|
|
5
|
-
localization: IShortVideoViewerLocalization;
|
|
6
|
-
};
|
|
7
|
-
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type Cmp = ReturnType<typeof Cmp>;
|
|
9
|
-
export default Cmp;
|