@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
@@ -1,11 +1,10 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import { type ILineClampLocalization } from './line-clamp-localization';
3
2
  import { type Snippet } from 'svelte';
4
3
  type Props = {
5
4
  value?: string | null;
6
5
  maxLines?: number | 'auto';
7
6
  enableShowMore?: boolean;
8
- localization?: ILineClampLocalization | Locale;
7
+ locale?: Locale;
9
8
  children?: Snippet;
10
9
  };
11
10
  declare const Cmp: import("svelte").Component<Props, {}, "">;
@@ -1,2 +1 @@
1
1
  export { default as LineClamp } from './cmp.line-clamp.svelte';
2
- export { type ILineClampLocalization } from './line-clamp-localization';
@@ -1,2 +1 @@
1
1
  export { default as LineClamp } from './cmp.line-clamp.svelte';
2
- export {} from './line-clamp-localization';
@@ -1,10 +1,6 @@
1
1
  import { type Locale } from '../../core/locale';
2
- export interface ILineClampLocalization {
3
- showLess?: string;
4
- showMore?: string;
5
- }
6
2
  export declare class LineClampLocalization {
7
3
  showLess: string;
8
4
  showMore: string;
9
- constructor(init: ILineClampLocalization | Locale);
5
+ constructor(locale: Locale);
10
6
  }
@@ -1,10 +1,10 @@
1
- import { isLocale } from '../../core/locale';
1
+ import {} from '../../core/locale';
2
2
  export class LineClampLocalization {
3
3
  showLess;
4
4
  showMore;
5
- constructor(init) {
6
- this.showLess = isLocale(init) ? loc.showLess[init] : init.showLess || loc.showLess.en;
7
- this.showMore = isLocale(init) ? loc.showMore[init] : init.showMore || loc.showMore.en;
5
+ constructor(locale) {
6
+ this.showLess = loc.showLess[locale];
7
+ this.showMore = loc.showMore[locale];
8
8
  }
9
9
  }
10
10
  const loc = {
@@ -1,5 +1,3 @@
1
- $input-placeholder-color: var(--input--placeholder--color, #c1c1c1);
2
-
3
1
  /*Default margins and paddings are removed*/
4
2
  a,
5
3
  article,
@@ -87,55 +85,44 @@ li {
87
85
  input {
88
86
  vertical-align: middle;
89
87
  min-width: 0;
90
- &::placeholder {
91
- color: $input-placeholder-color !important;
92
- }
93
- &:-webkit-autofill,
94
- &:-webkit-autofill:hover,
95
- &:-webkit-autofill:focus {
96
- -webkit-background-clip: text;
97
- }
98
- /* Chrome, Safari, Edge, Opera */
99
- &::-webkit-outer-spin-button,
100
- &::-webkit-inner-spin-button {
101
- -webkit-appearance: none;
102
- margin: 0;
103
- }
104
- &[type='number'] {
105
- -moz-appearance: textfield;
106
- }
107
88
  }
108
89
 
109
- $scrollbar-width: thin;
110
- $scrollbar-color: var(--custom-scrollbar-color, #7d7d7d);
111
- $scrollbar-background-color: var(--custom-scrollbar-background, transparent);
90
+ input::placeholder {
91
+ color: #c1c1c1 !important;
92
+ }
93
+ input:-webkit-autofill,
94
+ input:-webkit-autofill:hover,
95
+ input:-webkit-autofill:focus {
96
+ -webkit-background-clip: text;
97
+ }
98
+ /* Chrome, Safari, Edge, Opera */
99
+ input::-webkit-outer-spin-button,
100
+ input::-webkit-inner-spin-button {
101
+ -webkit-appearance: none;
102
+ margin: 0;
103
+ }
104
+ input[type='number'] {
105
+ -moz-appearance: textfield;
106
+ }
112
107
 
113
108
  textarea {
114
109
  vertical-align: top;
115
110
  resize: vertical;
116
- scrollbar-color: $scrollbar-color $scrollbar-background-color;
117
- scrollbar-width: $scrollbar-width;
118
- &::-webkit-scrollbar {
119
- @if ($scrollbar-width == thin) {
120
- width: 3px;
121
- height: 3px;
122
- } @else if ($scrollbar-width == none) {
123
- width: 0;
124
- height: 0;
125
- } @else {
126
- width: 6px;
127
- height: 6px;
128
- }
111
+ scrollbar-color: #7d7d7d transparent;
112
+ scrollbar-width: thin;
113
+ }
129
114
 
130
- background: $custom-scrollbar-background;
131
- visibility: hidden;
132
- }
133
- &::-webkit-scrollbar-thumb {
134
- background: $scrollbar-color;
135
- }
136
- &::placeholder {
137
- color: $input-placeholder-color !important;
138
- }
115
+ textarea::-webkit-scrollbar {
116
+ width: 3px;
117
+ height: 3px;
118
+
119
+ background: transparent;
120
+ }
121
+ textarea::-webkit-scrollbar-thumb {
122
+ background: #7d7d7d;
123
+ }
124
+ textarea::placeholder {
125
+ color: #c1c1c1 !important;
139
126
  }
140
127
 
141
128
  input:focus,
@@ -1,5 +1,5 @@
1
- import normalize from './normalize.scss?raw';
2
- import reset from './reset.scss?raw';
1
+ import normalize from './normalize-shadow.css?raw';
2
+ import reset from './reset-shadow.css?raw';
3
3
  export const createShadowRoot = (host) => {
4
4
  prepareShadowRootHost(host);
5
5
  const shadowRoot = host.attachShadow({ mode: 'open' });
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">import { Icon } from '../icon';
2
2
  import { SwipeIndicatorLocalization } from './swipe-indicator-localization';
3
3
  import IconArrowUp from '@fluentui/svg-icons/icons/arrow_up_20_regular.svg?raw';
4
- let { fadeTimeout = 2000, localization: localizationInit } = $props();
5
- const localization = $derived(new SwipeIndicatorLocalization(localizationInit));
4
+ let { fadeTimeout = 2000, locale } = $props();
5
+ const localization = $derived(new SwipeIndicatorLocalization(locale));
6
6
  let isFaded = $state(false);
7
7
  const indicatorMounted = (_) => {
8
8
  if (fadeTimeout) {
@@ -1,8 +1,7 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import { type ISwipeIndicatorLocalization } from './swipe-indicator-localization';
3
2
  type Props = {
4
3
  fadeTimeout?: number;
5
- localization: ISwipeIndicatorLocalization | Locale;
4
+ locale: Locale;
6
5
  };
7
6
  declare const Cmp: import("svelte").Component<Props, {}, "">;
8
7
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,2 +1 @@
1
1
  export { default as SwipeIndicator } from './cmp.swipe-indicator.svelte';
2
- export type { ISwipeIndicatorLocalization } from './swipe-indicator-localization';
@@ -1,8 +1,5 @@
1
1
  import { type Locale } from '../../core/locale';
2
- export interface ISwipeIndicatorLocalization {
3
- swipe?: string;
4
- }
5
2
  export declare class SwipeIndicatorLocalization {
6
3
  swipe: string;
7
- constructor(init: ISwipeIndicatorLocalization | Locale);
4
+ constructor(locale: Locale);
8
5
  }
@@ -1,8 +1,8 @@
1
- import { isLocale } from '../../core/locale';
1
+ import {} from '../../core/locale';
2
2
  export class SwipeIndicatorLocalization {
3
3
  swipe;
4
- constructor(init) {
5
- this.swipe = isLocale(init) ? loc.swipe[init] : init.swipe || loc.swipe.en;
4
+ constructor(locale) {
5
+ this.swipe = loc.swipe[locale];
6
6
  }
7
7
  }
8
8
  const loc = {
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">import { DateFormatOptions, DateHelper } from '../../core/utils/date-helper';
2
2
  import { TimeAgoLocalization } from './time-ago-localization';
3
3
  import { onDestroy } from 'svelte';
4
- let { date = null, thresholdMinutes = 60 * 24 * 2 /* 2 days */, localization: localizationInit } = $props();
5
- const localization = $derived(new TimeAgoLocalization(localizationInit));
4
+ let { date = null, thresholdMinutes = 60 * 24 * 2 /* 2 days */, locale } = $props();
5
+ const localization = $derived(new TimeAgoLocalization(locale));
6
6
  let timeSpan = $state.raw(null);
7
7
  let timeoutId;
8
8
  onDestroy(() => {
@@ -1,9 +1,8 @@
1
1
  import type { Locale } from '../../core/locale';
2
- import { type ITimeAgoLocalization } from './time-ago-localization';
3
2
  type Props = {
4
3
  date: Date | string | null;
5
4
  thresholdMinutes?: number;
6
- localization: ITimeAgoLocalization | Locale;
5
+ locale: Locale;
7
6
  };
8
7
  declare const Cmp: import("svelte").Component<Props, {}, "">;
9
8
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,2 +1 @@
1
1
  export { default as TimeAgo } from './cmp.time-ago.svelte';
2
- export type { ITimeAgoLocalization } from './time-ago-localization';
@@ -1,14 +1,4 @@
1
1
  import { type Locale } from '../../core/locale';
2
- export interface ITimeAgoLocalization {
3
- locale?: string;
4
- aMinuteAgo?: string;
5
- anHourAgo?: string;
6
- justNow?: string;
7
- at?: (date: string, time: string) => string;
8
- hoursAgo?: (hours: number) => string;
9
- minutesAgo?: (minutes: number) => string;
10
- yesterday?: (time: string) => string;
11
- }
12
2
  export declare class TimeAgoLocalization {
13
3
  locale: string;
14
4
  aMinuteAgo: string;
@@ -18,5 +8,5 @@ export declare class TimeAgoLocalization {
18
8
  hoursAgo: (hours: number) => string;
19
9
  minutesAgo: (minutes: number) => string;
20
10
  yesterday: (time: string) => string;
21
- constructor(init: ITimeAgoLocalization | Locale);
11
+ constructor(locale: Locale);
22
12
  }
@@ -1,4 +1,4 @@
1
- import { isLocale } from '../../core/locale';
1
+ import {} from '../../core/locale';
2
2
  export class TimeAgoLocalization {
3
3
  locale;
4
4
  aMinuteAgo;
@@ -8,15 +8,15 @@ export class TimeAgoLocalization {
8
8
  hoursAgo;
9
9
  minutesAgo;
10
10
  yesterday;
11
- constructor(init) {
12
- this.locale = isLocale(init) ? loc.locale[init] : init.locale || loc.locale.en;
13
- this.aMinuteAgo = isLocale(init) ? loc.aMinuteAgo[init] : init.aMinuteAgo || loc.aMinuteAgo.en;
14
- this.anHourAgo = isLocale(init) ? loc.anHourAgo[init] : init.anHourAgo || loc.anHourAgo.en;
15
- this.justNow = isLocale(init) ? loc.justNow[init] : init.justNow || loc.justNow.en;
16
- this.at = isLocale(init) ? loc.at[init] : init.at || loc.at.en;
17
- this.hoursAgo = isLocale(init) ? loc.hoursAgo[init] : init.hoursAgo || loc.hoursAgo.en;
18
- this.minutesAgo = isLocale(init) ? loc.minutesAgo[init] : init.minutesAgo || loc.minutesAgo.en;
19
- this.yesterday = isLocale(init) ? loc.yesterday[init] : init.yesterday || loc.yesterday.en;
11
+ constructor(locale) {
12
+ this.locale = loc.locale[locale];
13
+ this.aMinuteAgo = loc.aMinuteAgo[locale];
14
+ this.anHourAgo = loc.anHourAgo[locale];
15
+ this.justNow = loc.justNow[locale];
16
+ this.at = loc.at[locale];
17
+ this.hoursAgo = loc.hoursAgo[locale];
18
+ this.minutesAgo = loc.minutesAgo[locale];
19
+ this.yesterday = loc.yesterday[locale];
20
20
  }
21
21
  }
22
22
  const loc = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "6.5.1",
3
+ "version": "7.0.0-1758321646285",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- export type { IMediaCenterDataProvider } from './types';
2
- export { InternalMediaCenterDataProvider } from './internal-media-center-data-provider.svelte';
@@ -1 +0,0 @@
1
- export { InternalMediaCenterDataProvider } from './internal-media-center-data-provider.svelte';
@@ -1,8 +0,0 @@
1
- import type { IMediaCenterDataProvider } from './types';
2
- export declare class InternalMediaCenterDataProvider implements IMediaCenterDataProvider {
3
- private readonly mediaPageId;
4
- private graphql;
5
- constructor(mediaPageId: string, graphqlOrigin?: string);
6
- getConfig: IMediaCenterDataProvider['getConfig'];
7
- getShortVideosCursor: IMediaCenterDataProvider['getShortVideosCursor'];
8
- }
@@ -1,46 +0,0 @@
1
- import { PostType, Status } from '../../core/enums';
2
- import { createLocalGQLClient } from '../../core/graphql';
3
- import { mapToShortVideoPlayerModel } from '../../short-videos/short-videos-player/mapper';
4
- import { GetMediaPageConfigDocument, GetShortVideosDocument } from './operations.generated';
5
- export class InternalMediaCenterDataProvider {
6
- mediaPageId;
7
- graphql;
8
- constructor(mediaPageId, graphqlOrigin) {
9
- this.mediaPageId = mediaPageId;
10
- this.graphql = createLocalGQLClient(graphqlOrigin);
11
- }
12
- getConfig = async () => {
13
- const payload = await this.graphql.query(GetMediaPageConfigDocument, { mediaPageId: this.mediaPageId }).toPromise();
14
- if (!payload.data?.embedMediaPagePlayerSettings) {
15
- return null;
16
- }
17
- const settings = payload.data.embedMediaPagePlayerSettings;
18
- return {
19
- logo: settings.logo?.url || null,
20
- postCategories: settings.postCategories.map((c) => ({ id: c.id, name: c.name })),
21
- streamCategories: settings.streamCategories.map((c) => ({ id: c.id, name: c.name }))
22
- };
23
- };
24
- getShortVideosCursor = async ({ filter, limit, continuationToken }) => {
25
- const payload = await this.graphql
26
- .query(GetShortVideosDocument, {
27
- input: {
28
- filter: {
29
- mediaPageId: this.mediaPageId,
30
- types: [PostType.ShortVideo],
31
- statuses: [Status.Published],
32
- categoryId: filter.categoryId,
33
- excludeIds: filter.excludeIds
34
- },
35
- limit,
36
- continuationToken
37
- }
38
- })
39
- .toPromise();
40
- const posts = payload.data?.shortVideos?.items || [];
41
- return {
42
- items: posts.map(mapToShortVideoPlayerModel),
43
- continuationToken: payload.data?.shortVideos?.continuationToken || null
44
- };
45
- };
46
- }
@@ -1,24 +0,0 @@
1
- import type { ShortVideoPlayerModel } from '../../short-videos/short-videos-player/types';
2
- export interface IMediaCenterDataProvider {
3
- getConfig: () => Promise<MediaCenterConfig | null>;
4
- getShortVideosCursor: (input: {
5
- filter: {
6
- categoryId?: string;
7
- excludeIds?: string[];
8
- };
9
- limit: number;
10
- continuationToken?: string | null;
11
- }) => Promise<{
12
- items: ShortVideoPlayerModel[];
13
- continuationToken: string | null;
14
- }>;
15
- }
16
- export type MediaCenterConfig = {
17
- logo: string | null;
18
- postCategories: MediaCenterCategoryModel[];
19
- streamCategories: MediaCenterCategoryModel[];
20
- };
21
- export type MediaCenterCategoryModel = {
22
- id: string;
23
- name: string;
24
- };