@streamscloud/embeddable 6.5.2 → 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 (122) hide show
  1. package/dist/core/enums.d.ts +3 -0
  2. package/dist/core/enums.js +4 -0
  3. package/dist/core/locale.d.ts +0 -4
  4. package/dist/core/locale.js +1 -12
  5. package/dist/media-center/config/internal-media-center-config.d.ts +9 -0
  6. package/dist/media-center/config/internal-media-center-config.js +81 -0
  7. package/dist/media-center/{data-provider → config}/operations.generated.d.ts +20 -3
  8. package/dist/media-center/{data-provider → config}/operations.generated.js +53 -2
  9. package/dist/media-center/{data-provider → config}/operations.graphql +15 -1
  10. package/dist/media-center/config/types.d.ts +52 -0
  11. package/dist/media-center/index.d.ts +1 -1
  12. package/dist/media-center/media-center/cmp.media-center.svelte +105 -66
  13. package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +11 -11
  14. package/dist/media-center/media-center/index.d.ts +0 -1
  15. package/dist/media-center/media-center/media-center-localization.d.ts +3 -8
  16. package/dist/media-center/media-center/media-center-localization.js +12 -6
  17. package/dist/media-center/media-center/overview.svelte +14 -1
  18. package/dist/media-center/media-center/overview.svelte.d.ts +1 -0
  19. package/dist/media-center/media-center/short-video-resources-generator.d.ts +2 -2
  20. package/dist/media-center/media-center/short-video-resources-generator.js +2 -2
  21. package/dist/media-center/media-center/streams-in-category.svelte +100 -0
  22. package/dist/media-center/media-center/streams-in-category.svelte.d.ts +10 -0
  23. package/dist/media-center/media-center/types.d.ts +11 -0
  24. package/dist/products/product-card/cmp.product-card.svelte +2 -2
  25. package/dist/products/product-card/cmp.product-card.svelte.d.ts +1 -2
  26. package/dist/products/product-card/product-card-localization.d.ts +1 -4
  27. package/dist/products/product-card/product-card-localization.js +2 -2
  28. package/dist/short-videos/short-video-card/cmp.short-video-card.svelte +11 -46
  29. package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte +1 -1
  30. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +3 -3
  31. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +1 -2
  32. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +2 -3
  33. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +2 -2
  34. package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte +2 -2
  35. package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte.d.ts +1 -2
  36. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +2 -2
  37. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +1 -2
  38. package/dist/short-videos/short-video-viewer/index.d.ts +0 -2
  39. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.d.ts +2 -6
  40. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +4 -4
  41. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +3 -10
  42. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +7 -7
  43. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +4 -4
  44. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +2 -2
  45. package/dist/short-videos/short-videos-player/controls.svelte +1 -1
  46. package/dist/short-videos/short-videos-player/index.d.ts +12 -10
  47. package/dist/short-videos/short-videos-player/index.js +9 -8
  48. package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +4 -11
  49. package/dist/short-videos/short-videos-player/short-videos-player-localization.js +8 -8
  50. package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +4 -4
  51. package/dist/short-videos/short-videos-player/types.d.ts +2 -4
  52. package/dist/streams/cmp.stream-product-card.svelte +2 -2
  53. package/dist/streams/cmp.stream-product-card.svelte.d.ts +1 -2
  54. package/dist/streams/layout/cmp.slot-content.svelte +2 -2
  55. package/dist/streams/layout/cmp.slot-content.svelte.d.ts +1 -2
  56. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +3 -8
  57. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +1 -2
  58. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +2 -2
  59. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +1 -2
  60. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +3 -8
  61. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +1 -2
  62. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +2 -2
  63. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +1 -2
  64. package/dist/streams/layout/element-views/cmp.stream-element.svelte +6 -6
  65. package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +1 -2
  66. package/dist/streams/layout/element-views/index.d.ts +0 -4
  67. package/dist/streams/layout/element-views/price-element-view.svelte +1 -1
  68. package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +2 -8
  69. package/dist/streams/layout/element-views/price-stream-element-localization.js +5 -5
  70. package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +2 -6
  71. package/dist/streams/layout/element-views/short-video-stream-element-localization.js +4 -4
  72. package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +1 -4
  73. package/dist/streams/layout/element-views/stock-stream-element-localization.js +2 -2
  74. package/dist/streams/layout/element-views/stream-element-localization.d.ts +4 -12
  75. package/dist/streams/layout/element-views/stream-element-localization.js +5 -5
  76. package/dist/streams/stream-card/cmp.stream-card.svelte +89 -0
  77. package/dist/streams/stream-card/cmp.stream-card.svelte.d.ts +11 -0
  78. package/dist/streams/stream-card/index.d.ts +2 -0
  79. package/dist/streams/stream-card/index.js +1 -0
  80. package/dist/streams/stream-card/types.d.ts +6 -0
  81. package/dist/streams/stream-card/types.js +1 -0
  82. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +3 -3
  83. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +1 -2
  84. package/dist/streams/stream-page-viewer/index.d.ts +0 -1
  85. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +2 -6
  86. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +3 -3
  87. package/dist/streams/stream-player/controls.svelte +1 -1
  88. package/dist/streams/stream-player/index.d.ts +15 -10
  89. package/dist/streams/stream-player/index.js +11 -8
  90. package/dist/streams/stream-player/internal-stream-player-data-provider.d.ts +2 -0
  91. package/dist/streams/stream-player/internal-stream-player-data-provider.js +2 -2
  92. package/dist/streams/stream-player/stream-overview.svelte +1 -1
  93. package/dist/streams/stream-player/stream-player-localization.d.ts +6 -19
  94. package/dist/streams/stream-player/stream-player-localization.js +14 -14
  95. package/dist/streams/stream-player/stream-player.svelte +6 -6
  96. package/dist/streams/stream-player/types.d.ts +4 -4
  97. package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
  98. package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +1 -2
  99. package/dist/ui/line-clamp/index.d.ts +0 -1
  100. package/dist/ui/line-clamp/index.js +0 -1
  101. package/dist/ui/line-clamp/line-clamp-localization.d.ts +1 -5
  102. package/dist/ui/line-clamp/line-clamp-localization.js +4 -4
  103. package/dist/ui/shadow-dom/{reset.scss → reset-shadow.css} +31 -44
  104. package/dist/ui/shadow-dom/shadow-root-service.js +2 -2
  105. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +2 -2
  106. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +1 -2
  107. package/dist/ui/swipe-indicator/index.d.ts +0 -1
  108. package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +1 -4
  109. package/dist/ui/swipe-indicator/swipe-indicator-localization.js +3 -3
  110. package/dist/ui/time-ago/cmp.time-ago.svelte +2 -2
  111. package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +1 -2
  112. package/dist/ui/time-ago/index.d.ts +0 -1
  113. package/dist/ui/time-ago/time-ago-localization.d.ts +1 -11
  114. package/dist/ui/time-ago/time-ago-localization.js +10 -10
  115. package/package.json +1 -1
  116. package/dist/media-center/data-provider/index.d.ts +0 -2
  117. package/dist/media-center/data-provider/index.js +0 -1
  118. package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.d.ts +0 -8
  119. package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.js +0 -46
  120. package/dist/media-center/data-provider/types.d.ts +0 -24
  121. /package/dist/media-center/{data-provider → config}/types.js +0 -0
  122. /package/dist/ui/shadow-dom/{normalize.scss → normalize-shadow.css} +0 -0
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">import { ProductCard } from '../../products/product-card';
2
2
  import { ShortVideoCard } from '../../short-videos/short-video-card';
3
+ import { StreamCard } from '../../streams/stream-card';
3
4
  import { MediaCenterLocalization } from './media-center-localization';
4
5
  let { data, localization, on } = $props();
5
6
  const shortVideoSectionItems = $derived.by(() => {
@@ -39,6 +40,18 @@ const shortVideoSectionItems = $derived.by(() => {
39
40
 
40
41
  <div class="media-center-overview">
41
42
  <div class="media-center-overview__content">
43
+ {#if data.streams.length}
44
+ <div class="media-center-overview__section">
45
+ <div class="media-center-overview__section-header media-center-overview__section-header--blue">
46
+ {localization.streamsSectionTitle}
47
+ </div>
48
+ <div class="media-center-overview__section-content">
49
+ {#each data.streams as item (item.id)}
50
+ <StreamCard stream={item} on={{ click: () => on.streamSelected(item.id) }}></StreamCard>
51
+ {/each}
52
+ </div>
53
+ </div>
54
+ {/if}
42
55
  {#if shortVideoSectionItems.length}
43
56
  <div class="media-center-overview__section">
44
57
  <div class="media-center-overview__section-header media-center-overview__section-header--red">
@@ -54,7 +67,7 @@ const shortVideoSectionItems = $derived.by(() => {
54
67
  </div>
55
68
  {:else if item.kind === 'product'}
56
69
  <div class="media-center-overview__card-wrapper" data-theme="dark">
57
- <ProductCard product={item.data} localization={localization.productLocalization} />
70
+ <ProductCard product={item.data} locale={localization.productLocale} />
58
71
  </div>
59
72
  {/if}
60
73
  {/each}
@@ -6,6 +6,7 @@ type Props = {
6
6
  localization: MediaCenterLocalization;
7
7
  on: {
8
8
  shortVideoSelected: (shortVideo: ShortVideoPlayerModel) => void;
9
+ streamSelected: (id: string) => void;
9
10
  };
10
11
  };
11
12
  declare const Overview: import("svelte").Component<Props, {}, "">;
@@ -1,8 +1,8 @@
1
1
  import type { ShortVideoPlayerModel } from '../../short-videos/short-videos-player';
2
2
  import type { IPlayerItemsProvider } from '../../ui/player';
3
- import type { IMediaCenterDataProvider } from '../data-provider';
3
+ import type { IMediaCenterConfig } from '../config/types';
4
4
  export declare const makeShortVideosProvider: (data: {
5
- dataProvider: IMediaCenterDataProvider;
5
+ config: IMediaCenterConfig;
6
6
  categoryId?: string;
7
7
  prefetchedItems?: ShortVideoPlayerModel[];
8
8
  }) => IPlayerItemsProvider<ShortVideoPlayerModel>;
@@ -1,10 +1,10 @@
1
1
  import { ContinuationToken } from '../../core/continuation-token';
2
2
  import { CursorDataLoader } from '../../core/data-loaders';
3
3
  export const makeShortVideosProvider = (data) => {
4
- const { dataProvider, categoryId, prefetchedItems = [] } = data;
4
+ const { config, categoryId, prefetchedItems = [] } = data;
5
5
  const loader = new CursorDataLoader({
6
6
  loadPage: async (continuationToken) => {
7
- const result = await dataProvider.getShortVideosCursor({
7
+ const result = await config.shortVideosPlayer.getShortVideosCursor({
8
8
  filter: { categoryId, excludeIds: prefetchedItems.length ? prefetchedItems.map((i) => i.id) : undefined },
9
9
  continuationToken: continuationToken.toNextChunkString(),
10
10
  limit: 20
@@ -0,0 +1,100 @@
1
+ <script lang="ts">import { StreamCard } from '../../streams/stream-card';
2
+ let { data, on } = $props();
3
+ </script>
4
+
5
+ <div class="streams-in-category">
6
+ <div class="streams-in-category__content">
7
+ {#if data.streams.length}
8
+ <div class="streams-in-category__section">
9
+ <div class="streams-in-category__section-header streams-in-category__section-header--blue">
10
+ {data.categoryName}
11
+ </div>
12
+ <div class="streams-in-category__section-content">
13
+ {#each data.streams as item (item.id)}
14
+ <StreamCard stream={item} on={{ click: () => on.streamSelected(item.id) }}></StreamCard>
15
+ {/each}
16
+ </div>
17
+ </div>
18
+ {/if}
19
+ </div>
20
+ </div>
21
+
22
+ <style>@keyframes fadeIn {
23
+ 0% {
24
+ opacity: 1;
25
+ }
26
+ 50% {
27
+ opacity: 0.4;
28
+ }
29
+ 100% {
30
+ opacity: 1;
31
+ }
32
+ }
33
+ .streams-in-category {
34
+ background: transparent;
35
+ width: 100%;
36
+ display: flex;
37
+ justify-content: center;
38
+ padding: 1.25rem 1.875rem;
39
+ /* Set 'container-type: inline-size;' to reference container*/
40
+ }
41
+ @container (width < 576px) {
42
+ .streams-in-category {
43
+ padding: 0.625rem 0.9375rem;
44
+ }
45
+ }
46
+ .streams-in-category__content {
47
+ width: 100%;
48
+ max-width: 73.75rem;
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: 2.25rem;
52
+ }
53
+ .streams-in-category__section {
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: 1rem;
57
+ }
58
+ .streams-in-category__section-header {
59
+ display: flex;
60
+ align-items: center;
61
+ gap: 0.6875rem;
62
+ font-size: 1.125rem;
63
+ line-height: 1.75rem;
64
+ font-weight: 500;
65
+ color: #ffffff;
66
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
67
+ }
68
+ .streams-in-category__section-header::before {
69
+ content: "";
70
+ display: inline-block;
71
+ width: 0.3125rem;
72
+ height: 1.625rem;
73
+ border-radius: 0.125rem;
74
+ background: #5a8dec;
75
+ }
76
+ .streams-in-category__section-content {
77
+ --product-card--aspect-ratio: 9/16;
78
+ --product-card--border-radius: 0.375rem;
79
+ display: grid;
80
+ gap: 2rem 1.25rem;
81
+ grid-template-columns: repeat(5, minmax(0, 1fr));
82
+ /* Set 'container-type: inline-size;' to reference container*/
83
+ /* Set 'container-type: inline-size;' to reference container*/
84
+ /* Set 'container-type: inline-size;' to reference container*/
85
+ }
86
+ @container (width < 992px) {
87
+ .streams-in-category__section-content {
88
+ grid-template-columns: repeat(4, minmax(0, 1fr));
89
+ }
90
+ }
91
+ @container (width < 768px) {
92
+ .streams-in-category__section-content {
93
+ grid-template-columns: repeat(3, minmax(0, 1fr));
94
+ }
95
+ }
96
+ @container (width < 576px) {
97
+ .streams-in-category__section-content {
98
+ grid-template-columns: repeat(2, minmax(0, 1fr));
99
+ }
100
+ }</style>
@@ -0,0 +1,10 @@
1
+ import type { StreamInCategoryData } from './types';
2
+ type Props = {
3
+ data: StreamInCategoryData;
4
+ on: {
5
+ streamSelected: (id: string) => void;
6
+ };
7
+ };
8
+ declare const StreamsInCategory: import("svelte").Component<Props, {}, "">;
9
+ type StreamsInCategory = ReturnType<typeof StreamsInCategory>;
10
+ export default StreamsInCategory;
@@ -5,6 +5,17 @@ export declare enum MediaCenterMode {
5
5
  Stream = "stream"
6
6
  }
7
7
  export type OverviewData = {
8
+ streams: MediaCenterStreamModel[];
8
9
  shortVideos: ShortVideoPlayerModel[];
9
10
  products: ProductCardModel[];
10
11
  };
12
+ export type StreamInCategoryData = {
13
+ categoryName: string;
14
+ streams: MediaCenterStreamModel[];
15
+ };
16
+ export type MediaCenterStreamModel = {
17
+ id: string;
18
+ title: string;
19
+ subTitle: string | null;
20
+ cover: string | null;
21
+ };
@@ -3,8 +3,8 @@ import { Image } from '../../ui/image';
3
3
  import { LineClamp } from '../../ui/line-clamp';
4
4
  import { ProportionalContainer } from '../../ui/proportional-container';
5
5
  import { ProductCardLocalization } from './product-card-localization';
6
- let { product, includeBeforeNowPrefix, inert = false, localization: localizationInit = 'en', on } = $props();
7
- const localization = $derived(new ProductCardLocalization(localizationInit));
6
+ let { product, includeBeforeNowPrefix, inert = false, locale = 'en', on } = $props();
7
+ const localization = $derived(new ProductCardLocalization(locale));
8
8
  const showDescriptionPresented = $derived(product.shortDescription && product.shortDescription.length > 0);
9
9
  const onProductClicked = (event) => {
10
10
  event.preventDefault();
@@ -1,9 +1,8 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import { type IProductCardLocalization } from './product-card-localization';
3
2
  import type { ProductCardModel } from './types';
4
3
  type Props = {
5
4
  product: ProductCardModel;
6
- localization?: IProductCardLocalization | Locale;
5
+ locale?: Locale;
7
6
  includeBeforeNowPrefix?: boolean;
8
7
  inert?: boolean;
9
8
  on?: {
@@ -1,8 +1,5 @@
1
1
  import { type Locale } from '../../core/locale';
2
- export interface IProductCardLocalization {
3
- beforeNowPrefix?: string | null;
4
- }
5
2
  export declare class ProductCardLocalization {
6
3
  beforeNowPrefix: string | null;
7
- constructor(init: IProductCardLocalization | 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 ProductCardLocalization {
3
3
  beforeNowPrefix;
4
4
  constructor(init) {
5
- this.beforeNowPrefix = isLocale(init) ? loc.beforeNowPrefix[init] : init?.beforeNowPrefix || loc.beforeNowPrefix.en;
5
+ this.beforeNowPrefix = loc.beforeNowPrefix[init];
6
6
  }
7
7
  }
8
8
  const loc = {
@@ -15,15 +15,11 @@ let { shortVideo, aspectRatio = 9 / 16, on } = $props();
15
15
  <div class="short-video-card__media-icons">
16
16
  <Icon src={IconPhone}></Icon>
17
17
  </div>
18
-
19
- <div class="short-video-card__gradient-overlay"></div>
20
18
  </div>
21
19
 
22
20
  {#if shortVideo.text}
23
21
  <div class="short-video-card__text">
24
- <div class="short-video-card__text-value">
25
- <LineClamp value={shortVideo.text} maxLines={2} enableShowMore={false} />
26
- </div>
22
+ <LineClamp value={shortVideo.text} maxLines={2} enableShowMore={false} />
27
23
  </div>
28
24
  {/if}
29
25
 
@@ -56,20 +52,6 @@ let { shortVideo, aspectRatio = 9 / 16, on } = $props();
56
52
  justify-content: center;
57
53
  --image--rounded--outer--border-radius: 1%;
58
54
  }
59
- .short-video-card__gradient-overlay {
60
- /* Set 'container-type: inline-size;' to reference container*/
61
- }
62
- @container (width < 350px) {
63
- .short-video-card__gradient-overlay {
64
- position: absolute;
65
- bottom: 0;
66
- left: 0;
67
- right: 0;
68
- height: 80px;
69
- background: linear-gradient(0deg, #000000 0%, rgba(0, 0, 0, 0) 100%);
70
- pointer-events: none;
71
- }
72
- }
73
55
  .short-video-card__media-icons {
74
56
  position: absolute;
75
57
  top: 0.625em;
@@ -82,33 +64,16 @@ let { shortVideo, aspectRatio = 9 / 16, on } = $props();
82
64
  --icon--filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.2));
83
65
  }
84
66
  .short-video-card__text {
85
- font-weight: 500;
86
- white-space: pre-line;
87
- word-break: break-word;
88
- display: -webkit-box;
89
- overflow: hidden;
90
- -webkit-box-orient: vertical;
91
- line-clamp: 3;
92
- -webkit-line-clamp: 3;
93
- /* Set 'container-type: inline-size;' to reference container*/
94
- }
95
- .short-video-card__text-value {
96
- font-size: 0.9375em;
97
- line-height: 1.2;
98
- }
99
- @container (width < 350px) {
100
- .short-video-card__text {
101
- position: absolute;
102
- bottom: 0;
103
- left: 0;
104
- right: 0;
105
- background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 100%);
106
- color: #ffffff;
107
- font-size: 0.9375rem;
108
- font-weight: 400;
109
- padding: 0.78125rem 1rem;
110
- padding-top: 2.5rem;
111
- }
67
+ position: absolute;
68
+ bottom: 0;
69
+ left: 0;
70
+ right: 0;
71
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 30%, rgba(0, 0, 0, 0.01) 100%);
72
+ color: #ffffff;
73
+ font-size: 0.75rem;
74
+ font-weight: 400;
75
+ padding: 0.75rem 0.75rem;
76
+ padding-top: 2.5rem;
112
77
  }
113
78
  .short-video-card__link {
114
79
  position: absolute;
@@ -94,7 +94,7 @@ $effect(() => {
94
94
  </script>
95
95
 
96
96
  <div class="attachments-horizontal" use:horizontalWheelScroll use:swallowTouch>
97
- {#each attachmentsToShow as attachment, index (attachment)}
97
+ {#each attachmentsToShow as attachment (attachment)}
98
98
  <div
99
99
  class="attachments-horizontal__item"
100
100
  class:attachments-horizontal__item--single={attachmentsToShow.length === 1}
@@ -2,8 +2,8 @@
2
2
  import { default as ShortVideoProductCard } from './cmp.short-video-product-card.svelte';
3
3
  import { ShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
4
4
  import {} from './types';
5
- let { shortVideo, localization: localizationInit = 'en', on } = $props();
6
- const localization = $derived(new ShortVideoAttachmentsLocalization(localizationInit));
5
+ let { shortVideo, locale = 'en', on } = $props();
6
+ const localization = $derived(new ShortVideoAttachmentsLocalization(locale));
7
7
  </script>
8
8
 
9
9
  {#if shortVideo.hasAttachments}
@@ -22,7 +22,7 @@ const localization = $derived(new ShortVideoAttachmentsLocalization(localization
22
22
  <ShortVideoProductCard
23
23
  product={product}
24
24
  videoId={shortVideo.id}
25
- localization={localization.productLocalization}
25
+ locale={localization.productLocale}
26
26
  on={{
27
27
  productClick: on?.productClick,
28
28
  impression: on?.productImpression
@@ -1,9 +1,8 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import { type IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
3
2
  import { type ShortVideoViewerModel } from './types';
4
3
  type Props = {
5
4
  shortVideo: ShortVideoViewerModel;
6
- localization?: IShortVideoAttachmentsLocalization | Locale;
5
+ locale?: Locale;
7
6
  on?: {
8
7
  productClick?: (productId: string) => void;
9
8
  productImpression?: (productId: string, videoId: string) => void;
@@ -1,8 +1,7 @@
1
1
  <script lang="ts">import { ImageRound } from '../../ui/image';
2
2
  import { TimeAgo } from '../../ui/time-ago';
3
3
  import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
4
- let { model, localization: localizationInit } = $props();
5
- const localization = $derived(new ShortVideoViewerLocalization(localizationInit));
4
+ let { model, localization } = $props();
6
5
  </script>
7
6
 
8
7
  <div class="short-video-heading">
@@ -13,7 +12,7 @@ const localization = $derived(new ShortVideoViewerLocalization(localizationInit)
13
12
  <div class="short-video-heading__info">
14
13
  <div class="short-video-heading__source-name">{model.name}</div>
15
14
  <p class="short-video-heading__metadata">
16
- <TimeAgo date={model.displayDate} localization={localization.timeAgoLocalization} />
15
+ <TimeAgo date={model.displayDate} locale={localization.timeAgoLocale} />
17
16
  {#if Number.isInteger(model.viewsCount) && model.viewsCount}
18
17
  <span>&middot;</span>
19
18
  {localization.viewsCount(model.viewsCount)}
@@ -1,8 +1,8 @@
1
- import { type IShortVideoViewerLocalization } from './short-video-viewer-localization';
1
+ import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
2
2
  import type { ShortVideoViewerHeadingModel } from './types';
3
3
  type Props = {
4
4
  model: ShortVideoViewerHeadingModel;
5
- localization: IShortVideoViewerLocalization;
5
+ localization: ShortVideoViewerLocalization;
6
6
  };
7
7
  declare const Cmp: import("svelte").Component<Props, {}, "">;
8
8
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">import { ProductCard } from '../../products/product-card';
2
2
  import { onMount } from 'svelte';
3
- let { product, videoId, localization, includeBeforeNowPrefix, inert = false, on } = $props();
3
+ let { product, videoId, locale, includeBeforeNowPrefix, inert = false, on } = $props();
4
4
  let productElement;
5
5
  const productData = product;
6
6
  onMount(() => {
@@ -22,5 +22,5 @@ onMount(() => {
22
22
  </script>
23
23
 
24
24
  <div bind:this={productElement}>
25
- <ProductCard product={productData} localization={localization} includeBeforeNowPrefix={includeBeforeNowPrefix} inert={inert} on={on} />
25
+ <ProductCard product={productData} locale={locale} includeBeforeNowPrefix={includeBeforeNowPrefix} inert={inert} on={on} />
26
26
  </div>
@@ -1,10 +1,9 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import type { IProductCardLocalization } from '../../products/product-card/product-card-localization';
3
2
  import type { ShortVideoProductCardModel } from './types';
4
3
  type Props = {
5
4
  product: ShortVideoProductCardModel;
6
5
  videoId: string;
7
- localization?: IProductCardLocalization | Locale;
6
+ locale?: Locale;
8
7
  includeBeforeNowPrefix?: boolean;
9
8
  inert?: boolean;
10
9
  on?: {
@@ -6,8 +6,8 @@ import { default as ShortVideoControls } from './cmp.short-video-controls.svelte
6
6
  import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
7
7
  import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
8
8
  import { ShortVideoViewerUiManager } from './ui-manager.svelte';
9
- let { model, socialInteractionsHandler, showAttachments = true, showControls = true, autoplay = 'on-appearance', localization: localizationInit = 'en', on } = $props();
10
- const localization = $derived(new ShortVideoViewerLocalization(localizationInit));
9
+ let { model, socialInteractionsHandler, showAttachments = true, showControls = true, autoplay = 'on-appearance', locale = 'en', on } = $props();
10
+ const localization = $derived(new ShortVideoViewerLocalization(locale));
11
11
  const uiManager = new ShortVideoViewerUiManager();
12
12
  $effect(() => {
13
13
  uiManager.updateCanShowAttachments(showAttachments);
@@ -1,5 +1,4 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import { type IShortVideoViewerLocalization } from './short-video-viewer-localization';
3
2
  import type { IPostSocialInteractionsHandler, ShortVideoViewerModel } from './types';
4
3
  type Props = {
5
4
  model: ShortVideoViewerModel;
@@ -7,7 +6,7 @@ type Props = {
7
6
  showAttachments?: boolean;
8
7
  showControls?: boolean;
9
8
  autoplay?: true | false | 'on-appearance';
10
- localization?: IShortVideoViewerLocalization | Locale;
9
+ locale?: Locale;
11
10
  on?: {
12
11
  progress?: (progress: number) => void;
13
12
  productClick?: (productId: string) => void;
@@ -2,6 +2,4 @@ export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
2
2
  export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
3
3
  export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
4
4
  export type { ShortVideoViewerModel, IPostSocialInteractionsHandler, ShortVideoAdCardModel, ShortVideoProductCardModel } from './types';
5
- export type { IShortVideoViewerLocalization } from './short-video-viewer-localization';
6
- export type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
7
5
  export { mapToShortVideoViewerModel } from './mapper';
@@ -1,9 +1,5 @@
1
1
  import { type Locale } from '../../core/locale';
2
- import type { IProductCardLocalization } from '../../products/product-card/product-card-localization';
3
- export interface IShortVideoAttachmentsLocalization {
4
- productLocalization?: IProductCardLocalization | Locale;
5
- }
6
2
  export declare class ShortVideoAttachmentsLocalization {
7
- productLocalization: IProductCardLocalization | Locale;
8
- constructor(init: IShortVideoAttachmentsLocalization | Locale);
3
+ productLocale: 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 ShortVideoAttachmentsLocalization {
3
- productLocalization;
4
- constructor(init) {
5
- this.productLocalization = isLocale(init) ? init : init.productLocalization || 'en';
3
+ productLocale;
4
+ constructor(locale) {
5
+ this.productLocale = locale;
6
6
  }
7
7
  }
@@ -1,14 +1,7 @@
1
1
  import { type Locale } from '../../core/locale';
2
- import type { IProductCardLocalization } from '../../products/product-card/product-card-localization';
3
- import type { ITimeAgoLocalization } from '../../ui/time-ago';
4
- export interface IShortVideoViewerLocalization {
5
- viewsCount?: (count: number) => string;
6
- timeAgoLocalization?: ITimeAgoLocalization | Locale;
7
- productLocalization?: IProductCardLocalization | Locale;
8
- }
9
2
  export declare class ShortVideoViewerLocalization {
10
3
  viewsCount: (count: number) => string;
11
- timeAgoLocalization: ITimeAgoLocalization | Locale;
12
- productLocalization: IProductCardLocalization | Locale;
13
- constructor(init: IShortVideoViewerLocalization | Locale);
4
+ timeAgoLocale: Locale;
5
+ productLocale: Locale;
6
+ constructor(locale: Locale);
14
7
  }
@@ -1,12 +1,12 @@
1
- import { isLocale } from '../../core/locale';
1
+ import {} from '../../core/locale';
2
2
  export class ShortVideoViewerLocalization {
3
3
  viewsCount;
4
- timeAgoLocalization;
5
- productLocalization;
6
- constructor(init) {
7
- this.viewsCount = isLocale(init) ? loc.viewsCount[init] : init.viewsCount || loc.viewsCount.en;
8
- this.timeAgoLocalization = isLocale(init) ? init : init.timeAgoLocalization || 'en';
9
- this.productLocalization = isLocale(init) ? init : init.productLocalization || 'en';
4
+ timeAgoLocale;
5
+ productLocale;
6
+ constructor(locale) {
7
+ this.viewsCount = loc.viewsCount[locale];
8
+ this.timeAgoLocale = locale;
9
+ this.productLocale = locale;
10
10
  }
11
11
  }
12
12
  const loc = {
@@ -1,20 +1,20 @@
1
1
  <script lang="ts">import { MediaCenter, MediaCenterMode } from '../../media-center/media-center';
2
2
  import { createShadowRoot } from '../../ui/shadow-dom';
3
3
  import { mount, unmount } from 'svelte';
4
- let { dataProvider, socialInteractionsHandler, localization, showStreamsCloudWatermark, disableBackground, analyticsHandler, on, mediaCenterDataProvider } = $props();
4
+ let { dataProvider, socialInteractionsHandler, locale, showStreamsCloudWatermark, disableBackground, analyticsHandler, on, mediaCenterConfig } = $props();
5
5
  const initHost = (node) => {
6
6
  const shadowRoot = createShadowRoot(node);
7
7
  const mounted = mount(MediaCenter, {
8
8
  target: shadowRoot,
9
9
  props: {
10
- dataProvider: mediaCenterDataProvider || null,
10
+ config: mediaCenterConfig || null,
11
11
  playerProps: {
12
- type: MediaCenterMode.ShortVideos,
12
+ mode: MediaCenterMode.ShortVideos,
13
13
  props: {
14
14
  dataProvider,
15
15
  socialInteractionsHandler,
16
16
  disableBackground,
17
- localization,
17
+ locale,
18
18
  showStreamsCloudWatermark,
19
19
  analyticsHandler,
20
20
  on
@@ -1,7 +1,7 @@
1
- import type { IMediaCenterDataProvider } from '../../media-center/data-provider';
1
+ import type { IMediaCenterConfig } from '../../media-center/config/types';
2
2
  import type { ShortVideoPlayerProps } from './types';
3
3
  type $$ComponentProps = ShortVideoPlayerProps & {
4
- mediaCenterDataProvider?: IMediaCenterDataProvider;
4
+ mediaCenterConfig?: IMediaCenterConfig;
5
5
  };
6
6
  declare const Cmp: import("svelte").Component<$$ComponentProps, {}, "">;
7
7
  type Cmp = ReturnType<typeof Cmp>;
@@ -71,7 +71,7 @@ const trackNavigationButtonsSize = (node) => {
71
71
  <div class="short-videos-player-controls__short-video-attachments" transition:slideHorizontally|local>
72
72
  <ShortVideoViewerAttachments
73
73
  shortVideo={shortVideo}
74
- localization={localization.shortVideoAttachmentsLocalization}
74
+ locale={localization.shortVideoAttachmentsLocale}
75
75
  on={{
76
76
  productClick: on.productClick,
77
77
  productImpression: on.productImpression,