@streamscloud/embeddable 6.5.2 → 7.0.0-1758321891466

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 +106 -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,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.2",
3
+ "version": "7.0.0-1758321891466",
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
- };