@streamscloud/embeddable 6.4.2 → 6.5.0-1758183492920
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ads/ad-card/cmp.ad-card.svelte +3 -5
- package/dist/core/actions/horizontal-wheel-scroll.d.ts +4 -0
- package/dist/core/actions/horizontal-wheel-scroll.js +22 -0
- package/dist/core/actions/index.d.ts +2 -0
- package/dist/core/actions/index.js +2 -0
- package/dist/core/actions/swallow-touch.d.ts +2 -0
- package/dist/core/actions/swallow-touch.js +17 -0
- package/dist/media-center/media-center/cmp.media-center.svelte +10 -5
- package/dist/products/price-helper.d.ts +8 -1
- package/dist/products/price-helper.js +69 -24
- package/dist/products/product-card/cmp.product-card.svelte +2 -2
- package/dist/products/product-card/types.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-horizontal.svelte +224 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +63 -65
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -1
- package/dist/short-videos/short-video-viewer/index.js +0 -1
- package/dist/short-videos/short-video-viewer/types.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +2 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +5 -2
- package/dist/short-videos/short-videos-player/controls.svelte +85 -84
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +2 -2
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +8 -1
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +15 -6
- package/dist/streams/layout/element-views/price-element-view.svelte +7 -5
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +4 -4
- package/dist/streams/stream-player/controls.svelte +131 -94
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -0
- package/dist/streams/stream-player/fade-mixins.scss +12 -0
- package/dist/streams/stream-player/stream-overview.svelte +1 -3
- package/dist/streams/stream-player/stream-player.svelte +22 -3
- package/dist/streams/stream-player/stream-player.svelte.d.ts +12 -1
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +15 -8
- package/dist/streams/stream-player/ui-manager.svelte.js +40 -19
- package/package.json +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +0 -133
- /package/dist/short-videos/short-video-viewer/{cmp.attachments-inline.svelte.d.ts → cmp.attachments-horizontal.svelte.d.ts} +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { Icon, IconColor } from '../../ui/icon';
|
|
2
|
-
import { ImageRounded } from '../../ui/image';
|
|
3
|
-
import IconTargetArrow from '@fluentui/svg-icons/icons/target_arrow_20_regular.svg?raw';
|
|
4
|
-
let { model, on } = $props();
|
|
5
|
-
const attachmentsToShow = $derived.by(() => {
|
|
6
|
-
const products = model.products
|
|
7
|
-
.filter((p) => !!p.image)
|
|
8
|
-
.map((p) => ({
|
|
9
|
-
isAd: false,
|
|
10
|
-
image: p.image,
|
|
11
|
-
link: p.link,
|
|
12
|
-
productId: p.id
|
|
13
|
-
}));
|
|
14
|
-
const ads = (model.ad ? [model.ad] : [])
|
|
15
|
-
.filter((a) => !!a.image)
|
|
16
|
-
.map((a) => {
|
|
17
|
-
var _a;
|
|
18
|
-
return ({
|
|
19
|
-
isAd: true,
|
|
20
|
-
image: a.image,
|
|
21
|
-
link: ((_a = a.ctaButton) === null || _a === void 0 ? void 0 : _a.url) || null,
|
|
22
|
-
productId: null
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
const result = [...products, ...ads];
|
|
26
|
-
return result;
|
|
27
|
-
});
|
|
28
|
-
const handleAttachmentClick = (attachment) => {
|
|
29
|
-
if (attachment.productId && (on === null || on === void 0 ? void 0 : on.productClick)) {
|
|
30
|
-
on.productClick(attachment.productId);
|
|
31
|
-
}
|
|
32
|
-
if (attachment.link) {
|
|
33
|
-
window.open(attachment.link, '_blank');
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
let attachmentElements = $state({});
|
|
37
|
-
let observer = null;
|
|
38
|
-
$effect(() => {
|
|
39
|
-
if ((on === null || on === void 0 ? void 0 : on.productImpression) && Object.keys(attachmentElements).length > 0) {
|
|
40
|
-
if (observer) {
|
|
41
|
-
observer.disconnect();
|
|
42
|
-
}
|
|
43
|
-
observer = new IntersectionObserver((entries) => {
|
|
44
|
-
entries.forEach((entry) => {
|
|
45
|
-
if (entry.isIntersecting && entry.intersectionRatio >= 0.1) {
|
|
46
|
-
const productId = entry.target.getAttribute('data-product-id');
|
|
47
|
-
if (productId) {
|
|
48
|
-
on.productImpression(productId, model.id);
|
|
49
|
-
observer === null || observer === void 0 ? void 0 : observer.unobserve(entry.target); // Only track once per session
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}, { threshold: 0.1 });
|
|
54
|
-
Object.entries(attachmentElements).forEach(([key, element]) => {
|
|
55
|
-
if (element && key.startsWith('product-')) {
|
|
56
|
-
observer === null || observer === void 0 ? void 0 : observer.observe(element);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return () => {
|
|
61
|
-
if (observer) {
|
|
62
|
-
observer.disconnect();
|
|
63
|
-
observer = null;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
|
-
<div class="attachments-inline-container">
|
|
70
|
-
<div class="attachments-inline">
|
|
71
|
-
{#each attachmentsToShow as attachment, index (attachment)}
|
|
72
|
-
<div
|
|
73
|
-
class="attachments-inline__item"
|
|
74
|
-
onclick={() => handleAttachmentClick(attachment)}
|
|
75
|
-
onkeydown={() => {}}
|
|
76
|
-
role="none"
|
|
77
|
-
bind:this={attachmentElements[attachment.productId ? `product-${attachment.productId}` : `ad-${index}`]}
|
|
78
|
-
data-product-id={attachment.productId || undefined}>
|
|
79
|
-
<ImageRounded src={attachment.image} alt="" />
|
|
80
|
-
{#if attachment.isAd}
|
|
81
|
-
<div class="attachments-inline__item-icon">
|
|
82
|
-
<Icon src={IconTargetArrow} color={IconColor.White} />
|
|
83
|
-
</div>
|
|
84
|
-
{/if}
|
|
85
|
-
</div>
|
|
86
|
-
{/each}
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<style>@keyframes fadeIn {
|
|
91
|
-
0% {
|
|
92
|
-
opacity: 1;
|
|
93
|
-
}
|
|
94
|
-
50% {
|
|
95
|
-
opacity: 0.4;
|
|
96
|
-
}
|
|
97
|
-
100% {
|
|
98
|
-
opacity: 1;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
.attachments-inline-container {
|
|
102
|
-
flex: 1;
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
min-height: 0;
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
justify-content: flex-end;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.attachments-inline {
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
gap: 0.5rem;
|
|
114
|
-
flex-wrap: wrap;
|
|
115
|
-
height: 100%;
|
|
116
|
-
justify-content: flex-end;
|
|
117
|
-
}
|
|
118
|
-
.attachments-inline__item {
|
|
119
|
-
--image--rounded--width: 3.125rem;
|
|
120
|
-
--image--rounded--height: 3.75rem;
|
|
121
|
-
--image--rounded--inner--border-width: 0;
|
|
122
|
-
--image--rounded--outer--border-radius: 0.25rem;
|
|
123
|
-
--image--rounded--outer--border-width: 1px;
|
|
124
|
-
--image--rounded--outer--border-color: #f3f4f6;
|
|
125
|
-
position: relative;
|
|
126
|
-
cursor: pointer;
|
|
127
|
-
}
|
|
128
|
-
.attachments-inline__item-icon {
|
|
129
|
-
position: absolute;
|
|
130
|
-
bottom: 2px;
|
|
131
|
-
right: 2px;
|
|
132
|
-
--icon--size: 1rem;
|
|
133
|
-
}</style>
|