@streamscloud/embeddable 6.5.1 → 7.0.0-1758321646285
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 +29 -3
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +4 -0
- package/dist/core/enums.d.ts +3 -0
- package/dist/core/enums.js +4 -0
- package/dist/core/locale.d.ts +0 -4
- package/dist/core/locale.js +1 -12
- package/dist/media-center/config/internal-media-center-config.d.ts +9 -0
- package/dist/media-center/config/internal-media-center-config.js +81 -0
- package/dist/media-center/{data-provider → config}/operations.generated.d.ts +20 -3
- package/dist/media-center/{data-provider → config}/operations.generated.js +53 -2
- package/dist/media-center/{data-provider → config}/operations.graphql +15 -1
- package/dist/media-center/config/types.d.ts +52 -0
- package/dist/media-center/index.d.ts +1 -1
- package/dist/media-center/media-center/cmp.media-center.svelte +105 -66
- package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +11 -11
- package/dist/media-center/media-center/index.d.ts +0 -1
- package/dist/media-center/media-center/media-center-localization.d.ts +3 -8
- package/dist/media-center/media-center/media-center-localization.js +12 -6
- package/dist/media-center/media-center/overview.svelte +14 -1
- package/dist/media-center/media-center/overview.svelte.d.ts +1 -0
- package/dist/media-center/media-center/short-video-resources-generator.d.ts +2 -2
- package/dist/media-center/media-center/short-video-resources-generator.js +2 -2
- package/dist/media-center/media-center/streams-in-category.svelte +100 -0
- package/dist/media-center/media-center/streams-in-category.svelte.d.ts +10 -0
- package/dist/media-center/media-center/types.d.ts +11 -0
- package/dist/products/product-card/cmp.product-card.svelte +2 -2
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +1 -2
- package/dist/products/product-card/product-card-localization.d.ts +1 -4
- package/dist/products/product-card/product-card-localization.js +2 -2
- package/dist/short-videos/short-video-card/cmp.short-video-card.svelte +11 -46
- package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte +17 -7
- package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte.d.ts +2 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +9 -4
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +2 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +2 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte +2 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte.d.ts +1 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +5 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -2
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.d.ts +2 -6
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +4 -4
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +3 -10
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +7 -7
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +4 -4
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +2 -2
- package/dist/short-videos/short-videos-player/controls.svelte +4 -2
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +2 -0
- package/dist/short-videos/short-videos-player/index.d.ts +12 -10
- package/dist/short-videos/short-videos-player/index.js +9 -8
- package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.d.ts +2 -0
- package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.js +2 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +4 -11
- package/dist/short-videos/short-videos-player/short-videos-player-localization.js +8 -8
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +16 -6
- package/dist/short-videos/short-videos-player/types.d.ts +4 -4
- package/dist/streams/cmp.stream-product-card.svelte +2 -2
- package/dist/streams/cmp.stream-product-card.svelte.d.ts +1 -2
- package/dist/streams/layout/cmp.slot-content.svelte +2 -2
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +1 -2
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +3 -8
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +1 -2
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +1 -2
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +3 -8
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +1 -2
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +1 -2
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +6 -6
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +1 -2
- package/dist/streams/layout/element-views/index.d.ts +0 -4
- package/dist/streams/layout/element-views/price-element-view.svelte +1 -1
- package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +2 -8
- package/dist/streams/layout/element-views/price-stream-element-localization.js +5 -5
- package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +2 -6
- package/dist/streams/layout/element-views/short-video-stream-element-localization.js +4 -4
- package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +1 -4
- package/dist/streams/layout/element-views/stock-stream-element-localization.js +2 -2
- package/dist/streams/layout/element-views/stream-element-localization.d.ts +4 -12
- package/dist/streams/layout/element-views/stream-element-localization.js +5 -5
- package/dist/streams/stream-card/cmp.stream-card.svelte +89 -0
- package/dist/streams/stream-card/cmp.stream-card.svelte.d.ts +11 -0
- package/dist/streams/stream-card/index.d.ts +2 -0
- package/dist/streams/stream-card/index.js +1 -0
- package/dist/streams/stream-card/types.d.ts +6 -0
- package/dist/streams/stream-card/types.js +1 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +3 -3
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +1 -2
- package/dist/streams/stream-page-viewer/index.d.ts +0 -1
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +2 -6
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +3 -3
- package/dist/streams/stream-player/controls.svelte +1 -1
- package/dist/streams/stream-player/index.d.ts +15 -10
- package/dist/streams/stream-player/index.js +11 -8
- package/dist/streams/stream-player/internal-stream-player-data-provider.d.ts +2 -0
- package/dist/streams/stream-player/internal-stream-player-data-provider.js +2 -2
- package/dist/streams/stream-player/stream-overview.svelte +1 -1
- package/dist/streams/stream-player/stream-player-localization.d.ts +6 -19
- package/dist/streams/stream-player/stream-player-localization.js +14 -14
- package/dist/streams/stream-player/stream-player.svelte +6 -6
- package/dist/streams/stream-player/types.d.ts +4 -4
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +1 -2
- package/dist/ui/line-clamp/index.d.ts +0 -1
- package/dist/ui/line-clamp/index.js +0 -1
- package/dist/ui/line-clamp/line-clamp-localization.d.ts +1 -5
- package/dist/ui/line-clamp/line-clamp-localization.js +4 -4
- package/dist/ui/shadow-dom/{reset.scss → reset-shadow.css} +31 -44
- package/dist/ui/shadow-dom/shadow-root-service.js +2 -2
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +2 -2
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +1 -2
- package/dist/ui/swipe-indicator/index.d.ts +0 -1
- package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +1 -4
- package/dist/ui/swipe-indicator/swipe-indicator-localization.js +3 -3
- package/dist/ui/time-ago/cmp.time-ago.svelte +2 -2
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +1 -2
- package/dist/ui/time-ago/index.d.ts +0 -1
- package/dist/ui/time-ago/time-ago-localization.d.ts +1 -11
- package/dist/ui/time-ago/time-ago-localization.js +10 -10
- package/package.json +1 -1
- package/dist/media-center/data-provider/index.d.ts +0 -2
- package/dist/media-center/data-provider/index.js +0 -1
- package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.d.ts +0 -8
- package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.js +0 -46
- package/dist/media-center/data-provider/types.d.ts +0 -24
- /package/dist/media-center/{data-provider → config}/types.js +0 -0
- /package/dist/ui/shadow-dom/{normalize.scss → normalize-shadow.css} +0 -0
|
@@ -140,7 +140,7 @@ $effect(() => {
|
|
|
140
140
|
{/if}
|
|
141
141
|
</div>
|
|
142
142
|
{#if model.stock}
|
|
143
|
-
<StockElementView model={model.stock} heightOverrideDdu={stockElementHeight}
|
|
143
|
+
<StockElementView model={model.stock} heightOverrideDdu={stockElementHeight} locale={localization.stockLocalization} />
|
|
144
144
|
{/if}
|
|
145
145
|
</div>
|
|
146
146
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { type Locale } from '../../../core/locale';
|
|
2
|
-
import type { IStockStreamElementLocalization } from './stock-stream-element-localization';
|
|
3
|
-
export interface IPriceStreamElementLocalization {
|
|
4
|
-
saveValue?: (value: string | number) => string;
|
|
5
|
-
beforeValue?: (value: string) => string;
|
|
6
|
-
stockLocalization?: IStockStreamElementLocalization | Locale;
|
|
7
|
-
}
|
|
8
2
|
export declare class PriceStreamElementLocalization {
|
|
9
3
|
saveValue: (value: string | number) => string;
|
|
10
4
|
beforeValue: (value: string) => string;
|
|
11
|
-
stockLocalization:
|
|
12
|
-
constructor(
|
|
5
|
+
stockLocalization: Locale;
|
|
6
|
+
constructor(locale: Locale);
|
|
13
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '../../../core/locale';
|
|
2
2
|
export class PriceStreamElementLocalization {
|
|
3
3
|
saveValue;
|
|
4
4
|
beforeValue;
|
|
5
5
|
stockLocalization;
|
|
6
|
-
constructor(
|
|
7
|
-
this.saveValue =
|
|
8
|
-
this.beforeValue =
|
|
9
|
-
this.stockLocalization =
|
|
6
|
+
constructor(locale) {
|
|
7
|
+
this.saveValue = loc.saveValue[locale];
|
|
8
|
+
this.beforeValue = loc.beforeValue[locale];
|
|
9
|
+
this.stockLocalization = locale;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
const loc = {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { type Locale } from '../../../core/locale';
|
|
2
|
-
import type { IShortVideoViewerLocalization } from '../../../short-videos/short-video-viewer';
|
|
3
|
-
export interface IShortVideoStreamElementLocalization {
|
|
4
|
-
shortVideoViewerLocalization?: IShortVideoViewerLocalization | Locale;
|
|
5
|
-
}
|
|
6
2
|
export declare class ShortVideoStreamElementLocalization {
|
|
7
|
-
|
|
8
|
-
constructor(
|
|
3
|
+
shortVideoViewerLocale: Locale;
|
|
4
|
+
constructor(locale: Locale);
|
|
9
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '../../../core/locale';
|
|
2
2
|
export class ShortVideoStreamElementLocalization {
|
|
3
|
-
|
|
4
|
-
constructor(
|
|
5
|
-
this.
|
|
3
|
+
shortVideoViewerLocale;
|
|
4
|
+
constructor(locale) {
|
|
5
|
+
this.shortVideoViewerLocale = locale;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type Locale } from '../../../core/locale';
|
|
2
|
-
export interface IStockStreamElementLocalization {
|
|
3
|
-
quantity?: (value: number, low: boolean) => string;
|
|
4
|
-
}
|
|
5
2
|
export declare class StockStreamElementLocalization {
|
|
6
3
|
quantity: (value: number, low: boolean) => string;
|
|
7
|
-
constructor(init:
|
|
4
|
+
constructor(init: Locale);
|
|
8
5
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '../../../core/locale';
|
|
2
2
|
export class StockStreamElementLocalization {
|
|
3
3
|
quantity;
|
|
4
4
|
constructor(init) {
|
|
5
|
-
this.quantity =
|
|
5
|
+
this.quantity = loc.quantity[init];
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
const loc = {
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { type Locale } from '../../../core/locale';
|
|
2
|
-
import type { IPriceStreamElementLocalization } from './price-stream-element-localization';
|
|
3
|
-
import type { IShortVideoStreamElementLocalization } from './short-video-stream-element-localization';
|
|
4
|
-
import type { IStockStreamElementLocalization } from './stock-stream-element-localization';
|
|
5
|
-
export interface IStreamElementLocalization {
|
|
6
|
-
priceElementLocalization?: IPriceStreamElementLocalization | Locale;
|
|
7
|
-
stockElementLocalization?: IStockStreamElementLocalization | Locale;
|
|
8
|
-
shortVideoElementLocalization?: IShortVideoStreamElementLocalization | Locale;
|
|
9
|
-
}
|
|
10
2
|
export declare class StreamElementLocalization {
|
|
11
|
-
priceElementLocalization:
|
|
12
|
-
stockElementLocalization:
|
|
13
|
-
shortVideoElementLocalization:
|
|
14
|
-
constructor(
|
|
3
|
+
priceElementLocalization: Locale;
|
|
4
|
+
stockElementLocalization: Locale;
|
|
5
|
+
shortVideoElementLocalization: Locale;
|
|
6
|
+
constructor(locale: Locale);
|
|
15
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '../../../core/locale';
|
|
2
2
|
export class StreamElementLocalization {
|
|
3
3
|
priceElementLocalization;
|
|
4
4
|
stockElementLocalization;
|
|
5
5
|
shortVideoElementLocalization;
|
|
6
|
-
constructor(
|
|
7
|
-
this.priceElementLocalization =
|
|
8
|
-
this.stockElementLocalization =
|
|
9
|
-
this.shortVideoElementLocalization =
|
|
6
|
+
constructor(locale) {
|
|
7
|
+
this.priceElementLocalization = locale;
|
|
8
|
+
this.stockElementLocalization = locale;
|
|
9
|
+
this.shortVideoElementLocalization = locale;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">import { ImageRounded } from '../../ui/image';
|
|
2
|
+
import { ProportionalContainer } from '../../ui/proportional-container';
|
|
3
|
+
let { stream, aspectRatio = 9 / 16, on } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class="stream-card">
|
|
7
|
+
<div class="stream-card__media">
|
|
8
|
+
<ProportionalContainer ratio={aspectRatio}>
|
|
9
|
+
<ImageRounded src={stream.cover} alt="" noBorders={true} />
|
|
10
|
+
</ProportionalContainer>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="stream-card__text">
|
|
14
|
+
<div class="stream-card__title">
|
|
15
|
+
{stream.title}
|
|
16
|
+
</div>
|
|
17
|
+
{#if stream.subTitle}
|
|
18
|
+
<div class="stream-card__sub-title">
|
|
19
|
+
{stream.subTitle}
|
|
20
|
+
</div>
|
|
21
|
+
{/if}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
{#if on?.click}
|
|
25
|
+
<button type="button" onclick={on.click} class="stream-card__link" aria-label="none"> </button>
|
|
26
|
+
{/if}
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<style>@keyframes fadeIn {
|
|
30
|
+
0% {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
50% {
|
|
34
|
+
opacity: 0.4;
|
|
35
|
+
}
|
|
36
|
+
100% {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.stream-card {
|
|
41
|
+
position: relative;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
container-type: inline-size;
|
|
44
|
+
width: 100%;
|
|
45
|
+
border-radius: 0.375rem;
|
|
46
|
+
}
|
|
47
|
+
.stream-card__media {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
--image--rounded--outer--border-radius: 1%;
|
|
52
|
+
}
|
|
53
|
+
.stream-card__text {
|
|
54
|
+
position: absolute;
|
|
55
|
+
bottom: 0;
|
|
56
|
+
left: 0;
|
|
57
|
+
right: 0;
|
|
58
|
+
height: 2.5rem;
|
|
59
|
+
background: rgba(0, 0, 0, 0.8);
|
|
60
|
+
color: #ffffff;
|
|
61
|
+
padding: 0 0.75rem;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-content: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
}
|
|
67
|
+
.stream-card__title {
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
text-align: center;
|
|
74
|
+
}
|
|
75
|
+
.stream-card__sub-title {
|
|
76
|
+
font-size: 0.625rem;
|
|
77
|
+
font-weight: 400;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
text-align: center;
|
|
82
|
+
}
|
|
83
|
+
.stream-card__link {
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 0;
|
|
86
|
+
left: 0;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
}</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StreamCardModel } from './types';
|
|
2
|
+
type Props = {
|
|
3
|
+
stream: StreamCardModel;
|
|
4
|
+
aspectRatio?: number;
|
|
5
|
+
on?: {
|
|
6
|
+
click?: () => 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 StreamCard } from './cmp.stream-card.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script lang="ts">import { StreamLayoutSlot, StreamPageLayout, StreamLayoutSlotContent } from '../layout';
|
|
2
2
|
import { StreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
3
|
-
let { page,
|
|
4
|
-
const localization = $derived(new StreamPageViewerLocalization(
|
|
3
|
+
let { page, locale, on } = $props();
|
|
4
|
+
const localization = $derived(new StreamPageViewerLocalization(locale));
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
{#if page.type === 'general'}
|
|
8
8
|
<StreamPageLayout model={page.layout}>
|
|
9
9
|
{#each page.layout.slots as slot (slot)}
|
|
10
10
|
<StreamLayoutSlot model={slot}>
|
|
11
|
-
<StreamLayoutSlotContent model={slot} on={on}
|
|
11
|
+
<StreamLayoutSlotContent model={slot} on={on} locale={localization.elementsLocale} />
|
|
12
12
|
</StreamLayoutSlot>
|
|
13
13
|
{/each}
|
|
14
14
|
</StreamPageLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Locale } from '../../core/locale';
|
|
2
|
-
import { type IStreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
3
2
|
import type { StreamPageViewerModel } from './types';
|
|
4
3
|
type Props = {
|
|
5
4
|
page: StreamPageViewerModel;
|
|
6
|
-
|
|
5
|
+
locale: Locale;
|
|
7
6
|
on?: {
|
|
8
7
|
productClick: (productId: string) => void;
|
|
9
8
|
productImpression?: (productId: string) => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default as StreamPageViewer } from './cmp.stream-page-viewer.svelte';
|
|
2
2
|
export type { StreamPageViewerModel } from './types';
|
|
3
|
-
export type { IStreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
4
3
|
export { mapToStreamPageViewerModel } from './mapper';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { type Locale } from '../../core/locale';
|
|
2
|
-
import type { IStreamElementLocalization } from '../layout/element-views';
|
|
3
|
-
export interface IStreamPageViewerLocalization {
|
|
4
|
-
elementsLocalization?: IStreamElementLocalization | Locale;
|
|
5
|
-
}
|
|
6
2
|
export declare class StreamPageViewerLocalization {
|
|
7
|
-
|
|
8
|
-
constructor(init:
|
|
3
|
+
elementsLocale: Locale;
|
|
4
|
+
constructor(init: Locale);
|
|
9
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '../../core/locale';
|
|
2
2
|
export class StreamPageViewerLocalization {
|
|
3
|
-
|
|
3
|
+
elementsLocale;
|
|
4
4
|
constructor(init) {
|
|
5
|
-
this.
|
|
5
|
+
this.elementsLocale = init;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
@@ -110,7 +110,7 @@ const trackNavigationButtonsSize = (node) => {
|
|
|
110
110
|
<div class="stream-player-controls__short-video-attachments" transition:slideHorizontally|local>
|
|
111
111
|
<ShortVideoViewerAttachments
|
|
112
112
|
shortVideo={shortVideo}
|
|
113
|
-
|
|
113
|
+
locale={localization.shortVideoAttachmentsLocale}
|
|
114
114
|
on={{
|
|
115
115
|
productClick: on.productClick,
|
|
116
116
|
productImpression: on.productImpression
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IMediaCenterConfig } from '../../media-center/config/types';
|
|
2
|
+
import type { IPostSocialInteractionsHandler } from '../../short-videos/short-video-viewer';
|
|
2
3
|
import type { StreamPageViewerModel } from '../stream-page-viewer/types';
|
|
3
|
-
import
|
|
4
|
+
import { mapToStreamPlayerModel } from './mapper';
|
|
4
5
|
import type { IStreamAnalyticsHandler, IStreamPlayerDataProvider, PlayerSettings, StreamPlayerModel } from './types';
|
|
5
|
-
export
|
|
6
|
+
export { type StreamPlayerModel, type StreamPageViewerModel, mapToStreamPlayerModel };
|
|
7
|
+
export type { IStreamPlayerDataProvider, IStreamAnalyticsHandler, IMediaCenterConfig };
|
|
6
8
|
/**
|
|
7
9
|
* Opens the stream player modal.
|
|
8
10
|
*
|
|
9
11
|
* Two overloads (mutually exclusive; enforced by TypeScript):
|
|
10
|
-
* - Provider mode: openStreamPlayer({ dataProvider,
|
|
12
|
+
* - Provider mode: openStreamPlayer({ dataProvider, mediaCenterConfig?, analyticsHandler?, ...common })
|
|
11
13
|
* - Internal provider mode: openStreamPlayer({ initiator, graphqlOrigin?, mediaPageId?, ...common })
|
|
12
14
|
*
|
|
13
15
|
* @param init Configuration options.
|
|
@@ -19,8 +21,8 @@ export type { IStreamPlayerLocalization, IStreamPlayerDataProvider, IStreamAnaly
|
|
|
19
21
|
* Provider mode (overload 1)
|
|
20
22
|
* @param {IStreamPlayerDataProvider} init.dataProvider
|
|
21
23
|
* Provider that supplies the stream data to the player.
|
|
22
|
-
* @param {
|
|
23
|
-
* Optional media-center
|
|
24
|
+
* @param {IMediaCenterConfig} [init.mediaCenterConfig]
|
|
25
|
+
* Optional media-center config.
|
|
24
26
|
* @param {IStreamAnalyticsHandler} [init.analyticsHandler]
|
|
25
27
|
* Optional analytics handler to capture player/stream analytics events.
|
|
26
28
|
* If omitted in provider mode, analytics is not auto-initialized.
|
|
@@ -31,10 +33,10 @@ export type { IStreamPlayerLocalization, IStreamPlayerDataProvider, IStreamAnaly
|
|
|
31
33
|
* @param {string} [init.graphqlOrigin]
|
|
32
34
|
* Optional GraphQL origin (base URL). If omitted, the default origin is determined internally.
|
|
33
35
|
* @param {string} [init.mediaPageId]
|
|
34
|
-
* Optional media page ID used to construct an internal media-center
|
|
36
|
+
* Optional media page ID used to construct an internal media-center config.
|
|
35
37
|
*
|
|
36
38
|
* Common (optional)
|
|
37
|
-
* @param {
|
|
39
|
+
* @param {Locale} [init.locale]
|
|
38
40
|
* Localization for the player UI. If omitted, 'en' is used.
|
|
39
41
|
* @param {boolean} [init.showStreamsCloudWatermark]
|
|
40
42
|
* If true, shows the StreamsCloud watermark.
|
|
@@ -58,7 +60,7 @@ export type { IStreamPlayerLocalization, IStreamPlayerDataProvider, IStreamAnaly
|
|
|
58
60
|
* openStreamPlayer({
|
|
59
61
|
* streamId: 'stream_123',
|
|
60
62
|
* dataProvider: myStreamProvider,
|
|
61
|
-
*
|
|
63
|
+
* mediaCenterConfig: myMediaCenterProvider,
|
|
62
64
|
* analyticsHandler: myAnalyticsHandler,
|
|
63
65
|
* localization: { play: 'Play', pause: 'Pause' },
|
|
64
66
|
* showStreamsCloudWatermark: true,
|
|
@@ -87,11 +89,14 @@ export type { IStreamPlayerLocalization, IStreamPlayerDataProvider, IStreamAnaly
|
|
|
87
89
|
* ```
|
|
88
90
|
*/
|
|
89
91
|
export declare function openStreamPlayer(init: PlayerSettings & {
|
|
92
|
+
streamId: string;
|
|
90
93
|
dataProvider: IStreamPlayerDataProvider;
|
|
91
|
-
|
|
94
|
+
mediaCenterConfig?: IMediaCenterConfig;
|
|
95
|
+
postSocialInteractionsHandler?: IPostSocialInteractionsHandler;
|
|
92
96
|
analyticsHandler?: IStreamAnalyticsHandler;
|
|
93
97
|
}): void;
|
|
94
98
|
export declare function openStreamPlayer(init: PlayerSettings & {
|
|
99
|
+
streamId: string;
|
|
95
100
|
initiator: string;
|
|
96
101
|
graphqlOrigin?: string;
|
|
97
102
|
mediaPageId?: string;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { toastrWarning } from '../../core/toastr';
|
|
2
|
-
import {
|
|
2
|
+
import { InternalMediaCenterConfig } from '../../media-center/config/internal-media-center-config';
|
|
3
|
+
import {} from '../../media-center/config/types';
|
|
3
4
|
import { MediaCenter, MediaCenterMode } from '../../media-center/media-center';
|
|
4
5
|
import { ModalShadowHost } from '../../ui/shadow-dom';
|
|
5
6
|
import { InternalStreamAnalyticsHandler } from './internal-stream-analytics-handler';
|
|
6
7
|
import { InternalStreamPlayerDataProvider } from './internal-stream-player-data-provider';
|
|
8
|
+
import { mapToStreamPlayerModel } from './mapper';
|
|
7
9
|
import { mount, unmount } from 'svelte';
|
|
10
|
+
export { mapToStreamPlayerModel };
|
|
8
11
|
export function openStreamPlayer(init) {
|
|
9
|
-
const { streamId, graphqlOrigin,
|
|
12
|
+
const { streamId, graphqlOrigin, locale, showStreamsCloudWatermark, postSocialInteractionsHandler, initiator } = init;
|
|
10
13
|
const dataProvider = init.dataProvider ?? new InternalStreamPlayerDataProvider({ graphqlOrigin, initiator });
|
|
11
14
|
if (!dataProvider) {
|
|
12
15
|
toastrWarning('Data provider is not specified.');
|
|
13
16
|
return;
|
|
14
17
|
}
|
|
15
|
-
let
|
|
16
|
-
if (!
|
|
17
|
-
|
|
18
|
+
let mediaCenterConfig = init.mediaCenterConfig;
|
|
19
|
+
if (!mediaCenterConfig && init.mediaPageId) {
|
|
20
|
+
mediaCenterConfig = new InternalMediaCenterConfig(init.mediaPageId, graphqlOrigin);
|
|
18
21
|
}
|
|
19
22
|
let analyticsHandler = init.analyticsHandler;
|
|
20
23
|
if (!analyticsHandler && !init.dataProvider) {
|
|
@@ -25,14 +28,14 @@ export function openStreamPlayer(init) {
|
|
|
25
28
|
const mounted = mount(MediaCenter, {
|
|
26
29
|
target: shadowHost.shadowRoot,
|
|
27
30
|
props: {
|
|
28
|
-
|
|
31
|
+
config: mediaCenterConfig || null,
|
|
29
32
|
playerProps: {
|
|
30
|
-
|
|
33
|
+
mode: MediaCenterMode.Stream,
|
|
31
34
|
props: {
|
|
32
35
|
streamId,
|
|
33
36
|
dataProvider,
|
|
34
37
|
analyticsHandler,
|
|
35
|
-
|
|
38
|
+
locale,
|
|
36
39
|
showStreamsCloudWatermark,
|
|
37
40
|
postSocialInteractionsHandler,
|
|
38
41
|
on: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { IStreamPlayerDataProvider } from './types';
|
|
2
|
+
import type { Client } from '@urql/core';
|
|
2
3
|
export declare class InternalStreamPlayerDataProvider implements IStreamPlayerDataProvider {
|
|
3
4
|
private graphql;
|
|
4
5
|
constructor(input: {
|
|
5
6
|
initiator?: string;
|
|
6
7
|
graphqlOrigin?: string;
|
|
8
|
+
graphql?: Client;
|
|
7
9
|
});
|
|
8
10
|
getStream: IStreamPlayerDataProvider['getStream'];
|
|
9
11
|
getStreamPages: IStreamPlayerDataProvider['getStreamPages'];
|
|
@@ -6,8 +6,8 @@ import { GetStreamDocument, GetStreamPagesDocument } from './operations.generate
|
|
|
6
6
|
export class InternalStreamPlayerDataProvider {
|
|
7
7
|
graphql;
|
|
8
8
|
constructor(input) {
|
|
9
|
-
const { graphqlOrigin, initiator } = input;
|
|
10
|
-
this.graphql = createLocalGQLClient(graphqlOrigin, initiator ? { 'x-initiator': initiator } : undefined);
|
|
9
|
+
const { graphqlOrigin, initiator, graphql } = input;
|
|
10
|
+
this.graphql = graphql ?? createLocalGQLClient(graphqlOrigin, initiator ? { 'x-initiator': initiator } : undefined);
|
|
11
11
|
}
|
|
12
12
|
getStream = async (id) => {
|
|
13
13
|
const streamPayload = await this.graphql.query(GetStreamDocument, { id }).toPromise();
|
|
@@ -36,7 +36,7 @@ const overviewAttached = (node) => {
|
|
|
36
36
|
</div>
|
|
37
37
|
<div class="stream-overview-owner__meta">
|
|
38
38
|
<LineClamp maxLines={1}>
|
|
39
|
-
<TimeAgo date={model.publishedAt || model.createdAt}
|
|
39
|
+
<TimeAgo date={model.publishedAt || model.createdAt} locale={localization.timeAgoLocale} />
|
|
40
40
|
</LineClamp>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
import { type Locale } from '../../core/locale';
|
|
2
|
-
import type { IShortVideoAttachmentsLocalization, IShortVideoViewerLocalization } from '../../short-videos/short-video-viewer';
|
|
3
|
-
import type { IStreamPageViewerLocalization } from '../stream-page-viewer';
|
|
4
|
-
import type { ISwipeIndicatorLocalization } from '../../ui/swipe-indicator';
|
|
5
|
-
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
6
|
-
export interface IStreamPlayerLocalization {
|
|
7
|
-
streamNotFound?: string;
|
|
8
|
-
pagesCount?: (count: number) => string;
|
|
9
|
-
timeAgoLocalization?: ITimeAgoLocalization | Locale;
|
|
10
|
-
streamPageViewerLocalization?: IStreamPageViewerLocalization | Locale;
|
|
11
|
-
shortVideoAttachmentsLocalization?: IShortVideoAttachmentsLocalization | Locale;
|
|
12
|
-
shortVideoViewerLocalization?: IShortVideoViewerLocalization | Locale;
|
|
13
|
-
swipeIndicatorLocalization?: ISwipeIndicatorLocalization | Locale;
|
|
14
|
-
}
|
|
15
2
|
export declare class StreamPlayerLocalization {
|
|
16
3
|
streamNotFound: string;
|
|
17
4
|
pagesCount: (count: number) => string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
constructor(
|
|
5
|
+
timeAgoLocale: Locale;
|
|
6
|
+
streamPageViewerLocale: Locale;
|
|
7
|
+
shortVideoAttachmentsLocale: Locale;
|
|
8
|
+
shortVideoViewerLocale: Locale;
|
|
9
|
+
swipeIndicatorLocale: Locale;
|
|
10
|
+
constructor(locale: Locale);
|
|
24
11
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '../../core/locale';
|
|
2
2
|
export class StreamPlayerLocalization {
|
|
3
3
|
streamNotFound;
|
|
4
4
|
pagesCount;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
this.streamNotFound =
|
|
12
|
-
this.pagesCount =
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
5
|
+
timeAgoLocale;
|
|
6
|
+
streamPageViewerLocale;
|
|
7
|
+
shortVideoAttachmentsLocale;
|
|
8
|
+
shortVideoViewerLocale;
|
|
9
|
+
swipeIndicatorLocale;
|
|
10
|
+
constructor(locale) {
|
|
11
|
+
this.streamNotFound = loc.streamNotFound[locale];
|
|
12
|
+
this.pagesCount = loc.pagesCount[locale];
|
|
13
|
+
this.timeAgoLocale = locale;
|
|
14
|
+
this.streamPageViewerLocale = locale;
|
|
15
|
+
this.shortVideoAttachmentsLocale = locale;
|
|
16
|
+
this.shortVideoViewerLocale = locale;
|
|
17
|
+
this.swipeIndicatorLocale = locale;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
const loc = {
|
|
@@ -23,8 +23,8 @@ import { StreamPlayerBuffer } from './stream-player-buffer.svelte';
|
|
|
23
23
|
import { StreamPlayerLocalization } from './stream-player-localization';
|
|
24
24
|
import { StreamPlayerUiManager } from './ui-manager.svelte';
|
|
25
25
|
import { onMount, untrack } from 'svelte';
|
|
26
|
-
let { streamId, dataProvider, analyticsHandler,
|
|
27
|
-
const localization = $derived(new StreamPlayerLocalization(
|
|
26
|
+
let { streamId, dataProvider, analyticsHandler, locale = 'en', showStreamsCloudWatermark, postSocialInteractionsHandler, on, categoriesSwitcher, playerLogo = null, fadeContent = false } = $props();
|
|
27
|
+
const localization = $derived(new StreamPlayerLocalization(locale));
|
|
28
28
|
let model = $state(null);
|
|
29
29
|
let buffer = $state.raw(null);
|
|
30
30
|
let bufferIsLoading = $state(false);
|
|
@@ -233,7 +233,7 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
233
233
|
{#if item.type === 'general'}
|
|
234
234
|
<StreamPageViewer
|
|
235
235
|
page={item}
|
|
236
|
-
|
|
236
|
+
locale={localization.streamPageViewerLocale}
|
|
237
237
|
on={{
|
|
238
238
|
progress: (videoId: String, progress: Number) => onProgress(item.id, videoId, progress),
|
|
239
239
|
productClick: (productId: String) => onProductCardClick(productId),
|
|
@@ -249,14 +249,14 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
249
249
|
}}
|
|
250
250
|
autoplay="on-appearance"
|
|
251
251
|
socialInteractionsHandler={postSocialInteractionsHandler}
|
|
252
|
-
|
|
252
|
+
locale={localization.shortVideoViewerLocale}
|
|
253
253
|
showAttachments={uiManager.showShortVideoOverlayAttachments}
|
|
254
254
|
showControls={uiManager.showShortVideoOverlayControls} />
|
|
255
255
|
{/if}
|
|
256
256
|
{/snippet}
|
|
257
257
|
</PlayerSlider>
|
|
258
258
|
{#if uiManager.isMobileView && buffer.loaded.length > 1 && !everTouched}
|
|
259
|
-
<SwipeIndicator
|
|
259
|
+
<SwipeIndicator locale={localization.swipeIndicatorLocale} />
|
|
260
260
|
{/if}
|
|
261
261
|
</div>
|
|
262
262
|
</SpotlightLayout>
|
|
@@ -328,7 +328,7 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
328
328
|
.stream-player {
|
|
329
329
|
display: flex;
|
|
330
330
|
flex: 1;
|
|
331
|
-
padding:
|
|
331
|
+
padding: var(--stream-player--padding);
|
|
332
332
|
backdrop-filter: blur(30px);
|
|
333
333
|
position: relative;
|
|
334
334
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Locale } from '../../core/locale';
|
|
2
2
|
import type { IPostSocialInteractionsHandler } from '../../short-videos/short-video-viewer';
|
|
3
3
|
import type { StreamPageViewerModel } from '../stream-page-viewer';
|
|
4
|
-
import type { IStreamPlayerLocalization } from './stream-player-localization';
|
|
5
4
|
export type StreamPlayerModel = {
|
|
6
5
|
id: string;
|
|
7
6
|
title: string;
|
|
@@ -17,14 +16,15 @@ export type StreamPlayerModel = {
|
|
|
17
16
|
pagesCount: number;
|
|
18
17
|
};
|
|
19
18
|
export type StreamPlayerProps = PlayerSettings & {
|
|
19
|
+
streamId: string;
|
|
20
20
|
dataProvider: IStreamPlayerDataProvider;
|
|
21
|
+
postSocialInteractionsHandler?: IPostSocialInteractionsHandler;
|
|
21
22
|
analyticsHandler?: IStreamAnalyticsHandler;
|
|
22
23
|
};
|
|
23
24
|
export type PlayerSettings = {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
disableBackground?: boolean;
|
|
26
|
+
locale?: Locale;
|
|
26
27
|
showStreamsCloudWatermark?: boolean;
|
|
27
|
-
postSocialInteractionsHandler?: IPostSocialInteractionsHandler;
|
|
28
28
|
on?: {
|
|
29
29
|
streamActivated?: (data: {
|
|
30
30
|
title: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">import { LineClampLocalization } from './line-clamp-localization';
|
|
2
2
|
import { LineClampUtils } from './line-clamp-utils';
|
|
3
3
|
import { onDestroy, onMount } from 'svelte';
|
|
4
|
-
let { value = undefined, maxLines = 3,
|
|
5
|
-
const localization = $derived(new LineClampLocalization(
|
|
4
|
+
let { value = undefined, maxLines = 3, locale, enableShowMore = false, children } = $props();
|
|
5
|
+
const localization = $derived(new LineClampLocalization(locale !== null && locale !== void 0 ? locale : 'en'));
|
|
6
6
|
let parent;
|
|
7
7
|
let element;
|
|
8
8
|
let clampWrapperRef;
|