@streamscloud/embeddable 9.0.0 → 10.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/content-player/cmp.content-player.svelte +1 -1
- package/dist/content-player/content-player-config.svelte.d.ts +4 -4
- package/dist/content-player/controls-and-attachments.svelte +1 -1
- package/dist/content-player/header.svelte +1 -1
- package/dist/core/actions/horizontal-wheel-scroll.d.ts +1 -0
- package/dist/core/actions/horizontal-wheel-scroll.js +9 -8
- package/dist/core/document.event-handlers.d.ts +1 -0
- package/dist/core/document.event-handlers.js +3 -0
- package/dist/media-center/config/internal-media-center-analytics-handler.d.ts +1 -1
- package/dist/media-center/config/internal-media-center-config.js +34 -44
- package/dist/media-center/config/operations.generated.d.ts +0 -104
- package/dist/media-center/config/operations.generated.js +0 -320
- package/dist/media-center/config/operations.graphql +0 -24
- package/dist/media-center/config/types.d.ts +7 -9
- package/dist/media-center/media-center/cmp.media-center.svelte +27 -7
- package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +2 -2
- package/dist/media-center/media-center/discover-panel-handler.svelte.d.ts +2 -2
- package/dist/media-center/media-center/discover-panel.svelte +1 -1
- package/dist/media-center/media-center/discover-panel.svelte.d.ts +2 -1
- package/dist/media-center/media-center/post-player-provider-generator.d.ts +2 -2
- package/dist/media-center/media-center/post-player-provider-generator.js +2 -1
- package/dist/media-center/media-center/streams-in-category-panel-handler.svelte.d.ts +5 -2
- package/dist/media-center/media-center/streams-in-category-panel-handler.svelte.js +5 -0
- package/dist/media-center/media-center/streams-in-category-panel.svelte +2 -2
- package/dist/media-center/media-center/streams-in-category-panel.svelte.d.ts +3 -2
- package/dist/media-center/media-center/streams-player-provider-generator.d.ts +8 -0
- package/dist/media-center/media-center/streams-player-provider-generator.js +36 -0
- package/dist/media-center/media-center/types.d.ts +0 -6
- package/dist/posts/controls/cmp.controls.svelte +1 -1
- package/dist/posts/data-loaders/index.d.ts +1 -0
- package/dist/posts/data-loaders/index.js +1 -0
- package/dist/posts/{posts-player → data-loaders}/mapper.d.ts +1 -1
- package/dist/{short-videos/data-providers → posts/data-loaders}/operations.generated.d.ts +82 -4
- package/dist/{short-videos/data-providers → posts/data-loaders}/operations.generated.js +232 -3
- package/dist/posts/data-loaders/operations.graphql +17 -0
- package/dist/posts/data-loaders/posts-loader.d.ts +19 -0
- package/dist/posts/data-loaders/posts-loader.js +28 -0
- package/dist/posts/posts-player/index.d.ts +27 -6
- package/dist/posts/posts-player/index.js +2 -3
- package/dist/posts/posts-player/posts-player-view.svelte +29 -13
- package/dist/posts/posts-player/types.d.ts +2 -2
- package/dist/short-videos/data-providers/internal-short-video-player-items-provider.d.ts +5 -6
- package/dist/short-videos/data-providers/internal-short-video-player-items-provider.js +12 -32
- package/dist/short-videos/short-videos-player/index.d.ts +2 -3
- package/dist/short-videos/short-videos-player/index.js +1 -1
- package/dist/streams/data-loaders/index.d.ts +2 -0
- package/dist/streams/data-loaders/index.js +2 -0
- package/dist/streams/{stream-player → data-loaders}/mapper.d.ts +1 -1
- package/dist/streams/{stream-player → data-loaders}/operations.generated.d.ts +27 -24
- package/dist/streams/{stream-player → data-loaders}/operations.generated.js +18 -17
- package/dist/streams/{stream-player → data-loaders}/operations.graphql +6 -3
- package/dist/streams/data-loaders/stream-pages-loader.d.ts +10 -0
- package/dist/streams/data-loaders/stream-pages-loader.js +33 -0
- package/dist/streams/data-loaders/streams-loader.d.ts +19 -0
- package/dist/streams/data-loaders/streams-loader.js +28 -0
- package/dist/streams/layout/cmp.slot-content.svelte +18 -13
- package/dist/streams/layout/element-views/cmp.button-stream-element.svelte +26 -0
- package/dist/streams/layout/element-views/cmp.button-stream-element.svelte.d.ts +10 -0
- package/dist/streams/layout/element-views/cmp.products-slider-stream-element.svelte +43 -0
- package/dist/streams/layout/element-views/cmp.products-slider-stream-element.svelte.d.ts +13 -0
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +8 -6
- package/dist/streams/layout/element-views/index.d.ts +2 -0
- package/dist/streams/layout/element-views/index.js +2 -0
- package/dist/streams/layout/element-views/price-element-view.svelte +3 -0
- package/dist/streams/layout/elements.d.ts +20 -2
- package/dist/streams/layout/enums.d.ts +4 -1
- package/dist/streams/layout/enums.js +3 -0
- package/dist/streams/layout/index.d.ts +1 -0
- package/dist/streams/layout/index.js +15 -0
- package/dist/streams/layout/serializer.svelte.js +30 -5
- package/dist/streams/layout/slot-data-input.d.ts +5 -1
- package/dist/streams/layout/slot-data-ref.d.ts +2 -2
- package/dist/streams/layout/slot-data.d.ts +6 -1
- package/dist/streams/layout/styles-transformer.d.ts +3 -1
- package/dist/streams/layout/styles-transformer.js +47 -0
- package/dist/streams/layout/styles.d.ts +25 -0
- package/dist/streams/layout/type-guards.d.ts +11 -4
- package/dist/streams/layout/type-guards.js +17 -3
- package/dist/streams/{stream-player → streams-player}/index.d.ts +21 -22
- package/dist/streams/{stream-player → streams-player}/index.js +9 -7
- package/dist/streams/streams-player/internal-streams-player-data-provider.d.ts +16 -0
- package/dist/streams/streams-player/internal-streams-player-data-provider.js +55 -0
- package/dist/streams/{stream-player → streams-player}/stream-overview.svelte +18 -15
- package/dist/streams/{stream-player → streams-player}/stream-overview.svelte.d.ts +2 -2
- package/dist/streams/streams-player/streams-player-buffer.svelte.d.ts +8 -0
- package/dist/streams/streams-player/streams-player-buffer.svelte.js +15 -0
- package/dist/streams/{stream-player/stream-player-view.svelte → streams-player/streams-player-view.svelte} +69 -55
- package/dist/streams/streams-player/streams-player-view.svelte.d.ts +8 -0
- package/dist/streams/{stream-player → streams-player}/types.d.ts +9 -7
- package/dist/ui/{player-button → player/button}/cmp.player-button.svelte +1 -1
- package/dist/ui/{player-button → player/button}/cmp.player-button.svelte.d.ts +1 -1
- package/dist/ui/{player-button → player/button}/cmp.player-buttons-group.svelte +1 -1
- package/dist/ui/{player-button → player/button}/types.d.ts +1 -1
- package/dist/ui/player/button/types.js +1 -0
- package/dist/ui/player/providers/chunks-player-buffer/index.d.ts +2 -0
- package/dist/ui/player/providers/chunks-player-buffer/index.js +2 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk-item.svelte.d.ts +11 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk-item.svelte.js +11 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk.svelte.d.ts +31 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunk.svelte.js +67 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunks-manager.svelte.d.ts +23 -0
- package/dist/ui/player/providers/chunks-player-buffer/player-chunks-manager.svelte.js +125 -0
- package/dist/ui/player/providers/default-chunks-player-buffer.svelte.d.ts +20 -0
- package/dist/ui/player/providers/default-chunks-player-buffer.svelte.js +47 -0
- package/dist/ui/player/providers/default-feed-player-buffer.svelte.d.ts +27 -0
- package/dist/ui/player/providers/default-feed-player-buffer.svelte.js +78 -0
- package/dist/ui/player/providers/index.d.ts +3 -0
- package/dist/ui/player/providers/index.js +2 -0
- package/dist/ui/player/providers/types.d.ts +49 -0
- package/dist/ui/{player-slider → player/slider}/cmp.player-slider.svelte +7 -20
- package/dist/ui/{player-slider → player/slider}/cmp.player-slider.svelte.d.ts +4 -4
- package/dist/ui/{player-slider → player/slider}/index.d.ts +0 -2
- package/dist/ui/{player-slider → player/slider}/index.js +0 -1
- package/dist/ui/player/slider/types.d.ts +16 -0
- package/dist/ui/player/slider/types.js +1 -0
- package/package.json +4 -4
- package/dist/posts/posts-player/operations.generated.d.ts +0 -80
- package/dist/posts/posts-player/operations.generated.js +0 -229
- package/dist/posts/posts-player/operations.graphql +0 -7
- package/dist/short-videos/data-providers/operations.graphql +0 -9
- package/dist/streams/layout/element-views/stream-element-localization.d.ts +0 -7
- package/dist/streams/layout/element-views/stream-element-localization.js +0 -11
- package/dist/streams/stream-player/internal-stream-player-data-provider.d.ts +0 -12
- package/dist/streams/stream-player/internal-stream-player-data-provider.js +0 -48
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +0 -28
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +0 -79
- package/dist/streams/stream-player/stream-player-view.svelte.d.ts +0 -8
- package/dist/ui/player-button/types.js +0 -1
- package/dist/ui/player-slider/player-buffer.svelte.d.ts +0 -32
- package/dist/ui/player-slider/player-buffer.svelte.js +0 -76
- package/dist/ui/player-slider/types.d.ts +0 -26
- /package/dist/posts/{posts-player → data-loaders}/mapper.js +0 -0
- /package/dist/streams/{stream-player → data-loaders}/mapper.js +0 -0
- /package/dist/streams/{stream-player → streams-player}/internal-stream-analytics-handler.d.ts +0 -0
- /package/dist/streams/{stream-player → streams-player}/internal-stream-analytics-handler.js +0 -0
- /package/dist/streams/{stream-player → streams-player}/stream-player-localization.d.ts +0 -0
- /package/dist/streams/{stream-player → streams-player}/stream-player-localization.js +0 -0
- /package/dist/streams/{stream-player → streams-player}/types.js +0 -0
- /package/dist/ui/{player-button → player/button}/cmp.player-buttons-group.svelte.d.ts +0 -0
- /package/dist/ui/{player-button → player/button}/index.d.ts +0 -0
- /package/dist/ui/{player-button → player/button}/index.js +0 -0
- /package/dist/ui/{player-slider → player/providers}/types.js +0 -0
- /package/dist/ui/{player-slider → player/slider}/prevent-slider-scroll.d.ts +0 -0
- /package/dist/ui/{player-slider → player/slider}/prevent-slider-scroll.js +0 -0
- /package/dist/ui/{player-slider → player/slider}/wheel-gestures-adapter.d.ts +0 -0
- /package/dist/ui/{player-slider → player/slider}/wheel-gestures-adapter.js +0 -0
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import type * as SchemaTypes from '../../../gql/types';
|
|
2
2
|
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
-
export type
|
|
4
|
-
|
|
3
|
+
export type GetStreamsQueryVariables = SchemaTypes.Exact<{
|
|
4
|
+
input: SchemaTypes.EmbedStreamsInput;
|
|
5
5
|
}>;
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
subTitle: string | null;
|
|
11
|
-
createdAt: any;
|
|
12
|
-
publishedAt: any | null;
|
|
13
|
-
pagesCount: number;
|
|
14
|
-
cover: {
|
|
15
|
-
url: string;
|
|
16
|
-
} | null;
|
|
17
|
-
ownerProfile: {
|
|
18
|
-
image: string | null;
|
|
19
|
-
name: string;
|
|
6
|
+
export type GetStreamsQuery = {
|
|
7
|
+
streams: {
|
|
8
|
+
continuationToken: string | null;
|
|
9
|
+
items: Array<{
|
|
20
10
|
id: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
title: string;
|
|
12
|
+
subTitle: string | null;
|
|
13
|
+
createdAt: any;
|
|
14
|
+
publishedAt: any | null;
|
|
15
|
+
pagesCount: number;
|
|
16
|
+
cover: {
|
|
17
|
+
url: string;
|
|
18
|
+
} | null;
|
|
19
|
+
ownerProfile: {
|
|
20
|
+
image: string | null;
|
|
21
|
+
name: string;
|
|
22
|
+
id: string;
|
|
23
|
+
type: SchemaTypes.ProfileType;
|
|
24
|
+
};
|
|
25
|
+
availableFrom: {
|
|
26
|
+
image: string;
|
|
27
|
+
name: string;
|
|
28
|
+
} | null;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
28
31
|
};
|
|
29
32
|
export type GetStreamPagesQueryVariables = SchemaTypes.Exact<{
|
|
30
33
|
input: SchemaTypes.EmbedStreamPagesInput;
|
|
@@ -65,5 +68,5 @@ export type StreamPlayerPayloadFragment = {
|
|
|
65
68
|
} | null;
|
|
66
69
|
};
|
|
67
70
|
export declare const StreamPlayerPayloadFragmentDoc: DocumentNode<StreamPlayerPayloadFragment, unknown>;
|
|
68
|
-
export declare const
|
|
71
|
+
export declare const GetStreamsDocument: DocumentNode<GetStreamsQuery, GetStreamsQueryVariables>;
|
|
69
72
|
export declare const GetStreamPagesDocument: DocumentNode<GetStreamPagesQuery, GetStreamPagesQueryVariables>;
|
|
@@ -48,18 +48,18 @@ export const StreamPlayerPayloadFragmentDoc = {
|
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
50
|
};
|
|
51
|
-
export const
|
|
51
|
+
export const GetStreamsDocument = {
|
|
52
52
|
kind: 'Document',
|
|
53
53
|
definitions: [
|
|
54
54
|
{
|
|
55
55
|
kind: 'OperationDefinition',
|
|
56
56
|
operation: 'query',
|
|
57
|
-
name: { kind: 'Name', value: '
|
|
57
|
+
name: { kind: 'Name', value: 'GetStreams' },
|
|
58
58
|
variableDefinitions: [
|
|
59
59
|
{
|
|
60
60
|
kind: 'VariableDefinition',
|
|
61
|
-
variable: { kind: 'Variable', name: { kind: 'Name', value: '
|
|
62
|
-
type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: '
|
|
61
|
+
variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
|
|
62
|
+
type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'EmbedStreamsInput' } } }
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
65
|
selectionSet: {
|
|
@@ -67,19 +67,20 @@ export const GetStreamDocument = {
|
|
|
67
67
|
selections: [
|
|
68
68
|
{
|
|
69
69
|
kind: 'Field',
|
|
70
|
-
alias: { kind: 'Name', value: '
|
|
71
|
-
name: { kind: 'Name', value: '
|
|
72
|
-
arguments: [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
kind: '
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
alias: { kind: 'Name', value: 'streams' },
|
|
71
|
+
name: { kind: 'Name', value: 'embedStreams' },
|
|
72
|
+
arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'input' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } } }],
|
|
73
|
+
selectionSet: {
|
|
74
|
+
kind: 'SelectionSet',
|
|
75
|
+
selections: [
|
|
76
|
+
{
|
|
77
|
+
kind: 'Field',
|
|
78
|
+
name: { kind: 'Name', value: 'items' },
|
|
79
|
+
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'StreamPlayerPayloadFragment' } }] }
|
|
80
|
+
},
|
|
81
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'continuationToken' } }
|
|
82
|
+
]
|
|
83
|
+
}
|
|
83
84
|
}
|
|
84
85
|
]
|
|
85
86
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
query
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
query GetStreams($input: EmbedStreamsInput!) {
|
|
2
|
+
streams: embedStreams(input: $input) {
|
|
3
|
+
items {
|
|
4
|
+
...StreamPlayerPayloadFragment
|
|
5
|
+
}
|
|
6
|
+
continuationToken
|
|
4
7
|
}
|
|
5
8
|
}
|
|
6
9
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type StreamPageViewerModel } from '../stream-page-viewer';
|
|
2
|
+
import type { Client } from '@urql/core';
|
|
3
|
+
export declare const getStreamPagesCursor: (input: {
|
|
4
|
+
streamId: string;
|
|
5
|
+
continuationToken: string | null | undefined;
|
|
6
|
+
graphql: Client;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
items: StreamPageViewerModel[];
|
|
9
|
+
continuationToken: string | null;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ImageScale } from '../..';
|
|
2
|
+
import { mapToStreamPageViewerModel } from '../stream-page-viewer';
|
|
3
|
+
import { GetStreamPagesDocument } from './operations.generated';
|
|
4
|
+
export const getStreamPagesCursor = async (input) => {
|
|
5
|
+
const { streamId, continuationToken, graphql } = input;
|
|
6
|
+
const emptyResult = { items: [], continuationToken: null };
|
|
7
|
+
if (continuationToken === null) {
|
|
8
|
+
return emptyResult;
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const payload = await graphql
|
|
12
|
+
.query(GetStreamPagesDocument, {
|
|
13
|
+
input: {
|
|
14
|
+
limit: 10,
|
|
15
|
+
continuationToken,
|
|
16
|
+
filter: { streamId }
|
|
17
|
+
},
|
|
18
|
+
image_scale: ImageScale.OriginalEncoded
|
|
19
|
+
})
|
|
20
|
+
.toPromise();
|
|
21
|
+
const data = payload.data?.streamPages;
|
|
22
|
+
if (!data) {
|
|
23
|
+
return emptyResult;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
items: data.items.map(mapToStreamPageViewerModel),
|
|
27
|
+
continuationToken: data.continuationToken
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return emptyResult;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StreamStatus } from '../../core/enums';
|
|
2
|
+
import type { StreamPlayerModel } from '../streams-player/types';
|
|
3
|
+
import type { Client } from '@urql/core';
|
|
4
|
+
export declare const getStreamsCursor: (input: {
|
|
5
|
+
filter: {
|
|
6
|
+
ids?: string[];
|
|
7
|
+
categoryId?: string;
|
|
8
|
+
excludeIds?: string[];
|
|
9
|
+
mediaPageId?: string;
|
|
10
|
+
statuses?: StreamStatus[];
|
|
11
|
+
showInFeed?: boolean;
|
|
12
|
+
};
|
|
13
|
+
limit: number;
|
|
14
|
+
continuationToken?: string | null;
|
|
15
|
+
graphql: Client;
|
|
16
|
+
}) => Promise<{
|
|
17
|
+
items: StreamPlayerModel[];
|
|
18
|
+
continuationToken: string | null;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StreamStatus } from '../../core/enums';
|
|
2
|
+
import { mapToStreamPlayerModel } from './mapper';
|
|
3
|
+
import { GetStreamsDocument } from './operations.generated';
|
|
4
|
+
export const getStreamsCursor = async (input) => {
|
|
5
|
+
const { filter, limit, continuationToken, graphql } = input;
|
|
6
|
+
const { mediaPageId, ids, categoryId, excludeIds, statuses, showInFeed } = filter;
|
|
7
|
+
const payload = await graphql
|
|
8
|
+
.query(GetStreamsDocument, {
|
|
9
|
+
input: {
|
|
10
|
+
filter: {
|
|
11
|
+
ids,
|
|
12
|
+
mediaPageId,
|
|
13
|
+
categoryId,
|
|
14
|
+
excludeIds,
|
|
15
|
+
statuses,
|
|
16
|
+
showInFeed
|
|
17
|
+
},
|
|
18
|
+
limit,
|
|
19
|
+
continuationToken
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
.toPromise();
|
|
23
|
+
const streams = payload.data?.streams.items ?? [];
|
|
24
|
+
return {
|
|
25
|
+
items: streams.map(mapToStreamPlayerModel),
|
|
26
|
+
continuationToken: payload.data?.streams?.continuationToken ?? null
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -3,30 +3,35 @@ import { enrichProductLinkWithTracking } from '../../marketing-tracking';
|
|
|
3
3
|
import { StreamElementView } from './element-views';
|
|
4
4
|
import { StreamComponentDataType } from './enums';
|
|
5
5
|
let { model, locale, trackingParams, on } = $props();
|
|
6
|
+
const slotData = $derived.by(() => {
|
|
7
|
+
return model.data;
|
|
8
|
+
});
|
|
6
9
|
const component = $derived.by(() => {
|
|
7
|
-
return model.components.find((c) => (
|
|
10
|
+
return model.components.find((c) => (slotData ? c.dataType === slotData.type : c.dataType === StreamComponentDataType.NoData));
|
|
8
11
|
});
|
|
9
12
|
const dataIsFilled = $derived.by(() => {
|
|
10
|
-
if (!
|
|
13
|
+
if (!slotData) {
|
|
11
14
|
return false;
|
|
12
15
|
}
|
|
13
|
-
switch (
|
|
14
|
-
case StreamComponentDataType.
|
|
15
|
-
return !!
|
|
16
|
+
switch (slotData.type) {
|
|
17
|
+
case StreamComponentDataType.Images: {
|
|
18
|
+
return !!slotData.items.length;
|
|
16
19
|
}
|
|
17
20
|
case StreamComponentDataType.Product: {
|
|
18
|
-
return !!
|
|
21
|
+
return !!slotData.product;
|
|
19
22
|
}
|
|
20
|
-
case StreamComponentDataType.
|
|
21
|
-
return !!
|
|
23
|
+
case StreamComponentDataType.Products: {
|
|
24
|
+
return !!slotData.products.length;
|
|
25
|
+
}
|
|
26
|
+
case StreamComponentDataType.ShortVideo: {
|
|
27
|
+
return !!slotData.shortVideo;
|
|
22
28
|
}
|
|
23
29
|
default:
|
|
24
|
-
Utils.assertUnreachable(
|
|
30
|
+
Utils.assertUnreachable(slotData);
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
33
|
const productModel = $derived.by(() => {
|
|
28
|
-
|
|
29
|
-
return ((_a = model.data) === null || _a === void 0 ? void 0 : _a.type) === StreamComponentDataType.Product ? model.data.product : undefined;
|
|
34
|
+
return (slotData === null || slotData === void 0 ? void 0 : slotData.type) === StreamComponentDataType.Product ? slotData.product : undefined;
|
|
30
35
|
});
|
|
31
36
|
const enrichedLink = $derived((productModel === null || productModel === void 0 ? void 0 : productModel.link)
|
|
32
37
|
? enrichProductLinkWithTracking({
|
|
@@ -71,9 +76,9 @@ const productLinkMounted = (node, productModel) => {
|
|
|
71
76
|
</script>
|
|
72
77
|
|
|
73
78
|
{#snippet slotContent()}
|
|
74
|
-
{#if component && (!
|
|
79
|
+
{#if component && (!slotData || dataIsFilled)}
|
|
75
80
|
{#each component.elements as element (element)}
|
|
76
|
-
<StreamElementView model={element} data={
|
|
81
|
+
<StreamElementView model={element} data={slotData} trackingParams={trackingParams} locale={locale} on={on} />
|
|
77
82
|
{/each}
|
|
78
83
|
{/if}
|
|
79
84
|
{/snippet}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">import { generateButtonStyles } from '../styles-transformer';
|
|
2
|
+
let { model, placeholder, inert = false } = $props();
|
|
3
|
+
const handleClick = () => {
|
|
4
|
+
if (model.url) {
|
|
5
|
+
window.open(model.url, '_blank', 'noopener noreferrer');
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<button type="button" class="button-stream-element" style={generateButtonStyles(model.styles)} onclick={handleClick} inert={inert}>
|
|
11
|
+
<span class="button-stream-element__text">
|
|
12
|
+
{#if model.text}
|
|
13
|
+
{model.text}
|
|
14
|
+
{:else if placeholder}
|
|
15
|
+
{@render placeholder()}
|
|
16
|
+
{/if}
|
|
17
|
+
</span>
|
|
18
|
+
</button>
|
|
19
|
+
|
|
20
|
+
<style>.button-stream-element__text {
|
|
21
|
+
min-width: 0;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
}</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ButtonStreamElementModel } from '../elements';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type Props = {
|
|
4
|
+
model: ButtonStreamElementModel;
|
|
5
|
+
inert?: boolean;
|
|
6
|
+
placeholder?: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
10
|
+
export default Cmp;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">import { horizontalWheelScroll } from '../../../core/actions';
|
|
2
|
+
import { StreamComponentDataType, StreamElementStyleDirection } from '../enums';
|
|
3
|
+
import { generateProductsSliderStyles } from '../styles-transformer';
|
|
4
|
+
import { default as StreamElement } from './cmp.stream-element.svelte';
|
|
5
|
+
let { model, data, trackingParams, locale } = $props();
|
|
6
|
+
const getProductDataByIndex = (index) => {
|
|
7
|
+
const products = (data === null || data === void 0 ? void 0 : data.type) === StreamComponentDataType.Products ? data.products : [];
|
|
8
|
+
const product = products[index];
|
|
9
|
+
if (!product) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
type: StreamComponentDataType.Product,
|
|
14
|
+
id: product.id,
|
|
15
|
+
product: product
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="products-slider-stream-element" style={generateProductsSliderStyles(model.styles)} use:horizontalWheelScroll>
|
|
21
|
+
{#each model.items as item, index (item)}
|
|
22
|
+
<div class="products-slider-stream-element__item">
|
|
23
|
+
{#each item.elements as element (element)}
|
|
24
|
+
{@const productData = getProductDataByIndex(index)}
|
|
25
|
+
<StreamElement
|
|
26
|
+
model={element}
|
|
27
|
+
data={productData}
|
|
28
|
+
trackingParams={trackingParams}
|
|
29
|
+
constainerDirection={StreamElementStyleDirection.Vertical}
|
|
30
|
+
locale={locale} />
|
|
31
|
+
{/each}
|
|
32
|
+
</div>
|
|
33
|
+
{/each}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<style>.products-slider-stream-element {
|
|
37
|
+
overscroll-behavior-x: contain;
|
|
38
|
+
scroll-snap-type: x proximity;
|
|
39
|
+
}
|
|
40
|
+
.products-slider-stream-element__item {
|
|
41
|
+
scroll-snap-align: start;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Locale } from '../../../core/locale';
|
|
2
|
+
import type { StreamTrackingParams } from '..';
|
|
3
|
+
import type { ProductsSliderStreamElementModel } from '../elements';
|
|
4
|
+
import type { StreamSlotData } from '../slot-data';
|
|
5
|
+
type Props = {
|
|
6
|
+
model: ProductsSliderStreamElementModel;
|
|
7
|
+
data: StreamSlotData | null;
|
|
8
|
+
trackingParams: StreamTrackingParams;
|
|
9
|
+
locale: Locale;
|
|
10
|
+
};
|
|
11
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
13
|
+
export default Cmp;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
<script lang="ts">import { AnnotationStreamElementView, ContainerStreamElementView, ImageRefStreamElementView, ImagesStreamElementView, PriceStreamElementView, ShortVideoStreamElementView, SpacerStreamElementView, StockStreamElementView, TextRefStreamElementView, TextStreamElementView, WebViewStreamElementView } from '.';
|
|
2
|
-
import { StreamElementLocalization } from './stream-element-localization';
|
|
1
|
+
<script lang="ts">import { AnnotationStreamElementView, ButtonStreamElementView, ContainerStreamElementView, ImageRefStreamElementView, ImagesStreamElementView, PriceStreamElementView, ProductsSliderStreamElementView, ShortVideoStreamElementView, SpacerStreamElementView, StockStreamElementView, TextRefStreamElementView, TextStreamElementView, WebViewStreamElementView } from '.';
|
|
3
2
|
import { StreamComponentDataType, StreamElementStyleDirection, StreamElementType } from '../enums';
|
|
4
3
|
let { model, data, trackingParams, constainerDirection = StreamElementStyleDirection.Vertical, locale, on } = $props();
|
|
5
|
-
const localization = $derived(new StreamElementLocalization(locale));
|
|
6
4
|
const shortVideoModel = $derived.by(() => {
|
|
7
5
|
if (!data) {
|
|
8
6
|
return null;
|
|
@@ -43,6 +41,8 @@ const productModel = $derived.by(() => {
|
|
|
43
41
|
|
|
44
42
|
{#if model.type === StreamElementType.Annotation}
|
|
45
43
|
<AnnotationStreamElementView model={model} />
|
|
44
|
+
{:else if model.type === StreamElementType.Button}
|
|
45
|
+
<ButtonStreamElementView model={model} />
|
|
46
46
|
{:else if model.type === StreamElementType.Container}
|
|
47
47
|
<ContainerStreamElementView model={model} data={data} trackingParams={trackingParams} locale={locale} />
|
|
48
48
|
{:else if model.type === StreamElementType.ImageRef && data}
|
|
@@ -50,12 +50,14 @@ const productModel = $derived.by(() => {
|
|
|
50
50
|
{:else if model.type === StreamElementType.Images && imagesModel?.length}
|
|
51
51
|
<ImagesStreamElementView model={model} data={imagesModel} />
|
|
52
52
|
{:else if model.type === StreamElementType.Price && productModel}
|
|
53
|
-
<PriceStreamElementView model={model} data={productModel.price} locale={
|
|
53
|
+
<PriceStreamElementView model={model} data={productModel.price} locale={locale} />
|
|
54
|
+
{:else if model.type === StreamElementType.ProductsSlider}
|
|
55
|
+
<ProductsSliderStreamElementView model={model} data={data} trackingParams={trackingParams} locale={locale} />
|
|
54
56
|
{:else if model.type === StreamElementType.ShortVideo && shortVideoModel}
|
|
55
57
|
<ShortVideoStreamElementView
|
|
56
58
|
data={shortVideoModel}
|
|
57
59
|
trackingParams={trackingParams}
|
|
58
|
-
locale={
|
|
60
|
+
locale={locale}
|
|
59
61
|
on={on
|
|
60
62
|
? {
|
|
61
63
|
progress: (progress: Number) => {
|
|
@@ -66,7 +68,7 @@ const productModel = $derived.by(() => {
|
|
|
66
68
|
{:else if model.type === StreamElementType.Spacer}
|
|
67
69
|
<SpacerStreamElementView model={model} parentContainerDirection={constainerDirection} />
|
|
68
70
|
{:else if model.type === StreamElementType.Stock}
|
|
69
|
-
<StockStreamElementView model={model} locale={
|
|
71
|
+
<StockStreamElementView model={model} locale={locale} />
|
|
70
72
|
{:else if model.type === StreamElementType.Text}
|
|
71
73
|
<TextStreamElementView model={model} />
|
|
72
74
|
{:else if model.type === StreamElementType.TextRef && data}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { default as StreamElementView } from './cmp.stream-element.svelte';
|
|
2
2
|
export { default as AnnotationStreamElementView } from './cmp.annotation-stream-element.svelte';
|
|
3
|
+
export { default as ButtonStreamElementView } from './cmp.button-stream-element.svelte';
|
|
3
4
|
export { default as ContainerStreamElementView } from './cmp.container-stream-element.svelte';
|
|
4
5
|
export { default as ImageRefStreamElementView } from './cmp.image-ref-stream-element.svelte';
|
|
5
6
|
export { default as ImagesStreamElementView } from './cmp.images-stream-element.svelte';
|
|
6
7
|
export { default as PriceStreamElementView } from './cmp.price-stream-element.svelte';
|
|
8
|
+
export { default as ProductsSliderStreamElementView } from './cmp.products-slider-stream-element.svelte';
|
|
7
9
|
export { default as ShortVideoStreamElementView } from './cmp.short-video-stream-element.svelte';
|
|
8
10
|
export { default as SpacerStreamElementView } from './cmp.spacer-stream-element.svelte';
|
|
9
11
|
export { default as StockStreamElementView } from './cmp.stock-stream-element.svelte';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { default as StreamElementView } from './cmp.stream-element.svelte';
|
|
2
2
|
export { default as AnnotationStreamElementView } from './cmp.annotation-stream-element.svelte';
|
|
3
|
+
export { default as ButtonStreamElementView } from './cmp.button-stream-element.svelte';
|
|
3
4
|
export { default as ContainerStreamElementView } from './cmp.container-stream-element.svelte';
|
|
4
5
|
export { default as ImageRefStreamElementView } from './cmp.image-ref-stream-element.svelte';
|
|
5
6
|
export { default as ImagesStreamElementView } from './cmp.images-stream-element.svelte';
|
|
6
7
|
export { default as PriceStreamElementView } from './cmp.price-stream-element.svelte';
|
|
8
|
+
export { default as ProductsSliderStreamElementView } from './cmp.products-slider-stream-element.svelte';
|
|
7
9
|
export { default as ShortVideoStreamElementView } from './cmp.short-video-stream-element.svelte';
|
|
8
10
|
export { default as SpacerStreamElementView } from './cmp.spacer-stream-element.svelte';
|
|
9
11
|
export { default as StockStreamElementView } from './cmp.stock-stream-element.svelte';
|
|
@@ -102,6 +102,9 @@ const adjustHeightToFit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
102
102
|
while (currentHeight > minElementHeight) {
|
|
103
103
|
adjustedHeight = currentHeight;
|
|
104
104
|
yield new Promise((resolve) => requestAnimationFrame(resolve));
|
|
105
|
+
if (!priceContainerRef || !priceElementRef || !adjustableHeight) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
105
108
|
let hasOverflow = priceElementRef.clientWidth < priceContainerRef.clientWidth;
|
|
106
109
|
if (!hasOverflow) {
|
|
107
110
|
break;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StreamElementType, ImagesStreamElementMode, AnnotationStreamElementPlacement, StockStreamElementLevel } from './enums';
|
|
2
|
-
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles, AnnotationStreamElementStyles, StockStreamElementStyles } from './styles';
|
|
3
|
-
export type StreamElementModel = AnnotationStreamElementModel | ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | ShortVideoStreamElementModel | SpacerStreamElementModel | StockStreamElementModel | TextStreamElementModel | TextRefStreamElementModel | WebViewStreamElementModel;
|
|
2
|
+
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles, AnnotationStreamElementStyles, StockStreamElementStyles, ProductsSliderStreamElementStyles, ButtonStreamElementStyles } from './styles';
|
|
3
|
+
export type StreamElementModel = AnnotationStreamElementModel | ButtonStreamElementModel | ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | ProductsSliderStreamElementModel | ShortVideoStreamElementModel | SpacerStreamElementModel | StockStreamElementModel | TextStreamElementModel | TextRefStreamElementModel | WebViewStreamElementModel;
|
|
4
4
|
export type AnnotationStreamElementModel = {
|
|
5
5
|
type: StreamElementType.Annotation;
|
|
6
6
|
$id: string;
|
|
@@ -10,6 +10,14 @@ export type AnnotationStreamElementModel = {
|
|
|
10
10
|
placement: AnnotationStreamElementPlacement;
|
|
11
11
|
styles: AnnotationStreamElementStyles;
|
|
12
12
|
};
|
|
13
|
+
export type ButtonStreamElementModel = {
|
|
14
|
+
type: StreamElementType.Button;
|
|
15
|
+
$id: string;
|
|
16
|
+
name?: string | null;
|
|
17
|
+
text: string | null;
|
|
18
|
+
url: string | null;
|
|
19
|
+
styles: ButtonStreamElementStyles | null;
|
|
20
|
+
};
|
|
13
21
|
export type ContainerStreamElementModel = {
|
|
14
22
|
type: StreamElementType.Container;
|
|
15
23
|
$id: string;
|
|
@@ -42,6 +50,16 @@ export type PriceStreamElementModel = {
|
|
|
42
50
|
stock?: StockStreamElementModel | null;
|
|
43
51
|
styles: PriceStreamElementStyles | null;
|
|
44
52
|
};
|
|
53
|
+
export type ProductsSliderStreamElementModel = {
|
|
54
|
+
type: StreamElementType.ProductsSlider;
|
|
55
|
+
$id: string;
|
|
56
|
+
name?: string | null;
|
|
57
|
+
template: StreamElementModel[];
|
|
58
|
+
items: {
|
|
59
|
+
elements: StreamElementModel[];
|
|
60
|
+
}[];
|
|
61
|
+
styles: ProductsSliderStreamElementStyles | null;
|
|
62
|
+
};
|
|
45
63
|
export type ShortVideoStreamElementModel = {
|
|
46
64
|
type: StreamElementType.ShortVideo;
|
|
47
65
|
$id: string;
|
|
@@ -2,14 +2,17 @@ export declare enum StreamComponentDataType {
|
|
|
2
2
|
Images = "IMAGES",
|
|
3
3
|
NoData = "NO_DATA",
|
|
4
4
|
ShortVideo = "SHORT_VIDEO",
|
|
5
|
-
Product = "PRODUCT"
|
|
5
|
+
Product = "PRODUCT",
|
|
6
|
+
Products = "PRODUCTS"
|
|
6
7
|
}
|
|
7
8
|
export declare enum StreamElementType {
|
|
8
9
|
Annotation = "ANNOTATION",
|
|
10
|
+
Button = "BUTTON",
|
|
9
11
|
Container = "CONTAINER",
|
|
10
12
|
ImageRef = "IMAGE_REF",
|
|
11
13
|
Images = "IMAGES",
|
|
12
14
|
Price = "PRICE",
|
|
15
|
+
ProductsSlider = "PRODUCTS_SLIDER",
|
|
13
16
|
ShortVideo = "SHORT_VIDEO",
|
|
14
17
|
Spacer = "SPACER",
|
|
15
18
|
Stock = "STOCK",
|
|
@@ -4,14 +4,17 @@ export var StreamComponentDataType;
|
|
|
4
4
|
StreamComponentDataType["NoData"] = "NO_DATA";
|
|
5
5
|
StreamComponentDataType["ShortVideo"] = "SHORT_VIDEO";
|
|
6
6
|
StreamComponentDataType["Product"] = "PRODUCT";
|
|
7
|
+
StreamComponentDataType["Products"] = "PRODUCTS";
|
|
7
8
|
})(StreamComponentDataType || (StreamComponentDataType = {}));
|
|
8
9
|
export var StreamElementType;
|
|
9
10
|
(function (StreamElementType) {
|
|
10
11
|
StreamElementType["Annotation"] = "ANNOTATION";
|
|
12
|
+
StreamElementType["Button"] = "BUTTON";
|
|
11
13
|
StreamElementType["Container"] = "CONTAINER";
|
|
12
14
|
StreamElementType["ImageRef"] = "IMAGE_REF";
|
|
13
15
|
StreamElementType["Images"] = "IMAGES";
|
|
14
16
|
StreamElementType["Price"] = "PRICE";
|
|
17
|
+
StreamElementType["ProductsSlider"] = "PRODUCTS_SLIDER";
|
|
15
18
|
StreamElementType["ShortVideo"] = "SHORT_VIDEO";
|
|
16
19
|
StreamElementType["Spacer"] = "SPACER";
|
|
17
20
|
StreamElementType["Stock"] = "STOCK";
|
|
@@ -10,4 +10,5 @@ export * from './svg-attributes';
|
|
|
10
10
|
export type { StreamTrackingParams } from './types';
|
|
11
11
|
export { parseToStreamLayout, parseToStreamLayoutTemplate, stringifyToStreamLayoutInput, IdPopulator } from './serializer.svelte';
|
|
12
12
|
export declare const getAllowedDataTypesForSlot: (slot: StreamSlot) => StreamComponentDataType[];
|
|
13
|
+
export declare const slotAcceptsDataOfType: (slot: StreamSlot, dataType: StreamComponentDataType) => boolean;
|
|
13
14
|
export declare const getSingleShortVideoFromLayout: (layout: StreamLayout) => StreamLayoutShortVideoModel | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Utils } from '../../core/utils';
|
|
1
2
|
import { StreamComponentDataType } from './enums';
|
|
2
3
|
export { default as StreamPageLayout } from './cmp.layout.svelte';
|
|
3
4
|
export { default as StreamLayoutSlot } from './cmp.slot.svelte';
|
|
@@ -8,6 +9,20 @@ export { parseToStreamLayout, parseToStreamLayoutTemplate, stringifyToStreamLayo
|
|
|
8
9
|
export const getAllowedDataTypesForSlot = (slot) => {
|
|
9
10
|
return slot.components.flatMap((c) => c.dataType);
|
|
10
11
|
};
|
|
12
|
+
export const slotAcceptsDataOfType = (slot, dataType) => {
|
|
13
|
+
const allowedDataTypesForSlot = getAllowedDataTypesForSlot(slot);
|
|
14
|
+
switch (dataType) {
|
|
15
|
+
case StreamComponentDataType.Images:
|
|
16
|
+
case StreamComponentDataType.NoData:
|
|
17
|
+
case StreamComponentDataType.Products:
|
|
18
|
+
case StreamComponentDataType.ShortVideo:
|
|
19
|
+
return allowedDataTypesForSlot.includes(dataType);
|
|
20
|
+
case StreamComponentDataType.Product:
|
|
21
|
+
return allowedDataTypesForSlot.includes(StreamComponentDataType.Product) || allowedDataTypesForSlot.includes(StreamComponentDataType.Products);
|
|
22
|
+
default:
|
|
23
|
+
Utils.assertUnreachable(dataType);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
11
26
|
export const getSingleShortVideoFromLayout = (layout) => {
|
|
12
27
|
if (layout.slots.length === 1 && layout.slots[0].data?.type === StreamComponentDataType.ShortVideo && layout.slots[0].data.shortVideo) {
|
|
13
28
|
return layout.slots[0].data.shortVideo;
|
|
@@ -31,28 +31,47 @@ export const stringifyToStreamLayoutInput = (layout) => {
|
|
|
31
31
|
// @ts-expect-error - clearing local data before sending to the server
|
|
32
32
|
delete data.items;
|
|
33
33
|
break;
|
|
34
|
-
case StreamComponentDataType.ShortVideo:
|
|
35
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
36
|
-
delete data.shortVideo;
|
|
37
|
-
break;
|
|
38
34
|
case StreamComponentDataType.Product:
|
|
39
35
|
// @ts-expect-error - clearing local data before sending to the server
|
|
40
36
|
delete data.product;
|
|
41
37
|
break;
|
|
38
|
+
case StreamComponentDataType.Products:
|
|
39
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
40
|
+
delete data.products;
|
|
41
|
+
break;
|
|
42
|
+
case StreamComponentDataType.ShortVideo:
|
|
43
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
44
|
+
delete data.shortVideo;
|
|
45
|
+
break;
|
|
42
46
|
default:
|
|
43
47
|
Utils.assertUnreachable(data);
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
|
-
return JSON.stringify(clone);
|
|
52
|
+
return JSON.stringify(clone, removeNullishReplacer);
|
|
49
53
|
};
|
|
54
|
+
function removeNullishReplacer(key, value) {
|
|
55
|
+
if (key === '') {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
if (value === null || value === undefined) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
50
63
|
const removeElementIdRecursive = (element) => {
|
|
51
64
|
// @ts-expect-error - clearing local data before sending to the server
|
|
52
65
|
delete element.$id;
|
|
53
66
|
if (element.type === StreamElementType.Container && Array.isArray(element.elements)) {
|
|
54
67
|
element.elements.forEach(removeElementIdRecursive);
|
|
55
68
|
}
|
|
69
|
+
if (element.type === StreamElementType.ProductsSlider) {
|
|
70
|
+
element.template.forEach(removeElementIdRecursive);
|
|
71
|
+
if (Array.isArray(element.items)) {
|
|
72
|
+
element.items.flatMap((i) => i.elements).forEach(removeElementIdRecursive);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
56
75
|
if (element.type === StreamElementType.ImageRef && Array.isArray(element.annotations)) {
|
|
57
76
|
element.annotations.forEach((annotation) => {
|
|
58
77
|
// @ts-expect-error - clearing local data before sending to the server
|
|
@@ -82,6 +101,12 @@ export class IdPopulator {
|
|
|
82
101
|
if (element.type === StreamElementType.Container && element.elements) {
|
|
83
102
|
element.elements.forEach((element) => IdPopulator.populateElementId(element));
|
|
84
103
|
}
|
|
104
|
+
if (element.type === StreamElementType.ProductsSlider) {
|
|
105
|
+
element.template.forEach((element) => IdPopulator.populateElementId(element));
|
|
106
|
+
if (element.items) {
|
|
107
|
+
element.items.flatMap((i) => i.elements).forEach((element) => IdPopulator.populateElementId(element));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
85
110
|
if (element.type === StreamElementType.ImageRef && element.annotations) {
|
|
86
111
|
element.annotations.forEach((element) => IdPopulator.populateElementId(element));
|
|
87
112
|
}
|