@streamscloud/embeddable 3.2.4 → 3.2.5

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 (179) hide show
  1. package/dist/core/analytics.profile-id.d.ts +5 -0
  2. package/dist/core/analytics.profile-id.js +17 -0
  3. package/dist/core/document.event-handlers.d.ts +1 -0
  4. package/dist/core/document.event-handlers.js +5 -0
  5. package/dist/core/enums.d.ts +0 -2
  6. package/dist/core/enums.js +0 -2
  7. package/dist/core/graphql.d.ts +3 -1
  8. package/dist/core/graphql.js +12 -3
  9. package/dist/core/locale.d.ts +6 -0
  10. package/dist/core/locale.js +24 -0
  11. package/dist/core/utils/html-helper.d.ts +1 -0
  12. package/dist/core/utils/html-helper.js +4 -0
  13. package/dist/products/price-helper.js +1 -1
  14. package/dist/short-videos/short-video-viewer/cmp.ad.svelte +103 -37
  15. package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +2 -2
  16. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +2 -2
  17. package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +3 -2
  18. package/dist/short-videos/short-video-viewer/cmp.product.svelte +1 -1
  19. package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +3 -2
  20. package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +1 -1
  21. package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +3 -2
  22. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +6 -2
  23. package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +1 -1
  24. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +1 -1
  25. package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +3 -2
  26. package/dist/short-videos/short-video-viewer/description.svelte +5 -0
  27. package/dist/short-videos/short-video-viewer/description.svelte.d.ts +1 -1
  28. package/dist/short-videos/short-video-viewer/index.d.ts +4 -2
  29. package/dist/short-videos/short-video-viewer/index.js +1 -0
  30. package/dist/short-videos/short-video-viewer/mapper.js +5 -4
  31. package/dist/short-videos/short-video-viewer/operations.generated.d.ts +10 -3
  32. package/dist/short-videos/short-video-viewer/operations.generated.js +17 -3
  33. package/dist/short-videos/short-video-viewer/operations.graphql +10 -3
  34. package/dist/short-videos/short-video-viewer/{short-video-attachments-localization.svelte.d.ts → short-video-attachments-localization.d.ts} +5 -4
  35. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +21 -0
  36. package/dist/short-videos/short-video-viewer/{short-video-details-localization.svelte.d.ts → short-video-details-localization.d.ts} +7 -6
  37. package/dist/short-videos/short-video-viewer/short-video-details-localization.js +17 -0
  38. package/dist/short-videos/short-video-viewer/{short-video-product-localization.svelte.d.ts → short-video-product-localization.d.ts} +2 -1
  39. package/dist/short-videos/short-video-viewer/short-video-product-localization.js +13 -0
  40. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +14 -0
  41. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +17 -0
  42. package/dist/short-videos/short-video-viewer/types.d.ts +10 -3
  43. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +88 -11
  44. package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +5 -5
  45. package/dist/short-videos/short-videos-player/controls.svelte +2 -2
  46. package/dist/short-videos/short-videos-player/controls.svelte.d.ts +1 -1
  47. package/dist/short-videos/short-videos-player/index.d.ts +51 -14
  48. package/dist/short-videos/short-videos-player/index.js +83 -12
  49. package/dist/short-videos/short-videos-player/operations.generated.d.ts +71 -0
  50. package/dist/short-videos/short-videos-player/operations.generated.js +207 -0
  51. package/dist/short-videos/short-videos-player/operations.graphql +8 -0
  52. package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +16 -0
  53. package/dist/short-videos/short-videos-player/short-videos-player-localization.js +13 -0
  54. package/dist/short-videos/short-videos-player/types.d.ts +36 -0
  55. package/dist/short-videos/short-videos-player/types.js +6 -0
  56. package/dist/streams/layout/cmp.layout.svelte.d.ts +4 -2
  57. package/dist/streams/layout/cmp.slot-content.svelte +4 -4
  58. package/dist/streams/layout/cmp.slot-content.svelte.d.ts +2 -1
  59. package/dist/streams/layout/cmp.slot.svelte.d.ts +7 -2
  60. package/dist/streams/layout/component.d.ts +2 -0
  61. package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +16 -0
  62. package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte.d.ts +7 -0
  63. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +1 -1
  64. package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +4 -3
  65. package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +15 -2
  66. package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +7 -3
  67. package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
  68. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +15 -89
  69. package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +5 -4
  70. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +4 -2
  71. package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +3 -0
  72. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +74 -0
  73. package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +11 -0
  74. package/dist/streams/layout/element-views/cmp.stream-element.svelte +24 -17
  75. package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +4 -3
  76. package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +2 -2
  77. package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +6 -2
  78. package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +2 -0
  79. package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +37 -0
  80. package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +7 -0
  81. package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -3
  82. package/dist/streams/layout/element-views/index.d.ts +16 -11
  83. package/dist/streams/layout/element-views/index.js +12 -9
  84. package/dist/streams/layout/element-views/price-element-view.svelte +168 -0
  85. package/dist/streams/layout/element-views/price-element-view.svelte.d.ts +15 -0
  86. package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +13 -0
  87. package/dist/streams/layout/element-views/price-stream-element-localization.js +21 -0
  88. package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +9 -0
  89. package/dist/streams/layout/element-views/short-video-stream-element-localization.js +7 -0
  90. package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +8 -0
  91. package/dist/streams/layout/element-views/stock-stream-element-localization.js +26 -0
  92. package/dist/streams/layout/element-views/stream-element-localization.d.ts +15 -0
  93. package/dist/streams/layout/element-views/stream-element-localization.js +11 -0
  94. package/dist/streams/layout/elements.d.ts +47 -12
  95. package/dist/streams/layout/elements.js +1 -1
  96. package/dist/streams/layout/enums.d.ts +34 -3
  97. package/dist/streams/layout/enums.js +46 -7
  98. package/dist/streams/layout/index.d.ts +3 -10
  99. package/dist/streams/layout/index.js +3 -2
  100. package/dist/streams/layout/layout.d.ts +2 -1
  101. package/dist/streams/layout/models/index.d.ts +1 -1
  102. package/dist/streams/layout/models/mapper.js +5 -4
  103. package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +1 -1
  104. package/dist/streams/layout/models/stream-layout-media-item-model.js +1 -1
  105. package/dist/streams/layout/models/stream-layout-post-header-model.d.ts +1 -1
  106. package/dist/streams/layout/models/stream-layout-product-model.d.ts +1 -2
  107. package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +13 -3
  108. package/dist/streams/layout/serializer.svelte.d.ts +29 -0
  109. package/dist/streams/layout/serializer.svelte.js +93 -0
  110. package/dist/streams/layout/slot-data-ref.d.ts +13 -0
  111. package/dist/streams/layout/slot-data-ref.js +1 -0
  112. package/dist/streams/layout/slot.d.ts +2 -0
  113. package/dist/streams/layout/styles-transformer.d.ts +3 -2
  114. package/dist/streams/layout/styles-transformer.js +54 -30
  115. package/dist/streams/layout/styles.d.ts +24 -14
  116. package/dist/streams/layout/svg-attributes.d.ts +7 -0
  117. package/dist/streams/layout/svg-attributes.js +8 -0
  118. package/dist/streams/layout/type-guards.d.ts +31 -0
  119. package/dist/streams/layout/type-guards.js +13 -1
  120. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +4 -2
  121. package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +3 -0
  122. package/dist/streams/stream-page-viewer/index.d.ts +1 -0
  123. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +9 -0
  124. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +7 -0
  125. package/dist/streams/stream-player/cmp.stream-player.svelte +47 -7
  126. package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +6 -4
  127. package/dist/streams/stream-player/controls.svelte +46 -3
  128. package/dist/streams/stream-player/controls.svelte.d.ts +1 -1
  129. package/dist/streams/stream-player/index.d.ts +6 -4
  130. package/dist/streams/stream-player/index.js +15 -28
  131. package/dist/streams/stream-player/operations.generated.d.ts +1 -1
  132. package/dist/streams/stream-player/operations.generated.js +5 -3
  133. package/dist/streams/stream-player/operations.graphql +3 -3
  134. package/dist/streams/stream-player/stream-overview.svelte +2 -2
  135. package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -1
  136. package/dist/streams/stream-player/stream-player-buffer.svelte.js +2 -2
  137. package/dist/streams/stream-player/stream-player-localization.d.ts +26 -0
  138. package/dist/streams/stream-player/stream-player-localization.js +31 -0
  139. package/dist/ui/icon/cmp.icon.svelte +13 -26
  140. package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
  141. package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +3 -2
  142. package/dist/ui/line-clamp/index.d.ts +1 -1
  143. package/dist/ui/line-clamp/index.js +1 -1
  144. package/dist/ui/line-clamp/{line-clamp-localization.svelte.d.ts → line-clamp-localization.d.ts} +2 -1
  145. package/dist/ui/line-clamp/line-clamp-localization.js +19 -0
  146. package/dist/ui/shadow-dom/shadow-host.d.ts +1 -5
  147. package/dist/ui/shadow-dom/shadow-host.js +1 -14
  148. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +125 -0
  149. package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +9 -0
  150. package/dist/ui/swipe-indicator/index.d.ts +2 -0
  151. package/dist/ui/swipe-indicator/index.js +1 -0
  152. package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +8 -0
  153. package/dist/ui/swipe-indicator/swipe-indicator-localization.js +13 -0
  154. package/dist/ui/time-ago/cmp.time-ago.svelte +1 -1
  155. package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +3 -2
  156. package/dist/ui/time-ago/index.d.ts +1 -1
  157. package/dist/ui/time-ago/{time-ago-localization.svelte.d.ts → time-ago-localization.d.ts} +2 -1
  158. package/dist/ui/time-ago/time-ago-localization.js +55 -0
  159. package/dist/ui/video/cmp.video.svelte +42 -18
  160. package/package.json +1 -1
  161. package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +0 -10
  162. package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +0 -10
  163. package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +0 -11
  164. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +0 -13
  165. package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +0 -10
  166. package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +0 -8
  167. package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +0 -6
  168. package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +0 -9
  169. package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +0 -8
  170. package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +0 -8
  171. package/dist/streams/layout/element-views/stream-element-localization.svelte.js +0 -6
  172. package/dist/streams/layout/serializer.d.ts +0 -3
  173. package/dist/streams/layout/serializer.js +0 -6
  174. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +0 -13
  175. package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +0 -10
  176. package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +0 -12
  177. package/dist/streams/stream-player/stream-player-localization.svelte.js +0 -10
  178. package/dist/ui/line-clamp/line-clamp-localization.svelte.js +0 -15
  179. package/dist/ui/time-ago/time-ago-localization.svelte.js +0 -39
@@ -0,0 +1,207 @@
1
+ export const GetShortVideosDocument = {
2
+ kind: 'Document',
3
+ definitions: [
4
+ {
5
+ kind: 'OperationDefinition',
6
+ operation: 'query',
7
+ name: { kind: 'Name', value: 'GetShortVideos' },
8
+ variableDefinitions: [
9
+ {
10
+ kind: 'VariableDefinition',
11
+ variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
12
+ type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'EmbedPostsInput' } } }
13
+ },
14
+ {
15
+ kind: 'VariableDefinition',
16
+ variable: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } },
17
+ type: { kind: 'NamedType', name: { kind: 'Name', value: 'ImageScale' } },
18
+ defaultValue: { kind: 'EnumValue', value: 'ORIGINAL_ENCODED' }
19
+ }
20
+ ],
21
+ selectionSet: {
22
+ kind: 'SelectionSet',
23
+ selections: [
24
+ {
25
+ kind: 'Field',
26
+ alias: { kind: 'Name', value: 'shortVideos' },
27
+ name: { kind: 'Name', value: 'embedPosts' },
28
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'input' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } } }],
29
+ selectionSet: {
30
+ kind: 'SelectionSet',
31
+ selections: [
32
+ {
33
+ kind: 'Field',
34
+ name: { kind: 'Name', value: 'items' },
35
+ selectionSet: {
36
+ kind: 'SelectionSet',
37
+ selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'ShortVideoViewerPayloadFragment' } }]
38
+ }
39
+ }
40
+ ]
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ kind: 'FragmentDefinition',
48
+ name: { kind: 'Name', value: 'ShortVideoViewerPayloadFragment' },
49
+ typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Post' } },
50
+ selectionSet: {
51
+ kind: 'SelectionSet',
52
+ selections: [
53
+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
54
+ { kind: 'Field', name: { kind: 'Name', value: 'enableSocialInteractions' } },
55
+ {
56
+ kind: 'Field',
57
+ name: { kind: 'Name', value: 'postHeading' },
58
+ selectionSet: {
59
+ kind: 'SelectionSet',
60
+ selections: [
61
+ { kind: 'Field', name: { kind: 'Name', value: 'sourceImage' } },
62
+ { kind: 'Field', name: { kind: 'Name', value: 'sourceName' } },
63
+ { kind: 'Field', name: { kind: 'Name', value: 'postDisplayDate' } },
64
+ { kind: 'Field', name: { kind: 'Name', value: 'postViewsCount' } }
65
+ ]
66
+ }
67
+ },
68
+ {
69
+ kind: 'Field',
70
+ name: { kind: 'Name', value: 'allProducts' },
71
+ selectionSet: {
72
+ kind: 'SelectionSet',
73
+ selections: [
74
+ {
75
+ kind: 'Field',
76
+ name: { kind: 'Name', value: 'media' },
77
+ selectionSet: {
78
+ kind: 'SelectionSet',
79
+ selections: [
80
+ { kind: 'Field', name: { kind: 'Name', value: 'url' } },
81
+ { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
82
+ { kind: 'Field', name: { kind: 'Name', value: 'type' } }
83
+ ]
84
+ }
85
+ },
86
+ { kind: 'Field', name: { kind: 'Name', value: 'title' } },
87
+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
88
+ { kind: 'Field', name: { kind: 'Name', value: 'link' } },
89
+ { kind: 'Field', name: { kind: 'Name', value: 'shortDescription' } },
90
+ {
91
+ kind: 'Field',
92
+ name: { kind: 'Name', value: 'priceAndAvailability' },
93
+ selectionSet: {
94
+ kind: 'SelectionSet',
95
+ selections: [
96
+ { kind: 'Field', name: { kind: 'Name', value: 'currency' } },
97
+ { kind: 'Field', name: { kind: 'Name', value: 'price' } },
98
+ {
99
+ kind: 'Field',
100
+ name: { kind: 'Name', value: 'productSalePrices' },
101
+ selectionSet: {
102
+ kind: 'SelectionSet',
103
+ selections: [
104
+ { kind: 'Field', name: { kind: 'Name', value: 'salePrice' } },
105
+ { kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateFrom' } },
106
+ { kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateTo' } }
107
+ ]
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ kind: 'Field',
118
+ name: { kind: 'Name', value: 'ad' },
119
+ selectionSet: {
120
+ kind: 'SelectionSet',
121
+ selections: [
122
+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
123
+ { kind: 'Field', name: { kind: 'Name', value: 'title' } },
124
+ { kind: 'Field', name: { kind: 'Name', value: 'description' } },
125
+ { kind: 'Field', name: { kind: 'Name', value: 'price' } },
126
+ { kind: 'Field', name: { kind: 'Name', value: 'currency' } },
127
+ {
128
+ kind: 'Field',
129
+ name: { kind: 'Name', value: 'ctaButton' },
130
+ selectionSet: {
131
+ kind: 'SelectionSet',
132
+ selections: [
133
+ { kind: 'Field', name: { kind: 'Name', value: 'background' } },
134
+ { kind: 'Field', name: { kind: 'Name', value: 'textColor' } },
135
+ { kind: 'Field', name: { kind: 'Name', value: 'text' } },
136
+ { kind: 'Field', name: { kind: 'Name', value: 'url' } },
137
+ { kind: 'Field', name: { kind: 'Name', value: 'border' } }
138
+ ]
139
+ }
140
+ },
141
+ { kind: 'Field', name: { kind: 'Name', value: 'type' } },
142
+ {
143
+ kind: 'Field',
144
+ name: { kind: 'Name', value: 'media' },
145
+ selectionSet: {
146
+ kind: 'SelectionSet',
147
+ selections: [
148
+ { kind: 'Field', name: { kind: 'Name', value: 'url' } },
149
+ { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
150
+ { kind: 'Field', name: { kind: 'Name', value: 'type' } }
151
+ ]
152
+ }
153
+ }
154
+ ]
155
+ }
156
+ },
157
+ {
158
+ kind: 'Field',
159
+ name: { kind: 'Name', value: 'postData' },
160
+ selectionSet: {
161
+ kind: 'SelectionSet',
162
+ selections: [
163
+ {
164
+ kind: 'Field',
165
+ name: { kind: 'Name', value: 'media' },
166
+ selectionSet: {
167
+ kind: 'SelectionSet',
168
+ selections: [
169
+ {
170
+ kind: 'Field',
171
+ name: { kind: 'Name', value: 'url' },
172
+ arguments: [
173
+ {
174
+ kind: 'Argument',
175
+ name: { kind: 'Name', value: 'scale' },
176
+ value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } }
177
+ }
178
+ ]
179
+ },
180
+ {
181
+ kind: 'Field',
182
+ name: { kind: 'Name', value: 'thumbnailUrl' },
183
+ arguments: [
184
+ {
185
+ kind: 'Argument',
186
+ name: { kind: 'Name', value: 'scale' },
187
+ value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } }
188
+ }
189
+ ]
190
+ },
191
+ { kind: 'Field', name: { kind: 'Name', value: 'type' } }
192
+ ]
193
+ }
194
+ },
195
+ {
196
+ kind: 'Field',
197
+ name: { kind: 'Name', value: 'shortVideoData' },
198
+ selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'text' } }] }
199
+ }
200
+ ]
201
+ }
202
+ }
203
+ ]
204
+ }
205
+ }
206
+ ]
207
+ };
@@ -0,0 +1,8 @@
1
+ # noinspection GraphQLSchemaValidation
2
+ query GetShortVideos($input: EmbedPostsInput!, $image_scale: ImageScale = ORIGINAL_ENCODED) {
3
+ shortVideos: embedPosts(input: $input) {
4
+ items {
5
+ ...ShortVideoViewerPayloadFragment
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,16 @@
1
+ import { type Locale } from '../../core/locale';
2
+ import type { IShortVideoAttachmentsLocalization, IShortVideoDetailsLocalization, IShortVideoViewerLocalization } from '../short-video-viewer';
3
+ import type { ISwipeIndicatorLocalization } from '../../ui/swipe-indicator';
4
+ export interface IShortVideosPlayerLocalization {
5
+ shortVideoAttachmentsLocalization?: IShortVideoAttachmentsLocalization | Locale;
6
+ shortVideoDetailsLocalization?: IShortVideoDetailsLocalization | Locale;
7
+ shortVideoViewerLocalization?: IShortVideoViewerLocalization | Locale;
8
+ swipeIndicatorLocalization?: ISwipeIndicatorLocalization | Locale;
9
+ }
10
+ export declare class ShortVideosPlayerLocalization {
11
+ shortVideoAttachmentsLocalization: IShortVideoAttachmentsLocalization | Locale;
12
+ shortVideoDetailsLocalization: IShortVideoDetailsLocalization | Locale;
13
+ shortVideoViewerLocalization: IShortVideoViewerLocalization | Locale;
14
+ swipeIndicatorLocalization: ISwipeIndicatorLocalization | Locale;
15
+ constructor(init: IShortVideosPlayerLocalization | Locale);
16
+ }
@@ -0,0 +1,13 @@
1
+ import { isLocale } from '../../core/locale';
2
+ export class ShortVideosPlayerLocalization {
3
+ shortVideoAttachmentsLocalization;
4
+ shortVideoDetailsLocalization;
5
+ shortVideoViewerLocalization;
6
+ swipeIndicatorLocalization;
7
+ constructor(init) {
8
+ this.shortVideoAttachmentsLocalization = isLocale(init) ? init : init.shortVideoAttachmentsLocalization || 'en';
9
+ this.shortVideoDetailsLocalization = isLocale(init) ? init : init.shortVideoDetailsLocalization || 'en';
10
+ this.shortVideoViewerLocalization = isLocale(init) ? init : init.shortVideoViewerLocalization || 'en';
11
+ this.swipeIndicatorLocalization = isLocale(init) ? init : init.swipeIndicatorLocalization || 'en';
12
+ }
13
+ }
@@ -0,0 +1,36 @@
1
+ import type { ShortVideoViewerModel } from '../..';
2
+ import type { PlayerItemsProvider } from '../../ui/player';
3
+ import type { IShortVideosPlayerLocalization } from './short-videos-player-localization';
4
+ export type PlayerInput = ProviderPlayerInput | IdsPlayerInput;
5
+ export type ProviderPlayerInput = {
6
+ type: 'provider';
7
+ provider: PlayerItemsProvider<ShortVideoViewerModel>;
8
+ };
9
+ export type IdsPlayerInput = {
10
+ type: 'ids';
11
+ ids: string[];
12
+ initialId?: string;
13
+ graphqlOrigin?: string;
14
+ initiator?: string;
15
+ };
16
+ export type OpenShortVideosPlayerInit = ProviderInit | IdsInit;
17
+ type ProviderInit = {
18
+ shortVideosProvider: PlayerItemsProvider<ShortVideoViewerModel>;
19
+ localization?: IShortVideosPlayerLocalization | 'en' | 'no';
20
+ on?: {
21
+ playerClosed?: () => void;
22
+ };
23
+ };
24
+ type IdsInit = {
25
+ ids: string[];
26
+ graphqlOrigin?: string;
27
+ initialId?: string;
28
+ localization?: IShortVideosPlayerLocalization | 'en' | 'no';
29
+ initiator?: string;
30
+ on?: {
31
+ playerClosed?: () => void;
32
+ };
33
+ };
34
+ export declare const isShortVideosProviderInit: (init: unknown) => init is ProviderInit;
35
+ export declare function isIdsInit(init: unknown): init is IdsInit;
36
+ export {};
@@ -0,0 +1,6 @@
1
+ export const isShortVideosProviderInit = (init) => {
2
+ return typeof init === 'object' && init !== null && 'shortVideosProvider' in init;
3
+ };
4
+ export function isIdsInit(init) {
5
+ return typeof init === 'object' && init !== null && 'ids' in init && 'graphqlOrigin' in init;
6
+ }
@@ -1,7 +1,9 @@
1
- import type { StreamLayout } from './layout';
1
+ import type { StreamLayoutStyles } from './styles';
2
2
  import type { Snippet } from 'svelte';
3
3
  type Props = {
4
- model: StreamLayout;
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 { StreamElement } from './element-views';
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) => { var _a; return c.dataType === ((_a = model.data) === null || _a === void 0 ? void 0 : _a.type); });
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 && dataIsFilled}
45
+ {#if component && (!model.data || dataIsFilled)}
46
46
  {#each component.elements as element (element)}
47
- <StreamElement model={element} data={model.data} localization={localization} on={on} />
47
+ <StreamElementView model={element} data={model.data} localization={localization} on={on} />
48
48
  {/each}
49
49
  {/if}
50
50
  {/snippet}
@@ -1,8 +1,9 @@
1
+ import type { Locale } from '../../core/locale';
1
2
  import { type IStreamElementLocalization } from './element-views';
2
3
  import type { StreamSlot } from './slot';
3
4
  type Props = {
4
5
  model: StreamSlot;
5
- localization?: IStreamElementLocalization;
6
+ localization: IStreamElementLocalization | Locale;
6
7
  on?: {
7
8
  productClick: (productId: string) => void;
8
9
  progress?: (videoId: string, progress: number) => void;
@@ -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: StreamSlot;
9
+ model: LayoutStyles;
5
10
  children: Snippet;
6
11
  };
7
12
  declare const Cmp: import("svelte").Component<Props, {}, "">;
@@ -1,6 +1,8 @@
1
1
  import type { StreamElementModel } from './elements';
2
2
  import { StreamComponentDataType } from './enums';
3
3
  export type StreamComponent = {
4
+ $id: string;
5
+ name?: string | null;
4
6
  dataType: StreamComponentDataType;
5
7
  elements: StreamElementModel[];
6
8
  };
@@ -0,0 +1,16 @@
1
+ <script lang="ts">import { HtmlHelper } from '../../../core/utils/html-helper';
2
+ import { generateAnnotationStyles } from '../styles-transformer';
3
+ let { model } = $props();
4
+ const svgValue = $derived.by(() => {
5
+ if (model.svg) {
6
+ return HtmlHelper.sanitizeSvg(model.svg);
7
+ }
8
+ return '';
9
+ });
10
+ </script>
11
+
12
+ {#if !model.inactive}
13
+ <div class="annotation-stream-element" style={generateAnnotationStyles(model.styles, model.placement)}>
14
+ {@html svgValue}
15
+ </div>
16
+ {/if}
@@ -0,0 +1,7 @@
1
+ import type { AnnotationStreamElementModel } from '../elements';
2
+ type Props = {
3
+ model: AnnotationStreamElementModel;
4
+ };
5
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
6
+ type Cmp = ReturnType<typeof Cmp>;
7
+ export default Cmp;
@@ -1,4 +1,4 @@
1
- <script lang="ts">import {} from './stream-element-localization.svelte';
1
+ <script lang="ts">import {} from './stream-element-localization';
2
2
  import { StreamElementStyleDirection } from '../enums';
3
3
  import { generateContainerStyles } from '../styles-transformer';
4
4
  import { default as StreamElement } from './cmp.stream-element.svelte';
@@ -1,10 +1,11 @@
1
- import { type IStreamElementLocalization } from './stream-element-localization.svelte';
1
+ import type { Locale } from '../../../core/locale';
2
+ import { type IStreamElementLocalization } from './stream-element-localization';
2
3
  import type { ContainerStreamElementModel } from '../elements';
3
4
  import type { StreamSlotData } from '../slot-data';
4
5
  type Props = {
5
6
  model: ContainerStreamElementModel;
6
- data: StreamSlotData;
7
- localization?: IStreamElementLocalization;
7
+ data: StreamSlotData | null;
8
+ localization: IStreamElementLocalization | Locale;
8
9
  };
9
10
  declare const Cmp: import("svelte").Component<Props, {}, "">;
10
11
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,11 +1,21 @@
1
1
  <script lang="ts">import { getStringValueByKey } from './data-by-key-accessor';
2
2
  import { generateImageStyles } from '../styles-transformer';
3
- let { model, data } = $props();
3
+ import { default as AnnotationStreamElement } from './cmp.annotation-stream-element.svelte';
4
+ let { model, data, annotationView } = $props();
4
5
  const value = $derived(getStringValueByKey(data, model.key));
5
6
  </script>
6
7
 
7
8
  <div class="image-ref-stream-element">
8
9
  <img class="image-ref-stream-element-image" src={value} alt={model.key} style={generateImageStyles(model.styles)} />
10
+ {#if model.annotations}
11
+ {#each model.annotations as annotationModel (annotationModel)}
12
+ {#if annotationView}
13
+ {@render annotationView({ model: annotationModel })}
14
+ {:else}
15
+ <AnnotationStreamElement model={annotationModel} />
16
+ {/if}
17
+ {/each}
18
+ {/if}
9
19
  </div>
10
20
 
11
21
  <style>@keyframes fadeIn {
@@ -26,7 +36,10 @@ const value = $derived(getStringValueByKey(data, model.key));
26
36
  height: 100%;
27
37
  min-height: 100%;
28
38
  max-height: 100%;
29
- overflow: hidden;
39
+ position: relative;
40
+ }
41
+ .image-ref-stream-element :global(svg) {
42
+ overflow: visible;
30
43
  }
31
44
 
32
45
  .image-ref-stream-element-image {
@@ -1,8 +1,12 @@
1
- import type { ImageRefStreamElementModel } from '../elements';
2
- import type { StreamSlotData } from '../slot-data';
1
+ import type { AnnotationStreamElementModel, ImageRefStreamElementModel } from '../elements';
2
+ import type { StreamSlotDataRef } from '../slot-data-ref';
3
+ import type { Snippet } from 'svelte';
3
4
  type Props = {
4
5
  model: ImageRefStreamElementModel;
5
- data: StreamSlotData;
6
+ data: StreamSlotDataRef;
7
+ annotationView?: Snippet<[{
8
+ model: AnnotationStreamElementModel;
9
+ }]>;
6
10
  };
7
11
  declare const Cmp: import("svelte").Component<Props, {}, "">;
8
12
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,11 +1,11 @@
1
1
  <script lang="ts">import { Image } from '../../../ui/image';
2
- import { ImagesImagesElementMode } from '../enums';
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 === ImagesImagesElementMode.Single || data.length === 1}
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,97 +1,23 @@
1
1
  <script lang="ts">var _a;
2
- import { toPriceRepresentation } from '../../../products/price-helper';
3
- import { PriceStreamElementLocalization } from './price-stream-element-localization.svelte.js';
4
- import { mapFlexJustifyContent, mapFontFamily, mapFontWeight, transformColorValue, transformFontSizeValue, transformNumericValue } from '../styles-transformer';
2
+ import { PriceStreamElementLocalization } from './price-stream-element-localization';
3
+ import { default as PriceElementView } from './price-element-view.svelte';
5
4
  let { model, data, localization: localizationInit } = $props();
6
5
  const localization = $derived(new PriceStreamElementLocalization(localizationInit));
7
- const lineHeight = 1.2;
8
- const height = $derived(((_a = model.styles) === null || _a === void 0 ? void 0 : _a.height) || 16);
9
- const currentPrice = $derived.by(() => {
10
- if (data.price.salePrice) {
11
- return toPriceRepresentation(data.price.salePrice, data.price.currency, model.includeCurrency || false);
12
- }
13
- return toPriceRepresentation(data.price.price, data.price.currency, model.includeCurrency || false);
14
- });
15
- const saveValue = $derived.by(() => {
16
- if (data.price.salePrice) {
17
- return toPriceRepresentation(data.price.price - data.price.salePrice, data.price.currency, model.includeCurrency || false);
18
- }
19
- return 0;
20
- });
21
- const containerStyles = $derived.by(() => {
22
- var _a, _b;
23
- const values = [
24
- `font-family: ${mapFontFamily((_a = model.styles) === null || _a === void 0 ? void 0 : _a.fontFamily)};`,
25
- `justify-content: ${mapFlexJustifyContent((_b = model.styles) === null || _b === void 0 ? void 0 : _b.horizontalAlign)};`,
26
- `align-items: center;`,
27
- `height: ${transformNumericValue(height)};`
28
- ];
29
- return values.join('');
30
- });
31
- const priceCustomStyles = $derived.by(() => {
32
- var _a, _b, _c;
33
- const values = [
34
- `font-size: ${transformFontSizeValue(height / lineHeight)};`,
35
- `line-height: ${lineHeight};`,
36
- `font-weight: ${mapFontWeight((_a = model.styles) === null || _a === void 0 ? void 0 : _a.fontWeight)};`,
37
- `color: ${transformColorValue(data.price.salePrice ? (_b = model.styles) === null || _b === void 0 ? void 0 : _b.salePriceColor : (_c = model.styles) === null || _c === void 0 ? void 0 : _c.regularPriceColor)};`
38
- ];
39
- return values.join('');
40
- });
41
- const saveValueCustomStyles = $derived.by(() => {
42
- var _a, _b;
43
- const values = [
44
- `margin-top: ${transformNumericValue((height - height / lineHeight) / 2)};`,
45
- `font-size: ${transformFontSizeValue(height / 4)};`,
46
- `font-weight: 500;`,
47
- `padding: ${transformNumericValue(height / 8)} ${transformNumericValue(height / 4)};`,
48
- `border-radius: ${transformNumericValue(height / 8)};`,
49
- `background-color: ${transformColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.saveValueBackgroundColor)};`,
50
- `color: ${transformColorValue((_b = model.styles) === null || _b === void 0 ? void 0 : _b.saveValueColor)};`
51
- ];
52
- return values.join('');
53
- });
54
- const beforeValueCustomStyles = $derived.by(() => {
55
- var _a;
56
- const values = [`font-size: ${transformFontSizeValue(height / 5)};`, `font-weight: 500;`, `color: ${transformColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.beforeValueColor)};`];
57
- return values.join('');
58
- });
6
+ let baseMaxHeight = $derived(((_a = model.styles) === null || _a === void 0 ? void 0 : _a.height) || 32);
7
+ let adjustedHeight = $derived(baseMaxHeight);
59
8
  </script>
60
9
 
61
- <div class="price-stream-element" style={containerStyles}>
62
- <div class="price-stream-element__price" style={priceCustomStyles}>
63
- {currentPrice}
64
- </div>
65
- {#if data.price.salePrice && !model.excludeBeforePrice}
66
- <div class="price-stream-element__sale-price">
67
- <div class="price-stream-element__save" style={saveValueCustomStyles}>
68
- {localization.saveValue(saveValue)}
69
- </div>
70
- <div class="price-stream-element__before-price" style={beforeValueCustomStyles}>
71
- {localization.beforeValue(toPriceRepresentation(data.price.price, data.price.currency, model.includeCurrency || false))}
72
- </div>
73
- </div>
74
- {/if}
10
+ <div class="price-stream-element">
11
+ <PriceElementView maxElementHeight={adjustedHeight} model={model} data={data} localization={localization} />
12
+ <PriceElementView
13
+ maxElementHeight={baseMaxHeight}
14
+ model={model}
15
+ data={data}
16
+ localization={localization}
17
+ on={{ heightAdjusted: (e) => (adjustedHeight = e) }} />
75
18
  </div>
76
19
 
77
- <style>@keyframes fadeIn {
78
- 0% {
79
- opacity: 1;
80
- }
81
- 50% {
82
- opacity: 0.4;
83
- }
84
- 100% {
85
- opacity: 1;
86
- }
87
- }
88
- .price-stream-element {
89
- display: flex;
90
- gap: 4cqi;
91
- }
92
- .price-stream-element__sale-price {
93
- display: flex;
94
- height: 100%;
95
- flex-direction: column;
96
- justify-content: space-between;
20
+ <style>.price-stream-element {
21
+ position: relative;
22
+ width: 100%;
97
23
  }</style>
@@ -1,10 +1,11 @@
1
- import { type IPriceStreamElementLocalization } from './price-stream-element-localization.svelte.js';
1
+ import type { Locale } from '../../../core/locale';
2
+ import { type IPriceStreamElementLocalization } from './price-stream-element-localization';
2
3
  import type { PriceStreamElementModel } from '../elements';
3
- import type { StreamLayoutProductModel } from '../models';
4
+ import type { StreamLayoutProductPriceModel } from '../models';
4
5
  type Props = {
5
6
  model: PriceStreamElementModel;
6
- data: StreamLayoutProductModel;
7
- localization?: IPriceStreamElementLocalization;
7
+ data: StreamLayoutProductPriceModel;
8
+ localization: IPriceStreamElementLocalization | Locale;
8
9
  };
9
10
  declare const Cmp: import("svelte").Component<Props, {}, "">;
10
11
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,6 +1,8 @@
1
1
  <script lang="ts">import { ShortVideoViewer } from '../../../short-videos/short-video-viewer';
2
+ import { ShortVideoStreamElementLocalization } from './short-video-stream-element-localization';
2
3
  import { mapToShortVideoViewerModel } from '../models';
3
- let { data, on } = $props();
4
+ let { data, localization: localizationInit, on } = $props();
5
+ const localization = $derived(new ShortVideoStreamElementLocalization(localizationInit));
4
6
  </script>
5
7
 
6
- <ShortVideoViewer model={mapToShortVideoViewerModel(data)} autoplay={false} on={on} />
8
+ <ShortVideoViewer model={mapToShortVideoViewerModel(data)} autoplay={false} localization={localization.shortVideoViewerLocalization} on={on} />
@@ -1,6 +1,9 @@
1
+ import type { Locale } from '../../../core/locale';
2
+ import { type IShortVideoStreamElementLocalization } from './short-video-stream-element-localization';
1
3
  import { type StreamLayoutShortVideoModel } from '../models';
2
4
  type Props = {
3
5
  data: StreamLayoutShortVideoModel;
6
+ localization: IShortVideoStreamElementLocalization | Locale;
4
7
  on?: {
5
8
  progress?: (progress: number) => void;
6
9
  };