@streamscloud/embeddable 2.4.0 → 2.4.1
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/short-videos/short-videos-player/controls.svelte +1 -1
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +1 -1
- package/dist/streams/layout/cmp.layout.svelte.d.ts +4 -2
- package/dist/streams/layout/cmp.slot-content.svelte +4 -4
- package/dist/streams/layout/cmp.slot.svelte.d.ts +7 -2
- package/dist/streams/layout/component.d.ts +2 -0
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +1 -1
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +3 -3
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +9 -9
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +3 -3
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +14 -12
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +1 -1
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +2 -2
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +32 -0
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +7 -0
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -3
- package/dist/streams/layout/element-views/index.d.ts +11 -10
- package/dist/streams/layout/element-views/index.js +11 -10
- package/dist/streams/layout/elements.d.ts +25 -10
- package/dist/streams/layout/enums.d.ts +3 -1
- package/dist/streams/layout/enums.js +2 -0
- package/dist/streams/layout/index.d.ts +2 -11
- package/dist/streams/layout/index.js +2 -2
- package/dist/streams/layout/layout.d.ts +2 -1
- package/dist/streams/layout/models/index.d.ts +1 -1
- package/dist/streams/layout/models/stream-layout-product-model.d.ts +1 -2
- package/dist/streams/layout/serializer.svelte.d.ts +29 -0
- package/dist/streams/layout/serializer.svelte.js +86 -0
- package/dist/streams/layout/slot-data-ref.d.ts +13 -0
- package/dist/streams/layout/slot-data-ref.js +1 -0
- package/dist/streams/layout/slot.d.ts +2 -0
- package/dist/streams/layout/type-guards.d.ts +29 -0
- package/dist/streams/layout/type-guards.js +13 -1
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +1 -1
- package/package.json +6 -2
- package/dist/streams/layout/serializer.d.ts +0 -3
- package/dist/streams/layout/serializer.js +0 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Icon } from '../../ui/icon';
|
|
3
3
|
import { MediaVolumeManager } from '../../ui/media-playback';
|
|
4
4
|
import { default as ActionButton } from './action-button.svelte';
|
|
5
|
-
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte
|
|
5
|
+
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
6
6
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
7
7
|
import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_20_regular.svg?raw';
|
|
8
8
|
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_20_regular.svg?raw';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ShortVideoViewerModel } from '../short-video-viewer';
|
|
2
2
|
import type { IPlayerBuffer } from '../../ui/player';
|
|
3
|
-
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte
|
|
3
|
+
import { ShortVideosPlayerLocalization } from './short-videos-player-localization.svelte';
|
|
4
4
|
import type { ShortVideosPlayerUiManager } from './ui-manager.svelte';
|
|
5
5
|
type Props = {
|
|
6
6
|
buffer: IPlayerBuffer<ShortVideoViewerModel>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StreamLayoutStyles } from './styles';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
type Props = {
|
|
4
|
-
model:
|
|
4
|
+
model: {
|
|
5
|
+
styles: StreamLayoutStyles | null;
|
|
6
|
+
};
|
|
5
7
|
children: Snippet;
|
|
6
8
|
};
|
|
7
9
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">import { Utils } from '../../core/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { StreamElementView } from './element-views';
|
|
3
3
|
import { StreamComponentDataType } from './enums';
|
|
4
4
|
let { model, localization, on } = $props();
|
|
5
5
|
const component = $derived.by(() => {
|
|
6
|
-
return model.components.find((c) =>
|
|
6
|
+
return model.components.find((c) => (model.data ? c.dataType === model.data.type : c.dataType === StreamComponentDataType.NoData));
|
|
7
7
|
});
|
|
8
8
|
const dataIsFilled = $derived.by(() => {
|
|
9
9
|
if (!model.data) {
|
|
@@ -42,9 +42,9 @@ const handleProductClick = (e) => {
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
{#snippet slotContent()}
|
|
45
|
-
{#if component && model.data
|
|
45
|
+
{#if component && (!model.data || dataIsFilled)}
|
|
46
46
|
{#each component.elements as element (element)}
|
|
47
|
-
<
|
|
47
|
+
<StreamElementView model={element} data={model.data} localization={localization} on={on} />
|
|
48
48
|
{/each}
|
|
49
49
|
{/if}
|
|
50
50
|
{/snippet}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type { StreamSlot } from './slot';
|
|
2
1
|
import type { Snippet } from 'svelte';
|
|
2
|
+
type LayoutStyles = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
top: number;
|
|
6
|
+
left: number;
|
|
7
|
+
};
|
|
3
8
|
type Props = {
|
|
4
|
-
model:
|
|
9
|
+
model: LayoutStyles;
|
|
5
10
|
children: Snippet;
|
|
6
11
|
};
|
|
7
12
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
@@ -3,7 +3,7 @@ import type { ContainerStreamElementModel } from '../elements';
|
|
|
3
3
|
import type { StreamSlotData } from '../slot-data';
|
|
4
4
|
type Props = {
|
|
5
5
|
model: ContainerStreamElementModel;
|
|
6
|
-
data: StreamSlotData;
|
|
6
|
+
data: StreamSlotData | null;
|
|
7
7
|
localization?: IStreamElementLocalization;
|
|
8
8
|
};
|
|
9
9
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
1
|
import type { AnnotationStreamElementModel, ImageRefStreamElementModel } from '../elements';
|
|
3
|
-
import type {
|
|
2
|
+
import type { StreamSlotDataRef } from '../slot-data-ref';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
4
|
type Props = {
|
|
5
5
|
model: ImageRefStreamElementModel;
|
|
6
|
-
data:
|
|
6
|
+
data: StreamSlotDataRef;
|
|
7
7
|
annotationView?: Snippet<[{
|
|
8
8
|
model: AnnotationStreamElementModel;
|
|
9
9
|
}]>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">var _a;
|
|
2
2
|
import { toPriceRepresentation } from '../../../products/price-helper';
|
|
3
|
-
import { PriceStreamElementLocalization } from './price-stream-element-localization.svelte
|
|
3
|
+
import { PriceStreamElementLocalization } from './price-stream-element-localization.svelte';
|
|
4
4
|
import { mapFlexJustifyContent, mapFontFamily, mapFontWeight, transformColorValue, transformFontSizeValue, transformNumericValue } from '../styles-transformer';
|
|
5
5
|
let { model, data, localization: localizationInit } = $props();
|
|
6
6
|
const localization = $derived(new PriceStreamElementLocalization(localizationInit));
|
|
7
7
|
const lineHeight = 1.2;
|
|
8
8
|
const height = $derived(((_a = model.styles) === null || _a === void 0 ? void 0 : _a.height) || 16);
|
|
9
9
|
const currentPrice = $derived.by(() => {
|
|
10
|
-
if (data.
|
|
11
|
-
return toPriceRepresentation(data.
|
|
10
|
+
if (data.salePrice) {
|
|
11
|
+
return toPriceRepresentation(data.salePrice, data.currency, model.includeCurrency || false);
|
|
12
12
|
}
|
|
13
|
-
return toPriceRepresentation(data.price
|
|
13
|
+
return toPriceRepresentation(data.price, data.currency, model.includeCurrency || false);
|
|
14
14
|
});
|
|
15
15
|
const saveValue = $derived.by(() => {
|
|
16
|
-
if (data.
|
|
17
|
-
return toPriceRepresentation(data.price
|
|
16
|
+
if (data.salePrice) {
|
|
17
|
+
return toPriceRepresentation(data.price - data.salePrice, data.currency, model.includeCurrency || false);
|
|
18
18
|
}
|
|
19
19
|
return 0;
|
|
20
20
|
});
|
|
@@ -34,7 +34,7 @@ const priceCustomStyles = $derived.by(() => {
|
|
|
34
34
|
`font-size: ${transformFontSizeValue(height / lineHeight)};`,
|
|
35
35
|
`line-height: ${lineHeight};`,
|
|
36
36
|
`font-weight: ${mapFontWeight((_a = model.styles) === null || _a === void 0 ? void 0 : _a.fontWeight)};`,
|
|
37
|
-
`color: ${transformColorValue(data.
|
|
37
|
+
`color: ${transformColorValue(data.salePrice ? (_b = model.styles) === null || _b === void 0 ? void 0 : _b.salePriceColor : (_c = model.styles) === null || _c === void 0 ? void 0 : _c.regularPriceColor)};`
|
|
38
38
|
];
|
|
39
39
|
return values.join('');
|
|
40
40
|
});
|
|
@@ -62,13 +62,13 @@ const beforeValueCustomStyles = $derived.by(() => {
|
|
|
62
62
|
<div class="price-stream-element__price" style={priceCustomStyles}>
|
|
63
63
|
{currentPrice}
|
|
64
64
|
</div>
|
|
65
|
-
{#if data.
|
|
65
|
+
{#if data.salePrice && !model.excludeBeforePrice}
|
|
66
66
|
<div class="price-stream-element__sale-price">
|
|
67
67
|
<div class="price-stream-element__save" style={saveValueCustomStyles}>
|
|
68
68
|
{localization.saveValue(saveValue)}
|
|
69
69
|
</div>
|
|
70
70
|
<div class="price-stream-element__before-price" style={beforeValueCustomStyles}>
|
|
71
|
-
{localization.beforeValue(toPriceRepresentation(data.price
|
|
71
|
+
{localization.beforeValue(toPriceRepresentation(data.price, data.currency, model.includeCurrency || false))}
|
|
72
72
|
</div>
|
|
73
73
|
</div>
|
|
74
74
|
{/if}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type IPriceStreamElementLocalization } from './price-stream-element-localization.svelte
|
|
1
|
+
import { type IPriceStreamElementLocalization } from './price-stream-element-localization.svelte';
|
|
2
2
|
import type { PriceStreamElementModel } from '../elements';
|
|
3
|
-
import type {
|
|
3
|
+
import type { StreamLayoutProductPriceModel } from '../models';
|
|
4
4
|
type Props = {
|
|
5
5
|
model: PriceStreamElementModel;
|
|
6
|
-
data:
|
|
6
|
+
data: StreamLayoutProductPriceModel;
|
|
7
7
|
localization?: IPriceStreamElementLocalization;
|
|
8
8
|
};
|
|
9
9
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
1
|
+
<script lang="ts">import { AnnotationStreamElementView, ContainerStreamElementView, ImageRefStreamElementView, ImagesStreamElementView, PriceStreamElementView, ShortVideoStreamElementView, SpacerStreamElementView, TextRefStreamElementView, TextStreamElementView, WebViewStreamElementView } from '.';
|
|
2
2
|
import { StreamElementLocalization } from './stream-element-localization.svelte';
|
|
3
3
|
import { StreamComponentDataType, StreamElementStyleDirection, StreamElementType } from '../enums';
|
|
4
4
|
let { model, data, constainerDirection = StreamElementStyleDirection.Vertical, localization: localizatoinInit, on } = $props();
|
|
@@ -42,19 +42,19 @@ const productModel = $derived.by(() => {
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
{#if model.type === StreamElementType.Annotation}
|
|
45
|
-
<
|
|
45
|
+
<AnnotationStreamElementView model={model} />
|
|
46
46
|
{:else if model.type === StreamElementType.Container}
|
|
47
|
-
<
|
|
47
|
+
<ContainerStreamElementView model={model} data={data} localization={localizatoinInit} />
|
|
48
48
|
{:else if model.type === StreamElementType.Spacer}
|
|
49
|
-
<
|
|
50
|
-
{:else if model.type === StreamElementType.ImageRef}
|
|
51
|
-
<
|
|
49
|
+
<SpacerStreamElementView model={model} parentContainerDirection={constainerDirection} />
|
|
50
|
+
{:else if model.type === StreamElementType.ImageRef && data}
|
|
51
|
+
<ImageRefStreamElementView model={model} data={data} />
|
|
52
52
|
{:else if model.type === StreamElementType.Images && imagesModel?.length}
|
|
53
|
-
<
|
|
53
|
+
<ImagesStreamElementView model={model} data={imagesModel} />
|
|
54
54
|
{:else if model.type === StreamElementType.Price && productModel}
|
|
55
|
-
<
|
|
55
|
+
<PriceStreamElementView model={model} data={productModel.price} localization={localization.priceElementLocalization} />
|
|
56
56
|
{:else if model.type === StreamElementType.ShortVideo && shortVideoModel}
|
|
57
|
-
<
|
|
57
|
+
<ShortVideoStreamElementView
|
|
58
58
|
data={shortVideoModel}
|
|
59
59
|
on={on
|
|
60
60
|
? {
|
|
@@ -64,7 +64,9 @@ const productModel = $derived.by(() => {
|
|
|
64
64
|
}
|
|
65
65
|
: undefined} />
|
|
66
66
|
{:else if model.type === StreamElementType.Text}
|
|
67
|
-
<
|
|
68
|
-
{:else if model.type === StreamElementType.TextRef}
|
|
69
|
-
<
|
|
67
|
+
<TextStreamElementView model={model} />
|
|
68
|
+
{:else if model.type === StreamElementType.TextRef && data}
|
|
69
|
+
<TextRefStreamElementView model={model} data={data} />
|
|
70
|
+
{:else if model.type === StreamElementType.WebView}
|
|
71
|
+
<WebViewStreamElementView model={model} />
|
|
70
72
|
{/if}
|
|
@@ -4,7 +4,7 @@ import { StreamElementStyleDirection } from '../enums';
|
|
|
4
4
|
import type { StreamSlotData } from '../slot-data';
|
|
5
5
|
type Props = {
|
|
6
6
|
model: StreamElementModel;
|
|
7
|
-
data: StreamSlotData;
|
|
7
|
+
data: StreamSlotData | null;
|
|
8
8
|
constainerDirection?: StreamElementStyleDirection;
|
|
9
9
|
localization?: IStreamElementLocalization;
|
|
10
10
|
on?: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TextRefStreamElementModel } from '../elements';
|
|
2
|
-
import type {
|
|
2
|
+
import type { StreamSlotDataRef } from '../slot-data-ref';
|
|
3
3
|
type Props = {
|
|
4
4
|
model: TextRefStreamElementModel;
|
|
5
|
-
data:
|
|
5
|
+
data: StreamSlotDataRef;
|
|
6
6
|
};
|
|
7
7
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
8
8
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">let { model } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="web-view-stream-element">
|
|
6
|
+
{#if model.url}
|
|
7
|
+
<iframe title="Web View" src={model.url} style="width: 100%; height: 100%; border: none;" allowfullscreen></iframe>
|
|
8
|
+
{:else}
|
|
9
|
+
<p>No URL provided for the web view.</p>
|
|
10
|
+
{/if}
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<style>@keyframes fadeIn {
|
|
14
|
+
0% {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
50% {
|
|
18
|
+
opacity: 0.4;
|
|
19
|
+
}
|
|
20
|
+
100% {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.web-view-stream-element {
|
|
25
|
+
width: 100%;
|
|
26
|
+
min-width: 100%;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
min-height: 100%;
|
|
30
|
+
max-height: 100%;
|
|
31
|
+
position: relative;
|
|
32
|
+
}</style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getStringValueByKey: (data:
|
|
3
|
-
export declare const getNumberValueByKey: (data:
|
|
1
|
+
import type { StreamSlotDataRef } from '../slot-data-ref';
|
|
2
|
+
export declare const getStringValueByKey: (data: StreamSlotDataRef, key: string) => string;
|
|
3
|
+
export declare const getNumberValueByKey: (data: StreamSlotDataRef, key: string) => number;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
1
|
+
export { default as StreamElementView } from './cmp.stream-element.svelte';
|
|
2
|
+
export { default as AnnotationStreamElementView } from './cmp.annotation-stream-element.svelte';
|
|
3
|
+
export { default as ContainerStreamElementView } from './cmp.container-stream-element.svelte';
|
|
4
|
+
export { default as ImageRefStreamElementView } from './cmp.image-ref-stream-element.svelte';
|
|
5
|
+
export { default as ImagesStreamElementView } from './cmp.images-stream-element.svelte';
|
|
6
|
+
export { default as PriceStreamElementView } from './cmp.price-stream-element.svelte';
|
|
7
|
+
export { default as ShortVideoStreamElementView } from './cmp.short-video-stream-element.svelte';
|
|
8
|
+
export { default as SpacerStreamElementView } from './cmp.spacer-stream-element.svelte';
|
|
9
|
+
export { default as TextRefStreamElementView } from './cmp.text-ref-stream-element.svelte';
|
|
10
|
+
export { default as TextStreamElementView } from './cmp.text-stream-element.svelte';
|
|
11
|
+
export { default as WebViewStreamElementView } from './cmp.web-view-stream-element.svelte';
|
|
11
12
|
export type { IStreamElementLocalization } from './stream-element-localization.svelte';
|
|
12
13
|
export type { IPriceStreamElementLocalization } from './price-stream-element-localization.svelte';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
1
|
+
export { default as StreamElementView } from './cmp.stream-element.svelte';
|
|
2
|
+
export { default as AnnotationStreamElementView } from './cmp.annotation-stream-element.svelte';
|
|
3
|
+
export { default as ContainerStreamElementView } from './cmp.container-stream-element.svelte';
|
|
4
|
+
export { default as ImageRefStreamElementView } from './cmp.image-ref-stream-element.svelte';
|
|
5
|
+
export { default as ImagesStreamElementView } from './cmp.images-stream-element.svelte';
|
|
6
|
+
export { default as PriceStreamElementView } from './cmp.price-stream-element.svelte';
|
|
7
|
+
export { default as ShortVideoStreamElementView } from './cmp.short-video-stream-element.svelte';
|
|
8
|
+
export { default as SpacerStreamElementView } from './cmp.spacer-stream-element.svelte';
|
|
9
|
+
export { default as TextRefStreamElementView } from './cmp.text-ref-stream-element.svelte';
|
|
10
|
+
export { default as TextStreamElementView } from './cmp.text-stream-element.svelte';
|
|
11
|
+
export { default as WebViewStreamElementView } from './cmp.web-view-stream-element.svelte';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { StreamElementType, ImagesStreamElementMode, AnnotationStreamElementPlacement } from './enums';
|
|
2
2
|
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles, AnnotationStreamElementStyles } from './styles';
|
|
3
|
-
export type StreamElementModel = AnnotationStreamElementModel | ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | SpacerStreamElementModel | ShortVideoStreamElementModel | TextStreamElementModel | TextRefStreamElementModel;
|
|
3
|
+
export type StreamElementModel = AnnotationStreamElementModel | ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | SpacerStreamElementModel | ShortVideoStreamElementModel | TextStreamElementModel | TextRefStreamElementModel | WebViewStreamElementModel;
|
|
4
4
|
export type AnnotationStreamElementModel = {
|
|
5
5
|
type: StreamElementType.Annotation;
|
|
6
|
-
id
|
|
6
|
+
$id: string;
|
|
7
|
+
name?: string | null;
|
|
7
8
|
svg: string;
|
|
8
9
|
inactive: boolean;
|
|
9
10
|
placement: AnnotationStreamElementPlacement;
|
|
@@ -11,50 +12,64 @@ export type AnnotationStreamElementModel = {
|
|
|
11
12
|
};
|
|
12
13
|
export type ContainerStreamElementModel = {
|
|
13
14
|
type: StreamElementType.Container;
|
|
14
|
-
id
|
|
15
|
+
$id: string;
|
|
16
|
+
name?: string | null;
|
|
15
17
|
elements: StreamElementModel[];
|
|
16
18
|
customizable: boolean | null;
|
|
17
19
|
styles: ContainerStreamElementStyles | null;
|
|
18
20
|
};
|
|
19
21
|
export type ImagesStreamElementModel = {
|
|
20
22
|
type: StreamElementType.Images;
|
|
21
|
-
id
|
|
23
|
+
$id: string;
|
|
24
|
+
name?: string | null;
|
|
22
25
|
mode: ImagesStreamElementMode;
|
|
23
26
|
};
|
|
24
27
|
export type ImageRefStreamElementModel = {
|
|
25
28
|
type: StreamElementType.ImageRef;
|
|
26
|
-
id
|
|
29
|
+
$id: string;
|
|
30
|
+
name?: string | null;
|
|
27
31
|
key: string;
|
|
28
32
|
annotations?: AnnotationStreamElementModel[] | null;
|
|
29
33
|
styles: ImageStreamElementStyles | null;
|
|
30
34
|
};
|
|
31
35
|
export type PriceStreamElementModel = {
|
|
32
36
|
type: StreamElementType.Price;
|
|
33
|
-
id
|
|
37
|
+
$id: string;
|
|
38
|
+
name?: string | null;
|
|
34
39
|
excludeBeforePrice: boolean | null;
|
|
35
40
|
includeCurrency: boolean | null;
|
|
36
41
|
styles: PriceStreamElementStyles | null;
|
|
37
42
|
};
|
|
38
43
|
export type ShortVideoStreamElementModel = {
|
|
39
44
|
type: StreamElementType.ShortVideo;
|
|
40
|
-
id
|
|
45
|
+
$id: string;
|
|
46
|
+
name?: string | null;
|
|
41
47
|
};
|
|
42
48
|
export type SpacerStreamElementModel = {
|
|
43
49
|
type: StreamElementType.Spacer;
|
|
44
|
-
id
|
|
50
|
+
$id: string;
|
|
51
|
+
name?: string | null;
|
|
45
52
|
value: number | null;
|
|
46
53
|
};
|
|
47
54
|
export type TextStreamElementModel = {
|
|
48
55
|
type: StreamElementType.Text;
|
|
49
|
-
id
|
|
56
|
+
$id: string;
|
|
57
|
+
name?: string | null;
|
|
50
58
|
value: string | null;
|
|
51
59
|
styles: TextStreamElementStyles | null;
|
|
52
60
|
};
|
|
53
61
|
export type TextRefStreamElementModel = {
|
|
54
62
|
type: StreamElementType.TextRef;
|
|
55
|
-
id
|
|
63
|
+
$id: string;
|
|
64
|
+
name?: string | null;
|
|
56
65
|
key: string;
|
|
57
66
|
valueBefore: string | null;
|
|
58
67
|
valueAfter: string | null;
|
|
59
68
|
styles: TextStreamElementStyles | null;
|
|
60
69
|
};
|
|
70
|
+
export type WebViewStreamElementModel = {
|
|
71
|
+
type: StreamElementType.WebView;
|
|
72
|
+
$id: string;
|
|
73
|
+
name?: string | null;
|
|
74
|
+
url: string | null;
|
|
75
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum StreamComponentDataType {
|
|
2
2
|
Images = "IMAGES",
|
|
3
|
+
NoData = "NO_DATA",
|
|
3
4
|
ShortVideo = "SHORT_VIDEO",
|
|
4
5
|
Product = "PRODUCT"
|
|
5
6
|
}
|
|
@@ -12,7 +13,8 @@ export declare enum StreamElementType {
|
|
|
12
13
|
Spacer = "SPACER",
|
|
13
14
|
ShortVideo = "SHORT_VIDEO",
|
|
14
15
|
Text = "TEXT",
|
|
15
|
-
TextRef = "TEXT_REF"
|
|
16
|
+
TextRef = "TEXT_REF",
|
|
17
|
+
WebView = "WEB_VIEW"
|
|
16
18
|
}
|
|
17
19
|
export declare enum AnnotationStreamElementPlacement {
|
|
18
20
|
TopLeft = "TOP_LEFT",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var StreamComponentDataType;
|
|
2
2
|
(function (StreamComponentDataType) {
|
|
3
3
|
StreamComponentDataType["Images"] = "IMAGES";
|
|
4
|
+
StreamComponentDataType["NoData"] = "NO_DATA";
|
|
4
5
|
StreamComponentDataType["ShortVideo"] = "SHORT_VIDEO";
|
|
5
6
|
StreamComponentDataType["Product"] = "PRODUCT";
|
|
6
7
|
})(StreamComponentDataType || (StreamComponentDataType = {}));
|
|
@@ -15,6 +16,7 @@ export var StreamElementType;
|
|
|
15
16
|
StreamElementType["ShortVideo"] = "SHORT_VIDEO";
|
|
16
17
|
StreamElementType["Text"] = "TEXT";
|
|
17
18
|
StreamElementType["TextRef"] = "TEXT_REF";
|
|
19
|
+
StreamElementType["WebView"] = "WEB_VIEW";
|
|
18
20
|
})(StreamElementType || (StreamElementType = {}));
|
|
19
21
|
export var AnnotationStreamElementPlacement;
|
|
20
22
|
(function (AnnotationStreamElementPlacement) {
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import { StreamComponentDataType
|
|
1
|
+
import { StreamComponentDataType } from './enums';
|
|
2
2
|
import type { StreamLayout } from './layout';
|
|
3
3
|
import type { StreamLayoutShortVideoModel } from './models';
|
|
4
4
|
import type { StreamSlot } from './slot';
|
|
5
|
-
import type { AnnotationStreamElementStyles, ContainerStreamElementStyles, ImageStreamElementStyles, PriceStreamElementStyles, TextStreamElementStyles } from './styles';
|
|
6
5
|
export { default as StreamPageLayout } from './cmp.layout.svelte';
|
|
7
6
|
export { default as StreamLayoutSlot } from './cmp.slot.svelte';
|
|
8
7
|
export { default as StreamLayoutSlotContent } from './cmp.slot-content.svelte';
|
|
9
8
|
export * from './layout';
|
|
10
9
|
export * from './svg-attributes';
|
|
11
|
-
export { parseToStreamLayout, stringifyToStreamLayoutInput } from './serializer';
|
|
10
|
+
export { parseToStreamLayout, parseToStreamLayoutTemplate, stringifyToStreamLayoutInput, IdPopulator } from './serializer.svelte';
|
|
12
11
|
export declare const getAllowedDataTypesForSlot: (slot: StreamSlot) => StreamComponentDataType[];
|
|
13
12
|
export declare const getSingleShortVideoFromLayout: (layout: StreamLayout) => StreamLayoutShortVideoModel | null;
|
|
14
|
-
export type ElementTypeToStyles = {
|
|
15
|
-
[StreamElementType.Annotation]: AnnotationStreamElementStyles;
|
|
16
|
-
[StreamElementType.Container]: ContainerStreamElementStyles;
|
|
17
|
-
[StreamElementType.Price]: PriceStreamElementStyles;
|
|
18
|
-
[StreamElementType.ImageRef]: ImageStreamElementStyles;
|
|
19
|
-
[StreamElementType.Text]: TextStreamElementStyles;
|
|
20
|
-
[StreamElementType.TextRef]: TextStreamElementStyles;
|
|
21
|
-
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StreamComponentDataType
|
|
1
|
+
import { StreamComponentDataType } from './enums';
|
|
2
2
|
export { default as StreamPageLayout } from './cmp.layout.svelte';
|
|
3
3
|
export { default as StreamLayoutSlot } from './cmp.slot.svelte';
|
|
4
4
|
export { default as StreamLayoutSlotContent } from './cmp.slot-content.svelte';
|
|
5
5
|
export * from './layout';
|
|
6
6
|
export * from './svg-attributes';
|
|
7
|
-
export { parseToStreamLayout, stringifyToStreamLayoutInput } from './serializer';
|
|
7
|
+
export { parseToStreamLayout, parseToStreamLayoutTemplate, stringifyToStreamLayoutInput, IdPopulator } from './serializer.svelte';
|
|
8
8
|
export const getAllowedDataTypesForSlot = (slot) => {
|
|
9
9
|
return slot.components.flatMap((c) => c.dataType);
|
|
10
10
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { StreamSlot, StreamSlotInput, StreamSlotTemplate } from './slot';
|
|
2
2
|
import type { StreamLayoutStyles } from './styles';
|
|
3
3
|
export type StreamLayoutTemplate = {
|
|
4
|
+
$id: string;
|
|
5
|
+
name?: string | null;
|
|
4
6
|
styles: StreamLayoutStyles | null;
|
|
5
7
|
slots: StreamSlotTemplate[];
|
|
6
8
|
};
|
|
@@ -8,6 +10,5 @@ export type StreamLayoutInput = Omit<StreamLayoutTemplate, 'slots'> & {
|
|
|
8
10
|
slots: StreamSlotInput[];
|
|
9
11
|
};
|
|
10
12
|
export type StreamLayout = Omit<StreamLayoutTemplate, 'slots'> & {
|
|
11
|
-
id?: string;
|
|
12
13
|
slots: StreamSlot[];
|
|
13
14
|
};
|
|
@@ -2,5 +2,5 @@ export { mapToShortVideoViewerModel } from './mapper';
|
|
|
2
2
|
export type { StreamLayoutBlobModel } from './stream-layout-blob-model';
|
|
3
3
|
export type { StreamLayoutMediaItemModel } from './stream-layout-media-item-model';
|
|
4
4
|
export type { StreamLayoutPostHeaderModel } from './stream-layout-post-header-model';
|
|
5
|
-
export type { StreamLayoutProductModel } from './stream-layout-product-model';
|
|
5
|
+
export type { StreamLayoutProductModel, StreamLayoutProductPriceModel } from './stream-layout-product-model';
|
|
6
6
|
export type { StreamLayoutShortVideoModel, StreamLayoutShortVideoProductModel, StreamLayoutShortVideoAdModel } from './stream-layout-short-video-model';
|
|
@@ -7,7 +7,7 @@ export type StreamLayoutProductModel = {
|
|
|
7
7
|
link: string | null;
|
|
8
8
|
price: StreamLayoutProductPriceModel;
|
|
9
9
|
};
|
|
10
|
-
type StreamLayoutProductPriceModel = {
|
|
10
|
+
export type StreamLayoutProductPriceModel = {
|
|
11
11
|
price: number;
|
|
12
12
|
currency: Currency;
|
|
13
13
|
salePrice: number | null;
|
|
@@ -16,4 +16,3 @@ type StreamLayoutProductPriceModel = {
|
|
|
16
16
|
saveValue: string | null;
|
|
17
17
|
savePercentValue: string | null;
|
|
18
18
|
};
|
|
19
|
-
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StreamElementModel } from './elements';
|
|
2
|
+
import type { StreamLayout, StreamLayoutTemplate } from './layout';
|
|
3
|
+
export declare const parseToStreamLayout: (value: string) => StreamLayout;
|
|
4
|
+
export declare const parseToStreamLayoutTemplate: (value: string) => StreamLayoutTemplate;
|
|
5
|
+
export declare const stringifyToStreamLayoutInput: (layout: StreamLayout | StreamLayoutTemplate) => string;
|
|
6
|
+
export declare class IdPopulator {
|
|
7
|
+
static populateLayoutIds(layout: {
|
|
8
|
+
$id: string;
|
|
9
|
+
slots: {
|
|
10
|
+
$id: string;
|
|
11
|
+
components: {
|
|
12
|
+
$id: string;
|
|
13
|
+
elements: StreamElementModel[];
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
}): void;
|
|
17
|
+
static populateSlotIds(slot: {
|
|
18
|
+
$id: string;
|
|
19
|
+
components: {
|
|
20
|
+
$id: string;
|
|
21
|
+
elements: StreamElementModel[];
|
|
22
|
+
}[];
|
|
23
|
+
}): void;
|
|
24
|
+
static populateComponentIds(component: {
|
|
25
|
+
$id: string;
|
|
26
|
+
elements: StreamElementModel[];
|
|
27
|
+
}): void;
|
|
28
|
+
static populateElementId(element: StreamElementModel): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Utils } from '../../core/utils';
|
|
2
|
+
import { StreamComponentDataType, StreamElementType } from './enums';
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
4
|
+
export const parseToStreamLayout = (value) => {
|
|
5
|
+
const layout = JSON.parse(value);
|
|
6
|
+
IdPopulator.populateLayoutIds(layout);
|
|
7
|
+
return layout;
|
|
8
|
+
};
|
|
9
|
+
export const parseToStreamLayoutTemplate = (value) => {
|
|
10
|
+
const layout = JSON.parse(value);
|
|
11
|
+
IdPopulator.populateLayoutIds(layout);
|
|
12
|
+
return layout;
|
|
13
|
+
};
|
|
14
|
+
export const stringifyToStreamLayoutInput = (layout) => {
|
|
15
|
+
const clone = structuredClone($state.snapshot(layout));
|
|
16
|
+
// @ts-expect-error - clearing local data before sending to the server - clearing local data before sending to the server
|
|
17
|
+
delete clone.$id;
|
|
18
|
+
if (clone.slots) {
|
|
19
|
+
clone.slots.forEach((slot) => {
|
|
20
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
21
|
+
delete slot.$id;
|
|
22
|
+
slot.components.forEach((component) => {
|
|
23
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
24
|
+
delete component.$id;
|
|
25
|
+
component.elements.forEach(removeElementIdRecursive);
|
|
26
|
+
});
|
|
27
|
+
if ('data' in slot && slot.data) {
|
|
28
|
+
const data = slot.data;
|
|
29
|
+
switch (data.type) {
|
|
30
|
+
case StreamComponentDataType.Images:
|
|
31
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
32
|
+
delete data.items;
|
|
33
|
+
break;
|
|
34
|
+
case StreamComponentDataType.ShortVideo:
|
|
35
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
36
|
+
delete data.shortVideo;
|
|
37
|
+
break;
|
|
38
|
+
case StreamComponentDataType.Product:
|
|
39
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
40
|
+
delete data.product;
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
Utils.assertUnreachable(data);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return JSON.stringify(clone);
|
|
49
|
+
};
|
|
50
|
+
const removeElementIdRecursive = (element) => {
|
|
51
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
52
|
+
delete element.$id;
|
|
53
|
+
if (element.type === StreamElementType.Container && Array.isArray(element.elements)) {
|
|
54
|
+
element.elements.forEach(removeElementIdRecursive);
|
|
55
|
+
}
|
|
56
|
+
if (element.type === StreamElementType.ImageRef && Array.isArray(element.annotations)) {
|
|
57
|
+
element.annotations.forEach((annotation) => {
|
|
58
|
+
// @ts-expect-error - clearing local data before sending to the server
|
|
59
|
+
delete annotation.$id;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export class IdPopulator {
|
|
64
|
+
static populateLayoutIds(layout) {
|
|
65
|
+
layout.$id = nanoid(10);
|
|
66
|
+
layout.slots.forEach((slot) => IdPopulator.populateSlotIds(slot));
|
|
67
|
+
}
|
|
68
|
+
static populateSlotIds(slot) {
|
|
69
|
+
slot.$id = nanoid(10);
|
|
70
|
+
slot.components.forEach((component) => IdPopulator.populateComponentIds(component));
|
|
71
|
+
}
|
|
72
|
+
static populateComponentIds(component) {
|
|
73
|
+
component.$id = nanoid(10);
|
|
74
|
+
component.elements.forEach((element) => IdPopulator.populateElementId(element));
|
|
75
|
+
}
|
|
76
|
+
static populateElementId(element) {
|
|
77
|
+
element.$id = nanoid(10);
|
|
78
|
+
// Рекурсивно обрабатываем дочерние элементы
|
|
79
|
+
if (element.type === StreamElementType.Container && element.elements) {
|
|
80
|
+
element.elements.forEach((element) => IdPopulator.populateElementId(element));
|
|
81
|
+
}
|
|
82
|
+
if (element.type === StreamElementType.ImageRef && element.annotations) {
|
|
83
|
+
element.annotations.forEach((element) => IdPopulator.populateElementId(element));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ImagesStreamSlotData, ProductStreamSlotData, ShortVideoStreamSlotData } from './slot-data';
|
|
2
|
+
export type StreamSlotDataRef = Partial<Pick<ImagesStreamSlotData, 'items'>> & Partial<Pick<ProductStreamSlotData, 'product'>> & Partial<Pick<ShortVideoStreamSlotData, 'shortVideo'>>;
|
|
3
|
+
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...0[]];
|
|
4
|
+
type Join<K, P> = K extends string | number ? (P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never) : never;
|
|
5
|
+
type IsPrimitive<T> = T extends string | number | boolean | null | undefined ? true : false;
|
|
6
|
+
type ExcludeBuiltins<T> = {
|
|
7
|
+
[K in keyof T as K extends keyof any[] ? never : K extends symbol ? never : T[K] extends (...args: any[]) => any ? never : T[K] extends any[] ? never : K]: T[K];
|
|
8
|
+
};
|
|
9
|
+
type Paths<T, D extends number = 4> = [D] extends [never] ? never : T extends object ? {
|
|
10
|
+
[K in keyof ExcludeBuiltins<T>]: K extends string | number ? IsPrimitive<ExcludeBuiltins<T>[K]> extends true ? `${K}` : ExcludeBuiltins<T>[K] extends object | null ? ExcludeBuiltins<T>[K] extends null ? never : Join<K, Paths<ExcludeBuiltins<NonNullable<T[K]>>, Prev[D]>> : never : never;
|
|
11
|
+
}[keyof ExcludeBuiltins<T>] : '';
|
|
12
|
+
export type StreamSlotDataRefPaths = `#${Paths<Required<StreamSlotDataRef>>}`;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,8 @@ import type { StreamComponent } from './component';
|
|
|
2
2
|
import type { StreamSlotData } from './slot-data';
|
|
3
3
|
import type { StreamSlotDataInput } from './slot-data-input';
|
|
4
4
|
export type StreamSlotTemplate = {
|
|
5
|
+
$id: string;
|
|
6
|
+
name?: string | null;
|
|
5
7
|
top: number;
|
|
6
8
|
left: number;
|
|
7
9
|
width: number;
|
|
@@ -1,8 +1,37 @@
|
|
|
1
|
+
import type { AnnotationStreamElementModel, ContainerStreamElementModel, ImageRefStreamElementModel, ImagesStreamElementModel, PriceStreamElementModel, ShortVideoStreamElementModel, SpacerStreamElementModel, TextRefStreamElementModel, TextStreamElementModel, WebViewStreamElementModel } from './elements';
|
|
2
|
+
import { StreamElementType } from './enums';
|
|
1
3
|
import type { ImagesStreamSlotData, ProductStreamSlotData, ShortVideoStreamSlotData, StreamSlotData } from './slot-data';
|
|
2
4
|
import type { ImagesStreamSlotDataInput, ProductStreamSlotDataInput, ShortVideoStreamSlotDataInput, StreamSlotDataInput } from './slot-data-input';
|
|
5
|
+
import type { AnnotationStreamElementStyles, ContainerStreamElementStyles, ImageStreamElementStyles, PriceStreamElementStyles, TextStreamElementStyles } from './styles';
|
|
3
6
|
export declare function isImagesSlotDataInput(data: StreamSlotDataInput | null): data is ImagesStreamSlotDataInput;
|
|
4
7
|
export declare function isProductSlotDataInput(data: StreamSlotDataInput | null): data is ProductStreamSlotDataInput;
|
|
5
8
|
export declare function isShortVideoSlotDataInput(data: StreamSlotDataInput | null): data is ShortVideoStreamSlotDataInput;
|
|
6
9
|
export declare function isImagesSlotData(data: StreamSlotData | null): data is ImagesStreamSlotData;
|
|
7
10
|
export declare function isProductSlotData(data: StreamSlotData | null): data is ProductStreamSlotData;
|
|
8
11
|
export declare function isShortVideoSlotData(data: StreamSlotData | null): data is ShortVideoStreamSlotData;
|
|
12
|
+
export type ElementTypeToStylesMap = {
|
|
13
|
+
[StreamElementType.Annotation]: AnnotationStreamElementStyles;
|
|
14
|
+
[StreamElementType.Container]: ContainerStreamElementStyles;
|
|
15
|
+
[StreamElementType.Price]: PriceStreamElementStyles;
|
|
16
|
+
[StreamElementType.ImageRef]: ImageStreamElementStyles;
|
|
17
|
+
[StreamElementType.Text]: TextStreamElementStyles;
|
|
18
|
+
[StreamElementType.TextRef]: TextStreamElementStyles;
|
|
19
|
+
};
|
|
20
|
+
export type ElementTypeToModelMap = {
|
|
21
|
+
[StreamElementType.Annotation]: AnnotationStreamElementModel;
|
|
22
|
+
[StreamElementType.Container]: ContainerStreamElementModel;
|
|
23
|
+
[StreamElementType.ImageRef]: ImageRefStreamElementModel;
|
|
24
|
+
[StreamElementType.Images]: ImagesStreamElementModel;
|
|
25
|
+
[StreamElementType.Price]: PriceStreamElementModel;
|
|
26
|
+
[StreamElementType.ShortVideo]: ShortVideoStreamElementModel;
|
|
27
|
+
[StreamElementType.Spacer]: SpacerStreamElementModel;
|
|
28
|
+
[StreamElementType.Text]: TextStreamElementModel;
|
|
29
|
+
[StreamElementType.TextRef]: TextRefStreamElementModel;
|
|
30
|
+
[StreamElementType.WebView]: WebViewStreamElementModel;
|
|
31
|
+
};
|
|
32
|
+
export declare const NotAllowedElementTypesForComponent: {
|
|
33
|
+
IMAGES: StreamElementType[];
|
|
34
|
+
PRODUCT: StreamElementType[];
|
|
35
|
+
SHORT_VIDEO: StreamElementType[];
|
|
36
|
+
NO_DATA: StreamElementType[];
|
|
37
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
1
|
+
import { StreamComponentDataType, StreamElementType } from './enums';
|
|
2
2
|
// SlotDataInput guards
|
|
3
3
|
export function isImagesSlotDataInput(data) {
|
|
4
4
|
return data?.type === StreamComponentDataType.Images;
|
|
@@ -19,3 +19,15 @@ export function isProductSlotData(data) {
|
|
|
19
19
|
export function isShortVideoSlotData(data) {
|
|
20
20
|
return data?.type === StreamComponentDataType.ShortVideo;
|
|
21
21
|
}
|
|
22
|
+
export const NotAllowedElementTypesForComponent = {
|
|
23
|
+
[StreamComponentDataType.Images]: [StreamElementType.ImageRef, StreamElementType.Price, StreamElementType.ShortVideo, StreamElementType.TextRef],
|
|
24
|
+
[StreamComponentDataType.Product]: [StreamElementType.Images, StreamElementType.ShortVideo],
|
|
25
|
+
[StreamComponentDataType.ShortVideo]: [StreamElementType.ImageRef, StreamElementType.Price, StreamElementType.TextRef],
|
|
26
|
+
[StreamComponentDataType.NoData]: [
|
|
27
|
+
StreamElementType.ImageRef,
|
|
28
|
+
StreamElementType.Images,
|
|
29
|
+
StreamElementType.Price,
|
|
30
|
+
StreamElementType.ShortVideo,
|
|
31
|
+
StreamElementType.TextRef
|
|
32
|
+
]
|
|
33
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { Icon } from '../icon';
|
|
2
|
-
import IconArrowUp from '@fluentui/svg-icons/icons/arrow_up_20_regular.svg?raw';
|
|
3
2
|
import { SwipeIndicatorLocalization } from './swipe-indicator-localization.svelte';
|
|
3
|
+
import IconArrowUp from '@fluentui/svg-icons/icons/arrow_up_20_regular.svg?raw';
|
|
4
4
|
let { fadeTimeout = 2000, localization: localizationInit } = $props();
|
|
5
5
|
const localization = $derived(new SwipeIndicatorLocalization(localizationInit));
|
|
6
6
|
let isFaded = $state(false);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamscloud/embeddable",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"author": "StreamsCloud",
|
|
5
5
|
"repository": "https://github.com/StreamsCloud/streamscloud-frontend-packages.git",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite dev --port 3010",
|
|
9
|
-
"build": "svelte-package --tsconfig ./tsconfig.app.json && prettier --write --plugin prettier-plugin-svelte .",
|
|
9
|
+
"build": "svelte-package --tsconfig ./tsconfig.app.json && prettier --write --plugin prettier-plugin-svelte . && eslint --fix .",
|
|
10
10
|
"pack": "npm run build && npm pack",
|
|
11
11
|
"preview": "vite preview",
|
|
12
12
|
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
|
|
@@ -77,6 +77,10 @@
|
|
|
77
77
|
"types": "./dist/streams/layout/slot-data-input.d.ts",
|
|
78
78
|
"import": "./dist/streams/layout/slot-data-input.js"
|
|
79
79
|
},
|
|
80
|
+
"./stream-layout/slot-data-ref": {
|
|
81
|
+
"types": "./dist/streams/layout/slot-data-ref.d.ts",
|
|
82
|
+
"import": "./dist/streams/layout/slot-data-ref.js"
|
|
83
|
+
},
|
|
80
84
|
"./stream-layout/styles": {
|
|
81
85
|
"types": "./dist/streams/layout/styles.d.ts",
|
|
82
86
|
"import": "./dist/streams/layout/styles.js"
|