@streamscloud/embeddable 16.0.6 → 16.0.7-1772032565273

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 (105) hide show
  1. package/dist/ads/ad-card/types.d.ts +1 -1
  2. package/dist/ads/ad-card/types.js +1 -1
  3. package/dist/articles/article/article-layout.svelte +32 -0
  4. package/dist/articles/article/article-layout.svelte.d.ts +9 -0
  5. package/dist/articles/article/article-section.svelte +52 -0
  6. package/dist/articles/article/article-section.svelte.d.ts +9 -0
  7. package/dist/articles/article/cmp.article.svelte +31 -0
  8. package/dist/articles/article/cmp.article.svelte.d.ts +8 -0
  9. package/dist/articles/article/facts-container.svelte +27 -0
  10. package/dist/articles/article/facts-container.svelte.d.ts +7 -0
  11. package/dist/articles/article/fields/alt-text.svelte +15 -0
  12. package/dist/articles/article/fields/alt-text.svelte.d.ts +6 -0
  13. package/dist/articles/article/fields/article-field.svelte +45 -0
  14. package/dist/articles/article/fields/article-field.svelte.d.ts +8 -0
  15. package/dist/articles/article/fields/byline-field.svelte +23 -0
  16. package/dist/articles/article/fields/byline-field.svelte.d.ts +8 -0
  17. package/dist/articles/article/fields/image-field.svelte +8 -0
  18. package/dist/articles/article/fields/image-field.svelte.d.ts +7 -0
  19. package/dist/articles/article/fields/media-field.svelte +8 -0
  20. package/dist/articles/article/fields/media-field.svelte.d.ts +7 -0
  21. package/dist/articles/article/fields/media-gallery-field.svelte +8 -0
  22. package/dist/articles/article/fields/media-gallery-field.svelte.d.ts +7 -0
  23. package/dist/articles/article/fields/rich-text-field.svelte +19 -0
  24. package/dist/articles/article/fields/rich-text-field.svelte.d.ts +7 -0
  25. package/dist/articles/article/fields/text-field.svelte +24 -0
  26. package/dist/articles/article/fields/text-field.svelte.d.ts +7 -0
  27. package/dist/articles/article/fields/types.d.ts +62 -0
  28. package/dist/articles/article/fields/types.js +1 -0
  29. package/dist/articles/article/fields/video-field.svelte +8 -0
  30. package/dist/articles/article/fields/video-field.svelte.d.ts +7 -0
  31. package/dist/articles/article/helpers.d.ts +5 -0
  32. package/dist/articles/article/helpers.js +27 -0
  33. package/dist/articles/article/index.d.ts +4 -0
  34. package/dist/articles/article/index.js +2 -0
  35. package/dist/articles/article/styles-transformer.d.ts +19 -0
  36. package/dist/articles/article/styles-transformer.js +36 -0
  37. package/dist/articles/article/types.d.ts +27 -0
  38. package/dist/articles/article/types.js +1 -0
  39. package/dist/articles/article-viewer/article-viewer-host-settings.svelte.d.ts +14 -0
  40. package/dist/articles/article-viewer/article-viewer-host-settings.svelte.js +11 -0
  41. package/dist/articles/article-viewer/article-viewer-proxy.svelte +9 -0
  42. package/dist/articles/article-viewer/article-viewer-proxy.svelte.d.ts +10 -0
  43. package/dist/articles/article-viewer/article-viewer-view.svelte +85 -0
  44. package/dist/articles/article-viewer/article-viewer-view.svelte.d.ts +9 -0
  45. package/dist/articles/article-viewer/cmp.article-viewer.svelte +34 -0
  46. package/dist/articles/article-viewer/cmp.article-viewer.svelte.d.ts +12 -0
  47. package/dist/articles/article-viewer/index.d.ts +43 -0
  48. package/dist/articles/article-viewer/index.js +60 -0
  49. package/dist/articles/article-viewer/types.d.ts +12 -0
  50. package/dist/articles/article-viewer/types.js +1 -0
  51. package/dist/core/enums.d.ts +15 -50
  52. package/dist/core/enums.js +1 -61
  53. package/dist/core/media/media-item-url.service.d.ts +1 -1
  54. package/dist/core/media/media-item-url.service.js +1 -3
  55. package/dist/core/media/types.d.ts +1 -1
  56. package/dist/external-api/data-providers/internal-media-center-data-provider.svelte.js +2 -3
  57. package/dist/external-api/data-providers/internal-short-video-player-items-provider.d.ts +1 -1
  58. package/dist/external-api/data-providers/internal-short-video-player-items-provider.js +1 -3
  59. package/dist/external-api/data-providers/mapper.d.ts +1 -1
  60. package/dist/external-api/data-providers/mapper.js +5 -6
  61. package/dist/external-api/data-providers/mocks/mock-content-management-handler.svelte.js +2 -3
  62. package/dist/external-api/data-providers/post-data-loaders/posts-loader.d.ts +1 -1
  63. package/dist/external-api/data-providers/post-data-loaders/posts-loader.js +0 -1
  64. package/dist/external-api/data-providers/stream-data-loaders/mapper.js +1 -2
  65. package/dist/external-api/data-providers/stream-data-loaders/stream-pages-loader.d.ts +1 -1
  66. package/dist/external-api/data-providers/stream-data-loaders/stream-pages-loader.js +1 -2
  67. package/dist/external-api/data-providers/stream-data-loaders/streams-loader.d.ts +1 -1
  68. package/dist/external-api/data-providers/stream-data-loaders/streams-loader.js +1 -2
  69. package/dist/media-center/config/types.d.ts +1 -1
  70. package/dist/media-center/config/types.js +1 -1
  71. package/dist/media-center/media-center/discover/data-loading.js +1 -2
  72. package/dist/media-center/media-center/discover/discover-view-handler.svelte.js +1 -2
  73. package/dist/media-center/media-center/moments/moments-feed-handler.svelte.d.ts +1 -1
  74. package/dist/media-center/media-center/moments/moments-feed-handler.svelte.js +2 -3
  75. package/dist/media-center/media-center/moments/moments-state.svelte.d.ts +1 -1
  76. package/dist/media-center/media-center/moments/moments-state.svelte.js +1 -3
  77. package/dist/media-center/media-center/posts-feed/feed-providers-generator.js +1 -2
  78. package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.d.ts +1 -1
  79. package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.js +1 -2
  80. package/dist/posts/attachments/cmp.attachments.svelte +2 -3
  81. package/dist/posts/model/post-model.d.ts +1 -1
  82. package/dist/posts/model/post-model.js +0 -1
  83. package/dist/posts/post-viewer/attachments-horizontal.svelte +1 -2
  84. package/dist/posts/post-viewer/cmp.post-viewer.svelte +2 -3
  85. package/dist/posts/post-viewer/mapper.js +6 -7
  86. package/dist/posts/posts-player/cmp.posts-player.svelte +7 -2
  87. package/dist/posts/posts-player/posts-player-host-settings.svelte.d.ts +20 -0
  88. package/dist/posts/posts-player/posts-player-host-settings.svelte.js +15 -0
  89. package/dist/posts/posts-player/posts-player-view.svelte +6 -7
  90. package/dist/products/price-helper.d.ts +1 -1
  91. package/dist/products/price-helper.js +3 -4
  92. package/dist/streams/layout/models/mapper.d.ts +1 -1
  93. package/dist/streams/layout/models/mapper.js +2 -6
  94. package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +1 -1
  95. package/dist/streams/layout/models/stream-layout-media-item-model.js +1 -1
  96. package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +1 -1
  97. package/dist/streams/layout/models/stream-layout-short-video-model.js +1 -1
  98. package/dist/streams/streams-player/cmp.streams-player.svelte +7 -2
  99. package/dist/streams/streams-player/streams-player-host-settings.svelte.d.ts +20 -0
  100. package/dist/streams/streams-player/streams-player-host-settings.svelte.js +15 -0
  101. package/dist/ui/media-item-view/cmp.media-item-view.svelte +3 -4
  102. package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +1 -1
  103. package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +5 -6
  104. package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +1 -1
  105. package/package.json +12 -3
@@ -0,0 +1,14 @@
1
+ import type { ThemeValue } from '../../core/theme';
2
+ import type { AppLocaleValue } from '@streamscloud/kit/core/locale';
3
+ export declare class ArticleViewerHostSettings {
4
+ locale: AppLocaleValue | undefined;
5
+ theme: ThemeValue | undefined;
6
+ constructor(init: {
7
+ locale?: AppLocaleValue;
8
+ theme?: ThemeValue;
9
+ } | undefined);
10
+ update: (data: {
11
+ locale?: AppLocaleValue;
12
+ theme?: ThemeValue;
13
+ } | undefined) => void;
14
+ }
@@ -0,0 +1,11 @@
1
+ export class ArticleViewerHostSettings {
2
+ locale = $state();
3
+ theme = $state();
4
+ constructor(init) {
5
+ this.update(init);
6
+ }
7
+ update = (data) => {
8
+ this.locale = data?.locale;
9
+ this.theme = data?.theme;
10
+ };
11
+ }
@@ -0,0 +1,9 @@
1
+ <script lang="ts">import {} from '../../ui/player/close-orchestrator';
2
+ import { ShadowRoot } from '../../ui/shadow-dom';
3
+ import ArticleViewerView from './article-viewer-view.svelte';
4
+ let { data, closeOrchestrator, viewerSettings } = $props();
5
+ </script>
6
+
7
+ <ShadowRoot locale={viewerSettings?.locale} theme={viewerSettings?.theme ?? 'light'} backgroundDisabled={true} backgroundImageUrl="not-applicable">
8
+ <ArticleViewerView data={data} closeOrchestrator={closeOrchestrator} />
9
+ </ShadowRoot>
@@ -0,0 +1,10 @@
1
+ import { type ICloseOrchestrator } from '../../ui/player/close-orchestrator';
2
+ import type { ArticleViewerModel, ArticleViewerSettings } from './types';
3
+ type Props = {
4
+ data: ArticleViewerModel;
5
+ closeOrchestrator: ICloseOrchestrator;
6
+ viewerSettings?: ArticleViewerSettings;
7
+ };
8
+ declare const ArticleViewerProxy: import("svelte").Component<Props, {}, "">;
9
+ type ArticleViewerProxy = ReturnType<typeof ArticleViewerProxy>;
10
+ export default ArticleViewerProxy;
@@ -0,0 +1,85 @@
1
+ <script lang="ts">import { Article } from '../article';
2
+ import {} from '../../ui/player/close-orchestrator';
3
+ let { data, closeOrchestrator } = $props();
4
+ const handleCloseClick = () => {
5
+ closeOrchestrator.requestClose();
6
+ };
7
+ const handleKeydown = (event) => {
8
+ if (event.key === 'Escape' && closeOrchestrator.closeTriggerVisible) {
9
+ closeOrchestrator.requestClose();
10
+ }
11
+ };
12
+ </script>
13
+
14
+ <svelte:window onkeydown={handleKeydown} />
15
+
16
+ <div class="article-viewer">
17
+ {#if closeOrchestrator.closeTriggerVisible}
18
+ <button type="button" class="article-viewer__close" aria-label="Close" onclick={handleCloseClick}>
19
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
20
+ <path
21
+ d="M4.397 4.554l.073-.084a.75.75 0 01.976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 111.06 1.061L13.061 12l6.47 6.47a.75.75 0 01.072.976l-.073.084a.75.75 0 01-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 01-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 01-.072-.976l.073-.084-.073.084z"
22
+ ></path>
23
+ </svg>
24
+ </button>
25
+ {/if}
26
+ <div class="article-viewer__content">
27
+ <Article sections={data.sections} metadata={data.metadata} />
28
+ </div>
29
+ </div>
30
+
31
+ <style>.article-viewer {
32
+ width: 100%;
33
+ min-width: 100%;
34
+ max-width: 100%;
35
+ height: 100%;
36
+ min-height: 100%;
37
+ max-height: 100%;
38
+ position: relative;
39
+ display: flex;
40
+ flex-direction: column;
41
+ }
42
+ .article-viewer__close {
43
+ position: absolute;
44
+ top: 0.75rem;
45
+ right: 0.75rem;
46
+ z-index: 10;
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
50
+ width: 2.25rem;
51
+ height: 2.25rem;
52
+ border-radius: 50%;
53
+ border: none;
54
+ background: rgba(0, 0, 0, 0.4);
55
+ color: white;
56
+ cursor: pointer;
57
+ padding: 0;
58
+ }
59
+ .article-viewer__close:hover {
60
+ background: rgba(0, 0, 0, 0.6);
61
+ }
62
+ .article-viewer__content {
63
+ flex: 1;
64
+ overflow-y: auto;
65
+ --_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #7d7d7d);
66
+ --_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
67
+ }
68
+ .article-viewer__content::-webkit-scrollbar {
69
+ width: 6px;
70
+ height: 6px;
71
+ }
72
+ .article-viewer__content::-webkit-scrollbar-track {
73
+ background: var(--_cross-browser-scrollbar--track-color);
74
+ border-radius: 100vw;
75
+ }
76
+ .article-viewer__content::-webkit-scrollbar-thumb {
77
+ background: var(--_cross-browser-scrollbar--thumb-color);
78
+ border-radius: 100vw;
79
+ }
80
+ @supports (scrollbar-color: transparent transparent) {
81
+ .article-viewer__content {
82
+ scrollbar-color: var(--_cross-browser-scrollbar--thumb-color) var(--_cross-browser-scrollbar--track-color);
83
+ scrollbar-width: thin;
84
+ }
85
+ }</style>
@@ -0,0 +1,9 @@
1
+ import { type ICloseOrchestrator } from '../../ui/player/close-orchestrator';
2
+ import type { ArticleViewerModel } from './types';
3
+ type Props = {
4
+ data: ArticleViewerModel;
5
+ closeOrchestrator: ICloseOrchestrator;
6
+ };
7
+ declare const ArticleViewerView: import("svelte").Component<Props, {}, "">;
8
+ type ArticleViewerView = ReturnType<typeof ArticleViewerView>;
9
+ export default ArticleViewerView;
@@ -0,0 +1,34 @@
1
+ <script lang="ts">import { CloseOrchestrator } from '../../ui/player/close-orchestrator';
2
+ import { createShadowRoot } from '../../ui/shadow-dom';
3
+ import { ArticleViewerHostSettings } from './article-viewer-host-settings.svelte';
4
+ import ArticleViewerProxy from './article-viewer-proxy.svelte';
5
+ import { mount, unmount, untrack } from 'svelte';
6
+ let { data, viewerSettings } = $props();
7
+ const settingsHolder = untrack(() => new ArticleViewerHostSettings(viewerSettings));
8
+ $effect(() => {
9
+ settingsHolder.update(viewerSettings);
10
+ });
11
+ const initHost = (node) => {
12
+ const shadowRoot = createShadowRoot(node);
13
+ const mounted = mount(ArticleViewerProxy, {
14
+ target: shadowRoot,
15
+ props: {
16
+ data,
17
+ viewerSettings: settingsHolder,
18
+ closeOrchestrator: new CloseOrchestrator({
19
+ closeFn: async () => {
20
+ await unmount(mounted);
21
+ },
22
+ canClose: false
23
+ })
24
+ }
25
+ });
26
+ return {
27
+ destroy: () => {
28
+ unmount(mounted);
29
+ }
30
+ };
31
+ };
32
+ </script>
33
+
34
+ <div class="article-viewer-host" use:initHost></div>
@@ -0,0 +1,12 @@
1
+ import type { ArticleViewerModel } from './types';
2
+ import type { AppLocaleValue } from '@streamscloud/kit/core/locale';
3
+ type Props = {
4
+ data: ArticleViewerModel;
5
+ viewerSettings?: {
6
+ locale?: AppLocaleValue;
7
+ theme?: 'light' | 'dark';
8
+ };
9
+ };
10
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
11
+ type Cmp = ReturnType<typeof Cmp>;
12
+ export default Cmp;
@@ -0,0 +1,43 @@
1
+ import type { ArticleViewerModel, ArticleViewerSettings } from './types';
2
+ export { default as ArticleViewer } from './cmp.article-viewer.svelte';
3
+ export type { ArticleViewerModel, ArticleViewerSettings } from './types';
4
+ /**
5
+ * Opens the article viewer as a full-screen modal.
6
+ *
7
+ * @param init Configuration options for the article viewer.
8
+ *
9
+ * @param {ArticleViewerModel} init.data
10
+ * Article data containing sections and metadata.
11
+ *
12
+ * @param {ArticleViewerSettings} [init.viewerSettings]
13
+ * Viewer UI settings.
14
+ * - {'en'|'no'} [locale='en'] — Localization for the viewer UI.
15
+ * - {'light'|'dark'} [theme='light'] — Theme for the viewer UI.
16
+ * - {boolean} [hideCloseButton] — If true, hides the close button.
17
+ *
18
+ * @param {{ closed?: () => void }} [init.on]
19
+ * Optional event handlers.
20
+ * @param {() => void} [init.on.closed]
21
+ * Called after the viewer is fully closed.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { openArticleViewer } from '@streamscloud/embeddable/article-viewer';
26
+ *
27
+ * openArticleViewer({
28
+ * data: {
29
+ * sections: articleSections,
30
+ * metadata: { displayDate: '2026-02-25' }
31
+ * },
32
+ * viewerSettings: { locale: 'en', theme: 'light' },
33
+ * on: { closed: () => console.log('Viewer closed') }
34
+ * });
35
+ * ```
36
+ */
37
+ export declare const openArticleViewer: (init: {
38
+ data: ArticleViewerModel;
39
+ viewerSettings?: ArticleViewerSettings;
40
+ on?: {
41
+ closed?: () => void;
42
+ };
43
+ }) => void;
@@ -0,0 +1,60 @@
1
+ import { CloseOrchestrator } from '../../ui/player/close-orchestrator';
2
+ import { ModalShadowHost } from '../../ui/shadow-dom';
3
+ import ArticleViewerProxy from './article-viewer-proxy.svelte';
4
+ import { mount, unmount } from 'svelte';
5
+ export { default as ArticleViewer } from './cmp.article-viewer.svelte';
6
+ /**
7
+ * Opens the article viewer as a full-screen modal.
8
+ *
9
+ * @param init Configuration options for the article viewer.
10
+ *
11
+ * @param {ArticleViewerModel} init.data
12
+ * Article data containing sections and metadata.
13
+ *
14
+ * @param {ArticleViewerSettings} [init.viewerSettings]
15
+ * Viewer UI settings.
16
+ * - {'en'|'no'} [locale='en'] — Localization for the viewer UI.
17
+ * - {'light'|'dark'} [theme='light'] — Theme for the viewer UI.
18
+ * - {boolean} [hideCloseButton] — If true, hides the close button.
19
+ *
20
+ * @param {{ closed?: () => void }} [init.on]
21
+ * Optional event handlers.
22
+ * @param {() => void} [init.on.closed]
23
+ * Called after the viewer is fully closed.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { openArticleViewer } from '@streamscloud/embeddable/article-viewer';
28
+ *
29
+ * openArticleViewer({
30
+ * data: {
31
+ * sections: articleSections,
32
+ * metadata: { displayDate: '2026-02-25' }
33
+ * },
34
+ * viewerSettings: { locale: 'en', theme: 'light' },
35
+ * on: { closed: () => console.log('Viewer closed') }
36
+ * });
37
+ * ```
38
+ */
39
+ export const openArticleViewer = (init) => {
40
+ const { data, viewerSettings, on } = init;
41
+ const shadowHost = new ModalShadowHost();
42
+ let mounted = null;
43
+ const closeOrchestrator = new CloseOrchestrator({
44
+ closeFn: async () => {
45
+ await unmount(mounted);
46
+ shadowHost.remove();
47
+ on?.closed?.();
48
+ },
49
+ canClose: !viewerSettings?.hideCloseButton
50
+ });
51
+ mounted = mount(ArticleViewerProxy, {
52
+ target: shadowHost.shadowRoot,
53
+ props: {
54
+ data,
55
+ viewerSettings,
56
+ closeOrchestrator
57
+ }
58
+ });
59
+ shadowHost.attachToBody();
60
+ };
@@ -0,0 +1,12 @@
1
+ import type { ArticleMetadata, ArticleSectionModel } from '../article';
2
+ import type { ThemeValue } from '../../core/theme';
3
+ import type { AppLocaleValue } from '@streamscloud/kit/core/locale';
4
+ export type ArticleViewerModel = {
5
+ sections: ArticleSectionModel[];
6
+ metadata: ArticleMetadata;
7
+ };
8
+ export type ArticleViewerSettings = {
9
+ locale?: AppLocaleValue;
10
+ theme?: ThemeValue;
11
+ hideCloseButton?: boolean;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,50 +1,15 @@
1
- export declare enum PostSourceType {
2
- MediaPage = "MEDIA_PAGE",
3
- Organization = "ORGANIZATION",
4
- UserProfile = "USER_PROFILE"
5
- }
6
- export declare enum AdType {
7
- BannerResponsive = "BANNER_RESPONSIVE",
8
- MediaDialogPromotion = "MEDIA_DIALOG_PROMOTION",
9
- Story = "STORY"
10
- }
11
- export declare enum Currency {
12
- Eur = "EUR",
13
- Nok = "NOK",
14
- Usd = "USD"
15
- }
16
- export declare enum MediaType {
17
- Audio = "AUDIO",
18
- Image = "IMAGE",
19
- ShortVideo = "SHORT_VIDEO",
20
- Video = "VIDEO"
21
- }
22
- export declare enum MediaFormat {
23
- W4H3 = "W4H3",
24
- W16H9 = "W16H9"
25
- }
26
- export declare enum ImageScale {
27
- Big = "BIG",
28
- Medium = "MEDIUM",
29
- OriginalEncoded = "ORIGINAL_ENCODED",
30
- Small = "SMALL"
31
- }
32
- export declare enum ProfileType {
33
- Organization = "ORGANIZATION"
34
- }
35
- export declare enum PostType {
36
- Article = "ARTICLE",
37
- Media = "MEDIA",
38
- Moment = "MOMENT",
39
- ShortVideo = "SHORT_VIDEO",
40
- Video = "VIDEO"
41
- }
42
- export declare enum Status {
43
- Published = "PUBLISHED"
44
- }
45
- export declare enum StreamStatus {
46
- Published = "PUBLISHED"
47
- }
48
- export declare enum EmbedStreamsOrderBy {
49
- ContentUpdatedAt = "CONTENT_UPDATED_AT"
50
- }
1
+ export type PostSourceType = 'MEDIA_PAGE' | 'ORGANIZATION' | 'USER_PROFILE';
2
+ export type AdType = 'BANNER_RESPONSIVE' | 'MEDIA_DIALOG_PROMOTION' | 'STORY';
3
+ export type Currency = 'EUR' | 'NOK' | 'USD';
4
+ export type MediaType = 'AUDIO' | 'IMAGE' | 'SHORT_VIDEO' | 'VIDEO';
5
+ export type MediaFormat = 'W4H3' | 'W16H9';
6
+ export type ImageScale = 'BIG' | 'MEDIUM' | 'ORIGINAL_ENCODED' | 'SMALL';
7
+ export type ProfileType = 'ORGANIZATION';
8
+ export type PostType = 'ARTICLE' | 'MEDIA' | 'MOMENT' | 'SHORT_VIDEO' | 'VIDEO';
9
+ export type Status = 'PUBLISHED';
10
+ export type StreamStatus = 'PUBLISHED';
11
+ export type EmbedStreamsOrderBy = 'CONTENT_UPDATED_AT';
12
+ export type ArticleFieldType = 'BYLINE' | 'IMAGE' | 'MEDIA' | 'MEDIA_GALLERY' | 'RICH_TEXT' | 'TEXT' | 'VIDEO';
13
+ export type TextFieldMode = 'MULTILINE' | 'SINGLE_LINE';
14
+ export type TextFieldWeight = 'BOLD' | 'NORMAL' | 'SEMI_BOLD';
15
+ export type GalleryFieldMode = 'GALLERY' | 'SLIDER';
@@ -1,61 +1 @@
1
- export var PostSourceType;
2
- (function (PostSourceType) {
3
- PostSourceType["MediaPage"] = "MEDIA_PAGE";
4
- PostSourceType["Organization"] = "ORGANIZATION";
5
- PostSourceType["UserProfile"] = "USER_PROFILE";
6
- })(PostSourceType || (PostSourceType = {}));
7
- export var AdType;
8
- (function (AdType) {
9
- AdType["BannerResponsive"] = "BANNER_RESPONSIVE";
10
- AdType["MediaDialogPromotion"] = "MEDIA_DIALOG_PROMOTION";
11
- AdType["Story"] = "STORY";
12
- })(AdType || (AdType = {}));
13
- export var Currency;
14
- (function (Currency) {
15
- Currency["Eur"] = "EUR";
16
- Currency["Nok"] = "NOK";
17
- Currency["Usd"] = "USD";
18
- })(Currency || (Currency = {}));
19
- export var MediaType;
20
- (function (MediaType) {
21
- MediaType["Audio"] = "AUDIO";
22
- MediaType["Image"] = "IMAGE";
23
- MediaType["ShortVideo"] = "SHORT_VIDEO";
24
- MediaType["Video"] = "VIDEO";
25
- })(MediaType || (MediaType = {}));
26
- export var MediaFormat;
27
- (function (MediaFormat) {
28
- MediaFormat["W4H3"] = "W4H3";
29
- MediaFormat["W16H9"] = "W16H9";
30
- })(MediaFormat || (MediaFormat = {}));
31
- export var ImageScale;
32
- (function (ImageScale) {
33
- ImageScale["Big"] = "BIG";
34
- ImageScale["Medium"] = "MEDIUM";
35
- ImageScale["OriginalEncoded"] = "ORIGINAL_ENCODED";
36
- ImageScale["Small"] = "SMALL";
37
- })(ImageScale || (ImageScale = {}));
38
- export var ProfileType;
39
- (function (ProfileType) {
40
- ProfileType["Organization"] = "ORGANIZATION";
41
- })(ProfileType || (ProfileType = {}));
42
- export var PostType;
43
- (function (PostType) {
44
- PostType["Article"] = "ARTICLE";
45
- PostType["Media"] = "MEDIA";
46
- PostType["Moment"] = "MOMENT";
47
- PostType["ShortVideo"] = "SHORT_VIDEO";
48
- PostType["Video"] = "VIDEO";
49
- })(PostType || (PostType = {}));
50
- export var Status;
51
- (function (Status) {
52
- Status["Published"] = "PUBLISHED";
53
- })(Status || (Status = {}));
54
- export var StreamStatus;
55
- (function (StreamStatus) {
56
- StreamStatus["Published"] = "PUBLISHED";
57
- })(StreamStatus || (StreamStatus = {}));
58
- export var EmbedStreamsOrderBy;
59
- (function (EmbedStreamsOrderBy) {
60
- EmbedStreamsOrderBy["ContentUpdatedAt"] = "CONTENT_UPDATED_AT";
61
- })(EmbedStreamsOrderBy || (EmbedStreamsOrderBy = {}));
1
+ export {};
@@ -1,2 +1,2 @@
1
- import { type MediaItemModel } from './types';
1
+ import type { MediaItemModel } from './types';
2
2
  export declare const getMediaItemImageUrl: (media: MediaItemModel) => string;
@@ -1,3 +1 @@
1
- import { MediaType } from '../enums';
2
- import {} from './types';
3
- export const getMediaItemImageUrl = (media) => (media.type === MediaType.Image ? media.url : media.thumbnailUrl);
1
+ export const getMediaItemImageUrl = (media) => (media.type === 'IMAGE' ? media.url : (media.thumbnailUrl ?? ''));
@@ -2,7 +2,7 @@ import type { MediaType } from '../enums';
2
2
  export type MediaItemModel = {
3
3
  type: MediaType;
4
4
  url: string;
5
- thumbnailUrl: string | null;
5
+ thumbnailUrl?: string | null;
6
6
  };
7
7
  export type MediaItemMetadataModel = {
8
8
  width: number;
@@ -1,4 +1,3 @@
1
- import { Status, StreamStatus } from '../../core/enums';
2
1
  import { createLocalGQLClient } from '../../core/graphql';
3
2
  import { InternalMediaCenterAnalyticsHandler } from './internal-media-center-analytics-handler';
4
3
  import { MockCategoryFollowingProvider, MockMediaCenterContentManagementHandler, MockMembershipHandler, MockNavigationHandler, MockPostSocialInteractionsHandler } from './mocks';
@@ -49,7 +48,7 @@ export class InternalMediaCenterDataProvider {
49
48
  filter: {
50
49
  mediaPageId,
51
50
  types: filter.types,
52
- statuses: [Status.Published],
51
+ statuses: ['PUBLISHED'],
53
52
  categoryId: filter.categoryId,
54
53
  ids: filter.ids,
55
54
  excludeIds: filter.excludeIds
@@ -68,7 +67,7 @@ export class InternalMediaCenterDataProvider {
68
67
  categoryId: filter.categoryId,
69
68
  ids: filter.ids,
70
69
  excludeIds: filter.excludeIds,
71
- statuses: [StreamStatus.Published],
70
+ statuses: ['PUBLISHED'],
72
71
  showInFeed: true
73
72
  },
74
73
  limit,
@@ -1,4 +1,4 @@
1
- import { type PostPlayerModel } from '../../posts/posts-player';
1
+ import type { PostPlayerModel } from '../../posts/posts-player';
2
2
  import type { IFeedPlayerDataProvider } from '@streamscloud/kit/ui/player/providers';
3
3
  export declare class InternalShortVideoPlayerItemsProvider implements IFeedPlayerDataProvider<PostPlayerModel> {
4
4
  readonly kind = "feed";
@@ -1,6 +1,4 @@
1
- import { PostType } from '../..';
2
1
  import { createLocalGQLClient } from '../../core/graphql';
3
- import {} from '../../posts/posts-player';
4
2
  import { getPostsCursor } from './post-data-loaders';
5
3
  import { ContinuationToken } from '@streamscloud/kit/core';
6
4
  import { CursorDataLoader } from '@streamscloud/kit/core/data-loaders';
@@ -18,7 +16,7 @@ export class InternalShortVideoPlayerItemsProvider {
18
16
  const idsChunk = this.ids.slice(startIdIndex, endIdIndex);
19
17
  try {
20
18
  const posts = await getPostsCursor({
21
- filter: { ids: idsChunk, types: [PostType.ShortVideo] },
19
+ filter: { ids: idsChunk, types: ['SHORT_VIDEO'] },
22
20
  limit: idsChunk.length,
23
21
  graphql: this.graphql
24
22
  });
@@ -1,3 +1,3 @@
1
- import { PostType } from '../../core/enums';
1
+ import type { PostType } from '../../core/enums';
2
2
  import { EntityType } from '@streamscloud/streams-analytics-collector';
3
3
  export declare function mapPostTypeToEntityType(postType: PostType): EntityType;
@@ -1,16 +1,15 @@
1
- import { PostType } from '../../core/enums';
2
1
  import { EntityType } from '@streamscloud/streams-analytics-collector';
3
2
  export function mapPostTypeToEntityType(postType) {
4
3
  switch (postType) {
5
- case PostType.Article:
4
+ case 'ARTICLE':
6
5
  return EntityType.Article;
7
- case PostType.Media:
6
+ case 'MEDIA':
8
7
  return EntityType.Media;
9
- case PostType.Moment:
8
+ case 'MOMENT':
10
9
  return EntityType.Moment;
11
- case PostType.ShortVideo:
10
+ case 'SHORT_VIDEO':
12
11
  return EntityType.ShortVideo;
13
- case PostType.Video:
12
+ case 'VIDEO':
14
13
  return EntityType.Video;
15
14
  default:
16
15
  throw new Error(`Unknown PostType: ${postType}`);
@@ -1,4 +1,3 @@
1
- import { Status, StreamStatus } from '../../../core/enums';
2
1
  import { mapToStreamPlayerModel } from '../stream-data-loaders/mapper';
3
2
  import { GetPostDocument, GetStreamDocument } from './operations.generated';
4
3
  import { mapToPostPlayerModel } from '../post-data-loaders/mapper';
@@ -43,7 +42,7 @@ export class MockMediaCenterContentManagementHandler {
43
42
  return {
44
43
  post: mapToPostPlayerModel(post),
45
44
  categories: post.categoryIds,
46
- isPublished: post.status === Status.Published
45
+ isPublished: post.status === 'PUBLISHED'
47
46
  };
48
47
  };
49
48
  _getUpdatedStream = async (id) => {
@@ -55,7 +54,7 @@ export class MockMediaCenterContentManagementHandler {
55
54
  return {
56
55
  stream: mapToStreamPlayerModel(stream),
57
56
  categories: stream.categoryIds,
58
- isPublished: stream.status === StreamStatus.Published
57
+ isPublished: stream.status === 'PUBLISHED'
59
58
  };
60
59
  };
61
60
  }
@@ -1,4 +1,4 @@
1
- import { PostType, Status } from '../../../core/enums';
1
+ import type { PostType, Status } from '../../../core/enums';
2
2
  import type { PostPlayerModel } from '../../../posts/posts-player/types';
3
3
  import type { Client } from '@urql/core';
4
4
  export declare const getPostsCursor: (input: {
@@ -1,4 +1,3 @@
1
- import { PostType, Status } from '../../../core/enums';
2
1
  import { mapToPostPlayerModel } from './mapper';
3
2
  import { GetPostsDocument } from './operations.generated';
4
3
  export const getPostsCursor = async (input) => {
@@ -1,4 +1,3 @@
1
- import { ProfileType } from '../../../core/enums';
2
1
  export const mapToStreamPlayerModel = (payload) => {
3
2
  return {
4
3
  id: payload.id,
@@ -7,7 +6,7 @@ export const mapToStreamPlayerModel = (payload) => {
7
6
  cover: payload.cover?.url || null,
8
7
  createdAt: payload.createdAt,
9
8
  publishedAt: payload.publishedAt,
10
- organizationId: payload.ownerProfile.type === ProfileType.Organization ? payload.ownerProfile.id : null,
9
+ organizationId: payload.ownerProfile.type === 'ORGANIZATION' ? payload.ownerProfile.id : null,
11
10
  pagesCount: payload.pagesCount
12
11
  };
13
12
  };
@@ -1,4 +1,4 @@
1
- import { type StreamPageViewerModel } from '../../../streams/stream-page-viewer';
1
+ import type { StreamPageViewerModel } from '../../../streams/stream-page-viewer';
2
2
  import type { Client } from '@urql/core';
3
3
  export declare const getStreamPagesCursor: (input: {
4
4
  streamId: string;
@@ -1,4 +1,3 @@
1
- import { ImageScale } from '../../..';
2
1
  import { mapToStreamPageViewerModel } from '../../../streams/stream-page-viewer';
3
2
  import { GetStreamPagesDocument } from './operations.generated';
4
3
  export const getStreamPagesCursor = async (input) => {
@@ -15,7 +14,7 @@ export const getStreamPagesCursor = async (input) => {
15
14
  continuationToken,
16
15
  filter: { streamId }
17
16
  },
18
- image_scale: ImageScale.OriginalEncoded
17
+ image_scale: 'ORIGINAL_ENCODED'
19
18
  })
20
19
  .toPromise();
21
20
  const data = payload.data?.streamPages;
@@ -1,4 +1,4 @@
1
- import { StreamStatus } from '../../../core/enums';
1
+ import type { StreamStatus } from '../../../core/enums';
2
2
  import type { StreamPlayerModel } from '../../../streams/streams-player/types';
3
3
  import type { Client } from '@urql/core';
4
4
  export declare const getStreamsCursor: (input: {
@@ -1,4 +1,3 @@
1
- import { EmbedStreamsOrderBy, StreamStatus } from '../../../core/enums';
2
1
  import { mapToStreamPlayerModel } from './mapper';
3
2
  import { GetStreamsDocument } from './operations.generated';
4
3
  export const getStreamsCursor = async (input) => {
@@ -18,7 +17,7 @@ export const getStreamsCursor = async (input) => {
18
17
  limit,
19
18
  continuationToken,
20
19
  sorting: {
21
- orderBy: EmbedStreamsOrderBy.ContentUpdatedAt,
20
+ orderBy: 'CONTENT_UPDATED_AT',
22
21
  ascendingOrder: false
23
22
  }
24
23
  }
@@ -1,4 +1,4 @@
1
- import { PostType } from '../../core/enums';
1
+ import type { PostType } from '../../core/enums';
2
2
  import type { IContentCategoryFollowingHandler } from '../categories-following';
3
3
  import type { IMediaCenterContentManagementHandler } from '../content-management';
4
4
  import type { IMediaCenterMembershipHandler } from '../membership';
@@ -1 +1 @@
1
- import { PostType } from '../../core/enums';
1
+ export {};