@streamscloud/embeddable 7.0.1 → 7.0.2-1759149696160
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 +13 -12
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +2 -2
- package/dist/content-player/cmp.content-player.svelte +224 -0
- package/dist/content-player/cmp.content-player.svelte.d.ts +33 -0
- package/dist/content-player/content-player-config.svelte.d.ts +49 -0
- package/dist/content-player/content-player-config.svelte.js +43 -0
- package/dist/content-player/controls-and-attachments.svelte +275 -0
- package/dist/content-player/controls-and-attachments.svelte.d.ts +28 -0
- package/dist/content-player/fade-mixins.scss +12 -0
- package/dist/content-player/index.d.ts +2 -0
- package/dist/content-player/index.js +2 -0
- package/dist/content-player/overview-panel.svelte +85 -0
- package/dist/content-player/overview-panel.svelte.d.ts +10 -0
- package/dist/{streams/stream-player → content-player}/ui-manager.svelte.d.ts +10 -9
- package/dist/content-player/ui-manager.svelte.js +68 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/media-center/config/internal-media-center-config.js +2 -1
- package/dist/media-center/config/types.d.ts +1 -1
- package/dist/media-center/media-center/cmp.media-center.svelte +13 -9
- package/dist/media-center/media-center/overview.svelte +3 -2
- package/dist/media-center/media-center/short-video-resources-generator.d.ts +1 -1
- package/dist/media-center/model/types.d.ts +12 -0
- package/dist/posts/attachments/cmp.attachments.svelte +50 -0
- package/dist/{short-videos/short-video-viewer → posts/attachments}/cmp.attachments.svelte.d.ts +3 -3
- package/dist/posts/attachments/index.d.ts +1 -0
- package/dist/posts/attachments/index.js +1 -0
- package/dist/{short-videos/short-video-viewer/cmp.short-video-controls.svelte → posts/controls/cmp.controls.svelte} +21 -26
- package/dist/posts/controls/cmp.controls.svelte.d.ts +11 -0
- package/dist/posts/controls/index.d.ts +1 -0
- package/dist/posts/controls/index.js +1 -0
- package/dist/posts/index.d.ts +4 -0
- package/dist/posts/index.js +2 -0
- package/dist/posts/model/types.d.ts +13 -0
- package/dist/posts/model/types.js +1 -0
- package/dist/{short-videos/short-video-viewer/cmp.attachments-horizontal.svelte → posts/post-viewer/attachments-horizontal.svelte} +2 -3
- package/dist/posts/post-viewer/attachments-horizontal.svelte.d.ts +13 -0
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +120 -0
- package/dist/{short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts → posts/post-viewer/cmp.post-viewer.svelte.d.ts} +3 -2
- package/dist/posts/post-viewer/heading.svelte +76 -0
- package/dist/posts/post-viewer/heading.svelte.d.ts +9 -0
- package/dist/posts/post-viewer/index.d.ts +4 -0
- package/dist/posts/post-viewer/index.js +3 -0
- package/dist/posts/post-viewer/mapper.d.ts +3 -0
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/mapper.js +33 -17
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/operations.generated.d.ts +2 -2
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/operations.generated.js +2 -2
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/operations.graphql +1 -1
- package/dist/posts/post-viewer/post-media.svelte +20 -0
- package/dist/posts/post-viewer/post-media.svelte.d.ts +12 -0
- package/dist/{short-videos/short-video-viewer/short-video-viewer-localization.d.ts → posts/post-viewer/post-viewer-localization.d.ts} +2 -3
- package/dist/{short-videos/short-video-viewer/short-video-viewer-localization.js → posts/post-viewer/post-viewer-localization.js} +3 -5
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/types.d.ts +24 -25
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/ui-manager.svelte.d.ts +5 -3
- package/dist/{short-videos/short-video-viewer → posts/post-viewer}/ui-manager.svelte.js +11 -4
- package/dist/posts/post-viewer/utils.d.ts +2 -0
- package/dist/posts/post-viewer/utils.js +13 -0
- package/dist/posts/social-interactions/index.d.ts +1 -0
- package/dist/posts/social-interactions/index.js +1 -0
- package/dist/posts/social-interactions/types.d.ts +9 -0
- package/dist/posts/social-interactions/types.js +1 -0
- package/dist/products/product-card/cmp.product-card.svelte +27 -8
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +2 -1
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +11 -17
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +1 -5
- package/dist/short-videos/short-videos-player/index.d.ts +20 -5
- package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.d.ts +1 -1
- package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.js +1 -1
- package/dist/short-videos/short-videos-player/internal-short-video-player-provider.d.ts +1 -1
- package/dist/short-videos/short-videos-player/mapper.js +2 -2
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +50 -216
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte.d.ts +2 -9
- package/dist/short-videos/short-videos-player/types.d.ts +6 -7
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +3 -3
- package/dist/streams/layout/models/index.d.ts +1 -1
- package/dist/streams/layout/models/index.js +1 -1
- package/dist/streams/layout/models/mapper.d.ts +2 -2
- package/dist/streams/layout/models/mapper.js +6 -6
- package/dist/streams/stream-player/index.d.ts +25 -4
- package/dist/streams/stream-player/internal-stream-analytics-handler.d.ts +2 -0
- package/dist/streams/stream-player/internal-stream-analytics-handler.js +2 -0
- package/dist/streams/stream-player/stream-overview.svelte +47 -122
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -4
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +1 -1
- package/dist/streams/stream-player/stream-player-localization.d.ts +1 -5
- package/dist/streams/stream-player/stream-player-localization.js +2 -10
- package/dist/streams/stream-player/stream-player-view.svelte +229 -0
- package/dist/streams/stream-player/stream-player-view.svelte.d.ts +8 -0
- package/dist/streams/stream-player/types.d.ts +4 -4
- package/dist/ui/{player → player-slider}/cmp.player-slider.svelte.d.ts +2 -10
- package/dist/ui/{player → player-slider}/types.d.ts +9 -0
- package/dist/ui/player-slider/types.js +1 -0
- package/package.json +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte.d.ts +0 -13
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +0 -52
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte.d.ts +0 -19
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +0 -89
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte +0 -26
- package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte.d.ts +0 -16
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +0 -146
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -5
- package/dist/short-videos/short-video-viewer/index.js +0 -4
- package/dist/short-videos/short-video-viewer/mapper.d.ts +0 -3
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.d.ts +0 -5
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +0 -7
- package/dist/short-videos/short-videos-player/controls.svelte +0 -261
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +0 -22
- package/dist/short-videos/short-videos-player/fade-mixins.scss +0 -12
- package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +0 -7
- package/dist/short-videos/short-videos-player/short-videos-player-localization.js +0 -11
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +0 -24
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +0 -47
- package/dist/streams/cmp.stream-product-card.svelte +0 -25
- package/dist/streams/cmp.stream-product-card.svelte.d.ts +0 -16
- package/dist/streams/stream-player/controls.svelte +0 -301
- package/dist/streams/stream-player/controls.svelte.d.ts +0 -20
- package/dist/streams/stream-player/fade-mixins.scss +0 -12
- package/dist/streams/stream-player/stream-player.svelte +0 -393
- package/dist/streams/stream-player/stream-player.svelte.d.ts +0 -16
- package/dist/streams/stream-player/ui-manager.svelte.js +0 -63
- /package/dist/{streams/stream-player → content-player}/button-mixins.scss +0 -0
- /package/dist/{ui/player → media-center/model}/types.js +0 -0
- /package/dist/{short-videos/short-video-viewer → posts/post-viewer}/types.js +0 -0
- /package/dist/ui/{player → player-slider}/cmp.player-slider.svelte +0 -0
- /package/dist/ui/{player → player-slider}/index.d.ts +0 -0
- /package/dist/ui/{player → player-slider}/index.js +0 -0
- /package/dist/ui/{player → player-slider}/player-buffer.svelte.d.ts +0 -0
- /package/dist/ui/{player → player-slider}/player-buffer.svelte.js +0 -0
- /package/dist/ui/{player → player-slider}/prevent-slider-scroll.d.ts +0 -0
- /package/dist/ui/{player → player-slider}/prevent-slider-scroll.js +0 -0
- /package/dist/ui/{player → player-slider}/wheel-gestures-adapter.d.ts +0 -0
- /package/dist/ui/{player → player-slider}/wheel-gestures-adapter.js +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ContentPlayerConfig } from './content-player-config.svelte';
|
|
2
|
+
declare class __sveltets_Render<T extends {
|
|
3
|
+
id: string;
|
|
4
|
+
}> {
|
|
5
|
+
props(): {
|
|
6
|
+
config: ContentPlayerConfig<T>;
|
|
7
|
+
};
|
|
8
|
+
events(): {};
|
|
9
|
+
slots(): {};
|
|
10
|
+
bindings(): "";
|
|
11
|
+
exports(): {};
|
|
12
|
+
}
|
|
13
|
+
interface $$IsomorphicComponent {
|
|
14
|
+
new <T extends {
|
|
15
|
+
id: string;
|
|
16
|
+
}>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
17
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
18
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
19
|
+
<T extends {
|
|
20
|
+
id: string;
|
|
21
|
+
}>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
22
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
23
|
+
}
|
|
24
|
+
declare const ControlsAndAttachments: $$IsomorphicComponent;
|
|
25
|
+
type ControlsAndAttachments<T extends {
|
|
26
|
+
id: string;
|
|
27
|
+
}> = InstanceType<typeof ControlsAndAttachments<T>>;
|
|
28
|
+
export default ControlsAndAttachments;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@mixin default-opacity {
|
|
2
|
+
--content-player--elements-opacity: 1;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin fade-opacity {
|
|
6
|
+
--content-player--elements-opacity: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin handle-fade {
|
|
10
|
+
opacity: var(--content-player--elements-opacity);
|
|
11
|
+
transition: opacity 0.3s ease-in-out;
|
|
12
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts">import { slideHorizontally } from '../core/transitions';
|
|
2
|
+
import { Icon } from '../ui/icon';
|
|
3
|
+
import IconPanelLeftText from '@fluentui/svg-icons/icons/panel_left_text_20_regular.svg?raw';
|
|
4
|
+
let { children, contentFaded, uiManager } = $props();
|
|
5
|
+
const overviewAttached = (node) => {
|
|
6
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
7
|
+
uiManager.setOverviewWidth(node.clientWidth);
|
|
8
|
+
});
|
|
9
|
+
resizeObserver.observe(node);
|
|
10
|
+
return {
|
|
11
|
+
destroy() {
|
|
12
|
+
resizeObserver.disconnect();
|
|
13
|
+
uiManager.setOverviewWidth(0);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#if !uiManager.overviewCollapsed && !contentFaded}
|
|
20
|
+
<div class="overview-panel" transition:slideHorizontally|local use:overviewAttached>
|
|
21
|
+
{@render children()}
|
|
22
|
+
</div>
|
|
23
|
+
{/if}
|
|
24
|
+
|
|
25
|
+
<button
|
|
26
|
+
class="toggle-collapsed-button"
|
|
27
|
+
class:toggle-collapsed-button--overview-expanded={!!uiManager.overviewWidth}
|
|
28
|
+
type="button"
|
|
29
|
+
onclick={() => (uiManager.overviewCollapsed = !uiManager.overviewCollapsed)}>
|
|
30
|
+
<Icon src={IconPanelLeftText} />
|
|
31
|
+
</button>
|
|
32
|
+
|
|
33
|
+
<style>@keyframes fadeIn {
|
|
34
|
+
0% {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
}
|
|
37
|
+
50% {
|
|
38
|
+
opacity: 0.4;
|
|
39
|
+
}
|
|
40
|
+
100% {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.overview-panel {
|
|
45
|
+
background: #1c1c1c;
|
|
46
|
+
height: 100%;
|
|
47
|
+
min-height: 100%;
|
|
48
|
+
max-height: 100%;
|
|
49
|
+
width: 13.75rem;
|
|
50
|
+
min-width: 13.75rem;
|
|
51
|
+
max-width: 13.75rem;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
min-height: 0;
|
|
55
|
+
padding-bottom: 0.9375rem;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
height: 100%;
|
|
61
|
+
z-index: 1;
|
|
62
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
63
|
+
}
|
|
64
|
+
@container (width < 576px) {
|
|
65
|
+
.overview-panel {
|
|
66
|
+
width: calc(100% - 80px);
|
|
67
|
+
min-width: calc(100% - 80px);
|
|
68
|
+
max-width: calc(100% - 80px);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.toggle-collapsed-button {
|
|
73
|
+
position: absolute;
|
|
74
|
+
bottom: 0.625rem;
|
|
75
|
+
left: 0.625rem;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
--icon--color: #ffffff;
|
|
78
|
+
--icon--size: 1.25rem;
|
|
79
|
+
opacity: var(--content-player--elements-opacity);
|
|
80
|
+
transition: opacity 0.3s ease-in-out;
|
|
81
|
+
}
|
|
82
|
+
.toggle-collapsed-button--overview-expanded {
|
|
83
|
+
left: calc(var(--content-player--overview--width) - 0.625rem);
|
|
84
|
+
transform: translateX(-100%);
|
|
85
|
+
}</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContentPlayerUIManager } from './ui-manager.svelte';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type Props = {
|
|
4
|
+
uiManager: ContentPlayerUIManager;
|
|
5
|
+
contentFaded: boolean;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const OverviewPanel: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type OverviewPanel = ReturnType<typeof OverviewPanel>;
|
|
10
|
+
export default OverviewPanel;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class ContentPlayerUIManager {
|
|
2
2
|
overviewCollapsed: boolean;
|
|
3
|
-
|
|
3
|
+
showAttachments: boolean;
|
|
4
4
|
globalCssVariables: string;
|
|
5
5
|
isMobileView: boolean;
|
|
6
6
|
viewInitialized: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
showPostOverlayAttachments: boolean;
|
|
8
|
+
showPostOverlayControls: boolean;
|
|
9
9
|
private _backgroundImageUrl;
|
|
10
|
-
private
|
|
10
|
+
private _dialogTotalWidth;
|
|
11
11
|
private _mainViewColumnWidth;
|
|
12
12
|
private _mediaCenterHeaderHeight;
|
|
13
13
|
private _overviewWidth;
|
|
@@ -15,15 +15,16 @@ export declare class StreamPlayerUiManager {
|
|
|
15
15
|
private _controlsNavitagionButtonsWidth;
|
|
16
16
|
private _controlsAvailableSpace;
|
|
17
17
|
private _controlsContentWidth;
|
|
18
|
-
get
|
|
18
|
+
get dialogTotalWidth(): number;
|
|
19
19
|
get mainViewColumnWidth(): number;
|
|
20
20
|
get backgroundImageUrl(): string | null;
|
|
21
|
-
|
|
21
|
+
get overviewWidth(): number;
|
|
22
|
+
setDialogDimensions: (dimensions: {
|
|
22
23
|
viewTotalWidth: number;
|
|
23
24
|
mainViewColumnWidth: number;
|
|
24
25
|
}) => void;
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
setOverviewWidth: (width: number) => void;
|
|
27
|
+
setMediaCenterHeaderHeight: (height: number) => void;
|
|
27
28
|
setAttachmentsPanelWidth: (width: number) => void;
|
|
28
29
|
setNavigationButtonsBlockWidth: (width: number) => void;
|
|
29
30
|
setBackgroundImageUrl: (url: string | null) => void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const CONTROLS_PADDING_HORIZONTAL = 28;
|
|
2
|
+
const CONTROLS_PADDING_VERTICAL = 28;
|
|
3
|
+
const CONTROLS_ATTACHMENTS_MAX_WIDTH = 176;
|
|
4
|
+
const PLAYER_PADDING_VERTICAL = 10;
|
|
5
|
+
export class ContentPlayerUIManager {
|
|
6
|
+
overviewCollapsed = $state(false);
|
|
7
|
+
showAttachments = $state(true);
|
|
8
|
+
globalCssVariables = $derived.by(() => {
|
|
9
|
+
const values = [
|
|
10
|
+
`--content-player--controls--attachments--max-width: ${CONTROLS_ATTACHMENTS_MAX_WIDTH}px`,
|
|
11
|
+
`--content-player--controls--logo--max-width: ${CONTROLS_ATTACHMENTS_MAX_WIDTH}px`,
|
|
12
|
+
`--content-player--controls--logo--height: ${this._mediaCenterHeaderHeight || 72}px`,
|
|
13
|
+
`--content-player--controls--available-space: ${this._controlsAvailableSpace}px`,
|
|
14
|
+
`--content-player--controls--close-button--left: ${this._overviewWidth}px`,
|
|
15
|
+
`--content-player--controls--padding: ${this._mediaCenterHeaderHeight ? 0 : CONTROLS_PADDING_VERTICAL}px ${CONTROLS_PADDING_HORIZONTAL}px ${CONTROLS_PADDING_VERTICAL}px`,
|
|
16
|
+
`--content-player--overview--width: ${this._overviewWidth}px`,
|
|
17
|
+
`--content-player--padding: ${this._mediaCenterHeaderHeight ? this._mediaCenterHeaderHeight : PLAYER_PADDING_VERTICAL}px 0 ${PLAYER_PADDING_VERTICAL}px`
|
|
18
|
+
];
|
|
19
|
+
if (this._backgroundImageUrl) {
|
|
20
|
+
values.push(`--content-player--background-image-url: url(${this._backgroundImageUrl})`);
|
|
21
|
+
}
|
|
22
|
+
return values.join(';');
|
|
23
|
+
});
|
|
24
|
+
isMobileView = $derived.by(() => this._dialogTotalWidth <= 576);
|
|
25
|
+
viewInitialized = $derived.by(() => !!this._dialogTotalWidth && !!this._mainViewColumnWidth);
|
|
26
|
+
showPostOverlayAttachments = $derived.by(() => this.viewInitialized && this._controlsAttachmentsPanelWidth < CONTROLS_ATTACHMENTS_MAX_WIDTH + 10);
|
|
27
|
+
showPostOverlayControls = $derived.by(() => this.viewInitialized && this._controlsContentWidth < this._controlsNavitagionButtonsWidth);
|
|
28
|
+
_backgroundImageUrl = $state(null);
|
|
29
|
+
_dialogTotalWidth = $state(0);
|
|
30
|
+
_mainViewColumnWidth = $state(0);
|
|
31
|
+
_mediaCenterHeaderHeight = $state(0);
|
|
32
|
+
_overviewWidth = $state(0);
|
|
33
|
+
_controlsAttachmentsPanelWidth = $state(0);
|
|
34
|
+
_controlsNavitagionButtonsWidth = $state(0);
|
|
35
|
+
_controlsAvailableSpace = $derived.by(() => (this._dialogTotalWidth - this._mainViewColumnWidth) / 2);
|
|
36
|
+
_controlsContentWidth = $derived.by(() => this._controlsAvailableSpace - CONTROLS_PADDING_HORIZONTAL * 2);
|
|
37
|
+
get dialogTotalWidth() {
|
|
38
|
+
return this._dialogTotalWidth;
|
|
39
|
+
}
|
|
40
|
+
get mainViewColumnWidth() {
|
|
41
|
+
return this._mainViewColumnWidth;
|
|
42
|
+
}
|
|
43
|
+
get backgroundImageUrl() {
|
|
44
|
+
return this._backgroundImageUrl;
|
|
45
|
+
}
|
|
46
|
+
get overviewWidth() {
|
|
47
|
+
return this._overviewWidth;
|
|
48
|
+
}
|
|
49
|
+
setDialogDimensions = (dimensions) => {
|
|
50
|
+
this._dialogTotalWidth = dimensions.viewTotalWidth;
|
|
51
|
+
this._mainViewColumnWidth = dimensions.mainViewColumnWidth;
|
|
52
|
+
};
|
|
53
|
+
setOverviewWidth = (width) => {
|
|
54
|
+
this._overviewWidth = width;
|
|
55
|
+
};
|
|
56
|
+
setMediaCenterHeaderHeight = (height) => {
|
|
57
|
+
this._mediaCenterHeaderHeight = height;
|
|
58
|
+
};
|
|
59
|
+
setAttachmentsPanelWidth = (width) => {
|
|
60
|
+
this._controlsAttachmentsPanelWidth = width;
|
|
61
|
+
};
|
|
62
|
+
setNavigationButtonsBlockWidth = (width) => {
|
|
63
|
+
this._controlsNavitagionButtonsWidth = width;
|
|
64
|
+
};
|
|
65
|
+
setBackgroundImageUrl = (url) => {
|
|
66
|
+
this._backgroundImageUrl = url;
|
|
67
|
+
};
|
|
68
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -48,7 +48,8 @@ export class InternalMediaCenterConfig {
|
|
|
48
48
|
mediaPageId: this.mediaPageId,
|
|
49
49
|
categoryId: filter.categoryId,
|
|
50
50
|
excludeIds: filter.excludeIds,
|
|
51
|
-
statuses: [StreamStatus.Published]
|
|
51
|
+
statuses: [StreamStatus.Published],
|
|
52
|
+
showInFeed: true
|
|
52
53
|
},
|
|
53
54
|
limit,
|
|
54
55
|
continuationToken
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPostSocialInteractionsHandler } from '../../
|
|
1
|
+
import type { IPostSocialInteractionsHandler } from '../../posts';
|
|
2
2
|
import type { IShortVideoAnalyticsHandler, ShortVideoPlayerModel } from '../../short-videos/short-videos-player/types';
|
|
3
3
|
import type { IStreamPlayerDataProvider, IStreamAnalyticsHandler } from '../../streams/stream-player/types';
|
|
4
4
|
export interface IMediaCenterConfig {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { horizontalWheelScroll } from '../../core/actions';
|
|
11
11
|
import { Utils } from '../../core/utils';
|
|
12
12
|
import { default as ShortVideosPlayerView } from '../../short-videos/short-videos-player/short-videos-player-view.svelte';
|
|
13
|
-
import { default as
|
|
13
|
+
import { default as StreamPlayerView } from '../../streams/stream-player/stream-player-view.svelte';
|
|
14
14
|
import { Dropdown } from '../../ui/dropdown';
|
|
15
15
|
import { Icon, IconColor } from '../../ui/icon';
|
|
16
16
|
import { Loading } from '../../ui/loading';
|
|
@@ -210,7 +210,7 @@ const onScrollMounted = (node) => {
|
|
|
210
210
|
{#if mediaDataLoading}
|
|
211
211
|
<Loading positionFixedCenter={true} timeout={600} />
|
|
212
212
|
{:else}
|
|
213
|
-
{#snippet
|
|
213
|
+
{#snippet controlsPanel(data: { maxItemsWidth: Number; onMounted: (data: { height: Number }) => void; closeButton?: Snippet })}
|
|
214
214
|
<div class="media-center" use:mounted={data.onMounted}>
|
|
215
215
|
{#if data.closeButton}
|
|
216
216
|
<div class="media-center__close-button">
|
|
@@ -270,15 +270,19 @@ const onScrollMounted = (node) => {
|
|
|
270
270
|
{#if computedPlayerProps.mode === MediaCenterMode.ShortVideos}
|
|
271
271
|
<ShortVideosPlayerView
|
|
272
272
|
{...computedPlayerProps.props}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
mediaCenterData={{
|
|
274
|
+
controlsPanel: categories.length ? controlsPanel : undefined,
|
|
275
|
+
playerLogo: logo,
|
|
276
|
+
overlayIsActive: overlayActivated
|
|
277
|
+
}} />
|
|
276
278
|
{:else if computedPlayerProps.mode === MediaCenterMode.Stream}
|
|
277
|
-
<
|
|
279
|
+
<StreamPlayerView
|
|
278
280
|
{...computedPlayerProps.props}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
mediaCenterData={{
|
|
282
|
+
controlsPanel: categories.length ? controlsPanel : undefined,
|
|
283
|
+
playerLogo: logo,
|
|
284
|
+
overlayIsActive: overlayActivated
|
|
285
|
+
}} />
|
|
282
286
|
{/if}
|
|
283
287
|
{#if overviewOpened && overviewData?.loading}
|
|
284
288
|
<Loading positionFixedCenter={true} timeout={600} />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
1
|
+
<script lang="ts">import { getPostCoverImage } from '../../posts/post-viewer';
|
|
2
|
+
import { ProductCard } from '../../products/product-card';
|
|
2
3
|
import { ShortVideoCard } from '../../short-videos/short-video-card';
|
|
3
4
|
import { StreamCard } from '../../streams/stream-card';
|
|
4
5
|
import { MediaCenterLocalization } from './media-center-localization';
|
|
@@ -62,7 +63,7 @@ const shortVideoSectionItems = $derived.by(() => {
|
|
|
62
63
|
{#if item.kind === 'video'}
|
|
63
64
|
<div class="media-center-overview__card-wrapper">
|
|
64
65
|
<ShortVideoCard
|
|
65
|
-
shortVideo={{ id: item.data.id, text: item.data.text, cover: item.data
|
|
66
|
+
shortVideo={{ id: item.data.id, text: item.data.text, cover: getPostCoverImage(item.data) }}
|
|
66
67
|
on={{ click: () => on.shortVideoSelected(item.data) }} />
|
|
67
68
|
</div>
|
|
68
69
|
{:else if item.kind === 'product'}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShortVideoPlayerModel } from '../../short-videos/short-videos-player';
|
|
2
|
-
import type { IPlayerItemsProvider } from '../../ui/player';
|
|
2
|
+
import type { IPlayerItemsProvider } from '../../ui/player-slider';
|
|
3
3
|
import type { IMediaCenterConfig } from '../config/types';
|
|
4
4
|
export declare const makeShortVideosProvider: (data: {
|
|
5
5
|
config: IMediaCenterConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type MediaCenterData = {
|
|
3
|
+
controlsPanel?: Snippet<[{
|
|
4
|
+
maxItemsWidth: number;
|
|
5
|
+
onMounted: (data: {
|
|
6
|
+
height: number;
|
|
7
|
+
}) => void;
|
|
8
|
+
closeButton: Snippet | undefined;
|
|
9
|
+
}]>;
|
|
10
|
+
playerLogo: string | null;
|
|
11
|
+
overlayIsActive: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">import { AdCard } from '../../ads/ad-card';
|
|
2
|
+
import { ProductCard } from '../../products/product-card';
|
|
3
|
+
let { container, locale = 'en', on } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
{#if container.ads.length || container.products.length}
|
|
7
|
+
<div class="post-attachments">
|
|
8
|
+
{#if container.ads.length}
|
|
9
|
+
{#each container.ads as ad (ad.id)}
|
|
10
|
+
<AdCard
|
|
11
|
+
ad={ad}
|
|
12
|
+
on={{
|
|
13
|
+
click: on?.adClick,
|
|
14
|
+
impression: on?.adImpression
|
|
15
|
+
}} />
|
|
16
|
+
{/each}
|
|
17
|
+
{/if}
|
|
18
|
+
|
|
19
|
+
{#if container.products.length}
|
|
20
|
+
{#each container.products as product (product.id)}
|
|
21
|
+
<ProductCard
|
|
22
|
+
product={product}
|
|
23
|
+
locale={locale}
|
|
24
|
+
on={{
|
|
25
|
+
click: on?.productClick,
|
|
26
|
+
impression: on?.productImpression
|
|
27
|
+
}} />
|
|
28
|
+
{/each}
|
|
29
|
+
{/if}
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
32
|
+
|
|
33
|
+
<style>@keyframes fadeIn {
|
|
34
|
+
0% {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
}
|
|
37
|
+
50% {
|
|
38
|
+
opacity: 0.4;
|
|
39
|
+
}
|
|
40
|
+
100% {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.post-attachments {
|
|
45
|
+
--_post-attachments--gap: var(--post-attachments--gap, 2.75rem);
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: var(--_post-attachments--gap);
|
|
49
|
+
padding: 0;
|
|
50
|
+
}</style>
|
package/dist/{short-videos/short-video-viewer → posts/attachments}/cmp.attachments.svelte.d.ts
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Locale } from '../../core/locale';
|
|
2
|
-
import {
|
|
2
|
+
import type { PostAttachmentsContainer } from '..';
|
|
3
3
|
type Props = {
|
|
4
|
-
|
|
4
|
+
container: PostAttachmentsContainer;
|
|
5
5
|
locale?: Locale;
|
|
6
6
|
on?: {
|
|
7
7
|
productClick?: (productId: string) => void;
|
|
8
|
-
productImpression?: (productId: string
|
|
8
|
+
productImpression?: (productId: string) => void;
|
|
9
9
|
adClick?: (adId: string) => void;
|
|
10
10
|
adImpression?: (adId: string) => void;
|
|
11
11
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PostAttachments } from './cmp.attachments.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PostAttachments } from './cmp.attachments.svelte';
|
|
@@ -24,13 +24,13 @@ let isLikedStore = $state.raw({
|
|
|
24
24
|
});
|
|
25
25
|
const availableActionsCount = $derived.by(() => {
|
|
26
26
|
let actionsCount = 0;
|
|
27
|
-
if (model.products.length || model.
|
|
27
|
+
if (model.products.length || model.ads.length) {
|
|
28
28
|
actionsCount++;
|
|
29
29
|
}
|
|
30
30
|
if (showSocialInteractions) {
|
|
31
31
|
actionsCount++;
|
|
32
32
|
}
|
|
33
|
-
if (
|
|
33
|
+
if (model.media && model.media.isMutable) {
|
|
34
34
|
actionsCount++;
|
|
35
35
|
}
|
|
36
36
|
return actionsCount;
|
|
@@ -66,30 +66,25 @@ const refreshIsLiked = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
{#if availableActionsCount}
|
|
69
|
-
<div class="
|
|
70
|
-
{#if model.products.length || model.
|
|
71
|
-
<button type="button" class="
|
|
69
|
+
<div class="post-controls" class:post-controls--single-action={availableActionsCount === 1}>
|
|
70
|
+
{#if model.products.length || model.ads.length}
|
|
71
|
+
<button type="button" class="post-controls__action" onclick={onAttachmentsClicked}>
|
|
72
72
|
<Icon src={IconShoppingBag} />
|
|
73
73
|
</button>
|
|
74
74
|
{/if}
|
|
75
75
|
|
|
76
76
|
{#if showSocialInteractions}
|
|
77
|
-
<button
|
|
78
|
-
type="button"
|
|
79
|
-
class="short-video-controls__action"
|
|
80
|
-
onclick={onLikeClicked}
|
|
81
|
-
aria-label="none"
|
|
82
|
-
class:short-video-controls__action--liked={isLikedStore.isLiked}>
|
|
77
|
+
<button type="button" class="post-controls__action" onclick={onLikeClicked} aria-label="none" class:post-controls__action--liked={isLikedStore.isLiked}>
|
|
83
78
|
<Icon src={isLikedStore.isLiked ? IconHeartFilled : IconHeart} />
|
|
84
79
|
</button>
|
|
85
80
|
|
|
86
|
-
<button type="button" class="
|
|
81
|
+
<button type="button" class="post-controls__action" onclick={onShareClicked}>
|
|
87
82
|
<Icon src={IconShare} />
|
|
88
83
|
</button>
|
|
89
84
|
{/if}
|
|
90
85
|
|
|
91
|
-
{#if
|
|
92
|
-
<button type="button" class="
|
|
86
|
+
{#if model.media && model.media.isMutable}
|
|
87
|
+
<button type="button" class="post-controls__action" onclick={onMuteClicked}>
|
|
93
88
|
{#if MediaVolumeManager.isMuted}
|
|
94
89
|
<Icon src={IconSpeakerMute} />
|
|
95
90
|
{:else}
|
|
@@ -111,10 +106,10 @@ const refreshIsLiked = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
111
106
|
opacity: 1;
|
|
112
107
|
}
|
|
113
108
|
}
|
|
114
|
-
.
|
|
115
|
-
--
|
|
116
|
-
--
|
|
117
|
-
--
|
|
109
|
+
.post-controls {
|
|
110
|
+
--_post-controls--icon--size: var(--post-controls--icon--size, 1.75rem);
|
|
111
|
+
--_post-controls--padding-vertical: 1rem;
|
|
112
|
+
--_post-controls--padding-horizontal: 0.625rem;
|
|
118
113
|
cursor: pointer;
|
|
119
114
|
display: flex;
|
|
120
115
|
flex-direction: column;
|
|
@@ -123,23 +118,23 @@ const refreshIsLiked = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
123
118
|
border-radius: 1.25rem;
|
|
124
119
|
border: 0.0625rem solid #1c1c1c;
|
|
125
120
|
background: rgba(0, 0, 0, 0.6);
|
|
126
|
-
padding: var(--
|
|
121
|
+
padding: var(--_post-controls--padding-vertical) var(--_post-controls--padding-horizontal);
|
|
127
122
|
}
|
|
128
|
-
.
|
|
129
|
-
padding: var(--
|
|
130
|
-
border-radius: calc((var(--
|
|
123
|
+
.post-controls--single-action {
|
|
124
|
+
padding: var(--_post-controls--padding-horizontal);
|
|
125
|
+
border-radius: calc((var(--_post-controls--padding-horizontal) * 2 + var(--_post-controls--icon--size)) / 2);
|
|
131
126
|
}
|
|
132
|
-
.
|
|
133
|
-
--icon--size: var(--
|
|
127
|
+
.post-controls__action {
|
|
128
|
+
--icon--size: var(--_post-controls--icon--size);
|
|
134
129
|
--icon--color: #ffffff;
|
|
135
130
|
display: flex;
|
|
136
131
|
justify-content: center;
|
|
137
132
|
align-items: center;
|
|
138
133
|
}
|
|
139
|
-
.
|
|
134
|
+
.post-controls__action--liked {
|
|
140
135
|
--icon--color: #e71d36;
|
|
141
136
|
}
|
|
142
|
-
.
|
|
137
|
+
.post-controls__action:hover {
|
|
143
138
|
transform: scale(1.2);
|
|
144
139
|
transition: 0.3s;
|
|
145
140
|
}</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IPostSocialInteractionsHandler, PostContainer } from '..';
|
|
2
|
+
type Props = {
|
|
3
|
+
model: PostContainer;
|
|
4
|
+
socialInteractionsHandler?: IPostSocialInteractionsHandler;
|
|
5
|
+
on?: {
|
|
6
|
+
attachmentsClicked?: () => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
11
|
+
export default Cmp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PostControls } from './cmp.controls.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PostControls } from './cmp.controls.svelte';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AdCardModel } from '../../ads/ad-card';
|
|
2
|
+
import type { ProductCardModel } from '../../products/product-card';
|
|
3
|
+
export type PostContainer = PostAttachmentsContainer & {
|
|
4
|
+
id: string;
|
|
5
|
+
enableSocialInteractions: boolean;
|
|
6
|
+
media: {
|
|
7
|
+
isMutable: boolean;
|
|
8
|
+
} | null;
|
|
9
|
+
};
|
|
10
|
+
export type PostAttachmentsContainer = {
|
|
11
|
+
ads: AdCardModel[];
|
|
12
|
+
products: ProductCardModel[];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,7 +21,7 @@ const attachmentsToShow = $derived.by(() => {
|
|
|
21
21
|
title: p.title,
|
|
22
22
|
description: p.shortDescription
|
|
23
23
|
}));
|
|
24
|
-
const ads =
|
|
24
|
+
const ads = model.ads
|
|
25
25
|
.filter((a) => !!a.image)
|
|
26
26
|
.map((a) => {
|
|
27
27
|
var _a;
|
|
@@ -148,14 +148,13 @@ $effect(() => {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
.attachments-horizontal {
|
|
151
|
-
--_short-video-attachments-horizontal--padding-horizontal: var(--short-video-attachments-horizontal--padding-horizontal, 0);
|
|
152
151
|
display: flex;
|
|
153
152
|
gap: 0.5rem;
|
|
154
153
|
flex-wrap: nowrap;
|
|
155
154
|
width: 100%;
|
|
156
155
|
justify-content: flex-start;
|
|
157
156
|
overflow-x: auto;
|
|
158
|
-
padding: 0 var(--
|
|
157
|
+
padding: 0 var(--post-viewer--attachments-horizontal--padding-horizontal);
|
|
159
158
|
scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
|
|
160
159
|
scrollbar-width: none;
|
|
161
160
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PostViewerModel } from './types';
|
|
2
|
+
type Props = {
|
|
3
|
+
model: PostViewerModel;
|
|
4
|
+
on?: {
|
|
5
|
+
productClick?: (productId: string) => void;
|
|
6
|
+
productImpression?: (productId: string, videoId: string) => void;
|
|
7
|
+
adClick?: (adId: string) => void;
|
|
8
|
+
adImpression?: (adId: string) => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare const AttachmentsHorizontal: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type AttachmentsHorizontal = ReturnType<typeof AttachmentsHorizontal>;
|
|
13
|
+
export default AttachmentsHorizontal;
|