@streamscloud/embeddable 1.1.11 → 2.0.0
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/enums.d.ts +33 -0
- package/dist/core/enums.js +39 -0
- package/dist/core/graphql.d.ts +1 -1
- package/dist/core/graphql.js +2 -2
- package/dist/core/media/images-size-detector.service.d.ts +1 -1
- package/dist/core/media/images-size-detector.service.js +1 -1
- package/dist/core/media/index.d.ts +1 -1
- package/dist/core/media/index.js +1 -1
- package/dist/core/media/media-item-url.service.js +2 -1
- package/dist/core/media/types.d.ts +1 -16
- package/dist/core/media/types.js +1 -19
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -3
- package/dist/products/price-helper.d.ts +2 -2
- package/dist/products/price-helper.js +20 -9
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte +74 -0
- package/dist/{advertising/ad-view/cmp.ad-view.svelte.d.ts → short-videos/short-video-viewer/cmp.ad.svelte.d.ts} +2 -3
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +70 -0
- package/dist/{streams/components/images/cmp.images-component.svelte.d.ts → short-videos/short-video-viewer/cmp.attachments-inline.svelte.d.ts} +2 -2
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +45 -48
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +4 -2
- package/dist/{streams/components/product/cmp.product-component.svelte → short-videos/short-video-viewer/cmp.product.svelte} +34 -26
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +10 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +31 -52
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +6 -6
- package/dist/short-videos/short-video-viewer/index.d.ts +6 -3
- package/dist/short-videos/short-video-viewer/index.js +4 -2
- package/dist/short-videos/short-video-viewer/mapper.js +35 -7
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/operations.generated.js +67 -103
- package/dist/short-videos/short-video-viewer/operations.graphql +29 -2
- 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 +3 -4
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +4 -15
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.d.ts +7 -0
- package/dist/{products/product-card/product-card-localization.svelte.js → short-videos/short-video-viewer/short-video-product-localization.svelte.js} +1 -1
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +3 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +4 -7
- package/dist/short-videos/short-video-viewer/types.d.ts +29 -6
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +4 -4
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +2 -2
- package/dist/short-videos/short-videos-player/controls.svelte +42 -35
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +1 -1
- package/dist/short-videos/short-videos-player/index.d.ts +28 -2
- package/dist/short-videos/short-videos-player/index.js +40 -1
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +3 -9
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +2 -17
- package/dist/streams/layout/cmp.layout.svelte +34 -0
- package/dist/streams/{slots/cmp.stream-component-slot.svelte.d.ts → layout/cmp.layout.svelte.d.ts} +2 -2
- package/dist/streams/layout/cmp.slot-content.svelte +32 -0
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +9 -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/{components/product/cmp.product-component.svelte.d.ts → layout/element-views/cmp.short-video-stream-element.svelte.d.ts} +2 -3
- 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 +60 -0
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +13 -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/{ui/shadow-dom/cmp.shadow-dom.svelte.d.ts → streams/layout/element-views/cmp.text-stream-element.svelte.d.ts} +2 -2
- 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/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-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 +8 -42
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -2
- package/dist/streams/stream-page-viewer/mapper.d.ts +1 -1
- package/dist/streams/stream-page-viewer/mapper.js +7 -8
- package/dist/streams/stream-page-viewer/operations.generated.d.ts +1 -104
- package/dist/streams/stream-page-viewer/operations.generated.js +2 -375
- package/dist/streams/stream-page-viewer/operations.graphql +1 -6
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +3 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +4 -7
- package/dist/streams/stream-page-viewer/types.d.ts +5 -5
- package/dist/streams/stream-player/cmp.stream-player.svelte +7 -3
- package/dist/streams/stream-player/controls.svelte +43 -35
- package/dist/streams/stream-player/index.d.ts +29 -2
- package/dist/streams/stream-player/index.js +44 -1
- package/dist/streams/stream-player/operations.generated.d.ts +1 -103
- package/dist/streams/stream-player/operations.generated.js +2 -375
- package/dist/streams/stream-player/stream-overview.svelte +2 -2
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +1 -1
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +1 -1
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +3 -9
- package/dist/streams/stream-player/stream-player-localization.svelte.js +4 -23
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +2 -1
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +2 -1
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +2 -1
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +2 -1
- 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 -1
- package/dist/ui/shadow-dom/index.js +1 -1
- package/dist/ui/shadow-dom/shadow-host.svelte.d.ts +8 -0
- package/dist/ui/shadow-dom/shadow-host.svelte.js +39 -0
- package/dist/ui/video/cmp.video.svelte +1 -1
- package/package.json +68 -26
- package/dist/advertising/ad-view/cmp.ad-view.svelte +0 -82
- package/dist/advertising/ad-view/index.d.ts +0 -2
- package/dist/advertising/ad-view/index.js +0 -1
- package/dist/advertising/ad-view/mapper.d.ts +0 -3
- package/dist/advertising/ad-view/mapper.js +0 -16
- package/dist/advertising/ad-view/operations.generated.d.ts +0 -17
- package/dist/advertising/ad-view/operations.generated.js +0 -46
- package/dist/advertising/ad-view/operations.graphql +0 -14
- package/dist/advertising/ad-view/types.d.ts +0 -10
- package/dist/advertising/index.d.ts +0 -1
- package/dist/advertising/index.js +0 -1
- package/dist/advertising/types.d.ts +0 -5
- package/dist/advertising/types.js +0 -6
- package/dist/products/index.d.ts +0 -1
- package/dist/products/index.js +0 -1
- package/dist/products/product-card/cmp.product-card.svelte +0 -121
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +0 -10
- package/dist/products/product-card/index.d.ts +0 -3
- package/dist/products/product-card/index.js +0 -3
- package/dist/products/product-card/mapper.d.ts +0 -3
- package/dist/products/product-card/mapper.js +0 -14
- package/dist/products/product-card/operations.generated.d.ts +0 -22
- package/dist/products/product-card/operations.generated.js +0 -65
- package/dist/products/product-card/operations.graphql +0 -19
- package/dist/products/product-card/product-card-localization.svelte.d.ts +0 -7
- package/dist/products/product-card/types.d.ts +0 -10
- package/dist/products/product-card/types.js +0 -1
- package/dist/products/types.d.ts +0 -5
- package/dist/products/types.js +0 -6
- package/dist/short-videos/short-videos-player-modal/cmp.short-videos-player-modal.svelte +0 -490
- package/dist/short-videos/short-videos-player-modal/cmp.short-videos-player-modal.svelte.d.ts +0 -3
- package/dist/short-videos/short-videos-player-modal/index.d.ts +0 -79
- package/dist/short-videos/short-videos-player-modal/index.js +0 -78
- package/dist/short-videos/short-videos-player-modal/short-videos-player-modal-state.svelte.d.ts +0 -16
- package/dist/short-videos/short-videos-player-modal/short-videos-player-modal-state.svelte.js +0 -13
- package/dist/streams/components/cmp.stream-page-component.svelte +0 -16
- package/dist/streams/components/cmp.stream-page-component.svelte.d.ts +0 -10
- package/dist/streams/components/components.factory.d.ts +0 -22
- package/dist/streams/components/components.factory.js +0 -34
- package/dist/streams/components/images/cmp.images-component.svelte +0 -7
- package/dist/streams/components/images/index.d.ts +0 -2
- package/dist/streams/components/images/index.js +0 -1
- package/dist/streams/components/images/types.d.ts +0 -8
- package/dist/streams/components/images/types.js +0 -5
- package/dist/streams/components/index.d.ts +0 -7
- package/dist/streams/components/index.js +0 -6
- package/dist/streams/components/mapper.d.ts +0 -3
- package/dist/streams/components/mapper.js +0 -43
- package/dist/streams/components/operations.generated.d.ts +0 -178
- package/dist/streams/components/operations.generated.js +0 -653
- package/dist/streams/components/operations.graphql +0 -35
- package/dist/streams/components/product/index.d.ts +0 -3
- package/dist/streams/components/product/index.js +0 -2
- package/dist/streams/components/product/mapper.d.ts +0 -3
- package/dist/streams/components/product/mapper.js +0 -14
- package/dist/streams/components/product/operations.generated.d.ts +0 -22
- package/dist/streams/components/product/operations.generated.js +0 -53
- package/dist/streams/components/product/operations.graphql +0 -19
- package/dist/streams/components/product/types.d.ts +0 -10
- package/dist/streams/components/product/types.js +0 -1
- package/dist/streams/components/short-video/cmp.short-video-component.svelte +0 -9
- package/dist/streams/components/short-video/cmp.short-video-component.svelte.d.ts +0 -10
- package/dist/streams/components/short-video/index.d.ts +0 -3
- package/dist/streams/components/short-video/index.js +0 -2
- package/dist/streams/components/short-video/mapper.d.ts +0 -3
- package/dist/streams/components/short-video/mapper.js +0 -4
- package/dist/streams/components/short-video/operations.generated.d.ts +0 -56
- package/dist/streams/components/short-video/operations.generated.js +0 -193
- package/dist/streams/components/short-video/operations.graphql +0 -3
- package/dist/streams/components/short-video/types.d.ts +0 -2
- package/dist/streams/components/stream-components-localization.svelte.d.ts +0 -10
- package/dist/streams/components/stream-components-localization.svelte.js +0 -13
- package/dist/streams/components/types.d.ts +0 -27
- package/dist/streams/components/types.js +0 -6
- package/dist/streams/slots/cmp.stream-component-slot.svelte +0 -35
- package/dist/streams/slots/index.d.ts +0 -3
- package/dist/streams/slots/index.js +0 -2
- package/dist/streams/slots/mapper.d.ts +0 -3
- package/dist/streams/slots/mapper.js +0 -18
- package/dist/streams/slots/operations.generated.d.ts +0 -17
- package/dist/streams/slots/operations.generated.js +0 -34
- package/dist/streams/slots/operations.graphql +0 -14
- package/dist/streams/slots/styles-transformer.d.ts +0 -6
- package/dist/streams/slots/styles-transformer.js +0 -12
- package/dist/streams/slots/types.d.ts +0 -16
- package/dist/streams/slots/types.js +0 -1
- package/dist/streams/stream-player-modal/cmp.stream-player-modal.svelte +0 -491
- package/dist/streams/stream-player-modal/cmp.stream-player-modal.svelte.d.ts +0 -3
- package/dist/streams/stream-player-modal/index.d.ts +0 -79
- package/dist/streams/stream-player-modal/index.js +0 -78
- package/dist/streams/stream-player-modal/stream-player-modal-state.svelte.d.ts +0 -17
- package/dist/streams/stream-player-modal/stream-player-modal-state.svelte.js +0 -14
- package/dist/ui/shadow-dom/cmp.shadow-dom.svelte +0 -26
- /package/dist/{advertising/ad-view/types.js → streams/layout/layout.js} +0 -0
- /package/dist/streams/{components/short-video/types.js → layout/models/stream-layout-blob-model.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
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,6 +1,5 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import {
|
|
3
|
-
import { ProductCard } from '../../products/product-card';
|
|
1
|
+
<script lang="ts">import { slideHorizontally } from '../../core/transitions';
|
|
2
|
+
import { default as ShortVideoAttachments } from './cmp.attachments.svelte';
|
|
4
3
|
import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
|
|
5
4
|
import { ShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
6
5
|
import {} from './types';
|
|
@@ -27,25 +26,7 @@ const localization = $derived(new ShortVideoDetailsLocalization(localizationInit
|
|
|
27
26
|
|
|
28
27
|
<div class="short-video-details__section-splitter"></div>
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
<div class="short-video-details__attachments">
|
|
32
|
-
{#if shortVideo.products.length}
|
|
33
|
-
<div class="short-video-details__section-header">{localization.productsSection}</div>
|
|
34
|
-
<div class="short-video-details__products">
|
|
35
|
-
{#each shortVideo.products as product (product.id)}
|
|
36
|
-
<ProductCard model={product} />
|
|
37
|
-
{/each}
|
|
38
|
-
</div>
|
|
39
|
-
{/if}
|
|
40
|
-
|
|
41
|
-
{#if shortVideo.ad}
|
|
42
|
-
<div class="short-video-details__section-header">{localization.offersSection}</div>
|
|
43
|
-
<div class="short-video-details__offer">
|
|
44
|
-
<AdView ad={shortVideo.ad} />
|
|
45
|
-
</div>
|
|
46
|
-
{/if}
|
|
47
|
-
</div>
|
|
48
|
-
{/if}
|
|
29
|
+
<ShortVideoAttachments shortVideo={shortVideo} localization={localization.attachmentsLocalization} />
|
|
49
30
|
</div>
|
|
50
31
|
</div>
|
|
51
32
|
{/if}
|
|
@@ -63,6 +44,8 @@ const localization = $derived(new ShortVideoDetailsLocalization(localizationInit
|
|
|
63
44
|
}
|
|
64
45
|
.short-video-details {
|
|
65
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);
|
|
66
49
|
background: #1c1c1c;
|
|
67
50
|
height: 100%;
|
|
68
51
|
min-height: 100%;
|
|
@@ -74,8 +57,10 @@ const localization = $derived(new ShortVideoDetailsLocalization(localizationInit
|
|
|
74
57
|
flex-direction: column;
|
|
75
58
|
min-height: 0;
|
|
76
59
|
padding-bottom: 0.9375rem;
|
|
77
|
-
overflow:
|
|
78
|
-
|
|
60
|
+
overflow: auto;
|
|
61
|
+
scrollbar-color: transparent transparent;
|
|
62
|
+
scrollbar-width: thin;
|
|
63
|
+
--custom-scrollbar-color: #999999;
|
|
79
64
|
position: absolute;
|
|
80
65
|
top: 0;
|
|
81
66
|
right: 0;
|
|
@@ -83,11 +68,32 @@ const localization = $derived(new ShortVideoDetailsLocalization(localizationInit
|
|
|
83
68
|
z-index: 1;
|
|
84
69
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
85
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
|
+
}
|
|
86
93
|
.short-video-details__sliding-container {
|
|
87
94
|
flex: 1;
|
|
88
95
|
display: flex;
|
|
89
96
|
flex-direction: column;
|
|
90
|
-
overflow: hidden;
|
|
91
97
|
min-height: 0;
|
|
92
98
|
}
|
|
93
99
|
@container (width < 576px) {
|
|
@@ -113,33 +119,6 @@ const localization = $derived(new ShortVideoDetailsLocalization(localizationInit
|
|
|
113
119
|
word-break: break-word;
|
|
114
120
|
margin-bottom: 0.4375rem;
|
|
115
121
|
}
|
|
116
|
-
.short-video-details__section-header {
|
|
117
|
-
color: #d1d5db;
|
|
118
|
-
font-size: 1rem;
|
|
119
|
-
font-weight: 700;
|
|
120
|
-
line-height: 1.2;
|
|
121
|
-
display: flex;
|
|
122
|
-
justify-content: space-between;
|
|
123
|
-
margin-bottom: 0.5rem;
|
|
124
|
-
padding: 0.5625rem var(--_short-video-details--padding-horizontal) 0;
|
|
125
|
-
}
|
|
126
122
|
.short-video-details__section-splitter {
|
|
127
123
|
border-bottom: 1px solid #4b5563;
|
|
128
|
-
}
|
|
129
|
-
.short-video-details__attachments {
|
|
130
|
-
display: flex;
|
|
131
|
-
flex-direction: column;
|
|
132
|
-
gap: 1.25rem;
|
|
133
|
-
margin-bottom: 1.25rem;
|
|
134
|
-
}
|
|
135
|
-
.short-video-details__products {
|
|
136
|
-
padding: 0 var(--_short-video-details--padding-horizontal);
|
|
137
|
-
display: grid;
|
|
138
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
139
|
-
grid-column-gap: 1rem;
|
|
140
|
-
grid-row-gap: 1.25rem;
|
|
141
|
-
--product-card--text--color: #d1d5db;
|
|
142
|
-
}
|
|
143
|
-
.short-video-details__offer {
|
|
144
|
-
padding: 0 var(--_short-video-details--padding-horizontal);
|
|
145
124
|
}</style>
|
|
@@ -3,7 +3,7 @@ import { type ShortVideoViewerModel } from './types';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
shortVideo: ShortVideoViewerModel;
|
|
5
5
|
collapsed: boolean;
|
|
6
|
-
localization
|
|
6
|
+
localization?: IShortVideoDetailsLocalization;
|
|
7
7
|
};
|
|
8
8
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
9
9
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import { Image } from '../../ui/image';
|
|
1
|
+
<script lang="ts">import { Image } from '../../ui/image';
|
|
3
2
|
import { Video } from '../../ui/video';
|
|
4
|
-
import { default as
|
|
3
|
+
import { default as AttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
5
4
|
import { default as ShortVideoDescription } from './description.svelte';
|
|
6
5
|
import { ShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
7
6
|
import { ShortVideoViewerUiManager } from './ui-manager.svelte';
|
|
@@ -32,9 +31,9 @@ $effect(() => {
|
|
|
32
31
|
|
|
33
32
|
<div class="short-video-viewer" style={uiManager.globalCssVariables}>
|
|
34
33
|
<div class="short-video-viewer__media">
|
|
35
|
-
{#if model.media.
|
|
34
|
+
{#if !model.media.isImage}
|
|
36
35
|
<Video controls={false} autoplay={autoplay} src={model.media.url} loop={true} poster={model.media.thumbnailUrl} id={model.id} />
|
|
37
|
-
{:else
|
|
36
|
+
{:else}
|
|
38
37
|
<Image src={model.media.url} />
|
|
39
38
|
{/if}
|
|
40
39
|
</div>
|
|
@@ -44,7 +43,7 @@ $effect(() => {
|
|
|
44
43
|
class:short-video-viewer__actions-panel--inside-frame={uiManager.showActionsInsideFrame}
|
|
45
44
|
bind:this={actionsPanelRef}>
|
|
46
45
|
{#if uiManager.showAttachments}
|
|
47
|
-
<
|
|
46
|
+
<AttachmentsInline model={model} />
|
|
48
47
|
{/if}
|
|
49
48
|
</div>
|
|
50
49
|
<div class="short-video-viewer__description">
|
|
@@ -81,6 +80,7 @@ $effect(() => {
|
|
|
81
80
|
@container (width < 576px) {
|
|
82
81
|
.short-video-viewer {
|
|
83
82
|
--_short-video-viewer--button--background-color: #ffffff;
|
|
83
|
+
--_short-video-viewer--button--font-color: #2e2e2e;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
.short-video-viewer__media {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
|
|
2
|
+
export { default as ShortVideoAdViewer } from './cmp.ad.svelte';
|
|
3
|
+
export { default as ShortVideoProductViewer } from './cmp.product.svelte';
|
|
2
4
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
3
|
-
export { default as
|
|
5
|
+
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
4
6
|
export { default as ShortVideoDetails } from './cmp.short-video-details.svelte';
|
|
5
|
-
export type { ShortVideoViewerModel } from './types';
|
|
7
|
+
export type { ShortVideoViewerModel, ShortVideoViewerAdModel, ShortVideoViewerProductModel } from './types';
|
|
6
8
|
export type { IShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
9
|
+
export type { IShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
|
|
2
|
+
export { default as ShortVideoAdViewer } from './cmp.ad.svelte';
|
|
3
|
+
export { default as ShortVideoProductViewer } from './cmp.product.svelte';
|
|
2
4
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
3
|
-
export { default as
|
|
5
|
+
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
4
6
|
export { default as ShortVideoDetails } from './cmp.short-video-details.svelte';
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { MediaType } from '../../core/enums';
|
|
2
|
+
import { getMediaItemImageUrl } from '../../core/media';
|
|
3
|
+
import { shouldUseSalePrice } from '../../products/price-helper';
|
|
4
4
|
export const mapShortVideoViewerModel = (payload) => {
|
|
5
|
-
const allowedAdTypes = [AdType.MediaDialogPromotion];
|
|
6
5
|
const mediaBlob = payload.postData.media[0];
|
|
7
6
|
return {
|
|
8
7
|
id: payload.id,
|
|
9
|
-
media: mediaBlob
|
|
8
|
+
media: mediaBlob.type === MediaType.Image
|
|
9
|
+
? { isImage: true, url: mediaBlob.url }
|
|
10
|
+
: {
|
|
11
|
+
isImage: false,
|
|
12
|
+
url: mediaBlob.url,
|
|
13
|
+
thumbnailUrl: mediaBlob.thumbnailUrl
|
|
14
|
+
},
|
|
10
15
|
text: payload.postData.shortVideoData.text,
|
|
11
16
|
heading: {
|
|
12
17
|
image: payload.postHeading.sourceImage,
|
|
@@ -14,8 +19,8 @@ export const mapShortVideoViewerModel = (payload) => {
|
|
|
14
19
|
displayDate: payload.postHeading.postDisplayDate,
|
|
15
20
|
viewsCount: payload.postHeading.postViewsCount
|
|
16
21
|
},
|
|
17
|
-
ad: payload.ad
|
|
18
|
-
products: payload.allProducts.map(
|
|
22
|
+
ad: payload.ad ? mapToShortVideoViewerAdModel(payload.ad) : null,
|
|
23
|
+
products: payload.allProducts.map(mapToShortVideoViewerProductModel)
|
|
19
24
|
// uncomment if you want to test many products behavior
|
|
20
25
|
/*.flatMap((x) => [
|
|
21
26
|
{ ...x, id: x.id + '1' },
|
|
@@ -26,3 +31,26 @@ export const mapShortVideoViewerModel = (payload) => {
|
|
|
26
31
|
])*/
|
|
27
32
|
};
|
|
28
33
|
};
|
|
34
|
+
const mapToShortVideoViewerAdModel = (payload) => {
|
|
35
|
+
return {
|
|
36
|
+
id: payload.id,
|
|
37
|
+
image: getMediaItemImageUrl(payload.media[0]),
|
|
38
|
+
title: payload.title,
|
|
39
|
+
description: payload.description,
|
|
40
|
+
buttonText: payload.buttonText,
|
|
41
|
+
buttonUrl: payload.buttonUrl,
|
|
42
|
+
openLinkInNewWindow: payload.openLinkInNewWindow
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const mapToShortVideoViewerProductModel = (payload) => {
|
|
46
|
+
const effectiveSalePrice = payload.priceAndAvailability.productSalePrices?.find((x) => shouldUseSalePrice(payload.priceAndAvailability.price, x.salePrice, x.salePriceEffectiveDateFrom, x.salePriceEffectiveDateTo));
|
|
47
|
+
return {
|
|
48
|
+
id: payload.id,
|
|
49
|
+
title: payload.title,
|
|
50
|
+
image: getMediaItemImageUrl(payload.media[0]),
|
|
51
|
+
link: payload.link,
|
|
52
|
+
currency: payload.priceAndAvailability.currency,
|
|
53
|
+
price: payload.priceAndAvailability.price,
|
|
54
|
+
salePrice: effectiveSalePrice?.salePrice ?? null
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -37,9 +37,9 @@ export type ShortVideoViewerPayloadFragment = {
|
|
|
37
37
|
openLinkInNewWindow: boolean | null;
|
|
38
38
|
type: SchemaTypes.AdType;
|
|
39
39
|
media: Array<{
|
|
40
|
-
type: SchemaTypes.MediaType;
|
|
41
40
|
url: string;
|
|
42
41
|
thumbnailUrl: string | null;
|
|
42
|
+
type: SchemaTypes.MediaType;
|
|
43
43
|
}>;
|
|
44
44
|
} | null;
|
|
45
45
|
postData: {
|
|
@@ -26,12 +26,77 @@ export const ShortVideoViewerPayloadFragmentDoc = {
|
|
|
26
26
|
{
|
|
27
27
|
kind: 'Field',
|
|
28
28
|
name: { kind: 'Name', value: 'allProducts' },
|
|
29
|
-
selectionSet: {
|
|
29
|
+
selectionSet: {
|
|
30
|
+
kind: 'SelectionSet',
|
|
31
|
+
selections: [
|
|
32
|
+
{
|
|
33
|
+
kind: 'Field',
|
|
34
|
+
name: { kind: 'Name', value: 'media' },
|
|
35
|
+
selectionSet: {
|
|
36
|
+
kind: 'SelectionSet',
|
|
37
|
+
selections: [
|
|
38
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'url' } },
|
|
39
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
|
|
40
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
45
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
46
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'link' } },
|
|
47
|
+
{
|
|
48
|
+
kind: 'Field',
|
|
49
|
+
name: { kind: 'Name', value: 'priceAndAvailability' },
|
|
50
|
+
selectionSet: {
|
|
51
|
+
kind: 'SelectionSet',
|
|
52
|
+
selections: [
|
|
53
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
54
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
55
|
+
{
|
|
56
|
+
kind: 'Field',
|
|
57
|
+
name: { kind: 'Name', value: 'productSalePrices' },
|
|
58
|
+
selectionSet: {
|
|
59
|
+
kind: 'SelectionSet',
|
|
60
|
+
selections: [
|
|
61
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'salePrice' } },
|
|
62
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateFrom' } },
|
|
63
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateTo' } }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
30
72
|
},
|
|
31
73
|
{
|
|
32
74
|
kind: 'Field',
|
|
33
75
|
name: { kind: 'Name', value: 'ad' },
|
|
34
|
-
selectionSet: {
|
|
76
|
+
selectionSet: {
|
|
77
|
+
kind: 'SelectionSet',
|
|
78
|
+
selections: [
|
|
79
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
80
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
81
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
|
|
82
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'buttonText' } },
|
|
83
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'buttonUrl' } },
|
|
84
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'openLinkInNewWindow' } },
|
|
85
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
86
|
+
{
|
|
87
|
+
kind: 'Field',
|
|
88
|
+
name: { kind: 'Name', value: 'media' },
|
|
89
|
+
selectionSet: {
|
|
90
|
+
kind: 'SelectionSet',
|
|
91
|
+
selections: [
|
|
92
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'url' } },
|
|
93
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
|
|
94
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
35
100
|
},
|
|
36
101
|
{
|
|
37
102
|
kind: 'Field',
|
|
@@ -81,107 +146,6 @@ export const ShortVideoViewerPayloadFragmentDoc = {
|
|
|
81
146
|
}
|
|
82
147
|
]
|
|
83
148
|
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
kind: 'FragmentDefinition',
|
|
87
|
-
name: { kind: 'Name', value: 'ProductCardPayloadFragment' },
|
|
88
|
-
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Product' } },
|
|
89
|
-
selectionSet: {
|
|
90
|
-
kind: 'SelectionSet',
|
|
91
|
-
selections: [
|
|
92
|
-
{
|
|
93
|
-
kind: 'Field',
|
|
94
|
-
name: { kind: 'Name', value: 'media' },
|
|
95
|
-
selectionSet: {
|
|
96
|
-
kind: 'SelectionSet',
|
|
97
|
-
selections: [
|
|
98
|
-
{
|
|
99
|
-
kind: 'Field',
|
|
100
|
-
name: { kind: 'Name', value: 'url' },
|
|
101
|
-
arguments: [
|
|
102
|
-
{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } } }
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
kind: 'Field',
|
|
107
|
-
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
108
|
-
arguments: [
|
|
109
|
-
{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } } }
|
|
110
|
-
]
|
|
111
|
-
},
|
|
112
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
117
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
118
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'link' } },
|
|
119
|
-
{
|
|
120
|
-
kind: 'Field',
|
|
121
|
-
name: { kind: 'Name', value: 'priceAndAvailability' },
|
|
122
|
-
selectionSet: {
|
|
123
|
-
kind: 'SelectionSet',
|
|
124
|
-
selections: [
|
|
125
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
126
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
127
|
-
{
|
|
128
|
-
kind: 'Field',
|
|
129
|
-
name: { kind: 'Name', value: 'productSalePrices' },
|
|
130
|
-
selectionSet: {
|
|
131
|
-
kind: 'SelectionSet',
|
|
132
|
-
selections: [
|
|
133
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'salePrice' } },
|
|
134
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateFrom' } },
|
|
135
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateTo' } }
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
kind: 'FragmentDefinition',
|
|
147
|
-
name: { kind: 'Name', value: 'AdViewPayloadFragment' },
|
|
148
|
-
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Ad' } },
|
|
149
|
-
selectionSet: {
|
|
150
|
-
kind: 'SelectionSet',
|
|
151
|
-
selections: [
|
|
152
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
153
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
154
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
|
|
155
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'buttonText' } },
|
|
156
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'buttonUrl' } },
|
|
157
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'openLinkInNewWindow' } },
|
|
158
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
159
|
-
{
|
|
160
|
-
kind: 'Field',
|
|
161
|
-
name: { kind: 'Name', value: 'media' },
|
|
162
|
-
selectionSet: {
|
|
163
|
-
kind: 'SelectionSet',
|
|
164
|
-
selections: [
|
|
165
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
166
|
-
{
|
|
167
|
-
kind: 'Field',
|
|
168
|
-
name: { kind: 'Name', value: 'url' },
|
|
169
|
-
arguments: [
|
|
170
|
-
{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } } }
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
kind: 'Field',
|
|
175
|
-
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
176
|
-
arguments: [
|
|
177
|
-
{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } } }
|
|
178
|
-
]
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
149
|
}
|
|
186
150
|
]
|
|
187
151
|
};
|
|
@@ -8,10 +8,37 @@ fragment ShortVideoViewerPayloadFragment on Post {
|
|
|
8
8
|
postViewsCount
|
|
9
9
|
}
|
|
10
10
|
allProducts {
|
|
11
|
-
|
|
11
|
+
media {
|
|
12
|
+
url
|
|
13
|
+
thumbnailUrl
|
|
14
|
+
type
|
|
15
|
+
}
|
|
16
|
+
title
|
|
17
|
+
id
|
|
18
|
+
link
|
|
19
|
+
priceAndAvailability {
|
|
20
|
+
currency
|
|
21
|
+
price
|
|
22
|
+
productSalePrices {
|
|
23
|
+
salePrice
|
|
24
|
+
salePriceEffectiveDateFrom
|
|
25
|
+
salePriceEffectiveDateTo
|
|
26
|
+
}
|
|
27
|
+
}
|
|
12
28
|
}
|
|
13
29
|
ad {
|
|
14
|
-
|
|
30
|
+
id
|
|
31
|
+
title
|
|
32
|
+
description
|
|
33
|
+
buttonText
|
|
34
|
+
buttonUrl
|
|
35
|
+
openLinkInNewWindow
|
|
36
|
+
type
|
|
37
|
+
media {
|
|
38
|
+
url
|
|
39
|
+
thumbnailUrl
|
|
40
|
+
type
|
|
41
|
+
}
|
|
15
42
|
}
|
|
16
43
|
postData {
|
|
17
44
|
media {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
2
|
+
export interface IShortVideoAttachmentsLocalization {
|
|
3
|
+
productsSection?: string;
|
|
4
|
+
offersSection?: string;
|
|
5
|
+
productLocalization?: IShortVideoProductLocalization;
|
|
6
|
+
}
|
|
7
|
+
export declare class ShortVideoAttachmentsLocalizationSvelte {
|
|
8
|
+
productsSection: string;
|
|
9
|
+
offersSection: string;
|
|
10
|
+
productLocalization: IShortVideoProductLocalization | undefined;
|
|
11
|
+
constructor(init?: IShortVideoAttachmentsLocalization);
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ShortVideoAttachmentsLocalizationSvelte {
|
|
2
|
+
productsSection = $state('Products');
|
|
3
|
+
offersSection = $state('Offers');
|
|
4
|
+
productLocalization = $state(undefined);
|
|
5
|
+
constructor(init) {
|
|
6
|
+
this.productsSection = init?.productsSection || this.productsSection;
|
|
7
|
+
this.offersSection = init?.offersSection || this.offersSection;
|
|
8
|
+
this.productLocalization = init?.productLocalization;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
2
|
+
import type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization.svelte';
|
|
2
3
|
export interface IShortVideoDetailsLocalization {
|
|
3
|
-
productsSection?: string;
|
|
4
|
-
offersSection?: string;
|
|
5
4
|
viewsCount?: (count: number) => string;
|
|
6
5
|
timeAgoLocalization?: ITimeAgoLocalization;
|
|
6
|
+
attachmentsLocalization?: IShortVideoAttachmentsLocalization;
|
|
7
7
|
}
|
|
8
8
|
export declare class ShortVideoDetailsLocalization {
|
|
9
|
-
productsSection: string;
|
|
10
|
-
offersSection: string;
|
|
11
9
|
viewsCount: (count: number) => string;
|
|
12
10
|
timeAgoLocalization: ITimeAgoLocalization | undefined;
|
|
11
|
+
attachmentsLocalization: IShortVideoAttachmentsLocalization | undefined;
|
|
13
12
|
constructor(init?: IShortVideoDetailsLocalization);
|
|
14
13
|
}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
export class ShortVideoDetailsLocalization {
|
|
2
|
-
productsSection = $state('Products');
|
|
3
|
-
offersSection = $state('Offers');
|
|
4
2
|
viewsCount = $state((count) => (count === 1 ? '1 view' : `${count} views`));
|
|
5
3
|
timeAgoLocalization = $state(undefined);
|
|
4
|
+
attachmentsLocalization = $state(undefined);
|
|
6
5
|
constructor(init) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (init.productsSection !== undefined) {
|
|
11
|
-
this.productsSection = init.productsSection;
|
|
12
|
-
}
|
|
13
|
-
if (init.offersSection !== undefined) {
|
|
14
|
-
this.offersSection = init.offersSection;
|
|
15
|
-
}
|
|
16
|
-
if (init.viewsCount !== undefined) {
|
|
17
|
-
this.viewsCount = init.viewsCount;
|
|
18
|
-
}
|
|
19
|
-
this.timeAgoLocalization = init.timeAgoLocalization;
|
|
6
|
+
this.viewsCount = init?.viewsCount ? init.viewsCount : this.viewsCount;
|
|
7
|
+
this.timeAgoLocalization = init?.timeAgoLocalization;
|
|
8
|
+
this.attachmentsLocalization = init?.attachmentsLocalization;
|
|
20
9
|
}
|
|
21
10
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
2
|
+
import type { IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
2
3
|
export interface IShortVideoViewerLocalization {
|
|
3
4
|
viewsCount?: (count: number) => string;
|
|
4
5
|
timeAgoLocalization?: ITimeAgoLocalization;
|
|
6
|
+
productLocalization?: IShortVideoProductLocalization;
|
|
5
7
|
}
|
|
6
8
|
export declare class ShortVideoViewerLocalization {
|
|
7
9
|
viewsCount: (count: number) => string;
|
|
8
10
|
timeAgoLocalization: ITimeAgoLocalization | undefined;
|
|
11
|
+
productLocalization: IShortVideoProductLocalization | undefined;
|
|
9
12
|
constructor(init?: IShortVideoViewerLocalization);
|
|
10
13
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export class ShortVideoViewerLocalization {
|
|
2
2
|
viewsCount = $state((count) => (count === 1 ? '1 view' : `${count} views`));
|
|
3
3
|
timeAgoLocalization = $state(undefined);
|
|
4
|
+
productLocalization = $state(undefined);
|
|
4
5
|
constructor(init) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (init.viewsCount !== undefined) {
|
|
9
|
-
this.viewsCount = init.viewsCount;
|
|
10
|
-
}
|
|
11
|
-
this.timeAgoLocalization = init.timeAgoLocalization;
|
|
6
|
+
this.viewsCount = init?.viewsCount ? init.viewsCount : this.viewsCount;
|
|
7
|
+
this.timeAgoLocalization = init?.timeAgoLocalization;
|
|
8
|
+
this.productLocalization = init?.productLocalization;
|
|
12
9
|
}
|
|
13
10
|
}
|