@streamscloud/embeddable 7.0.1 → 7.0.2-1759149696160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/ads/ad-card/cmp.ad-card.svelte +13 -12
  2. package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +2 -2
  3. package/dist/content-player/cmp.content-player.svelte +224 -0
  4. package/dist/content-player/cmp.content-player.svelte.d.ts +33 -0
  5. package/dist/content-player/content-player-config.svelte.d.ts +49 -0
  6. package/dist/content-player/content-player-config.svelte.js +43 -0
  7. package/dist/content-player/controls-and-attachments.svelte +275 -0
  8. package/dist/content-player/controls-and-attachments.svelte.d.ts +28 -0
  9. package/dist/content-player/fade-mixins.scss +12 -0
  10. package/dist/content-player/index.d.ts +2 -0
  11. package/dist/content-player/index.js +2 -0
  12. package/dist/content-player/overview-panel.svelte +85 -0
  13. package/dist/content-player/overview-panel.svelte.d.ts +10 -0
  14. package/dist/{streams/stream-player → content-player}/ui-manager.svelte.d.ts +10 -9
  15. package/dist/content-player/ui-manager.svelte.js +68 -0
  16. package/dist/index.d.ts +0 -1
  17. package/dist/index.js +0 -1
  18. package/dist/media-center/config/internal-media-center-config.js +2 -1
  19. package/dist/media-center/config/types.d.ts +1 -1
  20. package/dist/media-center/media-center/cmp.media-center.svelte +13 -9
  21. package/dist/media-center/media-center/overview.svelte +3 -2
  22. package/dist/media-center/media-center/short-video-resources-generator.d.ts +1 -1
  23. package/dist/media-center/model/types.d.ts +12 -0
  24. package/dist/posts/attachments/cmp.attachments.svelte +50 -0
  25. package/dist/{short-videos/short-video-viewer → posts/attachments}/cmp.attachments.svelte.d.ts +3 -3
  26. package/dist/posts/attachments/index.d.ts +1 -0
  27. package/dist/posts/attachments/index.js +1 -0
  28. package/dist/{short-videos/short-video-viewer/cmp.short-video-controls.svelte → posts/controls/cmp.controls.svelte} +21 -26
  29. package/dist/posts/controls/cmp.controls.svelte.d.ts +11 -0
  30. package/dist/posts/controls/index.d.ts +1 -0
  31. package/dist/posts/controls/index.js +1 -0
  32. package/dist/posts/index.d.ts +4 -0
  33. package/dist/posts/index.js +2 -0
  34. package/dist/posts/model/types.d.ts +13 -0
  35. package/dist/posts/model/types.js +1 -0
  36. package/dist/{short-videos/short-video-viewer/cmp.attachments-horizontal.svelte → posts/post-viewer/attachments-horizontal.svelte} +2 -3
  37. package/dist/posts/post-viewer/attachments-horizontal.svelte.d.ts +13 -0
  38. package/dist/posts/post-viewer/cmp.post-viewer.svelte +120 -0
  39. package/dist/{short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts → posts/post-viewer/cmp.post-viewer.svelte.d.ts} +3 -2
  40. package/dist/posts/post-viewer/heading.svelte +76 -0
  41. package/dist/posts/post-viewer/heading.svelte.d.ts +9 -0
  42. package/dist/posts/post-viewer/index.d.ts +4 -0
  43. package/dist/posts/post-viewer/index.js +3 -0
  44. package/dist/posts/post-viewer/mapper.d.ts +3 -0
  45. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/mapper.js +33 -17
  46. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/operations.generated.d.ts +2 -2
  47. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/operations.generated.js +2 -2
  48. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/operations.graphql +1 -1
  49. package/dist/posts/post-viewer/post-media.svelte +20 -0
  50. package/dist/posts/post-viewer/post-media.svelte.d.ts +12 -0
  51. package/dist/{short-videos/short-video-viewer/short-video-viewer-localization.d.ts → posts/post-viewer/post-viewer-localization.d.ts} +2 -3
  52. package/dist/{short-videos/short-video-viewer/short-video-viewer-localization.js → posts/post-viewer/post-viewer-localization.js} +3 -5
  53. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/types.d.ts +24 -25
  54. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/ui-manager.svelte.d.ts +5 -3
  55. package/dist/{short-videos/short-video-viewer → posts/post-viewer}/ui-manager.svelte.js +11 -4
  56. package/dist/posts/post-viewer/utils.d.ts +2 -0
  57. package/dist/posts/post-viewer/utils.js +13 -0
  58. package/dist/posts/social-interactions/index.d.ts +1 -0
  59. package/dist/posts/social-interactions/index.js +1 -0
  60. package/dist/posts/social-interactions/types.d.ts +9 -0
  61. package/dist/posts/social-interactions/types.js +1 -0
  62. package/dist/products/product-card/cmp.product-card.svelte +27 -8
  63. package/dist/products/product-card/cmp.product-card.svelte.d.ts +2 -1
  64. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +11 -17
  65. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +1 -5
  66. package/dist/short-videos/short-videos-player/index.d.ts +20 -5
  67. package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.d.ts +1 -1
  68. package/dist/short-videos/short-videos-player/internal-short-video-analytics-handler.js +1 -1
  69. package/dist/short-videos/short-videos-player/internal-short-video-player-provider.d.ts +1 -1
  70. package/dist/short-videos/short-videos-player/mapper.js +2 -2
  71. package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +50 -216
  72. package/dist/short-videos/short-videos-player/short-videos-player-view.svelte.d.ts +2 -9
  73. package/dist/short-videos/short-videos-player/types.d.ts +6 -7
  74. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +3 -3
  75. package/dist/streams/layout/models/index.d.ts +1 -1
  76. package/dist/streams/layout/models/index.js +1 -1
  77. package/dist/streams/layout/models/mapper.d.ts +2 -2
  78. package/dist/streams/layout/models/mapper.js +6 -6
  79. package/dist/streams/stream-player/index.d.ts +25 -4
  80. package/dist/streams/stream-player/internal-stream-analytics-handler.d.ts +2 -0
  81. package/dist/streams/stream-player/internal-stream-analytics-handler.js +2 -0
  82. package/dist/streams/stream-player/stream-overview.svelte +47 -122
  83. package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -4
  84. package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +1 -1
  85. package/dist/streams/stream-player/stream-player-localization.d.ts +1 -5
  86. package/dist/streams/stream-player/stream-player-localization.js +2 -10
  87. package/dist/streams/stream-player/stream-player-view.svelte +229 -0
  88. package/dist/streams/stream-player/stream-player-view.svelte.d.ts +8 -0
  89. package/dist/streams/stream-player/types.d.ts +4 -4
  90. package/dist/ui/{player → player-slider}/cmp.player-slider.svelte.d.ts +2 -10
  91. package/dist/ui/{player → player-slider}/types.d.ts +9 -0
  92. package/dist/ui/player-slider/types.js +1 -0
  93. package/package.json +1 -1
  94. package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte.d.ts +0 -13
  95. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +0 -52
  96. package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte.d.ts +0 -19
  97. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +0 -89
  98. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +0 -9
  99. package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte +0 -26
  100. package/dist/short-videos/short-video-viewer/cmp.short-video-product-card.svelte.d.ts +0 -16
  101. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +0 -146
  102. package/dist/short-videos/short-video-viewer/index.d.ts +0 -5
  103. package/dist/short-videos/short-video-viewer/index.js +0 -4
  104. package/dist/short-videos/short-video-viewer/mapper.d.ts +0 -3
  105. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.d.ts +0 -5
  106. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +0 -7
  107. package/dist/short-videos/short-videos-player/controls.svelte +0 -261
  108. package/dist/short-videos/short-videos-player/controls.svelte.d.ts +0 -22
  109. package/dist/short-videos/short-videos-player/fade-mixins.scss +0 -12
  110. package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +0 -7
  111. package/dist/short-videos/short-videos-player/short-videos-player-localization.js +0 -11
  112. package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +0 -24
  113. package/dist/short-videos/short-videos-player/ui-manager.svelte.js +0 -47
  114. package/dist/streams/cmp.stream-product-card.svelte +0 -25
  115. package/dist/streams/cmp.stream-product-card.svelte.d.ts +0 -16
  116. package/dist/streams/stream-player/controls.svelte +0 -301
  117. package/dist/streams/stream-player/controls.svelte.d.ts +0 -20
  118. package/dist/streams/stream-player/fade-mixins.scss +0 -12
  119. package/dist/streams/stream-player/stream-player.svelte +0 -393
  120. package/dist/streams/stream-player/stream-player.svelte.d.ts +0 -16
  121. package/dist/streams/stream-player/ui-manager.svelte.js +0 -63
  122. /package/dist/{streams/stream-player → content-player}/button-mixins.scss +0 -0
  123. /package/dist/{ui/player → media-center/model}/types.js +0 -0
  124. /package/dist/{short-videos/short-video-viewer → posts/post-viewer}/types.js +0 -0
  125. /package/dist/ui/{player → player-slider}/cmp.player-slider.svelte +0 -0
  126. /package/dist/ui/{player → player-slider}/index.d.ts +0 -0
  127. /package/dist/ui/{player → player-slider}/index.js +0 -0
  128. /package/dist/ui/{player → player-slider}/player-buffer.svelte.d.ts +0 -0
  129. /package/dist/ui/{player → player-slider}/player-buffer.svelte.js +0 -0
  130. /package/dist/ui/{player → player-slider}/prevent-slider-scroll.d.ts +0 -0
  131. /package/dist/ui/{player → player-slider}/prevent-slider-scroll.js +0 -0
  132. /package/dist/ui/{player → player-slider}/wheel-gestures-adapter.d.ts +0 -0
  133. /package/dist/ui/{player → player-slider}/wheel-gestures-adapter.js +0 -0
@@ -1,89 +0,0 @@
1
- <script lang="ts">import { ImageRound } from '../../ui/image';
2
- import { TimeAgo } from '../../ui/time-ago';
3
- import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
4
- let { model, localization } = $props();
5
- </script>
6
-
7
- <div class="short-video-heading">
8
- <div class="short-video-heading__source-image">
9
- <ImageRound src={model.image} alt={`${model.name} profilbilde`} noBorders={true} />
10
- </div>
11
-
12
- <div class="short-video-heading__info">
13
- <div class="short-video-heading__source-name">{model.name}</div>
14
- <p class="short-video-heading__metadata">
15
- <TimeAgo date={model.displayDate} locale={localization.timeAgoLocale} />
16
- {#if Number.isInteger(model.viewsCount) && model.viewsCount}
17
- <span>&middot;</span>
18
- {localization.viewsCount(model.viewsCount)}
19
- {/if}
20
- </p>
21
- </div>
22
- </div>
23
-
24
- <style>@keyframes fadeIn {
25
- 0% {
26
- opacity: 1;
27
- }
28
- 50% {
29
- opacity: 0.4;
30
- }
31
- 100% {
32
- opacity: 1;
33
- }
34
- }
35
- .short-video-heading {
36
- --_short-video-heading--container--font-size: var(--short-video-heading--container--font-size, 1em);
37
- --_short-video-heading--text--color: var(--short-video-heading--text--color, #374151);
38
- --_short-video-heading--text--shadow: var(--short-video-heading--text--shadow, 1px 1px hsl(0, 0%, 10%));
39
- --_short-video-heading--meta--color: var(--short-video-heading--meta--color, #6b7280);
40
- --_short-video-heading--meta--shadow: var(--short-video-heading--meta--shadow, 1px 1px hsl(0, 0%, 10%));
41
- --_short-video-heading--padding: var(--short-video-heading--padding, 0);
42
- display: flex;
43
- align-items: center;
44
- padding: var(--_short-video-heading--padding);
45
- min-width: 0;
46
- font-size: var(--_short-video-heading--container--font-size);
47
- }
48
- .short-video-heading__source-image {
49
- width: 2em;
50
- min-width: 2em;
51
- max-width: 2em;
52
- height: 2em;
53
- min-height: 2em;
54
- max-height: 2em;
55
- margin-right: 0.625em;
56
- --image--rounded--outer--border-radius: 0.5em;
57
- --image--rounded--inner--border-width: 0;
58
- --rounded-img-background: none;
59
- }
60
- .short-video-heading__info {
61
- display: flex;
62
- flex-direction: column;
63
- min-width: 0;
64
- }
65
- .short-video-heading__source-name {
66
- font-size: 0.75em;
67
- line-height: 1.25em;
68
- font-weight: 500;
69
- color: var(--_short-video-heading--text--color);
70
- text-shadow: var(--_short-video-heading--text--shadow);
71
- text-overflow: ellipsis;
72
- width: 100%;
73
- white-space: nowrap;
74
- overflow: hidden;
75
- }
76
- :global([data-theme="dark"]) .short-video-heading__source-name {
77
- --_short-video-heading--text--color: var(--short-video-heading--text--color, #ffffff);
78
- }
79
- .short-video-heading__metadata {
80
- margin: 0;
81
- font-size: 0.625em;
82
- line-height: 1.2em;
83
- font-weight: 400;
84
- color: var(--_short-video-heading--meta--color);
85
- text-shadow: var(--_short-video-heading--meta--shadow);
86
- }
87
- :global([data-theme="dark"]) .short-video-heading__metadata {
88
- --_short-video-heading--meta--color: var(--short-video-heading--meta--color, #d1d5db);
89
- }</style>
@@ -1,9 +0,0 @@
1
- import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
2
- import type { ShortVideoViewerHeadingModel } from './types';
3
- type Props = {
4
- model: ShortVideoViewerHeadingModel;
5
- localization: ShortVideoViewerLocalization;
6
- };
7
- declare const Cmp: import("svelte").Component<Props, {}, "">;
8
- type Cmp = ReturnType<typeof Cmp>;
9
- export default Cmp;
@@ -1,26 +0,0 @@
1
- <script lang="ts">import { ProductCard } from '../../products/product-card';
2
- import { onMount } from 'svelte';
3
- let { product, videoId, locale, includeBeforeNowPrefix, inert = false, on } = $props();
4
- let productElement;
5
- const productData = product;
6
- onMount(() => {
7
- if (productElement && (on === null || on === void 0 ? void 0 : on.impression)) {
8
- const observer = new IntersectionObserver((entries) => {
9
- entries.forEach((entry) => {
10
- if (entry.isIntersecting && entry.intersectionRatio >= 0.5) {
11
- on.impression(product.id, videoId);
12
- observer.unobserve(entry.target);
13
- }
14
- });
15
- }, { threshold: 0.5 });
16
- observer.observe(productElement);
17
- return () => {
18
- observer.disconnect();
19
- };
20
- }
21
- });
22
- </script>
23
-
24
- <div bind:this={productElement}>
25
- <ProductCard product={productData} locale={locale} includeBeforeNowPrefix={includeBeforeNowPrefix} inert={inert} on={on} />
26
- </div>
@@ -1,16 +0,0 @@
1
- import type { Locale } from '../../core/locale';
2
- import type { ShortVideoProductCardModel } from './types';
3
- type Props = {
4
- product: ShortVideoProductCardModel;
5
- videoId: string;
6
- locale?: Locale;
7
- includeBeforeNowPrefix?: boolean;
8
- inert?: boolean;
9
- on?: {
10
- productClick?: (id: string) => void;
11
- impression?: (productId: string, videoId: string) => void;
12
- };
13
- };
14
- declare const Cmp: import("svelte").Component<Props, {}, "">;
15
- type Cmp = ReturnType<typeof Cmp>;
16
- export default Cmp;
@@ -1,146 +0,0 @@
1
- <script lang="ts">import { Image } from '../../ui/image';
2
- import { LineClamp } from '../../ui/line-clamp';
3
- import { Video } from '../../ui/video';
4
- import { default as AttachmentsHorizontal } from './cmp.attachments-horizontal.svelte';
5
- import { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
6
- import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
7
- import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
8
- import { ShortVideoViewerUiManager } from './ui-manager.svelte';
9
- let { model, socialInteractionsHandler, showAttachments = true, showControls = true, autoplay = 'on-appearance', locale = 'en', on } = $props();
10
- const localization = $derived(new ShortVideoViewerLocalization(locale));
11
- const uiManager = new ShortVideoViewerUiManager();
12
- $effect(() => {
13
- uiManager.updateCanShowAttachments(showAttachments);
14
- uiManager.updateCanShowControls(showControls);
15
- });
16
- const trackControlsPanelSize = (node) => {
17
- const resizeObserver = new ResizeObserver(([entry]) => {
18
- const width = entry.contentRect.width;
19
- uiManager.setControlsPanelWidth(width);
20
- });
21
- resizeObserver.observe(node);
22
- return {
23
- destroy() {
24
- resizeObserver.unobserve(node);
25
- }
26
- };
27
- };
28
- </script>
29
-
30
- <div class="short-video-viewer" style={uiManager.globalCssVariables}>
31
- {#if !model.media.isImage}
32
- <Video
33
- src={model.media.url}
34
- poster={model.media.thumbnailUrl}
35
- controls={false}
36
- autoplay={autoplay}
37
- loop={true}
38
- id={model.id}
39
- hideSpeaker={true}
40
- on={{
41
- progress: on?.progress
42
- }} />
43
- {:else}
44
- <Image src={model.media.url} />
45
- {/if}
46
- <div class="short-video-viewer__information">
47
- {#if model.heading}
48
- <div class="short-video-viewer__heading">
49
- <ShortVideoHeading model={model.heading} localization={localization} />
50
- </div>
51
- {/if}
52
- <div class="short-video-viewer__text">
53
- {#if model.text}
54
- <LineClamp value={model.text} maxLines={2} enableShowMore={true} />
55
- {/if}
56
- </div>
57
- {#if uiManager.showAttachments && model.hasAttachments}
58
- <div class="short-video-viewer__attachments">
59
- <AttachmentsHorizontal
60
- model={model}
61
- on={{
62
- productClick: on?.productClick,
63
- productImpression: on?.productImpression,
64
- adClick: on?.adClick,
65
- adImpression: on?.adImpression
66
- }} />
67
- </div>
68
- {/if}
69
- </div>
70
-
71
- <div class="short-video-viewer__controls-panel" use:trackControlsPanelSize>
72
- {#if uiManager.showControls}
73
- <ShortVideoControls model={model} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: uiManager.toggleEnableAttachments }} />
74
- {/if}
75
- </div>
76
- </div>
77
-
78
- <style>@keyframes fadeIn {
79
- 0% {
80
- opacity: 1;
81
- }
82
- 50% {
83
- opacity: 0.4;
84
- }
85
- 100% {
86
- opacity: 1;
87
- }
88
- }
89
- .short-video-viewer {
90
- --video--media-fit: cover;
91
- width: 100%;
92
- min-width: 100%;
93
- max-width: 100%;
94
- height: 100%;
95
- min-height: 100%;
96
- max-height: 100%;
97
- border-radius: 0.375rem;
98
- overflow: hidden;
99
- position: relative;
100
- /* Set 'container-type: inline-size;' to reference container*/
101
- }
102
- @container (width < 576px) {
103
- .short-video-viewer {
104
- border-radius: 0;
105
- position: relative;
106
- }
107
- }
108
- .short-video-viewer__controls-panel {
109
- position: absolute;
110
- left: auto;
111
- right: 0.625rem;
112
- top: 5rem;
113
- bottom: 6.25rem;
114
- gap: 2.5rem;
115
- display: flex;
116
- flex-direction: column;
117
- justify-content: flex-end;
118
- align-items: flex-end;
119
- }
120
- .short-video-viewer__information {
121
- position: absolute;
122
- bottom: 0;
123
- left: 0;
124
- right: 0;
125
- padding: 1.875rem 0;
126
- background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 100%);
127
- --_short-video-viewer--information--padding-horizontal: 1.25rem;
128
- --_short-video-viewer--information--padding-right: calc(1.875rem + var(--_short-video-viewer--controls-panel--width));
129
- }
130
- .short-video-viewer__heading {
131
- --short-video-heading--padding: 0 var(--_short-video-viewer--information--padding-right) 0.875rem
132
- var(--_short-video-viewer--information--padding-horizontal);
133
- --short-video-heading--text--color: #ffffff;
134
- --short-video-heading--meta--color: #ffffff;
135
- }
136
- .short-video-viewer__text {
137
- color: #ffffff;
138
- font-size: 1.125rem;
139
- font-weight: 400;
140
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
141
- padding: 0 var(--_short-video-viewer--information--padding-right) 0 var(--_short-video-viewer--information--padding-horizontal);
142
- }
143
- .short-video-viewer__attachments {
144
- margin-top: 1.25rem;
145
- --short-video-attachments-horizontal--padding-horizontal: var(--_short-video-viewer--information--padding-horizontal);
146
- }</style>
@@ -1,5 +0,0 @@
1
- export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
2
- export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
3
- export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
4
- export type { ShortVideoViewerModel, IPostSocialInteractionsHandler, ShortVideoAdCardModel, ShortVideoProductCardModel } from './types';
5
- export { mapToShortVideoViewerModel } from './mapper';
@@ -1,4 +0,0 @@
1
- export { default as ShortVideoViewer } from './cmp.short-video-viewer.svelte';
2
- export { default as ShortVideoControls } from './cmp.short-video-controls.svelte';
3
- export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
4
- export { mapToShortVideoViewerModel } from './mapper';
@@ -1,3 +0,0 @@
1
- import type { ShortVideoViewerPayloadFragment } from './operations.generated';
2
- import type { ShortVideoViewerModel } from './types';
3
- export declare const mapToShortVideoViewerModel: (payload: ShortVideoViewerPayloadFragment) => ShortVideoViewerModel;
@@ -1,5 +0,0 @@
1
- import { type Locale } from '../../core/locale';
2
- export declare class ShortVideoAttachmentsLocalization {
3
- productLocale: Locale;
4
- constructor(locale: Locale);
5
- }
@@ -1,7 +0,0 @@
1
- import {} from '../../core/locale';
2
- export class ShortVideoAttachmentsLocalization {
3
- productLocale;
4
- constructor(locale) {
5
- this.productLocale = locale;
6
- }
7
- }
@@ -1,261 +0,0 @@
1
- <script lang="ts">import { slideHorizontally } from '../../core/transitions';
2
- import { ShortVideoControls, ShortVideoViewerAttachments } from '../short-video-viewer';
3
- import { Icon } from '../../ui/icon';
4
- import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
5
- import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
6
- import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_20_regular.svg?raw';
7
- import IconDismiss from '@fluentui/svg-icons/icons/dismiss_20_regular.svg?raw';
8
- let { buffer, uiManager, localization, socialInteractionsHandler, playerLogo, on } = $props();
9
- const shortVideo = $derived(buffer.current);
10
- const changeShowAttachments = () => {
11
- uiManager.showAttachments = !uiManager.showAttachments;
12
- };
13
- const trackAttachmentsPanelSize = (node) => {
14
- const resizeObserver = new ResizeObserver(([entry]) => {
15
- const width = entry.contentRect.width;
16
- uiManager.setAttachmentsPanelWidth(width);
17
- });
18
- resizeObserver.observe(node);
19
- return {
20
- destroy() {
21
- resizeObserver.unobserve(node);
22
- }
23
- };
24
- };
25
- const trackNavigationButtonsSize = (node) => {
26
- const resizeObserver = new ResizeObserver(([entry]) => {
27
- const width = entry.contentRect.width;
28
- uiManager.setNavigationButtonsBlockWidth(width);
29
- });
30
- resizeObserver.observe(node);
31
- return {
32
- destroy() {
33
- resizeObserver.unobserve(node);
34
- }
35
- };
36
- };
37
- </script>
38
-
39
- {#if uiManager.viewInitialized && (!uiManager.showShortVideoOverlayAttachments || !uiManager.showShortVideoOverlayControls)}
40
- <div class="short-videos-player-controls" class:short-videos-player-controls--with-logo={!!playerLogo}>
41
- {#if !uiManager.showShortVideoOverlayControls}
42
- <div class="short-videos-player-controls__left">
43
- {#if shortVideo}
44
- <div class="short-videos-player-controls__short-video-controls">
45
- <ShortVideoControls model={shortVideo} socialInteractionsHandler={socialInteractionsHandler} on={{ attachmentsClicked: changeShowAttachments }} />
46
- </div>
47
- {/if}
48
- <div class="short-videos-player-controls__navigation-buttons" use:trackNavigationButtonsSize>
49
- <button type="button" class="navigation-button" disabled={!buffer.canLoadPrevious} onclick={buffer.loadPrevious}>
50
- <span class="navigation-button__icon">
51
- <Icon src={IconChevronUp} />
52
- </span>
53
- </button>
54
- <button type="button" class="navigation-button" disabled={!buffer.canLoadNext} onclick={buffer.loadNext}>
55
- <span class="navigation-button__icon">
56
- <Icon src={IconChevronDown} />
57
- </span>
58
- </button>
59
- </div>
60
- </div>
61
- {/if}
62
-
63
- <div class="short-videos-player-controls__right" use:trackAttachmentsPanelSize>
64
- {#if !uiManager.showShortVideoOverlayAttachments}
65
- {#if playerLogo}
66
- <div class="short-videos-player-controls__player-logo">
67
- <img src={playerLogo} class="short-videos-player-controls__logo-img" alt="Player Logo" />
68
- </div>
69
- {/if}
70
- {#if shortVideo?.hasAttachments && uiManager.showAttachments}
71
- <div class="short-videos-player-controls__short-video-attachments" transition:slideHorizontally|local>
72
- <ShortVideoViewerAttachments
73
- shortVideo={shortVideo}
74
- locale={localization.shortVideoAttachmentsLocale}
75
- on={{
76
- productClick: on.productClick,
77
- productImpression: on.productImpression,
78
- adClick: on.adClick,
79
- adImpression: on.adImpression
80
- }} />
81
- </div>
82
- {/if}
83
- {/if}
84
- </div>
85
- </div>
86
- {/if}
87
-
88
- {#if on.closePlayer}
89
- <button type="button" class="close-button" onclick={on.closePlayer}>
90
- <Icon src={IconDismiss} />
91
- </button>
92
- {/if}
93
-
94
- <style>@keyframes fadeIn {
95
- 0% {
96
- opacity: 1;
97
- }
98
- 50% {
99
- opacity: 0.4;
100
- }
101
- 100% {
102
- opacity: 1;
103
- }
104
- }
105
- .short-videos-player-controls {
106
- position: absolute;
107
- top: 0;
108
- right: 0;
109
- height: 100%;
110
- width: var(--short-videos-player--controls--available-space);
111
- display: flex;
112
- justify-content: space-between;
113
- padding: var(--short-videos-player--controls--padding);
114
- container-type: inline-size;
115
- }
116
- .short-videos-player-controls--with-logo {
117
- padding-top: 0;
118
- }
119
- .short-videos-player-controls__left {
120
- display: flex;
121
- flex-direction: column;
122
- gap: 2.3125rem;
123
- justify-content: flex-end;
124
- align-items: center;
125
- padding-top: var(--short-videos-player--media-center-header--height);
126
- opacity: var(--short-videos-player--elements-opacity);
127
- transition: opacity 0.3s ease-in-out;
128
- }
129
- .short-videos-player-controls__right {
130
- flex: 1;
131
- display: flex;
132
- justify-content: space-between;
133
- align-items: flex-end;
134
- flex-direction: column;
135
- overflow-x: hidden;
136
- overflow-y: auto;
137
- scrollbar-color: transparent transparent;
138
- scrollbar-width: thin;
139
- scrollbar-gutter: stable;
140
- }
141
- .short-videos-player-controls__right::-webkit-scrollbar {
142
- width: 3px;
143
- height: 3px;
144
- background: transparent;
145
- }
146
- .short-videos-player-controls__right::-webkit-scrollbar-thumb {
147
- background: transparent;
148
- }
149
- .short-videos-player-controls__right:hover {
150
- scrollbar-color: var(--custom-scrollbar-color, #7d7d7d) var(--custom-scrollbar-background, transparent);
151
- scrollbar-width: thin;
152
- }
153
- .short-videos-player-controls__right:hover::-webkit-scrollbar {
154
- width: 3px;
155
- height: 3px;
156
- background: var(--custom-scrollbar-background, transparent);
157
- }
158
- .short-videos-player-controls__right:hover::-webkit-scrollbar-thumb {
159
- background: var(--custom-scrollbar-color, #7d7d7d);
160
- }
161
- .short-videos-player-controls__short-video-controls {
162
- gap: 2.5rem;
163
- display: flex;
164
- flex: 1;
165
- min-height: 0;
166
- flex-direction: column;
167
- align-items: flex-start;
168
- justify-content: flex-end;
169
- --short-video-controls--icon--size: 1.75rem;
170
- }
171
- .short-videos-player-controls__player-logo {
172
- width: var(--short-videos-player--controls--attachments--max-width);
173
- max-width: var(--short-videos-player--controls--attachments--max-width);
174
- height: var(--short-videos-player--media-center-header--height);
175
- min-height: var(--short-videos-player--media-center-header--height);
176
- max-height: var(--short-videos-player--media-center-header--height);
177
- display: flex;
178
- justify-content: center;
179
- align-items: center;
180
- }
181
- .short-videos-player-controls__logo-img {
182
- width: 6.25rem;
183
- min-width: 6.25rem;
184
- max-width: 6.25rem;
185
- }
186
- .short-videos-player-controls__short-video-attachments {
187
- flex: 1;
188
- width: var(--short-videos-player--controls--attachments--max-width);
189
- max-width: var(--short-videos-player--controls--attachments--max-width);
190
- opacity: var(--short-videos-player--elements-opacity);
191
- transition: opacity 0.3s ease-in-out;
192
- }
193
- .short-videos-player-controls__navigation-buttons {
194
- display: flex;
195
- flex-direction: column;
196
- gap: 1rem;
197
- margin-bottom: 0.625rem;
198
- z-index: 1;
199
- }
200
-
201
- .close-button {
202
- width: 3rem;
203
- min-width: 3rem;
204
- max-width: 3rem;
205
- height: 3rem;
206
- min-height: 3rem;
207
- max-height: 3rem;
208
- background-color: rgba(0, 0, 0, 0.6);
209
- border: 1px solid #1c1c1c;
210
- border-radius: 50%;
211
- text-align: center;
212
- --icon--color: #ffffff;
213
- --icon--size: 1.75rem;
214
- position: absolute;
215
- top: 0.9375rem;
216
- left: 0.625rem;
217
- z-index: 1;
218
- /* Set 'container-type: inline-size;' to reference container*/
219
- }
220
- .close-button:disabled {
221
- opacity: 0.5;
222
- cursor: default;
223
- }
224
- .close-button:hover {
225
- background-color: rgba(0, 0, 0, 0.9);
226
- transition: background-color 0.5s;
227
- }
228
- @container (width < 576px) {
229
- .close-button {
230
- left: unset;
231
- right: 0.625rem;
232
- }
233
- }
234
-
235
- .navigation-button {
236
- --_icon-scale: 1;
237
- width: 3rem;
238
- min-width: 3rem;
239
- max-width: 3rem;
240
- height: 3rem;
241
- min-height: 3rem;
242
- max-height: 3rem;
243
- background-color: rgba(0, 0, 0, 0.6);
244
- border: 1px solid #1c1c1c;
245
- border-radius: 50%;
246
- text-align: center;
247
- --icon--color: #ffffff;
248
- --icon--size: 1.75rem;
249
- }
250
- .navigation-button:disabled {
251
- opacity: 0.5;
252
- cursor: default;
253
- }
254
- .navigation-button:hover:not(:disabled) {
255
- --_icon-scale: 1.2;
256
- }
257
- .navigation-button__icon {
258
- display: block;
259
- transform: scale(var(--_icon-scale));
260
- transition: 0.3s;
261
- }</style>
@@ -1,22 +0,0 @@
1
- import { type IPostSocialInteractionsHandler } from '../short-video-viewer';
2
- import type { IPlayerBuffer } from '../../ui/player';
3
- import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
4
- import type { ShortVideoPlayerModel } from './types';
5
- import type { ShortVideosPlayerUiManager } from './ui-manager.svelte';
6
- type Props = {
7
- buffer: IPlayerBuffer<ShortVideoPlayerModel>;
8
- uiManager: ShortVideosPlayerUiManager;
9
- localization: ShortVideosPlayerLocalization;
10
- socialInteractionsHandler?: IPostSocialInteractionsHandler;
11
- playerLogo: string | null;
12
- on: {
13
- closePlayer?: () => void;
14
- productClick?: (productId: string) => void;
15
- productImpression?: (productId: string, videoId: string) => void;
16
- adClick?: (adId: string) => void;
17
- adImpression?: (adId: string) => void;
18
- };
19
- };
20
- declare const Controls: import("svelte").Component<Props, {}, "">;
21
- type Controls = ReturnType<typeof Controls>;
22
- export default Controls;
@@ -1,12 +0,0 @@
1
- @mixin default-opacity {
2
- --short-videos-player--elements-opacity: 1;
3
- }
4
-
5
- @mixin fade-opacity {
6
- --short-videos-player--elements-opacity: 0;
7
- }
8
-
9
- @mixin handle-fade {
10
- opacity: var(--short-videos-player--elements-opacity);
11
- transition: opacity 0.3s ease-in-out;
12
- }
@@ -1,7 +0,0 @@
1
- import { type Locale } from '../../core/locale';
2
- export declare class ShortVideosPlayerLocalization {
3
- shortVideoAttachmentsLocale: Locale;
4
- shortVideoViewerLocale: Locale;
5
- swipeIndicatorLocale: Locale;
6
- constructor(locale: Locale);
7
- }
@@ -1,11 +0,0 @@
1
- import {} from '../../core/locale';
2
- export class ShortVideosPlayerLocalization {
3
- shortVideoAttachmentsLocale;
4
- shortVideoViewerLocale;
5
- swipeIndicatorLocale;
6
- constructor(locale) {
7
- this.shortVideoAttachmentsLocale = locale;
8
- this.shortVideoViewerLocale = locale;
9
- this.swipeIndicatorLocale = locale;
10
- }
11
- }
@@ -1,24 +0,0 @@
1
- export declare class ShortVideosPlayerUiManager {
2
- showAttachments: boolean;
3
- globalCssVariables: string;
4
- isMobileView: boolean;
5
- viewInitialized: boolean;
6
- showShortVideoOverlayAttachments: boolean;
7
- showShortVideoOverlayControls: boolean;
8
- private _viewTotalWidth;
9
- private _mainViewColumnWidth;
10
- private _mediaCenterHeaderHeight;
11
- private _controlsAttachmentsPanelWidth;
12
- private _controlsNavigationButtonsWidth;
13
- private _controlsAvailableSpace;
14
- private _controlsContentWidth;
15
- get viewTotalWidth(): number;
16
- get mainViewColumnWidth(): number;
17
- updateDimensions: (dimensions: {
18
- viewTotalWidth: number;
19
- mainViewColumnWidth: number;
20
- }) => void;
21
- updateMediaCenterHeaderHeight: (height: number) => void;
22
- setAttachmentsPanelWidth: (width: number) => void;
23
- setNavigationButtonsBlockWidth: (width: number) => void;
24
- }