@streamscloud/embeddable 3.2.1 → 3.2.3
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/enums.d.ts +2 -0
- package/dist/core/enums.js +2 -0
- package/dist/core/graphql.d.ts +1 -3
- package/dist/core/graphql.js +3 -12
- package/dist/core/utils/html-helper.d.ts +0 -1
- package/dist/core/utils/html-helper.js +0 -4
- package/dist/products/price-helper.js +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +2 -2
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +2 -3
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +2 -3
- 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 +2 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +2 -6
- 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 +2 -3
- package/dist/short-videos/short-video-viewer/description.svelte +0 -5
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/index.d.ts +2 -4
- package/dist/short-videos/short-video-viewer/index.js +0 -1
- package/dist/short-videos/short-video-viewer/mapper.js +1 -5
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +0 -4
- package/dist/short-videos/short-video-viewer/operations.generated.js +0 -6
- package/dist/short-videos/short-video-viewer/operations.graphql +0 -4
- package/dist/short-videos/short-video-viewer/{short-video-attachments-localization.d.ts → short-video-attachments-localization.svelte.d.ts} +4 -5
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/{short-video-details-localization.d.ts → short-video-details-localization.svelte.d.ts} +6 -7
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/{short-video-product-localization.d.ts → short-video-product-localization.svelte.d.ts} +1 -2
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +11 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +13 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/types.d.ts +0 -4
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +11 -88
- 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 +14 -51
- package/dist/short-videos/short-videos-player/index.js +12 -83
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +8 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +6 -0
- package/dist/streams/layout/cmp.layout.svelte.d.ts +2 -4
- package/dist/streams/layout/cmp.slot-content.svelte +4 -4
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +1 -2
- package/dist/streams/layout/cmp.slot.svelte.d.ts +2 -7
- package/dist/streams/layout/component.d.ts +0 -2
- 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 +3 -4
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +2 -15
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +3 -7
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +89 -15
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +4 -5
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +2 -4
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +0 -3
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +17 -24
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +3 -4
- 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 +2 -6
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +0 -2
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -3
- package/dist/streams/layout/element-views/index.d.ts +11 -16
- package/dist/streams/layout/element-views/index.js +9 -12
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +8 -0
- package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +8 -0
- package/dist/streams/layout/element-views/stream-element-localization.svelte.js +6 -0
- package/dist/streams/layout/elements.d.ts +12 -47
- package/dist/streams/layout/elements.js +1 -1
- package/dist/streams/layout/enums.d.ts +3 -34
- package/dist/streams/layout/enums.js +7 -46
- package/dist/streams/layout/index.d.ts +10 -3
- package/dist/streams/layout/index.js +2 -3
- package/dist/streams/layout/layout.d.ts +1 -2
- package/dist/streams/layout/models/index.d.ts +1 -1
- package/dist/streams/layout/models/mapper.js +1 -5
- 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 +2 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +0 -4
- package/dist/streams/layout/serializer.d.ts +3 -0
- package/dist/streams/layout/serializer.js +6 -0
- package/dist/streams/layout/slot.d.ts +0 -2
- package/dist/streams/layout/styles-transformer.d.ts +2 -3
- package/dist/streams/layout/styles-transformer.js +30 -54
- package/dist/streams/layout/styles.d.ts +14 -24
- package/dist/streams/layout/type-guards.d.ts +0 -31
- package/dist/streams/layout/type-guards.js +1 -13
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +2 -4
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -3
- package/dist/streams/stream-page-viewer/index.d.ts +0 -1
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +13 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +10 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +7 -47
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +4 -6
- package/dist/streams/stream-player/controls.svelte +3 -46
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -1
- package/dist/streams/stream-player/index.d.ts +4 -6
- package/dist/streams/stream-player/index.js +28 -15
- package/dist/streams/stream-player/operations.generated.d.ts +1 -1
- package/dist/streams/stream-player/operations.generated.js +3 -5
- 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.svelte.d.ts +12 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.js +10 -0
- package/dist/ui/icon/cmp.icon.svelte +26 -13
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +2 -3
- 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.d.ts → line-clamp-localization.svelte.d.ts} +1 -2
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +15 -0
- package/dist/ui/shadow-dom/shadow-host.d.ts +5 -1
- package/dist/ui/shadow-dom/shadow-host.js +14 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte +1 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +2 -3
- package/dist/ui/time-ago/index.d.ts +1 -1
- package/dist/ui/time-ago/{time-ago-localization.d.ts → time-ago-localization.svelte.d.ts} +1 -2
- package/dist/ui/time-ago/time-ago-localization.svelte.js +39 -0
- package/dist/ui/video/cmp.video.svelte +18 -42
- package/package.json +1 -1
- package/dist/core/analytics.profile-id.d.ts +0 -5
- package/dist/core/analytics.profile-id.js +0 -17
- package/dist/core/document.event-handlers.d.ts +0 -1
- package/dist/core/document.event-handlers.js +0 -5
- package/dist/core/locale.d.ts +0 -6
- package/dist/core/locale.js +0 -24
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +0 -21
- package/dist/short-videos/short-video-viewer/short-video-details-localization.js +0 -17
- package/dist/short-videos/short-video-viewer/short-video-product-localization.js +0 -13
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +0 -14
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +0 -17
- package/dist/short-videos/short-videos-player/operations.generated.d.ts +0 -68
- package/dist/short-videos/short-videos-player/operations.generated.js +0 -199
- package/dist/short-videos/short-videos-player/operations.graphql +0 -8
- package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +0 -16
- package/dist/short-videos/short-videos-player/short-videos-player-localization.js +0 -13
- package/dist/short-videos/short-videos-player/types.d.ts +0 -36
- package/dist/short-videos/short-videos-player/types.js +0 -6
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +0 -16
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +0 -74
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +0 -11
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +0 -37
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/price-element-view.svelte +0 -168
- package/dist/streams/layout/element-views/price-element-view.svelte.d.ts +0 -15
- package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +0 -13
- package/dist/streams/layout/element-views/price-stream-element-localization.js +0 -21
- package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +0 -9
- package/dist/streams/layout/element-views/short-video-stream-element-localization.js +0 -7
- package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +0 -8
- package/dist/streams/layout/element-views/stock-stream-element-localization.js +0 -26
- package/dist/streams/layout/element-views/stream-element-localization.d.ts +0 -15
- package/dist/streams/layout/element-views/stream-element-localization.js +0 -11
- package/dist/streams/layout/serializer.svelte.d.ts +0 -29
- package/dist/streams/layout/serializer.svelte.js +0 -93
- package/dist/streams/layout/slot-data-ref.d.ts +0 -13
- package/dist/streams/layout/slot-data-ref.js +0 -1
- package/dist/streams/layout/svg-attributes.d.ts +0 -7
- package/dist/streams/layout/svg-attributes.js +0 -8
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +0 -9
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +0 -7
- package/dist/streams/stream-player/stream-player-localization.d.ts +0 -26
- package/dist/streams/stream-player/stream-player-localization.js +0 -31
- package/dist/ui/line-clamp/line-clamp-localization.js +0 -19
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +0 -125
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +0 -9
- package/dist/ui/swipe-indicator/index.d.ts +0 -2
- package/dist/ui/swipe-indicator/index.js +0 -1
- package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +0 -8
- package/dist/ui/swipe-indicator/swipe-indicator-localization.js +0 -13
- package/dist/ui/time-ago/time-ago-localization.js +0 -55
package/dist/core/enums.d.ts
CHANGED
package/dist/core/enums.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export var PostSourceType;
|
|
2
2
|
(function (PostSourceType) {
|
|
3
|
+
PostSourceType["Channel"] = "CHANNEL";
|
|
4
|
+
PostSourceType["Group"] = "GROUP";
|
|
3
5
|
PostSourceType["MediaPage"] = "MEDIA_PAGE";
|
|
4
6
|
PostSourceType["Organization"] = "ORGANIZATION";
|
|
5
7
|
PostSourceType["UserProfile"] = "USER_PROFILE";
|
package/dist/core/graphql.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export declare const createLocalGQLClient: (
|
|
2
|
-
export declare const resolveGraphQLOrigin: (origin?: string) => string;
|
|
3
|
-
export declare const constructGraphQLUrl: (graphqlOrigin?: string) => string;
|
|
1
|
+
export declare const createLocalGQLClient: (graphqlUrl: string, customFetch?: typeof fetch) => import("@urql/core").Client;
|
package/dist/core/graphql.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { createClient, fetchExchange } from '@urql/core';
|
|
2
|
-
export const createLocalGQLClient = (
|
|
3
|
-
url:
|
|
2
|
+
export const createLocalGQLClient = (graphqlUrl, customFetch) => createClient({
|
|
3
|
+
url: graphqlUrl,
|
|
4
4
|
requestPolicy: 'network-only',
|
|
5
5
|
fetchOptions: {
|
|
6
|
-
credentials: 'include'
|
|
7
|
-
headers: headers
|
|
6
|
+
credentials: 'include'
|
|
8
7
|
},
|
|
9
8
|
fetch: customFetch || fetch,
|
|
10
9
|
exchanges: [fetchExchange]
|
|
11
10
|
});
|
|
12
|
-
export const resolveGraphQLOrigin = (origin) => {
|
|
13
|
-
return origin || 'https://api.streamscloud.com';
|
|
14
|
-
};
|
|
15
|
-
export const constructGraphQLUrl = (graphqlOrigin) => {
|
|
16
|
-
let baseUrl = resolveGraphQLOrigin(graphqlOrigin);
|
|
17
|
-
baseUrl = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
|
|
18
|
-
return `${baseUrl}external/graphql`;
|
|
19
|
-
};
|
|
@@ -36,6 +36,5 @@ export declare class HtmlHelper {
|
|
|
36
36
|
* DomHelper.insert(siblingElement, newContentField, false);
|
|
37
37
|
*/
|
|
38
38
|
static insert(newElement: Element, siblingElement: Element, insertBefore?: boolean): void;
|
|
39
|
-
static sanitizeSvg(svg: string): string;
|
|
40
39
|
static pasteIntoInput(value: string, element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
41
40
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import dp from 'dompurify';
|
|
2
1
|
export class HtmlHelper {
|
|
3
2
|
static clearSelection() {
|
|
4
3
|
if (window.getSelection) {
|
|
@@ -71,9 +70,6 @@ export class HtmlHelper {
|
|
|
71
70
|
HtmlHelper.insertAfter(newElement, siblingElement);
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
|
-
static sanitizeSvg(svg) {
|
|
75
|
-
return dp.sanitize(svg, { USE_PROFILES: { svg: true, svgFilters: true }, ADD_ATTR: ['dominant-baseline'] });
|
|
76
|
-
}
|
|
77
73
|
static pasteIntoInput(value, element) {
|
|
78
74
|
if (element.selectionStart || element.selectionStart === 0) {
|
|
79
75
|
const startPos = element.selectionStart;
|
|
@@ -20,7 +20,7 @@ export const toPriceRepresentation = (amount, currency, includeCurrency = true)
|
|
|
20
20
|
}
|
|
21
21
|
case Currency.Usd: {
|
|
22
22
|
const value = formatNumber(amount);
|
|
23
|
-
return includeCurrency ?
|
|
23
|
+
return includeCurrency ? `€ ${value}` : value;
|
|
24
24
|
}
|
|
25
25
|
default: {
|
|
26
26
|
Utils.assertUnreachable(currency);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { Icon, IconColor } from '../../ui/icon';
|
|
2
2
|
import { ImageRounded } from '../../ui/image';
|
|
3
|
-
import IconTargetArrow from '@fluentui/svg-icons/icons/target_arrow_20_regular.svg
|
|
3
|
+
import IconTargetArrow from '@fluentui/svg-icons/icons/target_arrow_20_regular.svg';
|
|
4
4
|
let { model } = $props();
|
|
5
5
|
const attachmentsToShow = $derived.by(() => {
|
|
6
6
|
const products = model.products.filter((p) => !!p.image).map((p) => ({ isAd: false, image: p.image, link: p.link }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">import { default as ShortVideoAdViewer } from './cmp.ad.svelte';
|
|
2
2
|
import { default as ShortVideoProductViewer } from './cmp.product.svelte';
|
|
3
|
-
import {
|
|
3
|
+
import { ShortVideoAttachmentsLocalizationSvelte } from './short-video-attachments-localization.svelte';
|
|
4
4
|
import {} from './types';
|
|
5
5
|
let { shortVideo, localization: localizationInit, on } = $props();
|
|
6
|
-
const localization = $derived(new
|
|
6
|
+
const localization = $derived(new ShortVideoAttachmentsLocalizationSvelte(localizationInit));
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
{#if shortVideo.products.length || shortVideo.ad}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
|
|
1
|
+
import { type IShortVideoAttachmentsLocalization } from './short-video-attachments-localization.svelte';
|
|
3
2
|
import { type ShortVideoViewerModel } from './types';
|
|
4
3
|
type Props = {
|
|
5
4
|
shortVideo: ShortVideoViewerModel;
|
|
6
|
-
localization
|
|
5
|
+
localization?: IShortVideoAttachmentsLocalization;
|
|
7
6
|
on?: {
|
|
8
7
|
productClick?: (productId: string) => void;
|
|
9
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { toPriceRepresentation } from '../../products/price-helper';
|
|
2
2
|
import { ImageRounded } from '../../ui/image';
|
|
3
3
|
import { ProportionalContainer } from '../../ui/proportional-container';
|
|
4
|
-
import { ShortVideoProductLocalization } from './short-video-product-localization';
|
|
4
|
+
import { ShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
5
5
|
let { product, fitToContainer = false, localization: localizationInit, on } = $props();
|
|
6
6
|
const localization = $derived(new ShortVideoProductLocalization(localizationInit));
|
|
7
7
|
const handleProductClick = (event) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type IShortVideoProductLocalization } from './short-video-product-localization';
|
|
1
|
+
import { type IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
3
2
|
import type { ShortVideoViewerProductModel } from './types';
|
|
4
3
|
type Props = {
|
|
5
4
|
product: ShortVideoViewerProductModel;
|
|
6
5
|
fitToContainer?: boolean;
|
|
7
|
-
localization
|
|
6
|
+
localization?: IShortVideoProductLocalization;
|
|
8
7
|
on?: {
|
|
9
8
|
productClick?: (productId: string) => void;
|
|
10
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { slideHorizontally } from '../../core/transitions';
|
|
2
2
|
import { default as ShortVideoAttachments } from './cmp.attachments.svelte';
|
|
3
3
|
import { default as ShortVideoHeading } from './cmp.short-video-heading.svelte';
|
|
4
|
-
import { ShortVideoDetailsLocalization } from './short-video-details-localization';
|
|
4
|
+
import { ShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
5
5
|
import {} from './types';
|
|
6
6
|
let { shortVideo, collapsed, localization: localizationInit, on } = $props();
|
|
7
7
|
const localization = $derived(new ShortVideoDetailsLocalization(localizationInit));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type IShortVideoDetailsLocalization } from './short-video-details-localization';
|
|
1
|
+
import { type IShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
3
2
|
import { type ShortVideoViewerModel } from './types';
|
|
4
3
|
type Props = {
|
|
5
4
|
shortVideo: ShortVideoViewerModel;
|
|
6
5
|
collapsed: boolean;
|
|
7
|
-
localization
|
|
6
|
+
localization?: IShortVideoDetailsLocalization;
|
|
8
7
|
on?: {
|
|
9
8
|
productClick?: (productId: string) => void;
|
|
10
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { ImageRound } from '../../ui/image';
|
|
2
2
|
import { TimeAgo } from '../../ui/time-ago';
|
|
3
|
-
import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
3
|
+
import { ShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
4
4
|
let { model, localization: localizationInit } = $props();
|
|
5
5
|
const localization = $derived(new ShortVideoViewerLocalization(localizationInit));
|
|
6
6
|
</script>
|
|
@@ -14,7 +14,7 @@ const localization = $derived(new ShortVideoViewerLocalization(localizationInit)
|
|
|
14
14
|
<div class="short-video-heading__source-name">{model.name}</div>
|
|
15
15
|
<p class="short-video-heading__metadata">
|
|
16
16
|
<TimeAgo date={model.displayDate} localization={localization.timeAgoLocalization} />
|
|
17
|
-
{#if Number.isInteger(model.viewsCount)
|
|
17
|
+
{#if Number.isInteger(model.viewsCount)}
|
|
18
18
|
<span>·</span>
|
|
19
19
|
{localization.viewsCount(model.viewsCount)}
|
|
20
20
|
{/if}
|
|
@@ -36,9 +36,7 @@ const localization = $derived(new ShortVideoViewerLocalization(localizationInit)
|
|
|
36
36
|
.short-video-heading {
|
|
37
37
|
--_short-video-heading--container--font-size: var(--short-video-heading--container--font-size, 1em);
|
|
38
38
|
--_short-video-heading--text--color: var(--short-video-heading--text--color, #374151);
|
|
39
|
-
--_short-video-heading--text--shadow: var(--short-video-heading--text--shadow, 1px 1px hsl(0, 0%, 10%));
|
|
40
39
|
--_short-video-heading--meta--color: var(--short-video-heading--meta--color, #6b7280);
|
|
41
|
-
--_short-video-heading--meta--shadow: var(--short-video-heading--meta--shadow, 1px 1px hsl(0, 0%, 10%));
|
|
42
40
|
--_short-video-heading--padding: var(--short-video-heading--padding, 0);
|
|
43
41
|
display: flex;
|
|
44
42
|
align-items: center;
|
|
@@ -68,7 +66,6 @@ const localization = $derived(new ShortVideoViewerLocalization(localizationInit)
|
|
|
68
66
|
line-height: 1.25em;
|
|
69
67
|
font-weight: 500;
|
|
70
68
|
color: var(--_short-video-heading--text--color);
|
|
71
|
-
text-shadow: var(--_short-video-heading--text--shadow);
|
|
72
69
|
text-overflow: ellipsis;
|
|
73
70
|
width: 100%;
|
|
74
71
|
white-space: nowrap;
|
|
@@ -83,7 +80,6 @@ const localization = $derived(new ShortVideoViewerLocalization(localizationInit)
|
|
|
83
80
|
line-height: 1.2em;
|
|
84
81
|
font-weight: 400;
|
|
85
82
|
color: var(--_short-video-heading--meta--color);
|
|
86
|
-
text-shadow: var(--_short-video-heading--meta--shadow);
|
|
87
83
|
}
|
|
88
84
|
:global([data-theme="dark"]) .short-video-heading__metadata {
|
|
89
85
|
--_short-video-heading--meta--color: var(--short-video-heading--meta--color, #d1d5db);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
1
|
+
import { type IShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
2
2
|
import type { ShortVideoViewerHeadingModel } from './types';
|
|
3
3
|
type Props = {
|
|
4
4
|
model: ShortVideoViewerHeadingModel;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Video } from '../../ui/video';
|
|
3
3
|
import { default as AttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
4
4
|
import { default as ShortVideoDescription } from './description.svelte';
|
|
5
|
-
import { ShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
5
|
+
import { ShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
6
6
|
import { ShortVideoViewerUiManager } from './ui-manager.svelte';
|
|
7
7
|
let { model, availableSideSpace = 0, showAttachments = true, autoplay = 'on-appearance', localization: localizationInit, on } = $props();
|
|
8
8
|
const localization = $derived(new ShortVideoViewerLocalization(localizationInit));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type IShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
1
|
+
import { type IShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
3
2
|
import type { ShortVideoViewerModel } from './types';
|
|
4
3
|
type Props = {
|
|
5
4
|
model: ShortVideoViewerModel;
|
|
6
5
|
availableSideSpace?: number;
|
|
7
6
|
showAttachments?: boolean;
|
|
8
7
|
autoplay?: true | false | 'on-appearance';
|
|
9
|
-
localization
|
|
8
|
+
localization?: IShortVideoViewerLocalization;
|
|
10
9
|
on?: {
|
|
11
10
|
progress?: (progress: number) => void;
|
|
12
11
|
};
|
|
@@ -27,9 +27,7 @@ let { model, localization } = $props();
|
|
|
27
27
|
}
|
|
28
28
|
.short-video-description {
|
|
29
29
|
--_short-video-viewer--description--font--primary-color: var(--short-video-viewer--description--font--primary-color);
|
|
30
|
-
--_short-video-viewer--description--font--primary-shadow: var(--short-video-viewer--description--font--primary-shadow, 1px 1px hsl(0, 0%, 10%));
|
|
31
30
|
--_short-video-viewer--description--font--secondary-color: var(--short-video-viewer--description--font--secondary-color);
|
|
32
|
-
--_short-video-viewer--description--font--secondary-shadow: var(--short-video-viewer--description--font--secondary-shadow, 1px 1px hsl(0, 0%, 10%));
|
|
33
31
|
display: flex;
|
|
34
32
|
flex-direction: column;
|
|
35
33
|
padding-top: 0.75rem;
|
|
@@ -37,13 +35,10 @@ let { model, localization } = $props();
|
|
|
37
35
|
.short-video-description__heading {
|
|
38
36
|
--short-video-heading--padding: 0 0 0.875rem 0;
|
|
39
37
|
--short-video-heading--text--color: var(--_short-video-viewer--description--font--primary-color);
|
|
40
|
-
--short-video-heading--text--shadow: var(--_short-video-viewer--description--font--primary-shadow);
|
|
41
38
|
--short-video-heading--meta--color: var(--_short-video-viewer--description--font--secondary-color);
|
|
42
|
-
--short-video-heading--meta--shadow: var(--_short-video-viewer--description--font--secondary-shadow);
|
|
43
39
|
}
|
|
44
40
|
.short-video-description__text {
|
|
45
41
|
color: var(--_short-video-viewer--description--font--primary-color);
|
|
46
|
-
text-shadow: var(--_short-video-viewer--description--font--primary-shadow);
|
|
47
42
|
font-size: 0.9375rem;
|
|
48
43
|
line-height: 1.25rem;
|
|
49
44
|
font-weight: 400;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
1
|
+
import type { ShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
2
2
|
import type { ShortVideoViewerModel } from './types';
|
|
3
3
|
type Props = {
|
|
4
4
|
model: ShortVideoViewerModel;
|
|
@@ -5,7 +5,5 @@ export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte
|
|
|
5
5
|
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
6
6
|
export { default as ShortVideoDetails } from './cmp.short-video-details.svelte';
|
|
7
7
|
export type { ShortVideoViewerModel, ShortVideoViewerAdModel, ShortVideoViewerProductModel } from './types';
|
|
8
|
-
export type { IShortVideoViewerLocalization } from './short-video-viewer-localization';
|
|
9
|
-
export type { IShortVideoDetailsLocalization } from './short-video-details-localization';
|
|
10
|
-
export type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
|
|
11
|
-
export { mapShortVideoViewerModel } from './mapper';
|
|
8
|
+
export type { IShortVideoViewerLocalization } from './short-video-viewer-localization.svelte';
|
|
9
|
+
export type { IShortVideoDetailsLocalization } from './short-video-details-localization.svelte';
|
|
@@ -4,4 +4,3 @@ export { default as ShortVideoProductViewer } from './cmp.product.svelte';
|
|
|
4
4
|
export { default as ShortVideoViewerAttachments } from './cmp.attachments.svelte';
|
|
5
5
|
export { default as ShortVideoViewerAttachmentsInline } from './cmp.attachments-inline.svelte';
|
|
6
6
|
export { default as ShortVideoDetails } from './cmp.short-video-details.svelte';
|
|
7
|
-
export { mapShortVideoViewerModel } from './mapper';
|
|
@@ -51,10 +51,6 @@ const mapToShortVideoViewerProductModel = (payload) => {
|
|
|
51
51
|
link: payload.link,
|
|
52
52
|
currency: payload.priceAndAvailability.currency,
|
|
53
53
|
price: payload.priceAndAvailability.price,
|
|
54
|
-
salePrice: effectiveSalePrice?.salePrice ?? null
|
|
55
|
-
brand: {
|
|
56
|
-
name: payload.brand?.name ?? null
|
|
57
|
-
},
|
|
58
|
-
shortDescription: payload.shortDescription ?? null
|
|
54
|
+
salePrice: effectiveSalePrice?.salePrice ?? null
|
|
59
55
|
};
|
|
60
56
|
};
|
|
@@ -13,15 +13,11 @@ export type ShortVideoViewerPayloadFragment = {
|
|
|
13
13
|
title: string;
|
|
14
14
|
id: string;
|
|
15
15
|
link: string | null;
|
|
16
|
-
shortDescription: string | null;
|
|
17
16
|
media: Array<{
|
|
18
17
|
url: string;
|
|
19
18
|
thumbnailUrl: string | null;
|
|
20
19
|
type: SchemaTypes.MediaType;
|
|
21
20
|
}>;
|
|
22
|
-
brand: {
|
|
23
|
-
name: string;
|
|
24
|
-
} | null;
|
|
25
21
|
priceAndAvailability: {
|
|
26
22
|
currency: SchemaTypes.Currency;
|
|
27
23
|
price: number;
|
|
@@ -44,12 +44,6 @@ export const ShortVideoViewerPayloadFragmentDoc = {
|
|
|
44
44
|
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
45
45
|
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
46
46
|
{ kind: 'Field', name: { kind: 'Name', value: 'link' } },
|
|
47
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'shortDescription' } },
|
|
48
|
-
{
|
|
49
|
-
kind: 'Field',
|
|
50
|
-
name: { kind: 'Name', value: 'brand' },
|
|
51
|
-
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'name' } }] }
|
|
52
|
-
},
|
|
53
47
|
{
|
|
54
48
|
kind: 'Field',
|
|
55
49
|
name: { kind: 'Name', value: 'priceAndAvailability' },
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IShortVideoProductLocalization } from './short-video-product-localization';
|
|
1
|
+
import type { IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
3
2
|
export interface IShortVideoAttachmentsLocalization {
|
|
4
3
|
productsSection?: string;
|
|
5
4
|
offersSection?: string;
|
|
6
5
|
productLocalization?: IShortVideoProductLocalization;
|
|
7
6
|
}
|
|
8
|
-
export declare class
|
|
7
|
+
export declare class ShortVideoAttachmentsLocalizationSvelte {
|
|
9
8
|
productsSection: string;
|
|
10
9
|
offersSection: string;
|
|
11
|
-
productLocalization: IShortVideoProductLocalization |
|
|
12
|
-
constructor(init
|
|
10
|
+
productLocalization: IShortVideoProductLocalization | undefined;
|
|
11
|
+
constructor(init?: IShortVideoAttachmentsLocalization);
|
|
13
12
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ShortVideoAttachmentsLocalizationSvelte {
|
|
2
|
+
productsSection = $state('Products');
|
|
3
|
+
offersSection = $state('Offers');
|
|
4
|
+
productLocalization = $state(undefined);
|
|
5
|
+
constructor(init) {
|
|
6
|
+
this.productsSection = init?.productsSection || this.productsSection;
|
|
7
|
+
this.offersSection = init?.offersSection || this.offersSection;
|
|
8
|
+
this.productLocalization = init?.productLocalization;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { type Locale } from '../../core/locale';
|
|
2
1
|
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
3
|
-
import type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization';
|
|
2
|
+
import type { IShortVideoAttachmentsLocalization } from './short-video-attachments-localization.svelte';
|
|
4
3
|
export interface IShortVideoDetailsLocalization {
|
|
5
4
|
viewsCount?: (count: number) => string;
|
|
6
|
-
timeAgoLocalization?: ITimeAgoLocalization
|
|
7
|
-
attachmentsLocalization?: IShortVideoAttachmentsLocalization
|
|
5
|
+
timeAgoLocalization?: ITimeAgoLocalization;
|
|
6
|
+
attachmentsLocalization?: IShortVideoAttachmentsLocalization;
|
|
8
7
|
}
|
|
9
8
|
export declare class ShortVideoDetailsLocalization {
|
|
10
9
|
viewsCount: (count: number) => string;
|
|
11
|
-
timeAgoLocalization: ITimeAgoLocalization |
|
|
12
|
-
attachmentsLocalization: IShortVideoAttachmentsLocalization |
|
|
13
|
-
constructor(init
|
|
10
|
+
timeAgoLocalization: ITimeAgoLocalization | undefined;
|
|
11
|
+
attachmentsLocalization: IShortVideoAttachmentsLocalization | undefined;
|
|
12
|
+
constructor(init?: IShortVideoDetailsLocalization);
|
|
14
13
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ShortVideoDetailsLocalization {
|
|
2
|
+
viewsCount = $state((count) => (count === 1 ? '1 view' : `${count} views`));
|
|
3
|
+
timeAgoLocalization = $state(undefined);
|
|
4
|
+
attachmentsLocalization = $state(undefined);
|
|
5
|
+
constructor(init) {
|
|
6
|
+
this.viewsCount = init?.viewsCount ? init.viewsCount : this.viewsCount;
|
|
7
|
+
this.timeAgoLocalization = init?.timeAgoLocalization;
|
|
8
|
+
this.attachmentsLocalization = init?.attachmentsLocalization;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type Locale } from '../../core/locale';
|
|
2
1
|
export interface IShortVideoProductLocalization {
|
|
3
2
|
beforeNowPrefix?: string | null;
|
|
4
3
|
}
|
|
5
4
|
export declare class ShortVideoProductLocalization {
|
|
6
5
|
beforeNowPrefix: string | null;
|
|
7
|
-
constructor(init
|
|
6
|
+
constructor(init?: IShortVideoProductLocalization);
|
|
8
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
2
|
+
import type { IShortVideoProductLocalization } from './short-video-product-localization.svelte';
|
|
3
|
+
export interface IShortVideoViewerLocalization {
|
|
4
|
+
viewsCount?: (count: number) => string;
|
|
5
|
+
timeAgoLocalization?: ITimeAgoLocalization;
|
|
6
|
+
productLocalization?: IShortVideoProductLocalization;
|
|
7
|
+
}
|
|
8
|
+
export declare class ShortVideoViewerLocalization {
|
|
9
|
+
viewsCount: (count: number) => string;
|
|
10
|
+
timeAgoLocalization: ITimeAgoLocalization | undefined;
|
|
11
|
+
productLocalization: IShortVideoProductLocalization | undefined;
|
|
12
|
+
constructor(init?: IShortVideoViewerLocalization);
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ShortVideoViewerLocalization {
|
|
2
|
+
viewsCount = $state((count) => (count === 1 ? '1 view' : `${count} views`));
|
|
3
|
+
timeAgoLocalization = $state(undefined);
|
|
4
|
+
productLocalization = $state(undefined);
|
|
5
|
+
constructor(init) {
|
|
6
|
+
this.viewsCount = init?.viewsCount ? init.viewsCount : this.viewsCount;
|
|
7
|
+
this.timeAgoLocalization = init?.timeAgoLocalization;
|
|
8
|
+
this.productLocalization = init?.productLocalization;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -7,121 +7,44 @@
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { createLocalGQLClient } from '../../core/graphql';
|
|
12
|
-
import { mapShortVideoViewerModel, ShortVideoViewer } from '../short-video-viewer';
|
|
13
|
-
import { Loading } from '../../ui/loading';
|
|
10
|
+
import { ShortVideoViewer } from '../short-video-viewer';
|
|
14
11
|
import { PlayerBuffer, PlayerSlider } from '../../ui/player';
|
|
15
12
|
import { SpotlightLayout } from '../../ui/spotlight-layout';
|
|
16
|
-
import { SwipeIndicator } from '../../ui/swipe-indicator';
|
|
17
13
|
import { default as Controls } from './controls.svelte';
|
|
18
|
-
import {
|
|
19
|
-
import { ShortVideosPlayerLocalization } from './short-videos-player-localization';
|
|
14
|
+
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
20
15
|
import { ShortVideosPlayerUiManager } from './ui-manager.svelte';
|
|
21
|
-
import {
|
|
22
|
-
let {
|
|
16
|
+
import { onDestroy, onMount } from 'svelte';
|
|
17
|
+
let { shortVideosProvider, localization: localizationInit, on } = $props();
|
|
23
18
|
const localization = $derived(new ShortVideosPlayerLocalization(localizationInit));
|
|
24
|
-
|
|
25
|
-
let buffer = $state(input.type === 'provider' ? new PlayerBuffer(input.provider) : null);
|
|
26
|
-
$effect(() => {
|
|
27
|
-
if (input.type !== 'ids') {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
untrack(() => {
|
|
31
|
-
initBuffer(input);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
const initBuffer = (input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
try {
|
|
37
|
-
const { graphqlOrigin, ids, initialId } = input;
|
|
38
|
-
const graphql = createLocalGQLClient(graphqlOrigin, { 'x-initiator': input.initiator || 'player/short-videos' });
|
|
39
|
-
const payload = yield graphql
|
|
40
|
-
.query(GetShortVideosDocument, {
|
|
41
|
-
input: {
|
|
42
|
-
filter: {
|
|
43
|
-
ids
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
.toPromise();
|
|
48
|
-
const posts = ((_b = (_a = payload.data) === null || _a === void 0 ? void 0 : _a.shortVideos) === null || _b === void 0 ? void 0 : _b.items) || [];
|
|
49
|
-
const idOrder = new Map(ids.map((id, index) => [id, index]));
|
|
50
|
-
posts.sort((a, b) => {
|
|
51
|
-
var _a, _b;
|
|
52
|
-
return ((_a = idOrder.get(a.id)) !== null && _a !== void 0 ? _a : Infinity) - ((_b = idOrder.get(b.id)) !== null && _b !== void 0 ? _b : Infinity);
|
|
53
|
-
});
|
|
54
|
-
const index = initialId ? posts.findIndex((p) => p.id === initialId) : 0;
|
|
55
|
-
const provider = {
|
|
56
|
-
initialData: {
|
|
57
|
-
prefetchedItems: posts.map(mapShortVideoViewerModel),
|
|
58
|
-
startIndex: index
|
|
59
|
-
},
|
|
60
|
-
loadMore: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
-
// No more items to load, as all are already prefetched
|
|
62
|
-
return [];
|
|
63
|
-
})
|
|
64
|
-
};
|
|
65
|
-
buffer = new PlayerBuffer(provider);
|
|
66
|
-
}
|
|
67
|
-
catch (_c) {
|
|
68
|
-
console.error('Failed to load short videos by IDs:', input.ids);
|
|
69
|
-
buffer = null; // Reset buffer on error
|
|
70
|
-
}
|
|
71
|
-
});
|
|
19
|
+
const buffer = $derived(new PlayerBuffer(shortVideosProvider));
|
|
72
20
|
const uiManager = new ShortVideosPlayerUiManager();
|
|
73
21
|
onMount(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
22
|
uiManager.detailsCollapsed = window && window.innerWidth < window.innerHeight;
|
|
75
23
|
}));
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
node.removeEventListener('touchstart', markAsTouched);
|
|
80
|
-
node.removeEventListener('wheel', markAsTouched);
|
|
81
|
-
node.removeEventListener('click', markAsTouched);
|
|
82
|
-
node.removeEventListener('keypress', markAsTouched);
|
|
83
|
-
};
|
|
84
|
-
node.addEventListener('touchstart', markAsTouched);
|
|
85
|
-
node.addEventListener('wheel', markAsTouched);
|
|
86
|
-
node.addEventListener('click', markAsTouched);
|
|
87
|
-
node.addEventListener('keypress', markAsTouched);
|
|
88
|
-
};
|
|
24
|
+
onDestroy(() => {
|
|
25
|
+
// end tracking the short video
|
|
26
|
+
});
|
|
89
27
|
const handleDimensionsChanged = (dimensions) => {
|
|
90
28
|
uiManager.updateDimensions({
|
|
91
29
|
mainViewColumnWidth: dimensions.mainSceneWidth,
|
|
92
30
|
viewTotalWidth: dimensions.totalWidth
|
|
93
31
|
});
|
|
94
32
|
};
|
|
95
|
-
const onPlayerClose = () => {
|
|
96
|
-
var _a;
|
|
97
|
-
(_a = on === null || on === void 0 ? void 0 : on.closePlayer) === null || _a === void 0 ? void 0 : _a.call(on);
|
|
98
|
-
};
|
|
99
33
|
</script>
|
|
100
34
|
|
|
101
|
-
<svelte:document onkeydown={(e) => handleEsc(e, onPlayerClose)} />
|
|
102
|
-
|
|
103
35
|
<div class="short-videos-player-container">
|
|
104
36
|
<div class="short-videos-player" style={uiManager.globalCssVariables}>
|
|
105
37
|
{#if buffer}
|
|
106
38
|
<SpotlightLayout ratio={9 / 16} on={{ dimensionsChanged: handleDimensionsChanged }}>
|
|
107
|
-
<div class="short-videos-player__content"
|
|
39
|
+
<div class="short-videos-player__content">
|
|
108
40
|
<PlayerSlider buffer={buffer}>
|
|
109
41
|
{#snippet children({ item })}
|
|
110
|
-
<ShortVideoViewer
|
|
111
|
-
model={item}
|
|
112
|
-
autoplay="on-appearance"
|
|
113
|
-
showAttachments={uiManager.showShortVideoOverlay}
|
|
114
|
-
localization={localization.shortVideoViewerLocalization} />
|
|
42
|
+
<ShortVideoViewer model={item} autoplay="on-appearance" showAttachments={uiManager.showShortVideoOverlay} />
|
|
115
43
|
{/snippet}
|
|
116
44
|
</PlayerSlider>
|
|
117
|
-
{#if uiManager.isMobileView && buffer.loaded.length > 1 && !everTouched}
|
|
118
|
-
<SwipeIndicator localization={localization.swipeIndicatorLocalization} />
|
|
119
|
-
{/if}
|
|
120
45
|
</div>
|
|
121
46
|
</SpotlightLayout>
|
|
122
|
-
<Controls buffer={buffer} uiManager={uiManager} localization={localization} on={{ closePlayer: () =>
|
|
123
|
-
{:else}
|
|
124
|
-
<Loading positionFixedCenter={true} timeout={1000} />
|
|
47
|
+
<Controls buffer={buffer} uiManager={uiManager} localization={localization} on={{ closePlayer: () => on?.closePlayer?.() }} />
|
|
125
48
|
{/if}
|
|
126
49
|
</div>
|
|
127
50
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type
|
|
3
|
-
import type
|
|
1
|
+
import { type ShortVideoViewerModel } from '../short-video-viewer';
|
|
2
|
+
import { type PlayerItemsProvider } from '../../ui/player';
|
|
3
|
+
import { type IShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
4
4
|
type Props = {
|
|
5
|
-
|
|
6
|
-
localization
|
|
5
|
+
shortVideosProvider: PlayerItemsProvider<ShortVideoViewerModel>;
|
|
6
|
+
localization?: IShortVideosPlayerLocalization;
|
|
7
7
|
on?: {
|
|
8
8
|
closePlayer?: () => void;
|
|
9
9
|
};
|