@streamscloud/embeddable 6.4.2 → 6.5.0-1758183492920
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 +3 -5
- package/dist/core/actions/horizontal-wheel-scroll.d.ts +4 -0
- package/dist/core/actions/horizontal-wheel-scroll.js +22 -0
- package/dist/core/actions/index.d.ts +2 -0
- package/dist/core/actions/index.js +2 -0
- package/dist/core/actions/swallow-touch.d.ts +2 -0
- package/dist/core/actions/swallow-touch.js +17 -0
- package/dist/media-center/media-center/cmp.media-center.svelte +10 -5
- package/dist/products/price-helper.d.ts +8 -1
- package/dist/products/price-helper.js +69 -24
- package/dist/products/product-card/cmp.product-card.svelte +2 -2
- package/dist/products/product-card/types.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte +224 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +63 -65
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -1
- package/dist/short-videos/short-video-viewer/index.js +0 -1
- package/dist/short-videos/short-video-viewer/types.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +2 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +5 -2
- package/dist/short-videos/short-videos-player/controls.svelte +85 -84
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +2 -2
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +8 -1
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +15 -6
- package/dist/streams/layout/element-views/price-element-view.svelte +7 -5
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +4 -4
- package/dist/streams/stream-player/controls.svelte +131 -94
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -0
- package/dist/streams/stream-player/fade-mixins.scss +12 -0
- package/dist/streams/stream-player/stream-overview.svelte +1 -3
- package/dist/streams/stream-player/stream-player.svelte +22 -3
- package/dist/streams/stream-player/stream-player.svelte.d.ts +12 -1
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +15 -8
- package/dist/streams/stream-player/ui-manager.svelte.js +40 -19
- package/package.json +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +0 -133
- /package/dist/short-videos/short-video-viewer/{cmp.attachments-inline.svelte.d.ts → cmp.attachments-horizontal.svelte.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { Image } from '../../ui/image';
|
|
2
2
|
import { LineClamp } from '../../ui/line-clamp';
|
|
3
3
|
import { Video } from '../../ui/video';
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as AttachmentsHorizontal } from './cmp.attachments-horizontal.svelte';
|
|
5
5
|
import { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
|
|
6
6
|
import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
|
|
7
7
|
import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
@@ -13,41 +13,37 @@ $effect(() => {
|
|
|
13
13
|
uiManager.updateCanShowAttachments(showAttachments);
|
|
14
14
|
uiManager.updateCanShowControls(showControls);
|
|
15
15
|
});
|
|
16
|
+
const trackControlsPanelSize = (node) => {
|
|
17
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
18
|
+
const width = entry.contentRect.width;
|
|
19
|
+
uiManager.setControlsPanelWidth(width);
|
|
20
|
+
});
|
|
21
|
+
resizeObserver.observe(node);
|
|
22
|
+
return {
|
|
23
|
+
destroy() {
|
|
24
|
+
resizeObserver.unobserve(node);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
16
28
|
</script>
|
|
17
29
|
|
|
18
30
|
<div class="short-video-viewer" style={uiManager.globalCssVariables}>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
on
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div class="short-video-viewer__actions-panel" class:short-video-viewer__actions-panel--inside-frame={true}>
|
|
38
|
-
{#if uiManager.showAttachments}
|
|
39
|
-
<AttachmentsInline
|
|
40
|
-
model={model}
|
|
41
|
-
on={{
|
|
42
|
-
productClick: on?.productClick,
|
|
43
|
-
productImpression: on?.productImpression
|
|
44
|
-
}} />
|
|
45
|
-
{/if}
|
|
46
|
-
{#if uiManager.showControls}
|
|
47
|
-
<ShortVideoControls model={model} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: uiManager.toggleEnableAttachments }} />
|
|
48
|
-
{/if}
|
|
49
|
-
</div>
|
|
50
|
-
<div class="short-video-viewer__description">
|
|
31
|
+
{#if !model.media.isImage}
|
|
32
|
+
<Video
|
|
33
|
+
src={model.media.url}
|
|
34
|
+
poster={model.media.thumbnailUrl}
|
|
35
|
+
controls={false}
|
|
36
|
+
autoplay={autoplay}
|
|
37
|
+
loop={true}
|
|
38
|
+
id={model.id}
|
|
39
|
+
hideSpeaker={true}
|
|
40
|
+
on={{
|
|
41
|
+
progress: on?.progress
|
|
42
|
+
}} />
|
|
43
|
+
{:else}
|
|
44
|
+
<Image src={model.media.url} />
|
|
45
|
+
{/if}
|
|
46
|
+
<div class="short-video-viewer__information">
|
|
51
47
|
{#if model.heading}
|
|
52
48
|
<div class="short-video-viewer__heading">
|
|
53
49
|
<ShortVideoHeading model={model.heading} localization={localization} />
|
|
@@ -58,6 +54,22 @@ $effect(() => {
|
|
|
58
54
|
<LineClamp value={model.text} maxLines={2} enableShowMore={true} />
|
|
59
55
|
{/if}
|
|
60
56
|
</div>
|
|
57
|
+
{#if uiManager.showAttachments}
|
|
58
|
+
<div class="short-video-viewer__attachments">
|
|
59
|
+
<AttachmentsHorizontal
|
|
60
|
+
model={model}
|
|
61
|
+
on={{
|
|
62
|
+
productClick: on?.productClick,
|
|
63
|
+
productImpression: on?.productImpression
|
|
64
|
+
}} />
|
|
65
|
+
</div>
|
|
66
|
+
{/if}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="short-video-viewer__controls-panel" use:trackControlsPanelSize>
|
|
70
|
+
{#if uiManager.showControls}
|
|
71
|
+
<ShortVideoControls model={model} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: uiManager.toggleEnableAttachments }} />
|
|
72
|
+
{/if}
|
|
61
73
|
</div>
|
|
62
74
|
</div>
|
|
63
75
|
|
|
@@ -77,64 +89,45 @@ $effect(() => {
|
|
|
77
89
|
width: 100%;
|
|
78
90
|
min-width: 100%;
|
|
79
91
|
max-width: 100%;
|
|
80
|
-
height: 100%;
|
|
81
|
-
min-height: 100%;
|
|
82
|
-
max-height: 100%;
|
|
83
|
-
position: relative;
|
|
84
|
-
}
|
|
85
|
-
.short-video-viewer__media {
|
|
86
92
|
height: 100%;
|
|
87
93
|
min-height: 100%;
|
|
88
94
|
max-height: 100%;
|
|
89
95
|
border-radius: 0.375rem;
|
|
90
96
|
overflow: hidden;
|
|
97
|
+
position: relative;
|
|
91
98
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
92
99
|
}
|
|
93
100
|
@container (width < 576px) {
|
|
94
|
-
.short-video-
|
|
101
|
+
.short-video-viewer {
|
|
95
102
|
border-radius: 0;
|
|
96
103
|
position: relative;
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
|
-
.short-video-
|
|
106
|
+
.short-video-viewer__controls-panel {
|
|
100
107
|
position: absolute;
|
|
101
|
-
left:
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
left: auto;
|
|
109
|
+
right: 0.625rem;
|
|
110
|
+
top: 5rem;
|
|
111
|
+
bottom: 6.25rem;
|
|
104
112
|
gap: 2.5rem;
|
|
105
113
|
display: flex;
|
|
106
114
|
flex-direction: column;
|
|
107
115
|
justify-content: flex-end;
|
|
108
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
109
|
-
}
|
|
110
|
-
@container (width < 576px) {
|
|
111
|
-
.short-video-viewer__actions-panel {
|
|
112
|
-
left: auto;
|
|
113
|
-
right: 0.625rem;
|
|
114
|
-
top: 5rem;
|
|
115
|
-
bottom: 5rem;
|
|
116
|
-
align-items: flex-end;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
.short-video-viewer__actions-panel--inside-frame {
|
|
120
|
-
left: auto;
|
|
121
|
-
right: 0.625rem;
|
|
122
|
-
top: 5rem;
|
|
123
|
-
bottom: 5rem;
|
|
124
116
|
align-items: flex-end;
|
|
125
117
|
}
|
|
126
|
-
.short-video-
|
|
118
|
+
.short-video-viewer__information {
|
|
127
119
|
position: absolute;
|
|
128
120
|
bottom: 0;
|
|
129
121
|
left: 0;
|
|
130
122
|
right: 0;
|
|
131
|
-
padding: 1.875rem
|
|
132
|
-
padding-right: calc(1.25rem + var(--_short-video-viewer--button--size));
|
|
123
|
+
padding: 1.875rem 0;
|
|
133
124
|
background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 100%);
|
|
134
|
-
|
|
125
|
+
--_short-video-viewer--information--padding-horizontal: 1.25rem;
|
|
126
|
+
--_short-video-viewer--information--padding-right: calc(1.875rem + var(--_short-video-viewer--controls-panel--width));
|
|
135
127
|
}
|
|
136
128
|
.short-video-viewer__heading {
|
|
137
|
-
--short-video-heading--padding: 0
|
|
129
|
+
--short-video-heading--padding: 0 var(--_short-video-viewer--information--padding-right) 0.875rem
|
|
130
|
+
var(--_short-video-viewer--information--padding-horizontal);
|
|
138
131
|
--short-video-heading--text--color: #ffffff;
|
|
139
132
|
--short-video-heading--meta--color: #ffffff;
|
|
140
133
|
}
|
|
@@ -143,4 +136,9 @@ $effect(() => {
|
|
|
143
136
|
font-size: 1.125rem;
|
|
144
137
|
font-weight: 400;
|
|
145
138
|
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
|
|
139
|
+
padding: 0 var(--_short-video-viewer--information--padding-right) 0 var(--_short-video-viewer--information--padding-horizontal);
|
|
140
|
+
}
|
|
141
|
+
.short-video-viewer__attachments {
|
|
142
|
+
margin-top: 1.25rem;
|
|
143
|
+
--short-video-attachments-horizontal--padding-horizontal: var(--_short-video-viewer--information--padding-horizontal);
|
|
146
144
|
}</style>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
|
|
2
2
|
export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
|
|
3
3
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
4
|
-
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
5
4
|
export type { ShortVideoViewerModel, IPostSocialInteractionsHandler, ShortVideoAdCardModel, ShortVideoProductCardModel } from './types';
|
|
6
5
|
export type { IShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
7
6
|
export type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
|
|
2
2
|
export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
|
|
3
3
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
4
|
-
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
5
4
|
export { mapToShortVideoViewerModel } from './mapper';
|
|
@@ -33,7 +33,7 @@ type PromiseLike<T> = T | Promise<T>;
|
|
|
33
33
|
export type ShortVideoProductCardModel = {
|
|
34
34
|
id: string;
|
|
35
35
|
title: string;
|
|
36
|
-
shortDescription
|
|
36
|
+
shortDescription: string | null;
|
|
37
37
|
link: string | null;
|
|
38
38
|
image: string | null;
|
|
39
39
|
brandName: string | null;
|
|
@@ -2,11 +2,12 @@ export declare class ShortVideoViewerUiManager {
|
|
|
2
2
|
readonly globalCssVariables: string;
|
|
3
3
|
readonly showAttachments: boolean;
|
|
4
4
|
readonly showControls: boolean;
|
|
5
|
-
private
|
|
5
|
+
private controlsPanelWidth;
|
|
6
6
|
private canShowControls;
|
|
7
7
|
private canShowAttachments;
|
|
8
8
|
private enableAttachments;
|
|
9
9
|
updateCanShowAttachments: (value: boolean) => void;
|
|
10
10
|
updateCanShowControls: (value: boolean) => void;
|
|
11
11
|
toggleEnableAttachments: () => void;
|
|
12
|
+
setControlsPanelWidth(value: number): void;
|
|
12
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class ShortVideoViewerUiManager {
|
|
2
2
|
globalCssVariables = $derived.by(() => {
|
|
3
|
-
const values = [`--_short-video-viewer--
|
|
3
|
+
const values = [`--_short-video-viewer--controls-panel--width: ${this.controlsPanelWidth}px`];
|
|
4
4
|
return values.join(';');
|
|
5
5
|
});
|
|
6
6
|
showAttachments = $derived.by(() => {
|
|
@@ -9,7 +9,7 @@ export class ShortVideoViewerUiManager {
|
|
|
9
9
|
showControls = $derived.by(() => {
|
|
10
10
|
return this.canShowControls;
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
controlsPanelWidth = $state(0);
|
|
13
13
|
// is provided from the calling side
|
|
14
14
|
canShowControls = $state(false);
|
|
15
15
|
// is provided from the calling side
|
|
@@ -25,4 +25,7 @@ export class ShortVideoViewerUiManager {
|
|
|
25
25
|
toggleEnableAttachments = () => {
|
|
26
26
|
this.enableAttachments = !this.enableAttachments;
|
|
27
27
|
};
|
|
28
|
+
setControlsPanelWidth(value) {
|
|
29
|
+
this.controlsPanelWidth = value;
|
|
30
|
+
}
|
|
28
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import { slideHorizontally } from '../../core/transitions';
|
|
2
|
-
import { ShortVideoControls, ShortVideoViewerAttachments
|
|
2
|
+
import { ShortVideoControls, ShortVideoViewerAttachments } from '../short-video-viewer';
|
|
3
3
|
import { Icon } from '../../ui/icon';
|
|
4
4
|
import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
5
5
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
@@ -10,50 +10,74 @@ const shortVideo = $derived(buffer.current);
|
|
|
10
10
|
const changeShowAttachments = () => {
|
|
11
11
|
uiManager.showAttachments = !uiManager.showAttachments;
|
|
12
12
|
};
|
|
13
|
+
const trackAttachmentsPanelSize = (node) => {
|
|
14
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
15
|
+
const width = entry.contentRect.width;
|
|
16
|
+
uiManager.setAttachmentsPanelWidth(width);
|
|
17
|
+
});
|
|
18
|
+
resizeObserver.observe(node);
|
|
19
|
+
return {
|
|
20
|
+
destroy() {
|
|
21
|
+
resizeObserver.unobserve(node);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const trackNavigationButtonsSize = (node) => {
|
|
26
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
27
|
+
const width = entry.contentRect.width;
|
|
28
|
+
uiManager.setNavigationButtonsBlockWidth(width);
|
|
29
|
+
});
|
|
30
|
+
resizeObserver.observe(node);
|
|
31
|
+
return {
|
|
32
|
+
destroy() {
|
|
33
|
+
resizeObserver.unobserve(node);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
13
37
|
</script>
|
|
14
38
|
|
|
15
|
-
{#if uiManager.viewInitialized && !uiManager.
|
|
39
|
+
{#if uiManager.viewInitialized && (!uiManager.showShortVideoOverlayAttachments || !uiManager.showShortVideoOverlayControls)}
|
|
16
40
|
<div class="short-videos-player-controls" class:short-videos-player-controls--with-logo={!!playerLogo}>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
41
|
+
{#if !uiManager.showShortVideoOverlayControls}
|
|
42
|
+
<div class="short-videos-player-controls__left">
|
|
43
|
+
{#if shortVideo}
|
|
44
|
+
<div class="short-videos-player-controls__short-video-controls">
|
|
45
|
+
<ShortVideoControls model={shortVideo} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: changeShowAttachments }} />
|
|
46
|
+
</div>
|
|
47
|
+
{/if}
|
|
48
|
+
<div class="short-videos-player-controls__navigation-buttons" use:trackNavigationButtonsSize>
|
|
49
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
50
|
+
<span class="navigation-button__icon">
|
|
51
|
+
<Icon src={IconChevronUp} />
|
|
52
|
+
</span>
|
|
53
|
+
</button>
|
|
54
|
+
<button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
|
|
55
|
+
<span class="navigation-button__icon">
|
|
56
|
+
<Icon src={IconChevronDown} />
|
|
57
|
+
</span>
|
|
58
|
+
</button>
|
|
26
59
|
</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>
|
|
39
60
|
</div>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
{/if}
|
|
62
|
+
|
|
63
|
+
<div class="short-videos-player-controls__right" use:trackAttachmentsPanelSize>
|
|
64
|
+
{#if !uiManager.showShortVideoOverlayAttachments}
|
|
65
|
+
{#if playerLogo}
|
|
66
|
+
<div class="short-videos-player-controls__player-logo">
|
|
67
|
+
<img src={playerLogo} class="short-videos-player-controls__logo-img" alt="Player Logo" />
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
70
|
+
{#if shortVideo?.hasAttachments && uiManager.showAttachments}
|
|
71
|
+
<div class="short-videos-player-controls__short-video-attachments" transition:slideHorizontally|local>
|
|
72
|
+
<ShortVideoViewerAttachments
|
|
73
|
+
shortVideo={shortVideo}
|
|
74
|
+
localization={localization.shortVideoAttachmentsLocalization}
|
|
75
|
+
on={{
|
|
76
|
+
productClick: on.productClick,
|
|
77
|
+
productImpression: on.productImpression
|
|
78
|
+
}} />
|
|
79
|
+
</div>
|
|
80
|
+
{/if}
|
|
57
81
|
{/if}
|
|
58
82
|
</div>
|
|
59
83
|
</div>
|
|
@@ -115,8 +139,7 @@ const changeShowAttachments = () => {
|
|
|
115
139
|
.short-videos-player-controls__right::-webkit-scrollbar {
|
|
116
140
|
width: 3px;
|
|
117
141
|
height: 3px;
|
|
118
|
-
background:
|
|
119
|
-
visibility: hidden;
|
|
142
|
+
background: transparent;
|
|
120
143
|
}
|
|
121
144
|
.short-videos-player-controls__right::-webkit-scrollbar-thumb {
|
|
122
145
|
background: transparent;
|
|
@@ -129,12 +152,11 @@ const changeShowAttachments = () => {
|
|
|
129
152
|
width: 3px;
|
|
130
153
|
height: 3px;
|
|
131
154
|
background: var(--custom-scrollbar-background, transparent);
|
|
132
|
-
visibility: hidden;
|
|
133
155
|
}
|
|
134
156
|
.short-videos-player-controls__right:hover::-webkit-scrollbar-thumb {
|
|
135
157
|
background: var(--custom-scrollbar-color, #7d7d7d);
|
|
136
158
|
}
|
|
137
|
-
.short-videos-player-controls__short-video-
|
|
159
|
+
.short-videos-player-controls__short-video-controls {
|
|
138
160
|
gap: 2.5rem;
|
|
139
161
|
display: flex;
|
|
140
162
|
flex: 1;
|
|
@@ -142,50 +164,29 @@ const changeShowAttachments = () => {
|
|
|
142
164
|
flex-direction: column;
|
|
143
165
|
align-items: flex-start;
|
|
144
166
|
justify-content: flex-end;
|
|
145
|
-
--short-video-controls--icon--size:
|
|
167
|
+
--short-video-controls--icon--size: 1.75rem;
|
|
146
168
|
}
|
|
147
169
|
.short-videos-player-controls__player-logo {
|
|
148
|
-
width:
|
|
149
|
-
max-width:
|
|
170
|
+
width: var(--short-videos-player--controls--attachments--max-width);
|
|
171
|
+
max-width: var(--short-videos-player--controls--attachments--max-width);
|
|
150
172
|
height: var(--short-videos-player--media-center-header--height);
|
|
151
173
|
min-height: var(--short-videos-player--media-center-header--height);
|
|
152
174
|
max-height: var(--short-videos-player--media-center-header--height);
|
|
153
175
|
display: flex;
|
|
154
176
|
justify-content: center;
|
|
155
177
|
align-items: center;
|
|
156
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
157
|
-
}
|
|
158
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
159
|
-
.short-videos-player-controls__player-logo {
|
|
160
|
-
display: none;
|
|
161
|
-
}
|
|
162
178
|
}
|
|
163
179
|
.short-videos-player-controls__logo-img {
|
|
164
180
|
width: 6.25rem;
|
|
165
181
|
min-width: 6.25rem;
|
|
166
182
|
max-width: 6.25rem;
|
|
167
183
|
}
|
|
168
|
-
.short-videos-player-controls__short-video-attachments-inline {
|
|
169
|
-
display: none;
|
|
170
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
171
|
-
}
|
|
172
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
173
|
-
.short-videos-player-controls__short-video-attachments-inline {
|
|
174
|
-
display: contents;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
184
|
.short-videos-player-controls__short-video-attachments {
|
|
178
185
|
flex: 1;
|
|
179
|
-
width:
|
|
180
|
-
max-width:
|
|
186
|
+
width: var(--short-videos-player--controls--attachments--max-width);
|
|
187
|
+
max-width: var(--short-videos-player--controls--attachments--max-width);
|
|
181
188
|
opacity: var(--short-videos-player--elements-opacity);
|
|
182
189
|
transition: opacity 0.3s ease-in-out;
|
|
183
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
184
|
-
}
|
|
185
|
-
@container (width < calc(11rem + 3.75rem)) {
|
|
186
|
-
.short-videos-player-controls__short-video-attachments {
|
|
187
|
-
display: none;
|
|
188
|
-
}
|
|
189
190
|
}
|
|
190
191
|
.short-videos-player-controls__navigation-buttons {
|
|
191
192
|
display: flex;
|
|
@@ -196,18 +197,18 @@ const changeShowAttachments = () => {
|
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
.close-button {
|
|
199
|
-
width:
|
|
200
|
-
min-width:
|
|
201
|
-
max-width:
|
|
202
|
-
height:
|
|
203
|
-
min-height:
|
|
204
|
-
max-height:
|
|
200
|
+
width: 3rem;
|
|
201
|
+
min-width: 3rem;
|
|
202
|
+
max-width: 3rem;
|
|
203
|
+
height: 3rem;
|
|
204
|
+
min-height: 3rem;
|
|
205
|
+
max-height: 3rem;
|
|
205
206
|
background-color: rgba(0, 0, 0, 0.6);
|
|
206
207
|
border: 1px solid #1c1c1c;
|
|
207
208
|
border-radius: 50%;
|
|
208
209
|
text-align: center;
|
|
209
210
|
--icon--color: #ffffff;
|
|
210
|
-
--icon--size:
|
|
211
|
+
--icon--size: 1.75rem;
|
|
211
212
|
position: absolute;
|
|
212
213
|
top: 0.9375rem;
|
|
213
214
|
left: 0.625rem;
|
|
@@ -231,18 +232,18 @@ const changeShowAttachments = () => {
|
|
|
231
232
|
|
|
232
233
|
.navigation-button {
|
|
233
234
|
--_icon-scale: 1;
|
|
234
|
-
width:
|
|
235
|
-
min-width:
|
|
236
|
-
max-width:
|
|
237
|
-
height:
|
|
238
|
-
min-height:
|
|
239
|
-
max-height:
|
|
235
|
+
width: 3rem;
|
|
236
|
+
min-width: 3rem;
|
|
237
|
+
max-width: 3rem;
|
|
238
|
+
height: 3rem;
|
|
239
|
+
min-height: 3rem;
|
|
240
|
+
max-height: 3rem;
|
|
240
241
|
background-color: rgba(0, 0, 0, 0.6);
|
|
241
242
|
border: 1px solid #1c1c1c;
|
|
242
243
|
border-radius: 50%;
|
|
243
244
|
text-align: center;
|
|
244
245
|
--icon--color: #ffffff;
|
|
245
|
-
--icon--size:
|
|
246
|
+
--icon--size: 1.75rem;
|
|
246
247
|
}
|
|
247
248
|
.navigation-button:disabled {
|
|
248
249
|
opacity: 0.5;
|
|
@@ -135,8 +135,8 @@ const onShortVideoProductImpression = (productId, videoId) => {
|
|
|
135
135
|
model={item}
|
|
136
136
|
socialInteractionsHandler={socialInteractionsHandler}
|
|
137
137
|
autoplay="on-appearance"
|
|
138
|
-
showAttachments={uiManager.
|
|
139
|
-
showControls={uiManager.
|
|
138
|
+
showAttachments={uiManager.showShortVideoOverlayAttachments}
|
|
139
|
+
showControls={uiManager.showShortVideoOverlayControls}
|
|
140
140
|
localization={localization.shortVideoViewerLocalization}
|
|
141
141
|
on={{
|
|
142
142
|
productClick: (productId) => onShortVideoProductClick(productId, item.id),
|
|
@@ -3,10 +3,15 @@ export declare class ShortVideosPlayerUiManager {
|
|
|
3
3
|
globalCssVariables: string;
|
|
4
4
|
isMobileView: boolean;
|
|
5
5
|
viewInitialized: boolean;
|
|
6
|
-
|
|
6
|
+
showShortVideoOverlayAttachments: boolean;
|
|
7
|
+
showShortVideoOverlayControls: boolean;
|
|
7
8
|
private _viewTotalWidth;
|
|
8
9
|
private _mainViewColumnWidth;
|
|
9
10
|
private _mediaCenterHeaderHeight;
|
|
11
|
+
private _controlsAttachmentsPanelWidth;
|
|
12
|
+
private _controlsNavigationButtonsWidth;
|
|
13
|
+
private _controlsAvailableSpace;
|
|
14
|
+
private _controlsContentWidth;
|
|
10
15
|
get viewTotalWidth(): number;
|
|
11
16
|
get mainViewColumnWidth(): number;
|
|
12
17
|
updateDimensions: (dimensions: {
|
|
@@ -14,4 +19,6 @@ export declare class ShortVideosPlayerUiManager {
|
|
|
14
19
|
mainViewColumnWidth: number;
|
|
15
20
|
}) => void;
|
|
16
21
|
updateMediaCenterHeaderHeight: (height: number) => void;
|
|
22
|
+
setAttachmentsPanelWidth: (width: number) => void;
|
|
23
|
+
setNavigationButtonsBlockWidth: (width: number) => void;
|
|
17
24
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
const CONTROLS_PADDING_HORIZONTAL = 28;
|
|
2
2
|
const CONTROLS_PADDING_VERTICAL = 28;
|
|
3
|
+
const CONTROLS_ATTACHMENTS_MAX_WIDTH = 176;
|
|
3
4
|
const PLAYER_PADDING_VERTICAL = 10;
|
|
4
|
-
const BUTTON_SIZE = 48;
|
|
5
|
-
const ICON_SIZE = 28;
|
|
6
5
|
export class ShortVideosPlayerUiManager {
|
|
7
6
|
showAttachments = $state(true);
|
|
8
7
|
globalCssVariables = $derived.by(() => {
|
|
9
8
|
const values = [
|
|
10
|
-
`--short-videos-player--
|
|
11
|
-
`--short-videos-player--controls--available-space: ${
|
|
9
|
+
`--short-videos-player--controls--attachments--max-width: ${CONTROLS_ATTACHMENTS_MAX_WIDTH}px`,
|
|
10
|
+
`--short-videos-player--controls--available-space: ${this._controlsAvailableSpace}px`,
|
|
12
11
|
`--short-videos-player--controls--padding: ${this._mediaCenterHeaderHeight ? 0 : CONTROLS_PADDING_VERTICAL}px ${CONTROLS_PADDING_HORIZONTAL}px ${CONTROLS_PADDING_VERTICAL}px`,
|
|
13
|
-
`--short-videos-player--icon--size: ${ICON_SIZE}px`,
|
|
14
12
|
`--short-videos-player--media-center-header--height: ${this._mediaCenterHeaderHeight || 72}px`,
|
|
15
13
|
`--short-videos-player--padding: ${this._mediaCenterHeaderHeight ? this._mediaCenterHeaderHeight : PLAYER_PADDING_VERTICAL}px 0 ${PLAYER_PADDING_VERTICAL}px`
|
|
16
14
|
];
|
|
@@ -18,10 +16,15 @@ export class ShortVideosPlayerUiManager {
|
|
|
18
16
|
});
|
|
19
17
|
isMobileView = $derived.by(() => this._viewTotalWidth <= 576);
|
|
20
18
|
viewInitialized = $derived.by(() => !!this._viewTotalWidth && !!this._mainViewColumnWidth);
|
|
21
|
-
|
|
19
|
+
showShortVideoOverlayAttachments = $derived.by(() => this.viewInitialized && this._controlsAttachmentsPanelWidth < CONTROLS_ATTACHMENTS_MAX_WIDTH + 10);
|
|
20
|
+
showShortVideoOverlayControls = $derived.by(() => this.viewInitialized && this._controlsContentWidth < this._controlsNavigationButtonsWidth);
|
|
22
21
|
_viewTotalWidth = $state(0);
|
|
23
22
|
_mainViewColumnWidth = $state(0);
|
|
24
23
|
_mediaCenterHeaderHeight = $state(0);
|
|
24
|
+
_controlsAttachmentsPanelWidth = $state(0);
|
|
25
|
+
_controlsNavigationButtonsWidth = $state(0);
|
|
26
|
+
_controlsAvailableSpace = $derived.by(() => (this._viewTotalWidth - this._mainViewColumnWidth) / 2);
|
|
27
|
+
_controlsContentWidth = $derived.by(() => this._controlsAvailableSpace - CONTROLS_PADDING_HORIZONTAL * 2);
|
|
25
28
|
get viewTotalWidth() {
|
|
26
29
|
return this._viewTotalWidth;
|
|
27
30
|
}
|
|
@@ -35,4 +38,10 @@ export class ShortVideosPlayerUiManager {
|
|
|
35
38
|
updateMediaCenterHeaderHeight = (height) => {
|
|
36
39
|
this._mediaCenterHeaderHeight = height;
|
|
37
40
|
};
|
|
41
|
+
setAttachmentsPanelWidth = (width) => {
|
|
42
|
+
this._controlsAttachmentsPanelWidth = width;
|
|
43
|
+
};
|
|
44
|
+
setNavigationButtonsBlockWidth = (width) => {
|
|
45
|
+
this._controlsNavigationButtonsWidth = width;
|
|
46
|
+
};
|
|
38
47
|
}
|
|
@@ -22,21 +22,23 @@ const lineHeight = 1.2;
|
|
|
22
22
|
const elementHeight = $derived(adjustedHeight);
|
|
23
23
|
const priceHeight = $derived(model.stock ? elementHeight * 0.68 : elementHeight);
|
|
24
24
|
const adjustableHeight = $derived(!!(on === null || on === void 0 ? void 0 : on.heightAdjusted));
|
|
25
|
-
const
|
|
25
|
+
const priceOptions = $derived({
|
|
26
|
+
currencyMode: model.includeCurrency ? 'symbol' : 'none'
|
|
27
|
+
});
|
|
26
28
|
const currentPrice = $derived.by(() => {
|
|
27
29
|
if (data.salePrice) {
|
|
28
|
-
return toPriceRepresentation({ amount: data.salePrice, currency: data.currency,
|
|
30
|
+
return toPriceRepresentation({ amount: data.salePrice, currency: data.currency, options: priceOptions });
|
|
29
31
|
}
|
|
30
|
-
return toPriceRepresentation({ amount: data.price, currency: data.currency,
|
|
32
|
+
return toPriceRepresentation({ amount: data.price, currency: data.currency, options: priceOptions });
|
|
31
33
|
});
|
|
32
34
|
const saveValue = $derived.by(() => {
|
|
33
35
|
if (data.salePrice) {
|
|
34
|
-
return toPriceRepresentation({ amount: data.price - data.salePrice, currency: data.currency,
|
|
36
|
+
return toPriceRepresentation({ amount: data.price - data.salePrice, currency: data.currency, options: priceOptions });
|
|
35
37
|
}
|
|
36
38
|
return 0;
|
|
37
39
|
});
|
|
38
40
|
const beforeValue = $derived.by(() => {
|
|
39
|
-
return toPriceRepresentation({ amount: data.price, currency: data.currency,
|
|
41
|
+
return toPriceRepresentation({ amount: data.price, currency: data.currency, options: priceOptions });
|
|
40
42
|
});
|
|
41
43
|
const elementContainerStyles = $derived.by(() => {
|
|
42
44
|
var _a, _b;
|
|
@@ -36,8 +36,8 @@ export type StreamLayoutShortVideoProductModel = {
|
|
|
36
36
|
price: number;
|
|
37
37
|
currency: Currency;
|
|
38
38
|
salePrice: number | null;
|
|
39
|
-
brand
|
|
40
|
-
name
|
|
41
|
-
};
|
|
42
|
-
shortDescription
|
|
39
|
+
brand: {
|
|
40
|
+
name: string;
|
|
41
|
+
} | null;
|
|
42
|
+
shortDescription: string | null;
|
|
43
43
|
};
|