@streamscloud/embeddable 10.1.2 → 11.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 +27 -7
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +5 -0
- package/dist/content-player/cmp.content-player.svelte +30 -40
- package/dist/content-player/content-player-config.svelte.d.ts +13 -2
- package/dist/content-player/content-player-config.svelte.js +8 -5
- package/dist/content-player/content-player-settings.d.ts +12 -0
- package/dist/content-player/content-player-settings.js +12 -0
- package/dist/content-player/controls-and-attachments.svelte +25 -54
- package/dist/content-player/header.svelte +10 -132
- package/dist/content-player/header.svelte.d.ts +0 -4
- package/dist/content-player/overview-panel.svelte +22 -72
- package/dist/content-player/overview-panel.svelte.d.ts +30 -7
- package/dist/content-player/ui-manager.svelte.d.ts +2 -4
- package/dist/content-player/ui-manager.svelte.js +3 -5
- package/dist/media-center/config/internal-media-center-config.js +2 -1
- package/dist/media-center/config/operations.generated.d.ts +13 -0
- package/dist/media-center/config/operations.generated.js +20 -0
- package/dist/media-center/config/operations.graphql +13 -0
- package/dist/media-center/config/types.d.ts +13 -0
- package/dist/media-center/media-center/cmp.media-center.svelte +117 -348
- package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +3 -1
- package/dist/media-center/media-center/{discover-panel-handler.svelte.d.ts → discover/discover-panel-handler.svelte.d.ts} +5 -6
- package/dist/media-center/media-center/{discover-panel-handler.svelte.js → discover/discover-panel-handler.svelte.js} +1 -8
- package/dist/media-center/media-center/discover/discover-panel-localization.d.ts +19 -0
- package/dist/media-center/media-center/discover/discover-panel-localization.js +78 -0
- package/dist/media-center/media-center/{discover-panel.svelte → discover/discover-panel.svelte} +18 -9
- package/dist/media-center/media-center/discover/discover-panel.svelte.d.ts +15 -0
- package/dist/media-center/media-center/discover/index.d.ts +2 -0
- package/dist/media-center/media-center/discover/index.js +2 -0
- package/dist/media-center/media-center/handlers/categories-handler.svelte.d.ts +21 -0
- package/dist/media-center/media-center/handlers/categories-handler.svelte.js +36 -0
- package/dist/media-center/media-center/handlers/feed-handler.svelte.d.ts +6 -0
- package/dist/media-center/media-center/handlers/feed-handler.svelte.js +12 -0
- package/dist/media-center/media-center/handlers/index.d.ts +2 -0
- package/dist/media-center/media-center/handlers/index.js +2 -0
- package/dist/media-center/media-center/header-footer/index.d.ts +3 -0
- package/dist/media-center/media-center/header-footer/index.js +3 -0
- package/dist/media-center/media-center/header-footer/media-center-footer.svelte +77 -0
- package/dist/media-center/media-center/header-footer/media-center-footer.svelte.d.ts +7 -0
- package/dist/media-center/media-center/header-footer/media-center-header-localization.d.ts +12 -0
- package/dist/media-center/media-center/header-footer/media-center-header-localization.js +40 -0
- package/dist/media-center/media-center/header-footer/media-center-header-mobile.svelte +91 -0
- package/dist/media-center/media-center/header-footer/media-center-header-mobile.svelte.d.ts +11 -0
- package/dist/media-center/media-center/header-footer/media-center-header.svelte +310 -0
- package/dist/media-center/media-center/header-footer/media-center-header.svelte.d.ts +13 -0
- package/dist/media-center/media-center/media-center-context.svelte.d.ts +50 -0
- package/dist/media-center/media-center/media-center-context.svelte.js +98 -0
- package/dist/media-center/media-center/{category-following-wrapper.svelte → menu/category-following-wrapper.svelte} +3 -2
- package/dist/media-center/media-center/{category-following-wrapper.svelte.d.ts → menu/category-following-wrapper.svelte.d.ts} +2 -2
- package/dist/media-center/media-center/menu/index.d.ts +2 -0
- package/dist/media-center/media-center/menu/index.js +2 -0
- package/dist/media-center/media-center/menu/menu-localization.d.ts +19 -0
- package/dist/media-center/media-center/menu/menu-localization.js +78 -0
- package/dist/media-center/media-center/menu/menu.svelte +345 -0
- package/dist/media-center/media-center/menu/menu.svelte.d.ts +14 -0
- package/dist/media-center/media-center/menu/popular-streams-panel-handler.svelte.d.ts +10 -0
- package/dist/media-center/media-center/menu/popular-streams-panel-handler.svelte.js +26 -0
- package/dist/media-center/media-center/providers/index.d.ts +2 -0
- package/dist/media-center/media-center/providers/index.js +2 -0
- package/dist/media-center/media-center/providers/post-player-provider-generator.d.ts +8 -0
- package/dist/media-center/media-center/{post-player-provider-generator.js → providers/post-player-provider-generator.js} +3 -3
- package/dist/media-center/media-center/{streams-player-provider-generator.d.ts → providers/streams-player-provider-generator.d.ts} +2 -2
- package/dist/media-center/media-center/{streams-player-provider-generator.js → providers/streams-player-provider-generator.js} +2 -2
- package/dist/media-center/media-center/streams-in-category/index.d.ts +2 -0
- package/dist/media-center/media-center/streams-in-category/index.js +2 -0
- package/dist/media-center/media-center/{streams-in-category-panel-handler.svelte.d.ts → streams-in-category/streams-in-category-panel-handler.svelte.d.ts} +4 -4
- package/dist/media-center/media-center/{streams-in-category-panel-handler.svelte.js → streams-in-category/streams-in-category-panel-handler.svelte.js} +5 -5
- package/dist/media-center/media-center/{streams-in-category-panel.svelte → streams-in-category/streams-in-category-panel.svelte} +1 -1
- package/dist/media-center/media-center/{streams-in-category-panel.svelte.d.ts → streams-in-category/streams-in-category-panel.svelte.d.ts} +1 -1
- package/dist/media-center/media-center/types.d.ts +1 -1
- package/dist/media-center/model/types.d.ts +7 -6
- package/dist/posts/attachments/cmp.attachments.svelte +5 -3
- package/dist/posts/attachments/cmp.attachments.svelte.d.ts +6 -0
- package/dist/posts/controls/cmp.controls.svelte +3 -3
- package/dist/posts/controls/cmp.controls.svelte.d.ts +2 -0
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +3 -1
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +4 -0
- package/dist/products/product-card/cmp.product-card.svelte +35 -11
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +5 -0
- package/dist/streams/data-loaders/mapper.js +0 -5
- package/dist/streams/data-loaders/operations.generated.d.ts +0 -12
- package/dist/streams/data-loaders/operations.generated.js +0 -26
- package/dist/streams/data-loaders/operations.graphql +0 -6
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +2 -1
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +4 -0
- package/dist/streams/stream-card/cmp.stream-card.svelte +5 -5
- package/dist/streams/streams-player/index.js +1 -1
- package/dist/streams/streams-player/stream-overview.svelte +6 -96
- package/dist/streams/streams-player/stream-overview.svelte.d.ts +0 -4
- package/dist/streams/streams-player/stream-player-localization.d.ts +0 -1
- package/dist/streams/streams-player/stream-player-localization.js +0 -6
- package/dist/streams/streams-player/streams-player-view.svelte +0 -2
- package/dist/streams/streams-player/types.d.ts +0 -4
- package/dist/ui/icon/cmp.icon.svelte +3 -2
- package/dist/ui/player/button/cmp.player-button.svelte +17 -5
- package/dist/ui/player/button/cmp.player-button.svelte.d.ts +3 -0
- package/dist/ui/player/button/cmp.player-buttons-group.svelte +20 -5
- package/dist/ui/player/button/cmp.player-buttons-group.svelte.d.ts +2 -0
- package/dist/ui/player/button/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/content-player/content-player-localization.d.ts +0 -6
- package/dist/content-player/content-player-localization.js +0 -15
- package/dist/media-center/media-center/desktop-categories-selector.svelte +0 -132
- package/dist/media-center/media-center/desktop-categories-selector.svelte.d.ts +0 -12
- package/dist/media-center/media-center/discover-panel.svelte.d.ts +0 -15
- package/dist/media-center/media-center/media-center-handler.svelte.d.ts +0 -28
- package/dist/media-center/media-center/media-center-handler.svelte.js +0 -73
- package/dist/media-center/media-center/media-center-localization.d.ts +0 -10
- package/dist/media-center/media-center/media-center-localization.js +0 -39
- package/dist/media-center/media-center/mobile-controls-panel.svelte +0 -268
- package/dist/media-center/media-center/mobile-controls-panel.svelte.d.ts +0 -20
- package/dist/media-center/media-center/post-player-provider-generator.d.ts +0 -8
|
@@ -4,7 +4,7 @@ import { toPriceRepresentation } from '../../products/price-helper';
|
|
|
4
4
|
import { Button, ButtonSize } from '../../ui/button';
|
|
5
5
|
import { Image } from '../../ui/image';
|
|
6
6
|
import { LineClamp } from '../../ui/line-clamp';
|
|
7
|
-
let { ad, trackingParams, inert = false, on } = $props();
|
|
7
|
+
let { ad, colors, trackingParams, inert = false, on } = $props();
|
|
8
8
|
const trackImpression = (node) => {
|
|
9
9
|
if (on === null || on === void 0 ? void 0 : on.impression) {
|
|
10
10
|
const observer = new IntersectionObserver((entries) => {
|
|
@@ -33,9 +33,19 @@ const handleAdClick = () => {
|
|
|
33
33
|
window.open(enrichedLink, '_blank', 'noopener noreferrer');
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
+
const styles = $derived.by(() => {
|
|
37
|
+
const values = [];
|
|
38
|
+
if (colors === null || colors === void 0 ? void 0 : colors.background) {
|
|
39
|
+
values.push(`--ad-card--background-color: ${colors.background}`);
|
|
40
|
+
}
|
|
41
|
+
if (colors === null || colors === void 0 ? void 0 : colors.price) {
|
|
42
|
+
values.push(`--ad-card--price-color: ${colors.price}`);
|
|
43
|
+
}
|
|
44
|
+
return values.join(';');
|
|
45
|
+
});
|
|
36
46
|
</script>
|
|
37
47
|
|
|
38
|
-
<div class="ad-card" inert={inert} use:trackImpression>
|
|
48
|
+
<div class="ad-card" style={styles} inert={inert} use:trackImpression>
|
|
39
49
|
<div class="ad-card__image">
|
|
40
50
|
<Image src={ad.image} alt={ad.title} />
|
|
41
51
|
</div>
|
|
@@ -70,7 +80,7 @@ const handleAdClick = () => {
|
|
|
70
80
|
on={{ click: handleAdClick }}
|
|
71
81
|
--button--font--size="1em"
|
|
72
82
|
--button--font--color={ad.ctaButton.textColor}
|
|
73
|
-
--button--background={ad.ctaButton.background}
|
|
83
|
+
--button--background={colors?.buttonBackground ?? ad.ctaButton.background}
|
|
74
84
|
--button--min-width="100%">
|
|
75
85
|
<span class="ad-card__button-text">{ad.ctaButton.text}</span>
|
|
76
86
|
</Button>
|
|
@@ -92,6 +102,9 @@ const handleAdClick = () => {
|
|
|
92
102
|
}
|
|
93
103
|
}
|
|
94
104
|
.ad-card {
|
|
105
|
+
--_ad-card--background-color: var(--ad-card--background-color, rgb(from #ffffff r g b/90%));
|
|
106
|
+
--_ad-card--border-color: var(--ad-card--background-color, #f2f2f3);
|
|
107
|
+
--_ad-card--price-color: var(--ad-card--price-color, inherit);
|
|
95
108
|
width: 100%;
|
|
96
109
|
height: max-content;
|
|
97
110
|
display: flex;
|
|
@@ -100,8 +113,8 @@ const handleAdClick = () => {
|
|
|
100
113
|
container-type: inline-size;
|
|
101
114
|
aspect-ratio: 9/16;
|
|
102
115
|
color: #000000;
|
|
103
|
-
background-color:
|
|
104
|
-
border: 1px solid
|
|
116
|
+
background-color: var(--_ad-card--background-color);
|
|
117
|
+
border: 1px solid var(--_ad-card--border-color);
|
|
105
118
|
border-radius: 0.5rem;
|
|
106
119
|
padding: 0.75rem 0.75rem 1.125rem;
|
|
107
120
|
justify-content: flex-start;
|
|
@@ -109,9 +122,9 @@ const handleAdClick = () => {
|
|
|
109
122
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
110
123
|
}
|
|
111
124
|
:global([data-theme="dark"]) .ad-card {
|
|
112
|
-
background-color:
|
|
125
|
+
--_ad-card--background-color: var(--ad-card--background-color, rgb(from #121212 r g b/90%));
|
|
126
|
+
--_ad-card--border-color: var(--ad-card--background-color, #1e1e1e);
|
|
113
127
|
color: #ffffff;
|
|
114
|
-
border-color: #1e1e1e;
|
|
115
128
|
}
|
|
116
129
|
@container (width < 230px) {
|
|
117
130
|
.ad-card {
|
|
@@ -221,6 +234,9 @@ const handleAdClick = () => {
|
|
|
221
234
|
min-height: 0.875rem;
|
|
222
235
|
}
|
|
223
236
|
}
|
|
237
|
+
:global([data-theme="dark"]) .ad-card__description {
|
|
238
|
+
color: #d1d5db;
|
|
239
|
+
}
|
|
224
240
|
.ad-card__price {
|
|
225
241
|
font-size: 1.6875rem;
|
|
226
242
|
font-weight: 700;
|
|
@@ -230,6 +246,7 @@ const handleAdClick = () => {
|
|
|
230
246
|
gap: 0.625rem;
|
|
231
247
|
min-width: 0;
|
|
232
248
|
white-space: nowrap;
|
|
249
|
+
color: var(--_ad-card--price-color);
|
|
233
250
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
234
251
|
}
|
|
235
252
|
@container (width < 230px) {
|
|
@@ -259,6 +276,9 @@ const handleAdClick = () => {
|
|
|
259
276
|
line-height: 0.875rem;
|
|
260
277
|
}
|
|
261
278
|
}
|
|
279
|
+
:global([data-theme="dark"]) .ad-card__price-info-label {
|
|
280
|
+
color: #d1d5db;
|
|
281
|
+
}
|
|
262
282
|
.ad-card__button {
|
|
263
283
|
width: 100%;
|
|
264
284
|
}
|
|
@@ -3,6 +3,11 @@ import type { AdCardModel } from './types';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
ad: AdCardModel;
|
|
5
5
|
trackingParams: TrackingParams;
|
|
6
|
+
colors: {
|
|
7
|
+
background?: string | null;
|
|
8
|
+
price?: string | null;
|
|
9
|
+
buttonBackground?: string | null;
|
|
10
|
+
};
|
|
6
11
|
inert?: boolean;
|
|
7
12
|
on?: {
|
|
8
13
|
click?: (id: string) => void;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { ContentPlayerLocalization } from './content-player-localization';
|
|
11
|
-
import { handleEsc } from '../core/document.event-handlers';
|
|
1
|
+
<script lang="ts">import { handleEsc } from '../core/document.event-handlers';
|
|
12
2
|
import { PostViewer } from '../posts/post-viewer';
|
|
13
3
|
import { Loading } from '../ui/loading';
|
|
14
4
|
import { PlayerSlider } from '../ui/player/slider';
|
|
@@ -16,23 +6,10 @@ import { SwipeIndicator } from '../ui/swipe-indicator';
|
|
|
16
6
|
import { default as ControlsAndAttachments } from './controls-and-attachments.svelte';
|
|
17
7
|
import { default as Header } from './header.svelte';
|
|
18
8
|
import { default as OverviewPanel } from './overview-panel.svelte';
|
|
19
|
-
import {
|
|
9
|
+
import {} from 'svelte';
|
|
20
10
|
let { config, nonPostItemView, overviewPanelContent } = $props();
|
|
21
|
-
const localization = new ContentPlayerLocalization(config.settings.locale);
|
|
22
11
|
let everTouched = $state(false);
|
|
23
12
|
const uiManager = config.uiManager;
|
|
24
|
-
onMount(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
-
uiManager.overviewCollapsed = window && window.innerWidth < window.innerHeight;
|
|
26
|
-
}));
|
|
27
|
-
$effect(() => {
|
|
28
|
-
var _a;
|
|
29
|
-
void ((_a = config.playerBuffer) === null || _a === void 0 ? void 0 : _a.current);
|
|
30
|
-
untrack(() => {
|
|
31
|
-
if (uiManager.viewInitialized && uiManager.isMobileView) {
|
|
32
|
-
uiManager.overviewCollapsed = true;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
13
|
const handleContentPlayerMounted = (node) => {
|
|
37
14
|
const markAsTouched = () => {
|
|
38
15
|
everTouched = true;
|
|
@@ -106,15 +83,14 @@ const handleSliderMounted = (node) => {
|
|
|
106
83
|
}
|
|
107
84
|
};
|
|
108
85
|
};
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const values = [
|
|
112
|
-
`--_content-player--padding: ${uiManager.mediaCenterHeaderHeight ? uiManager.mediaCenterHeaderHeight : PLAYER_PADDING_VERTICAL}px 0 ${PLAYER_PADDING_VERTICAL}px`,
|
|
113
|
-
`--_content-player--watermark--left-indent: ${uiManager.overviewWidth + uiManager.safeAreaSize}px`
|
|
114
|
-
];
|
|
86
|
+
const styles = $derived.by(() => {
|
|
87
|
+
const values = [`--_content-player--watermark--left-indent: ${uiManager.safeAreaSize}px`];
|
|
115
88
|
if (uiManager.backgroundImageUrl) {
|
|
116
89
|
values.push(`--_content-player--background-image-url: url(${uiManager.backgroundImageUrl})`);
|
|
117
90
|
}
|
|
91
|
+
if (config.playerColors.playerBackground) {
|
|
92
|
+
values.push(`--content-player-container--background: ${config.playerColors.playerBackground}`);
|
|
93
|
+
}
|
|
118
94
|
return values.join(';');
|
|
119
95
|
});
|
|
120
96
|
</script>
|
|
@@ -147,13 +123,8 @@ const variables = $derived.by(() => {
|
|
|
147
123
|
class:content-player-container--background-enabled={!config.settings.disableBackground}
|
|
148
124
|
class:content-player-container--background-loading={!config.settings.disableBackground && !uiManager.backgroundImageUrl}
|
|
149
125
|
class:content-player-container--faded={config.fadeContent}
|
|
150
|
-
style={
|
|
151
|
-
<Header config={config}
|
|
152
|
-
{#if overviewPanelContent}
|
|
153
|
-
<OverviewPanel contentFaded={config.fadeContent} uiManager={uiManager}>
|
|
154
|
-
{@render overviewPanelContent()}
|
|
155
|
-
</OverviewPanel>
|
|
156
|
-
{/if}
|
|
126
|
+
style={styles}>
|
|
127
|
+
<Header config={config} />
|
|
157
128
|
<div class="content-player" use:handleContentPlayerMounted>
|
|
158
129
|
{#if config.settings.showStreamsCloudWatermark}
|
|
159
130
|
<div class="content-player__watermark">
|
|
@@ -168,9 +139,16 @@ const variables = $derived.by(() => {
|
|
|
168
139
|
{#snippet children({ item })}
|
|
169
140
|
{@const postModel = config.itemAsPostViewerModel(item)}
|
|
170
141
|
<div class="content-player__content">
|
|
142
|
+
{#if overviewPanelContent}
|
|
143
|
+
<OverviewPanel config={config} contentFaded={config.fadeContent} uiManager={uiManager}>
|
|
144
|
+
{@render overviewPanelContent()}
|
|
145
|
+
</OverviewPanel>
|
|
146
|
+
{/if}
|
|
147
|
+
|
|
171
148
|
{#if postModel}
|
|
172
149
|
<PostViewer
|
|
173
150
|
model={postModel}
|
|
151
|
+
controlsColors={{ active: config.playerColors.button, inactive: config.playerColors.buttonInactive }}
|
|
174
152
|
trackingParams={config.trackingParams}
|
|
175
153
|
socialInteractionsHandler={config.socialInteractionsHandler}
|
|
176
154
|
enableAttachments={config.uiManager.showPostOverlayAttachments}
|
|
@@ -200,6 +178,9 @@ const variables = $derived.by(() => {
|
|
|
200
178
|
<Loading positionFixedCenter={true} timeout={1000} />
|
|
201
179
|
{/if}
|
|
202
180
|
</div>
|
|
181
|
+
{#if config.mediaCenterMobileFooter}
|
|
182
|
+
{@render config.mediaCenterMobileFooter()}
|
|
183
|
+
{/if}
|
|
203
184
|
</div>
|
|
204
185
|
|
|
205
186
|
<style>@keyframes fadeIn {
|
|
@@ -214,6 +195,7 @@ const variables = $derived.by(() => {
|
|
|
214
195
|
}
|
|
215
196
|
}
|
|
216
197
|
.content-player-container {
|
|
198
|
+
--_content-player-container--background: var(--content-player-container--background);
|
|
217
199
|
--content-player--elements-opacity: 1;
|
|
218
200
|
width: 100%;
|
|
219
201
|
min-width: 100%;
|
|
@@ -223,8 +205,16 @@ const variables = $derived.by(() => {
|
|
|
223
205
|
max-height: 100%;
|
|
224
206
|
container-type: inline-size;
|
|
225
207
|
display: flex;
|
|
208
|
+
flex-direction: column;
|
|
226
209
|
position: relative;
|
|
227
210
|
}
|
|
211
|
+
.content-player-container:before {
|
|
212
|
+
content: "";
|
|
213
|
+
position: absolute;
|
|
214
|
+
inset: 0;
|
|
215
|
+
backdrop-filter: blur(30px);
|
|
216
|
+
background-color: var(--_content-player-container--background);
|
|
217
|
+
}
|
|
228
218
|
.content-player-container--background-enabled {
|
|
229
219
|
background-color: #c1c1c1;
|
|
230
220
|
background-image: var(--_content-player--background-image-url);
|
|
@@ -241,8 +231,8 @@ const variables = $derived.by(() => {
|
|
|
241
231
|
.content-player {
|
|
242
232
|
display: flex;
|
|
243
233
|
flex: 1;
|
|
244
|
-
|
|
245
|
-
|
|
234
|
+
min-height: 0;
|
|
235
|
+
padding: 0.625rem 0;
|
|
246
236
|
position: relative;
|
|
247
237
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
248
238
|
}
|
|
@@ -28,9 +28,20 @@ export declare class ContentPlayerConfig<T extends {
|
|
|
28
28
|
playerSliderCallbacks?: PlayerSliderCallbacks;
|
|
29
29
|
trackingParams?: ContentPlayerTrackingParams | null;
|
|
30
30
|
});
|
|
31
|
-
get
|
|
31
|
+
get mediaCenterHeader(): MediaCenterData['header'] | null;
|
|
32
|
+
get mediaCenterMobileFooter(): MediaCenterData['mobileFooter'] | null;
|
|
33
|
+
get playerColors(): {
|
|
34
|
+
brand: string | null;
|
|
35
|
+
button: string | null;
|
|
36
|
+
buttonInactive: string | null;
|
|
37
|
+
cardButton: string | null;
|
|
38
|
+
cardBackground: string | null;
|
|
39
|
+
playerBackground: string | null;
|
|
40
|
+
price: string | null;
|
|
41
|
+
salePrice: string | null;
|
|
42
|
+
sidebarBackground: string | null;
|
|
43
|
+
};
|
|
32
44
|
get mediaCenterCallbacks(): MediaCenterData['callbacks'] | null;
|
|
33
|
-
get playerLogo(): string | null;
|
|
34
45
|
get fadeContent(): boolean;
|
|
35
46
|
get trackingParams(): ContentPlayerConfig<T>['_trackingParams'];
|
|
36
47
|
itemAsPostViewerModel: (item: T & {
|
|
@@ -23,15 +23,18 @@ export class ContentPlayerConfig {
|
|
|
23
23
|
this.socialInteractionsHandler = socialInteractionsHandler;
|
|
24
24
|
this._mappers = mappers;
|
|
25
25
|
}
|
|
26
|
-
get
|
|
27
|
-
return this._mediaCenterData?.
|
|
26
|
+
get mediaCenterHeader() {
|
|
27
|
+
return this._mediaCenterData?.header || null;
|
|
28
|
+
}
|
|
29
|
+
get mediaCenterMobileFooter() {
|
|
30
|
+
return this._mediaCenterData?.mobileFooter || null;
|
|
31
|
+
}
|
|
32
|
+
get playerColors() {
|
|
33
|
+
return this.settings.playerColors;
|
|
28
34
|
}
|
|
29
35
|
get mediaCenterCallbacks() {
|
|
30
36
|
return this._mediaCenterData?.callbacks || null;
|
|
31
37
|
}
|
|
32
|
-
get playerLogo() {
|
|
33
|
-
return this._mediaCenterData?.playerLogo || null;
|
|
34
|
-
}
|
|
35
38
|
get fadeContent() {
|
|
36
39
|
return this._mediaCenterData?.overlayIsActive || false;
|
|
37
40
|
}
|
|
@@ -4,6 +4,7 @@ export declare class ContentPlayerSettings {
|
|
|
4
4
|
enableCloseButton: boolean;
|
|
5
5
|
locale: Locale;
|
|
6
6
|
showStreamsCloudWatermark: boolean;
|
|
7
|
+
playerColors: NonNullable<IContentPlayerSettingsInitializer['playerColors']>;
|
|
7
8
|
constructor(init?: IContentPlayerSettingsInitializer);
|
|
8
9
|
}
|
|
9
10
|
export interface IContentPlayerSettingsInitializer {
|
|
@@ -11,4 +12,15 @@ export interface IContentPlayerSettingsInitializer {
|
|
|
11
12
|
hideCloseButton?: boolean;
|
|
12
13
|
locale?: Locale;
|
|
13
14
|
showStreamsCloudWatermark?: boolean;
|
|
15
|
+
playerColors?: {
|
|
16
|
+
brand: string | null;
|
|
17
|
+
button: string | null;
|
|
18
|
+
buttonInactive: string | null;
|
|
19
|
+
cardButton: string | null;
|
|
20
|
+
cardBackground: string | null;
|
|
21
|
+
playerBackground: string | null;
|
|
22
|
+
price: string | null;
|
|
23
|
+
salePrice: string | null;
|
|
24
|
+
sidebarBackground: string | null;
|
|
25
|
+
} | null;
|
|
14
26
|
}
|
|
@@ -3,12 +3,24 @@ export class ContentPlayerSettings {
|
|
|
3
3
|
enableCloseButton = true;
|
|
4
4
|
locale = 'en';
|
|
5
5
|
showStreamsCloudWatermark = false;
|
|
6
|
+
playerColors = {
|
|
7
|
+
brand: null,
|
|
8
|
+
button: null,
|
|
9
|
+
buttonInactive: null,
|
|
10
|
+
cardButton: null,
|
|
11
|
+
cardBackground: null,
|
|
12
|
+
playerBackground: null,
|
|
13
|
+
price: null,
|
|
14
|
+
salePrice: null,
|
|
15
|
+
sidebarBackground: null
|
|
16
|
+
};
|
|
6
17
|
constructor(init) {
|
|
7
18
|
if (init) {
|
|
8
19
|
this.disableBackground = init.disableBackground ?? this.disableBackground;
|
|
9
20
|
this.enableCloseButton = init.hideCloseButton !== undefined ? !init.hideCloseButton : this.enableCloseButton;
|
|
10
21
|
this.locale = init.locale ?? this.locale;
|
|
11
22
|
this.showStreamsCloudWatermark = init.showStreamsCloudWatermark ?? this.showStreamsCloudWatermark;
|
|
23
|
+
this.playerColors = init?.playerColors ?? this.playerColors;
|
|
12
24
|
}
|
|
13
25
|
}
|
|
14
26
|
}
|
|
@@ -33,8 +33,6 @@ const trackAttachmentsPanelSize = (node) => {
|
|
|
33
33
|
const variables = $derived.by(() => {
|
|
34
34
|
const values = [
|
|
35
35
|
`--_controls-and-attachments--attachments--max-width: ${uiManager.attachmentsMaxWidth}px`,
|
|
36
|
-
`--_controls-and-attachments--logo--max-width: ${uiManager.attachmentsMaxWidth}px`,
|
|
37
|
-
`--_controls-and-attachments--logo--height: ${uiManager.mediaCenterHeaderHeight || 72}px`,
|
|
38
36
|
`--_controls-and-attachments--width: ${uiManager.sidePanelsMaxWidth}px`
|
|
39
37
|
];
|
|
40
38
|
return values.join(';');
|
|
@@ -42,12 +40,14 @@ const variables = $derived.by(() => {
|
|
|
42
40
|
</script>
|
|
43
41
|
|
|
44
42
|
{#if !uiManager.showPostOverlayControls}
|
|
45
|
-
<div class="controls-and-attachments"
|
|
43
|
+
<div class="controls-and-attachments" style={variables}>
|
|
46
44
|
<div class="controls-and-attachments__spacer"> </div>
|
|
47
45
|
<div class="controls-and-attachments__left">
|
|
48
46
|
{#if currentItemPostContainer}
|
|
49
47
|
<PostControls
|
|
50
48
|
model={currentItemPostContainer}
|
|
49
|
+
activeColor={config.playerColors.button}
|
|
50
|
+
inactiveColor={config.playerColors.buttonInactive}
|
|
51
51
|
socialInteractionsHandler={config.socialInteractionsHandler}
|
|
52
52
|
on={{ attachmentsClicked: changeShowAttachments }} />
|
|
53
53
|
{/if}
|
|
@@ -57,24 +57,33 @@ const variables = $derived.by(() => {
|
|
|
57
57
|
class:controls-and-attachments__navigation-buttons--invisible={config.playerBuffer.loaded.length <= 1}>
|
|
58
58
|
<PlayerButton
|
|
59
59
|
icon={IconChevronUp}
|
|
60
|
+
activeColor={config.playerColors.button}
|
|
61
|
+
inactiveColor={config.playerColors.buttonInactive}
|
|
60
62
|
disabled={!config.playerBuffer.canLoadPrevious}
|
|
61
63
|
scaleEffect={true}
|
|
62
64
|
on={{ click: config.playerBuffer.loadPrevious }} />
|
|
63
|
-
<PlayerButton
|
|
65
|
+
<PlayerButton
|
|
66
|
+
icon={IconChevronDown}
|
|
67
|
+
activeColor={config.playerColors.button}
|
|
68
|
+
inactiveColor={config.playerColors.buttonInactive}
|
|
69
|
+
disabled={!config.playerBuffer.canLoadNext}
|
|
70
|
+
scaleEffect={true}
|
|
71
|
+
on={{ click: config.playerBuffer.loadNext }} />
|
|
64
72
|
</div>
|
|
65
73
|
{/if}
|
|
66
74
|
</div>
|
|
67
75
|
<div class="controls-and-attachments__right" use:trackAttachmentsPanelSize>
|
|
68
76
|
{#if !uiManager.showPostOverlayAttachments}
|
|
69
|
-
{#if config.playerLogo}
|
|
70
|
-
<div class="controls-and-attachments__player-logo">
|
|
71
|
-
<img src={config.playerLogo} class="controls-and-attachments__logo-img" alt="Player Logo" />
|
|
72
|
-
</div>
|
|
73
|
-
{/if}
|
|
74
77
|
{#if currentItemPostContainer && !attachmentsCollapsed && currentItemPostContainer.attachments}
|
|
75
78
|
<div class="controls-and-attachments__post-attachments" transition:slideHorizontally|local>
|
|
76
79
|
<PostAttachments
|
|
77
80
|
model={currentItemPostContainer}
|
|
81
|
+
colors={{
|
|
82
|
+
background: config.playerColors.cardBackground,
|
|
83
|
+
price: config.playerColors.price,
|
|
84
|
+
salePrice: config.playerColors.salePrice,
|
|
85
|
+
buttonBackground: config.playerColors.cardButton
|
|
86
|
+
}}
|
|
78
87
|
trackingParams={config.trackingParams}
|
|
79
88
|
locale={config.settings.locale}
|
|
80
89
|
on={{
|
|
@@ -87,7 +96,7 @@ const variables = $derived.by(() => {
|
|
|
87
96
|
{/if}
|
|
88
97
|
{/if}
|
|
89
98
|
</div>
|
|
90
|
-
<div class="controls-and-attachments__spacer"> </div>
|
|
99
|
+
<div class="controls-and-attachments__spacer controls-and-attachments__spacer--right"> </div>
|
|
91
100
|
</div>
|
|
92
101
|
{/if}
|
|
93
102
|
|
|
@@ -110,16 +119,16 @@ const variables = $derived.by(() => {
|
|
|
110
119
|
width: var(--_controls-and-attachments--width);
|
|
111
120
|
display: flex;
|
|
112
121
|
justify-content: space-between;
|
|
113
|
-
padding: 1.
|
|
122
|
+
padding: 0.625rem 0 1.875rem 0;
|
|
114
123
|
pointer-events: none;
|
|
115
124
|
}
|
|
116
|
-
.controls-and-attachments--with-logo {
|
|
117
|
-
padding-top: 0;
|
|
118
|
-
}
|
|
119
125
|
.controls-and-attachments__spacer {
|
|
120
|
-
flex: 0 1 1.
|
|
126
|
+
flex: 0 1 1.875rem;
|
|
121
127
|
min-width: 0;
|
|
122
128
|
}
|
|
129
|
+
.controls-and-attachments__spacer--right {
|
|
130
|
+
flex-basis: 1.25rem;
|
|
131
|
+
}
|
|
123
132
|
.controls-and-attachments__left {
|
|
124
133
|
display: flex;
|
|
125
134
|
flex-direction: column;
|
|
@@ -135,21 +144,6 @@ const variables = $derived.by(() => {
|
|
|
135
144
|
align-items: flex-end;
|
|
136
145
|
flex-direction: column;
|
|
137
146
|
}
|
|
138
|
-
.controls-and-attachments__player-logo {
|
|
139
|
-
width: var(--_controls-and-attachments--logo--max-width);
|
|
140
|
-
max-width: var(--_controls-and-attachments--logo--max-width);
|
|
141
|
-
height: var(--_controls-and-attachments--logo--height);
|
|
142
|
-
min-height: var(--_controls-and-attachments--logo--height);
|
|
143
|
-
max-height: var(--_controls-and-attachments--logo--height);
|
|
144
|
-
display: flex;
|
|
145
|
-
justify-content: center;
|
|
146
|
-
align-items: center;
|
|
147
|
-
}
|
|
148
|
-
.controls-and-attachments__logo-img {
|
|
149
|
-
width: 6.25rem;
|
|
150
|
-
min-width: 6.25rem;
|
|
151
|
-
max-width: 6.25rem;
|
|
152
|
-
}
|
|
153
147
|
.controls-and-attachments__post-attachments {
|
|
154
148
|
flex: 1 1 auto;
|
|
155
149
|
width: var(--_controls-and-attachments--attachments--max-width);
|
|
@@ -159,30 +153,7 @@ const variables = $derived.by(() => {
|
|
|
159
153
|
overflow-y: auto;
|
|
160
154
|
opacity: var(--content-player--elements-opacity);
|
|
161
155
|
transition: opacity 0.3s ease-in-out;
|
|
162
|
-
|
|
163
|
-
--_cross-browser-scrollbar--track-color: transparent;
|
|
164
|
-
}
|
|
165
|
-
.controls-and-attachments__post-attachments:hover {
|
|
166
|
-
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #7d7d7d);
|
|
167
|
-
--_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
|
|
168
|
-
}
|
|
169
|
-
.controls-and-attachments__post-attachments::-webkit-scrollbar {
|
|
170
|
-
width: 6px;
|
|
171
|
-
height: 6px;
|
|
172
|
-
}
|
|
173
|
-
.controls-and-attachments__post-attachments::-webkit-scrollbar-track {
|
|
174
|
-
background: var(--_cross-browser-scrollbar--track-color);
|
|
175
|
-
border-radius: 100vw;
|
|
176
|
-
}
|
|
177
|
-
.controls-and-attachments__post-attachments::-webkit-scrollbar-thumb {
|
|
178
|
-
background: var(--_cross-browser-scrollbar--thumb-color);
|
|
179
|
-
border-radius: 100vw;
|
|
180
|
-
}
|
|
181
|
-
@supports (scrollbar-color: transparent transparent) {
|
|
182
|
-
.controls-and-attachments__post-attachments {
|
|
183
|
-
scrollbar-color: var(--_cross-browser-scrollbar--thumb-color) var(--_cross-browser-scrollbar--track-color);
|
|
184
|
-
scrollbar-width: thin;
|
|
185
|
-
}
|
|
156
|
+
scrollbar-width: none;
|
|
186
157
|
}
|
|
187
158
|
.controls-and-attachments__navigation-buttons {
|
|
188
159
|
display: flex;
|
|
@@ -1,137 +1,15 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _a;
|
|
10
|
-
if (overviewPanelContent) {
|
|
11
|
-
(_a = config.mediaCenterCallbacks) === null || _a === void 0 ? void 0 : _a.onExtraActionsForMobileControlsPanelDetermined([
|
|
12
|
-
{
|
|
13
|
-
name: localization.overviewLabel,
|
|
14
|
-
callback: () => (config.uiManager.overviewCollapsed = !config.uiManager.overviewCollapsed)
|
|
15
|
-
}
|
|
16
|
-
]);
|
|
17
|
-
}
|
|
18
|
-
const heightResizeObserver = new ResizeObserver(() => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
const headerHeight = node.clientHeight;
|
|
21
|
-
uiManager.mediaCenterHeaderHeight = headerHeight;
|
|
22
|
-
if ((_a = config.mediaCenterCallbacks) === null || _a === void 0 ? void 0 : _a.onHeaderHeightChanged) {
|
|
23
|
-
(_b = config.mediaCenterCallbacks) === null || _b === void 0 ? void 0 : _b.onHeaderHeightChanged({ height: headerHeight });
|
|
24
|
-
}
|
|
1
|
+
<script lang="ts">import { ContentPlayerConfig } from './content-player-config.svelte';
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
let { config } = $props();
|
|
4
|
+
onMount(() => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
(_a = config.mediaCenterCallbacks) === null || _a === void 0 ? void 0 : _a.onPlayerInitialized({
|
|
7
|
+
closePlayerFn: config.settings.enableCloseButton && ((_b = config.callbacks) === null || _b === void 0 ? void 0 : _b.close) ? config.callbacks.close : null,
|
|
8
|
+
extraActionsForMobilePanel: []
|
|
25
9
|
});
|
|
26
|
-
heightResizeObserver.observe(node);
|
|
27
|
-
return {
|
|
28
|
-
destroy: () => {
|
|
29
|
-
heightResizeObserver.disconnect();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const headerVariables = $derived.by(() => {
|
|
34
|
-
const maxHeaderWidth = Math.min(uiManager.contentViewWidth * 1.4, uiManager.playerTotalWidth);
|
|
35
|
-
const maxOverhang = 0.2 * uiManager.contentViewWidth;
|
|
36
|
-
const contentStart = (uiManager.playerTotalWidth - uiManager.contentViewWidth) / 2;
|
|
37
|
-
// Pre-calculate if overview will affect layout when fully opened
|
|
38
|
-
const willOverviewAffectLayout = uiManager.overviewWidth > 0 && uiManager.overviewMaxWidth < uiManager.sidePanelsMaxWidth;
|
|
39
|
-
// Check if header will actually compress (change position)
|
|
40
|
-
const willHeaderCompress = willOverviewAffectLayout && uiManager.overviewMaxWidth > contentStart - maxOverhang;
|
|
41
|
-
const values = [
|
|
42
|
-
`--_content-player-header--padding-inline: ${uiManager.safeAreaSize}px`,
|
|
43
|
-
`--_content-player-header--media-center--max-width: ${maxHeaderWidth}px`
|
|
44
|
-
];
|
|
45
|
-
if (!willOverviewAffectLayout) {
|
|
46
|
-
// Header is symmetric
|
|
47
|
-
const offset = (uiManager.playerTotalWidth - maxHeaderWidth) / 2;
|
|
48
|
-
values.push(`--_content-player-header--left: ${offset}px`);
|
|
49
|
-
values.push(`--_content-player-header--right: ${offset}px`);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// Overview affects layout
|
|
53
|
-
const rightOffset = contentStart - maxOverhang;
|
|
54
|
-
// Animate if header will compress, otherwise use static value
|
|
55
|
-
const effectiveOverviewWidth = willHeaderCompress ? uiManager.overviewWidth : uiManager.overviewMaxWidth;
|
|
56
|
-
const leftOffset = Math.max(contentStart - maxOverhang, effectiveOverviewWidth);
|
|
57
|
-
values.push(`--_content-player-header--left: ${leftOffset}px`);
|
|
58
|
-
values.push(`--_content-player-header--right: ${rightOffset}px`);
|
|
59
|
-
}
|
|
60
|
-
return values.join(';');
|
|
61
|
-
});
|
|
62
|
-
const buttonVariables = $derived.by(() => {
|
|
63
|
-
// Button always moves when overview affects layout - animate it
|
|
64
|
-
const willOverviewAffectLayout = uiManager.overviewWidth > 0 && uiManager.overviewMaxWidth < uiManager.sidePanelsMaxWidth;
|
|
65
|
-
const effectiveOverviewWidth = willOverviewAffectLayout ? uiManager.overviewWidth : 0;
|
|
66
|
-
const values = [`--_content-player-header--close-button--left-indent: ${effectiveOverviewWidth}px`];
|
|
67
|
-
return values.join(';');
|
|
68
10
|
});
|
|
69
11
|
</script>
|
|
70
12
|
|
|
71
|
-
{#if config.
|
|
72
|
-
|
|
73
|
-
{@render config.mediaCenterControlsPanel()}
|
|
74
|
-
</div>
|
|
75
|
-
{:else if overviewPanelContent}
|
|
76
|
-
<div class="overview-button">
|
|
77
|
-
<PlayerButton icon={IconLineHorizontal3} on={{ click: () => (config.uiManager.overviewCollapsed = !config.uiManager.overviewCollapsed) }} />
|
|
78
|
-
</div>
|
|
79
|
-
{/if}
|
|
80
|
-
|
|
81
|
-
{#if config.settings.enableCloseButton && config.callbacks?.close}
|
|
82
|
-
<div class="close-button" style={buttonVariables}>
|
|
83
|
-
<PlayerButton icon={IconDismiss} on={{ click: config.callbacks.close }} />
|
|
84
|
-
</div>
|
|
13
|
+
{#if config.mediaCenterHeader}
|
|
14
|
+
{@render config.mediaCenterHeader()}
|
|
85
15
|
{/if}
|
|
86
|
-
|
|
87
|
-
<style>@keyframes fadeIn {
|
|
88
|
-
0% {
|
|
89
|
-
opacity: 1;
|
|
90
|
-
}
|
|
91
|
-
50% {
|
|
92
|
-
opacity: 0.4;
|
|
93
|
-
}
|
|
94
|
-
100% {
|
|
95
|
-
opacity: 1;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
.content-player-header {
|
|
99
|
-
position: absolute;
|
|
100
|
-
inset: 0;
|
|
101
|
-
left: var(--_content-player-header--left);
|
|
102
|
-
right: var(--_content-player-header--right);
|
|
103
|
-
bottom: auto;
|
|
104
|
-
padding: 0.75rem var(--_content-player-header--padding-inline);
|
|
105
|
-
pointer-events: none;
|
|
106
|
-
z-index: 1;
|
|
107
|
-
display: flex;
|
|
108
|
-
justify-content: var(--_content-player-header--justify-content, center);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.close-button {
|
|
112
|
-
position: absolute;
|
|
113
|
-
top: 0.9375rem;
|
|
114
|
-
left: calc(var(--_content-player-header--close-button--left-indent) + 0.625rem);
|
|
115
|
-
z-index: 1;
|
|
116
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
117
|
-
}
|
|
118
|
-
@container (width < 576px) {
|
|
119
|
-
.close-button {
|
|
120
|
-
left: unset;
|
|
121
|
-
right: 0.625rem;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.overview-button {
|
|
126
|
-
display: none;
|
|
127
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
128
|
-
}
|
|
129
|
-
@container (width < 576px) {
|
|
130
|
-
.overview-button {
|
|
131
|
-
display: block;
|
|
132
|
-
position: absolute;
|
|
133
|
-
top: 0.9375rem;
|
|
134
|
-
left: 0.625rem;
|
|
135
|
-
z-index: 1;
|
|
136
|
-
}
|
|
137
|
-
}</style>
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { ContentPlayerConfig } from './content-player-config.svelte';
|
|
2
|
-
import { ContentPlayerLocalization } from './content-player-localization';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
2
|
declare class __sveltets_Render<T extends {
|
|
5
3
|
id: string;
|
|
6
4
|
}> {
|
|
7
5
|
props(): {
|
|
8
6
|
config: ContentPlayerConfig<T>;
|
|
9
|
-
localization: ContentPlayerLocalization;
|
|
10
|
-
overviewPanelContent?: Snippet;
|
|
11
7
|
};
|
|
12
8
|
events(): {};
|
|
13
9
|
slots(): {};
|