@streamscloud/embeddable 15.0.0-rc.1 → 15.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/external-api/data-providers/internal-media-center-analytics-handler.js +5 -5
- package/dist/external-api/data-providers/internal-post-analytics-handler.js +2 -2
- package/dist/external-api/data-providers/internal-stream-analytics-handler.js +5 -5
- package/dist/media-center/media-center/discover/discover-view-handler.svelte.js +1 -1
- package/dist/media-center/media-center/handlers/media-center-settings-handler.svelte.d.ts +12 -5
- package/dist/media-center/media-center/handlers/media-center-settings-handler.svelte.js +17 -5
- package/dist/media-center/media-center/header/media-center-header-mobile.svelte +4 -2
- package/dist/media-center/media-center/header/media-center-header.svelte +4 -2
- package/dist/media-center/media-center/media-center-view.svelte +7 -3
- package/dist/media-center/media-center/menu/menu.svelte +1 -1
- package/dist/posts/post-viewer/attachments-horizontal.svelte +15 -6
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +4 -1
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +2 -0
- package/dist/posts/post-viewer/heading.svelte +6 -4
- package/dist/posts/post-viewer/media/post-media.svelte +5 -1
- package/dist/posts/post-viewer/post-texts.svelte +4 -2
- package/dist/streams/layout/cmp.layout.svelte +4 -1
- package/dist/streams/layout/cmp.layout.svelte.d.ts +1 -0
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +3 -2
- package/dist/streams/layout/element-views/price-element-view.svelte +5 -5
- package/dist/streams/layout/styles-transformer.d.ts +2 -1
- package/dist/streams/layout/styles-transformer.js +15 -9
- package/dist/streams/layout/styles.d.ts +1 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +2 -2
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +2 -0
- package/dist/streams/streams-player/streams-player-view.svelte +163 -46
- package/dist/streams/streams-player/types.d.ts +1 -0
- package/dist/ui/player/progress/cmp.chunks-progress.svelte +60 -0
- package/dist/ui/player/progress/cmp.chunks-progress.svelte.d.ts +9 -0
- package/dist/ui/player/progress/index.d.ts +1 -0
- package/dist/ui/player/progress/index.js +1 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunks-manager.svelte.js +2 -2
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte +0 -13
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@ export class InternalMediaCenterAnalyticsHandler {
|
|
|
36
36
|
eventType: EventType.Viewed,
|
|
37
37
|
relatedEntities: [
|
|
38
38
|
{
|
|
39
|
-
relationType: EntityRelationType.
|
|
39
|
+
relationType: EntityRelationType.NestedIn,
|
|
40
40
|
entity: {
|
|
41
41
|
type: EntityType.Stream,
|
|
42
42
|
id: streamId
|
|
@@ -68,7 +68,7 @@ export class InternalMediaCenterAnalyticsHandler {
|
|
|
68
68
|
eventType: EventType.Appeared,
|
|
69
69
|
relatedEntities: [
|
|
70
70
|
{
|
|
71
|
-
relationType: EntityRelationType.
|
|
71
|
+
relationType: EntityRelationType.NestedIn,
|
|
72
72
|
entity: {
|
|
73
73
|
type: EntityType.Stream,
|
|
74
74
|
id: streamId
|
|
@@ -84,7 +84,7 @@ export class InternalMediaCenterAnalyticsHandler {
|
|
|
84
84
|
eventType: EventType.Clicked,
|
|
85
85
|
relatedEntities: [
|
|
86
86
|
{
|
|
87
|
-
relationType: EntityRelationType.
|
|
87
|
+
relationType: EntityRelationType.NestedIn,
|
|
88
88
|
entity: {
|
|
89
89
|
type: EntityType.Stream,
|
|
90
90
|
id: streamId
|
|
@@ -117,7 +117,7 @@ export class InternalMediaCenterAnalyticsHandler {
|
|
|
117
117
|
eventType: EventType.Appeared,
|
|
118
118
|
relatedEntities: [
|
|
119
119
|
{
|
|
120
|
-
relationType: EntityRelationType.
|
|
120
|
+
relationType: EntityRelationType.NestedIn,
|
|
121
121
|
entity: {
|
|
122
122
|
type: EntityType.ShortVideo,
|
|
123
123
|
id: videoId
|
|
@@ -133,7 +133,7 @@ export class InternalMediaCenterAnalyticsHandler {
|
|
|
133
133
|
eventType: EventType.Clicked,
|
|
134
134
|
relatedEntities: [
|
|
135
135
|
{
|
|
136
|
-
relationType: EntityRelationType.
|
|
136
|
+
relationType: EntityRelationType.NestedIn,
|
|
137
137
|
entity: {
|
|
138
138
|
type: EntityType.ShortVideo,
|
|
139
139
|
id: videoId
|
|
@@ -36,7 +36,7 @@ export class InternalPostAnalyticsHandler {
|
|
|
36
36
|
eventType: EventType.Appeared,
|
|
37
37
|
relatedEntities: [
|
|
38
38
|
{
|
|
39
|
-
relationType: EntityRelationType.
|
|
39
|
+
relationType: EntityRelationType.NestedIn,
|
|
40
40
|
entity: {
|
|
41
41
|
type: EntityType.ShortVideo,
|
|
42
42
|
id: videoId
|
|
@@ -52,7 +52,7 @@ export class InternalPostAnalyticsHandler {
|
|
|
52
52
|
eventType: EventType.Clicked,
|
|
53
53
|
relatedEntities: [
|
|
54
54
|
{
|
|
55
|
-
relationType: EntityRelationType.
|
|
55
|
+
relationType: EntityRelationType.NestedIn,
|
|
56
56
|
entity: {
|
|
57
57
|
type: EntityType.ShortVideo,
|
|
58
58
|
id: videoId
|
|
@@ -28,7 +28,7 @@ export class InternalStreamAnalyticsHandler {
|
|
|
28
28
|
eventType: EventType.Viewed,
|
|
29
29
|
relatedEntities: [
|
|
30
30
|
{
|
|
31
|
-
relationType: EntityRelationType.
|
|
31
|
+
relationType: EntityRelationType.NestedIn,
|
|
32
32
|
entity: {
|
|
33
33
|
type: EntityType.Stream,
|
|
34
34
|
id: streamId
|
|
@@ -60,7 +60,7 @@ export class InternalStreamAnalyticsHandler {
|
|
|
60
60
|
eventType: EventType.Appeared,
|
|
61
61
|
relatedEntities: [
|
|
62
62
|
{
|
|
63
|
-
relationType: EntityRelationType.
|
|
63
|
+
relationType: EntityRelationType.NestedIn,
|
|
64
64
|
entity: {
|
|
65
65
|
type: EntityType.Stream,
|
|
66
66
|
id: streamId
|
|
@@ -76,7 +76,7 @@ export class InternalStreamAnalyticsHandler {
|
|
|
76
76
|
eventType: EventType.Clicked,
|
|
77
77
|
relatedEntities: [
|
|
78
78
|
{
|
|
79
|
-
relationType: EntityRelationType.
|
|
79
|
+
relationType: EntityRelationType.NestedIn,
|
|
80
80
|
entity: {
|
|
81
81
|
type: EntityType.Stream,
|
|
82
82
|
id: streamId
|
|
@@ -109,7 +109,7 @@ export class InternalStreamAnalyticsHandler {
|
|
|
109
109
|
eventType: EventType.Appeared,
|
|
110
110
|
relatedEntities: [
|
|
111
111
|
{
|
|
112
|
-
relationType: EntityRelationType.
|
|
112
|
+
relationType: EntityRelationType.NestedIn,
|
|
113
113
|
entity: {
|
|
114
114
|
type: EntityType.ShortVideo,
|
|
115
115
|
id: videoId
|
|
@@ -125,7 +125,7 @@ export class InternalStreamAnalyticsHandler {
|
|
|
125
125
|
eventType: EventType.Clicked,
|
|
126
126
|
relatedEntities: [
|
|
127
127
|
{
|
|
128
|
-
relationType: EntityRelationType.
|
|
128
|
+
relationType: EntityRelationType.NestedIn,
|
|
129
129
|
entity: {
|
|
130
130
|
type: EntityType.ShortVideo,
|
|
131
131
|
id: videoId
|
|
@@ -12,11 +12,7 @@ export declare class MediaCenterSettingsHandler {
|
|
|
12
12
|
readonly dataProvider: IMediaCenterDataProvider;
|
|
13
13
|
settings: MediaCenterSettings;
|
|
14
14
|
});
|
|
15
|
-
get playerSettings():
|
|
16
|
-
locale?: Locale;
|
|
17
|
-
showStreamsCloudWatermark?: boolean;
|
|
18
|
-
playerColors?: Record<ThemeValue, PlayerColors>;
|
|
19
|
-
};
|
|
15
|
+
get playerSettings(): ContentPlayerSettingsLocal;
|
|
20
16
|
get actualMediaCenterColors(): PlayerColors;
|
|
21
17
|
get locale(): Locale;
|
|
22
18
|
get backgroundWrapperProps(): {
|
|
@@ -25,8 +21,19 @@ export declare class MediaCenterSettingsHandler {
|
|
|
25
21
|
backgroundColor?: string | null;
|
|
26
22
|
};
|
|
27
23
|
get backgroundImageLoadedHandler(): ((url: string | null) => void) | undefined;
|
|
24
|
+
setMinOverlayOffsetTop: (value: number) => void;
|
|
28
25
|
updateBackgroundImageUrl: (url: string | null | "not-applicable") => void;
|
|
29
26
|
}
|
|
30
27
|
export type MediaCenterSettingsWithColors = MediaCenterSettings & {
|
|
31
28
|
playerColors?: PlayerColors;
|
|
32
29
|
};
|
|
30
|
+
declare class ContentPlayerSettingsLocal {
|
|
31
|
+
private settings;
|
|
32
|
+
private dataProvider;
|
|
33
|
+
locale?: Locale;
|
|
34
|
+
showStreamsCloudWatermark?: boolean;
|
|
35
|
+
playerColors?: Record<ThemeValue, PlayerColors>;
|
|
36
|
+
overlayMinOffsetTop?: number;
|
|
37
|
+
constructor(settings: MediaCenterSettings, dataProvider: IMediaCenterDataProvider);
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -4,14 +4,11 @@ export class MediaCenterSettingsHandler {
|
|
|
4
4
|
_backgroundImageUrl = $state(null);
|
|
5
5
|
_mediaCenterSettings;
|
|
6
6
|
_dataProvider;
|
|
7
|
-
_contentPlayerSettings
|
|
8
|
-
locale: this._mediaCenterSettings.locale,
|
|
9
|
-
playerColors: this._dataProvider.model?.playerColors,
|
|
10
|
-
showStreamsCloudWatermark: this._mediaCenterSettings.showStreamsCloudWatermark
|
|
11
|
-
}));
|
|
7
|
+
_contentPlayerSettings;
|
|
12
8
|
constructor(init) {
|
|
13
9
|
this._mediaCenterSettings = init.settings;
|
|
14
10
|
this._dataProvider = init.dataProvider;
|
|
11
|
+
this._contentPlayerSettings = new ContentPlayerSettingsLocal(this._mediaCenterSettings, this._dataProvider);
|
|
15
12
|
}
|
|
16
13
|
get playerSettings() {
|
|
17
14
|
return this._contentPlayerSettings;
|
|
@@ -32,7 +29,22 @@ export class MediaCenterSettingsHandler {
|
|
|
32
29
|
get backgroundImageLoadedHandler() {
|
|
33
30
|
return this._mediaCenterSettings.disableBackground ? undefined : (url) => this.updateBackgroundImageUrl(url);
|
|
34
31
|
}
|
|
32
|
+
setMinOverlayOffsetTop = (value) => {
|
|
33
|
+
this._contentPlayerSettings.overlayMinOffsetTop = value;
|
|
34
|
+
};
|
|
35
35
|
updateBackgroundImageUrl = (url) => {
|
|
36
36
|
this._backgroundImageUrl = url;
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
class ContentPlayerSettingsLocal {
|
|
40
|
+
settings;
|
|
41
|
+
dataProvider;
|
|
42
|
+
locale = $derived.by(() => this.settings.locale);
|
|
43
|
+
showStreamsCloudWatermark = $derived.by(() => this.settings.showStreamsCloudWatermark);
|
|
44
|
+
playerColors = $derived.by(() => this.dataProvider.model?.playerColors);
|
|
45
|
+
overlayMinOffsetTop = $state(0);
|
|
46
|
+
constructor(settings, dataProvider) {
|
|
47
|
+
this.settings = settings;
|
|
48
|
+
this.dataProvider = dataProvider;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -6,13 +6,15 @@ let { context, locale = 'en', on } = $props();
|
|
|
6
6
|
const localization = $derived(new MediaCenterHeaderLocalization(locale));
|
|
7
7
|
const headerMounted = (node) => {
|
|
8
8
|
const heightResizeObserver = new ResizeObserver(() => {
|
|
9
|
+
var _a;
|
|
9
10
|
const headerHeight = node.clientHeight;
|
|
10
|
-
on.headerHeightChanged(headerHeight);
|
|
11
|
+
(_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, headerHeight);
|
|
11
12
|
});
|
|
12
13
|
heightResizeObserver.observe(node);
|
|
13
14
|
return {
|
|
14
15
|
destroy: () => {
|
|
15
|
-
|
|
16
|
+
var _a;
|
|
17
|
+
(_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, 0);
|
|
16
18
|
heightResizeObserver.disconnect();
|
|
17
19
|
}
|
|
18
20
|
};
|
|
@@ -19,14 +19,16 @@ let scrollAreaRef = $state(null);
|
|
|
19
19
|
const headerMounted = (node) => {
|
|
20
20
|
headerRef = node;
|
|
21
21
|
const heightResizeObserver = new ResizeObserver(() => {
|
|
22
|
+
var _a;
|
|
22
23
|
const headerHeight = node.clientHeight;
|
|
23
|
-
on.headerHeightChanged(headerHeight);
|
|
24
|
+
(_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, headerHeight);
|
|
24
25
|
calcHeaderGridProportions();
|
|
25
26
|
});
|
|
26
27
|
heightResizeObserver.observe(node);
|
|
27
28
|
return {
|
|
28
29
|
destroy: () => {
|
|
29
|
-
|
|
30
|
+
var _a;
|
|
31
|
+
(_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, 0);
|
|
30
32
|
heightResizeObserver.disconnect();
|
|
31
33
|
}
|
|
32
34
|
};
|
|
@@ -69,9 +69,13 @@ const activateSelectedStreamPlayer = (stream, categoryId) => {
|
|
|
69
69
|
const activateSelectedStreamOfCategoryPlayer = (id, prefetchedStreams, categoryId) => {
|
|
70
70
|
context.playStreamsFeed({ filter: { categoryId }, init: { prefetchedStreams, initialStreamId: id } });
|
|
71
71
|
};
|
|
72
|
-
const
|
|
72
|
+
const onDesktopHeaderHeightChanged = (height) => {
|
|
73
73
|
headerHeight = height;
|
|
74
74
|
};
|
|
75
|
+
const onMobileHeaderHeightChanged = (height) => {
|
|
76
|
+
headerHeight = height;
|
|
77
|
+
context.settingsHandler.setMinOverlayOffsetTop(height);
|
|
78
|
+
};
|
|
75
79
|
const onWidthAnchorMounted = (node) => {
|
|
76
80
|
const resizeObserver = new ResizeObserver(() => {
|
|
77
81
|
isMobileView = node.clientWidth <= 576;
|
|
@@ -142,9 +146,9 @@ const swipeToOpen = (node) => {
|
|
|
142
146
|
<div class="media-center" use:onWidthAnchorMounted>
|
|
143
147
|
<div class="media-center__header-and-content">
|
|
144
148
|
{#if !isMobileView}
|
|
145
|
-
<MediaCenterHeader context={context} dynamicActions={dynamicActions} on={{ headerHeightChanged:
|
|
149
|
+
<MediaCenterHeader context={context} dynamicActions={dynamicActions} on={{ headerHeightChanged: onDesktopHeaderHeightChanged }} />
|
|
146
150
|
{:else}
|
|
147
|
-
<MediaCenterHeaderMobile context={context} on={{ headerHeightChanged:
|
|
151
|
+
<MediaCenterHeaderMobile context={context} on={{ headerHeightChanged: onMobileHeaderHeightChanged }} />
|
|
148
152
|
{/if}
|
|
149
153
|
|
|
150
154
|
<div class="media-center__content-container" use:swipeToOpen>
|
|
@@ -109,14 +109,13 @@ const variables = $derived.by(() => {
|
|
|
109
109
|
<div
|
|
110
110
|
class="attachments-horizontal__item"
|
|
111
111
|
class:attachments-horizontal__item--single={attachmentsToShow.length === 1}
|
|
112
|
-
data-theme={attachment.isAd ? 'default' : 'dark'}
|
|
113
112
|
onclick={() => handleAttachmentClick(attachment)}
|
|
114
113
|
onkeydown={() => {}}
|
|
115
114
|
role="none"
|
|
116
115
|
bind:this={attachmentElements[attachment.productId ? `product-${attachment.productId}` : `ad-${attachment.adId}`]}
|
|
117
116
|
data-product-id={attachment.productId || undefined}
|
|
118
117
|
data-ad-id={attachment.adId || undefined}>
|
|
119
|
-
<div class="attachments-card" class:attachments-card--single={attachmentsToShow.length === 1}>
|
|
118
|
+
<div class="attachments-card" class:attachments-card--single={attachmentsToShow.length === 1} class:attachments-card--dark={!attachment.isAd}>
|
|
120
119
|
<div class="attachments-card__thumb">
|
|
121
120
|
<ImageRounded src={attachment.image} alt="" noBorders={true} />
|
|
122
121
|
</div>
|
|
@@ -187,17 +186,27 @@ const variables = $derived.by(() => {
|
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
.attachments-card {
|
|
189
|
+
--_attachments-card--background-color: #ffffff;
|
|
190
|
+
--_attachments-card--border-color: #f2f2f2;
|
|
191
|
+
--_attachments-card--text--color: #000000;
|
|
192
|
+
--_attachments-card--text--secondary--color: #6b7280;
|
|
190
193
|
display: grid;
|
|
191
194
|
grid-template-columns: 2.375rem 1fr;
|
|
192
195
|
grid-column-gap: 0.75rem;
|
|
193
196
|
align-items: center;
|
|
194
197
|
width: 15.625rem;
|
|
195
198
|
padding: 0.375rem;
|
|
196
|
-
background-color: rgb(from var(--
|
|
197
|
-
color: var(--
|
|
198
|
-
border: 0.0625rem solid var(--
|
|
199
|
+
background-color: rgb(from var(--_attachments-card--background-color) r g b/90%);
|
|
200
|
+
color: var(--_attachments-card--text--color);
|
|
201
|
+
border: 0.0625rem solid var(--_attachments-card--border-color);
|
|
199
202
|
border-radius: 0.25rem;
|
|
200
203
|
}
|
|
204
|
+
.attachments-card--dark {
|
|
205
|
+
--_attachments-card--background-color: #000000;
|
|
206
|
+
--_attachments-card--border-color: #000000;
|
|
207
|
+
--_attachments-card--text--color: #ffffff;
|
|
208
|
+
--_attachments-card--text--secondary--color: #d1d5db;
|
|
209
|
+
}
|
|
201
210
|
.attachments-card--single {
|
|
202
211
|
width: 100%;
|
|
203
212
|
}
|
|
@@ -222,7 +231,7 @@ const variables = $derived.by(() => {
|
|
|
222
231
|
}
|
|
223
232
|
.attachments-card__extra-info {
|
|
224
233
|
font-size: 0.625rem;
|
|
225
|
-
color: var(--
|
|
234
|
+
color: var(--_attachments-card--text--secondary--color);
|
|
226
235
|
white-space: nowrap;
|
|
227
236
|
overflow: hidden;
|
|
228
237
|
text-overflow: ellipsis;
|
|
@@ -7,7 +7,7 @@ import { default as PostMedia } from './media/post-media.svelte';
|
|
|
7
7
|
import { default as Texts } from './post-texts.svelte';
|
|
8
8
|
import { PostViewerLocalization } from './post-viewer-localization';
|
|
9
9
|
import { PostViewerUiManager } from './ui-manager.svelte';
|
|
10
|
-
let { model, trackingParams: externalTrackingParams, controlsColors = null, enableAttachments = true, controlActions, enableControls = true, autoplay = 'on-appearance', locale = 'en', on } = $props();
|
|
10
|
+
let { model, trackingParams: externalTrackingParams, controlsColors = null, enableAttachments = true, controlActions, enableControls = true, autoplay = 'on-appearance', locale = 'en', on, overlay } = $props();
|
|
11
11
|
const localization = $derived(new PostViewerLocalization(locale));
|
|
12
12
|
const uiManager = new PostViewerUiManager();
|
|
13
13
|
$effect(() => {
|
|
@@ -88,6 +88,9 @@ const variables = $derived.by(() => {
|
|
|
88
88
|
scaleEffect={true} />
|
|
89
89
|
</div>
|
|
90
90
|
{/if}
|
|
91
|
+
{#if overlay}
|
|
92
|
+
{@render overlay()}
|
|
93
|
+
{/if}
|
|
91
94
|
</div>
|
|
92
95
|
|
|
93
96
|
<style>@keyframes fadeIn {
|
|
@@ -2,6 +2,7 @@ import type { Locale } from '../../core/locale';
|
|
|
2
2
|
import type { TrackingParams } from '../../marketing-tracking';
|
|
3
3
|
import { PostModel } from '../model';
|
|
4
4
|
import { type PlayerButtonDef } from '../../ui/player/button';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
5
6
|
type Props = {
|
|
6
7
|
model: PostModel;
|
|
7
8
|
trackingParams: TrackingParams | null;
|
|
@@ -21,6 +22,7 @@ type Props = {
|
|
|
21
22
|
adClick?: (adId: string) => void;
|
|
22
23
|
adImpression?: (adId: string) => void;
|
|
23
24
|
};
|
|
25
|
+
overlay?: Snippet;
|
|
24
26
|
};
|
|
25
27
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
26
28
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -41,6 +41,8 @@ const variables = $derived.by(() => {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
.post-viewer-heading {
|
|
44
|
+
--_post-viewer-heading-texts--color: #ffffff;
|
|
45
|
+
--_post-viewer-heading--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);
|
|
44
46
|
display: flex;
|
|
45
47
|
align-items: center;
|
|
46
48
|
padding: var(--_post-viewer--heading--padding);
|
|
@@ -67,8 +69,8 @@ const variables = $derived.by(() => {
|
|
|
67
69
|
font-size: 0.75rem;
|
|
68
70
|
line-height: 0.9375rem;
|
|
69
71
|
font-weight: 500;
|
|
70
|
-
color: var(--
|
|
71
|
-
text-shadow: var(--
|
|
72
|
+
color: var(--_post-viewer-heading-texts--color);
|
|
73
|
+
text-shadow: var(--_post-viewer-heading--text--shadow);
|
|
72
74
|
text-overflow: ellipsis;
|
|
73
75
|
width: 100%;
|
|
74
76
|
white-space: nowrap;
|
|
@@ -79,6 +81,6 @@ const variables = $derived.by(() => {
|
|
|
79
81
|
font-size: 0.625rem;
|
|
80
82
|
line-height: 0.75rem;
|
|
81
83
|
font-weight: 400;
|
|
82
|
-
color: var(--
|
|
83
|
-
text-shadow: var(--
|
|
84
|
+
color: var(--_post-viewer-heading-texts--color);
|
|
85
|
+
text-shadow: var(--_post-viewer-heading--text--shadow);
|
|
84
86
|
}</style>
|
|
@@ -46,13 +46,17 @@ let { id, media, locale, autoplay = 'on-appearance', on } = $props();
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
.post-media {
|
|
49
|
+
--_post-media--background-color: #ffffff;
|
|
49
50
|
width: 100%;
|
|
50
51
|
min-width: 100%;
|
|
51
52
|
max-width: 100%;
|
|
52
53
|
height: 100%;
|
|
53
54
|
min-height: 100%;
|
|
54
55
|
max-height: 100%;
|
|
55
|
-
background-color: rgb(from var(--
|
|
56
|
+
background-color: rgb(from var(--_post-media--background-color) r g b/60%);
|
|
57
|
+
}
|
|
58
|
+
:global([data-theme="dark"]) .post-media {
|
|
59
|
+
--_post-media--background-color: #000000;
|
|
56
60
|
}
|
|
57
61
|
.post-media--fit {
|
|
58
62
|
--video--media-fit: contain;
|
|
@@ -45,8 +45,10 @@ const variables = $derived.by(() => {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
.post-viewer-texts {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
--_post-viewer-texts--color: #ffffff;
|
|
49
|
+
--_post-viewer-texts--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);
|
|
50
|
+
color: var(--_post-viewer-texts--color);
|
|
51
|
+
text-shadow: var(--_post-viewer-texts--shadow);
|
|
50
52
|
padding: var(--_post-viewer-texts--padding);
|
|
51
53
|
display: flex;
|
|
52
54
|
flex-direction: column;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { ProportionalContainer } from '../../ui/proportional-container';
|
|
2
2
|
import { generateStreamLayoutStyles } from './styles-transformer';
|
|
3
|
-
let { model, children, controls } = $props();
|
|
3
|
+
let { model, children, controls, overlay } = $props();
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<ProportionalContainer ratio={9 / 16}>
|
|
@@ -9,6 +9,9 @@ let { model, children, controls } = $props();
|
|
|
9
9
|
{#if controls}
|
|
10
10
|
{@render controls()}
|
|
11
11
|
{/if}
|
|
12
|
+
{#if overlay}
|
|
13
|
+
{@render overlay()}
|
|
14
|
+
{/if}
|
|
12
15
|
</div>
|
|
13
16
|
</ProportionalContainer>
|
|
14
17
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">var _a;
|
|
2
2
|
import { StockStreamElementLocalization } from './stock-stream-element-localization';
|
|
3
3
|
import { StockStreamElementLevel } from '../enums';
|
|
4
|
-
import { mapFlexJustifyContent, transformNumericValue } from '../styles-transformer';
|
|
4
|
+
import { mapFlexJustifyContent, transformNumericValue, transformTextColorValue } from '../styles-transformer';
|
|
5
5
|
let { model, heightOverrideDdu, locale } = $props();
|
|
6
6
|
const localization = $derived(new StockStreamElementLocalization(locale));
|
|
7
7
|
const height = $derived(heightOverrideDdu || ((_a = model.styles) === null || _a === void 0 ? void 0 : _a.height) || 16);
|
|
@@ -19,7 +19,8 @@ const dotCustomStyles = $derived.by(() => {
|
|
|
19
19
|
return values.join('');
|
|
20
20
|
});
|
|
21
21
|
const quantityCustomStyles = $derived.by(() => {
|
|
22
|
-
|
|
22
|
+
var _a;
|
|
23
|
+
const values = [`font-size: ${transformNumericValue(height * 0.75)};`, `color: ${transformTextColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.color)};`];
|
|
23
24
|
return values.join('');
|
|
24
25
|
});
|
|
25
26
|
</script>
|
|
@@ -12,7 +12,7 @@ import { toPriceRepresentation } from '../../../products/price-helper';
|
|
|
12
12
|
import { LineClamp } from '../../../ui/line-clamp';
|
|
13
13
|
import { PriceStreamElementLocalization } from './price-stream-element-localization';
|
|
14
14
|
import { default as StockElementView } from './cmp.stock-stream-element.svelte';
|
|
15
|
-
import { mapFlexJustifyContent, mapFontFamily, mapFontWeight,
|
|
15
|
+
import { mapFlexJustifyContent, mapFontFamily, mapFontWeight, transformTextColorValue, transformBackgroundColorValue, transformFontSizeValue, transformNumericValue } from '../styles-transformer';
|
|
16
16
|
let { maxElementHeight, model, data, localization, on } = $props();
|
|
17
17
|
let priceElementRef = $state.raw(null);
|
|
18
18
|
let priceContainerRef = $state.raw(null);
|
|
@@ -62,7 +62,7 @@ const priceCustomStyles = $derived.by(() => {
|
|
|
62
62
|
`font-size: ${transformFontSizeValue(priceHeight / lineHeight)};`,
|
|
63
63
|
`line-height: ${lineHeight};`,
|
|
64
64
|
`font-weight: ${mapFontWeight((_a = model.styles) === null || _a === void 0 ? void 0 : _a.fontWeight)};`,
|
|
65
|
-
`color: ${
|
|
65
|
+
`color: ${transformTextColorValue(data.salePrice ? (_b = model.styles) === null || _b === void 0 ? void 0 : _b.salePriceColor : (_c = model.styles) === null || _c === void 0 ? void 0 : _c.regularPriceColor)};`
|
|
66
66
|
];
|
|
67
67
|
return values.join('');
|
|
68
68
|
});
|
|
@@ -74,8 +74,8 @@ const saveValueCustomStyles = $derived.by(() => {
|
|
|
74
74
|
`font-weight: 500;`,
|
|
75
75
|
`padding: ${transformNumericValue(priceHeight / 8)} ${transformNumericValue(priceHeight / 4)};`,
|
|
76
76
|
`border-radius: ${transformNumericValue(priceHeight / 8)};`,
|
|
77
|
-
`background-color: ${
|
|
78
|
-
`color: ${
|
|
77
|
+
`background-color: ${transformBackgroundColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.saveValueBackgroundColor)};`,
|
|
78
|
+
`color: ${transformTextColorValue((_b = model.styles) === null || _b === void 0 ? void 0 : _b.saveValueColor)};`
|
|
79
79
|
];
|
|
80
80
|
return values.join('');
|
|
81
81
|
});
|
|
@@ -84,7 +84,7 @@ const beforeValueCustomStyles = $derived.by(() => {
|
|
|
84
84
|
const values = [
|
|
85
85
|
`font-size: ${transformFontSizeValue(priceHeight / 5)};`,
|
|
86
86
|
`font-weight: 500;`,
|
|
87
|
-
`color: ${
|
|
87
|
+
`color: ${transformTextColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.beforeValueColor)};`
|
|
88
88
|
];
|
|
89
89
|
return values.join('');
|
|
90
90
|
});
|
|
@@ -13,4 +13,5 @@ export declare const mapTextAlign: (value: StreamElementStyleHorizontalAlign | n
|
|
|
13
13
|
export declare const mapFlexJustifyContent: (value: StreamElementStyleHorizontalAlign | null | undefined) => "center" | "flex-start" | "flex-end";
|
|
14
14
|
export declare const transformFontSizeValue: (value: number | null | undefined) => string;
|
|
15
15
|
export declare const transformNumericValue: (value: number | null | undefined, fallback?: string) => string;
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const transformTextColorValue: (value: string | null | undefined) => string;
|
|
17
|
+
export declare const transformBackgroundColorValue: (value: string | null | undefined) => string;
|
|
@@ -4,7 +4,7 @@ export const generateStreamLayoutStyles = (styles) => {
|
|
|
4
4
|
if (!styles) {
|
|
5
5
|
return '';
|
|
6
6
|
}
|
|
7
|
-
const values = [`background-color: ${
|
|
7
|
+
const values = [`background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`, `font-family: ${mapFontFamily(styles.fontFamily)}`];
|
|
8
8
|
return values.join(';');
|
|
9
9
|
};
|
|
10
10
|
export const generateContainerStyles = (styles) => {
|
|
@@ -20,10 +20,10 @@ export const generateContainerStyles = (styles) => {
|
|
|
20
20
|
`padding-right: ${transformNumericValue(styles.paddingRight)}`,
|
|
21
21
|
`padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
|
|
22
22
|
`padding-left: ${transformNumericValue(styles.paddingLeft)}`,
|
|
23
|
-
`background-color: ${
|
|
23
|
+
`background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`,
|
|
24
24
|
`border-width: ${styles.borderColor ? '1px' : '0'}`,
|
|
25
25
|
`border-radius: ${transformNumericValue(styles.borderRadius)}`,
|
|
26
|
-
`border-color: ${
|
|
26
|
+
`border-color: ${transformBackgroundColorValue(styles.borderColor)}`,
|
|
27
27
|
`overflow: ${styles.borderRadius ? 'hidden' : 'visible'}`
|
|
28
28
|
];
|
|
29
29
|
if (styles.direction) {
|
|
@@ -49,11 +49,11 @@ export const generateButtonStyles = (styles) => {
|
|
|
49
49
|
`padding-right: ${transformNumericValue(styles.paddingRight)}`,
|
|
50
50
|
`padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
|
|
51
51
|
`padding-left: ${transformNumericValue(styles.paddingLeft)}`,
|
|
52
|
-
`color: ${
|
|
53
|
-
`background-color: ${
|
|
52
|
+
`color: ${transformTextColorValue(styles.textColor)}`,
|
|
53
|
+
`background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`,
|
|
54
54
|
`border-width: ${styles.borderColor ? '1px' : '0'}`,
|
|
55
55
|
`border-radius: ${transformNumericValue(styles.borderRadius)}`,
|
|
56
|
-
`border-color: ${
|
|
56
|
+
`border-color: ${transformBackgroundColorValue(styles.borderColor)}`,
|
|
57
57
|
`overflow: hidden`
|
|
58
58
|
];
|
|
59
59
|
return values.join(';');
|
|
@@ -94,7 +94,7 @@ export const generateProductsSliderStyles = (styles) => {
|
|
|
94
94
|
`padding-right: ${transformNumericValue(styles.paddingRight)}`,
|
|
95
95
|
`padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
|
|
96
96
|
`padding-left: ${transformNumericValue(styles.paddingLeft)}`,
|
|
97
|
-
`background-color: ${
|
|
97
|
+
`background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`,
|
|
98
98
|
`overflow-x: auto`,
|
|
99
99
|
`overflow-y: hidden`,
|
|
100
100
|
`scrollbar-width: none`,
|
|
@@ -111,7 +111,7 @@ export const generateTextStyles = (styles) => {
|
|
|
111
111
|
`font-weight: ${mapFontWeight(styles.fontWeight)}`,
|
|
112
112
|
`line-height: ${transformNumericValue(styles.lineHeight, '1.2')}`,
|
|
113
113
|
`text-align: ${mapTextAlign(styles.textAlign)}`,
|
|
114
|
-
`color: ${
|
|
114
|
+
`color: ${transformTextColorValue(styles.color)}`
|
|
115
115
|
];
|
|
116
116
|
return values.join(';');
|
|
117
117
|
};
|
|
@@ -203,7 +203,13 @@ export const transformNumericValue = (value, fallback = '0') => {
|
|
|
203
203
|
}
|
|
204
204
|
return `${(value / baseContainerWidth) * 100}cqi`;
|
|
205
205
|
};
|
|
206
|
-
export const
|
|
206
|
+
export const transformTextColorValue = (value) => {
|
|
207
|
+
if (value === null || value === undefined) {
|
|
208
|
+
return '#000000';
|
|
209
|
+
}
|
|
210
|
+
return value;
|
|
211
|
+
};
|
|
212
|
+
export const transformBackgroundColorValue = (value) => {
|
|
207
213
|
if (value === null || value === undefined) {
|
|
208
214
|
return 'transparent';
|
|
209
215
|
}
|
|
@@ -66,6 +66,7 @@ export type ProductsSliderStreamElementStyles = {
|
|
|
66
66
|
export type StockStreamElementStyles = {
|
|
67
67
|
height?: number | null;
|
|
68
68
|
horizontalAlign?: StreamElementStyleHorizontalAlign | null;
|
|
69
|
+
color?: string | null;
|
|
69
70
|
};
|
|
70
71
|
export type TextStreamElementStyles = {
|
|
71
72
|
fontSize?: number | null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">import { StreamLayoutSlot, StreamPageLayout, StreamLayoutSlotContent } from '../layout';
|
|
2
2
|
import { ResponsivePlayerButtonsGroup } from '../../ui/player/button';
|
|
3
3
|
import { StreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
4
|
-
let { page, trackingParams, overlayControls, locale, on } = $props();
|
|
4
|
+
let { page, trackingParams, overlayControls, locale, on, overlay } = $props();
|
|
5
5
|
const localization = $derived(new StreamPageViewerLocalization(locale));
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if page.type === 'general'}
|
|
9
|
-
<StreamPageLayout model={page.layout}>
|
|
9
|
+
<StreamPageLayout model={page.layout} overlay={overlay}>
|
|
10
10
|
{#each page.layout.slots as slot (slot)}
|
|
11
11
|
<StreamLayoutSlot model={slot}>
|
|
12
12
|
<StreamLayoutSlotContent model={slot} trackingParams={trackingParams} on={on} locale={localization.elementsLocale} />
|
|
@@ -2,6 +2,7 @@ import type { Locale } from '../../core/locale';
|
|
|
2
2
|
import { type StreamTrackingParams } from '../layout';
|
|
3
3
|
import { type PlayerButtonDef } from '../../ui/player/button';
|
|
4
4
|
import type { StreamPageViewerModel } from './types';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
5
6
|
type Props = {
|
|
6
7
|
page: StreamPageViewerModel;
|
|
7
8
|
trackingParams: StreamTrackingParams;
|
|
@@ -19,6 +20,7 @@ type Props = {
|
|
|
19
20
|
productImpression?: (productId: string) => void;
|
|
20
21
|
progress?: (videoId: string, progress: number) => void;
|
|
21
22
|
};
|
|
23
|
+
overlay?: Snippet;
|
|
22
24
|
};
|
|
23
25
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
24
26
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -17,6 +17,7 @@ import { mapToPostModel } from '../layout/models';
|
|
|
17
17
|
import { StreamPageViewer } from '../stream-page-viewer';
|
|
18
18
|
import { IconColor } from '../../ui/icon';
|
|
19
19
|
import { Player, PlayerConfig, PlayerSettings } from '../../ui/player';
|
|
20
|
+
import { ChunksProgress } from '../../ui/player/progress';
|
|
20
21
|
import { default as Overview } from './stream-overview.svelte';
|
|
21
22
|
import { StreamPlayerLocalization } from './stream-player-localization';
|
|
22
23
|
import { StreamsPlayerBuffer } from './streams-player-buffer.svelte';
|
|
@@ -232,6 +233,49 @@ const currentItemActions = $derived.by(() => {
|
|
|
232
233
|
}
|
|
233
234
|
return result;
|
|
234
235
|
});
|
|
236
|
+
const handlePageViewMounted = (node) => {
|
|
237
|
+
const updatePosition = () => {
|
|
238
|
+
var _a;
|
|
239
|
+
const progressElement = node.querySelector('[id^="chunk-progress-"]');
|
|
240
|
+
if (!progressElement) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const overlayMinOffsetTop = (_a = playerSettings === null || playerSettings === void 0 ? void 0 : playerSettings.overlayMinOffsetTop) !== null && _a !== void 0 ? _a : 0;
|
|
244
|
+
if (!overlayMinOffsetTop) {
|
|
245
|
+
progressElement.style.top = '';
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const contentElement = node.firstElementChild;
|
|
249
|
+
if (!contentElement) {
|
|
250
|
+
progressElement.style.top = '';
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const nodeRect = node.getBoundingClientRect();
|
|
254
|
+
const contentRect = contentElement.getBoundingClientRect();
|
|
255
|
+
const contentOffsetTop = contentRect.top - nodeRect.top;
|
|
256
|
+
if (contentOffsetTop <= 0) {
|
|
257
|
+
progressElement.style.top = `${overlayMinOffsetTop}px`;
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const overlayOverlap = overlayMinOffsetTop - contentOffsetTop;
|
|
261
|
+
if (overlayOverlap > 0) {
|
|
262
|
+
progressElement.style.top = `${overlayOverlap}px`;
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
progressElement.style.top = '';
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
updatePosition();
|
|
269
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
270
|
+
updatePosition();
|
|
271
|
+
});
|
|
272
|
+
resizeObserver.observe(node);
|
|
273
|
+
return {
|
|
274
|
+
destroy() {
|
|
275
|
+
resizeObserver.disconnect();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
};
|
|
235
279
|
//#region Activity Tracking
|
|
236
280
|
const resetInactivityTimer = () => {
|
|
237
281
|
if (!isActive) {
|
|
@@ -297,59 +341,82 @@ const stopActivityTracking = () => {
|
|
|
297
341
|
}} />
|
|
298
342
|
{/if}
|
|
299
343
|
{/snippet}
|
|
344
|
+
{#snippet overlay()}
|
|
345
|
+
{#if buffer?.activeChunk && buffer.activeChunk.chunkItems.length > 1}
|
|
346
|
+
<div class="stream-progress" id="chunk-progress-{buffer.activeChunk.model.id}">
|
|
347
|
+
{#snippet info()}
|
|
348
|
+
<div class="stream-progress-info">
|
|
349
|
+
<div class="stream-progress-info__title">
|
|
350
|
+
{buffer?.activeChunk.model.title}
|
|
351
|
+
</div>
|
|
352
|
+
{#if buffer?.activeChunk.model.subTitle}
|
|
353
|
+
<div class="stream-progress-info__sub-title">
|
|
354
|
+
{buffer.activeChunk.model.subTitle}
|
|
355
|
+
</div>
|
|
356
|
+
{/if}
|
|
357
|
+
</div>
|
|
358
|
+
{/snippet}
|
|
359
|
+
<ChunksProgress totalItems={buffer.activeChunk.model.pagesCount} activeItemIndex={buffer.activeChunk.activeItemIndex} chunkInfo={info} />
|
|
360
|
+
</div>
|
|
361
|
+
{/if}
|
|
362
|
+
{/snippet}
|
|
300
363
|
<Player
|
|
301
364
|
config={contentPlayerConfig}
|
|
302
365
|
itemActions={currentItemActions}
|
|
303
366
|
attachmentsView={buffer?.current && itemAsPostModel(buffer.current)?.attachments ? attachmentsView : undefined}>
|
|
304
367
|
{#snippet itemView({ item })}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
progress: (videoId, progress) => onProgress(item.id, videoId, progress),
|
|
322
|
-
productClick: (productId) => onStreamProductClick(productId),
|
|
323
|
-
productImpression: (productId) => onStreamProductImpression(productId)
|
|
324
|
-
}} />
|
|
325
|
-
{:else}
|
|
326
|
-
{@const postModel = itemAsPostModel(item)}
|
|
327
|
-
{#if postModel}
|
|
328
|
-
{@const handler = buffer?.activeChunk
|
|
329
|
-
? streamActionsGenerator.getPostActionsHandler({
|
|
330
|
-
model: postModel,
|
|
331
|
-
streamId: buffer.activeChunk.model.id,
|
|
332
|
-
streamPageId: item.id
|
|
333
|
-
})
|
|
334
|
-
: null}
|
|
335
|
-
<PostViewer
|
|
336
|
-
model={postModel}
|
|
337
|
-
controlsColors={{ active: contentPlayerConfig.playerColors.button, inactive: contentPlayerConfig.playerColors.buttonInactive }}
|
|
338
|
-
trackingParams={trackingParams}
|
|
339
|
-
enableAttachments={contentPlayerConfig.uiManager.showAttachmentsOverlay}
|
|
340
|
-
enableControls={contentPlayerConfig.uiManager.showControlsOverlay}
|
|
341
|
-
controlActions={handler?.actions ?? []}
|
|
342
|
-
autoplay="on-appearance"
|
|
343
|
-
locale={contentPlayerConfig.settings.locale}
|
|
368
|
+
<div class="page-view" use:handlePageViewMounted>
|
|
369
|
+
{#if item.type === 'general'}
|
|
370
|
+
<StreamPageViewer
|
|
371
|
+
page={item}
|
|
372
|
+
trackingParams={streamTrackingParams}
|
|
373
|
+
locale={localization.locale}
|
|
374
|
+
overlayControls={{
|
|
375
|
+
enabled: contentPlayerConfig.uiManager.showControlsOverlay,
|
|
376
|
+
colors: {
|
|
377
|
+
active: contentPlayerConfig.playerColors.button,
|
|
378
|
+
inactive: contentPlayerConfig.playerColors.buttonInactive
|
|
379
|
+
},
|
|
380
|
+
actions: buffer?.activeChunk
|
|
381
|
+
? streamActionsGenerator.getGeneralStreamPageActions({ streamId: buffer.activeChunk.model.id, streamPageId: item.id })
|
|
382
|
+
: []
|
|
383
|
+
}}
|
|
344
384
|
on={{
|
|
345
|
-
progress: (progress) =>
|
|
346
|
-
productClick: (productId) =>
|
|
347
|
-
productImpression: (productId) =>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
385
|
+
progress: (videoId, progress) => onProgress(item.id, videoId, progress),
|
|
386
|
+
productClick: (productId) => onStreamProductClick(productId),
|
|
387
|
+
productImpression: (productId) => onStreamProductImpression(productId)
|
|
388
|
+
}}
|
|
389
|
+
overlay={overlay} />
|
|
390
|
+
{:else}
|
|
391
|
+
{@const postModel = itemAsPostModel(item)}
|
|
392
|
+
{#if postModel}
|
|
393
|
+
{@const handler = buffer?.activeChunk
|
|
394
|
+
? streamActionsGenerator.getPostActionsHandler({
|
|
395
|
+
model: postModel,
|
|
396
|
+
streamId: buffer.activeChunk.model.id,
|
|
397
|
+
streamPageId: item.id
|
|
398
|
+
})
|
|
399
|
+
: null}
|
|
400
|
+
<PostViewer
|
|
401
|
+
model={postModel}
|
|
402
|
+
controlsColors={{ active: contentPlayerConfig.playerColors.button, inactive: contentPlayerConfig.playerColors.buttonInactive }}
|
|
403
|
+
trackingParams={trackingParams}
|
|
404
|
+
enableAttachments={contentPlayerConfig.uiManager.showAttachmentsOverlay}
|
|
405
|
+
enableControls={contentPlayerConfig.uiManager.showControlsOverlay}
|
|
406
|
+
controlActions={handler?.actions ?? []}
|
|
407
|
+
autoplay="on-appearance"
|
|
408
|
+
locale={contentPlayerConfig.settings.locale}
|
|
409
|
+
on={{
|
|
410
|
+
progress: (progress) => onShortVideoProgress(item.id, postModel.id, progress),
|
|
411
|
+
productClick: (productId) => onShortVideoProductClick(productId, postModel.id),
|
|
412
|
+
productImpression: (productId) => onShortVideoProductImpression(productId, postModel.id),
|
|
413
|
+
adClick: (adId) => onShortVideoAdClick(adId),
|
|
414
|
+
adImpression: (adId) => onShortVideoAdImpression(adId)
|
|
415
|
+
}}
|
|
416
|
+
overlay={overlay} />
|
|
417
|
+
{/if}
|
|
351
418
|
{/if}
|
|
352
|
-
|
|
419
|
+
</div>
|
|
353
420
|
{/snippet}
|
|
354
421
|
{#snippet overviewPanelContent()}
|
|
355
422
|
{#if buffer}
|
|
@@ -362,3 +429,53 @@ const stopActivityTracking = () => {
|
|
|
362
429
|
{/if}
|
|
363
430
|
{/snippet}
|
|
364
431
|
</Player>
|
|
432
|
+
|
|
433
|
+
<style>@keyframes fadeIn {
|
|
434
|
+
0% {
|
|
435
|
+
opacity: 1;
|
|
436
|
+
}
|
|
437
|
+
50% {
|
|
438
|
+
opacity: 0.4;
|
|
439
|
+
}
|
|
440
|
+
100% {
|
|
441
|
+
opacity: 1;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
.page-view {
|
|
445
|
+
width: 100%;
|
|
446
|
+
height: 100%;
|
|
447
|
+
position: relative;
|
|
448
|
+
display: flex;
|
|
449
|
+
justify-content: center;
|
|
450
|
+
align-items: center;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.stream-progress {
|
|
454
|
+
position: absolute;
|
|
455
|
+
top: 0.75rem;
|
|
456
|
+
left: 1rem;
|
|
457
|
+
right: 1rem;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.stream-progress-info {
|
|
461
|
+
color: var(--sc-mc-color--text-white);
|
|
462
|
+
text-shadow: var(--sc-mc-color--text-white-shadow);
|
|
463
|
+
display: flex;
|
|
464
|
+
flex-direction: column;
|
|
465
|
+
min-width: 0;
|
|
466
|
+
gap: 0.25rem;
|
|
467
|
+
}
|
|
468
|
+
.stream-progress-info__title {
|
|
469
|
+
font-size: 1.125rem;
|
|
470
|
+
text-overflow: ellipsis;
|
|
471
|
+
width: 100%;
|
|
472
|
+
white-space: nowrap;
|
|
473
|
+
overflow: hidden;
|
|
474
|
+
}
|
|
475
|
+
.stream-progress-info__sub-title {
|
|
476
|
+
font-size: 0.875rem;
|
|
477
|
+
text-overflow: ellipsis;
|
|
478
|
+
width: 100%;
|
|
479
|
+
white-space: nowrap;
|
|
480
|
+
overflow: hidden;
|
|
481
|
+
}</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script lang="ts">let { totalItems, activeItemIndex, chunkInfo } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="chunks-progress">
|
|
6
|
+
<div class="chunks" class:chunks--few={totalItems <= 3} class:chunks--common={totalItems > 3 && totalItems <= 6} class:chunks--many={totalItems > 6}>
|
|
7
|
+
{#each Array(totalItems) as _, i (i)}
|
|
8
|
+
<div class="chunk" class:active={i <= activeItemIndex} aria-label={`Item ${i}`}></div>
|
|
9
|
+
{/each}
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
{#if chunkInfo}
|
|
13
|
+
<div class="info">
|
|
14
|
+
{@render chunkInfo()}
|
|
15
|
+
</div>
|
|
16
|
+
{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>@keyframes fadeIn {
|
|
20
|
+
0% {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
50% {
|
|
24
|
+
opacity: 0.4;
|
|
25
|
+
}
|
|
26
|
+
100% {
|
|
27
|
+
opacity: 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
.chunks-progress {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: 0.5rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.chunks {
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
.chunks--few {
|
|
40
|
+
gap: 0.75rem;
|
|
41
|
+
}
|
|
42
|
+
.chunks--common {
|
|
43
|
+
gap: 0.5625rem;
|
|
44
|
+
}
|
|
45
|
+
.chunks--many {
|
|
46
|
+
gap: 0.375rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.chunk {
|
|
50
|
+
flex: 1;
|
|
51
|
+
height: 0.125rem;
|
|
52
|
+
border-radius: 1px;
|
|
53
|
+
background-color: rgb(from #6b7280 r g b/40%);
|
|
54
|
+
transition: background-color 0.2s ease;
|
|
55
|
+
box-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);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.chunk.active {
|
|
59
|
+
background-color: rgb(from #fafafa r g b/60%);
|
|
60
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ChunksProgress } from './cmp.chunks-progress.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ChunksProgress } from './cmp.chunks-progress.svelte';
|
|
@@ -122,8 +122,6 @@ export class PlayerChunksManager {
|
|
|
122
122
|
? this.provider.initialData.startItemIndex
|
|
123
123
|
: 0;
|
|
124
124
|
this.setActiveChunkIndex(firstFilledChunkIndex, initialStartItemIndex);
|
|
125
|
-
// Start background warm-up after initialization
|
|
126
|
-
this.warmUp();
|
|
127
125
|
};
|
|
128
126
|
setActiveChunkIndex = async (index, chunkItemIndex) => {
|
|
129
127
|
this._activeChunkIndex = index;
|
|
@@ -148,6 +146,8 @@ export class PlayerChunksManager {
|
|
|
148
146
|
}
|
|
149
147
|
else {
|
|
150
148
|
this.activeChunk.setActiveItemIndex(this.activeChunk.chunkItems.indexOf(nextItem));
|
|
149
|
+
// Don't wait for warm up to be finished, it runs in the background
|
|
150
|
+
this.warmUp();
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
warmUp = async () => {
|
|
@@ -14,19 +14,6 @@ const styles = $derived.by(() => {
|
|
|
14
14
|
|
|
15
15
|
<svelte:head>
|
|
16
16
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300..700&display=swap" />
|
|
17
|
-
<meta name="theme-color" content="#242424" />
|
|
18
|
-
<meta name="color-scheme" content="dark" />
|
|
19
|
-
<meta name="mobile-web-app-capable" content="yes" />
|
|
20
|
-
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
21
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
|
22
|
-
|
|
23
|
-
<style>
|
|
24
|
-
html,
|
|
25
|
-
body {
|
|
26
|
-
background-color: #242424;
|
|
27
|
-
color-scheme: dark;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
17
|
</svelte:head>
|
|
31
18
|
|
|
32
19
|
<div
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamscloud/embeddable",
|
|
3
|
-
"version": "15.0.0
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"author": "StreamsCloud",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"peerDependencies": {
|
|
136
136
|
"@fluentui/svg-icons": "^1.1.301",
|
|
137
137
|
"@popperjs/core": "^2.11.8",
|
|
138
|
-
"@streamscloud/streams-analytics-collector": "^
|
|
138
|
+
"@streamscloud/streams-analytics-collector": "^4.0.0",
|
|
139
139
|
"@urql/core": "^5.1.1",
|
|
140
140
|
"dequal": "^2.0.3",
|
|
141
141
|
"dompurify": "^3.2.6",
|