@streamscloud/embeddable 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/core/enums.d.ts +2 -0
  2. package/dist/core/enums.js +2 -0
  3. package/dist/core/graphql.d.ts +1 -3
  4. package/dist/core/graphql.js +3 -12
  5. package/dist/core/utils/html-helper.d.ts +0 -1
  6. package/dist/core/utils/html-helper.js +0 -4
  7. package/dist/products/price-helper.js +1 -1
  8. package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +1 -1
  9. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +2 -2
  10. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +2 -3
  11. package/dist/short-videos/short-video-viewer/cmp.product.svelte +1 -1
  12. package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +2 -3
  13. package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +1 -1
  14. package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +2 -3
  15. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +2 -6
  16. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +1 -1
  17. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +1 -1
  18. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +2 -3
  19. package/dist/short-videos/short-video-viewer/description.svelte +0 -5
  20. package/dist/short-videos/short-video-viewer/description.svelte.d.ts +1 -1
  21. package/dist/short-videos/short-video-viewer/index.d.ts +2 -4
  22. package/dist/short-videos/short-video-viewer/index.js +0 -1
  23. package/dist/short-videos/short-video-viewer/mapper.js +1 -5
  24. package/dist/short-videos/short-video-viewer/operations.generated.d.ts +0 -4
  25. package/dist/short-videos/short-video-viewer/operations.generated.js +0 -6
  26. package/dist/short-videos/short-video-viewer/operations.graphql +0 -4
  27. package/dist/short-videos/short-video-viewer/{short-video-attachments-localization.d.ts → short-video-attachments-localization.svelte.d.ts} +4 -5
  28. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +10 -0
  29. package/dist/short-videos/short-video-viewer/{short-video-details-localization.d.ts → short-video-details-localization.svelte.d.ts} +6 -7
  30. package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +10 -0
  31. package/dist/short-videos/short-video-viewer/{short-video-product-localization.d.ts → short-video-product-localization.svelte.d.ts} +1 -2
  32. package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +11 -0
  33. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +13 -0
  34. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +10 -0
  35. package/dist/short-videos/short-video-viewer/types.d.ts +0 -4
  36. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +11 -88
  37. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +5 -5
  38. package/dist/short-videos/short-videos-player/controls.svelte +2 -2
  39. package/dist/short-videos/short-videos-player/controls.svelte.d.ts +1 -1
  40. package/dist/short-videos/short-videos-player/index.d.ts +14 -51
  41. package/dist/short-videos/short-videos-player/index.js +12 -83
  42. package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +8 -0
  43. package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +6 -0
  44. package/dist/streams/layout/cmp.layout.svelte.d.ts +2 -4
  45. package/dist/streams/layout/cmp.slot-content.svelte +4 -4
  46. package/dist/streams/layout/cmp.slot-content.svelte.d.ts +1 -2
  47. package/dist/streams/layout/cmp.slot.svelte.d.ts +2 -7
  48. package/dist/streams/layout/component.d.ts +0 -2
  49. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +1 -1
  50. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +3 -4
  51. package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +2 -15
  52. package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +3 -7
  53. package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
  54. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +89 -15
  55. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +4 -5
  56. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +2 -4
  57. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +0 -3
  58. package/dist/streams/layout/element-views/cmp.stream-element.svelte +17 -24
  59. package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +3 -4
  60. package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +2 -2
  61. package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +2 -6
  62. package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +0 -2
  63. package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -3
  64. package/dist/streams/layout/element-views/index.d.ts +11 -16
  65. package/dist/streams/layout/element-views/index.js +9 -12
  66. package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +9 -0
  67. package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +8 -0
  68. package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +8 -0
  69. package/dist/streams/layout/element-views/stream-element-localization.svelte.js +6 -0
  70. package/dist/streams/layout/elements.d.ts +12 -47
  71. package/dist/streams/layout/elements.js +1 -1
  72. package/dist/streams/layout/enums.d.ts +3 -34
  73. package/dist/streams/layout/enums.js +7 -46
  74. package/dist/streams/layout/index.d.ts +10 -3
  75. package/dist/streams/layout/index.js +2 -3
  76. package/dist/streams/layout/layout.d.ts +1 -2
  77. package/dist/streams/layout/models/index.d.ts +1 -1
  78. package/dist/streams/layout/models/mapper.js +1 -5
  79. package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +1 -1
  80. package/dist/streams/layout/models/stream-layout-media-item-model.js +1 -1
  81. package/dist/streams/layout/models/stream-layout-post-header-model.d.ts +1 -1
  82. package/dist/streams/layout/models/stream-layout-product-model.d.ts +2 -1
  83. package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +0 -4
  84. package/dist/streams/layout/serializer.d.ts +3 -0
  85. package/dist/streams/layout/serializer.js +6 -0
  86. package/dist/streams/layout/slot.d.ts +0 -2
  87. package/dist/streams/layout/styles-transformer.d.ts +2 -3
  88. package/dist/streams/layout/styles-transformer.js +30 -54
  89. package/dist/streams/layout/styles.d.ts +14 -24
  90. package/dist/streams/layout/type-guards.d.ts +0 -31
  91. package/dist/streams/layout/type-guards.js +1 -13
  92. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +2 -4
  93. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -3
  94. package/dist/streams/stream-page-viewer/index.d.ts +0 -1
  95. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +13 -0
  96. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +10 -0
  97. package/dist/streams/stream-player/cmp.stream-player.svelte +7 -47
  98. package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +4 -6
  99. package/dist/streams/stream-player/controls.svelte +3 -46
  100. package/dist/streams/stream-player/controls.svelte.d.ts +1 -1
  101. package/dist/streams/stream-player/index.d.ts +4 -6
  102. package/dist/streams/stream-player/index.js +28 -15
  103. package/dist/streams/stream-player/operations.generated.d.ts +1 -1
  104. package/dist/streams/stream-player/operations.generated.js +3 -5
  105. package/dist/streams/stream-player/operations.graphql +3 -3
  106. package/dist/streams/stream-player/stream-overview.svelte +2 -2
  107. package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -1
  108. package/dist/streams/stream-player/stream-player-buffer.svelte.js +2 -2
  109. package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +12 -0
  110. package/dist/streams/stream-player/stream-player-localization.svelte.js +10 -0
  111. package/dist/ui/icon/cmp.icon.svelte +26 -13
  112. package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
  113. package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +2 -3
  114. package/dist/ui/line-clamp/index.d.ts +1 -1
  115. package/dist/ui/line-clamp/index.js +1 -1
  116. package/dist/ui/line-clamp/{line-clamp-localization.d.ts → line-clamp-localization.svelte.d.ts} +1 -2
  117. package/dist/ui/line-clamp/line-clamp-localization.svelte.js +15 -0
  118. package/dist/ui/shadow-dom/shadow-host.d.ts +5 -1
  119. package/dist/ui/shadow-dom/shadow-host.js +14 -1
  120. package/dist/ui/time-ago/cmp.time-ago.svelte +1 -1
  121. package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +2 -3
  122. package/dist/ui/time-ago/index.d.ts +1 -1
  123. package/dist/ui/time-ago/{time-ago-localization.d.ts → time-ago-localization.svelte.d.ts} +1 -2
  124. package/dist/ui/time-ago/time-ago-localization.svelte.js +39 -0
  125. package/dist/ui/video/cmp.video.svelte +18 -42
  126. package/package.json +1 -1
  127. package/dist/core/analytics.profile-id.d.ts +0 -5
  128. package/dist/core/analytics.profile-id.js +0 -17
  129. package/dist/core/document.event-handlers.d.ts +0 -1
  130. package/dist/core/document.event-handlers.js +0 -5
  131. package/dist/core/locale.d.ts +0 -6
  132. package/dist/core/locale.js +0 -24
  133. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +0 -21
  134. package/dist/short-videos/short-video-viewer/short-video-details-localization.js +0 -17
  135. package/dist/short-videos/short-video-viewer/short-video-product-localization.js +0 -13
  136. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +0 -14
  137. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +0 -17
  138. package/dist/short-videos/short-videos-player/operations.generated.d.ts +0 -68
  139. package/dist/short-videos/short-videos-player/operations.generated.js +0 -199
  140. package/dist/short-videos/short-videos-player/operations.graphql +0 -8
  141. package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +0 -16
  142. package/dist/short-videos/short-videos-player/short-videos-player-localization.js +0 -13
  143. package/dist/short-videos/short-videos-player/types.d.ts +0 -36
  144. package/dist/short-videos/short-videos-player/types.js +0 -6
  145. package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +0 -16
  146. package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte.d.ts +0 -7
  147. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +0 -74
  148. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +0 -11
  149. package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +0 -37
  150. package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +0 -7
  151. package/dist/streams/layout/element-views/price-element-view.svelte +0 -168
  152. package/dist/streams/layout/element-views/price-element-view.svelte.d.ts +0 -15
  153. package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +0 -13
  154. package/dist/streams/layout/element-views/price-stream-element-localization.js +0 -21
  155. package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +0 -9
  156. package/dist/streams/layout/element-views/short-video-stream-element-localization.js +0 -7
  157. package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +0 -8
  158. package/dist/streams/layout/element-views/stock-stream-element-localization.js +0 -26
  159. package/dist/streams/layout/element-views/stream-element-localization.d.ts +0 -15
  160. package/dist/streams/layout/element-views/stream-element-localization.js +0 -11
  161. package/dist/streams/layout/serializer.svelte.d.ts +0 -29
  162. package/dist/streams/layout/serializer.svelte.js +0 -93
  163. package/dist/streams/layout/slot-data-ref.d.ts +0 -13
  164. package/dist/streams/layout/slot-data-ref.js +0 -1
  165. package/dist/streams/layout/svg-attributes.d.ts +0 -7
  166. package/dist/streams/layout/svg-attributes.js +0 -8
  167. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +0 -9
  168. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +0 -7
  169. package/dist/streams/stream-player/stream-player-localization.d.ts +0 -26
  170. package/dist/streams/stream-player/stream-player-localization.js +0 -31
  171. package/dist/ui/line-clamp/line-clamp-localization.js +0 -19
  172. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +0 -125
  173. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +0 -9
  174. package/dist/ui/swipe-indicator/index.d.ts +0 -2
  175. package/dist/ui/swipe-indicator/index.js +0 -1
  176. package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +0 -8
  177. package/dist/ui/swipe-indicator/swipe-indicator-localization.js +0 -13
  178. package/dist/ui/time-ago/time-ago-localization.js +0 -55
@@ -1,8 +1,8 @@
1
1
  import type { TextRefStreamElementModel } from '../elements';
2
- import type { StreamSlotDataRef } from '../slot-data-ref';
2
+ import type { StreamSlotData } from '../slot-data';
3
3
  type Props = {
4
4
  model: TextRefStreamElementModel;
5
- data: StreamSlotDataRef;
5
+ data: StreamSlotData;
6
6
  };
7
7
  declare const Cmp: import("svelte").Component<Props, {}, "">;
8
8
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,12 +1,8 @@
1
1
  <script lang="ts">import { LineClamp } from '../../../ui/line-clamp';
2
2
  import { generateTextStyles } from '../styles-transformer';
3
- let { model, placeholder } = $props();
3
+ let { model } = $props();
4
4
  </script>
5
5
 
6
6
  <div class="text-stream-element" style={generateTextStyles(model.styles)}>
7
- {#if model.value}
8
- <LineClamp value={model.value} maxLines={model.styles?.maxLines || 'auto'} />
9
- {:else if placeholder}
10
- {@render placeholder()}
11
- {/if}
7
+ <LineClamp value={model.value} maxLines={model.styles?.maxLines || 'auto'} />
12
8
  </div>
@@ -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 { 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
+ 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 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 StockStreamElementView } from './cmp.stock-stream-element.svelte';
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';
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 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 StockStreamElementView } from './cmp.stock-stream-element.svelte';
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
+ }
@@ -0,0 +1,6 @@
1
+ export class StreamElementLocalization {
2
+ priceElementLocalization = $state(undefined);
3
+ constructor(init) {
4
+ this.priceElementLocalization = init?.priceElementLocalization ?? this.priceElementLocalization;
5
+ }
6
+ }
@@ -1,86 +1,51 @@
1
- import { StreamElementType, ImagesStreamElementMode, AnnotationStreamElementPlacement, StockStreamElementLevel } from './enums';
2
- import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles, AnnotationStreamElementStyles, StockStreamElementStyles } from './styles';
3
- export type StreamElementModel = AnnotationStreamElementModel | ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | ShortVideoStreamElementModel | SpacerStreamElementModel | StockStreamElementModel | TextStreamElementModel | TextRefStreamElementModel | WebViewStreamElementModel;
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
- $id: string;
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
- $id: string;
24
- name?: string | null;
25
- mode: ImagesStreamElementMode;
13
+ id?: string;
14
+ mode: ImagesImagesElementMode;
26
15
  };
27
16
  export type ImageRefStreamElementModel = {
28
17
  type: StreamElementType.ImageRef;
29
- $id: string;
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
- $id: string;
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
- $id: string;
48
- name?: string | null;
31
+ id?: string;
49
32
  };
50
33
  export type SpacerStreamElementModel = {
51
34
  type: StreamElementType.Spacer;
52
- $id: string;
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
- $id: string;
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
- $id: string;
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, ImagesStreamElementMode, AnnotationStreamElementPlacement, StockStreamElementLevel } from './enums';
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
- Stock = "STOCK",
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 ImagesStreamElementMode {
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["Stock"] = "STOCK";
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 AnnotationStreamElementPlacement;
23
- (function (AnnotationStreamElementPlacement) {
24
- AnnotationStreamElementPlacement["TopLeft"] = "TOP_LEFT";
25
- AnnotationStreamElementPlacement["TopRight"] = "TOP_RIGHT";
26
- AnnotationStreamElementPlacement["BottomLeft"] = "BOTTOM_LEFT";
27
- AnnotationStreamElementPlacement["BottomRight"] = "BOTTOM_RIGHT";
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 * from './svg-attributes';
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 * from './svg-attributes';
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, StreamLayoutProductPriceModel } from './stream-layout-product-model';
5
+ export type { StreamLayoutProductModel } from './stream-layout-product-model';
6
6
  export type { StreamLayoutShortVideoModel, StreamLayoutShortVideoProductModel, StreamLayoutShortVideoAdModel } from './stream-layout-short-video-model';
@@ -57,10 +57,6 @@ const mapToProductCardModel = (model) => {
57
57
  link: model.link,
58
58
  currency: model.currency,
59
59
  price: model.price,
60
- salePrice: model.salePrice,
61
- brand: {
62
- name: model.brand?.name ?? null
63
- },
64
- shortDescription: model.shortDescription ?? null
60
+ salePrice: model.salePrice
65
61
  };
66
62
  };
@@ -1,4 +1,4 @@
1
- import { MediaType } from '../../../core/enums';
1
+ import { MediaType } from '../../..';
2
2
  export type StreamLayoutMediaItemModel = {
3
3
  url: string;
4
4
  thumbnailUrl: string | null;
@@ -1 +1 @@
1
- import { MediaType } from '../../../core/enums';
1
+ import { MediaType } from '../../..';
@@ -1,4 +1,4 @@
1
- import type { PostSourceType } from '../../../core/enums';
1
+ import type { PostSourceType } from '$gql/types';
2
2
  export type StreamLayoutPostHeaderModel = {
3
3
  sourceId: string;
4
4
  sourceName: string;
@@ -7,7 +7,7 @@ export type StreamLayoutProductModel = {
7
7
  link: string | null;
8
8
  price: StreamLayoutProductPriceModel;
9
9
  };
10
- export type StreamLayoutProductPriceModel = {
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 {};
@@ -28,8 +28,4 @@ export type StreamLayoutShortVideoProductModel = {
28
28
  price: number;
29
29
  currency: Currency;
30
30
  salePrice: number | null;
31
- brand?: {
32
- name?: string | null;
33
- };
34
- shortDescription?: string | null;
35
31
  };
@@ -0,0 +1,3 @@
1
+ import type { StreamLayout } from './layout';
2
+ export declare const parseToStreamLayout: (value: string) => StreamLayout;
3
+ export declare const stringifyToStreamLayoutInput: (layout: StreamLayout) => string;
@@ -0,0 +1,6 @@
1
+ export const parseToStreamLayout = (value) => {
2
+ return JSON.parse(value);
3
+ };
4
+ export const stringifyToStreamLayoutInput = (layout) => {
5
+ return JSON.stringify(layout);
6
+ };
@@ -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, AnnotationStreamElementPlacement } from './enums';
2
- import type { AnnotationStreamElementStyles, ContainerStreamElementStyles, ImageStreamElementStyles, StreamLayoutStyles, TextStreamElementStyles } from './styles';
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;