@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
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { PostType } from '../../core/enums';
|
|
2
2
|
import type { Locale } from '../../core/locale';
|
|
3
|
-
import type { ThemeValue } from '../../core/theme';
|
|
4
3
|
import type { IPostModel } from '..';
|
|
5
4
|
import type { IPostSharingHandler } from '../sharing';
|
|
6
5
|
import type { IPostSocialInteractionsHandler } from '../social-interactions';
|
|
7
6
|
import type { ICloseOrchestrator } from '../../ui/player/close-orchestrator';
|
|
8
|
-
import type { PlayerColors } from '../../ui/player/colors';
|
|
9
7
|
import type { IPlayerBuffer, IPlayerDataProvider } from '../../ui/player/providers';
|
|
10
8
|
export interface IPostAnalyticsHandler {
|
|
11
9
|
trackPostOpened: (postType: PostType, postId: string) => void;
|
|
@@ -38,7 +36,6 @@ export type PostsPlayerProps = {
|
|
|
38
36
|
export type PostPlayerSettings = {
|
|
39
37
|
locale?: Locale;
|
|
40
38
|
showStreamsCloudWatermark?: boolean;
|
|
41
|
-
playerColors?: Record<ThemeValue, PlayerColors>;
|
|
42
39
|
};
|
|
43
40
|
export type PostManagementActions = {
|
|
44
41
|
editPost: ((id: string) => void) | null;
|
|
@@ -4,7 +4,7 @@ import { Image } from '../../ui/image';
|
|
|
4
4
|
import { LineClamp } from '../../ui/line-clamp';
|
|
5
5
|
import { ProportionalContainer } from '../../ui/proportional-container';
|
|
6
6
|
import { ProductCardLocalization } from './product-card-localization';
|
|
7
|
-
let { product,
|
|
7
|
+
let { product, includeBeforeNowPrefix, trackingParams, inert = false, locale, on } = $props();
|
|
8
8
|
const localization = $derived(new ProductCardLocalization(locale));
|
|
9
9
|
const shortDescriptionPresented = $derived(product.shortDescription && product.shortDescription.length > 0);
|
|
10
10
|
const trackImpression = (node) => {
|
|
@@ -36,22 +36,9 @@ const onProductClicked = (event) => {
|
|
|
36
36
|
window.open(enrichedLink, '_blank', 'noopener noreferrer');
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
const styles = $derived.by(() => {
|
|
40
|
-
const values = [];
|
|
41
|
-
if (colors?.background) {
|
|
42
|
-
values.push(`--product-card--background-color: ${colors.background}`);
|
|
43
|
-
}
|
|
44
|
-
if (colors?.price) {
|
|
45
|
-
values.push(`--product-card--price-color: ${colors.price}`);
|
|
46
|
-
}
|
|
47
|
-
if (colors?.salePrice) {
|
|
48
|
-
values.push(`--product-card--sale-price-color: ${colors.salePrice}`);
|
|
49
|
-
}
|
|
50
|
-
return values.join(';');
|
|
51
|
-
});
|
|
52
39
|
</script>
|
|
53
40
|
|
|
54
|
-
<div class="product-card" inert={inert} use:trackImpression
|
|
41
|
+
<div class="product-card" inert={inert} use:trackImpression>
|
|
55
42
|
<ProportionalContainer ratio={1}>
|
|
56
43
|
<Image src={product.image} />
|
|
57
44
|
</ProportionalContainer>
|
|
@@ -102,8 +89,8 @@ const styles = $derived.by(() => {
|
|
|
102
89
|
.product-card {
|
|
103
90
|
--_product-card--aspect-ratio: var(--product-card--aspect-ratio, 10/16);
|
|
104
91
|
--_product-card--border-radius: var(--product-card--border-radius, 0.5rem);
|
|
105
|
-
--_product-card--background-color: var(--product-card--background-color, rgb(from
|
|
106
|
-
--_product-card--border-color: var(--product-card--
|
|
92
|
+
--_product-card--background-color: var(--product-card--background-color, rgb(from light-dark(#ffffff, #000000) r g b / 90%));
|
|
93
|
+
--_product-card--border-color: var(--product-card--border-color, light-dark(#f2f2f2, #000000));
|
|
107
94
|
--_product-card--price-color: var(--product-card--price-color, inherit);
|
|
108
95
|
--_product-card--sale-price-color: var(--product-card--sale-price-color, inherit);
|
|
109
96
|
--product-price-color: var(--_product-card--price-color);
|
|
@@ -3,11 +3,6 @@ import { type TrackingParams } from '../../marketing-tracking';
|
|
|
3
3
|
import type { ProductCardModel } from './types';
|
|
4
4
|
type Props = {
|
|
5
5
|
product: ProductCardModel;
|
|
6
|
-
colors: {
|
|
7
|
-
background?: string | null;
|
|
8
|
-
price?: string | null;
|
|
9
|
-
salePrice?: string | null;
|
|
10
|
-
};
|
|
11
6
|
locale: Locale;
|
|
12
7
|
includeBeforeNowPrefix?: boolean;
|
|
13
8
|
inert?: boolean;
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { PostViewer } from '../../../posts/post-viewer';
|
|
3
3
|
import { ShortVideoStreamElementLocalization } from './short-video-stream-element-localization';
|
|
4
4
|
import { mapToPostModel } from '../models';
|
|
5
|
-
let { data, trackingParams, locale,
|
|
5
|
+
let { data, trackingParams, locale, on } = $props();
|
|
6
6
|
const localization = $derived(new ShortVideoStreamElementLocalization(locale));
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<PostViewer
|
|
10
10
|
model={new PostModel(mapToPostModel(data))}
|
|
11
|
-
controlsColors={controlsColors}
|
|
12
11
|
trackingParams={trackingParams ? { streamId: trackingParams.streamId, campaignId: trackingParams.campaignId } : false}
|
|
13
12
|
autoplay={false}
|
|
14
13
|
enableControls={false}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import { StreamLayoutSlot, StreamPageLayout, StreamLayoutSlotContent } from '../layout';
|
|
2
|
-
import {
|
|
2
|
+
import { ResponsivePlayerButtons } from '../../ui/player/button';
|
|
3
3
|
import { StreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
4
4
|
let { page, trackingParams, overlayControls, locale, on, overlay } = $props();
|
|
5
5
|
const localization = $derived(new StreamPageViewerLocalization(locale));
|
|
@@ -15,11 +15,7 @@ const localization = $derived(new StreamPageViewerLocalization(locale));
|
|
|
15
15
|
{#snippet controls()}
|
|
16
16
|
{#if overlayControls?.enabled && overlayControls.actions.length}
|
|
17
17
|
<div class="controls-panel">
|
|
18
|
-
<
|
|
19
|
-
actions={overlayControls.actions}
|
|
20
|
-
activeColor={overlayControls.colors?.active ?? null}
|
|
21
|
-
backgroundColor={overlayControls.colors?.inactive ?? null}
|
|
22
|
-
scaleEffect={true} />
|
|
18
|
+
<ResponsivePlayerButtons actions={overlayControls.actions} scaleEffect={true} />
|
|
23
19
|
</div>
|
|
24
20
|
{/if}
|
|
25
21
|
{/snippet}
|
|
@@ -38,6 +34,8 @@ const localization = $derived(new StreamPageViewerLocalization(locale));
|
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
.controls-panel {
|
|
37
|
+
--player-button--color: var(--sc-player--button);
|
|
38
|
+
--player-button--color--inactive: var(--sc-player--button-inactive);
|
|
41
39
|
position: absolute;
|
|
42
40
|
left: auto;
|
|
43
41
|
right: 0;
|
|
@@ -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 StreamsPlayerView } from './streams-player-view.svelte';
|
|
5
|
-
import { untrack } from 'svelte';
|
|
6
4
|
let { dataProvider, postSocialInteractionsHandler, sharingHandler, amplificationParameters, 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
|
<StreamsPlayerView
|
|
21
13
|
dataProvider={{ type: 'provider', provider: dataProvider }}
|
|
22
14
|
postSocialInteractionsHandler={postSocialInteractionsHandler}
|
|
@@ -311,12 +311,6 @@ const stopActivityTracking = () => {
|
|
|
311
311
|
{#if postModel}
|
|
312
312
|
<PostAttachments
|
|
313
313
|
model={postModel}
|
|
314
|
-
colors={{
|
|
315
|
-
background: contentPlayerConfig.playerColors.cardBackground,
|
|
316
|
-
price: contentPlayerConfig.playerColors.price,
|
|
317
|
-
salePrice: contentPlayerConfig.playerColors.salePrice,
|
|
318
|
-
buttonBackground: contentPlayerConfig.playerColors.cardButton
|
|
319
|
-
}}
|
|
320
314
|
trackingParams={trackingParams}
|
|
321
315
|
locale={contentPlayerConfig.settings.locale}
|
|
322
316
|
on={{
|
|
@@ -359,10 +353,6 @@ const stopActivityTracking = () => {
|
|
|
359
353
|
locale={localization.locale}
|
|
360
354
|
overlayControls={{
|
|
361
355
|
enabled: contentPlayerConfig.uiManager.showControlsOverlay,
|
|
362
|
-
colors: {
|
|
363
|
-
active: contentPlayerConfig.playerColors.button,
|
|
364
|
-
inactive: contentPlayerConfig.playerColors.buttonInactive
|
|
365
|
-
},
|
|
366
356
|
actions: buffer?.activeChunk
|
|
367
357
|
? streamActionsGenerator.getGeneralStreamPageActions({ streamId: buffer.activeChunk.model.id, streamPageId: item.id })
|
|
368
358
|
: []
|
|
@@ -385,7 +375,6 @@ const stopActivityTracking = () => {
|
|
|
385
375
|
: null}
|
|
386
376
|
<PostViewer
|
|
387
377
|
model={postModel}
|
|
388
|
-
controlsColors={{ active: contentPlayerConfig.playerColors.button, inactive: contentPlayerConfig.playerColors.buttonInactive }}
|
|
389
378
|
trackingParams={trackingParams}
|
|
390
379
|
enableAttachments={contentPlayerConfig.uiManager.showAttachmentsOverlay}
|
|
391
380
|
enableControls={contentPlayerConfig.uiManager.showControlsOverlay}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Locale } from '../../core/locale';
|
|
2
|
-
import type { ThemeValue } from '../../core/theme';
|
|
3
2
|
import type { IPostSocialInteractionsHandler } from '../../posts/social-interactions';
|
|
4
3
|
import type { IStreamSharingHandler } from '../sharing';
|
|
5
4
|
import type { StreamPageViewerModel } from '../stream-page-viewer';
|
|
6
5
|
import type { ICloseOrchestrator } from '../../ui/player/close-orchestrator';
|
|
7
|
-
import type { PlayerColors } from '../../ui/player/colors';
|
|
8
6
|
import type { StreamsPlayerBuffer } from './streams-player-buffer.svelte';
|
|
9
7
|
export type StreamPlayerModel = {
|
|
10
8
|
id: string;
|
|
@@ -47,7 +45,6 @@ export type StreamsPlayerProps = {
|
|
|
47
45
|
export type StreamsPlayerSettings = {
|
|
48
46
|
locale?: Locale;
|
|
49
47
|
showStreamsCloudWatermark?: boolean;
|
|
50
|
-
playerColors?: Record<ThemeValue, PlayerColors>;
|
|
51
48
|
overlayMinOffsetTop?: number;
|
|
52
49
|
};
|
|
53
50
|
export type StreamAmplificationParameters = {
|
|
@@ -23,33 +23,16 @@ let { style = undefined, size = ButtonSize.Standard, children } = $props();
|
|
|
23
23
|
{@render children()}
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
<style
|
|
27
|
-
0% {
|
|
28
|
-
opacity: 1;
|
|
29
|
-
}
|
|
30
|
-
50% {
|
|
31
|
-
opacity: 0.4;
|
|
32
|
-
}
|
|
33
|
-
100% {
|
|
34
|
-
opacity: 1;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
.button-theme {
|
|
26
|
+
<style>.button-theme {
|
|
38
27
|
display: contents;
|
|
39
28
|
}
|
|
40
29
|
.button-theme--standard {
|
|
41
30
|
--button--font--color: var(--sc-mc-color--text-primary);
|
|
42
31
|
--button--background: var(--sc-mc-color--bg-button);
|
|
43
|
-
--button--background--hover: #f9fafb;
|
|
44
|
-
--button--background--active: #f2f2f3;
|
|
45
|
-
--button--background--disabled: #f2f2f3;
|
|
46
|
-
--button--border: 1px solid #e5e7eb;
|
|
47
|
-
}
|
|
48
|
-
:global([data-theme='dark']) .button-theme--standard {
|
|
49
|
-
--button--background--hover: #1f2937;
|
|
50
|
-
--button--background--active: #374151;
|
|
51
|
-
--button--background--disabled: #374151;
|
|
52
|
-
--button--border: 1px solid #4b5563;
|
|
32
|
+
--button--background--hover: light-dark(#f9fafb, #1f2937);
|
|
33
|
+
--button--background--active: light-dark(#f2f2f3, #374151);
|
|
34
|
+
--button--background--disabled: light-dark(#f2f2f3, #374151);
|
|
35
|
+
--button--border: 1px solid light-dark(#e5e7eb, #4b5563);
|
|
53
36
|
}
|
|
54
37
|
.button-theme {
|
|
55
38
|
/*Size*/
|
|
@@ -72,8 +72,4 @@ let { src, color = null } = $props();
|
|
|
72
72
|
.icon :global(path) {
|
|
73
73
|
stroke: var(--_icon--stroke-color, var(--_icon--color));
|
|
74
74
|
stroke-width: var(--_icon--stroke-width);
|
|
75
|
-
}
|
|
76
|
-
:global([data-theme='dark']) .icon :global(path) {
|
|
77
|
-
stroke: var(--_icon--stroke-color, var(--_icon--color));
|
|
78
|
-
stroke-width: var(--_icon--stroke-width);
|
|
79
75
|
}</style>
|
|
@@ -2,35 +2,24 @@
|
|
|
2
2
|
let { actions } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<div class="mobile-player-buttons
|
|
5
|
+
<div class="mobile-player-buttons">
|
|
6
6
|
{#each actions as action (action.icon)}
|
|
7
|
-
<button type="button" class="mobile-player-
|
|
8
|
-
<span class="mobile-player-
|
|
7
|
+
<button type="button" class="mobile-player-buttons__action" disabled={action.disabled} onclick={action.callback}>
|
|
8
|
+
<span class="mobile-player-buttons__action-icon">
|
|
9
9
|
<Icon src={action.icon} color={action.iconColor} />
|
|
10
10
|
</span>
|
|
11
11
|
</button>
|
|
12
12
|
{/each}
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
-
<style
|
|
16
|
-
0% {
|
|
17
|
-
opacity: 1;
|
|
18
|
-
}
|
|
19
|
-
50% {
|
|
20
|
-
opacity: 0.4;
|
|
21
|
-
}
|
|
22
|
-
100% {
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
.mobile-player-buttons-group {
|
|
15
|
+
<style>.mobile-player-buttons {
|
|
27
16
|
cursor: pointer;
|
|
28
17
|
display: flex;
|
|
29
18
|
flex-direction: column;
|
|
30
19
|
justify-content: center;
|
|
31
20
|
pointer-events: auto;
|
|
32
21
|
}
|
|
33
|
-
.mobile-player-
|
|
22
|
+
.mobile-player-buttons__action {
|
|
34
23
|
display: flex;
|
|
35
24
|
justify-content: center;
|
|
36
25
|
align-items: center;
|
|
@@ -39,6 +28,10 @@ let { actions } = $props();
|
|
|
39
28
|
--icon--size: 2rem;
|
|
40
29
|
--icon--filter: var(--sc-mc-color--icon-overlay-shadow);
|
|
41
30
|
}
|
|
42
|
-
.mobile-player-
|
|
31
|
+
.mobile-player-buttons__action:disabled {
|
|
32
|
+
opacity: 0.5;
|
|
33
|
+
cursor: default;
|
|
34
|
+
}
|
|
35
|
+
.mobile-player-buttons__action-icon {
|
|
43
36
|
display: block;
|
|
44
37
|
}</style>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<script lang="ts">import { Icon } from '../../icon';
|
|
2
|
+
let { actions, scaleEffect = false, zoom = 1 } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if actions.length === 1}
|
|
6
|
+
{@const action = actions[0]}
|
|
7
|
+
<button
|
|
8
|
+
type="button"
|
|
9
|
+
class="player-button"
|
|
10
|
+
style:zoom={zoom}
|
|
11
|
+
class:player-button--scale-effect={scaleEffect}
|
|
12
|
+
disabled={action.disabled}
|
|
13
|
+
onclick={action.callback}>
|
|
14
|
+
<span class="player-button__icon">
|
|
15
|
+
<Icon src={action.icon} color={action.iconColor} />
|
|
16
|
+
</span>
|
|
17
|
+
</button>
|
|
18
|
+
{:else if actions.length > 1}
|
|
19
|
+
<div class="player-buttons" style:zoom={zoom}>
|
|
20
|
+
{#each actions as action (action.icon)}
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="player-buttons__action"
|
|
24
|
+
class:player-buttons__action--scale-effect={scaleEffect}
|
|
25
|
+
disabled={action.disabled}
|
|
26
|
+
onclick={action.callback}>
|
|
27
|
+
<span class="player-buttons__action-icon">
|
|
28
|
+
<Icon src={action.icon} color={action.iconColor} />
|
|
29
|
+
</span>
|
|
30
|
+
</button>
|
|
31
|
+
{/each}
|
|
32
|
+
</div>
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
<style>.player-button {
|
|
36
|
+
--_player-button--color: var(--player-button--color, rgb(from light-dark(#272727, #000000) r g b / 95%));
|
|
37
|
+
--_player-button--color--inactive: var(--player-button--color--inactive, rgb(from var(--_player-button--color) r g b / 60%));
|
|
38
|
+
--_player-button--icon-scale: 1;
|
|
39
|
+
pointer-events: auto;
|
|
40
|
+
padding: 0.625rem;
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
background-color: var(--_player-button--color--inactive);
|
|
45
|
+
transition: background-color 0.5s;
|
|
46
|
+
border-radius: 50%;
|
|
47
|
+
color: var(--sc-mc-color--text-white);
|
|
48
|
+
--icon--color: var(--sc-mc-color--icon-overlay);
|
|
49
|
+
--icon--size: 1.75rem;
|
|
50
|
+
}
|
|
51
|
+
.player-button:hover:not(:disabled) {
|
|
52
|
+
background-color: var(--_player-button--color);
|
|
53
|
+
}
|
|
54
|
+
.player-button:disabled {
|
|
55
|
+
opacity: 0.5;
|
|
56
|
+
cursor: default;
|
|
57
|
+
}
|
|
58
|
+
.player-button--scale-effect:hover:not(:disabled) {
|
|
59
|
+
--_player-button--icon-scale: 1.2;
|
|
60
|
+
}
|
|
61
|
+
.player-button__icon {
|
|
62
|
+
display: block;
|
|
63
|
+
transform: scale(var(--_player-button--icon-scale));
|
|
64
|
+
transition: 0.3s;
|
|
65
|
+
}
|
|
66
|
+
.player-button {
|
|
67
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
68
|
+
}
|
|
69
|
+
@container (width < 576px) {
|
|
70
|
+
.player-button {
|
|
71
|
+
padding: 0.5rem;
|
|
72
|
+
--icon--size: 1.5rem;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.player-buttons {
|
|
77
|
+
--_player-button--color: var(--player-button--color, rgb(from light-dark(#272727, #000000) r g b / 95%));
|
|
78
|
+
--_player-button--color--inactive: var(--player-button--color--inactive, rgb(from var(--_player-button--color) r g b / 60%));
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
border-radius: 1.25rem;
|
|
84
|
+
background: var(--_player-button--color--inactive);
|
|
85
|
+
padding: 0.4375rem 0.0625rem;
|
|
86
|
+
pointer-events: auto;
|
|
87
|
+
}
|
|
88
|
+
.player-buttons__action {
|
|
89
|
+
--_player-button--icon-scale: 1;
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
align-items: center;
|
|
93
|
+
padding: 0.5625rem;
|
|
94
|
+
border-radius: 1.25rem;
|
|
95
|
+
color: var(--sc-mc-color--text-white);
|
|
96
|
+
--icon--color: var(--sc-mc-color--icon-overlay);
|
|
97
|
+
--icon--size: 1.75rem;
|
|
98
|
+
transition: background-color 0.5s;
|
|
99
|
+
}
|
|
100
|
+
.player-buttons__action:hover:not(:disabled) {
|
|
101
|
+
background-color: var(--_player-button--color);
|
|
102
|
+
}
|
|
103
|
+
.player-buttons__action:disabled {
|
|
104
|
+
opacity: 0.5;
|
|
105
|
+
cursor: default;
|
|
106
|
+
}
|
|
107
|
+
.player-buttons__action--scale-effect:hover:not(:disabled) {
|
|
108
|
+
--_player-button--icon-scale: 1.2;
|
|
109
|
+
background-color: transparent;
|
|
110
|
+
}
|
|
111
|
+
.player-buttons__action-icon {
|
|
112
|
+
display: block;
|
|
113
|
+
transform: scale(var(--_player-button--icon-scale));
|
|
114
|
+
transition: 0.3s;
|
|
115
|
+
}
|
|
116
|
+
.player-buttons {
|
|
117
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
118
|
+
}
|
|
119
|
+
@container (width < 576px) {
|
|
120
|
+
.player-buttons {
|
|
121
|
+
border-radius: 0.9375rem;
|
|
122
|
+
padding: 0.25rem 0.0625rem;
|
|
123
|
+
}
|
|
124
|
+
.player-buttons__action {
|
|
125
|
+
--icon--size: 1.5rem;
|
|
126
|
+
}
|
|
127
|
+
}</style>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { PlayerButtonDef } from './types';
|
|
2
2
|
type Props = {
|
|
3
|
-
activeColor: string | null;
|
|
4
|
-
backgroundColor: string | null;
|
|
5
3
|
actions: PlayerButtonDef[];
|
|
6
4
|
scaleEffect?: boolean;
|
|
5
|
+
zoom?: number;
|
|
7
6
|
};
|
|
8
7
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
9
8
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">import { default as MobilePlayerButtons } from './cmp.mobile-player-buttons.svelte';
|
|
2
|
+
import { default as PlayerButtons } from './cmp.player-buttons.svelte';
|
|
3
|
+
let { scaleEffect = false, actions } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class="desktop-controls">
|
|
7
|
+
<PlayerButtons actions={actions} scaleEffect={scaleEffect} />
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="mobile-controls">
|
|
11
|
+
<MobilePlayerButtons actions={actions} />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<style>.desktop-controls {
|
|
15
|
+
display: contents;
|
|
16
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
17
|
+
}
|
|
18
|
+
@container (width < 576px) {
|
|
19
|
+
.desktop-controls {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.mobile-controls {
|
|
25
|
+
display: none;
|
|
26
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
27
|
+
}
|
|
28
|
+
@container (width < 576px) {
|
|
29
|
+
.mobile-controls {
|
|
30
|
+
display: contents;
|
|
31
|
+
}
|
|
32
|
+
}</style>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as ResponsivePlayerButtonsGroup } from './cmp.responsive-player-buttons-group.svelte';
|
|
1
|
+
export { default as PlayerButtons } from './cmp.player-buttons.svelte';
|
|
2
|
+
export { default as MobilePlayerButtons } from './cmp.mobile-player-buttons.svelte';
|
|
3
|
+
export { default as ResponsivePlayerButtons } from './cmp.responsive-player-buttons.svelte';
|
|
5
4
|
export type { PlayerButtonDef } from './types';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as ResponsivePlayerButtonsGroup } from './cmp.responsive-player-buttons-group.svelte';
|
|
1
|
+
export { default as PlayerButtons } from './cmp.player-buttons.svelte';
|
|
2
|
+
export { default as MobilePlayerButtons } from './cmp.mobile-player-buttons.svelte';
|
|
3
|
+
export { default as ResponsivePlayerButtons } from './cmp.responsive-player-buttons.svelte';
|
|
@@ -121,7 +121,7 @@ const handleSliderMounted = (node) => {
|
|
|
121
121
|
{/snippet}
|
|
122
122
|
</PlayerSlider>
|
|
123
123
|
{#if overviewPanelContent && config.playerBuffer.loaded.length > 0}
|
|
124
|
-
<OverviewPanel
|
|
124
|
+
<OverviewPanel position={overviewPosition} uiManager={uiManager}>
|
|
125
125
|
{@render overviewPanelContent()}
|
|
126
126
|
</OverviewPanel>
|
|
127
127
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends { id: string }">import { slideHorizontally } from '../../../core/transitions';
|
|
2
|
-
import {
|
|
2
|
+
import { PlayerButtons, ResponsivePlayerButtons } from '../button';
|
|
3
3
|
import { PlayerConfig } from './player-config.svelte.js';
|
|
4
4
|
import IconCalendarWeekNumbers from '@fluentui/svg-icons/icons/calendar_week_numbers_24_regular.svg?raw';
|
|
5
5
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_28_regular.svg?raw';
|
|
@@ -62,30 +62,18 @@ const variables = $derived.by(() => {
|
|
|
62
62
|
<div class="controls-and-attachments" style={variables}>
|
|
63
63
|
<div class="controls-and-attachments__spacer"> </div>
|
|
64
64
|
<div class="controls-and-attachments__left">
|
|
65
|
-
<
|
|
66
|
-
actions={allActions}
|
|
67
|
-
scaleEffect={true}
|
|
68
|
-
activeColor={config.playerColors.button}
|
|
69
|
-
backgroundColor={config.playerColors.buttonInactive} />
|
|
65
|
+
<ResponsivePlayerButtons actions={allActions} scaleEffect={true} />
|
|
70
66
|
|
|
71
67
|
{#if config.playerBuffer}
|
|
72
68
|
<div
|
|
73
69
|
class="controls-and-attachments__navigation-buttons"
|
|
74
70
|
class:controls-and-attachments__navigation-buttons--invisible={config.playerBuffer.loaded.length <= 1}>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
scaleEffect={true}
|
|
81
|
-
on={{ click: config.playerBuffer.loadPrevious }} />
|
|
82
|
-
<PlayerButton
|
|
83
|
-
icon={IconChevronDown}
|
|
84
|
-
activeColor={config.playerColors.button}
|
|
85
|
-
inactiveColor={config.playerColors.buttonInactive}
|
|
86
|
-
disabled={!config.playerBuffer.canLoadNext}
|
|
87
|
-
scaleEffect={true}
|
|
88
|
-
on={{ click: config.playerBuffer.loadNext }} />
|
|
71
|
+
<PlayerButtons
|
|
72
|
+
actions={[{ icon: IconChevronUp, callback: config.playerBuffer.loadPrevious, disabled: !config.playerBuffer.canLoadPrevious }]}
|
|
73
|
+
scaleEffect={true} />
|
|
74
|
+
<PlayerButtons
|
|
75
|
+
actions={[{ icon: IconChevronDown, callback: config.playerBuffer.loadNext, disabled: !config.playerBuffer.canLoadNext }]}
|
|
76
|
+
scaleEffect={true} />
|
|
89
77
|
</div>
|
|
90
78
|
{/if}
|
|
91
79
|
</div>
|
|
@@ -104,12 +92,7 @@ const variables = $derived.by(() => {
|
|
|
104
92
|
|
|
105
93
|
{#if showCloseButton}
|
|
106
94
|
<div class="close-button" use:handleCloseButtonMounted>
|
|
107
|
-
<
|
|
108
|
-
icon={IconDismiss}
|
|
109
|
-
zoom={0.8}
|
|
110
|
-
activeColor={config.playerColors.button ?? null}
|
|
111
|
-
inactiveColor={config.playerColors.buttonInactive ?? null}
|
|
112
|
-
on={{ click: config.closeOrchestrator.requestClose }} />
|
|
95
|
+
<PlayerButtons actions={[{ icon: IconDismiss, callback: config.closeOrchestrator.requestClose }]} zoom={0.8} />
|
|
113
96
|
</div>
|
|
114
97
|
{/if}
|
|
115
98
|
|
|
@@ -125,6 +108,8 @@ const variables = $derived.by(() => {
|
|
|
125
108
|
}
|
|
126
109
|
}
|
|
127
110
|
.controls-and-attachments {
|
|
111
|
+
--player-button--color: var(--sc-player--button);
|
|
112
|
+
--player-button--color--inactive: var(--sc-player--button-inactive);
|
|
128
113
|
position: absolute;
|
|
129
114
|
top: 0;
|
|
130
115
|
right: 0;
|
|
@@ -175,6 +160,8 @@ const variables = $derived.by(() => {
|
|
|
175
160
|
}
|
|
176
161
|
|
|
177
162
|
.close-button {
|
|
163
|
+
--player-button--color: var(--sc-player--button);
|
|
164
|
+
--player-button--color--inactive: var(--sc-player--button-inactive);
|
|
178
165
|
position: absolute;
|
|
179
166
|
top: 0;
|
|
180
167
|
right: 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import { slideHorizontally } from '../../../core/transitions';
|
|
2
|
-
let {
|
|
2
|
+
let { uiManager, position, children } = $props();
|
|
3
3
|
const handlePanelClick = (e) => {
|
|
4
4
|
e.stopPropagation();
|
|
5
5
|
};
|
|
@@ -10,12 +10,6 @@ const styles = $derived.by(() => {
|
|
|
10
10
|
`--overview-panel--bottom: ${position.bottom}px`,
|
|
11
11
|
`--overview-panel--right: ${position.right}px`
|
|
12
12
|
];
|
|
13
|
-
if (config.playerColors.sidebarBackground) {
|
|
14
|
-
values.push(`--overview-panel--background: ${config.playerColors.sidebarBackground}`);
|
|
15
|
-
}
|
|
16
|
-
if (config.playerColors.brand) {
|
|
17
|
-
values.push(`--overview-panel--brand-color: ${config.playerColors.brand}`);
|
|
18
|
-
}
|
|
19
13
|
return values.join(';');
|
|
20
14
|
});
|
|
21
15
|
</script>
|
|
@@ -43,12 +37,12 @@ const styles = $derived.by(() => {
|
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
39
|
.overview-panel {
|
|
46
|
-
--_overview-panel--background: var(--
|
|
40
|
+
--_overview-panel--background: var(--sc-player--sidebar-background);
|
|
47
41
|
--_overview-panel--width: var(--overview-panel--width);
|
|
48
42
|
--_overview-panel--top: var(--overview-panel--top);
|
|
49
43
|
--_overview-panel--bottom: var(--overview-panel--bottom);
|
|
50
44
|
--_overview-panel--right: var(--overview-panel--right);
|
|
51
|
-
--brand-color: var(--
|
|
45
|
+
--brand-color: var(--sc-player--brand);
|
|
52
46
|
width: var(--_overview-panel--width);
|
|
53
47
|
min-width: var(--_overview-panel--width);
|
|
54
48
|
max-width: var(--_overview-panel--width);
|