@streamscloud/embeddable 16.0.7 → 16.1.0
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.
- package/dist/ads/ad-card/types.d.ts +1 -1
- package/dist/ads/ad-card/types.js +1 -1
- package/dist/articles/article/article-layout.svelte +32 -0
- package/dist/articles/article/article-layout.svelte.d.ts +9 -0
- package/dist/articles/article/article-proxy.svelte +8 -0
- package/dist/articles/article/article-proxy.svelte.d.ts +12 -0
- package/dist/articles/article/article-section.svelte +52 -0
- package/dist/articles/article/article-section.svelte.d.ts +9 -0
- package/dist/articles/article/article-view.svelte +38 -0
- package/dist/articles/article/article-view.svelte.d.ts +8 -0
- package/dist/articles/article/cmp.article.svelte +36 -0
- package/dist/articles/article/cmp.article.svelte.d.ts +12 -0
- package/dist/articles/article/cmp.facts-container.svelte +27 -0
- package/dist/articles/article/cmp.facts-container.svelte.d.ts +7 -0
- package/dist/articles/article/fields/alt-text.svelte +15 -0
- package/dist/articles/article/fields/alt-text.svelte.d.ts +6 -0
- package/dist/articles/article/fields/article-field.svelte +45 -0
- package/dist/articles/article/fields/article-field.svelte.d.ts +8 -0
- package/dist/articles/article/fields/byline-field.svelte +23 -0
- package/dist/articles/article/fields/byline-field.svelte.d.ts +8 -0
- package/dist/articles/article/fields/image-field.svelte +8 -0
- package/dist/articles/article/fields/image-field.svelte.d.ts +7 -0
- package/dist/articles/article/fields/media-field.svelte +8 -0
- package/dist/articles/article/fields/media-field.svelte.d.ts +7 -0
- package/dist/articles/article/fields/media-gallery-field.svelte +8 -0
- package/dist/articles/article/fields/media-gallery-field.svelte.d.ts +7 -0
- package/dist/articles/article/fields/rich-text-field.svelte +19 -0
- package/dist/articles/article/fields/rich-text-field.svelte.d.ts +7 -0
- package/dist/articles/article/fields/text-field.svelte +24 -0
- package/dist/articles/article/fields/text-field.svelte.d.ts +7 -0
- package/dist/articles/article/fields/types.d.ts +72 -0
- package/dist/articles/article/fields/types.js +1 -0
- package/dist/articles/article/fields/video-field.svelte +8 -0
- package/dist/articles/article/fields/video-field.svelte.d.ts +7 -0
- package/dist/articles/article/helpers.d.ts +5 -0
- package/dist/articles/article/helpers.js +27 -0
- package/dist/articles/article/index.d.ts +8 -0
- package/dist/articles/article/index.js +5 -0
- package/dist/articles/article/styles-transformer.d.ts +47 -0
- package/dist/articles/article/styles-transformer.js +38 -0
- package/dist/articles/article/types.d.ts +32 -0
- package/dist/articles/article/types.js +1 -0
- package/dist/articles/article-dialog/article-dialog-localization.d.ts +3 -0
- package/dist/articles/article-dialog/article-dialog-localization.js +9 -0
- package/dist/articles/article-dialog/cmp.article-dialog.svelte +103 -0
- package/dist/articles/article-dialog/cmp.article-dialog.svelte.d.ts +9 -0
- package/dist/articles/article-dialog/index.d.ts +6 -0
- package/dist/articles/article-dialog/index.js +10 -0
- package/dist/articles/article-dialog/types.d.ts +6 -0
- package/dist/articles/data-providers/index.d.ts +1 -0
- package/dist/articles/data-providers/index.js +1 -0
- package/dist/articles/data-providers/types.d.ts +14 -0
- package/dist/articles/data-providers/types.js +1 -0
- package/dist/core/enums.d.ts +15 -50
- package/dist/core/enums.js +1 -61
- package/dist/core/graphql.d.ts +4 -1
- package/dist/core/graphql.js +3 -3
- package/dist/core/media/index.d.ts +0 -1
- package/dist/core/media/index.js +0 -1
- package/dist/core/media/media-item-url.service.d.ts +6 -2
- package/dist/core/media/media-item-url.service.js +1 -3
- package/dist/external-api/article/cmp.embed-article.svelte +98 -0
- package/dist/external-api/article/cmp.embed-article.svelte.d.ts +47 -0
- package/dist/external-api/article/index.d.ts +1 -0
- package/dist/external-api/article/index.js +1 -0
- package/dist/external-api/data-providers/article/article-data-provider.d.ts +4 -0
- package/dist/external-api/data-providers/article/article-data-provider.js +32 -0
- package/dist/external-api/data-providers/article/index.d.ts +1 -0
- package/dist/external-api/data-providers/article/index.js +1 -0
- package/dist/external-api/data-providers/article/operations.generated.d.ts +104 -0
- package/dist/external-api/data-providers/article/operations.generated.js +262 -0
- package/dist/external-api/data-providers/article/operations.graphql +99 -0
- package/dist/external-api/data-providers/internal-media-center-data-provider.svelte.js +6 -5
- package/dist/external-api/data-providers/internal-short-video-player-items-provider.d.ts +1 -1
- package/dist/external-api/data-providers/internal-short-video-player-items-provider.js +2 -4
- package/dist/external-api/data-providers/internal-streams-player-data-provider.js +1 -1
- package/dist/external-api/data-providers/mapper.d.ts +1 -1
- package/dist/external-api/data-providers/mapper.js +5 -6
- package/dist/external-api/data-providers/mocks/mock-content-management-handler.svelte.js +2 -3
- package/dist/external-api/data-providers/post-data-loaders/posts-loader.d.ts +1 -1
- package/dist/external-api/data-providers/post-data-loaders/posts-loader.js +0 -1
- package/dist/external-api/data-providers/stream-data-loaders/mapper.js +1 -2
- package/dist/external-api/data-providers/stream-data-loaders/stream-pages-loader.d.ts +1 -1
- package/dist/external-api/data-providers/stream-data-loaders/stream-pages-loader.js +1 -2
- package/dist/external-api/data-providers/stream-data-loaders/streams-loader.d.ts +1 -1
- package/dist/external-api/data-providers/stream-data-loaders/streams-loader.js +1 -2
- package/dist/external-api/index.d.ts +2 -1
- package/dist/external-api/index.js +2 -1
- package/dist/media-center/config/types.d.ts +4 -1
- package/dist/media-center/config/types.js +1 -1
- package/dist/media-center/media-center/cmp.media-center-proxy.svelte +9 -4
- package/dist/media-center/media-center/cmp.media-center-proxy.svelte.d.ts +2 -3
- package/dist/media-center/media-center/discover/data-loading.js +1 -2
- package/dist/media-center/media-center/discover/discover-view-handler.svelte.js +1 -2
- package/dist/media-center/media-center/index.d.ts +0 -1
- package/dist/media-center/media-center/index.js +0 -1
- package/dist/media-center/media-center/media-center-settings.svelte.d.ts +1 -1
- package/dist/media-center/media-center/media-center-settings.svelte.js +2 -2
- package/dist/media-center/media-center/moments/moments-feed-handler.svelte.d.ts +1 -1
- package/dist/media-center/media-center/moments/moments-feed-handler.svelte.js +2 -3
- package/dist/media-center/media-center/moments/moments-state.svelte.d.ts +1 -1
- package/dist/media-center/media-center/moments/moments-state.svelte.js +1 -3
- package/dist/media-center/media-center/posts-feed/feed-providers-generator.js +1 -2
- package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.d.ts +1 -1
- package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.js +2 -2
- package/dist/media-page/cmp.media-page.svelte +10 -9
- package/dist/media-page/index.js +4 -4
- package/dist/posts/attachments/cmp.attachments.svelte +2 -3
- package/dist/posts/model/post-model.d.ts +2 -1
- package/dist/posts/model/post-model.js +2 -1
- package/dist/posts/post-viewer/attachments-horizontal.svelte +1 -2
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +12 -5
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +1 -0
- package/dist/posts/post-viewer/mapper.js +6 -7
- package/dist/posts/post-viewer/post-texts.svelte +8 -1
- package/dist/posts/post-viewer/post-texts.svelte.d.ts +3 -0
- package/dist/posts/posts-player/cmp.posts-player.svelte +23 -13
- package/dist/posts/posts-player/cmp.posts-player.svelte.d.ts +2 -0
- package/dist/posts/posts-player/index.d.ts +8 -1
- package/dist/posts/posts-player/index.js +7 -1
- package/dist/posts/posts-player/posts-player-proxy.svelte +3 -2
- package/dist/posts/posts-player/posts-player-proxy.svelte.d.ts +2 -0
- package/dist/posts/posts-player/posts-player-view.svelte +22 -9
- package/dist/posts/posts-player/types.d.ts +3 -0
- package/dist/products/price-helper.d.ts +1 -1
- package/dist/products/price-helper.js +3 -4
- package/dist/streams/layout/models/mapper.d.ts +1 -1
- package/dist/streams/layout/models/mapper.js +2 -6
- package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +1 -1
- package/dist/streams/layout/models/stream-layout-media-item-model.js +1 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +1 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.js +1 -1
- package/dist/streams/streams-player/cmp.streams-player.svelte +22 -13
- package/dist/streams/streams-player/streams-player-proxy.svelte +1 -1
- package/dist/ui/media-items/index.d.ts +3 -0
- package/dist/ui/media-items/index.js +3 -0
- package/dist/ui/{media-item-view → media-items/media-item-view}/cmp.media-item-view.svelte +23 -5
- package/dist/ui/{media-item-view → media-items/media-item-view}/cmp.media-item-view.svelte.d.ts +5 -3
- package/dist/ui/{media-items-gallery → media-items/media-items-gallery}/cmp.media-items-gallery.svelte +31 -31
- package/dist/ui/{media-items-gallery → media-items/media-items-gallery}/cmp.media-items-gallery.svelte.d.ts +5 -3
- package/dist/ui/{media-items-gallery/types.d.ts → media-items/media-items-gallery/gallery-layout.d.ts} +1 -1
- package/dist/ui/{media-items-gallery/types.js → media-items/media-items-gallery/gallery-layout.js} +1 -1
- package/dist/ui/media-items/types.d.ts +14 -0
- package/dist/ui/media-items/types.js +1 -0
- package/dist/ui/shadow-dom/cmp.shadow-root.svelte +3 -2
- package/dist/ui/shadow-dom/index.d.ts +1 -1
- package/dist/ui/shadow-dom/index.js +1 -1
- package/dist/ui/shadow-dom/shadow-root-service.d.ts +1 -0
- package/dist/ui/shadow-dom/shadow-root-service.js +8 -0
- package/package.json +11 -3
- package/dist/core/media/types.d.ts +0 -13
- package/dist/posts/posts-player/posts-player-host-settings.svelte.d.ts +0 -20
- package/dist/posts/posts-player/posts-player-host-settings.svelte.js +0 -15
- package/dist/streams/streams-player/streams-player-host-settings.svelte.d.ts +0 -20
- package/dist/streams/streams-player/streams-player-host-settings.svelte.js +0 -15
- /package/dist/{core/media → articles/article-dialog}/types.js +0 -0
- /package/dist/ui/{media-item-view → media-items/media-item-view}/index.d.ts +0 -0
- /package/dist/ui/{media-item-view → media-items/media-item-view}/index.js +0 -0
- /package/dist/ui/{media-items-gallery → media-items/media-items-gallery}/index.d.ts +0 -0
- /package/dist/ui/{media-items-gallery → media-items/media-items-gallery}/index.js +0 -0
|
@@ -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 ===
|
|
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 ===
|
|
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 { 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 ===
|
|
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 {
|
|
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:
|
|
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:
|
|
20
|
+
orderBy: 'CONTENT_UPDATED_AT',
|
|
22
21
|
ascendingOrder: false
|
|
23
22
|
}
|
|
24
23
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { Article, type ArticleSeoModel } from './article';
|
|
1
2
|
export { openMediaPageModal } from './media-page';
|
|
2
|
-
export { openStreamsPlayer } from './streams-player';
|
|
3
3
|
export { openShortVideosPlayer } from './short-videos-player';
|
|
4
|
+
export { openStreamsPlayer } from './streams-player';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ArticleDataProvider } from '../../articles/data-providers';
|
|
2
|
+
import type { PostType } from '../../core/enums';
|
|
2
3
|
import type { IContentCategoryFollowingHandler } from '../categories-following';
|
|
3
4
|
import type { IMediaCenterContentManagementHandler } from '../content-management';
|
|
4
5
|
import type { IMediaCenterMembershipHandler } from '../membership';
|
|
@@ -36,6 +37,8 @@ export interface IMediaCenterDataProvider {
|
|
|
36
37
|
items: PostPlayerModel[];
|
|
37
38
|
continuationToken: string | null;
|
|
38
39
|
}>;
|
|
40
|
+
/** Provider for fetching article content. Enables "Read more" button that opens an article dialog in posts player. */
|
|
41
|
+
fetchArticle?: ArticleDataProvider['fetchArticle'];
|
|
39
42
|
};
|
|
40
43
|
streamPlayer: {
|
|
41
44
|
getStreamsCursor: (input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
<script lang="ts">import {} from '../../ui/player/close-orchestrator';
|
|
2
2
|
import { ShadowRoot } from '../../ui/shadow-dom';
|
|
3
3
|
import { MediaCenterContext } from './media-center-context.svelte';
|
|
4
|
+
import { MediaCenterSettings } from './media-center-settings.svelte';
|
|
4
5
|
import { default as MediaCenterView } from './media-center-view.svelte';
|
|
5
6
|
import { Utils } from '@streamscloud/kit/core/utils';
|
|
6
7
|
import { Loading } from '@streamscloud/kit/ui/loading';
|
|
7
8
|
import { untrack } from 'svelte';
|
|
8
9
|
let { dataProvider, modeProps, settings, closeOrchestrator, dynamicActions } = $props();
|
|
10
|
+
const settingsHolder = untrack(() => new MediaCenterSettings(settings));
|
|
11
|
+
$effect(() => {
|
|
12
|
+
settingsHolder.update(settings);
|
|
13
|
+
});
|
|
9
14
|
const context = untrack(() => new MediaCenterContext({
|
|
10
15
|
dataProvider,
|
|
11
16
|
closeOrchestrator,
|
|
12
|
-
settings,
|
|
17
|
+
settings: settingsHolder,
|
|
13
18
|
on: {
|
|
14
19
|
initialized: (instance) => {
|
|
15
20
|
switch (modeProps.mode) {
|
|
@@ -26,8 +31,8 @@ const context = untrack(() => new MediaCenterContext({
|
|
|
26
31
|
});
|
|
27
32
|
break;
|
|
28
33
|
case 'default':
|
|
29
|
-
if (
|
|
30
|
-
instance.restoreState(
|
|
34
|
+
if (settingsHolder.state) {
|
|
35
|
+
instance.restoreState(settingsHolder.state);
|
|
31
36
|
}
|
|
32
37
|
else {
|
|
33
38
|
instance.activateDiscover({ categoryId: null });
|
|
@@ -50,7 +55,7 @@ const context = untrack(() => new MediaCenterContext({
|
|
|
50
55
|
{:else if !context.initialized}
|
|
51
56
|
Not initialized placeholder
|
|
52
57
|
{:else}
|
|
53
|
-
<ShadowRoot locale={
|
|
58
|
+
<ShadowRoot locale={settingsHolder.locale} theme={settingsHolder.theme} {...context.backgroundWrapperProps}>
|
|
54
59
|
<MediaCenterView context={context} dynamicActions={dynamicActions} />
|
|
55
60
|
</ShadowRoot>
|
|
56
61
|
{/if}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { IMediaCenterDataProvider } from '../config/types';
|
|
2
2
|
import { type ICloseOrchestrator } from '../../ui/player/close-orchestrator';
|
|
3
|
-
import type {
|
|
4
|
-
import type { MediaCenterModeProps } from './types';
|
|
3
|
+
import type { IMediaCenterSettings, MediaCenterModeProps } from './types';
|
|
5
4
|
import { type Snippet } from 'svelte';
|
|
6
5
|
type Props = {
|
|
7
6
|
dataProvider: IMediaCenterDataProvider;
|
|
8
|
-
settings
|
|
7
|
+
settings?: IMediaCenterSettings;
|
|
9
8
|
modeProps: MediaCenterModeProps;
|
|
10
9
|
closeOrchestrator: ICloseOrchestrator;
|
|
11
10
|
dynamicActions?: Snippet;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PostType } from '../../..';
|
|
2
1
|
import { StreamsInCategory, ShortVideosInCategory } from './types.svelte';
|
|
3
2
|
export class DiscoverDataLoader {
|
|
4
3
|
dataProvider;
|
|
@@ -30,7 +29,7 @@ export class DiscoverDataLoader {
|
|
|
30
29
|
const shortVideosResponse = await this.dataProvider.postsPlayer.getPostsCursor({
|
|
31
30
|
filter: {
|
|
32
31
|
categoryId: holder.categoryId,
|
|
33
|
-
types: [
|
|
32
|
+
types: ['SHORT_VIDEO']
|
|
34
33
|
},
|
|
35
34
|
limit: this.minItemsPerLoad,
|
|
36
35
|
continuationToken: holder.continuationToken
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PostType } from '../../../core/enums';
|
|
2
1
|
import { DiscoverDataLoader } from './data-loading';
|
|
3
2
|
import { ShortVideosInCategory, StreamsInCategory } from './types.svelte';
|
|
4
3
|
import { Deferred } from '@streamscloud/kit/core';
|
|
@@ -113,7 +112,7 @@ export class DiscoverViewHandler {
|
|
|
113
112
|
this._shortVideosLoadingDeferred = null;
|
|
114
113
|
};
|
|
115
114
|
onPostCreated = (data) => {
|
|
116
|
-
if (!data.isPublished || data.post.postType !==
|
|
115
|
+
if (!data.isPublished || data.post.postType !== 'SHORT_VIDEO') {
|
|
117
116
|
return;
|
|
118
117
|
}
|
|
119
118
|
const affectedHolders = this._shortVideosInCategoryCache.filter((x) => data.categories.includes(x.categoryId) && x.continuationToken !== undefined);
|
|
@@ -6,7 +6,7 @@ export declare class MediaCenterSettings {
|
|
|
6
6
|
locale: AppLocaleValue;
|
|
7
7
|
showStreamsCloudWatermark: boolean;
|
|
8
8
|
disableBackground: boolean;
|
|
9
|
-
theme: ThemeValue;
|
|
9
|
+
theme: ThemeValue | undefined;
|
|
10
10
|
state: MediaCenterState | null;
|
|
11
11
|
constructor(init: IMediaCenterSettings | undefined);
|
|
12
12
|
update: (data: IMediaCenterSettings | undefined) => void;
|
|
@@ -2,7 +2,7 @@ export class MediaCenterSettings {
|
|
|
2
2
|
locale = $state('en');
|
|
3
3
|
showStreamsCloudWatermark = $state(false);
|
|
4
4
|
disableBackground = $state(false);
|
|
5
|
-
theme = $state(
|
|
5
|
+
theme = $state(undefined);
|
|
6
6
|
state = $state.raw(null);
|
|
7
7
|
constructor(init) {
|
|
8
8
|
this.update(init);
|
|
@@ -11,7 +11,7 @@ export class MediaCenterSettings {
|
|
|
11
11
|
this.locale = data?.locale ?? 'en';
|
|
12
12
|
this.showStreamsCloudWatermark = data?.showStreamsCloudWatermark ?? false;
|
|
13
13
|
this.disableBackground = data?.disableBackground ?? false;
|
|
14
|
-
this.theme = data?.theme
|
|
14
|
+
this.theme = data?.theme;
|
|
15
15
|
this.state = data?.state ?? null;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -4,7 +4,7 @@ import type { PostPlayerModel, PostsPlayerProps, PostManagementActions } from '.
|
|
|
4
4
|
import type { ICloseOrchestrator } from '../../../ui/player/close-orchestrator';
|
|
5
5
|
import { MomentsState } from './moments-state.svelte';
|
|
6
6
|
import { MediaCenterContentHandler, MediaCenterSettingsHandler } from '../handlers';
|
|
7
|
-
import {
|
|
7
|
+
import type { IPlayerBuffer } from '@streamscloud/kit/ui/player/providers';
|
|
8
8
|
export declare class MomentsFeedHandler {
|
|
9
9
|
momentsState: MomentsState;
|
|
10
10
|
private _active;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PostType } from '../../../core/enums';
|
|
2
1
|
import { MomentsState } from './moments-state.svelte';
|
|
3
2
|
import { MediaCenterContentHandler, MediaCenterSettingsHandler } from '../handlers';
|
|
4
3
|
import { initBufferFromProvider } from '@streamscloud/kit/ui/player/providers';
|
|
@@ -79,7 +78,7 @@ export class MomentsFeedHandler {
|
|
|
79
78
|
this._active = true;
|
|
80
79
|
};
|
|
81
80
|
onPostCreated = (data) => {
|
|
82
|
-
if (!this._active || !data.isPublished || data.post.postType !==
|
|
81
|
+
if (!this._active || !data.isPublished || data.post.postType !== 'MOMENT') {
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
84
|
// Reactivate to include the new moment
|
|
@@ -89,7 +88,7 @@ export class MomentsFeedHandler {
|
|
|
89
88
|
if (!this._active) {
|
|
90
89
|
return false;
|
|
91
90
|
}
|
|
92
|
-
const postStillInTheFeed = data.isPublished && data.post.postType ===
|
|
91
|
+
const postStillInTheFeed = data.isPublished && data.post.postType === 'MOMENT';
|
|
93
92
|
if (postStillInTheFeed) {
|
|
94
93
|
this.activate({ initialMomentId: data.post.id });
|
|
95
94
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IMediaCenterDataProvider } from '../..';
|
|
2
|
-
import {
|
|
2
|
+
import type { PostPlayerModel } from '../../../posts/posts-player';
|
|
3
3
|
import type { IChunksPlayerDataProvider } from '@streamscloud/kit/ui/player/providers';
|
|
4
4
|
export declare class MomentsState {
|
|
5
5
|
private readonly dataProvider;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { PostType } from '../../../core/enums';
|
|
2
|
-
import {} from '../../../posts/posts-player';
|
|
3
1
|
import { SvelteMap } from 'svelte/reactivity';
|
|
4
2
|
export class MomentsState {
|
|
5
3
|
dataProvider;
|
|
@@ -85,7 +83,7 @@ export class MomentsState {
|
|
|
85
83
|
}
|
|
86
84
|
const moments = await this.dataProvider.postsPlayer.getPostsCursor({
|
|
87
85
|
filter: {
|
|
88
|
-
types: [
|
|
86
|
+
types: ['MOMENT'],
|
|
89
87
|
ids: momentsInChunk
|
|
90
88
|
},
|
|
91
89
|
limit: collectionCapacity
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { PostType } from '../../../core/enums';
|
|
2
1
|
import { ContinuationToken } from '@streamscloud/kit/core';
|
|
3
2
|
import { CursorDataLoader } from '@streamscloud/kit/core/data-loaders';
|
|
4
|
-
const SUPPORTED_POST_TYPES = [
|
|
3
|
+
const SUPPORTED_POST_TYPES = ['ARTICLE', 'MEDIA', 'SHORT_VIDEO', 'VIDEO'];
|
|
5
4
|
export class FeedProvidersGenerator {
|
|
6
5
|
dataProvider;
|
|
7
6
|
constructor(dataProvider) {
|
|
@@ -4,7 +4,7 @@ import type { PostManagementActions, PostPlayerModel, PostsPlayerProps } from '.
|
|
|
4
4
|
import type { ICloseOrchestrator } from '../../../ui/player/close-orchestrator';
|
|
5
5
|
import { MediaCenterContentHandler, MediaCenterSettingsHandler } from '../handlers';
|
|
6
6
|
import type { PostsFeedFilter, PostsFeedProviderInit } from './types';
|
|
7
|
-
import {
|
|
7
|
+
import type { IPlayerBuffer, IPlayerDataProvider } from '@streamscloud/kit/ui/player/providers';
|
|
8
8
|
export declare class PostsFeedHandler {
|
|
9
9
|
private _state;
|
|
10
10
|
private _providersGenerator;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PostType } from '../../..';
|
|
2
1
|
import { MediaCenterContentHandler, MediaCenterSettingsHandler } from '../handlers';
|
|
3
2
|
import { FeedProvidersGenerator } from './feed-providers-generator';
|
|
4
3
|
import { Utils } from '@streamscloud/kit/core/utils';
|
|
@@ -154,7 +153,7 @@ export class PostsFeedHandler {
|
|
|
154
153
|
// Unpublished posts never affect the feed
|
|
155
154
|
return false;
|
|
156
155
|
}
|
|
157
|
-
if (post.postType ===
|
|
156
|
+
if (post.postType === 'MOMENT') {
|
|
158
157
|
// Moments are processed separately
|
|
159
158
|
return false;
|
|
160
159
|
}
|
|
@@ -176,6 +175,7 @@ export class PostsFeedHandler {
|
|
|
176
175
|
socialInteractionsHandler: this._dataProvider.handlers?.postSocialInteractionsHandler,
|
|
177
176
|
sharingHandler: this._dataProvider.handlers?.postSharingHandler,
|
|
178
177
|
analyticsHandler: this._dataProvider.handlers?.analyticsHandler,
|
|
178
|
+
articleDataProvider: this._dataProvider.postsPlayer.fetchArticle ? { fetchArticle: this._dataProvider.postsPlayer.fetchArticle } : undefined,
|
|
179
179
|
playerSettings: this._mediaCenterSettingsHandler.playerSettings,
|
|
180
180
|
closeOrchestrator: this._closeOrchestrator,
|
|
181
181
|
on: {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
<script lang="ts">import { MediaCenterProxy } from '../media-center/media-center';
|
|
2
|
-
import { MediaCenterSettings } from '../media-center/media-center/media-center-settings.svelte';
|
|
3
2
|
import { CloseOrchestrator } from '../ui/player/close-orchestrator';
|
|
4
3
|
import { createShadowRoot } from '../ui/shadow-dom';
|
|
5
|
-
import { mount, unmount
|
|
4
|
+
import { mount, unmount } from 'svelte';
|
|
6
5
|
let { dataProvider, settings, dynamicActions } = $props();
|
|
7
|
-
const settingsHolder = untrack(() => new MediaCenterSettings(settings));
|
|
8
|
-
$effect(() => {
|
|
9
|
-
settingsHolder.update(settings);
|
|
10
|
-
});
|
|
11
6
|
const initHost = (node) => {
|
|
12
7
|
const shadowRoot = createShadowRoot(node);
|
|
13
8
|
const mounted = mount(MediaCenterProxy, {
|
|
14
9
|
target: shadowRoot,
|
|
15
10
|
props: {
|
|
16
|
-
dataProvider
|
|
17
|
-
|
|
11
|
+
get dataProvider() {
|
|
12
|
+
return dataProvider;
|
|
13
|
+
},
|
|
14
|
+
get settings() {
|
|
15
|
+
return settings;
|
|
16
|
+
},
|
|
18
17
|
modeProps: { mode: 'default' },
|
|
19
|
-
dynamicActions
|
|
18
|
+
get dynamicActions() {
|
|
19
|
+
return dynamicActions;
|
|
20
|
+
},
|
|
20
21
|
closeOrchestrator: new CloseOrchestrator({
|
|
21
22
|
closeFn: async () => {
|
|
22
23
|
await unmount(mounted);
|
package/dist/media-page/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {} from '../media-center/config/types';
|
|
2
|
-
import { MediaCenterProxy
|
|
2
|
+
import { MediaCenterProxy } from '../media-center/media-center';
|
|
3
3
|
import { CloseOrchestrator } from '../ui/player/close-orchestrator';
|
|
4
4
|
import { ModalShadowHost } from '../ui/shadow-dom';
|
|
5
5
|
import { mount, unmount } from 'svelte';
|
|
@@ -83,7 +83,7 @@ export function openMediaPageModal(init) {
|
|
|
83
83
|
target: shadowHost.shadowRoot,
|
|
84
84
|
props: {
|
|
85
85
|
dataProvider,
|
|
86
|
-
settings:
|
|
86
|
+
settings: viewerSettings,
|
|
87
87
|
modeProps: {
|
|
88
88
|
mode: 'default'
|
|
89
89
|
},
|
|
@@ -110,7 +110,7 @@ export function openMediaPageModalWithInitialPostsProvider(init) {
|
|
|
110
110
|
target: shadowHost.shadowRoot,
|
|
111
111
|
props: {
|
|
112
112
|
dataProvider: mediaCenterDataProvider,
|
|
113
|
-
settings:
|
|
113
|
+
settings: viewerSettings,
|
|
114
114
|
modeProps: {
|
|
115
115
|
mode: 'posts',
|
|
116
116
|
props: {
|
|
@@ -141,7 +141,7 @@ export function openMediaPageModalWithInitialStreamsProvider(init) {
|
|
|
141
141
|
target: shadowHost.shadowRoot,
|
|
142
142
|
props: {
|
|
143
143
|
dataProvider: mediaCenterDataProvider,
|
|
144
|
-
settings:
|
|
144
|
+
settings: viewerSettings,
|
|
145
145
|
modeProps: {
|
|
146
146
|
mode: 'streams',
|
|
147
147
|
props: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import { AdCard } from '../../ads/ad-card';
|
|
1
|
+
<script lang="ts">import { AdCard } from '../../ads/ad-card';
|
|
3
2
|
import { PostModel } from '../model';
|
|
4
3
|
import { ProductCard } from '../../products/product-card';
|
|
5
4
|
let { model, trackingParams: externalTrackingParams, on } = $props();
|
|
@@ -7,7 +6,7 @@ const trackingParams = $derived.by(() => {
|
|
|
7
6
|
if (externalTrackingParams || externalTrackingParams === false) {
|
|
8
7
|
return externalTrackingParams;
|
|
9
8
|
}
|
|
10
|
-
if (model.postType ===
|
|
9
|
+
if (model.postType === 'SHORT_VIDEO') {
|
|
11
10
|
return { shortVideoId: model.id };
|
|
12
11
|
}
|
|
13
12
|
return false;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { PostType } from '../../core/enums';
|
|
1
|
+
import type { PostType } from '../../core/enums';
|
|
2
2
|
import { PostViewerMediaModel } from './post-media-model.svelte';
|
|
3
3
|
import type { IPostModel, IPostAdCardModel, IPostHeadingModel, IPostProductCardModel } from './types';
|
|
4
4
|
export declare class PostModel {
|
|
5
5
|
id: string;
|
|
6
6
|
media: PostViewerMediaModel;
|
|
7
7
|
postType: PostType | null;
|
|
8
|
+
articleId: string | null;
|
|
8
9
|
texts: {
|
|
9
10
|
kicker: string | null;
|
|
10
11
|
title: string | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PostType } from '../../core/enums';
|
|
2
1
|
import { PostViewerMediaModel } from './post-media-model.svelte';
|
|
3
2
|
export class PostModel {
|
|
4
3
|
id;
|
|
5
4
|
media;
|
|
6
5
|
postType;
|
|
6
|
+
articleId;
|
|
7
7
|
texts;
|
|
8
8
|
heading;
|
|
9
9
|
enableSocialInteractions;
|
|
@@ -11,6 +11,7 @@ export class PostModel {
|
|
|
11
11
|
constructor(init) {
|
|
12
12
|
this.id = init.id;
|
|
13
13
|
this.postType = init.postType;
|
|
14
|
+
this.articleId = init.articleId;
|
|
14
15
|
this.media = new PostViewerMediaModel({ media: init.media, mediaFit: init.mediaFit, mediaIndex: init.mediaIndex });
|
|
15
16
|
this.texts = {
|
|
16
17
|
kicker: init.kicker,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import { enrichAdLinkWithTracking, enrichProductLinkWithTracking } from '../../marketing-tracking';
|
|
1
|
+
<script lang="ts">import { enrichAdLinkWithTracking, enrichProductLinkWithTracking } from '../../marketing-tracking';
|
|
3
2
|
import { PostModel } from '../model';
|
|
4
3
|
import { toPriceRepresentation } from '../../products/price-helper';
|
|
5
4
|
import { PostViewerUiManager } from './ui-manager.svelte';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
2
|
-
import { PostModel } from '../model';
|
|
1
|
+
<script lang="ts">import { PostModel } from '../model';
|
|
3
2
|
import { default as AttachmentsHorizontal } from './attachments-horizontal.svelte';
|
|
4
3
|
import { default as Heading } from './heading.svelte';
|
|
5
4
|
import { default as PostMedia } from './media/post-media.svelte';
|
|
@@ -18,7 +17,7 @@ const trackingParams = $derived.by(() => {
|
|
|
18
17
|
if (externalTrackingParams || externalTrackingParams === false) {
|
|
19
18
|
return externalTrackingParams;
|
|
20
19
|
}
|
|
21
|
-
if (model.postType ===
|
|
20
|
+
if (model.postType === 'SHORT_VIDEO') {
|
|
22
21
|
return { shortVideoId: model.id };
|
|
23
22
|
}
|
|
24
23
|
return false;
|
|
@@ -46,6 +45,14 @@ const trackControlsPanelSize = (node) => {
|
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
};
|
|
48
|
+
const handleArticleReadMore = $derived.by(() => {
|
|
49
|
+
const articleId = model.articleId;
|
|
50
|
+
const handler = on?.articleReadMore;
|
|
51
|
+
if (!articleId || !handler) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return () => handler(articleId);
|
|
55
|
+
});
|
|
49
56
|
const variables = $derived.by(() => {
|
|
50
57
|
const values = [];
|
|
51
58
|
if (model.media.isGallery) {
|
|
@@ -57,12 +64,12 @@ const variables = $derived.by(() => {
|
|
|
57
64
|
|
|
58
65
|
<div class="post-viewer" style={variables} use:viewerMounted>
|
|
59
66
|
<PostMedia id={model.id} media={model.media} autoplay={autoplay} on={{ videoProgress: on?.progress }} />
|
|
60
|
-
{#if (uiManager.showAttachments && model.attachments) || model.heading || model.texts.kicker || model.texts.title || model.texts.text || model.texts.readMoreUrl}
|
|
67
|
+
{#if (uiManager.showAttachments && model.attachments) || model.heading || model.texts.kicker || model.texts.title || model.texts.text || model.texts.readMoreUrl || handleArticleReadMore}
|
|
61
68
|
<div class="post-viewer__information">
|
|
62
69
|
{#if model.heading}
|
|
63
70
|
<Heading model={model.heading} uiManager={uiManager} localization={localization} />
|
|
64
71
|
{/if}
|
|
65
|
-
<Texts model={model.texts} uiManager={uiManager} localization={localization} />
|
|
72
|
+
<Texts model={model.texts} uiManager={uiManager} localization={localization} on={{ readMore: handleArticleReadMore }} />
|
|
66
73
|
|
|
67
74
|
{#if uiManager.showAttachments && model.attachments}
|
|
68
75
|
<AttachmentsHorizontal
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MediaType, PostType } from '../../core/enums';
|
|
2
1
|
import { getMediaItemImageUrl } from '../../core/media';
|
|
3
2
|
import { shouldUseSalePrice } from '../../products/price-helper';
|
|
4
3
|
export const mapToPostModel = (payload) => {
|
|
@@ -29,15 +28,15 @@ export const mapToPostModel = (payload) => {
|
|
|
29
28
|
const mapToPostType = (payload) => {
|
|
30
29
|
switch (true) {
|
|
31
30
|
case !!payload.shortVideoData:
|
|
32
|
-
return
|
|
31
|
+
return 'SHORT_VIDEO';
|
|
33
32
|
case !!payload.momentData:
|
|
34
|
-
return
|
|
33
|
+
return 'MOMENT';
|
|
35
34
|
case !!payload.articleData:
|
|
36
|
-
return
|
|
35
|
+
return 'ARTICLE';
|
|
37
36
|
case !!payload.videoData:
|
|
38
|
-
return
|
|
37
|
+
return 'VIDEO';
|
|
39
38
|
case !!payload.mediaData:
|
|
40
|
-
return
|
|
39
|
+
return 'MEDIA';
|
|
41
40
|
default:
|
|
42
41
|
return null;
|
|
43
42
|
}
|
|
@@ -56,7 +55,7 @@ const extractPostText = (payload) => {
|
|
|
56
55
|
};
|
|
57
56
|
const mapToPostViewerMediaModel = (payload) => {
|
|
58
57
|
return payload.media.map((i) => {
|
|
59
|
-
return i.type ===
|
|
58
|
+
return i.type === 'IMAGE'
|
|
60
59
|
? { isImage: true, url: i.url }
|
|
61
60
|
: {
|
|
62
61
|
isImage: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { PostViewerLocalization } from './post-viewer-localization';
|
|
2
2
|
import { PostViewerUiManager } from './ui-manager.svelte';
|
|
3
3
|
import { LineClamp } from '@streamscloud/kit/ui/line-clamp';
|
|
4
|
-
let { model, uiManager, localization } = $props();
|
|
4
|
+
let { model, uiManager, localization, on } = $props();
|
|
5
5
|
const variables = $derived.by(() => {
|
|
6
6
|
const values = [
|
|
7
7
|
`--_post-viewer-texts--padding: 0 ${uiManager.controlsPanelWidth ? uiManager.controlsPanelWidth : uiManager.infoPaddingInline}px 0 ${uiManager.infoPaddingInline}px`
|
|
@@ -30,6 +30,10 @@ const variables = $derived.by(() => {
|
|
|
30
30
|
<a class="post-viewer-texts__read-more" href={model.readMoreUrl} target="_blank" rel="noopener noreferrer">
|
|
31
31
|
{localization.readMore}
|
|
32
32
|
</a>
|
|
33
|
+
{:else if on?.readMore}
|
|
34
|
+
<button type="button" class="post-viewer-texts__read-more" onclick={on.readMore}>
|
|
35
|
+
{localization.readMore}
|
|
36
|
+
</button>
|
|
33
37
|
{/if}
|
|
34
38
|
</div>
|
|
35
39
|
|
|
@@ -83,6 +87,9 @@ const variables = $derived.by(() => {
|
|
|
83
87
|
pointer-events: auto;
|
|
84
88
|
font-size: 1rem;
|
|
85
89
|
font-weight: 400;
|
|
90
|
+
color: inherit;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
text-shadow: inherit;
|
|
86
93
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
87
94
|
}
|
|
88
95
|
@container (width < 576px) {
|
|
@@ -5,6 +5,9 @@ type Props = {
|
|
|
5
5
|
model: PostModel['texts'];
|
|
6
6
|
uiManager: PostViewerUiManager;
|
|
7
7
|
localization: PostViewerLocalization;
|
|
8
|
+
on?: {
|
|
9
|
+
readMore?: () => void;
|
|
10
|
+
};
|
|
8
11
|
};
|
|
9
12
|
declare const PostTexts: import("svelte").Component<Props, {}, "">;
|
|
10
13
|
type PostTexts = ReturnType<typeof PostTexts>;
|