@streamscloud/embeddable 3.2.2 → 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 -2
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +0 -1
- package/dist/short-videos/short-video-viewer/operations.generated.js +0 -1
- package/dist/short-videos/short-video-viewer/operations.graphql +0 -1
- 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 -1
- 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 -2
- 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 -65
- package/dist/short-videos/short-videos-player/operations.generated.js +0 -194
- 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
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { TextStreamElementModel } from '../elements';
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
2
|
type Props = {
|
|
4
3
|
model: TextStreamElementModel;
|
|
5
|
-
placeholder?: Snippet;
|
|
6
4
|
};
|
|
7
5
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
8
6
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getStringValueByKey: (data:
|
|
3
|
-
export declare const getNumberValueByKey: (data:
|
|
1
|
+
import type { StreamSlotData } from '../slot-data';
|
|
2
|
+
export declare const getStringValueByKey: (data: StreamSlotData, key: string) => string;
|
|
3
|
+
export declare const getNumberValueByKey: (data: StreamSlotData, key: string) => number;
|
|
@@ -1,16 +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 {
|
|
11
|
-
export {
|
|
12
|
-
export { default as WebViewStreamElementView } from './cmp.web-view-stream-element.svelte';
|
|
13
|
-
export type { IStreamElementLocalization } from './stream-element-localization';
|
|
14
|
-
export type { IPriceStreamElementLocalization } from './price-stream-element-localization';
|
|
15
|
-
export type { IStockStreamElementLocalization } from './stock-stream-element-localization';
|
|
16
|
-
export type { IShortVideoStreamElementLocalization } from './short-video-stream-element-localization';
|
|
1
|
+
export { default as StreamElement } from './cmp.stream-element.svelte';
|
|
2
|
+
export { default as ContainerStreamElement } from './cmp.container-stream-element.svelte';
|
|
3
|
+
export { default as ImageRefStreamElement } from './cmp.image-ref-stream-element.svelte';
|
|
4
|
+
export { default as ImagesStreamElement } from './cmp.images-stream-element.svelte';
|
|
5
|
+
export { default as PriceStreamElement } from './cmp.price-stream-element.svelte';
|
|
6
|
+
export { default as ShortVideoStreamElement } from './cmp.short-video-stream-element.svelte';
|
|
7
|
+
export { default as SpacerStreamElement } from './cmp.spacer-stream-element.svelte';
|
|
8
|
+
export { default as TextRefStreamElement } from './cmp.text-ref-stream-element.svelte';
|
|
9
|
+
export { default as TextStreamElement } from './cmp.text-stream-element.svelte';
|
|
10
|
+
export type { IStreamElementLocalization } from './stream-element-localization.svelte';
|
|
11
|
+
export type { IPriceStreamElementLocalization } from './price-stream-element-localization.svelte';
|
|
@@ -1,12 +1,9 @@
|
|
|
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 TextRefStreamElementView } from './cmp.text-ref-stream-element.svelte';
|
|
11
|
-
export { default as TextStreamElementView } from './cmp.text-stream-element.svelte';
|
|
12
|
-
export { default as WebViewStreamElementView } from './cmp.web-view-stream-element.svelte';
|
|
1
|
+
export { default as StreamElement } from './cmp.stream-element.svelte';
|
|
2
|
+
export { default as ContainerStreamElement } from './cmp.container-stream-element.svelte';
|
|
3
|
+
export { default as ImageRefStreamElement } from './cmp.image-ref-stream-element.svelte';
|
|
4
|
+
export { default as ImagesStreamElement } from './cmp.images-stream-element.svelte';
|
|
5
|
+
export { default as PriceStreamElement } from './cmp.price-stream-element.svelte';
|
|
6
|
+
export { default as ShortVideoStreamElement } from './cmp.short-video-stream-element.svelte';
|
|
7
|
+
export { default as SpacerStreamElement } from './cmp.spacer-stream-element.svelte';
|
|
8
|
+
export { default as TextRefStreamElement } from './cmp.text-ref-stream-element.svelte';
|
|
9
|
+
export { default as TextStreamElement } from './cmp.text-stream-element.svelte';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface IPriceStreamElementLocalization {
|
|
2
|
+
saveValue?: (value: string | number) => string;
|
|
3
|
+
beforeValue?: (value: string) => string;
|
|
4
|
+
}
|
|
5
|
+
export declare class PriceStreamElementLocalization {
|
|
6
|
+
saveValue: (value: string | number) => string;
|
|
7
|
+
beforeValue: (value: string) => string;
|
|
8
|
+
constructor(init?: IPriceStreamElementLocalization);
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export class PriceStreamElementLocalization {
|
|
2
|
+
saveValue = $state((value) => `Save ${value}`);
|
|
3
|
+
beforeValue = $state((value) => `Before ${value}`);
|
|
4
|
+
constructor(init) {
|
|
5
|
+
this.saveValue = init?.saveValue ?? this.saveValue;
|
|
6
|
+
this.beforeValue = init?.beforeValue ?? this.beforeValue;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IPriceStreamElementLocalization } from './price-stream-element-localization.svelte';
|
|
2
|
+
export interface IStreamElementLocalization {
|
|
3
|
+
priceElementLocalization?: IPriceStreamElementLocalization;
|
|
4
|
+
}
|
|
5
|
+
export declare class StreamElementLocalization {
|
|
6
|
+
priceElementLocalization: IPriceStreamElementLocalization | undefined;
|
|
7
|
+
constructor(init?: IStreamElementLocalization);
|
|
8
|
+
}
|
|
@@ -1,86 +1,51 @@
|
|
|
1
|
-
import { StreamElementType,
|
|
2
|
-
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles
|
|
3
|
-
export type StreamElementModel =
|
|
4
|
-
export type AnnotationStreamElementModel = {
|
|
5
|
-
type: StreamElementType.Annotation;
|
|
6
|
-
$id: string;
|
|
7
|
-
name?: string | null;
|
|
8
|
-
svg: string;
|
|
9
|
-
inactive: boolean;
|
|
10
|
-
placement: AnnotationStreamElementPlacement;
|
|
11
|
-
styles: AnnotationStreamElementStyles;
|
|
12
|
-
};
|
|
1
|
+
import { StreamElementType, ImagesImagesElementMode } from './enums';
|
|
2
|
+
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles } from './styles';
|
|
3
|
+
export type StreamElementModel = ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | SpacerStreamElementModel | ShortVideoStreamElementModel | TextStreamElementModel | TextRefStreamElementModel;
|
|
13
4
|
export type ContainerStreamElementModel = {
|
|
14
5
|
type: StreamElementType.Container;
|
|
15
|
-
|
|
16
|
-
name?: string | null;
|
|
6
|
+
id?: string;
|
|
17
7
|
elements: StreamElementModel[];
|
|
18
8
|
customizable: boolean | null;
|
|
19
9
|
styles: ContainerStreamElementStyles | null;
|
|
20
10
|
};
|
|
21
11
|
export type ImagesStreamElementModel = {
|
|
22
12
|
type: StreamElementType.Images;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
mode: ImagesStreamElementMode;
|
|
13
|
+
id?: string;
|
|
14
|
+
mode: ImagesImagesElementMode;
|
|
26
15
|
};
|
|
27
16
|
export type ImageRefStreamElementModel = {
|
|
28
17
|
type: StreamElementType.ImageRef;
|
|
29
|
-
|
|
30
|
-
name?: string | null;
|
|
18
|
+
id?: string;
|
|
31
19
|
key: string;
|
|
32
|
-
annotations?: AnnotationStreamElementModel[] | null;
|
|
33
20
|
styles: ImageStreamElementStyles | null;
|
|
34
21
|
};
|
|
35
22
|
export type PriceStreamElementModel = {
|
|
36
23
|
type: StreamElementType.Price;
|
|
37
|
-
|
|
38
|
-
name?: string | null;
|
|
24
|
+
id?: string;
|
|
39
25
|
excludeBeforePrice: boolean | null;
|
|
40
26
|
includeCurrency: boolean | null;
|
|
41
|
-
textAfter: string | null;
|
|
42
|
-
stock?: StockStreamElementModel | null;
|
|
43
27
|
styles: PriceStreamElementStyles | null;
|
|
44
28
|
};
|
|
45
29
|
export type ShortVideoStreamElementModel = {
|
|
46
30
|
type: StreamElementType.ShortVideo;
|
|
47
|
-
|
|
48
|
-
name?: string | null;
|
|
31
|
+
id?: string;
|
|
49
32
|
};
|
|
50
33
|
export type SpacerStreamElementModel = {
|
|
51
34
|
type: StreamElementType.Spacer;
|
|
52
|
-
|
|
53
|
-
name?: string | null;
|
|
35
|
+
id?: string;
|
|
54
36
|
value: number | null;
|
|
55
37
|
};
|
|
56
|
-
export type StockStreamElementModel = {
|
|
57
|
-
type: StreamElementType.Stock;
|
|
58
|
-
$id: string;
|
|
59
|
-
name?: string | null;
|
|
60
|
-
level: StockStreamElementLevel;
|
|
61
|
-
quantity: number;
|
|
62
|
-
textAfter: string | null;
|
|
63
|
-
styles: StockStreamElementStyles | null;
|
|
64
|
-
};
|
|
65
38
|
export type TextStreamElementModel = {
|
|
66
39
|
type: StreamElementType.Text;
|
|
67
|
-
|
|
68
|
-
name?: string | null;
|
|
40
|
+
id?: string;
|
|
69
41
|
value: string | null;
|
|
70
42
|
styles: TextStreamElementStyles | null;
|
|
71
43
|
};
|
|
72
44
|
export type TextRefStreamElementModel = {
|
|
73
45
|
type: StreamElementType.TextRef;
|
|
74
|
-
|
|
75
|
-
name?: string | null;
|
|
46
|
+
id?: string;
|
|
76
47
|
key: string;
|
|
77
48
|
valueBefore: string | null;
|
|
78
49
|
valueAfter: string | null;
|
|
79
50
|
styles: TextStreamElementStyles | null;
|
|
80
51
|
};
|
|
81
|
-
export type WebViewStreamElementModel = {
|
|
82
|
-
type: StreamElementType.WebView;
|
|
83
|
-
$id: string;
|
|
84
|
-
name?: string | null;
|
|
85
|
-
url: string | null;
|
|
86
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { StreamElementType,
|
|
1
|
+
import { StreamElementType, ImagesImagesElementMode } from './enums';
|
|
@@ -1,39 +1,23 @@
|
|
|
1
1
|
export declare enum StreamComponentDataType {
|
|
2
2
|
Images = "IMAGES",
|
|
3
|
-
NoData = "NO_DATA",
|
|
4
3
|
ShortVideo = "SHORT_VIDEO",
|
|
5
4
|
Product = "PRODUCT"
|
|
6
5
|
}
|
|
7
6
|
export declare enum StreamElementType {
|
|
8
|
-
Annotation = "ANNOTATION",
|
|
9
7
|
Container = "CONTAINER",
|
|
10
8
|
ImageRef = "IMAGE_REF",
|
|
11
9
|
Images = "IMAGES",
|
|
12
10
|
Price = "PRICE",
|
|
13
|
-
ShortVideo = "SHORT_VIDEO",
|
|
14
11
|
Spacer = "SPACER",
|
|
15
|
-
|
|
12
|
+
ShortVideo = "SHORT_VIDEO",
|
|
16
13
|
Text = "TEXT",
|
|
17
|
-
TextRef = "TEXT_REF"
|
|
18
|
-
WebView = "WEB_VIEW"
|
|
19
|
-
}
|
|
20
|
-
export declare enum AnnotationStreamElementPlacement {
|
|
21
|
-
TopLeft = "TOP_LEFT",
|
|
22
|
-
TopRight = "TOP_RIGHT",
|
|
23
|
-
BottomLeft = "BOTTOM_LEFT",
|
|
24
|
-
BottomRight = "BOTTOM_RIGHT"
|
|
14
|
+
TextRef = "TEXT_REF"
|
|
25
15
|
}
|
|
26
|
-
export declare enum
|
|
16
|
+
export declare enum ImagesImagesElementMode {
|
|
27
17
|
Single = "SINGLE",
|
|
28
18
|
Gallery = "GALLERY",
|
|
29
19
|
Slider = "SLIDER"
|
|
30
20
|
}
|
|
31
|
-
export declare enum StockStreamElementLevel {
|
|
32
|
-
High = "HIGH",
|
|
33
|
-
Medium = "MEDIUM",
|
|
34
|
-
Low = "LOW",
|
|
35
|
-
OutOfStock = "OUT_OF_STOCK"
|
|
36
|
-
}
|
|
37
21
|
export declare enum StreamElementStyleMediaFit {
|
|
38
22
|
Cover = "COVER",
|
|
39
23
|
Contain = "CONTAIN"
|
|
@@ -59,18 +43,3 @@ export declare enum StreamCssValueType {
|
|
|
59
43
|
DDU = "DDU",
|
|
60
44
|
Pct = "PCT"
|
|
61
45
|
}
|
|
62
|
-
export declare enum StreamSvgTextValueType {
|
|
63
|
-
customText = "STREAM_SVG_CUSTOM_TEXT",
|
|
64
|
-
currency = "STREAM_SVG_CURRENCY",
|
|
65
|
-
currencySymbol = "STREAM_SVG_CURRENCY_SYMBOL",
|
|
66
|
-
price = "STREAM_SVG_PRODUCT_PRICE",
|
|
67
|
-
priceWhole = "STREAM_SVG_PRODUCT_PRICE_WHOLE",
|
|
68
|
-
priceDecimal = "STREAM_SVG_PRODUCT_PRICE_DECIMAL",
|
|
69
|
-
beforePrice = "STREAM_SVG_PRODUCT_BEFORE_PRICE",
|
|
70
|
-
beforePriceWhole = "STREAM_SVG_PRODUCT_BEFORE_PRICE_WHOLE",
|
|
71
|
-
beforePriceDecimal = "STREAM_SVG_PRODUCT_BEFORE_PRICE_DECIMAL",
|
|
72
|
-
saveValue = "STREAM_SVG_PRODUCT_SAVE_VALUE",
|
|
73
|
-
saveValueWhole = "STREAM_SVG_PRODUCT_SAVE_VALUE_WHOLE",
|
|
74
|
-
saveValueDecimal = "STREAM_SVG_PRODUCT_SAVE_VALUE_DECIMAL",
|
|
75
|
-
savePercentValue = "STREAM_SVG_PRODUCT_SAVE_PERCENT_VALUE"
|
|
76
|
-
}
|
|
@@ -1,44 +1,26 @@
|
|
|
1
1
|
export var StreamComponentDataType;
|
|
2
2
|
(function (StreamComponentDataType) {
|
|
3
3
|
StreamComponentDataType["Images"] = "IMAGES";
|
|
4
|
-
StreamComponentDataType["NoData"] = "NO_DATA";
|
|
5
4
|
StreamComponentDataType["ShortVideo"] = "SHORT_VIDEO";
|
|
6
5
|
StreamComponentDataType["Product"] = "PRODUCT";
|
|
7
6
|
})(StreamComponentDataType || (StreamComponentDataType = {}));
|
|
8
7
|
export var StreamElementType;
|
|
9
8
|
(function (StreamElementType) {
|
|
10
|
-
StreamElementType["Annotation"] = "ANNOTATION";
|
|
11
9
|
StreamElementType["Container"] = "CONTAINER";
|
|
12
10
|
StreamElementType["ImageRef"] = "IMAGE_REF";
|
|
13
11
|
StreamElementType["Images"] = "IMAGES";
|
|
14
12
|
StreamElementType["Price"] = "PRICE";
|
|
15
|
-
StreamElementType["ShortVideo"] = "SHORT_VIDEO";
|
|
16
13
|
StreamElementType["Spacer"] = "SPACER";
|
|
17
|
-
StreamElementType["
|
|
14
|
+
StreamElementType["ShortVideo"] = "SHORT_VIDEO";
|
|
18
15
|
StreamElementType["Text"] = "TEXT";
|
|
19
16
|
StreamElementType["TextRef"] = "TEXT_REF";
|
|
20
|
-
StreamElementType["WebView"] = "WEB_VIEW";
|
|
21
17
|
})(StreamElementType || (StreamElementType = {}));
|
|
22
|
-
export var
|
|
23
|
-
(function (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})(AnnotationStreamElementPlacement || (AnnotationStreamElementPlacement = {}));
|
|
29
|
-
export var ImagesStreamElementMode;
|
|
30
|
-
(function (ImagesStreamElementMode) {
|
|
31
|
-
ImagesStreamElementMode["Single"] = "SINGLE";
|
|
32
|
-
ImagesStreamElementMode["Gallery"] = "GALLERY";
|
|
33
|
-
ImagesStreamElementMode["Slider"] = "SLIDER";
|
|
34
|
-
})(ImagesStreamElementMode || (ImagesStreamElementMode = {}));
|
|
35
|
-
export var StockStreamElementLevel;
|
|
36
|
-
(function (StockStreamElementLevel) {
|
|
37
|
-
StockStreamElementLevel["High"] = "HIGH";
|
|
38
|
-
StockStreamElementLevel["Medium"] = "MEDIUM";
|
|
39
|
-
StockStreamElementLevel["Low"] = "LOW";
|
|
40
|
-
StockStreamElementLevel["OutOfStock"] = "OUT_OF_STOCK";
|
|
41
|
-
})(StockStreamElementLevel || (StockStreamElementLevel = {}));
|
|
18
|
+
export var ImagesImagesElementMode;
|
|
19
|
+
(function (ImagesImagesElementMode) {
|
|
20
|
+
ImagesImagesElementMode["Single"] = "SINGLE";
|
|
21
|
+
ImagesImagesElementMode["Gallery"] = "GALLERY";
|
|
22
|
+
ImagesImagesElementMode["Slider"] = "SLIDER";
|
|
23
|
+
})(ImagesImagesElementMode || (ImagesImagesElementMode = {}));
|
|
42
24
|
export var StreamElementStyleMediaFit;
|
|
43
25
|
(function (StreamElementStyleMediaFit) {
|
|
44
26
|
StreamElementStyleMediaFit["Cover"] = "COVER";
|
|
@@ -70,24 +52,3 @@ export var StreamCssValueType;
|
|
|
70
52
|
StreamCssValueType["DDU"] = "DDU";
|
|
71
53
|
StreamCssValueType["Pct"] = "PCT";
|
|
72
54
|
})(StreamCssValueType || (StreamCssValueType = {}));
|
|
73
|
-
export var StreamSvgTextValueType;
|
|
74
|
-
(function (StreamSvgTextValueType) {
|
|
75
|
-
/* Generic text */
|
|
76
|
-
StreamSvgTextValueType["customText"] = "STREAM_SVG_CUSTOM_TEXT";
|
|
77
|
-
/* Currency info */
|
|
78
|
-
StreamSvgTextValueType["currency"] = "STREAM_SVG_CURRENCY";
|
|
79
|
-
StreamSvgTextValueType["currencySymbol"] = "STREAM_SVG_CURRENCY_SYMBOL";
|
|
80
|
-
/* Product actual price */
|
|
81
|
-
StreamSvgTextValueType["price"] = "STREAM_SVG_PRODUCT_PRICE";
|
|
82
|
-
StreamSvgTextValueType["priceWhole"] = "STREAM_SVG_PRODUCT_PRICE_WHOLE";
|
|
83
|
-
StreamSvgTextValueType["priceDecimal"] = "STREAM_SVG_PRODUCT_PRICE_DECIMAL";
|
|
84
|
-
/* Product price before sales (if applicable) */
|
|
85
|
-
StreamSvgTextValueType["beforePrice"] = "STREAM_SVG_PRODUCT_BEFORE_PRICE";
|
|
86
|
-
StreamSvgTextValueType["beforePriceWhole"] = "STREAM_SVG_PRODUCT_BEFORE_PRICE_WHOLE";
|
|
87
|
-
StreamSvgTextValueType["beforePriceDecimal"] = "STREAM_SVG_PRODUCT_BEFORE_PRICE_DECIMAL";
|
|
88
|
-
/* “Save” / discount values */
|
|
89
|
-
StreamSvgTextValueType["saveValue"] = "STREAM_SVG_PRODUCT_SAVE_VALUE";
|
|
90
|
-
StreamSvgTextValueType["saveValueWhole"] = "STREAM_SVG_PRODUCT_SAVE_VALUE_WHOLE";
|
|
91
|
-
StreamSvgTextValueType["saveValueDecimal"] = "STREAM_SVG_PRODUCT_SAVE_VALUE_DECIMAL";
|
|
92
|
-
StreamSvgTextValueType["savePercentValue"] = "STREAM_SVG_PRODUCT_SAVE_PERCENT_VALUE";
|
|
93
|
-
})(StreamSvgTextValueType || (StreamSvgTextValueType = {}));
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
1
|
+
import { StreamComponentDataType, StreamElementType } 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 { ContainerStreamElementStyles, ImageStreamElementStyles, PriceStreamElementStyles, TextStreamElementStyles } from './styles';
|
|
5
6
|
export { default as StreamPageLayout } from './cmp.layout.svelte';
|
|
6
7
|
export { default as StreamLayoutSlot } from './cmp.slot.svelte';
|
|
7
8
|
export { default as StreamLayoutSlotContent } from './cmp.slot-content.svelte';
|
|
8
9
|
export * from './layout';
|
|
9
|
-
export
|
|
10
|
-
export { parseToStreamLayout, parseToStreamLayoutTemplate, stringifyToStreamLayoutInput, IdPopulator } from './serializer.svelte';
|
|
10
|
+
export { parseToStreamLayout, stringifyToStreamLayoutInput } from './serializer';
|
|
11
11
|
export declare const getAllowedDataTypesForSlot: (slot: StreamSlot) => StreamComponentDataType[];
|
|
12
12
|
export declare const getSingleShortVideoFromLayout: (layout: StreamLayout) => StreamLayoutShortVideoModel | null;
|
|
13
|
+
export type ElementTypeToStyles = {
|
|
14
|
+
[StreamElementType.Container]: ContainerStreamElementStyles;
|
|
15
|
+
[StreamElementType.Price]: PriceStreamElementStyles;
|
|
16
|
+
[StreamElementType.ImageRef]: ImageStreamElementStyles;
|
|
17
|
+
[StreamElementType.Text]: TextStreamElementStyles;
|
|
18
|
+
[StreamElementType.TextRef]: TextStreamElementStyles;
|
|
19
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
1
|
+
import { StreamComponentDataType, StreamElementType } 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
|
-
export
|
|
7
|
-
export { parseToStreamLayout, parseToStreamLayoutTemplate, stringifyToStreamLayoutInput, IdPopulator } from './serializer.svelte';
|
|
6
|
+
export { parseToStreamLayout, stringifyToStreamLayoutInput } from './serializer';
|
|
8
7
|
export const getAllowedDataTypesForSlot = (slot) => {
|
|
9
8
|
return slot.components.flatMap((c) => c.dataType);
|
|
10
9
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
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;
|
|
6
4
|
styles: StreamLayoutStyles | null;
|
|
7
5
|
slots: StreamSlotTemplate[];
|
|
8
6
|
};
|
|
@@ -10,5 +8,6 @@ export type StreamLayoutInput = Omit<StreamLayoutTemplate, 'slots'> & {
|
|
|
10
8
|
slots: StreamSlotInput[];
|
|
11
9
|
};
|
|
12
10
|
export type StreamLayout = Omit<StreamLayoutTemplate, 'slots'> & {
|
|
11
|
+
id?: string;
|
|
13
12
|
slots: StreamSlot[];
|
|
14
13
|
};
|
|
@@ -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
|
|
5
|
+
export type { StreamLayoutProductModel } from './stream-layout-product-model';
|
|
6
6
|
export type { StreamLayoutShortVideoModel, StreamLayoutShortVideoProductModel, StreamLayoutShortVideoAdModel } from './stream-layout-short-video-model';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { MediaType } from '
|
|
1
|
+
import { MediaType } from '../../..';
|
|
@@ -7,7 +7,7 @@ export type StreamLayoutProductModel = {
|
|
|
7
7
|
link: string | null;
|
|
8
8
|
price: StreamLayoutProductPriceModel;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type StreamLayoutProductPriceModel = {
|
|
11
11
|
price: number;
|
|
12
12
|
currency: Currency;
|
|
13
13
|
salePrice: number | null;
|
|
@@ -16,3 +16,4 @@ export type StreamLayoutProductPriceModel = {
|
|
|
16
16
|
saveValue: string | null;
|
|
17
17
|
savePercentValue: string | null;
|
|
18
18
|
};
|
|
19
|
+
export {};
|
|
@@ -2,8 +2,6 @@ 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;
|
|
7
5
|
top: number;
|
|
8
6
|
left: number;
|
|
9
7
|
width: number;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleHorizontalAlign
|
|
2
|
-
import type {
|
|
1
|
+
import { StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleHorizontalAlign } from './enums';
|
|
2
|
+
import type { ContainerStreamElementStyles, ImageStreamElementStyles, StreamLayoutStyles, TextStreamElementStyles } from './styles';
|
|
3
3
|
export declare const generateStreamLayoutStyles: (styles: StreamLayoutStyles | null) => string;
|
|
4
4
|
export declare const generateContainerStyles: (styles: Partial<ContainerStreamElementStyles> | null) => string;
|
|
5
|
-
export declare const generateAnnotationStyles: (styles: AnnotationStreamElementStyles, placement: AnnotationStreamElementPlacement) => string;
|
|
6
5
|
export declare const generateTextStyles: (styles: Partial<TextStreamElementStyles> | null) => string;
|
|
7
6
|
export declare const generateImageStyles: (styles: Partial<ImageStreamElementStyles> | null) => string;
|
|
8
7
|
export declare const mapFontFamily: (value: StreamElementStyleFontFamily | null | undefined) => string;
|
|
@@ -1,77 +1,53 @@
|
|
|
1
1
|
import { Utils } from '../../core/utils';
|
|
2
|
-
import { StreamCssValueType, StreamElementStyleDirection, StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleMediaFit, StreamElementStyleHorizontalAlign
|
|
2
|
+
import { StreamCssValueType, StreamElementStyleDirection, StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleMediaFit, StreamElementStyleHorizontalAlign } from './enums';
|
|
3
3
|
export const generateStreamLayoutStyles = (styles) => {
|
|
4
4
|
if (!styles) {
|
|
5
5
|
return '';
|
|
6
6
|
}
|
|
7
|
-
const values = [`background-color: ${transformColorValue(styles.backgroundColor)}
|
|
8
|
-
return values.join('
|
|
7
|
+
const values = [`background-color: ${transformColorValue(styles.backgroundColor)};`, `font-family: ${mapFontFamily(styles.fontFamily)};`];
|
|
8
|
+
return values.join('');
|
|
9
9
|
};
|
|
10
10
|
export const generateContainerStyles = (styles) => {
|
|
11
11
|
styles = styles || {};
|
|
12
12
|
const values = [
|
|
13
|
-
'display: flex',
|
|
14
|
-
'flex-direction: column',
|
|
15
|
-
`width: ${transformCssValue(styles.width, 'auto')}
|
|
16
|
-
`height: ${transformCssValue(styles.height, 'fit-content')}
|
|
17
|
-
`aspect-ratio: ${styles.aspectRatio || 'auto'}
|
|
18
|
-
`gap: ${transformNumericValue(styles.gap)}
|
|
19
|
-
`padding-top: ${transformNumericValue(styles.paddingTop)}
|
|
20
|
-
`padding-right: ${transformNumericValue(styles.paddingRight)}
|
|
21
|
-
`padding-bottom: ${transformNumericValue(styles.paddingBottom)}
|
|
22
|
-
`padding-left: ${transformNumericValue(styles.paddingLeft)}
|
|
23
|
-
`background-color: ${transformColorValue(styles.backgroundColor)}
|
|
24
|
-
`border-width: ${styles.borderColor ? '1px' : '0'}
|
|
25
|
-
`border-radius: ${transformNumericValue(styles.borderRadius)}
|
|
26
|
-
`border-color: ${transformColorValue(styles.borderColor)}
|
|
27
|
-
`overflow: ${styles.borderRadius ? 'hidden' : 'visible'}
|
|
13
|
+
'display: flex;',
|
|
14
|
+
'flex-direction: column;',
|
|
15
|
+
`width: ${transformCssValue(styles.width, 'auto')};`,
|
|
16
|
+
`height: ${transformCssValue(styles.height, 'fit-content')};`,
|
|
17
|
+
`aspect-ratio: ${styles.aspectRatio || 'auto'};`,
|
|
18
|
+
`gap: ${transformNumericValue(styles.gap)};`,
|
|
19
|
+
`padding-top: ${transformNumericValue(styles.paddingTop)};`,
|
|
20
|
+
`padding-right: ${transformNumericValue(styles.paddingRight)};`,
|
|
21
|
+
`padding-bottom: ${transformNumericValue(styles.paddingBottom)};`,
|
|
22
|
+
`padding-left: ${transformNumericValue(styles.paddingLeft)};`,
|
|
23
|
+
`background-color: ${transformColorValue(styles.backgroundColor)};`,
|
|
24
|
+
`border-width: ${styles.borderColor ? '1px' : '0'};`,
|
|
25
|
+
`border-radius: ${transformNumericValue(styles.borderRadius)};`,
|
|
26
|
+
`border-color: ${transformColorValue(styles.borderColor)};`,
|
|
27
|
+
`overflow: ${styles.borderRadius ? 'hidden' : 'visible'};`
|
|
28
28
|
];
|
|
29
29
|
if (styles.direction) {
|
|
30
|
-
values.push(`display: flex
|
|
31
|
-
values.push(`flex-direction: ${styles.direction === StreamElementStyleDirection.Horizontal ? 'row' : 'column'}
|
|
30
|
+
values.push(`display: flex;`);
|
|
31
|
+
values.push(`flex-direction: ${styles.direction === StreamElementStyleDirection.Horizontal ? 'row' : 'column'};`);
|
|
32
32
|
}
|
|
33
|
-
return values.join('
|
|
34
|
-
};
|
|
35
|
-
export const generateAnnotationStyles = (styles, placement) => {
|
|
36
|
-
const values = [`height: ${transformNumericValue(styles.height)}`, `aspect-ratio: ${styles.aspectRatio}`, 'position: absolute'];
|
|
37
|
-
switch (placement) {
|
|
38
|
-
case AnnotationStreamElementPlacement.TopLeft:
|
|
39
|
-
values.push(`top: ${transformNumericValue(styles.offsetY)}`);
|
|
40
|
-
values.push(`left: ${transformNumericValue(styles.offsetX)}`);
|
|
41
|
-
break;
|
|
42
|
-
case AnnotationStreamElementPlacement.TopRight:
|
|
43
|
-
values.push(`top: ${transformNumericValue(styles.offsetY)}`);
|
|
44
|
-
values.push(`right: ${transformNumericValue(styles.offsetX)}`);
|
|
45
|
-
break;
|
|
46
|
-
case AnnotationStreamElementPlacement.BottomLeft:
|
|
47
|
-
values.push(`bottom: ${transformNumericValue(styles.offsetY)}`);
|
|
48
|
-
values.push(`left: ${transformNumericValue(styles.offsetX)}`);
|
|
49
|
-
break;
|
|
50
|
-
case AnnotationStreamElementPlacement.BottomRight:
|
|
51
|
-
values.push(`bottom: ${transformNumericValue(styles.offsetY)}`);
|
|
52
|
-
values.push(`right: ${transformNumericValue(styles.offsetX)}`);
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
Utils.assertUnreachable(placement);
|
|
56
|
-
}
|
|
57
|
-
return values.join(';');
|
|
33
|
+
return values.join('');
|
|
58
34
|
};
|
|
59
35
|
export const generateTextStyles = (styles) => {
|
|
60
36
|
styles = styles || {};
|
|
61
37
|
const values = [
|
|
62
|
-
`font-family: ${mapFontFamily(styles.fontFamily)}
|
|
63
|
-
`font-size: ${transformFontSizeValue(styles.fontSize)}
|
|
64
|
-
`font-weight: ${mapFontWeight(styles.fontWeight)}
|
|
65
|
-
`line-height: ${transformNumericValue(styles.lineHeight, '1.2')}
|
|
66
|
-
`text-align: ${mapTextAlign(styles.textAlign)}
|
|
67
|
-
`color: ${transformColorValue(styles.color)}
|
|
38
|
+
`font-family: ${mapFontFamily(styles.fontFamily)};`,
|
|
39
|
+
`font-size: ${transformFontSizeValue(styles.fontSize)};`,
|
|
40
|
+
`font-weight: ${mapFontWeight(styles.fontWeight)};`,
|
|
41
|
+
`line-height: ${transformNumericValue(styles.lineHeight, '1.2')};`,
|
|
42
|
+
`text-align: ${mapTextAlign(styles.textAlign)};`,
|
|
43
|
+
`color: ${transformColorValue(styles.color)};`
|
|
68
44
|
];
|
|
69
|
-
return values.join('
|
|
45
|
+
return values.join('');
|
|
70
46
|
};
|
|
71
47
|
export const generateImageStyles = (styles) => {
|
|
72
48
|
styles = styles || {};
|
|
73
|
-
const imageStyles = [`object-fit: ${mapMediaFit(styles.mediaFit)}
|
|
74
|
-
return imageStyles.join('
|
|
49
|
+
const imageStyles = [`object-fit: ${mapMediaFit(styles.mediaFit)};`];
|
|
50
|
+
return imageStyles.join('');
|
|
75
51
|
};
|
|
76
52
|
export const mapFontFamily = (value) => {
|
|
77
53
|
switch (value) {
|