@streamscloud/embeddable 3.4.2 → 5.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/ads/ad-card/cmp.ad-card.svelte +220 -0
- package/dist/{short-videos/short-video-viewer/cmp.ad.svelte.d.ts → ads/ad-card/cmp.ad-card.svelte.d.ts} +3 -2
- package/dist/ads/ad-card/index.d.ts +3 -0
- package/dist/ads/ad-card/index.js +2 -0
- package/dist/ads/ad-card/mapper.d.ts +3 -0
- package/dist/ads/ad-card/mapper.js +14 -0
- package/dist/ads/ad-card/operations.generated.d.ts +24 -0
- package/dist/ads/ad-card/operations.generated.js +48 -0
- package/dist/ads/ad-card/operations.graphql +21 -0
- package/dist/ads/ad-card/types.d.ts +18 -0
- package/dist/ads/ad-card/types.js +1 -0
- package/dist/core/locale.d.ts +3 -0
- package/dist/products/price-helper.d.ts +18 -3
- package/dist/products/price-helper.js +9 -6
- package/dist/products/product-card/cmp.product-card.svelte +219 -0
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +15 -0
- package/dist/products/product-card/index.d.ts +4 -0
- package/dist/products/product-card/index.js +2 -0
- package/dist/products/product-card/mapper.d.ts +3 -0
- package/dist/products/product-card/mapper.js +22 -0
- package/dist/products/product-card/operations.generated.d.ts +26 -0
- package/dist/products/product-card/operations.generated.js +59 -0
- package/dist/products/product-card/operations.graphql +23 -0
- package/dist/products/product-card/product-card-localization.d.ts +8 -0
- package/dist/{short-videos/short-video-viewer/short-video-product-localization.js → products/product-card/product-card-localization.js} +1 -1
- package/dist/products/product-card/types.d.ts +12 -0
- package/dist/products/product-card/types.js +1 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +12 -40
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte +145 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte.d.ts +19 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +46 -20
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +4 -2
- package/dist/short-videos/short-video-viewer/index.d.ts +3 -7
- package/dist/short-videos/short-video-viewer/index.js +2 -5
- package/dist/short-videos/short-video-viewer/mapper.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/mapper.js +25 -22
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +6 -8
- package/dist/short-videos/short-video-viewer/operations.generated.js +10 -17
- package/dist/short-videos/short-video-viewer/operations.graphql +8 -10
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.d.ts +3 -7
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +0 -14
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +3 -3
- package/dist/short-videos/short-video-viewer/types.d.ts +23 -13
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +5 -0
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +15 -2
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +25 -163
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +7 -2
- package/dist/short-videos/short-videos-player/controls.svelte +125 -125
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +4 -2
- package/dist/short-videos/short-videos-player/index.d.ts +2 -0
- package/dist/short-videos/short-videos-player/index.js +12 -3
- package/dist/short-videos/short-videos-player/operations.generated.d.ts +6 -8
- package/dist/short-videos/short-videos-player/operations.generated.js +10 -17
- package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +1 -3
- package/dist/short-videos/short-videos-player/short-videos-player-localization.js +0 -2
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +211 -0
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte.d.ts +18 -0
- package/dist/short-videos/short-videos-player/types.d.ts +10 -8
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +4 -3
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +9 -8
- package/dist/streams/layout/element-views/price-element-view.svelte +5 -4
- package/dist/streams/layout/models/mapper.js +10 -18
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +1 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +23 -8
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +3 -1
- package/dist/streams/stream-player/controls.svelte +87 -74
- package/dist/streams/stream-player/controls.svelte.d.ts +2 -0
- package/dist/streams/stream-player/index.d.ts +2 -0
- package/dist/streams/stream-player/index.js +4 -3
- package/dist/streams/stream-player/mapper.d.ts +1 -1
- package/dist/streams/stream-player/mapper.js +1 -1
- package/dist/streams/stream-player/stream-overview.svelte +12 -1
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -0
- package/dist/streams/stream-player/stream-player-localization.d.ts +1 -3
- package/dist/streams/stream-player/stream-player-localization.js +0 -2
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +4 -2
- package/dist/streams/stream-player/ui-manager.svelte.js +10 -5
- package/dist/ui/button/resources/button-theme.svelte +1 -0
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +35 -13
- package/dist/ui/player/cmp.player-slider.svelte +74 -9
- package/dist/ui/progress/cmp.progress.svelte +4 -1
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +112 -28
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +3 -0
- package/dist/ui/shadow-dom/index.d.ts +2 -1
- package/dist/ui/shadow-dom/index.js +2 -1
- package/dist/ui/shadow-dom/{shadow-host.d.ts → modal-shadow-host.d.ts} +1 -1
- package/dist/ui/shadow-dom/modal-shadow-host.js +21 -0
- package/dist/ui/shadow-dom/shadow-root-service.d.ts +1 -0
- package/dist/ui/shadow-dom/shadow-root-service.js +23 -0
- package/dist/ui/video/cmp.video.svelte +46 -38
- package/dist/ui/video/cmp.video.svelte.d.ts +3 -0
- package/dist/ui/video/index.d.ts +1 -0
- package/dist/ui/video/index.js +1 -0
- package/dist/ui/video/types.d.ts +4 -0
- package/dist/ui/video/types.js +5 -0
- package/package.json +5 -1
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte +0 -140
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +0 -168
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +0 -14
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +0 -125
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +0 -14
- package/dist/short-videos/short-video-viewer/cmp.social-interactions.svelte +0 -69
- package/dist/short-videos/short-video-viewer/cmp.social-interactions.svelte.d.ts +0 -10
- package/dist/short-videos/short-video-viewer/description.svelte +0 -53
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/short-video-details-localization.d.ts +0 -14
- package/dist/short-videos/short-video-viewer/short-video-details-localization.js +0 -17
- package/dist/short-videos/short-video-viewer/short-video-product-localization.d.ts +0 -8
- 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/ui/shadow-dom/shadow-host.js +0 -32
|
@@ -1,70 +1,63 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
1
|
+
<script lang="ts">import { slideHorizontally } from '../../core/transitions';
|
|
2
|
+
import { ShortVideoControls, ShortVideoViewerAttachments, ShortVideoViewerAttachmentsInline } from '../short-video-viewer';
|
|
2
3
|
import { Icon } from '../../ui/icon';
|
|
3
|
-
import { MediaVolumeManager } from '../../ui/media-playback';
|
|
4
|
-
import { default as ActionButton } from './action-button.svelte';
|
|
5
4
|
import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
6
5
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
7
6
|
import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_20_regular.svg?raw';
|
|
8
7
|
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_20_regular.svg?raw';
|
|
9
|
-
|
|
10
|
-
import IconSpeaker2 from '@fluentui/svg-icons/icons/speaker_2_20_regular.svg?raw';
|
|
11
|
-
import IconSpeakerMute from '@fluentui/svg-icons/icons/speaker_mute_20_regular.svg?raw';
|
|
12
|
-
let { buffer, uiManager, localization, on } = $props();
|
|
13
|
-
const toggleMuted = () => {
|
|
14
|
-
MediaVolumeManager.isMuted = !MediaVolumeManager.isMuted;
|
|
15
|
-
};
|
|
8
|
+
let { buffer, uiManager, localization, socialInteractionsHandler, on } = $props();
|
|
16
9
|
const shortVideo = $derived(buffer.current);
|
|
10
|
+
const changeShowAttachments = () => {
|
|
11
|
+
uiManager.showAttachments = !uiManager.showAttachments;
|
|
12
|
+
};
|
|
17
13
|
</script>
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
<div class="short-videos-player-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<div class="short-videos-player-controls__short-video-
|
|
24
|
-
|
|
15
|
+
{#if uiManager.viewInitialized && !uiManager.showShortVideoOverlay}
|
|
16
|
+
<div class="short-videos-player-controls">
|
|
17
|
+
<div class="short-videos-player-controls__left">
|
|
18
|
+
{#if shortVideo}
|
|
19
|
+
<div class="short-videos-player-controls__short-video-hub">
|
|
20
|
+
{#if uiManager.showAttachments}
|
|
21
|
+
<div class="short-videos-player-controls__short-video-attachments-inline">
|
|
22
|
+
<ShortVideoViewerAttachmentsInline model={shortVideo} />
|
|
23
|
+
</div>
|
|
24
|
+
{/if}
|
|
25
|
+
<ShortVideoControls model={shortVideo} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: changeShowAttachments }} />
|
|
25
26
|
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
<div class="short-videos-player-controls__navigation-buttons">
|
|
29
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
30
|
+
<span class="navigation-button__icon">
|
|
31
|
+
<Icon src={IconChevronUp} />
|
|
32
|
+
</span>
|
|
33
|
+
</button>
|
|
34
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
35
|
+
<span class="navigation-button__icon">
|
|
36
|
+
<Icon src={IconChevronDown} />
|
|
37
|
+
</span>
|
|
38
|
+
</button>
|
|
26
39
|
</div>
|
|
27
|
-
{/if}
|
|
28
|
-
<div class="short-videos-player-controls__navigation-buttons">
|
|
29
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
30
|
-
<Icon src={IconChevronUp} />
|
|
31
|
-
</button>
|
|
32
|
-
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
33
|
-
<Icon src={IconChevronDown} />
|
|
34
|
-
</button>
|
|
35
40
|
</div>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{#if MediaVolumeManager.isMuted}
|
|
47
|
-
<Icon src={IconSpeakerMute} />
|
|
48
|
-
{:else}
|
|
49
|
-
<Icon src={IconSpeaker2} />
|
|
50
|
-
{/if}
|
|
51
|
-
</ActionButton>
|
|
41
|
+
<div class="short-videos-player-controls__right">
|
|
42
|
+
{#if shortVideo && uiManager.showAttachments}
|
|
43
|
+
<div class="short-videos-player-controls__short-video-attachments" transition:slideHorizontally|local>
|
|
44
|
+
<ShortVideoViewerAttachments
|
|
45
|
+
shortVideo={shortVideo}
|
|
46
|
+
localization={localization.shortVideoAttachmentsLocalization}
|
|
47
|
+
on={{
|
|
48
|
+
productClick: on.productClick
|
|
49
|
+
}} />
|
|
50
|
+
</div>
|
|
52
51
|
{/if}
|
|
53
52
|
</div>
|
|
54
53
|
</div>
|
|
55
|
-
|
|
54
|
+
{/if}
|
|
56
55
|
|
|
57
|
-
{#if
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<Icon src={IconPanelRightGallery} />
|
|
62
|
-
</ActionButton>
|
|
63
|
-
</div>
|
|
56
|
+
{#if on.closePlayer}
|
|
57
|
+
<button type="button" class="close-button" onclick={on.closePlayer}>
|
|
58
|
+
<Icon src={IconDismiss} />
|
|
59
|
+
</button>
|
|
64
60
|
{/if}
|
|
65
|
-
<button type="button" class="close-button navigation-button" onclick={on.closePlayer}>
|
|
66
|
-
<Icon src={IconDismiss} />
|
|
67
|
-
</button>
|
|
68
61
|
|
|
69
62
|
<style>@keyframes fadeIn {
|
|
70
63
|
0% {
|
|
@@ -77,20 +70,6 @@ const shortVideo = $derived(buffer.current);
|
|
|
77
70
|
opacity: 1;
|
|
78
71
|
}
|
|
79
72
|
}
|
|
80
|
-
.close-button {
|
|
81
|
-
position: absolute;
|
|
82
|
-
top: var(--short-videos-player--controls--offset-vertical);
|
|
83
|
-
right: var(--short-videos-player--controls--offset-horizontal);
|
|
84
|
-
z-index: 1;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.toggle-collapsed-button {
|
|
88
|
-
position: absolute;
|
|
89
|
-
bottom: var(--short-videos-player--controls--offset-vertical);
|
|
90
|
-
right: var(--short-videos-player--controls--offset-horizontal);
|
|
91
|
-
z-index: 1;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
73
|
.short-videos-player-controls {
|
|
95
74
|
position: absolute;
|
|
96
75
|
top: 0;
|
|
@@ -99,15 +78,15 @@ const shortVideo = $derived(buffer.current);
|
|
|
99
78
|
width: var(--short-videos-player--sidebar--available-space);
|
|
100
79
|
display: flex;
|
|
101
80
|
justify-content: space-between;
|
|
102
|
-
gap: 2.5rem;
|
|
103
81
|
padding: var(--short-videos-player--controls--offset-vertical) var(--short-videos-player--controls--offset-horizontal);
|
|
104
82
|
container-type: inline-size;
|
|
105
83
|
}
|
|
106
84
|
.short-videos-player-controls__left {
|
|
107
85
|
display: flex;
|
|
108
86
|
flex-direction: column;
|
|
109
|
-
gap: 2.
|
|
87
|
+
gap: 2.3125rem;
|
|
110
88
|
justify-content: flex-end;
|
|
89
|
+
align-items: center;
|
|
111
90
|
}
|
|
112
91
|
.short-videos-player-controls__right {
|
|
113
92
|
flex: 1;
|
|
@@ -115,69 +94,59 @@ const shortVideo = $derived(buffer.current);
|
|
|
115
94
|
justify-content: space-between;
|
|
116
95
|
align-items: flex-end;
|
|
117
96
|
flex-direction: column;
|
|
118
|
-
padding-top: 3.75rem;
|
|
119
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
120
|
-
}
|
|
121
|
-
@container (width < 9.375rem) {
|
|
122
|
-
.short-videos-player-controls__right {
|
|
123
|
-
display: none;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
.short-videos-player-controls__short-video-overlay {
|
|
127
|
-
gap: 2.5rem;
|
|
128
|
-
display: flex;
|
|
129
|
-
flex: 1;
|
|
130
|
-
min-height: 0;
|
|
131
|
-
flex-direction: column;
|
|
132
|
-
align-items: flex-start;
|
|
133
|
-
justify-content: flex-end;
|
|
134
|
-
--short-video-viewer--interactions--icon--size: var(--short-videos-player--navigation-button--size);
|
|
135
|
-
--short-video-viewer--interactions--background--color: #1c1c1c;
|
|
136
|
-
--short-video-viewer--interactions--counter--color: #f3f4f6;
|
|
137
|
-
--short-video-viewer--interactions--icon--font-color: #f3f4f6;
|
|
138
|
-
}
|
|
139
|
-
.short-videos-player-controls__short-video-attachments-inline {
|
|
140
|
-
display: none;
|
|
141
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
142
|
-
}
|
|
143
|
-
@container (width < calc(21.875rem + 3.75rem)) {
|
|
144
|
-
.short-videos-player-controls__short-video-attachments-inline {
|
|
145
|
-
display: contents;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
.short-videos-player-controls__short-video-attachments {
|
|
149
|
-
flex: 1;
|
|
150
97
|
overflow-x: hidden;
|
|
151
98
|
overflow-y: auto;
|
|
152
99
|
scrollbar-color: transparent transparent;
|
|
153
100
|
scrollbar-width: thin;
|
|
154
|
-
width: 21.875rem;
|
|
155
|
-
max-width: 21.875rem;
|
|
156
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
157
101
|
}
|
|
158
|
-
.short-videos-player-
|
|
102
|
+
.short-videos-player-controls__right::-webkit-scrollbar {
|
|
159
103
|
width: 3px;
|
|
160
104
|
height: 3px;
|
|
161
105
|
background: var(--custom-scrollbar-background, transparent);
|
|
162
106
|
visibility: hidden;
|
|
163
107
|
}
|
|
164
|
-
.short-videos-player-
|
|
108
|
+
.short-videos-player-controls__right::-webkit-scrollbar-thumb {
|
|
165
109
|
background: transparent;
|
|
166
110
|
}
|
|
167
|
-
.short-videos-player-
|
|
111
|
+
.short-videos-player-controls__right:hover {
|
|
168
112
|
scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
|
|
169
113
|
scrollbar-width: thin;
|
|
170
114
|
}
|
|
171
|
-
.short-videos-player-
|
|
115
|
+
.short-videos-player-controls__right:hover::-webkit-scrollbar {
|
|
172
116
|
width: 3px;
|
|
173
117
|
height: 3px;
|
|
174
118
|
background: var(--custom-scrollbar-background, transparent);
|
|
175
119
|
visibility: hidden;
|
|
176
120
|
}
|
|
177
|
-
.short-videos-player-
|
|
121
|
+
.short-videos-player-controls__right:hover::-webkit-scrollbar-thumb {
|
|
178
122
|
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
179
123
|
}
|
|
180
|
-
|
|
124
|
+
.short-videos-player-controls__short-video-hub {
|
|
125
|
+
gap: 2.5rem;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex: 1;
|
|
128
|
+
min-height: 0;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
align-items: flex-start;
|
|
131
|
+
justify-content: flex-end;
|
|
132
|
+
--short-video-controls--icon--size: var(--short-videos-player--icon--size);
|
|
133
|
+
}
|
|
134
|
+
.short-videos-player-controls__short-video-attachments-inline {
|
|
135
|
+
display: none;
|
|
136
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
137
|
+
}
|
|
138
|
+
@container (width < calc(11rem + 3.75rem)) {
|
|
139
|
+
.short-videos-player-controls__short-video-attachments-inline {
|
|
140
|
+
display: contents;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
.short-videos-player-controls__short-video-attachments {
|
|
144
|
+
flex: 1;
|
|
145
|
+
width: 11rem;
|
|
146
|
+
max-width: 11rem;
|
|
147
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
148
|
+
}
|
|
149
|
+
@container (width < calc(11rem + 3.75rem)) {
|
|
181
150
|
.short-videos-player-controls__short-video-attachments {
|
|
182
151
|
display: none;
|
|
183
152
|
}
|
|
@@ -188,35 +157,66 @@ const shortVideo = $derived(buffer.current);
|
|
|
188
157
|
gap: 1rem;
|
|
189
158
|
margin-bottom: 0.625rem;
|
|
190
159
|
z-index: 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.close-button {
|
|
163
|
+
width: var(--short-videos-player--button--size);
|
|
164
|
+
min-width: var(--short-videos-player--button--size);
|
|
165
|
+
max-width: var(--short-videos-player--button--size);
|
|
166
|
+
height: var(--short-videos-player--button--size);
|
|
167
|
+
min-height: var(--short-videos-player--button--size);
|
|
168
|
+
max-height: var(--short-videos-player--button--size);
|
|
169
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
170
|
+
border: 1px solid #1c1c1c;
|
|
171
|
+
border-radius: 50%;
|
|
172
|
+
text-align: center;
|
|
173
|
+
--icon--color: #ffffff;
|
|
174
|
+
--icon--size: var(--short-videos-player--icon--size);
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: 0.9375rem;
|
|
177
|
+
left: 0.625rem;
|
|
178
|
+
z-index: 1;
|
|
191
179
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
192
180
|
}
|
|
193
|
-
|
|
194
|
-
.
|
|
195
|
-
|
|
196
|
-
}
|
|
181
|
+
.close-button:disabled {
|
|
182
|
+
opacity: 0.5;
|
|
183
|
+
cursor: default;
|
|
197
184
|
}
|
|
198
|
-
.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
185
|
+
.close-button:hover {
|
|
186
|
+
background-color: rgba(0, 0, 0, 0.9);
|
|
187
|
+
transition: background-color 0.5s;
|
|
188
|
+
}
|
|
189
|
+
@container (width < 576px) {
|
|
190
|
+
.close-button {
|
|
191
|
+
left: unset;
|
|
192
|
+
right: 0.625rem;
|
|
193
|
+
}
|
|
203
194
|
}
|
|
204
195
|
|
|
205
196
|
.navigation-button {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
197
|
+
--_icon-scale: 1;
|
|
198
|
+
width: var(--short-videos-player--button--size);
|
|
199
|
+
min-width: var(--short-videos-player--button--size);
|
|
200
|
+
max-width: var(--short-videos-player--button--size);
|
|
201
|
+
height: var(--short-videos-player--button--size);
|
|
202
|
+
min-height: var(--short-videos-player--button--size);
|
|
203
|
+
max-height: var(--short-videos-player--button--size);
|
|
204
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
213
205
|
border: 1px solid #1c1c1c;
|
|
214
206
|
border-radius: 50%;
|
|
215
207
|
text-align: center;
|
|
216
208
|
--icon--color: #ffffff;
|
|
217
|
-
--icon--
|
|
209
|
+
--icon--size: var(--short-videos-player--icon--size);
|
|
218
210
|
}
|
|
219
211
|
.navigation-button:disabled {
|
|
220
212
|
opacity: 0.5;
|
|
221
213
|
cursor: default;
|
|
214
|
+
}
|
|
215
|
+
.navigation-button:hover:not(:disabled) {
|
|
216
|
+
--_icon-scale: 1.2;
|
|
217
|
+
}
|
|
218
|
+
.navigation-button__icon {
|
|
219
|
+
display: block;
|
|
220
|
+
transform: scale(var(--_icon-scale));
|
|
221
|
+
transition: 0.3s;
|
|
222
222
|
}</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ShortVideoViewerModel } from '../short-video-viewer';
|
|
1
|
+
import { type ShortVideoSocialInteractionsHanlder, type ShortVideoViewerModel } from '../short-video-viewer';
|
|
2
2
|
import type { IPlayerBuffer } from '../../ui/player';
|
|
3
3
|
import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
4
4
|
import type { ShortVideosPlayerUiManager } from './ui-manager.svelte';
|
|
@@ -6,8 +6,10 @@ type Props = {
|
|
|
6
6
|
buffer: IPlayerBuffer<ShortVideoViewerModel>;
|
|
7
7
|
uiManager: ShortVideosPlayerUiManager;
|
|
8
8
|
localization: ShortVideosPlayerLocalization;
|
|
9
|
+
socialInteractionsHandler?: ShortVideoSocialInteractionsHanlder;
|
|
9
10
|
on: {
|
|
10
|
-
closePlayer
|
|
11
|
+
closePlayer?: () => void;
|
|
12
|
+
productClick?: (productId: string) => void;
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
declare const Controls: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { default as ShortVideosPlayer } from './cmp.short-videos-player.svelte';
|
|
1
2
|
import type { IShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
2
3
|
import { type OpenShortVideosPlayerInit } from './types';
|
|
4
|
+
export { ShortVideosPlayer };
|
|
3
5
|
export type { IShortVideosPlayerLocalization };
|
|
4
6
|
/**
|
|
5
7
|
* Opens the short videos player modal with the specified provider or by fetching videos by IDs.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { getLocale } from '../../core/locale';
|
|
2
|
-
import {
|
|
2
|
+
import { ModalShadowHost } from '../../ui/shadow-dom';
|
|
3
3
|
import { default as ShortVideosPlayer } from './cmp.short-videos-player.svelte';
|
|
4
|
+
import { default as ShortVideosPlayerView } from './short-videos-player-view.svelte';
|
|
4
5
|
import { isIdsInit, isShortVideosProviderInit } from './types';
|
|
5
6
|
import { mount, unmount } from 'svelte';
|
|
7
|
+
export { ShortVideosPlayer };
|
|
6
8
|
/**
|
|
7
9
|
* Opens the short videos player modal with the specified provider or by fetching videos by IDs.
|
|
8
10
|
*
|
|
@@ -90,12 +92,14 @@ export const openShortVideosPlayer = async (init) => {
|
|
|
90
92
|
if (!input) {
|
|
91
93
|
return;
|
|
92
94
|
}
|
|
93
|
-
const shadowHost = new
|
|
94
|
-
const mounted = mount(
|
|
95
|
+
const shadowHost = new ModalShadowHost();
|
|
96
|
+
const mounted = mount(ShortVideosPlayerView, {
|
|
95
97
|
target: shadowHost.shadowRoot,
|
|
96
98
|
props: {
|
|
97
99
|
input,
|
|
100
|
+
socialInteractionsHandler: init.socialInteractionsHandler,
|
|
98
101
|
localization: getLocale(init.localization),
|
|
102
|
+
showStreamsCloudWatermark: init.showStreamsCloudWatermark,
|
|
99
103
|
on: {
|
|
100
104
|
closePlayer: async () => {
|
|
101
105
|
if (init.on?.playerClosed) {
|
|
@@ -103,6 +107,11 @@ export const openShortVideosPlayer = async (init) => {
|
|
|
103
107
|
}
|
|
104
108
|
await unmount(mounted);
|
|
105
109
|
shadowHost.remove();
|
|
110
|
+
},
|
|
111
|
+
videoActivated: (id) => {
|
|
112
|
+
if (init.on?.videoActivated) {
|
|
113
|
+
init.on.videoActivated(id);
|
|
114
|
+
}
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
117
|
}
|
|
@@ -9,22 +9,19 @@ export type GetShortVideosQuery = {
|
|
|
9
9
|
items: Array<{
|
|
10
10
|
id: string;
|
|
11
11
|
enableSocialInteractions: boolean;
|
|
12
|
-
postHeading: {
|
|
13
|
-
sourceImage: string | null;
|
|
14
|
-
sourceName: string;
|
|
15
|
-
postDisplayDate: any;
|
|
16
|
-
postViewsCount: number;
|
|
17
|
-
};
|
|
18
12
|
allProducts: Array<{
|
|
19
|
-
title: string;
|
|
20
13
|
id: string;
|
|
21
|
-
|
|
14
|
+
title: string;
|
|
22
15
|
shortDescription: string | null;
|
|
16
|
+
link: string | null;
|
|
23
17
|
media: Array<{
|
|
24
18
|
url: string;
|
|
25
19
|
thumbnailUrl: string | null;
|
|
26
20
|
type: SchemaTypes.MediaType;
|
|
27
21
|
}>;
|
|
22
|
+
brand: {
|
|
23
|
+
name: string;
|
|
24
|
+
} | null;
|
|
28
25
|
priceAndAvailability: {
|
|
29
26
|
currency: SchemaTypes.Currency;
|
|
30
27
|
price: number;
|
|
@@ -40,6 +37,7 @@ export type GetShortVideosQuery = {
|
|
|
40
37
|
title: string;
|
|
41
38
|
description: string | null;
|
|
42
39
|
price: number | null;
|
|
40
|
+
priceInfo: string | null;
|
|
43
41
|
currency: SchemaTypes.Currency | null;
|
|
44
42
|
type: SchemaTypes.AdType;
|
|
45
43
|
ctaButton: {
|
|
@@ -52,25 +52,16 @@ export const GetShortVideosDocument = {
|
|
|
52
52
|
selections: [
|
|
53
53
|
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
54
54
|
{ kind: 'Field', name: { kind: 'Name', value: 'enableSocialInteractions' } },
|
|
55
|
-
{
|
|
56
|
-
kind: 'Field',
|
|
57
|
-
name: { kind: 'Name', value: 'postHeading' },
|
|
58
|
-
selectionSet: {
|
|
59
|
-
kind: 'SelectionSet',
|
|
60
|
-
selections: [
|
|
61
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'sourceImage' } },
|
|
62
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'sourceName' } },
|
|
63
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'postDisplayDate' } },
|
|
64
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'postViewsCount' } }
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
55
|
{
|
|
69
56
|
kind: 'Field',
|
|
70
57
|
name: { kind: 'Name', value: 'allProducts' },
|
|
71
58
|
selectionSet: {
|
|
72
59
|
kind: 'SelectionSet',
|
|
73
60
|
selections: [
|
|
61
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
62
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
63
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'shortDescription' } },
|
|
64
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'link' } },
|
|
74
65
|
{
|
|
75
66
|
kind: 'Field',
|
|
76
67
|
name: { kind: 'Name', value: 'media' },
|
|
@@ -83,10 +74,11 @@ export const GetShortVideosDocument = {
|
|
|
83
74
|
]
|
|
84
75
|
}
|
|
85
76
|
},
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
{
|
|
78
|
+
kind: 'Field',
|
|
79
|
+
name: { kind: 'Name', value: 'brand' },
|
|
80
|
+
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'name' } }] }
|
|
81
|
+
},
|
|
90
82
|
{
|
|
91
83
|
kind: 'Field',
|
|
92
84
|
name: { kind: 'Name', value: 'priceAndAvailability' },
|
|
@@ -123,6 +115,7 @@ export const GetShortVideosDocument = {
|
|
|
123
115
|
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
124
116
|
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
|
|
125
117
|
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
118
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'priceInfo' } },
|
|
126
119
|
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
127
120
|
{
|
|
128
121
|
kind: 'Field',
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { type Locale } from '../../core/locale';
|
|
2
|
-
import type { IShortVideoAttachmentsLocalization,
|
|
2
|
+
import type { IShortVideoAttachmentsLocalization, IShortVideoViewerLocalization } from '../short-video-viewer';
|
|
3
3
|
import type { ISwipeIndicatorLocalization } from '../../ui/swipe-indicator';
|
|
4
4
|
export interface IShortVideosPlayerLocalization {
|
|
5
5
|
shortVideoAttachmentsLocalization?: IShortVideoAttachmentsLocalization | Locale;
|
|
6
|
-
shortVideoDetailsLocalization?: IShortVideoDetailsLocalization | Locale;
|
|
7
6
|
shortVideoViewerLocalization?: IShortVideoViewerLocalization | Locale;
|
|
8
7
|
swipeIndicatorLocalization?: ISwipeIndicatorLocalization | Locale;
|
|
9
8
|
}
|
|
10
9
|
export declare class ShortVideosPlayerLocalization {
|
|
11
10
|
shortVideoAttachmentsLocalization: IShortVideoAttachmentsLocalization | Locale;
|
|
12
|
-
shortVideoDetailsLocalization: IShortVideoDetailsLocalization | Locale;
|
|
13
11
|
shortVideoViewerLocalization: IShortVideoViewerLocalization | Locale;
|
|
14
12
|
swipeIndicatorLocalization: ISwipeIndicatorLocalization | Locale;
|
|
15
13
|
constructor(init: IShortVideosPlayerLocalization | Locale);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { isLocale } from '../../core/locale';
|
|
2
2
|
export class ShortVideosPlayerLocalization {
|
|
3
3
|
shortVideoAttachmentsLocalization;
|
|
4
|
-
shortVideoDetailsLocalization;
|
|
5
4
|
shortVideoViewerLocalization;
|
|
6
5
|
swipeIndicatorLocalization;
|
|
7
6
|
constructor(init) {
|
|
8
7
|
this.shortVideoAttachmentsLocalization = isLocale(init) ? init : init.shortVideoAttachmentsLocalization || 'en';
|
|
9
|
-
this.shortVideoDetailsLocalization = isLocale(init) ? init : init.shortVideoDetailsLocalization || 'en';
|
|
10
8
|
this.shortVideoViewerLocalization = isLocale(init) ? init : init.shortVideoViewerLocalization || 'en';
|
|
11
9
|
this.swipeIndicatorLocalization = isLocale(init) ? init : init.swipeIndicatorLocalization || 'en';
|
|
12
10
|
}
|