@streamscloud/embeddable 15.0.3 → 15.1.0-1770736445096
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 +15 -21
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +0 -5
- package/dist/core/theme/brand-colors.svelte.d.ts +33 -0
- package/dist/core/theme/brand-colors.svelte.js +26 -0
- package/dist/core/theme/index.d.ts +3 -2
- package/dist/core/theme/index.js +1 -1
- package/dist/external-api/data-providers/internal-media-center-data-provider.svelte.js +2 -5
- package/dist/media-center/config/types.d.ts +0 -3
- package/dist/media-center/media-center/cmp.media-center-proxy.svelte +2 -9
- package/dist/media-center/media-center/footer/media-center-footer.svelte +1 -1
- package/dist/media-center/media-center/handlers/media-center-settings-handler.svelte.d.ts +1 -11
- package/dist/media-center/media-center/handlers/media-center-settings-handler.svelte.js +3 -14
- package/dist/media-center/media-center/header/media-center-header.svelte +8 -27
- package/dist/media-center/media-center/media-center-context.svelte.d.ts +0 -2
- package/dist/media-center/media-center/media-center-context.svelte.js +0 -3
- package/dist/media-center/media-center/menu/menu.svelte +2 -9
- package/dist/media-center/media-center/moments/cmp.moments-circle.svelte +1 -9
- package/dist/posts/attachments/cmp.attachments.svelte +6 -3
- package/dist/posts/attachments/cmp.attachments.svelte.d.ts +0 -6
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +5 -7
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +0 -4
- package/dist/posts/post-viewer/media/post-media.svelte +1 -6
- package/dist/posts/posts-player/posts-player-proxy.svelte +2 -10
- package/dist/posts/posts-player/posts-player-view.svelte +0 -7
- package/dist/posts/posts-player/types.d.ts +0 -3
- package/dist/products/product-card/cmp.product-card.svelte +4 -17
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +0 -5
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +1 -2
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +0 -4
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +4 -6
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -4
- package/dist/streams/streams-player/streams-player-proxy.svelte +2 -10
- package/dist/streams/streams-player/streams-player-view.svelte +0 -11
- package/dist/streams/streams-player/types.d.ts +0 -3
- package/dist/ui/button/resources/button-theme.svelte +5 -22
- package/dist/ui/icon/cmp.icon.svelte +0 -4
- package/dist/ui/player/button/{cmp.mobile-player-buttons-group.svelte → cmp.mobile-player-buttons.svelte} +10 -17
- package/dist/ui/player/button/cmp.player-buttons.svelte +127 -0
- package/dist/ui/player/button/{cmp.player-buttons-group.svelte.d.ts → cmp.player-buttons.svelte.d.ts} +1 -2
- package/dist/ui/player/button/cmp.responsive-player-buttons.svelte +32 -0
- package/dist/ui/player/button/{cmp.responsive-player-buttons-group.svelte.d.ts → cmp.responsive-player-buttons.svelte.d.ts} +1 -3
- package/dist/ui/player/button/index.d.ts +3 -4
- package/dist/ui/player/button/index.js +3 -4
- package/dist/ui/player/button/types.d.ts +1 -0
- package/dist/ui/player/player/cmp.player.svelte +1 -1
- package/dist/ui/player/player/controls-and-attachments.svelte +13 -26
- package/dist/ui/player/player/overview-panel.svelte +3 -9
- package/dist/ui/player/player/overview-panel.svelte.d.ts +10 -33
- package/dist/ui/player/player/player-config.svelte.d.ts +0 -1
- package/dist/ui/player/player/player-config.svelte.js +0 -3
- package/dist/ui/player/player/player-settings.svelte.d.ts +0 -5
- package/dist/ui/player/player/player-settings.svelte.js +0 -12
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte +79 -62
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte.d.ts +2 -1
- package/dist/ui/shadow-dom/colors.scss +53 -55
- package/package.json +1 -1
- package/dist/core/theme/theme-store.svelte.d.ts +0 -6
- package/dist/core/theme/theme-store.svelte.js +0 -10
- package/dist/ui/player/button/cmp.player-button.svelte +0 -74
- package/dist/ui/player/button/cmp.player-button.svelte.d.ts +0 -16
- package/dist/ui/player/button/cmp.player-buttons-group.svelte +0 -86
- package/dist/ui/player/button/cmp.responsive-player-buttons-group.svelte +0 -53
- package/dist/ui/player/colors/index.d.ts +0 -1
- package/dist/ui/player/colors/index.js +0 -1
- package/dist/ui/player/colors/player-colors.d.ts +0 -25
- package/dist/ui/player/colors/player-colors.js +0 -24
- /package/dist/ui/player/button/{cmp.mobile-player-buttons-group.svelte.d.ts → cmp.mobile-player-buttons.svelte.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import { toPriceRepresentation } from '../../products/price-helper';
|
|
|
3
3
|
import { Button, ButtonSize } from '../../ui/button';
|
|
4
4
|
import { Image } from '../../ui/image';
|
|
5
5
|
import { LineClamp } from '../../ui/line-clamp';
|
|
6
|
-
let { ad,
|
|
6
|
+
let { ad, locale, trackingParams, inert = false, on } = $props();
|
|
7
7
|
const trackImpression = (node) => {
|
|
8
8
|
if (on?.impression) {
|
|
9
9
|
const observer = new IntersectionObserver((entries) => {
|
|
@@ -31,19 +31,14 @@ const handleAdClick = () => {
|
|
|
31
31
|
window.open(enrichedLink, '_blank', 'noopener noreferrer');
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const styles = $derived.by(() => {
|
|
35
|
-
const values = [];
|
|
36
|
-
if (colors?.background) {
|
|
37
|
-
values.push(`--ad-card--background-color: ${colors.background}`);
|
|
38
|
-
}
|
|
39
|
-
if (colors?.price) {
|
|
40
|
-
values.push(`--ad-card--price-color: ${colors.price}`);
|
|
41
|
-
}
|
|
42
|
-
return values.join(';');
|
|
43
|
-
});
|
|
44
34
|
</script>
|
|
45
35
|
|
|
46
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
class="ad-card"
|
|
38
|
+
style:--ad-card--cta-background={ad.ctaButton?.background}
|
|
39
|
+
style:--ad-card--cta-text-color={ad.ctaButton?.textColor}
|
|
40
|
+
inert={inert}
|
|
41
|
+
use:trackImpression>
|
|
47
42
|
<div class="ad-card__image">
|
|
48
43
|
<Image src={ad.image} alt={ad.title} />
|
|
49
44
|
</div>
|
|
@@ -73,13 +68,7 @@ const styles = $derived.by(() => {
|
|
|
73
68
|
<div class="ad-card__button-container">
|
|
74
69
|
{#if ad.ctaButton && enrichedLink && ad.ctaButton.text}
|
|
75
70
|
<div class="ad-card__button">
|
|
76
|
-
<Button
|
|
77
|
-
size={ButtonSize.Standard}
|
|
78
|
-
on={{ click: handleAdClick }}
|
|
79
|
-
--button--font--size="1em"
|
|
80
|
-
--button--font--color={colors?.buttonBackground ? '#FFFFFF' : ad.ctaButton.textColor}
|
|
81
|
-
--button--background={colors?.buttonBackground ?? ad.ctaButton.background}
|
|
82
|
-
--button--min-width="100%">
|
|
71
|
+
<Button size={ButtonSize.Standard} on={{ click: handleAdClick }} --button--font--size="1em" --button--min-width="100%">
|
|
83
72
|
<span class="ad-card__button-text">{ad.ctaButton.text}</span>
|
|
84
73
|
</Button>
|
|
85
74
|
</div>
|
|
@@ -100,8 +89,8 @@ const styles = $derived.by(() => {
|
|
|
100
89
|
}
|
|
101
90
|
}
|
|
102
91
|
.ad-card {
|
|
103
|
-
--_ad-card--background-color: var(--ad-card--background-color, rgb(from
|
|
104
|
-
--_ad-card--border-color: var(--ad-card--
|
|
92
|
+
--_ad-card--background-color: var(--ad-card--background-color, rgb(from light-dark(#ffffff, #000000) r g b / 90%));
|
|
93
|
+
--_ad-card--border-color: var(--ad-card--border-color, light-dark(#f2f2f2, #000000));
|
|
105
94
|
--_ad-card--price-color: var(--ad-card--price-color, inherit);
|
|
106
95
|
width: 100%;
|
|
107
96
|
height: max-content;
|
|
@@ -267,6 +256,11 @@ const styles = $derived.by(() => {
|
|
|
267
256
|
}
|
|
268
257
|
.ad-card__button {
|
|
269
258
|
width: 100%;
|
|
259
|
+
--button--background: light-dark(
|
|
260
|
+
var(--sc-player--light--card-button, var(--ad-card--cta-background)),
|
|
261
|
+
var(--sc-player--dark--card-button, var(--ad-card--cta-background))
|
|
262
|
+
);
|
|
263
|
+
--button--font--color: var(--ad-card--cta-text-color);
|
|
270
264
|
}
|
|
271
265
|
.ad-card__button :global(*) {
|
|
272
266
|
width: 100%;
|
|
@@ -4,11 +4,6 @@ import type { AdCardModel } from './types';
|
|
|
4
4
|
type Props = {
|
|
5
5
|
ad: AdCardModel;
|
|
6
6
|
trackingParams: TrackingParams;
|
|
7
|
-
colors: {
|
|
8
|
-
background?: string | null;
|
|
9
|
-
price?: string | null;
|
|
10
|
-
buttonBackground?: string | null;
|
|
11
|
-
};
|
|
12
7
|
locale: Locale;
|
|
13
8
|
inert?: boolean;
|
|
14
9
|
on?: {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type BrandColorPair = {
|
|
2
|
+
light: string | null;
|
|
3
|
+
dark: string | null;
|
|
4
|
+
};
|
|
5
|
+
export type IBrandColorsInit = {
|
|
6
|
+
brand: string | null;
|
|
7
|
+
button: string | null;
|
|
8
|
+
buttonInactive: string | null;
|
|
9
|
+
cardButton: string | null;
|
|
10
|
+
cardBackground: string | null;
|
|
11
|
+
menuBackground: string | null;
|
|
12
|
+
playerBackground: string | null;
|
|
13
|
+
price: string | null;
|
|
14
|
+
salePrice: string | null;
|
|
15
|
+
sidebarBackground: string | null;
|
|
16
|
+
};
|
|
17
|
+
export declare class BrandColors {
|
|
18
|
+
brand: BrandColorPair;
|
|
19
|
+
button: BrandColorPair;
|
|
20
|
+
buttonInactive: BrandColorPair;
|
|
21
|
+
cardBackground: BrandColorPair;
|
|
22
|
+
cardButton: BrandColorPair;
|
|
23
|
+
menuBackground: BrandColorPair;
|
|
24
|
+
playerBackground: BrandColorPair;
|
|
25
|
+
price: BrandColorPair;
|
|
26
|
+
salePrice: BrandColorPair;
|
|
27
|
+
sidebarBackground: BrandColorPair;
|
|
28
|
+
set: (init: {
|
|
29
|
+
light: IBrandColorsInit | null;
|
|
30
|
+
dark: IBrandColorsInit | null;
|
|
31
|
+
}) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const brandColors: BrandColors;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const EMPTY_PAIR = { light: null, dark: null };
|
|
2
|
+
export class BrandColors {
|
|
3
|
+
brand = $state.raw(EMPTY_PAIR);
|
|
4
|
+
button = $state.raw(EMPTY_PAIR);
|
|
5
|
+
buttonInactive = $state.raw(EMPTY_PAIR);
|
|
6
|
+
cardBackground = $state.raw(EMPTY_PAIR);
|
|
7
|
+
cardButton = $state.raw(EMPTY_PAIR);
|
|
8
|
+
menuBackground = $state.raw(EMPTY_PAIR);
|
|
9
|
+
playerBackground = $state.raw(EMPTY_PAIR);
|
|
10
|
+
price = $state.raw(EMPTY_PAIR);
|
|
11
|
+
salePrice = $state.raw(EMPTY_PAIR);
|
|
12
|
+
sidebarBackground = $state.raw(EMPTY_PAIR);
|
|
13
|
+
set = (init) => {
|
|
14
|
+
this.brand = { light: init.light?.brand ?? null, dark: init.dark?.brand ?? null };
|
|
15
|
+
this.button = { light: init.light?.button ?? null, dark: init.dark?.button ?? null };
|
|
16
|
+
this.buttonInactive = { light: init.light?.buttonInactive ?? null, dark: init.dark?.buttonInactive ?? null };
|
|
17
|
+
this.cardBackground = { light: init.light?.cardBackground ?? null, dark: init.dark?.cardBackground ?? null };
|
|
18
|
+
this.cardButton = { light: init.light?.cardButton ?? null, dark: init.dark?.cardButton ?? null };
|
|
19
|
+
this.menuBackground = { light: init.light?.menuBackground ?? null, dark: init.dark?.menuBackground ?? null };
|
|
20
|
+
this.playerBackground = { light: init.light?.playerBackground ?? null, dark: init.dark?.playerBackground ?? null };
|
|
21
|
+
this.price = { light: init.light?.price ?? null, dark: init.dark?.price ?? null };
|
|
22
|
+
this.salePrice = { light: init.light?.salePrice ?? null, dark: init.dark?.salePrice ?? null };
|
|
23
|
+
this.sidebarBackground = { light: init.light?.sidebarBackground ?? null, dark: init.dark?.sidebarBackground ?? null };
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export const brandColors = new BrandColors();
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { BrandColors, brandColors } from './brand-colors.svelte';
|
|
2
|
+
export type { BrandColorPair, IBrandColorsInit } from './brand-colors.svelte';
|
|
3
|
+
export type ThemeValue = 'dark' | 'light';
|
package/dist/core/theme/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BrandColors, brandColors } from './brand-colors.svelte';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Status, StreamStatus } from '../../core/enums';
|
|
2
2
|
import { createLocalGQLClient } from '../../core/graphql';
|
|
3
|
-
import {
|
|
3
|
+
import { brandColors } from '../../core/theme';
|
|
4
4
|
import { InternalMediaCenterAnalyticsHandler } from './internal-media-center-analytics-handler';
|
|
5
5
|
import { MockCategoryFollowingProvider, MockMediaCenterContentManagementHandler, MockMembershipHandler, MockNavigationHandler, MockPostSocialInteractionsHandler } from './mocks';
|
|
6
6
|
import { GetMediaPageConfigDocument } from './operations.generated';
|
|
@@ -38,12 +38,9 @@ export class InternalMediaCenterDataProvider {
|
|
|
38
38
|
: null,
|
|
39
39
|
contentCategories: config.menuSettings?.contentCategories || [],
|
|
40
40
|
categoryTagAssociations: config.menuSettings?.contentCategoryMenuItems || [],
|
|
41
|
-
playerColors: {
|
|
42
|
-
light: new PlayerColors(null),
|
|
43
|
-
dark: new PlayerColors(config.playerColors)
|
|
44
|
-
},
|
|
45
41
|
moments: config.moments
|
|
46
42
|
};
|
|
43
|
+
brandColors.set({ light: null, dark: config.playerColors });
|
|
47
44
|
}
|
|
48
45
|
return this.model;
|
|
49
46
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PostType } from '../../core/enums';
|
|
2
|
-
import type { ThemeValue } from '../../core/theme';
|
|
3
2
|
import type { IContentCategoryFollowingHandler } from '../categories-following';
|
|
4
3
|
import type { IMediaCenterContentManagementHandler } from '../content-management';
|
|
5
4
|
import type { IMediaCenterMembershipHandler } from '../membership';
|
|
@@ -10,7 +9,6 @@ import type { IPostSocialInteractionsHandler } from '../../posts/social-interact
|
|
|
10
9
|
import type { IStreamSharingHandler } from '../../streams/sharing';
|
|
11
10
|
import type { StreamPageViewerModel } from '../../streams/stream-page-viewer/types';
|
|
12
11
|
import type { IStreamAnalyticsHandler, StreamPlayerModel } from '../../streams/streams-player/types';
|
|
13
|
-
import type { PlayerColors } from '../../ui/player/colors';
|
|
14
12
|
export interface IMediaCenterDataProvider {
|
|
15
13
|
model: MediaCenterModel | null;
|
|
16
14
|
fetchModel: () => Promise<MediaCenterModel | null>;
|
|
@@ -88,5 +86,4 @@ export type MediaCenterModel = {
|
|
|
88
86
|
backgroundColor: string;
|
|
89
87
|
} | null;
|
|
90
88
|
}[];
|
|
91
|
-
playerColors: Record<ThemeValue, PlayerColors>;
|
|
92
89
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import { Utils } from '../../core/utils';
|
|
1
|
+
<script lang="ts">import { Utils } from '../../core/utils';
|
|
3
2
|
import { Loading } from '../../ui/loading';
|
|
4
3
|
import {} from '../../ui/player/close-orchestrator';
|
|
5
4
|
import { ShadowRoot } from '../../ui/shadow-dom';
|
|
@@ -44,12 +43,6 @@ const context = untrack(() => new MediaCenterContext({
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
}));
|
|
47
|
-
$effect(() => {
|
|
48
|
-
void settings?.theme;
|
|
49
|
-
untrack(() => {
|
|
50
|
-
Theme.set(settings?.theme ?? 'dark');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
46
|
</script>
|
|
54
47
|
|
|
55
48
|
{#if context.initializing}
|
|
@@ -57,7 +50,7 @@ $effect(() => {
|
|
|
57
50
|
{:else if !context.initialized}
|
|
58
51
|
Not initialized placeholder
|
|
59
52
|
{:else}
|
|
60
|
-
<ShadowRoot {...context.backgroundWrapperProps}>
|
|
53
|
+
<ShadowRoot theme={settings?.theme ?? 'dark'} {...context.backgroundWrapperProps}>
|
|
61
54
|
<MediaCenterView context={context} dynamicActions={dynamicActions} />
|
|
62
55
|
</ShadowRoot>
|
|
63
56
|
{/if}
|
|
@@ -6,7 +6,7 @@ import IconScreenSearch from '@fluentui/svg-icons/icons/screen_search_20_regular
|
|
|
6
6
|
let { context } = $props();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<div class="media-center-footer"
|
|
9
|
+
<div class="media-center-footer" style:color-scheme="dark">
|
|
10
10
|
<div class="media-center-footer__spacer"></div>
|
|
11
11
|
<button
|
|
12
12
|
type="button"
|
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
import type { Locale } from '../../../core/locale';
|
|
2
|
-
import { type ThemeValue } from '../../../core/theme';
|
|
3
2
|
import type { IMediaCenterDataProvider } from '../../config/types';
|
|
4
|
-
import { PlayerColors } from '../../../ui/player/colors';
|
|
5
3
|
import type { MediaCenterSettings } from '../media-center-settings.svelte';
|
|
6
4
|
export declare class MediaCenterSettingsHandler {
|
|
7
5
|
private _backgroundImageUrl;
|
|
8
6
|
private _mediaCenterSettings;
|
|
9
|
-
private _dataProvider;
|
|
10
7
|
private _contentPlayerSettings;
|
|
11
8
|
constructor(init: {
|
|
12
9
|
readonly dataProvider: IMediaCenterDataProvider;
|
|
13
10
|
settings: MediaCenterSettings;
|
|
14
11
|
});
|
|
15
12
|
get playerSettings(): ContentPlayerSettingsLocal;
|
|
16
|
-
get actualMediaCenterColors(): PlayerColors;
|
|
17
13
|
get locale(): Locale;
|
|
18
14
|
get backgroundWrapperProps(): {
|
|
19
15
|
backgroundDisabled: boolean;
|
|
20
16
|
backgroundImageUrl: string | null;
|
|
21
|
-
backgroundColor?: string | null;
|
|
22
17
|
};
|
|
23
18
|
get backgroundImageLoadedHandler(): ((url: string | null) => void) | undefined;
|
|
24
19
|
setMinOverlayOffsetTop: (value: number) => void;
|
|
25
20
|
updateBackgroundImageUrl: (url: string | null | "not-applicable") => void;
|
|
26
21
|
}
|
|
27
|
-
export type MediaCenterSettingsWithColors = MediaCenterSettings & {
|
|
28
|
-
playerColors?: PlayerColors;
|
|
29
|
-
};
|
|
30
22
|
declare class ContentPlayerSettingsLocal {
|
|
31
23
|
private settings;
|
|
32
|
-
private dataProvider;
|
|
33
24
|
locale?: Locale;
|
|
34
25
|
showStreamsCloudWatermark?: boolean;
|
|
35
|
-
playerColors?: Record<ThemeValue, PlayerColors>;
|
|
36
26
|
overlayMinOffsetTop?: number;
|
|
37
|
-
constructor(settings: MediaCenterSettings
|
|
27
|
+
constructor(settings: MediaCenterSettings);
|
|
38
28
|
}
|
|
39
29
|
export {};
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
import { Theme } from '../../../core/theme';
|
|
2
|
-
import { PlayerColors } from '../../../ui/player/colors';
|
|
3
1
|
export class MediaCenterSettingsHandler {
|
|
4
2
|
_backgroundImageUrl = $state(null);
|
|
5
3
|
_mediaCenterSettings;
|
|
6
|
-
_dataProvider;
|
|
7
4
|
_contentPlayerSettings;
|
|
8
5
|
constructor(init) {
|
|
9
6
|
this._mediaCenterSettings = init.settings;
|
|
10
|
-
this.
|
|
11
|
-
this._contentPlayerSettings = new ContentPlayerSettingsLocal(this._mediaCenterSettings, this._dataProvider);
|
|
7
|
+
this._contentPlayerSettings = new ContentPlayerSettingsLocal(this._mediaCenterSettings);
|
|
12
8
|
}
|
|
13
9
|
get playerSettings() {
|
|
14
10
|
return this._contentPlayerSettings;
|
|
15
11
|
}
|
|
16
|
-
get actualMediaCenterColors() {
|
|
17
|
-
return this._dataProvider.model?.playerColors?.[Theme.get()] || new PlayerColors(null);
|
|
18
|
-
}
|
|
19
12
|
get locale() {
|
|
20
13
|
return this._mediaCenterSettings.locale;
|
|
21
14
|
}
|
|
22
15
|
get backgroundWrapperProps() {
|
|
23
16
|
return {
|
|
24
17
|
backgroundDisabled: this._mediaCenterSettings.disableBackground,
|
|
25
|
-
backgroundImageUrl: this._backgroundImageUrl
|
|
26
|
-
backgroundColor: this.actualMediaCenterColors.playerBackground
|
|
18
|
+
backgroundImageUrl: this._backgroundImageUrl
|
|
27
19
|
};
|
|
28
20
|
}
|
|
29
21
|
get backgroundImageLoadedHandler() {
|
|
@@ -38,13 +30,10 @@ export class MediaCenterSettingsHandler {
|
|
|
38
30
|
}
|
|
39
31
|
class ContentPlayerSettingsLocal {
|
|
40
32
|
settings;
|
|
41
|
-
dataProvider;
|
|
42
33
|
locale = $derived.by(() => this.settings.locale);
|
|
43
34
|
showStreamsCloudWatermark = $derived.by(() => this.settings.showStreamsCloudWatermark);
|
|
44
|
-
playerColors = $derived.by(() => this.dataProvider.model?.playerColors);
|
|
45
35
|
overlayMinOffsetTop = $state(0);
|
|
46
|
-
constructor(settings
|
|
36
|
+
constructor(settings) {
|
|
47
37
|
this.settings = settings;
|
|
48
|
-
this.dataProvider = dataProvider;
|
|
49
38
|
}
|
|
50
39
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { horizontalWheelScroll } from '../../../core/actions';
|
|
2
2
|
import { Icon } from '../../../ui/icon';
|
|
3
|
-
import {
|
|
3
|
+
import { PlayerButtons } from '../../../ui/player/button';
|
|
4
4
|
import { MediaCenterHeaderLocalization } from './media-center-header-localization';
|
|
5
5
|
import IconCart from '@fluentui/svg-icons/icons/cart_20_regular.svg?raw';
|
|
6
6
|
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_28_regular.svg?raw';
|
|
@@ -112,24 +112,11 @@ const updateScrollShadows = (scrollArea) => {
|
|
|
112
112
|
scrollArea.classList.toggle('has-right-mask', scrollHasRight && !scrollHasLeft);
|
|
113
113
|
scrollArea.classList.toggle('has-both-masks', scrollHasRight && scrollHasLeft);
|
|
114
114
|
};
|
|
115
|
-
const styles = $derived.by(() => {
|
|
116
|
-
const values = [];
|
|
117
|
-
if (context.mediaCenterColors.button) {
|
|
118
|
-
values.push(`--media-center-header--button-color: ${context.mediaCenterColors.button}`);
|
|
119
|
-
}
|
|
120
|
-
if (context.mediaCenterColors.buttonInactive) {
|
|
121
|
-
values.push(`--media-center-header--button-color--inactive: ${context.mediaCenterColors.buttonInactive}`);
|
|
122
|
-
}
|
|
123
|
-
if (context.mediaCenterColors.brand) {
|
|
124
|
-
values.push(`--media-center-header--button-indicator: ${context.mediaCenterColors.brand}`);
|
|
125
|
-
}
|
|
126
|
-
return values.join(';');
|
|
127
|
-
});
|
|
128
115
|
</script>
|
|
129
116
|
|
|
130
117
|
<div class="media-center-header-container" use:headerMounted>
|
|
131
118
|
<div class="spacer"></div>
|
|
132
|
-
<div class="media-center-header"
|
|
119
|
+
<div class="media-center-header">
|
|
133
120
|
{#if context.model?.logo}
|
|
134
121
|
<div class="media-center-header__logo-wrap">
|
|
135
122
|
<img src={context.model.logo} class="media-center-header__logo" alt={context.model?.name} />
|
|
@@ -223,12 +210,7 @@ const styles = $derived.by(() => {
|
|
|
223
210
|
{/if}
|
|
224
211
|
{#if context.closeOrchestrator.closeTriggerVisible}
|
|
225
212
|
<div class="close-button" use:handleCloseButtonMounted>
|
|
226
|
-
<
|
|
227
|
-
icon={IconDismiss}
|
|
228
|
-
zoom={0.8}
|
|
229
|
-
activeColor={context.mediaCenterColors.button}
|
|
230
|
-
inactiveColor={context.mediaCenterColors.buttonInactive}
|
|
231
|
-
on={{ click: context.closeOrchestrator.requestClose }} />
|
|
213
|
+
<PlayerButtons actions={[{ icon: IconDismiss, callback: context.closeOrchestrator.requestClose }]} zoom={0.8} />
|
|
232
214
|
</div>
|
|
233
215
|
{/if}
|
|
234
216
|
</div>
|
|
@@ -262,12 +244,9 @@ const styles = $derived.by(() => {
|
|
|
262
244
|
}
|
|
263
245
|
|
|
264
246
|
.media-center-header {
|
|
265
|
-
--_media-center-header--button-color: var(--
|
|
266
|
-
--_media-center-header--button-color--inactive: var(
|
|
267
|
-
|
|
268
|
-
rgb(from var(--_media-center-header--button-color, var(--sc-mc-color--button-player)) r g b / 60%)
|
|
269
|
-
);
|
|
270
|
-
--_media-center-header--button-indicator: var(--media-center-header--button-indicator, var(--sc-mc-color--icon-success));
|
|
247
|
+
--_media-center-header--button-color: var(--sc-player--button);
|
|
248
|
+
--_media-center-header--button-color--inactive: var(--sc-player--button-inactive);
|
|
249
|
+
--_media-center-header--button-indicator: var(--sc-player--brand);
|
|
271
250
|
padding-top: 2.1875rem;
|
|
272
251
|
width: 73.75rem;
|
|
273
252
|
display: flex;
|
|
@@ -414,6 +393,8 @@ const styles = $derived.by(() => {
|
|
|
414
393
|
}
|
|
415
394
|
|
|
416
395
|
.close-button {
|
|
396
|
+
--player-button--color: var(--sc-player--button);
|
|
397
|
+
--player-button--color--inactive: var(--sc-player--button-inactive);
|
|
417
398
|
justify-self: flex-end;
|
|
418
399
|
flex-shrink: 0;
|
|
419
400
|
padding-block: 0.9375rem;
|
|
@@ -34,13 +34,11 @@ export declare class MediaCenterContext {
|
|
|
34
34
|
on: MediaCenterContextInitializationCallbacks;
|
|
35
35
|
});
|
|
36
36
|
get model(): import("../config/types").MediaCenterModel | null;
|
|
37
|
-
get mediaCenterColors(): import("../../ui/player/colors").PlayerColors;
|
|
38
37
|
get loading(): boolean;
|
|
39
38
|
get overlayIsActive(): boolean;
|
|
40
39
|
get backgroundWrapperProps(): {
|
|
41
40
|
backgroundDisabled: boolean;
|
|
42
41
|
backgroundImageUrl: string | null;
|
|
43
|
-
backgroundColor?: string | null;
|
|
44
42
|
};
|
|
45
43
|
get membershipHandler(): import("..").IMediaCenterMembershipHandler | null;
|
|
46
44
|
get categoriesFollowingHandler(): import("..").IContentCategoryFollowingHandler | null;
|
|
@@ -93,9 +93,6 @@ export class MediaCenterContext {
|
|
|
93
93
|
get model() {
|
|
94
94
|
return this._dataProvider.model;
|
|
95
95
|
}
|
|
96
|
-
get mediaCenterColors() {
|
|
97
|
-
return this.settingsHandler.actualMediaCenterColors;
|
|
98
|
-
}
|
|
99
96
|
get loading() {
|
|
100
97
|
return this.discoverHandler.loading || this.postsFeedHandler.loading || this.streamsFeedHandler.loading || this.streamsInCategoryHandler.loading;
|
|
101
98
|
}
|
|
@@ -28,16 +28,9 @@ const handleCategoryExpaned = (e, categoryId) => {
|
|
|
28
28
|
e.stopPropagation();
|
|
29
29
|
categoriesExpandedMap[categoryId] = !categoriesExpandedMap[categoryId];
|
|
30
30
|
};
|
|
31
|
-
const styles = $derived.by(() => {
|
|
32
|
-
const values = [];
|
|
33
|
-
if (context.mediaCenterColors.menuBackground) {
|
|
34
|
-
values.push(`--media-center-menu--background-color: ${context.mediaCenterColors.menuBackground}`);
|
|
35
|
-
}
|
|
36
|
-
return values.join(';');
|
|
37
|
-
});
|
|
38
31
|
</script>
|
|
39
32
|
|
|
40
|
-
<div class="media-center-menu" transition:slideHorizontally|local
|
|
33
|
+
<div class="media-center-menu" transition:slideHorizontally|local onclick={(e) => e.stopPropagation()} onkeydown={() => {}} role="none">
|
|
41
34
|
{#if target}
|
|
42
35
|
<div class="media-center-target">
|
|
43
36
|
<div class="media-center-target__image">
|
|
@@ -156,7 +149,7 @@ const styles = $derived.by(() => {
|
|
|
156
149
|
}
|
|
157
150
|
}
|
|
158
151
|
.media-center-menu {
|
|
159
|
-
--_media-center-menu--background-color: var(--
|
|
152
|
+
--_media-center-menu--background-color: var(--sc-player--menu-background);
|
|
160
153
|
--_media-center-menu--items--padding-inline: 0.625rem;
|
|
161
154
|
background: var(--_media-center-menu--background-color);
|
|
162
155
|
height: 100%;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { ImageRound } from '../../../ui/image';
|
|
2
2
|
let { context } = $props();
|
|
3
3
|
const handler = $derived(context.momentsFeedHandler);
|
|
4
|
-
const styles = $derived.by(() => {
|
|
5
|
-
const values = [];
|
|
6
|
-
if (context.mediaCenterColors.brand) {
|
|
7
|
-
values.push(`--moments-circle--brand-color: ${context.mediaCenterColors.brand}`);
|
|
8
|
-
}
|
|
9
|
-
return values.join(';');
|
|
10
|
-
});
|
|
11
4
|
const handleClick = () => {
|
|
12
5
|
if (!handler.hasMoments) {
|
|
13
6
|
return;
|
|
@@ -20,7 +13,6 @@ const handleClick = () => {
|
|
|
20
13
|
class="moments-circle"
|
|
21
14
|
class:moments-circle--clickable={handler.hasMoments}
|
|
22
15
|
class:moments-circle--has-unwatched={handler.hasUnwatchedMoments}
|
|
23
|
-
style={styles}
|
|
24
16
|
onclick={handleClick}
|
|
25
17
|
role="none">
|
|
26
18
|
{#if context.model}
|
|
@@ -40,7 +32,7 @@ const handleClick = () => {
|
|
|
40
32
|
}
|
|
41
33
|
}
|
|
42
34
|
.moments-circle {
|
|
43
|
-
--_moments-circle--brand-color: var(--
|
|
35
|
+
--_moments-circle--brand-color: var(--sc-player--brand);
|
|
44
36
|
width: 6.25%rem;
|
|
45
37
|
min-width: 6.25%rem;
|
|
46
38
|
max-width: 6.25%rem;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { AdCard } from '../../ads/ad-card';
|
|
3
3
|
import { PostModel } from '../model';
|
|
4
4
|
import { ProductCard } from '../../products/product-card';
|
|
5
|
-
let { model,
|
|
5
|
+
let { model, trackingParams: externalTrackingParams, locale = 'en', on } = $props();
|
|
6
6
|
const trackingParams = $derived.by(() => {
|
|
7
7
|
if (externalTrackingParams || externalTrackingParams === false) {
|
|
8
8
|
return externalTrackingParams;
|
|
@@ -20,7 +20,6 @@ const trackingParams = $derived.by(() => {
|
|
|
20
20
|
{#each model.attachments.ads as ad (ad.id)}
|
|
21
21
|
<AdCard
|
|
22
22
|
ad={ad}
|
|
23
|
-
colors={colors}
|
|
24
23
|
trackingParams={trackingParams}
|
|
25
24
|
locale={locale}
|
|
26
25
|
on={{
|
|
@@ -34,7 +33,6 @@ const trackingParams = $derived.by(() => {
|
|
|
34
33
|
{#each model.attachments.products as product (product.id)}
|
|
35
34
|
<ProductCard
|
|
36
35
|
product={product}
|
|
37
|
-
colors={colors}
|
|
38
36
|
trackingParams={trackingParams}
|
|
39
37
|
locale={locale}
|
|
40
38
|
on={{
|
|
@@ -59,6 +57,11 @@ const trackingParams = $derived.by(() => {
|
|
|
59
57
|
}
|
|
60
58
|
.post-attachments {
|
|
61
59
|
--_post-attachments--gap: var(--post-attachments--gap, 1.875rem);
|
|
60
|
+
--product-card--background-color: var(--sc-player--card-background);
|
|
61
|
+
--product-card--price-color: var(--sc-player--price);
|
|
62
|
+
--product-card--sale-price-color: var(--sc-player--sale-price);
|
|
63
|
+
--ad-card--background-color: var(--sc-player--card-background);
|
|
64
|
+
--ad-card--price-color: var(--sc-player--price);
|
|
62
65
|
display: flex;
|
|
63
66
|
flex-direction: column;
|
|
64
67
|
gap: var(--_post-attachments--gap);
|
|
@@ -3,12 +3,6 @@ import type { TrackingParams } from '../../marketing-tracking';
|
|
|
3
3
|
import { PostModel } from '../model';
|
|
4
4
|
type Props = {
|
|
5
5
|
model: PostModel;
|
|
6
|
-
colors: {
|
|
7
|
-
background?: string | null;
|
|
8
|
-
price?: string | null;
|
|
9
|
-
salePrice?: string | null;
|
|
10
|
-
buttonBackground?: string | null;
|
|
11
|
-
};
|
|
12
6
|
trackingParams: TrackingParams | null;
|
|
13
7
|
locale?: Locale;
|
|
14
8
|
on?: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts">import { PostType } from '../..';
|
|
2
2
|
import { PostModel } from '../model';
|
|
3
|
-
import {
|
|
3
|
+
import { ResponsivePlayerButtons } from '../../ui/player/button';
|
|
4
4
|
import { default as AttachmentsHorizontal } from './attachments-horizontal.svelte';
|
|
5
5
|
import { default as Heading } from './heading.svelte';
|
|
6
6
|
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,
|
|
10
|
+
let { model, trackingParams: externalTrackingParams, 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(() => {
|
|
@@ -81,11 +81,7 @@ const variables = $derived.by(() => {
|
|
|
81
81
|
|
|
82
82
|
{#if uiManager.showControls}
|
|
83
83
|
<div class="post-viewer__controls-panel" use:trackControlsPanelSize>
|
|
84
|
-
<
|
|
85
|
-
actions={controlActions}
|
|
86
|
-
activeColor={controlsColors?.active ?? null}
|
|
87
|
-
backgroundColor={controlsColors?.inactive ?? null}
|
|
88
|
-
scaleEffect={true} />
|
|
84
|
+
<ResponsivePlayerButtons actions={controlActions} scaleEffect={true} />
|
|
89
85
|
</div>
|
|
90
86
|
{/if}
|
|
91
87
|
{#if overlay}
|
|
@@ -123,6 +119,8 @@ const variables = $derived.by(() => {
|
|
|
123
119
|
}
|
|
124
120
|
}
|
|
125
121
|
.post-viewer__controls-panel {
|
|
122
|
+
--player-button--color: var(--sc-player--button);
|
|
123
|
+
--player-button--color--inactive: var(--sc-player--button-inactive);
|
|
126
124
|
position: absolute;
|
|
127
125
|
left: auto;
|
|
128
126
|
right: 0;
|
|
@@ -8,10 +8,6 @@ type Props = {
|
|
|
8
8
|
trackingParams: TrackingParams | null;
|
|
9
9
|
enableAttachments?: boolean;
|
|
10
10
|
enableControls?: boolean;
|
|
11
|
-
controlsColors: {
|
|
12
|
-
active: string | null;
|
|
13
|
-
inactive: string | null;
|
|
14
|
-
} | null;
|
|
15
11
|
controlActions: PlayerButtonDef[];
|
|
16
12
|
autoplay?: true | false | 'on-appearance';
|
|
17
13
|
locale?: Locale;
|
|
@@ -46,12 +46,7 @@ let { id, media, locale, autoplay = 'on-appearance', on } = $props();
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
.post-media {
|
|
49
|
-
--_post-media--background-color: #ffffff;
|
|
50
|
-
}
|
|
51
|
-
:global([data-theme='dark']) .post-media {
|
|
52
|
-
--_post-media--background-color: #000000;
|
|
53
|
-
}
|
|
54
|
-
.post-media {
|
|
49
|
+
--_post-media--background-color: light-dark(#ffffff, #000000);
|
|
55
50
|
width: 100%;
|
|
56
51
|
min-width: 100%;
|
|
57
52
|
max-width: 100%;
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import {} from '../../ui/player/close-orchestrator';
|
|
1
|
+
<script lang="ts">import {} from '../../ui/player/close-orchestrator';
|
|
3
2
|
import { ShadowRoot } from '../../ui/shadow-dom';
|
|
4
3
|
import { default as PostsPlayerView } from './posts-player-view.svelte';
|
|
5
|
-
import { untrack } from 'svelte';
|
|
6
4
|
let { dataProvider, socialInteractionsHandler, sharingHandler, closeOrchestrator, playerSettings, analyticsHandler, on } = $props();
|
|
7
5
|
let backgroundImageUrl = $state(null);
|
|
8
6
|
const handleBackgroundImagedLoaded = (url) => {
|
|
9
7
|
backgroundImageUrl = url;
|
|
10
8
|
};
|
|
11
|
-
$effect(() => {
|
|
12
|
-
void playerSettings?.theme;
|
|
13
|
-
untrack(() => {
|
|
14
|
-
Theme.set(playerSettings?.theme ?? 'dark');
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
9
|
</script>
|
|
18
10
|
|
|
19
|
-
<ShadowRoot backgroundDisabled={playerSettings?.disableBackground === true} backgroundImageUrl={backgroundImageUrl}>
|
|
11
|
+
<ShadowRoot theme={playerSettings?.theme ?? 'dark'} backgroundDisabled={playerSettings?.disableBackground === true} backgroundImageUrl={backgroundImageUrl}>
|
|
20
12
|
<PostsPlayerView
|
|
21
13
|
dataProvider={{ type: 'provider', provider: dataProvider }}
|
|
22
14
|
socialInteractionsHandler={socialInteractionsHandler}
|
|
@@ -140,12 +140,6 @@ const currentItemActions = $derived.by(() => {
|
|
|
140
140
|
|
|
141
141
|
<PostAttachments
|
|
142
142
|
model={postModel}
|
|
143
|
-
colors={{
|
|
144
|
-
background: contentPlayerConfig.playerColors.cardBackground,
|
|
145
|
-
price: contentPlayerConfig.playerColors.price,
|
|
146
|
-
salePrice: contentPlayerConfig.playerColors.salePrice,
|
|
147
|
-
buttonBackground: contentPlayerConfig.playerColors.cardButton
|
|
148
|
-
}}
|
|
149
143
|
trackingParams={false}
|
|
150
144
|
locale={contentPlayerConfig.settings.locale}
|
|
151
145
|
on={{
|
|
@@ -164,7 +158,6 @@ const currentItemActions = $derived.by(() => {
|
|
|
164
158
|
{@const handler = postActionsGenerator.getPostActionsHandler(postModel)}
|
|
165
159
|
<PostViewer
|
|
166
160
|
model={postModel}
|
|
167
|
-
controlsColors={{ active: contentPlayerConfig.playerColors.button, inactive: contentPlayerConfig.playerColors.buttonInactive }}
|
|
168
161
|
controlActions={handler.actions}
|
|
169
162
|
trackingParams={false}
|
|
170
163
|
enableAttachments={contentPlayerConfig.uiManager.showAttachmentsOverlay}
|