@streamscloud/embeddable 2.2.5 → 2.2.6
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/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
- package/dist/streams/layout/elements.d.ts +19 -4
- package/dist/streams/layout/elements.js +1 -1
- package/dist/streams/layout/enums.d.ts +2 -1
- package/dist/streams/layout/enums.js +7 -6
- 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/styles.d.ts +19 -14
- package/dist/streams/layout/svg.d.ts +18 -0
- package/dist/streams/layout/svg.js +12 -0
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">import { Image } from '../../../ui/image';
|
|
2
|
-
import {
|
|
2
|
+
import { ImagesStreamElementMode } from '../enums';
|
|
3
3
|
let { model, data } = $props();
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<div class="images-stream-element">
|
|
7
7
|
{#if data.length > 0}
|
|
8
|
-
{#if model.mode ===
|
|
8
|
+
{#if model.mode === ImagesStreamElementMode.Single || data.length === 1}
|
|
9
9
|
<Image src={data[0].url} />
|
|
10
10
|
{:else}
|
|
11
11
|
need implement multiple images
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import type { StreamSvgModel } from './svg';
|
|
2
|
+
import { StreamElementType, ImagesStreamElementMode } from './enums';
|
|
3
|
+
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles, AnnotationStreamElementStyles } from './styles';
|
|
4
|
+
export type StreamElementModel = AnnotationStreamElementModel | ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | SpacerStreamElementModel | ShortVideoStreamElementModel | TextStreamElementModel | TextRefStreamElementModel;
|
|
5
|
+
export type AnnotationStreamElementModel = {
|
|
6
|
+
type: StreamElementType.Annotation;
|
|
7
|
+
id?: string;
|
|
8
|
+
svg: StreamSvgModel;
|
|
9
|
+
showIfProductOnSaleOnly: boolean | null;
|
|
10
|
+
styles: AnnotationStreamElementStyles;
|
|
11
|
+
};
|
|
4
12
|
export type ContainerStreamElementModel = {
|
|
5
13
|
type: StreamElementType.Container;
|
|
6
14
|
id?: string;
|
|
@@ -11,12 +19,13 @@ export type ContainerStreamElementModel = {
|
|
|
11
19
|
export type ImagesStreamElementModel = {
|
|
12
20
|
type: StreamElementType.Images;
|
|
13
21
|
id?: string;
|
|
14
|
-
mode:
|
|
22
|
+
mode: ImagesStreamElementMode;
|
|
15
23
|
};
|
|
16
24
|
export type ImageRefStreamElementModel = {
|
|
17
25
|
type: StreamElementType.ImageRef;
|
|
18
26
|
id?: string;
|
|
19
27
|
key: string;
|
|
28
|
+
annotations?: StreamAnnotionsModel | null;
|
|
20
29
|
styles: ImageStreamElementStyles | null;
|
|
21
30
|
};
|
|
22
31
|
export type PriceStreamElementModel = {
|
|
@@ -49,3 +58,9 @@ export type TextRefStreamElementModel = {
|
|
|
49
58
|
valueAfter: string | null;
|
|
50
59
|
styles: TextStreamElementStyles | null;
|
|
51
60
|
};
|
|
61
|
+
export type StreamAnnotionsModel = {
|
|
62
|
+
topLeft?: AnnotationStreamElementModel | null;
|
|
63
|
+
topRight?: AnnotationStreamElementModel | null;
|
|
64
|
+
bottomLeft?: AnnotationStreamElementModel | null;
|
|
65
|
+
bottomRight?: AnnotationStreamElementModel | null;
|
|
66
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { StreamElementType,
|
|
1
|
+
import { StreamElementType, ImagesStreamElementMode } from './enums';
|
|
@@ -4,6 +4,7 @@ export declare enum StreamComponentDataType {
|
|
|
4
4
|
Product = "PRODUCT"
|
|
5
5
|
}
|
|
6
6
|
export declare enum StreamElementType {
|
|
7
|
+
Annotation = "ANNOTATION",
|
|
7
8
|
Container = "CONTAINER",
|
|
8
9
|
ImageRef = "IMAGE_REF",
|
|
9
10
|
Images = "IMAGES",
|
|
@@ -13,7 +14,7 @@ export declare enum StreamElementType {
|
|
|
13
14
|
Text = "TEXT",
|
|
14
15
|
TextRef = "TEXT_REF"
|
|
15
16
|
}
|
|
16
|
-
export declare enum
|
|
17
|
+
export declare enum ImagesStreamElementMode {
|
|
17
18
|
Single = "SINGLE",
|
|
18
19
|
Gallery = "GALLERY",
|
|
19
20
|
Slider = "SLIDER"
|
|
@@ -6,6 +6,7 @@ export var StreamComponentDataType;
|
|
|
6
6
|
})(StreamComponentDataType || (StreamComponentDataType = {}));
|
|
7
7
|
export var StreamElementType;
|
|
8
8
|
(function (StreamElementType) {
|
|
9
|
+
StreamElementType["Annotation"] = "ANNOTATION";
|
|
9
10
|
StreamElementType["Container"] = "CONTAINER";
|
|
10
11
|
StreamElementType["ImageRef"] = "IMAGE_REF";
|
|
11
12
|
StreamElementType["Images"] = "IMAGES";
|
|
@@ -15,12 +16,12 @@ export var StreamElementType;
|
|
|
15
16
|
StreamElementType["Text"] = "TEXT";
|
|
16
17
|
StreamElementType["TextRef"] = "TEXT_REF";
|
|
17
18
|
})(StreamElementType || (StreamElementType = {}));
|
|
18
|
-
export var
|
|
19
|
-
(function (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})(
|
|
19
|
+
export var ImagesStreamElementMode;
|
|
20
|
+
(function (ImagesStreamElementMode) {
|
|
21
|
+
ImagesStreamElementMode["Single"] = "SINGLE";
|
|
22
|
+
ImagesStreamElementMode["Gallery"] = "GALLERY";
|
|
23
|
+
ImagesStreamElementMode["Slider"] = "SLIDER";
|
|
24
|
+
})(ImagesStreamElementMode || (ImagesStreamElementMode = {}));
|
|
24
25
|
export var StreamElementStyleMediaFit;
|
|
25
26
|
(function (StreamElementStyleMediaFit) {
|
|
26
27
|
StreamElementStyleMediaFit["Cover"] = "COVER";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { MediaType } from '
|
|
1
|
+
import { MediaType } from '../../../core/enums';
|
|
@@ -4,6 +4,25 @@ export type StreamLayoutStyles = {
|
|
|
4
4
|
backgroundColor?: string | null;
|
|
5
5
|
fontFamily?: StreamElementStyleFontFamily | null;
|
|
6
6
|
};
|
|
7
|
+
export type AnnotationStreamElementStyles = {
|
|
8
|
+
size: number;
|
|
9
|
+
horizontalIndent: number;
|
|
10
|
+
verticalIndent: number;
|
|
11
|
+
};
|
|
12
|
+
export type ContainerStreamElementStyles = {
|
|
13
|
+
width?: StreamCssValue | null;
|
|
14
|
+
height?: StreamCssValue | null;
|
|
15
|
+
aspectRatio?: number | null;
|
|
16
|
+
direction?: StreamElementStyleDirection | null;
|
|
17
|
+
gap?: number | null;
|
|
18
|
+
paddingTop?: number | null;
|
|
19
|
+
paddingRight?: number | null;
|
|
20
|
+
paddingBottom?: number | null;
|
|
21
|
+
paddingLeft?: number | null;
|
|
22
|
+
backgroundColor?: string | null;
|
|
23
|
+
borderRadius?: number | null;
|
|
24
|
+
borderColor?: string | null;
|
|
25
|
+
};
|
|
7
26
|
export type ImageStreamElementStyles = {
|
|
8
27
|
mediaFit?: StreamElementStyleMediaFit | null;
|
|
9
28
|
};
|
|
@@ -27,17 +46,3 @@ export type TextStreamElementStyles = {
|
|
|
27
46
|
color?: string | null;
|
|
28
47
|
maxLines?: number | null;
|
|
29
48
|
};
|
|
30
|
-
export type ContainerStreamElementStyles = {
|
|
31
|
-
width?: StreamCssValue | null;
|
|
32
|
-
height?: StreamCssValue | null;
|
|
33
|
-
aspectRatio?: number | null;
|
|
34
|
-
direction?: StreamElementStyleDirection | null;
|
|
35
|
-
gap?: number | null;
|
|
36
|
-
paddingTop?: number | null;
|
|
37
|
-
paddingRight?: number | null;
|
|
38
|
-
paddingBottom?: number | null;
|
|
39
|
-
paddingLeft?: number | null;
|
|
40
|
-
backgroundColor?: string | null;
|
|
41
|
-
borderRadius?: number | null;
|
|
42
|
-
borderColor?: string | null;
|
|
43
|
-
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StreamSvgModel = {
|
|
2
|
+
src: string;
|
|
3
|
+
texts: {
|
|
4
|
+
id: string;
|
|
5
|
+
value: StreamSvgTextValueType;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
export declare enum StreamSvgTextValueType {
|
|
9
|
+
currency = "STREAM_SVG_CURRENCY",
|
|
10
|
+
price = "STREAM_SVG_PRODUCT_PRICE",
|
|
11
|
+
priceInteger = "STREAM_SVG_PRODUCT_PRICE_INTEGER",
|
|
12
|
+
priceFraction = "STREAM_SVG_PRODUCT_PRICE_FRACTION",
|
|
13
|
+
beforePrice = "STREAM_SVG_PRODUCT_BEFORE_PRICE",
|
|
14
|
+
beforePriceInteger = "STREAM_SVG_PRODUCT_BEFORE_PRICE_INTEGER",
|
|
15
|
+
beforePriceFraction = "STREAM_SVG_PRODUCT_BEFORE_PRICE_FRACTION",
|
|
16
|
+
saveValue = "SVG_PRODUCT_SAVE_VALUE",
|
|
17
|
+
savePercentValue = "SVG_PRODUCT_SAVE_PERCENT_VALUE"
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var StreamSvgTextValueType;
|
|
2
|
+
(function (StreamSvgTextValueType) {
|
|
3
|
+
StreamSvgTextValueType["currency"] = "STREAM_SVG_CURRENCY";
|
|
4
|
+
StreamSvgTextValueType["price"] = "STREAM_SVG_PRODUCT_PRICE";
|
|
5
|
+
StreamSvgTextValueType["priceInteger"] = "STREAM_SVG_PRODUCT_PRICE_INTEGER";
|
|
6
|
+
StreamSvgTextValueType["priceFraction"] = "STREAM_SVG_PRODUCT_PRICE_FRACTION";
|
|
7
|
+
StreamSvgTextValueType["beforePrice"] = "STREAM_SVG_PRODUCT_BEFORE_PRICE";
|
|
8
|
+
StreamSvgTextValueType["beforePriceInteger"] = "STREAM_SVG_PRODUCT_BEFORE_PRICE_INTEGER";
|
|
9
|
+
StreamSvgTextValueType["beforePriceFraction"] = "STREAM_SVG_PRODUCT_BEFORE_PRICE_FRACTION";
|
|
10
|
+
StreamSvgTextValueType["saveValue"] = "SVG_PRODUCT_SAVE_VALUE";
|
|
11
|
+
StreamSvgTextValueType["savePercentValue"] = "SVG_PRODUCT_SAVE_PERCENT_VALUE";
|
|
12
|
+
})(StreamSvgTextValueType || (StreamSvgTextValueType = {}));
|