@streamscloud/embeddable 16.1.0 → 16.2.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/articles/article/article-view.svelte +5 -2
- package/dist/articles/article-dialog/cmp.article-dialog.svelte +2 -1
- package/dist/media-center/media-center/cmp.media-center-proxy.svelte +2 -1
- package/dist/media-center/media-center/discover/discover-view.svelte +1 -1
- package/dist/media-center/media-center/media-center-view.svelte +1 -1
- package/dist/media-center/media-center/menu/menu.svelte +1 -1
- package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.d.ts +2 -0
- package/dist/media-center/media-center/posts-feed/posts-feed-handler.svelte.js +8 -3
- package/dist/media-center/media-center/types.d.ts +1 -0
- package/dist/media-page/index.d.ts +1 -0
- package/dist/media-page/index.js +2 -1
- package/dist/posts/attachments/cmp.attachments.svelte +2 -1
- package/dist/posts/attachments/cmp.attachments.svelte.d.ts +1 -0
- package/dist/posts/post-viewer/media/post-media.svelte +1 -1
- package/dist/posts/posts-player/cmp.posts-player.svelte +3 -2
- package/dist/posts/posts-player/cmp.posts-player.svelte.d.ts +2 -0
- package/dist/posts/posts-player/index.d.ts +4 -1
- package/dist/posts/posts-player/index.js +5 -2
- package/dist/posts/posts-player/posts-player-proxy.svelte +5 -1
- package/dist/posts/posts-player/posts-player-proxy.svelte.d.ts +1 -0
- package/dist/posts/posts-player/posts-player-view.svelte +8 -8
- package/dist/posts/posts-player/types.d.ts +1 -0
- package/dist/products/product-card/cmp.product-card.svelte +32 -0
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +1 -0
- package/dist/products/product-card/product-card-localization.d.ts +1 -0
- package/dist/products/product-card/product-card-localization.js +7 -0
- package/dist/streams/streams-player/stream-overview.svelte +1 -1
- package/dist/ui/media-items/media-items-gallery/cmp.media-items-gallery.svelte +7 -2
- package/package.json +5 -5
|
@@ -20,6 +20,9 @@ const fieldMetadata = $derived({ displayDate: metadata.displayDate });
|
|
|
20
20
|
--_article--container-background: var(--article--container-background, light-dark(#fafafa, #1c1c1c));
|
|
21
21
|
--_article--text-color: var(--article--text-color, light-dark(#000000, #ffffff));
|
|
22
22
|
container-type: inline-size;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
23
26
|
min-height: var(--_article--min-height);
|
|
24
27
|
background: var(--_article--container-background);
|
|
25
28
|
overflow: hidden;
|
|
@@ -27,9 +30,9 @@ const fieldMetadata = $derived({ displayDate: metadata.displayDate });
|
|
|
27
30
|
|
|
28
31
|
.article {
|
|
29
32
|
--article-field--text-color: var(--_article--text-color);
|
|
33
|
+
width: 100%;
|
|
30
34
|
max-width: var(--_article--max-width);
|
|
31
|
-
|
|
32
|
-
min-height: var(--_article--min-height);
|
|
35
|
+
flex: 1;
|
|
33
36
|
background: var(--_article--background);
|
|
34
37
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
|
35
38
|
padding-bottom: 6.25rem;
|
|
@@ -64,11 +64,12 @@ void load();
|
|
|
64
64
|
}
|
|
65
65
|
.article-dialog__content {
|
|
66
66
|
--article--max-width: 56.25rem;
|
|
67
|
+
--article--min-height: 100%;
|
|
67
68
|
--article--container-background: light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.8));
|
|
68
69
|
width: 100%;
|
|
69
70
|
height: 100%;
|
|
70
71
|
overflow-y: auto;
|
|
71
|
-
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #
|
|
72
|
+
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
|
|
72
73
|
--_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
|
|
73
74
|
}
|
|
74
75
|
.article-dialog__content::-webkit-scrollbar {
|
|
@@ -21,7 +21,8 @@ const context = untrack(() => new MediaCenterContext({
|
|
|
21
21
|
case 'posts':
|
|
22
22
|
instance.postsFeedHandler.activateWithDataProvider({
|
|
23
23
|
dataProvider: modeProps.props.dataProvider,
|
|
24
|
-
onPostActivated: modeProps.props.onPostActivated
|
|
24
|
+
onPostActivated: modeProps.props.onPostActivated,
|
|
25
|
+
onProductBuy: modeProps.props.onProductBuy
|
|
25
26
|
});
|
|
26
27
|
break;
|
|
27
28
|
case 'streams':
|
|
@@ -122,7 +122,7 @@ const genereateStreamActions = (id) => {
|
|
|
122
122
|
--_cross-browser-scrollbar--track-color: transparent;
|
|
123
123
|
}
|
|
124
124
|
.media-center-discover:hover {
|
|
125
|
-
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #
|
|
125
|
+
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
|
|
126
126
|
--_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
|
|
127
127
|
}
|
|
128
128
|
.media-center-discover::-webkit-scrollbar {
|
|
@@ -242,7 +242,7 @@ const swipeToOpen = (node) => {
|
|
|
242
242
|
--_cross-browser-scrollbar--track-color: transparent;
|
|
243
243
|
}
|
|
244
244
|
.media-center-overlay:hover {
|
|
245
|
-
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #
|
|
245
|
+
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
|
|
246
246
|
--_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
|
|
247
247
|
}
|
|
248
248
|
.media-center-overlay::-webkit-scrollbar {
|
|
@@ -166,7 +166,7 @@ const handleCategoryExpaned = (e, categoryId) => {
|
|
|
166
166
|
--_cross-browser-scrollbar--track-color: transparent;
|
|
167
167
|
}
|
|
168
168
|
.media-center-menu__content:hover {
|
|
169
|
-
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #
|
|
169
|
+
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
|
|
170
170
|
--_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
|
|
171
171
|
}
|
|
172
172
|
.media-center-menu__content::-webkit-scrollbar {
|
|
@@ -14,6 +14,7 @@ export declare class PostsFeedHandler {
|
|
|
14
14
|
private _mediaCenterContentHandler;
|
|
15
15
|
private _closeOrchestrator;
|
|
16
16
|
private _callbacks;
|
|
17
|
+
private _onProductBuy;
|
|
17
18
|
constructor(data: {
|
|
18
19
|
dataProvider: IMediaCenterDataProvider;
|
|
19
20
|
mediaCenterSettingsHandler: MediaCenterSettingsHandler;
|
|
@@ -32,6 +33,7 @@ export declare class PostsFeedHandler {
|
|
|
32
33
|
activateWithDataProvider: (data: {
|
|
33
34
|
dataProvider: IPlayerDataProvider<PostPlayerModel>;
|
|
34
35
|
onPostActivated?: (id: string) => void;
|
|
36
|
+
onProductBuy?: (productId: string) => void;
|
|
35
37
|
}) => Promise<void>;
|
|
36
38
|
activate: (options: Partial<{
|
|
37
39
|
filter: PostsFeedFilter;
|
|
@@ -11,6 +11,7 @@ export class PostsFeedHandler {
|
|
|
11
11
|
_mediaCenterContentHandler;
|
|
12
12
|
_closeOrchestrator;
|
|
13
13
|
_callbacks;
|
|
14
|
+
_onProductBuy;
|
|
14
15
|
constructor(data) {
|
|
15
16
|
const { dataProvider, mediaCenterSettingsHandler, mediaCenterContentHandler, closeOrchestrator, on } = data;
|
|
16
17
|
this._providersGenerator = new FeedProvidersGenerator(dataProvider);
|
|
@@ -70,12 +71,14 @@ export class PostsFeedHandler {
|
|
|
70
71
|
this._feedPlayerData = null;
|
|
71
72
|
};
|
|
72
73
|
activateWithDataProvider = async (data) => {
|
|
73
|
-
const { dataProvider, onPostActivated } = data;
|
|
74
|
+
const { dataProvider, onPostActivated, onProductBuy } = data;
|
|
75
|
+
this._onProductBuy = onProductBuy;
|
|
74
76
|
const on = {
|
|
75
77
|
postActivated: (id) => {
|
|
76
78
|
onPostActivated?.(id);
|
|
77
79
|
this._callbacks.navigationStateChanged({ mode: 'posts-feed', postId: id, categoryId: null });
|
|
78
|
-
}
|
|
80
|
+
},
|
|
81
|
+
productBuy: this._onProductBuy
|
|
79
82
|
};
|
|
80
83
|
try {
|
|
81
84
|
this._state = 'loading';
|
|
@@ -100,7 +103,8 @@ export class PostsFeedHandler {
|
|
|
100
103
|
const on = {
|
|
101
104
|
postActivated: (id) => {
|
|
102
105
|
this._callbacks.navigationStateChanged({ mode: 'posts-feed', postId: id, categoryId: filter?.categoryId ?? null });
|
|
103
|
-
}
|
|
106
|
+
},
|
|
107
|
+
productBuy: this._onProductBuy
|
|
104
108
|
};
|
|
105
109
|
try {
|
|
106
110
|
this._state = 'loading';
|
|
@@ -180,6 +184,7 @@ export class PostsFeedHandler {
|
|
|
180
184
|
closeOrchestrator: this._closeOrchestrator,
|
|
181
185
|
on: {
|
|
182
186
|
postActivated: on.postActivated,
|
|
187
|
+
productBuy: on.productBuy,
|
|
183
188
|
backgroundImageLoaded: this._mediaCenterSettingsHandler.backgroundImageLoadedHandler
|
|
184
189
|
}
|
|
185
190
|
};
|
|
@@ -84,6 +84,7 @@ export declare function openMediaPageModalWithInitialPostsProvider(init: {
|
|
|
84
84
|
on?: {
|
|
85
85
|
closed?: () => void;
|
|
86
86
|
postActivated?: (id: string) => void;
|
|
87
|
+
productBuy?: (productId: string) => void;
|
|
87
88
|
};
|
|
88
89
|
}): void;
|
|
89
90
|
export declare function openMediaPageModalWithInitialStreamsProvider(init: {
|
package/dist/media-page/index.js
CHANGED
|
@@ -115,7 +115,8 @@ export function openMediaPageModalWithInitialPostsProvider(init) {
|
|
|
115
115
|
mode: 'posts',
|
|
116
116
|
props: {
|
|
117
117
|
dataProvider,
|
|
118
|
-
onPostActivated: on?.postActivated
|
|
118
|
+
onPostActivated: on?.postActivated,
|
|
119
|
+
onProductBuy: on?.productBuy
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
122
|
closeOrchestrator: makeCloseOrchestrator()
|
|
@@ -35,7 +35,7 @@ let { id, media, autoplay = 'on-appearance', on } = $props();
|
|
|
35
35
|
</div>
|
|
36
36
|
|
|
37
37
|
<style>.post-media {
|
|
38
|
-
--_post-media--background-color: light-dark(#
|
|
38
|
+
--_post-media--background-color: light-dark(#000000, #ffffff);
|
|
39
39
|
width: 100%;
|
|
40
40
|
min-width: 100%;
|
|
41
41
|
max-width: 100%;
|
|
@@ -29,11 +29,12 @@ const initHost = (node) => {
|
|
|
29
29
|
closeOrchestrator: new CloseOrchestrator({
|
|
30
30
|
closeFn: async () => {
|
|
31
31
|
await unmount(mounted);
|
|
32
|
+
on?.playerClosed?.();
|
|
32
33
|
},
|
|
33
|
-
canClose:
|
|
34
|
+
canClose: !!on?.playerClosed
|
|
34
35
|
}),
|
|
35
36
|
get on() {
|
|
36
|
-
return on;
|
|
37
|
+
return { postActivated: on?.postActivated, productBuy: on?.productBuy };
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
});
|
|
@@ -46,12 +46,14 @@ export type { ArticleDataProvider, IMediaCenterDataProvider, IPostAnalyticsHandl
|
|
|
46
46
|
* Optional theme for the player UI.
|
|
47
47
|
*
|
|
48
48
|
* Events (optional)
|
|
49
|
-
* @param {{ playerClosed?: () => void; postActivated?: (id: string) => void }} [init.on]
|
|
49
|
+
* @param {{ playerClosed?: () => void; postActivated?: (id: string) => void; productBuy?: (productId: string) => void }} [init.on]
|
|
50
50
|
* Optional event handlers.
|
|
51
51
|
* @param {() => void} [init.on.playerClosed]
|
|
52
52
|
* Called after the player is fully closed (after unmount and removal from the DOM).
|
|
53
53
|
* @param {(id: string) => void} [init.on.postActivated]
|
|
54
54
|
* Called when a post becomes active (receives the post's id).
|
|
55
|
+
* @param {(productId: string) => void} [init.on.productBuy]
|
|
56
|
+
* Called when the user clicks the "Buy" button on a product card. When provided, a "Buy" button is shown on product cards in the attachments panel.
|
|
55
57
|
*
|
|
56
58
|
* @returns {void}
|
|
57
59
|
*
|
|
@@ -104,6 +106,7 @@ export declare function openPostsPlayer(init: {
|
|
|
104
106
|
on?: {
|
|
105
107
|
playerClosed?: () => void;
|
|
106
108
|
postActivated?: (id: string) => void;
|
|
109
|
+
productBuy?: (productId: string) => void;
|
|
107
110
|
};
|
|
108
111
|
}): void;
|
|
109
112
|
export type IPostsPlayerDataProvider<TChunk extends WithId = WithId> = {
|
|
@@ -44,12 +44,14 @@ export { PostsPlayer };
|
|
|
44
44
|
* Optional theme for the player UI.
|
|
45
45
|
*
|
|
46
46
|
* Events (optional)
|
|
47
|
-
* @param {{ playerClosed?: () => void; postActivated?: (id: string) => void }} [init.on]
|
|
47
|
+
* @param {{ playerClosed?: () => void; postActivated?: (id: string) => void; productBuy?: (productId: string) => void }} [init.on]
|
|
48
48
|
* Optional event handlers.
|
|
49
49
|
* @param {() => void} [init.on.playerClosed]
|
|
50
50
|
* Called after the player is fully closed (after unmount and removal from the DOM).
|
|
51
51
|
* @param {(id: string) => void} [init.on.postActivated]
|
|
52
52
|
* Called when a post becomes active (receives the post's id).
|
|
53
|
+
* @param {(productId: string) => void} [init.on.productBuy]
|
|
54
|
+
* Called when the user clicks the "Buy" button on a product card. When provided, a "Buy" button is shown on product cards in the attachments panel.
|
|
53
55
|
*
|
|
54
56
|
* @returns {void}
|
|
55
57
|
*
|
|
@@ -111,7 +113,8 @@ export function openPostsPlayer(init) {
|
|
|
111
113
|
playerSettings,
|
|
112
114
|
closeOrchestrator: makeCloseOrchestrator(),
|
|
113
115
|
on: {
|
|
114
|
-
postActivated: on?.postActivated
|
|
116
|
+
postActivated: on?.postActivated,
|
|
117
|
+
productBuy: on?.productBuy
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
});
|
|
@@ -21,5 +21,9 @@ const handleBackgroundImagedLoaded = (url) => {
|
|
|
21
21
|
analyticsHandler={analyticsHandler}
|
|
22
22
|
articleDataProvider={articleDataProvider}
|
|
23
23
|
closeOrchestrator={closeOrchestrator}
|
|
24
|
-
on={{
|
|
24
|
+
on={{
|
|
25
|
+
postActivated: on?.postActivated,
|
|
26
|
+
productBuy: on?.productBuy,
|
|
27
|
+
backgroundImageLoaded: playerSettings?.disableBackground === true ? undefined : handleBackgroundImagedLoaded
|
|
28
|
+
}} />
|
|
25
29
|
</ShadowRoot>
|
|
@@ -11,16 +11,15 @@ import { preloadImage } from '@streamscloud/kit/core/utils';
|
|
|
11
11
|
import { initBufferFromProvider } from '@streamscloud/kit/ui/player/providers';
|
|
12
12
|
import { untrack } from 'svelte';
|
|
13
13
|
let { dataProvider, socialInteractionsHandler, sharingHandler, playerSettings, analyticsHandler, managementActions, articleDataProvider, closeOrchestrator, on } = $props();
|
|
14
|
-
let
|
|
14
|
+
let dialogAnchor;
|
|
15
|
+
const resolveDialogAnchor = (el) => {
|
|
16
|
+
dialogAnchor = getDialogAnchor(el) ?? undefined;
|
|
17
|
+
};
|
|
15
18
|
const handleArticleReadMore = (articleId) => {
|
|
16
|
-
if (!articleDataProvider || !
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const anchor = getDialogAnchor(playerHostElement);
|
|
20
|
-
if (!anchor) {
|
|
19
|
+
if (!articleDataProvider || !dialogAnchor) {
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
openArticleDialog({ anchor, articleId, fetchArticle: articleDataProvider.fetchArticle });
|
|
22
|
+
openArticleDialog({ anchor: dialogAnchor, articleId, fetchArticle: articleDataProvider.fetchArticle });
|
|
24
23
|
};
|
|
25
24
|
let buffer = $state.raw(null);
|
|
26
25
|
let mappedPostsCache = {};
|
|
@@ -154,11 +153,12 @@ const currentItemActions = $derived.by(() => {
|
|
|
154
153
|
on={{
|
|
155
154
|
productClick: (id) => onProductClick(id, postModel.id),
|
|
156
155
|
productImpression: (id) => onProductImpression(id, postModel.id),
|
|
156
|
+
productBuy: on?.productBuy,
|
|
157
157
|
adClick: (id) => onAdClick(id),
|
|
158
158
|
adImpression: (id) => onAdImpression(id)
|
|
159
159
|
}} />
|
|
160
160
|
{/snippet}
|
|
161
|
-
<div class="player-host"
|
|
161
|
+
<div class="player-host" use:resolveDialogAnchor>
|
|
162
162
|
<Player
|
|
163
163
|
config={contentPlayerConfig}
|
|
164
164
|
itemActions={currentItemActions}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script lang="ts">import { enrichProductLinkWithTracking } from '../../marketing-tracking';
|
|
2
2
|
import { toPriceRepresentation } from '../price-helper';
|
|
3
3
|
import { ProductCardLocalization } from './product-card-localization';
|
|
4
|
+
import IconCart from '@fluentui/svg-icons/icons/cart_20_regular.svg?raw';
|
|
5
|
+
import { Button } from '@streamscloud/kit/ui/button';
|
|
6
|
+
import { IconText } from '@streamscloud/kit/ui/icon-text';
|
|
4
7
|
import { Image } from '@streamscloud/kit/ui/image';
|
|
5
8
|
import { LineClamp } from '@streamscloud/kit/ui/line-clamp';
|
|
6
9
|
import { ProportionalContainer } from '@streamscloud/kit/ui/proportional-container';
|
|
@@ -36,6 +39,11 @@ const onProductClicked = (event) => {
|
|
|
36
39
|
window.open(enrichedLink, '_blank', 'noopener noreferrer');
|
|
37
40
|
}
|
|
38
41
|
};
|
|
42
|
+
const onBuyClicked = (event) => {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
on?.buy?.(product.id);
|
|
46
|
+
};
|
|
39
47
|
</script>
|
|
40
48
|
|
|
41
49
|
<div class="product-card" inert={inert} use:trackImpression>
|
|
@@ -66,6 +74,14 @@ const onProductClicked = (event) => {
|
|
|
66
74
|
{toPriceRepresentation({ amount: product.salePrice ?? product.price, currency: product.currency })}
|
|
67
75
|
</div>
|
|
68
76
|
</div>
|
|
77
|
+
|
|
78
|
+
{#if on?.buy}
|
|
79
|
+
<div class="product-card__buy" onclick={onBuyClicked} onkeydown={() => {}} role="none">
|
|
80
|
+
<Button size="standard" on={{ click: onBuyClicked }} --sc-kit--button--min-width="100%">
|
|
81
|
+
<IconText icon={IconCart}>{localization.buy}</IconText>
|
|
82
|
+
</Button>
|
|
83
|
+
</div>
|
|
84
|
+
{/if}
|
|
69
85
|
</div>
|
|
70
86
|
|
|
71
87
|
{#if enrichedLink}
|
|
@@ -172,6 +188,22 @@ const onProductClicked = (event) => {
|
|
|
172
188
|
height: 1.75rem;
|
|
173
189
|
}
|
|
174
190
|
}
|
|
191
|
+
.product-card__buy {
|
|
192
|
+
position: relative;
|
|
193
|
+
z-index: 1;
|
|
194
|
+
margin-top: 0.375rem;
|
|
195
|
+
--sc-kit--button--background: light-dark(
|
|
196
|
+
var(--sc-player--light--card-button, #f2f2f2),
|
|
197
|
+
var(--sc-player--dark--card-button, #2e2e2e)
|
|
198
|
+
);
|
|
199
|
+
--sc-kit--button--font--color: var(--sc-mc-color--text-primary);
|
|
200
|
+
/* Set 'container-type: inline-size;' to reference container*/
|
|
201
|
+
}
|
|
202
|
+
@container (width < 230px) {
|
|
203
|
+
.product-card__buy {
|
|
204
|
+
margin-top: 0.25rem;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
175
207
|
.product-card__link {
|
|
176
208
|
position: absolute;
|
|
177
209
|
inset: 0;
|
|
@@ -3,10 +3,17 @@ export class ProductCardLocalization {
|
|
|
3
3
|
get beforeNowPrefix() {
|
|
4
4
|
return loc.beforeNowPrefix[AppLocale.current];
|
|
5
5
|
}
|
|
6
|
+
get buy() {
|
|
7
|
+
return loc.buy[AppLocale.current];
|
|
8
|
+
}
|
|
6
9
|
}
|
|
7
10
|
const loc = {
|
|
8
11
|
beforeNowPrefix: {
|
|
9
12
|
en: 'Before',
|
|
10
13
|
no: 'Før'
|
|
14
|
+
},
|
|
15
|
+
buy: {
|
|
16
|
+
en: 'Buy',
|
|
17
|
+
no: 'Kjøp'
|
|
11
18
|
}
|
|
12
19
|
};
|
|
@@ -36,7 +36,7 @@ let { buffer, activePageId, on } = $props();
|
|
|
36
36
|
--_cross-browser-scrollbar--track-color: transparent;
|
|
37
37
|
}
|
|
38
38
|
.stream-overview-pages:hover {
|
|
39
|
-
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #
|
|
39
|
+
--_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
|
|
40
40
|
--_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
|
|
41
41
|
}
|
|
42
42
|
.stream-overview-pages::-webkit-scrollbar {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
<script lang="ts">import { MediaItemView } from '../media-item-view';
|
|
2
|
+
import { getDialogAnchor } from '../../shadow-dom/shadow-root-service';
|
|
2
3
|
import {} from '../types';
|
|
3
4
|
import { GalleryLayout } from './gallery-layout';
|
|
4
5
|
import { openMediaViewer } from '@streamscloud/kit/ui/media-viewer-dialog';
|
|
5
6
|
let { media, singleImageRatio = 0, inert = false, on } = $props();
|
|
7
|
+
let dialogHost;
|
|
6
8
|
let layout = $state(null);
|
|
9
|
+
const resolveDialogHost = (el) => {
|
|
10
|
+
dialogHost = getDialogAnchor(el) ?? undefined;
|
|
11
|
+
};
|
|
7
12
|
const initLayout = async () => {
|
|
8
13
|
if (!media.length || media.length === 1 || media.length > 4) {
|
|
9
14
|
layout = null;
|
|
@@ -41,7 +46,7 @@ const handleGalleryItemClick = (index) => {
|
|
|
41
46
|
height: i.metadata.height
|
|
42
47
|
})),
|
|
43
48
|
index
|
|
44
|
-
});
|
|
49
|
+
}, dialogHost);
|
|
45
50
|
};
|
|
46
51
|
</script>
|
|
47
52
|
|
|
@@ -57,7 +62,7 @@ const handleGalleryItemClick = (index) => {
|
|
|
57
62
|
remove: on?.remove ? () => on?.remove?.(0) : undefined
|
|
58
63
|
}} />
|
|
59
64
|
{:else}
|
|
60
|
-
<div class="gallery-container" inert={inert}>
|
|
65
|
+
<div class="gallery-container" use:resolveDialogHost inert={inert}>
|
|
61
66
|
{#snippet galleryItem(index: number)}
|
|
62
67
|
<div class="gallery-item">
|
|
63
68
|
<MediaItemView
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamscloud/embeddable",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0",
|
|
4
4
|
"author": "StreamsCloud",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"preview": "vite preview",
|
|
18
18
|
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
|
|
19
19
|
"check:strict": "svelte-check --tsconfig ./tsconfig.app.json --fail-on-warnings --output machine && eslint . --format codeframe --max-warnings 0 && prettier --check --plugin prettier-plugin-svelte --cache .",
|
|
20
|
-
"uad": "graphql-codegen --config codegen.yml
|
|
21
|
-
"uad-types-only": "graphql-codegen --config codegen.types-only.yml
|
|
20
|
+
"uad": "graphql-codegen --config codegen.yml",
|
|
21
|
+
"uad-types-only": "graphql-codegen --config codegen.types-only.yml",
|
|
22
22
|
"lint": "prettier --check --plugin prettier-plugin-svelte . && eslint .",
|
|
23
23
|
"lint-format": "prettier --write --plugin prettier-plugin-svelte . && eslint --fix .",
|
|
24
24
|
"format": "prettier --write --plugin prettier-plugin-svelte ."
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
|
-
"@streamscloud/kit": "^0.2.
|
|
145
|
+
"@streamscloud/kit": "^0.2.1",
|
|
146
146
|
"@streamscloud/streams-analytics-collector": "^4.0.1",
|
|
147
147
|
"svelte": "^5.51.0"
|
|
148
148
|
},
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"@graphql-codegen/typescript": "^5.0.7",
|
|
159
159
|
"@graphql-codegen/typescript-operations": "^5.0.7",
|
|
160
160
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
161
|
-
"@streamscloud/kit": "^0.2.
|
|
161
|
+
"@streamscloud/kit": "^0.2.1",
|
|
162
162
|
"@streamscloud/streams-analytics-collector": "^4.0.1",
|
|
163
163
|
"@sveltejs/package": "^2.5.7",
|
|
164
164
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|