@streamscloud/embeddable 3.2.4 → 3.2.5
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/core/analytics.profile-id.d.ts +5 -0
- package/dist/core/analytics.profile-id.js +17 -0
- package/dist/core/document.event-handlers.d.ts +1 -0
- package/dist/core/document.event-handlers.js +5 -0
- package/dist/core/enums.d.ts +0 -2
- package/dist/core/enums.js +0 -2
- package/dist/core/graphql.d.ts +3 -1
- package/dist/core/graphql.js +12 -3
- package/dist/core/locale.d.ts +6 -0
- package/dist/core/locale.js +24 -0
- package/dist/core/utils/html-helper.d.ts +1 -0
- package/dist/core/utils/html-helper.js +4 -0
- package/dist/products/price-helper.js +1 -1
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte +103 -37
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +2 -2
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +2 -2
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +6 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +3 -2
- package/dist/short-videos/short-video-viewer/description.svelte +5 -0
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/index.d.ts +4 -2
- package/dist/short-videos/short-video-viewer/index.js +1 -0
- package/dist/short-videos/short-video-viewer/mapper.js +5 -4
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +10 -3
- package/dist/short-videos/short-video-viewer/operations.generated.js +17 -3
- package/dist/short-videos/short-video-viewer/operations.graphql +10 -3
- package/dist/short-videos/short-video-viewer/{short-video-attachments-localization.svelte.d.ts → short-video-attachments-localization.d.ts} +5 -4
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +21 -0
- package/dist/short-videos/short-video-viewer/{short-video-details-localization.svelte.d.ts → short-video-details-localization.d.ts} +7 -6
- package/dist/short-videos/short-video-viewer/short-video-details-localization.js +17 -0
- package/dist/short-videos/short-video-viewer/{short-video-product-localization.svelte.d.ts → short-video-product-localization.d.ts} +2 -1
- package/dist/short-videos/short-video-viewer/short-video-product-localization.js +13 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +14 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +17 -0
- package/dist/short-videos/short-video-viewer/types.d.ts +10 -3
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +88 -11
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +5 -5
- package/dist/short-videos/short-videos-player/controls.svelte +2 -2
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +1 -1
- package/dist/short-videos/short-videos-player/index.d.ts +51 -14
- package/dist/short-videos/short-videos-player/index.js +83 -12
- package/dist/short-videos/short-videos-player/operations.generated.d.ts +71 -0
- package/dist/short-videos/short-videos-player/operations.generated.js +207 -0
- package/dist/short-videos/short-videos-player/operations.graphql +8 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +16 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.js +13 -0
- package/dist/short-videos/short-videos-player/types.d.ts +36 -0
- package/dist/short-videos/short-videos-player/types.js +6 -0
- package/dist/streams/layout/cmp.layout.svelte.d.ts +4 -2
- package/dist/streams/layout/cmp.slot-content.svelte +4 -4
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +2 -1
- package/dist/streams/layout/cmp.slot.svelte.d.ts +7 -2
- package/dist/streams/layout/component.d.ts +2 -0
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +16 -0
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte.d.ts +7 -0
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +1 -1
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +4 -3
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +15 -2
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +7 -3
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +15 -89
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +5 -4
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +4 -2
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +3 -0
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +74 -0
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +11 -0
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +24 -17
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +4 -3
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +2 -2
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +6 -2
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +2 -0
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +37 -0
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +7 -0
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -3
- package/dist/streams/layout/element-views/index.d.ts +16 -11
- package/dist/streams/layout/element-views/index.js +12 -9
- package/dist/streams/layout/element-views/price-element-view.svelte +168 -0
- package/dist/streams/layout/element-views/price-element-view.svelte.d.ts +15 -0
- package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +13 -0
- package/dist/streams/layout/element-views/price-stream-element-localization.js +21 -0
- package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +9 -0
- package/dist/streams/layout/element-views/short-video-stream-element-localization.js +7 -0
- package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +8 -0
- package/dist/streams/layout/element-views/stock-stream-element-localization.js +26 -0
- package/dist/streams/layout/element-views/stream-element-localization.d.ts +15 -0
- package/dist/streams/layout/element-views/stream-element-localization.js +11 -0
- package/dist/streams/layout/elements.d.ts +47 -12
- package/dist/streams/layout/elements.js +1 -1
- package/dist/streams/layout/enums.d.ts +34 -3
- package/dist/streams/layout/enums.js +46 -7
- package/dist/streams/layout/index.d.ts +3 -10
- package/dist/streams/layout/index.js +3 -2
- package/dist/streams/layout/layout.d.ts +2 -1
- package/dist/streams/layout/models/index.d.ts +1 -1
- package/dist/streams/layout/models/mapper.js +5 -4
- 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-post-header-model.d.ts +1 -1
- package/dist/streams/layout/models/stream-layout-product-model.d.ts +1 -2
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +13 -3
- package/dist/streams/layout/serializer.svelte.d.ts +29 -0
- package/dist/streams/layout/serializer.svelte.js +93 -0
- package/dist/streams/layout/slot-data-ref.d.ts +13 -0
- package/dist/streams/layout/slot-data-ref.js +1 -0
- package/dist/streams/layout/slot.d.ts +2 -0
- package/dist/streams/layout/styles-transformer.d.ts +3 -2
- package/dist/streams/layout/styles-transformer.js +54 -30
- package/dist/streams/layout/styles.d.ts +24 -14
- package/dist/streams/layout/svg-attributes.d.ts +7 -0
- package/dist/streams/layout/svg-attributes.js +8 -0
- package/dist/streams/layout/type-guards.d.ts +31 -0
- package/dist/streams/layout/type-guards.js +13 -1
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +4 -2
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +3 -0
- package/dist/streams/stream-page-viewer/index.d.ts +1 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +9 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +7 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +47 -7
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +6 -4
- package/dist/streams/stream-player/controls.svelte +46 -3
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -1
- package/dist/streams/stream-player/index.d.ts +6 -4
- package/dist/streams/stream-player/index.js +15 -28
- package/dist/streams/stream-player/operations.generated.d.ts +1 -1
- package/dist/streams/stream-player/operations.generated.js +5 -3
- package/dist/streams/stream-player/operations.graphql +3 -3
- package/dist/streams/stream-player/stream-overview.svelte +2 -2
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -1
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +2 -2
- package/dist/streams/stream-player/stream-player-localization.d.ts +26 -0
- package/dist/streams/stream-player/stream-player-localization.js +31 -0
- package/dist/ui/icon/cmp.icon.svelte +13 -26
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +3 -2
- package/dist/ui/line-clamp/index.d.ts +1 -1
- package/dist/ui/line-clamp/index.js +1 -1
- package/dist/ui/line-clamp/{line-clamp-localization.svelte.d.ts → line-clamp-localization.d.ts} +2 -1
- package/dist/ui/line-clamp/line-clamp-localization.js +19 -0
- package/dist/ui/shadow-dom/shadow-host.d.ts +1 -5
- package/dist/ui/shadow-dom/shadow-host.js +1 -14
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +125 -0
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +9 -0
- package/dist/ui/swipe-indicator/index.d.ts +2 -0
- package/dist/ui/swipe-indicator/index.js +1 -0
- package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +8 -0
- package/dist/ui/swipe-indicator/swipe-indicator-localization.js +13 -0
- package/dist/ui/time-ago/cmp.time-ago.svelte +1 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +3 -2
- package/dist/ui/time-ago/index.d.ts +1 -1
- package/dist/ui/time-ago/{time-ago-localization.svelte.d.ts → time-ago-localization.d.ts} +2 -1
- package/dist/ui/time-ago/time-ago-localization.js +55 -0
- package/dist/ui/video/cmp.video.svelte +42 -18
- package/package.json +1 -1
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +0 -11
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +0 -13
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +0 -10
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +0 -8
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +0 -6
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +0 -8
- package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +0 -8
- package/dist/streams/layout/element-views/stream-element-localization.svelte.js +0 -6
- package/dist/streams/layout/serializer.d.ts +0 -3
- package/dist/streams/layout/serializer.js +0 -6
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +0 -13
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +0 -10
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +0 -12
- package/dist/streams/stream-player/stream-player-localization.svelte.js +0 -10
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +0 -15
- package/dist/ui/time-ago/time-ago-localization.svelte.js +0 -39
|
@@ -1,53 +1,77 @@
|
|
|
1
1
|
import { Utils } from '../../core/utils';
|
|
2
|
-
import { StreamCssValueType, StreamElementStyleDirection, StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleMediaFit, StreamElementStyleHorizontalAlign } from './enums';
|
|
2
|
+
import { StreamCssValueType, StreamElementStyleDirection, StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleMediaFit, StreamElementStyleHorizontalAlign, AnnotationStreamElementPlacement } from './enums';
|
|
3
3
|
export const generateStreamLayoutStyles = (styles) => {
|
|
4
4
|
if (!styles) {
|
|
5
5
|
return '';
|
|
6
6
|
}
|
|
7
|
-
const values = [`background-color: ${transformColorValue(styles.backgroundColor)}
|
|
8
|
-
return values.join('');
|
|
7
|
+
const values = [`background-color: ${transformColorValue(styles.backgroundColor)}`, `font-family: ${mapFontFamily(styles.fontFamily)}`];
|
|
8
|
+
return values.join(';');
|
|
9
9
|
};
|
|
10
10
|
export const generateContainerStyles = (styles) => {
|
|
11
11
|
styles = styles || {};
|
|
12
12
|
const values = [
|
|
13
|
-
'display: flex
|
|
14
|
-
'flex-direction: column
|
|
15
|
-
`width: ${transformCssValue(styles.width, 'auto')}
|
|
16
|
-
`height: ${transformCssValue(styles.height, 'fit-content')}
|
|
17
|
-
`aspect-ratio: ${styles.aspectRatio || 'auto'}
|
|
18
|
-
`gap: ${transformNumericValue(styles.gap)}
|
|
19
|
-
`padding-top: ${transformNumericValue(styles.paddingTop)}
|
|
20
|
-
`padding-right: ${transformNumericValue(styles.paddingRight)}
|
|
21
|
-
`padding-bottom: ${transformNumericValue(styles.paddingBottom)}
|
|
22
|
-
`padding-left: ${transformNumericValue(styles.paddingLeft)}
|
|
23
|
-
`background-color: ${transformColorValue(styles.backgroundColor)}
|
|
24
|
-
`border-width: ${styles.borderColor ? '1px' : '0'}
|
|
25
|
-
`border-radius: ${transformNumericValue(styles.borderRadius)}
|
|
26
|
-
`border-color: ${transformColorValue(styles.borderColor)}
|
|
27
|
-
`overflow: ${styles.borderRadius ? 'hidden' : 'visible'}
|
|
13
|
+
'display: flex',
|
|
14
|
+
'flex-direction: column',
|
|
15
|
+
`width: ${transformCssValue(styles.width, 'auto')}`,
|
|
16
|
+
`height: ${transformCssValue(styles.height, 'fit-content')}`,
|
|
17
|
+
`aspect-ratio: ${styles.aspectRatio || 'auto'}`,
|
|
18
|
+
`gap: ${transformNumericValue(styles.gap)}`,
|
|
19
|
+
`padding-top: ${transformNumericValue(styles.paddingTop)}`,
|
|
20
|
+
`padding-right: ${transformNumericValue(styles.paddingRight)}`,
|
|
21
|
+
`padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
|
|
22
|
+
`padding-left: ${transformNumericValue(styles.paddingLeft)}`,
|
|
23
|
+
`background-color: ${transformColorValue(styles.backgroundColor)}`,
|
|
24
|
+
`border-width: ${styles.borderColor ? '1px' : '0'}`,
|
|
25
|
+
`border-radius: ${transformNumericValue(styles.borderRadius)}`,
|
|
26
|
+
`border-color: ${transformColorValue(styles.borderColor)}`,
|
|
27
|
+
`overflow: ${styles.borderRadius ? 'hidden' : 'visible'}`
|
|
28
28
|
];
|
|
29
29
|
if (styles.direction) {
|
|
30
|
-
values.push(`display: flex
|
|
31
|
-
values.push(`flex-direction: ${styles.direction === StreamElementStyleDirection.Horizontal ? 'row' : 'column'}
|
|
30
|
+
values.push(`display: flex`);
|
|
31
|
+
values.push(`flex-direction: ${styles.direction === StreamElementStyleDirection.Horizontal ? 'row' : 'column'}`);
|
|
32
32
|
}
|
|
33
|
-
return values.join('');
|
|
33
|
+
return values.join(';');
|
|
34
|
+
};
|
|
35
|
+
export const generateAnnotationStyles = (styles, placement) => {
|
|
36
|
+
const values = [`height: ${transformNumericValue(styles.height)}`, `aspect-ratio: ${styles.aspectRatio}`, 'position: absolute'];
|
|
37
|
+
switch (placement) {
|
|
38
|
+
case AnnotationStreamElementPlacement.TopLeft:
|
|
39
|
+
values.push(`top: ${transformNumericValue(styles.offsetY)}`);
|
|
40
|
+
values.push(`left: ${transformNumericValue(styles.offsetX)}`);
|
|
41
|
+
break;
|
|
42
|
+
case AnnotationStreamElementPlacement.TopRight:
|
|
43
|
+
values.push(`top: ${transformNumericValue(styles.offsetY)}`);
|
|
44
|
+
values.push(`right: ${transformNumericValue(styles.offsetX)}`);
|
|
45
|
+
break;
|
|
46
|
+
case AnnotationStreamElementPlacement.BottomLeft:
|
|
47
|
+
values.push(`bottom: ${transformNumericValue(styles.offsetY)}`);
|
|
48
|
+
values.push(`left: ${transformNumericValue(styles.offsetX)}`);
|
|
49
|
+
break;
|
|
50
|
+
case AnnotationStreamElementPlacement.BottomRight:
|
|
51
|
+
values.push(`bottom: ${transformNumericValue(styles.offsetY)}`);
|
|
52
|
+
values.push(`right: ${transformNumericValue(styles.offsetX)}`);
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
Utils.assertUnreachable(placement);
|
|
56
|
+
}
|
|
57
|
+
return values.join(';');
|
|
34
58
|
};
|
|
35
59
|
export const generateTextStyles = (styles) => {
|
|
36
60
|
styles = styles || {};
|
|
37
61
|
const values = [
|
|
38
|
-
`font-family: ${mapFontFamily(styles.fontFamily)}
|
|
39
|
-
`font-size: ${transformFontSizeValue(styles.fontSize)}
|
|
40
|
-
`font-weight: ${mapFontWeight(styles.fontWeight)}
|
|
41
|
-
`line-height: ${transformNumericValue(styles.lineHeight, '1.2')}
|
|
42
|
-
`text-align: ${mapTextAlign(styles.textAlign)}
|
|
43
|
-
`color: ${transformColorValue(styles.color)}
|
|
62
|
+
`font-family: ${mapFontFamily(styles.fontFamily)}`,
|
|
63
|
+
`font-size: ${transformFontSizeValue(styles.fontSize)}`,
|
|
64
|
+
`font-weight: ${mapFontWeight(styles.fontWeight)}`,
|
|
65
|
+
`line-height: ${transformNumericValue(styles.lineHeight, '1.2')}`,
|
|
66
|
+
`text-align: ${mapTextAlign(styles.textAlign)}`,
|
|
67
|
+
`color: ${transformColorValue(styles.color)}`
|
|
44
68
|
];
|
|
45
|
-
return values.join('');
|
|
69
|
+
return values.join(';');
|
|
46
70
|
};
|
|
47
71
|
export const generateImageStyles = (styles) => {
|
|
48
72
|
styles = styles || {};
|
|
49
|
-
const imageStyles = [`object-fit: ${mapMediaFit(styles.mediaFit)}
|
|
50
|
-
return imageStyles.join('');
|
|
73
|
+
const imageStyles = [`object-fit: ${mapMediaFit(styles.mediaFit)}`];
|
|
74
|
+
return imageStyles.join(';');
|
|
51
75
|
};
|
|
52
76
|
export const mapFontFamily = (value) => {
|
|
53
77
|
switch (value) {
|
|
@@ -4,6 +4,26 @@ export type StreamLayoutStyles = {
|
|
|
4
4
|
backgroundColor?: string | null;
|
|
5
5
|
fontFamily?: StreamElementStyleFontFamily | null;
|
|
6
6
|
};
|
|
7
|
+
export type AnnotationStreamElementStyles = {
|
|
8
|
+
height: number;
|
|
9
|
+
aspectRatio: number;
|
|
10
|
+
offsetX: number;
|
|
11
|
+
offsetY: number;
|
|
12
|
+
};
|
|
13
|
+
export type ContainerStreamElementStyles = {
|
|
14
|
+
width?: StreamCssValue | null;
|
|
15
|
+
height?: StreamCssValue | null;
|
|
16
|
+
aspectRatio?: number | null;
|
|
17
|
+
direction?: StreamElementStyleDirection | null;
|
|
18
|
+
gap?: number | null;
|
|
19
|
+
paddingTop?: number | null;
|
|
20
|
+
paddingRight?: number | null;
|
|
21
|
+
paddingBottom?: number | null;
|
|
22
|
+
paddingLeft?: number | null;
|
|
23
|
+
backgroundColor?: string | null;
|
|
24
|
+
borderRadius?: number | null;
|
|
25
|
+
borderColor?: string | null;
|
|
26
|
+
};
|
|
7
27
|
export type ImageStreamElementStyles = {
|
|
8
28
|
mediaFit?: StreamElementStyleMediaFit | null;
|
|
9
29
|
};
|
|
@@ -18,6 +38,10 @@ export type PriceStreamElementStyles = {
|
|
|
18
38
|
beforeValueColor?: string | null;
|
|
19
39
|
horizontalAlign?: StreamElementStyleHorizontalAlign | null;
|
|
20
40
|
};
|
|
41
|
+
export type StockStreamElementStyles = {
|
|
42
|
+
height?: number | null;
|
|
43
|
+
horizontalAlign?: StreamElementStyleHorizontalAlign | null;
|
|
44
|
+
};
|
|
21
45
|
export type TextStreamElementStyles = {
|
|
22
46
|
fontSize?: number | null;
|
|
23
47
|
fontWeight?: StreamElementStyleFontWeight | null;
|
|
@@ -27,17 +51,3 @@ export type TextStreamElementStyles = {
|
|
|
27
51
|
color?: string | null;
|
|
28
52
|
maxLines?: number | null;
|
|
29
53
|
};
|
|
30
|
-
export type ContainerStreamElementStyles = {
|
|
31
|
-
width?: StreamCssValue | null;
|
|
32
|
-
height?: StreamCssValue | null;
|
|
33
|
-
aspectRatio?: number | null;
|
|
34
|
-
direction?: StreamElementStyleDirection | null;
|
|
35
|
-
gap?: number | null;
|
|
36
|
-
paddingTop?: number | null;
|
|
37
|
-
paddingRight?: number | null;
|
|
38
|
-
paddingBottom?: number | null;
|
|
39
|
-
paddingLeft?: number | null;
|
|
40
|
-
backgroundColor?: string | null;
|
|
41
|
-
borderRadius?: number | null;
|
|
42
|
-
borderColor?: string | null;
|
|
43
|
-
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare enum SvgAttributes {
|
|
2
|
+
customizableElement = "data-streams--customizable",
|
|
3
|
+
textElementValueType = "data-streams--text--value-type",
|
|
4
|
+
textElementCustomValue = "data-streams--text--custom-value",
|
|
5
|
+
textElementValueBefore = "data-streams--text--value-before",
|
|
6
|
+
textElementValueAfter = "data-streams--text--value-after"
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var SvgAttributes;
|
|
2
|
+
(function (SvgAttributes) {
|
|
3
|
+
SvgAttributes["customizableElement"] = "data-streams--customizable";
|
|
4
|
+
SvgAttributes["textElementValueType"] = "data-streams--text--value-type";
|
|
5
|
+
SvgAttributes["textElementCustomValue"] = "data-streams--text--custom-value";
|
|
6
|
+
SvgAttributes["textElementValueBefore"] = "data-streams--text--value-before";
|
|
7
|
+
SvgAttributes["textElementValueAfter"] = "data-streams--text--value-after";
|
|
8
|
+
})(SvgAttributes || (SvgAttributes = {}));
|
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
import type { AnnotationStreamElementModel, ContainerStreamElementModel, ImageRefStreamElementModel, ImagesStreamElementModel, PriceStreamElementModel, ShortVideoStreamElementModel, SpacerStreamElementModel, StockStreamElementModel, TextRefStreamElementModel, TextStreamElementModel, WebViewStreamElementModel } from './elements';
|
|
2
|
+
import { StreamElementType } from './enums';
|
|
1
3
|
import type { ImagesStreamSlotData, ProductStreamSlotData, ShortVideoStreamSlotData, StreamSlotData } from './slot-data';
|
|
2
4
|
import type { ImagesStreamSlotDataInput, ProductStreamSlotDataInput, ShortVideoStreamSlotDataInput, StreamSlotDataInput } from './slot-data-input';
|
|
5
|
+
import type { AnnotationStreamElementStyles, ContainerStreamElementStyles, ImageStreamElementStyles, PriceStreamElementStyles, StockStreamElementStyles, TextStreamElementStyles } from './styles';
|
|
3
6
|
export declare function isImagesSlotDataInput(data: StreamSlotDataInput | null): data is ImagesStreamSlotDataInput;
|
|
4
7
|
export declare function isProductSlotDataInput(data: StreamSlotDataInput | null): data is ProductStreamSlotDataInput;
|
|
5
8
|
export declare function isShortVideoSlotDataInput(data: StreamSlotDataInput | null): data is ShortVideoStreamSlotDataInput;
|
|
6
9
|
export declare function isImagesSlotData(data: StreamSlotData | null): data is ImagesStreamSlotData;
|
|
7
10
|
export declare function isProductSlotData(data: StreamSlotData | null): data is ProductStreamSlotData;
|
|
8
11
|
export declare function isShortVideoSlotData(data: StreamSlotData | null): data is ShortVideoStreamSlotData;
|
|
12
|
+
export type ElementTypeToStylesMap = {
|
|
13
|
+
[StreamElementType.Annotation]: AnnotationStreamElementStyles;
|
|
14
|
+
[StreamElementType.Container]: ContainerStreamElementStyles;
|
|
15
|
+
[StreamElementType.Price]: PriceStreamElementStyles;
|
|
16
|
+
[StreamElementType.ImageRef]: ImageStreamElementStyles;
|
|
17
|
+
[StreamElementType.Stock]: StockStreamElementStyles;
|
|
18
|
+
[StreamElementType.Text]: TextStreamElementStyles;
|
|
19
|
+
[StreamElementType.TextRef]: TextStreamElementStyles;
|
|
20
|
+
};
|
|
21
|
+
export type ElementTypeToModelMap = {
|
|
22
|
+
[StreamElementType.Annotation]: AnnotationStreamElementModel;
|
|
23
|
+
[StreamElementType.Container]: ContainerStreamElementModel;
|
|
24
|
+
[StreamElementType.ImageRef]: ImageRefStreamElementModel;
|
|
25
|
+
[StreamElementType.Images]: ImagesStreamElementModel;
|
|
26
|
+
[StreamElementType.Price]: PriceStreamElementModel;
|
|
27
|
+
[StreamElementType.ShortVideo]: ShortVideoStreamElementModel;
|
|
28
|
+
[StreamElementType.Spacer]: SpacerStreamElementModel;
|
|
29
|
+
[StreamElementType.Stock]: StockStreamElementModel;
|
|
30
|
+
[StreamElementType.Text]: TextStreamElementModel;
|
|
31
|
+
[StreamElementType.TextRef]: TextRefStreamElementModel;
|
|
32
|
+
[StreamElementType.WebView]: WebViewStreamElementModel;
|
|
33
|
+
};
|
|
34
|
+
export declare const NotAllowedElementTypesForComponent: {
|
|
35
|
+
IMAGES: StreamElementType[];
|
|
36
|
+
PRODUCT: StreamElementType[];
|
|
37
|
+
SHORT_VIDEO: StreamElementType[];
|
|
38
|
+
NO_DATA: StreamElementType[];
|
|
39
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
1
|
+
import { StreamComponentDataType, StreamElementType } from './enums';
|
|
2
2
|
// SlotDataInput guards
|
|
3
3
|
export function isImagesSlotDataInput(data) {
|
|
4
4
|
return data?.type === StreamComponentDataType.Images;
|
|
@@ -19,3 +19,15 @@ export function isProductSlotData(data) {
|
|
|
19
19
|
export function isShortVideoSlotData(data) {
|
|
20
20
|
return data?.type === StreamComponentDataType.ShortVideo;
|
|
21
21
|
}
|
|
22
|
+
export const NotAllowedElementTypesForComponent = {
|
|
23
|
+
[StreamComponentDataType.Images]: [StreamElementType.ImageRef, StreamElementType.Price, StreamElementType.ShortVideo, StreamElementType.TextRef],
|
|
24
|
+
[StreamComponentDataType.Product]: [StreamElementType.Images, StreamElementType.ShortVideo],
|
|
25
|
+
[StreamComponentDataType.ShortVideo]: [StreamElementType.ImageRef, StreamElementType.Price, StreamElementType.TextRef],
|
|
26
|
+
[StreamComponentDataType.NoData]: [
|
|
27
|
+
StreamElementType.ImageRef,
|
|
28
|
+
StreamElementType.Images,
|
|
29
|
+
StreamElementType.Price,
|
|
30
|
+
StreamElementType.ShortVideo,
|
|
31
|
+
StreamElementType.TextRef
|
|
32
|
+
]
|
|
33
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script lang="ts">import { StreamLayoutSlot, StreamPageLayout, StreamLayoutSlotContent } from '../layout';
|
|
2
|
-
|
|
2
|
+
import { StreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
3
|
+
let { page, localization: localizationInit, on } = $props();
|
|
4
|
+
const localization = $derived(new StreamPageViewerLocalization(localizationInit));
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
7
|
{#if page.type === 'general'}
|
|
6
8
|
<StreamPageLayout model={page.layout}>
|
|
7
9
|
{#each page.layout.slots as slot (slot)}
|
|
8
10
|
<StreamLayoutSlot model={slot}>
|
|
9
|
-
<StreamLayoutSlotContent model={slot} on={on} />
|
|
11
|
+
<StreamLayoutSlotContent model={slot} on={on} localization={localization.elementsLocalization} />
|
|
10
12
|
</StreamLayoutSlot>
|
|
11
13
|
{/each}
|
|
12
14
|
</StreamPageLayout>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { Locale } from '../../core/locale';
|
|
2
|
+
import { type IStreamPageViewerLocalization } from './stream-page-viewer-localization';
|
|
1
3
|
import type { StreamPageViewerModel } from './types';
|
|
2
4
|
type Props = {
|
|
3
5
|
page: StreamPageViewerModel;
|
|
6
|
+
localization: IStreamPageViewerLocalization | Locale;
|
|
4
7
|
on?: {
|
|
5
8
|
productClick: (productId: string) => void;
|
|
6
9
|
progress?: (videoId: string, progress: number) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Locale } from '../../core/locale';
|
|
2
|
+
import type { IStreamElementLocalization } from '../layout/element-views';
|
|
3
|
+
export interface IStreamPageViewerLocalization {
|
|
4
|
+
elementsLocalization?: IStreamElementLocalization | Locale;
|
|
5
|
+
}
|
|
6
|
+
export declare class StreamPageViewerLocalization {
|
|
7
|
+
elementsLocalization: IStreamElementLocalization | Locale;
|
|
8
|
+
constructor(init: IStreamPageViewerLocalization | Locale);
|
|
9
|
+
}
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { getOrCreateProfileId } from '../../core/analytics.profile-id';
|
|
11
|
+
import { handleEsc } from '../../core/document.event-handlers';
|
|
12
|
+
import { constructGraphQLUrl, createLocalGQLClient } from '../../core/graphql';
|
|
10
13
|
import { toastrWarning } from '../../core/toastr';
|
|
11
14
|
import { ShortVideoViewer } from '../../short-videos/short-video-viewer';
|
|
12
15
|
import { mapToShortVideoViewerModel } from '../layout/models';
|
|
@@ -14,21 +17,23 @@ import { StreamPageViewer } from '../stream-page-viewer';
|
|
|
14
17
|
import { Loading } from '../../ui/loading';
|
|
15
18
|
import { PlayerSlider } from '../../ui/player';
|
|
16
19
|
import { SpotlightLayout } from '../../ui/spotlight-layout';
|
|
20
|
+
import { SwipeIndicator } from '../../ui/swipe-indicator';
|
|
17
21
|
import { default as Controls } from './controls.svelte';
|
|
18
22
|
import { mapStreamPlayerModel } from './mapper';
|
|
19
23
|
import { GetStreamDocument } from './operations.generated';
|
|
20
24
|
import { default as Overview } from './stream-overview.svelte';
|
|
21
25
|
import { StreamPlayerBuffer } from './stream-player-buffer.svelte';
|
|
22
|
-
import { StreamPlayerLocalization } from './stream-player-localization
|
|
26
|
+
import { StreamPlayerLocalization } from './stream-player-localization';
|
|
23
27
|
import { StreamPlayerUiManager } from './ui-manager.svelte';
|
|
24
|
-
import { onMount } from 'svelte';
|
|
25
28
|
import { AppEventsTracker } from '@streamscloud/streams-analytics-collector';
|
|
26
|
-
|
|
29
|
+
import { onMount } from 'svelte';
|
|
30
|
+
let { streamId, graphqlOrigin, localization: localizationInit, showStreamsCloudWatermark, initiator, on } = $props();
|
|
27
31
|
const localization = $derived(new StreamPlayerLocalization(localizationInit));
|
|
28
32
|
let model = $state(null);
|
|
29
33
|
let buffer = $state.raw(null);
|
|
30
34
|
let loading = $state(true);
|
|
31
35
|
let activePageId = $derived.by(() => { var _a, _b; return (_b = (_a = buffer === null || buffer === void 0 ? void 0 : buffer.current) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ''; });
|
|
36
|
+
let everTouched = $state(false);
|
|
32
37
|
let totalEngagementTimeSeconds = 0;
|
|
33
38
|
let inactiveTimeSeconds = 10; // // Mark as inactive after 10 seconds of no activity
|
|
34
39
|
let isActive = true;
|
|
@@ -51,12 +56,15 @@ onMount(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
51
56
|
var _a, _b, _c, _d;
|
|
52
57
|
uiManager.overviewCollapsed = window && window.innerWidth < window.innerHeight;
|
|
53
58
|
try {
|
|
59
|
+
const graphql = createLocalGQLClient(graphqlOrigin, { 'x-initiator': initiator !== null && initiator !== void 0 ? initiator : 'player/stream' });
|
|
54
60
|
const streamPayload = yield graphql.query(GetStreamDocument, { id: streamId }).toPromise();
|
|
55
61
|
if (!((_a = streamPayload.data) === null || _a === void 0 ? void 0 : _a.stream)) {
|
|
56
62
|
toastrWarning(localization.streamNotFound);
|
|
57
63
|
(_b = on === null || on === void 0 ? void 0 : on.closePlayer) === null || _b === void 0 ? void 0 : _b.call(on);
|
|
58
64
|
return;
|
|
59
65
|
}
|
|
66
|
+
AppEventsTracker.setEndpoint(constructGraphQLUrl(graphqlOrigin));
|
|
67
|
+
AppEventsTracker.setProfileId(getOrCreateProfileId());
|
|
60
68
|
(_c = on === null || on === void 0 ? void 0 : on.streamActivated) === null || _c === void 0 ? void 0 : _c.call(on, {
|
|
61
69
|
ownerId: streamPayload.data.stream.ownerProfile.id,
|
|
62
70
|
title: streamPayload.data.stream.title,
|
|
@@ -115,6 +123,19 @@ const handleDimensionsChanged = (dimensions) => {
|
|
|
115
123
|
viewTotalWidth: dimensions.totalWidth
|
|
116
124
|
});
|
|
117
125
|
};
|
|
126
|
+
const contentMounted = (node) => {
|
|
127
|
+
const markAsTouched = () => {
|
|
128
|
+
everTouched = true;
|
|
129
|
+
node.removeEventListener('touchstart', markAsTouched);
|
|
130
|
+
node.removeEventListener('wheel', markAsTouched);
|
|
131
|
+
node.removeEventListener('click', markAsTouched);
|
|
132
|
+
node.removeEventListener('keypress', markAsTouched);
|
|
133
|
+
};
|
|
134
|
+
node.addEventListener('touchstart', markAsTouched);
|
|
135
|
+
node.addEventListener('wheel', markAsTouched);
|
|
136
|
+
node.addEventListener('click', markAsTouched);
|
|
137
|
+
node.addEventListener('keypress', markAsTouched);
|
|
138
|
+
};
|
|
118
139
|
const onPageActivated = (id) => {
|
|
119
140
|
const page = buffer === null || buffer === void 0 ? void 0 : buffer.loaded.find((x) => x.id === id);
|
|
120
141
|
if (page) {
|
|
@@ -146,14 +167,23 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
146
167
|
};
|
|
147
168
|
</script>
|
|
148
169
|
|
|
170
|
+
<svelte:document onkeydown={(e) => handleEsc(e, onPlayerClose)} />
|
|
171
|
+
|
|
149
172
|
<div class="stream-player-container">
|
|
150
173
|
{#if loading}
|
|
151
174
|
<Loading positionAbsoluteCenter={true} timeout={600} />
|
|
152
175
|
{/if}
|
|
153
176
|
<div class="stream-player" style={uiManager.globalCssVariables}>
|
|
177
|
+
{#if showStreamsCloudWatermark}
|
|
178
|
+
<div class="stream-player__watermark">
|
|
179
|
+
<a href="https://streamscloud.com/" tabindex="-1" aria-label="none">
|
|
180
|
+
<img src="https://embedabble-assets.streamscloud-cdn.com/watermark.svg" alt="StreamsCloud" />
|
|
181
|
+
</a>
|
|
182
|
+
</div>
|
|
183
|
+
{/if}
|
|
154
184
|
{#if buffer && model}
|
|
155
185
|
<SpotlightLayout ratio={9 / 16} on={{ dimensionsChanged: handleDimensionsChanged }}>
|
|
156
|
-
<div class="stream-player__content">
|
|
186
|
+
<div class="stream-player__content" use:contentMounted>
|
|
157
187
|
<PlayerSlider
|
|
158
188
|
buffer={buffer}
|
|
159
189
|
on={{
|
|
@@ -164,9 +194,10 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
164
194
|
{#if item.type === 'general'}
|
|
165
195
|
<StreamPageViewer
|
|
166
196
|
page={item}
|
|
197
|
+
localization={localization.streamPageViewerLocalization}
|
|
167
198
|
on={{
|
|
168
|
-
progress: (videoId:
|
|
169
|
-
productClick: (productId:
|
|
199
|
+
progress: (videoId: String, progress: Number) => onProgress(item.id, videoId, progress),
|
|
200
|
+
productClick: (productId: String) => onProductCardClick(productId)
|
|
170
201
|
}} />
|
|
171
202
|
{:else if item.type === 'short-video'}
|
|
172
203
|
<ShortVideoViewer
|
|
@@ -175,10 +206,14 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
175
206
|
progress: (progress) => onProgress(item.id, item.shortVideo.id, progress)
|
|
176
207
|
}}
|
|
177
208
|
autoplay="on-appearance"
|
|
209
|
+
localization={localization.shortVideoViewerLocalization}
|
|
178
210
|
showAttachments={uiManager.showShortVideoOverlay} />
|
|
179
211
|
{/if}
|
|
180
212
|
{/snippet}
|
|
181
213
|
</PlayerSlider>
|
|
214
|
+
{#if uiManager.isMobileView && buffer.loaded.length > 1 && !everTouched}
|
|
215
|
+
<SwipeIndicator localization={localization.swipeIndicatorLocalization} />
|
|
216
|
+
{/if}
|
|
182
217
|
</div>
|
|
183
218
|
</SpotlightLayout>
|
|
184
219
|
{#if model}
|
|
@@ -196,7 +231,7 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
196
231
|
localization={localization}
|
|
197
232
|
on={{
|
|
198
233
|
closePlayer: () => onPlayerClose(),
|
|
199
|
-
productClick: (productId:
|
|
234
|
+
productClick: (productId: String) => onProductCardClick(productId)
|
|
200
235
|
}} />
|
|
201
236
|
{/if}
|
|
202
237
|
</div>
|
|
@@ -237,6 +272,11 @@ const onProgress = (pageId, videoId, progress) => {
|
|
|
237
272
|
padding: 0;
|
|
238
273
|
}
|
|
239
274
|
}
|
|
275
|
+
.stream-player__watermark {
|
|
276
|
+
position: absolute;
|
|
277
|
+
bottom: 5rem;
|
|
278
|
+
left: 20rem;
|
|
279
|
+
}
|
|
240
280
|
.stream-player__content {
|
|
241
281
|
width: 100%;
|
|
242
282
|
height: 100%;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import type { Locale } from '../../core/locale';
|
|
2
|
+
import { type IStreamPlayerLocalization } from './stream-player-localization';
|
|
3
3
|
type Props = {
|
|
4
4
|
streamId: string;
|
|
5
|
-
localization
|
|
6
|
-
|
|
5
|
+
localization: IStreamPlayerLocalization | Locale;
|
|
6
|
+
graphqlOrigin?: string;
|
|
7
|
+
showStreamsCloudWatermark?: boolean;
|
|
8
|
+
initiator?: string;
|
|
7
9
|
on?: {
|
|
8
10
|
closePlayer?: () => void;
|
|
9
11
|
streamActivated?: (data: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts">var _a, _b;
|
|
2
2
|
import { ShortVideoDetails, ShortVideoViewerAttachmentsInline, ShortVideoViewerAttachments } from '../../short-videos/short-video-viewer';
|
|
3
|
+
import { StreamElementType } from '../layout/enums';
|
|
3
4
|
import { mapToShortVideoViewerModel } from '../layout/models';
|
|
4
5
|
import { Icon } from '../../ui/icon';
|
|
5
6
|
import { MediaVolumeManager } from '../../ui/media-playback';
|
|
6
7
|
import { default as ActionButton } from './action-button.svelte';
|
|
7
|
-
import { StreamPlayerLocalization } from './stream-player-localization
|
|
8
|
+
import { StreamPlayerLocalization } from './stream-player-localization';
|
|
8
9
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
9
10
|
import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_20_regular.svg?raw';
|
|
10
11
|
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_20_regular.svg?raw';
|
|
@@ -17,6 +18,36 @@ const toggleMuted = () => {
|
|
|
17
18
|
MediaVolumeManager.isMuted = !MediaVolumeManager.isMuted;
|
|
18
19
|
};
|
|
19
20
|
const shortVideo = $derived(((_a = buffer.current) === null || _a === void 0 ? void 0 : _a.type) === 'short-video' && ((_b = buffer.current) === null || _b === void 0 ? void 0 : _b.shortVideo) ? mapToShortVideoViewerModel(buffer.current.shortVideo) : null);
|
|
21
|
+
const singleWebViewPage = $derived.by(() => {
|
|
22
|
+
var _a;
|
|
23
|
+
if (((_a = buffer.current) === null || _a === void 0 ? void 0 : _a.type) !== 'general') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const layout = buffer.current.layout;
|
|
27
|
+
const collectRenderableElements = (elements) => {
|
|
28
|
+
const renderableElements = [];
|
|
29
|
+
for (const element of elements) {
|
|
30
|
+
if (element.type === StreamElementType.Container) {
|
|
31
|
+
if (element.elements) {
|
|
32
|
+
renderableElements.push(...collectRenderableElements(element.elements));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
renderableElements.push(element);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return renderableElements;
|
|
40
|
+
};
|
|
41
|
+
const allRenderableElements = [];
|
|
42
|
+
for (const slot of layout.slots) {
|
|
43
|
+
for (const component of slot.components) {
|
|
44
|
+
if (component.elements) {
|
|
45
|
+
allRenderableElements.push(...collectRenderableElements(component.elements));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return allRenderableElements.length === 1 && allRenderableElements[0].type === StreamElementType.WebView;
|
|
50
|
+
});
|
|
20
51
|
</script>
|
|
21
52
|
|
|
22
53
|
<div class="stream-player-controls">
|
|
@@ -28,7 +59,7 @@ const shortVideo = $derived(((_a = buffer.current) === null || _a === void 0 ? v
|
|
|
28
59
|
</div>
|
|
29
60
|
</div>
|
|
30
61
|
{/if}
|
|
31
|
-
<div class="stream-player-controls__navigation-buttons">
|
|
62
|
+
<div class="stream-player-controls__navigation-buttons" class:stream-player-controls__navigation-buttons--single-web-view-page={singleWebViewPage}>
|
|
32
63
|
<button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
|
|
33
64
|
<Icon src={IconChevronUp} />
|
|
34
65
|
</button>
|
|
@@ -42,7 +73,7 @@ const shortVideo = $derived(((_a = buffer.current) === null || _a === void 0 ? v
|
|
|
42
73
|
<div class="stream-player-controls__short-video-attachments">
|
|
43
74
|
<ShortVideoViewerAttachments
|
|
44
75
|
shortVideo={shortVideo}
|
|
45
|
-
localization={localization.
|
|
76
|
+
localization={localization.shortVideoAttachmentsLocalization}
|
|
46
77
|
on={{
|
|
47
78
|
productClick: on.productClick
|
|
48
79
|
}} />
|
|
@@ -214,6 +245,18 @@ const shortVideo = $derived(((_a = buffer.current) === null || _a === void 0 ? v
|
|
|
214
245
|
visibility: hidden;
|
|
215
246
|
}
|
|
216
247
|
}
|
|
248
|
+
.stream-player-controls__navigation-buttons--single-web-view-page {
|
|
249
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
250
|
+
}
|
|
251
|
+
@container (width < 6.25rem) {
|
|
252
|
+
.stream-player-controls__navigation-buttons--single-web-view-page {
|
|
253
|
+
visibility: visible;
|
|
254
|
+
position: absolute;
|
|
255
|
+
bottom: var(--stream-player--controls--offset-vertical);
|
|
256
|
+
right: var(--stream-player--controls--offset-horizontal);
|
|
257
|
+
z-index: 1;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
217
260
|
.stream-player-controls__controls {
|
|
218
261
|
display: flex;
|
|
219
262
|
margin-top: auto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StreamPlayerBuffer } from './stream-player-buffer.svelte';
|
|
2
|
-
import { StreamPlayerLocalization } from './stream-player-localization
|
|
2
|
+
import { StreamPlayerLocalization } from './stream-player-localization';
|
|
3
3
|
import type { StreamPlayerUiManager } from './ui-manager.svelte';
|
|
4
4
|
type Props = {
|
|
5
5
|
buffer: StreamPlayerBuffer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IStreamPlayerLocalization } from './stream-player-localization
|
|
1
|
+
import type { IStreamPlayerLocalization } from './stream-player-localization';
|
|
2
2
|
export type { IStreamPlayerLocalization };
|
|
3
3
|
/**
|
|
4
4
|
* Opens the stream player modal with the specified stream details.
|
|
@@ -15,7 +15,7 @@ export type { IStreamPlayerLocalization };
|
|
|
15
15
|
*
|
|
16
16
|
* openStreamPlayer({
|
|
17
17
|
* streamId: '...',
|
|
18
|
-
*
|
|
18
|
+
* graphqlOrigin: 'https://api.example.com',
|
|
19
19
|
* localization: {
|
|
20
20
|
* play: 'Play',
|
|
21
21
|
* pause: 'Pause'
|
|
@@ -25,8 +25,10 @@ export type { IStreamPlayerLocalization };
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const openStreamPlayer: (init: {
|
|
27
27
|
streamId: string;
|
|
28
|
-
|
|
29
|
-
localization?: IStreamPlayerLocalization;
|
|
28
|
+
graphqlOrigin?: string;
|
|
29
|
+
localization?: IStreamPlayerLocalization | "en" | "no";
|
|
30
|
+
showStreamsCloudWatermark?: boolean;
|
|
31
|
+
initiator?: string;
|
|
30
32
|
on?: {
|
|
31
33
|
streamActivated?: (data: {
|
|
32
34
|
title: string;
|