@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.
Files changed (128) hide show
  1. package/dist/ads/ad-card/cmp.ad-card.svelte +29 -3
  2. package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +4 -0
  3. package/dist/core/enums.d.ts +3 -0
  4. package/dist/core/enums.js +4 -0
  5. package/dist/core/locale.d.ts +0 -4
  6. package/dist/core/locale.js +1 -12
  7. package/dist/media-center/config/internal-media-center-config.d.ts +9 -0
  8. package/dist/media-center/config/internal-media-center-config.js +81 -0
  9. package/dist/media-center/{data-provider → config}/operations.generated.d.ts +20 -3
  10. package/dist/media-center/{data-provider → config}/operations.generated.js +53 -2
  11. package/dist/media-center/{data-provider → config}/operations.graphql +15 -1
  12. package/dist/media-center/config/types.d.ts +52 -0
  13. package/dist/media-center/index.d.ts +1 -1
  14. package/dist/media-center/media-center/cmp.media-center.svelte +105 -66
  15. package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +11 -11
  16. package/dist/media-center/media-center/index.d.ts +0 -1
  17. package/dist/media-center/media-center/media-center-localization.d.ts +3 -8
  18. package/dist/media-center/media-center/media-center-localization.js +12 -6
  19. package/dist/media-center/media-center/overview.svelte +14 -1
  20. package/dist/media-center/media-center/overview.svelte.d.ts +1 -0
  21. package/dist/media-center/media-center/short-video-resources-generator.d.ts +2 -2
  22. package/dist/media-center/media-center/short-video-resources-generator.js +2 -2
  23. package/dist/media-center/media-center/streams-in-category.svelte +100 -0
  24. package/dist/media-center/media-center/streams-in-category.svelte.d.ts +10 -0
  25. package/dist/media-center/media-center/types.d.ts +11 -0
  26. package/dist/products/product-card/cmp.product-card.svelte +2 -2
  27. package/dist/products/product-card/cmp.product-card.svelte.d.ts +1 -2
  28. package/dist/products/product-card/product-card-localization.d.ts +1 -4
  29. package/dist/products/product-card/product-card-localization.js +2 -2
  30. package/dist/short-videos/short-video-card/cmp.short-video-card.svelte +11 -46
  31. package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte +17 -7
  32. package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte.d.ts +2 -0
  33. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +9 -4
  34. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +3 -2
  35. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +2 -3
  36. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +2 -2
  37. package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte +2 -2
  38. package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte.d.ts +1 -2
  39. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +5 -3
  40. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +3 -2
  41. package/dist/short-videos/short-video-viewer/index.d.ts +0 -2
  42. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.d.ts +2 -6
  43. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +4 -4
  44. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +3 -10
  45. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +7 -7
  46. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +4 -4
  47. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +2 -2
  48. package/dist/short-videos/short-videos-player/controls.svelte +4 -2
  49. package/dist/short-videos/short-videos-player/controls.svelte.d.ts +2 -0
  50. package/dist/short-videos/short-videos-player/index.d.ts +12 -10
  51. package/dist/short-videos/short-videos-player/index.js +9 -8
  52. package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.d.ts +2 -0
  53. package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.js +2 -0
  54. package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +4 -11
  55. package/dist/short-videos/short-videos-player/short-videos-player-localization.js +8 -8
  56. package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +16 -6
  57. package/dist/short-videos/short-videos-player/types.d.ts +4 -4
  58. package/dist/streams/cmp.stream-product-card.svelte +2 -2
  59. package/dist/streams/cmp.stream-product-card.svelte.d.ts +1 -2
  60. package/dist/streams/layout/cmp.slot-content.svelte +2 -2
  61. package/dist/streams/layout/cmp.slot-content.svelte.d.ts +1 -2
  62. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +3 -8
  63. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +1 -2
  64. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +2 -2
  65. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +1 -2
  66. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +3 -8
  67. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +1 -2
  68. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +2 -2
  69. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +1 -2
  70. package/dist/streams/layout/element-views/cmp.stream-element.svelte +6 -6
  71. package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +1 -2
  72. package/dist/streams/layout/element-views/index.d.ts +0 -4
  73. package/dist/streams/layout/element-views/price-element-view.svelte +1 -1
  74. package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +2 -8
  75. package/dist/streams/layout/element-views/price-stream-element-localization.js +5 -5
  76. package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +2 -6
  77. package/dist/streams/layout/element-views/short-video-stream-element-localization.js +4 -4
  78. package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +1 -4
  79. package/dist/streams/layout/element-views/stock-stream-element-localization.js +2 -2
  80. package/dist/streams/layout/element-views/stream-element-localization.d.ts +4 -12
  81. package/dist/streams/layout/element-views/stream-element-localization.js +5 -5
  82. package/dist/streams/stream-card/cmp.stream-card.svelte +89 -0
  83. package/dist/streams/stream-card/cmp.stream-card.svelte.d.ts +11 -0
  84. package/dist/streams/stream-card/index.d.ts +2 -0
  85. package/dist/streams/stream-card/index.js +1 -0
  86. package/dist/streams/stream-card/types.d.ts +6 -0
  87. package/dist/streams/stream-card/types.js +1 -0
  88. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +3 -3
  89. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +1 -2
  90. package/dist/streams/stream-page-viewer/index.d.ts +0 -1
  91. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +2 -6
  92. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +3 -3
  93. package/dist/streams/stream-player/controls.svelte +1 -1
  94. package/dist/streams/stream-player/index.d.ts +15 -10
  95. package/dist/streams/stream-player/index.js +11 -8
  96. package/dist/streams/stream-player/internal-stream-player-data-provider.d.ts +2 -0
  97. package/dist/streams/stream-player/internal-stream-player-data-provider.js +2 -2
  98. package/dist/streams/stream-player/stream-overview.svelte +1 -1
  99. package/dist/streams/stream-player/stream-player-localization.d.ts +6 -19
  100. package/dist/streams/stream-player/stream-player-localization.js +14 -14
  101. package/dist/streams/stream-player/stream-player.svelte +6 -6
  102. package/dist/streams/stream-player/types.d.ts +4 -4
  103. package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
  104. package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +1 -2
  105. package/dist/ui/line-clamp/index.d.ts +0 -1
  106. package/dist/ui/line-clamp/index.js +0 -1
  107. package/dist/ui/line-clamp/line-clamp-localization.d.ts +1 -5
  108. package/dist/ui/line-clamp/line-clamp-localization.js +4 -4
  109. package/dist/ui/shadow-dom/{reset.scss → reset-shadow.css} +31 -44
  110. package/dist/ui/shadow-dom/shadow-root-service.js +2 -2
  111. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +2 -2
  112. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +1 -2
  113. package/dist/ui/swipe-indicator/index.d.ts +0 -1
  114. package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +1 -4
  115. package/dist/ui/swipe-indicator/swipe-indicator-localization.js +3 -3
  116. package/dist/ui/time-ago/cmp.time-ago.svelte +2 -2
  117. package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +1 -2
  118. package/dist/ui/time-ago/index.d.ts +0 -1
  119. package/dist/ui/time-ago/time-ago-localization.d.ts +1 -11
  120. package/dist/ui/time-ago/time-ago-localization.js +10 -10
  121. package/package.json +1 -1
  122. package/dist/media-center/data-provider/index.d.ts +0 -2
  123. package/dist/media-center/data-provider/index.js +0 -1
  124. package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.d.ts +0 -8
  125. package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.js +0 -46
  126. package/dist/media-center/data-provider/types.d.ts +0 -24
  127. /package/dist/media-center/{data-provider → config}/types.js +0 -0
  128. /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} localization={localization.stockLocalization} />
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: IStockStreamElementLocalization | Locale;
12
- constructor(init: IPriceStreamElementLocalization | Locale);
5
+ stockLocalization: Locale;
6
+ constructor(locale: Locale);
13
7
  }
@@ -1,12 +1,12 @@
1
- import { isLocale } from '../../../core/locale';
1
+ import {} from '../../../core/locale';
2
2
  export class PriceStreamElementLocalization {
3
3
  saveValue;
4
4
  beforeValue;
5
5
  stockLocalization;
6
- constructor(init) {
7
- this.saveValue = isLocale(init) ? loc.saveValue[init] : init.saveValue || loc.saveValue.en;
8
- this.beforeValue = isLocale(init) ? loc.beforeValue[init] : init.beforeValue || loc.beforeValue.en;
9
- this.stockLocalization = isLocale(init) ? init : init.stockLocalization || 'en';
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
- shortVideoViewerLocalization: IShortVideoViewerLocalization | Locale;
8
- constructor(init: IShortVideoStreamElementLocalization | Locale);
3
+ shortVideoViewerLocale: Locale;
4
+ constructor(locale: Locale);
9
5
  }
@@ -1,7 +1,7 @@
1
- import { isLocale } from '../../../core/locale';
1
+ import {} from '../../../core/locale';
2
2
  export class ShortVideoStreamElementLocalization {
3
- shortVideoViewerLocalization;
4
- constructor(init) {
5
- this.shortVideoViewerLocalization = isLocale(init) ? init : init.shortVideoViewerLocalization || 'en';
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: IStockStreamElementLocalization | Locale);
4
+ constructor(init: Locale);
8
5
  }
@@ -1,8 +1,8 @@
1
- import { isLocale } from '../../../core/locale';
1
+ import {} from '../../../core/locale';
2
2
  export class StockStreamElementLocalization {
3
3
  quantity;
4
4
  constructor(init) {
5
- this.quantity = isLocale(init) ? loc.quantity[init] : init.quantity || loc.quantity.en;
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: IPriceStreamElementLocalization | Locale;
12
- stockElementLocalization: IStockStreamElementLocalization | Locale;
13
- shortVideoElementLocalization: IShortVideoStreamElementLocalization | Locale;
14
- constructor(init: IStreamElementLocalization | Locale);
3
+ priceElementLocalization: Locale;
4
+ stockElementLocalization: Locale;
5
+ shortVideoElementLocalization: Locale;
6
+ constructor(locale: Locale);
15
7
  }
@@ -1,11 +1,11 @@
1
- import { isLocale } from '../../../core/locale';
1
+ import {} from '../../../core/locale';
2
2
  export class StreamElementLocalization {
3
3
  priceElementLocalization;
4
4
  stockElementLocalization;
5
5
  shortVideoElementLocalization;
6
- constructor(init) {
7
- this.priceElementLocalization = isLocale(init) ? init : init.priceElementLocalization || 'en';
8
- this.stockElementLocalization = isLocale(init) ? init : init.stockElementLocalization || 'en';
9
- this.shortVideoElementLocalization = isLocale(init) ? init : init.shortVideoElementLocalization || 'en';
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">&nbsp;</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,2 @@
1
+ export { default as StreamCard } from './cmp.stream-card.svelte';
2
+ export type { StreamCardModel } from './types';
@@ -0,0 +1 @@
1
+ export { default as StreamCard } from './cmp.stream-card.svelte';
@@ -0,0 +1,6 @@
1
+ export type StreamCardModel = {
2
+ id: string;
3
+ title: string;
4
+ subTitle: string | null;
5
+ cover: string | null;
6
+ };
@@ -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, localization: localizationInit, on } = $props();
4
- const localization = $derived(new StreamPageViewerLocalization(localizationInit));
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} localization={localization.elementsLocalization} />
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
- localization: IStreamPageViewerLocalization | Locale;
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
- elementsLocalization: IStreamElementLocalization | Locale;
8
- constructor(init: IStreamPageViewerLocalization | Locale);
3
+ elementsLocale: Locale;
4
+ constructor(init: Locale);
9
5
  }
@@ -1,7 +1,7 @@
1
- import { isLocale } from '../../core/locale';
1
+ import {} from '../../core/locale';
2
2
  export class StreamPageViewerLocalization {
3
- elementsLocalization;
3
+ elementsLocale;
4
4
  constructor(init) {
5
- this.elementsLocalization = isLocale(init) ? init : init?.elementsLocalization || 'en';
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
- localization={localization.shortVideoAttachmentsLocalization}
113
+ locale={localization.shortVideoAttachmentsLocale}
114
114
  on={{
115
115
  productClick: on.productClick,
116
116
  productImpression: on.productImpression
@@ -1,13 +1,15 @@
1
- import { type IMediaCenterDataProvider } from '../../media-center/data-provider';
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 type { IStreamPlayerLocalization } from './stream-player-localization';
4
+ import { mapToStreamPlayerModel } from './mapper';
4
5
  import type { IStreamAnalyticsHandler, IStreamPlayerDataProvider, PlayerSettings, StreamPlayerModel } from './types';
5
- export type { IStreamPlayerLocalization, IStreamPlayerDataProvider, IStreamAnalyticsHandler, IMediaCenterDataProvider, StreamPlayerModel, StreamPageViewerModel };
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, mediaCenterDataProvider?, analyticsHandler?, ...common })
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 {IMediaCenterDataProvider} [init.mediaCenterDataProvider]
23
- * Optional media-center data provider.
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 data provider.
36
+ * Optional media page ID used to construct an internal media-center config.
35
37
  *
36
38
  * Common (optional)
37
- * @param {IStreamPlayerLocalization | Locale} [init.localization]
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
- * mediaCenterDataProvider: myMediaCenterProvider,
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
- mediaCenterDataProvider?: IMediaCenterDataProvider;
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 { InternalMediaCenterDataProvider } from '../../media-center/data-provider';
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, localization, showStreamsCloudWatermark, postSocialInteractionsHandler, initiator } = init;
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 mediaCenterDataProvider = init.mediaCenterDataProvider;
16
- if (!mediaCenterDataProvider && init.mediaPageId) {
17
- mediaCenterDataProvider = new InternalMediaCenterDataProvider(init.mediaPageId, graphqlOrigin);
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
- dataProvider: mediaCenterDataProvider || null,
31
+ config: mediaCenterConfig || null,
29
32
  playerProps: {
30
- type: MediaCenterMode.Stream,
33
+ mode: MediaCenterMode.Stream,
31
34
  props: {
32
35
  streamId,
33
36
  dataProvider,
34
37
  analyticsHandler,
35
- localization,
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} localization={localization.timeAgoLocalization} />
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
- timeAgoLocalization: ITimeAgoLocalization | Locale;
19
- streamPageViewerLocalization: IStreamPageViewerLocalization | Locale;
20
- shortVideoAttachmentsLocalization: IShortVideoAttachmentsLocalization | Locale;
21
- shortVideoViewerLocalization: IShortVideoViewerLocalization | Locale;
22
- swipeIndicatorLocalization: ISwipeIndicatorLocalization | Locale;
23
- constructor(init: IStreamPlayerLocalization | Locale);
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 { isLocale } from '../../core/locale';
1
+ import {} from '../../core/locale';
2
2
  export class StreamPlayerLocalization {
3
3
  streamNotFound;
4
4
  pagesCount;
5
- timeAgoLocalization;
6
- streamPageViewerLocalization;
7
- shortVideoAttachmentsLocalization;
8
- shortVideoViewerLocalization;
9
- swipeIndicatorLocalization;
10
- constructor(init) {
11
- this.streamNotFound = isLocale(init) ? loc.streamNotFound[init] : init?.streamNotFound || loc.streamNotFound.en;
12
- this.pagesCount = isLocale(init) ? loc.pagesCount[init] : init?.pagesCount || loc.pagesCount.en;
13
- this.timeAgoLocalization = isLocale(init) ? init : init.timeAgoLocalization || 'en';
14
- this.streamPageViewerLocalization = isLocale(init) ? init : init.streamPageViewerLocalization || 'en';
15
- this.shortVideoAttachmentsLocalization = isLocale(init) ? init : init.shortVideoAttachmentsLocalization || 'en';
16
- this.shortVideoViewerLocalization = isLocale(init) ? init : init.shortVideoViewerLocalization || 'en';
17
- this.swipeIndicatorLocalization = isLocale(init) ? init : init.swipeIndicatorLocalization || 'en';
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, localization: localizationInit = 'en', showStreamsCloudWatermark, postSocialInteractionsHandler, on, categoriesSwitcher, playerLogo = null, fadeContent = false } = $props();
27
- const localization = $derived(new StreamPlayerLocalization(localizationInit));
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
- localization={localization.streamPageViewerLocalization}
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
- localization={localization.shortVideoViewerLocalization}
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 localization={localization.swipeIndicatorLocalization} />
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: 0.625rem 0;
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
- streamId: string;
25
- localization?: IStreamPlayerLocalization | Locale;
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, localization: localizationInit, enableShowMore = false, children } = $props();
5
- const localization = $derived(new LineClampLocalization(localizationInit !== null && localizationInit !== void 0 ? localizationInit : 'en'));
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;