@aiconomy/aico-components 0.0.57 → 0.0.78

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 (222) hide show
  1. package/dist/aico-components/aico-components.css +1 -1
  2. package/dist/aico-components/aico-components.esm.js +1 -1
  3. package/dist/aico-components/aico-components.esm.js.map +1 -1
  4. package/dist/aico-components/p-0b6e7469.entry.js +2 -0
  5. package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
  6. package/dist/aico-components/p-19752961.entry.js +2 -0
  7. package/dist/aico-components/p-19752961.entry.js.map +1 -0
  8. package/dist/aico-components/p-2677f2ab.js +2 -0
  9. package/dist/aico-components/p-2677f2ab.js.map +1 -0
  10. package/dist/aico-components/{p-1c4a07ef.entry.js → p-368503ee.entry.js} +3 -3
  11. package/dist/aico-components/p-368503ee.entry.js.map +1 -0
  12. package/dist/aico-components/p-7e0074f7.entry.js +2 -0
  13. package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
  14. package/dist/aico-components/p-9ea26390.entry.js +2 -0
  15. package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
  16. package/dist/aico-components/p-bccf08d0.entry.js +2 -0
  17. package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
  18. package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
  19. package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
  20. package/dist/cjs/aico-album-content_19.cjs.entry.js +76 -53
  21. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
  22. package/dist/cjs/aico-article-detail.cjs.entry.js +18 -17
  23. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
  24. package/dist/cjs/aico-components.cjs.js +1 -1
  25. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +3 -2
  26. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  27. package/dist/cjs/aico-news-list-item.cjs.entry.js +1 -1
  28. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
  29. package/dist/cjs/aico-news-list.cjs.entry.js +4 -3
  30. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  31. package/dist/cjs/aico-no-content_2.cjs.entry.js +5 -3
  32. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
  33. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +4 -3
  34. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/cjs/{utils-095ed22b.js → utils-c1b7a052.js} +11 -5
  37. package/dist/cjs/utils-c1b7a052.js.map +1 -0
  38. package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
  39. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  40. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +20 -1
  41. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  42. package/dist/collection/components/aico-news-list/aico-news-list.js +19 -2
  43. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  44. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +1 -1
  45. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  46. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
  47. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  48. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
  49. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
  50. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
  51. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
  52. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
  53. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
  54. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
  55. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
  56. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
  57. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
  58. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
  59. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
  60. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
  61. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
  62. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
  63. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
  64. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
  65. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
  66. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
  67. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
  68. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
  69. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
  70. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
  71. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
  72. package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
  73. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
  74. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
  75. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
  76. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
  77. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
  78. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
  79. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
  80. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
  81. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
  82. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
  83. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
  84. package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
  85. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
  86. package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
  87. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
  88. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
  89. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
  90. package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
  91. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
  92. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
  93. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
  94. package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
  95. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
  96. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
  97. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
  98. package/dist/collection/components/content/aico-text-content/aico-text-content.js +25 -9
  99. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
  100. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
  101. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
  102. package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
  103. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
  104. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
  105. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
  106. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
  107. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
  108. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
  109. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
  110. package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
  111. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
  112. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
  113. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
  114. package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
  115. package/dist/collection/utils/utils.js +10 -4
  116. package/dist/collection/utils/utils.js.map +1 -1
  117. package/dist/components/aico-article-detail2.js +20 -18
  118. package/dist/components/aico-article-detail2.js.map +1 -1
  119. package/dist/components/aico-asking-content2.js +6 -4
  120. package/dist/components/aico-asking-content2.js.map +1 -1
  121. package/dist/components/aico-block-quote-content2.js +5 -2
  122. package/dist/components/aico-block-quote-content2.js.map +1 -1
  123. package/dist/components/aico-bullet-content2.js +9 -6
  124. package/dist/components/aico-bullet-content2.js.map +1 -1
  125. package/dist/components/aico-carousel-content2.js +9 -4
  126. package/dist/components/aico-carousel-content2.js.map +1 -1
  127. package/dist/components/aico-content-card-content2.js +6 -4
  128. package/dist/components/aico-content-card-content2.js.map +1 -1
  129. package/dist/components/aico-divider-content2.js +5 -2
  130. package/dist/components/aico-divider-content2.js.map +1 -1
  131. package/dist/components/aico-document-content2.js +6 -4
  132. package/dist/components/aico-document-content2.js.map +1 -1
  133. package/dist/components/aico-faq-content2.js +5 -2
  134. package/dist/components/aico-faq-content2.js.map +1 -1
  135. package/dist/components/aico-fetch-article-detail.js +3 -1
  136. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  137. package/dist/components/aico-heading-content2.js +6 -3
  138. package/dist/components/aico-heading-content2.js.map +1 -1
  139. package/dist/components/aico-html-content2.js +7 -12
  140. package/dist/components/aico-html-content2.js.map +1 -1
  141. package/dist/components/aico-link-content2.js +6 -4
  142. package/dist/components/aico-link-content2.js.map +1 -1
  143. package/dist/components/aico-news-list-item2.js +1 -1
  144. package/dist/components/aico-news-list-item2.js.map +1 -1
  145. package/dist/components/aico-news-list.js +4 -2
  146. package/dist/components/aico-news-list.js.map +1 -1
  147. package/dist/components/aico-page-content2.js +7 -5
  148. package/dist/components/aico-page-content2.js.map +1 -1
  149. package/dist/components/aico-special-news-carousel.js +4 -2
  150. package/dist/components/aico-special-news-carousel.js.map +1 -1
  151. package/dist/components/aico-table-content2.js +10 -7
  152. package/dist/components/aico-table-content2.js.map +1 -1
  153. package/dist/components/aico-text-content2.js +9 -10
  154. package/dist/components/aico-text-content2.js.map +1 -1
  155. package/dist/components/aico-title-content2.js +7 -4
  156. package/dist/components/aico-title-content2.js.map +1 -1
  157. package/dist/components/aico-upload-content2.js +6 -3
  158. package/dist/components/aico-upload-content2.js.map +1 -1
  159. package/dist/components/aico-video-content2.js +6 -3
  160. package/dist/components/aico-video-content2.js.map +1 -1
  161. package/dist/components/utils.js +10 -4
  162. package/dist/components/utils.js.map +1 -1
  163. package/dist/esm/aico-album-content_19.entry.js +76 -53
  164. package/dist/esm/aico-album-content_19.entry.js.map +1 -1
  165. package/dist/esm/aico-article-detail.entry.js +18 -17
  166. package/dist/esm/aico-article-detail.entry.js.map +1 -1
  167. package/dist/esm/aico-components.js +1 -1
  168. package/dist/esm/aico-fetch-article-detail.entry.js +3 -2
  169. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  170. package/dist/esm/aico-news-list-item.entry.js +1 -1
  171. package/dist/esm/aico-news-list-item.entry.js.map +1 -1
  172. package/dist/esm/aico-news-list.entry.js +4 -3
  173. package/dist/esm/aico-news-list.entry.js.map +1 -1
  174. package/dist/esm/aico-no-content_2.entry.js +5 -3
  175. package/dist/esm/aico-no-content_2.entry.js.map +1 -1
  176. package/dist/esm/aico-special-news-carousel.entry.js +4 -3
  177. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  178. package/dist/esm/loader.js +1 -1
  179. package/dist/esm/{utils-54ffec33.js → utils-b4eec8e9.js} +11 -5
  180. package/dist/esm/utils-b4eec8e9.js.map +1 -0
  181. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
  182. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -0
  183. package/dist/types/components/aico-news-list/aico-news-list.d.ts +1 -0
  184. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
  185. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
  186. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
  187. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
  188. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
  189. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
  190. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
  191. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
  192. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
  193. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
  194. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
  195. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
  196. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
  197. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
  198. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
  199. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
  200. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
  201. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
  202. package/dist/types/components.d.ts +42 -0
  203. package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
  204. package/dist/types/utils/utils.d.ts +2 -2
  205. package/package.json +3 -2
  206. package/dist/aico-components/p-0ca1f065.entry.js +0 -2
  207. package/dist/aico-components/p-0ca1f065.entry.js.map +0 -1
  208. package/dist/aico-components/p-1c4a07ef.entry.js.map +0 -1
  209. package/dist/aico-components/p-406fa2e5.entry.js +0 -2
  210. package/dist/aico-components/p-406fa2e5.entry.js.map +0 -1
  211. package/dist/aico-components/p-4c0f3325.entry.js +0 -2
  212. package/dist/aico-components/p-4c0f3325.entry.js.map +0 -1
  213. package/dist/aico-components/p-5109399b.entry.js +0 -2
  214. package/dist/aico-components/p-5109399b.entry.js.map +0 -1
  215. package/dist/aico-components/p-6464810e.entry.js +0 -2
  216. package/dist/aico-components/p-6464810e.entry.js.map +0 -1
  217. package/dist/aico-components/p-b1f8308f.entry.js +0 -2
  218. package/dist/aico-components/p-b1f8308f.entry.js.map +0 -1
  219. package/dist/aico-components/p-dfd3b0d3.js +0 -2
  220. package/dist/aico-components/p-dfd3b0d3.js.map +0 -1
  221. package/dist/cjs/utils-095ed22b.js.map +0 -1
  222. package/dist/esm/utils-54ffec33.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"aico-text-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-text-content/aico-text-content.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,OAAO;oBACd,UAAU,EAA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AAE,MAAM;YAE5B,gBAAgB,EAAE,IAAI;YAEtB,kBAAkB,EAAE,IAAI;YACxB,eAAe,EAAE,KAAK;YAEtB,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,OAAO;YAClB,sBAAsB,EAAE,IAAI;YAC5B,0BAA0B,EAAE,KAAK;YAEjC,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM;SACpB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,OAAO;oBACd,UAAU,EAAE,aAAa;oBACzB,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,eAAe;oBACrB,YAAY,EAAE,eAAe;iBAC9B;aACF;YAED,eAAe,EAAE,QAAQ;YACzB,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,MAAM;YAE5B,gBAAgB,EAAE,IAAI;YAEtB,kBAAkB,EAAE,IAAI;YACxB,eAAe,EAAE,KAAK;YAEtB,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,OAAO;YAClB,sBAAsB,EAAE,IAAI;YAC5B,0BAA0B,EAAE,KAAK;YAEjC,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM;SACpB;KACF;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoTextContent> = {\n component: 'aico-text-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n },\n ],\n\n titleSize: 'h1',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const NoPrompt: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: null,\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\n\nexport const TextAndImage: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyImage: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyText: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n text: 'Foo\\nBar\\nBaz',\n pictureLabel: 'Picture label',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n"]}
1
+ {"version":3,"file":"aico-text-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-text-content/aico-text-content.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAA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AAE,IAAI;YACxB,eAAe,EAAE,KAAK;YAEtB,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,OAAO;YAClB,sBAAsB,EAAE,IAAI;YAC5B,0BAA0B,EAAE,KAAK;YAEjC,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM;SACpB;KACF;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoTextContent> = {\n component: 'aico-text-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n },\n ],\n\n titleSize: 'h1',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const NoPrompt: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: null,\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: null,\n locale: 'de',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label de',\n text: 'Foo de\\nBar de\\nBaz de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\n\nexport const TextAndImage: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label de',\n text: 'Foo de\\nBar de\\nBaz de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyImage: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyText: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n text: 'Foo\\nBar\\nBaz',\n pictureLabel: 'Picture label',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n text: 'Foo de\\nBar de\\nBaz de',\n pictureLabel: 'Picture label de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n"]}
@@ -2,12 +2,14 @@ import { h } from "@stencil/core";
2
2
  export class AicoTitleContent {
3
3
  constructor() {
4
4
  this.content = undefined;
5
+ this.locale = 'de';
5
6
  }
6
7
  render() {
7
- var _a;
8
+ var _a, _b;
8
9
  if (!this.content.size || this.content.translations.length === 0) {
9
10
  return h("aico-no-content", null);
10
11
  }
12
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
11
13
  const CustomTag = this.content.size;
12
14
  const defaultColor = 'black';
13
15
  const styles = {
@@ -15,10 +17,10 @@ export class AicoTitleContent {
15
17
  };
16
18
  if (this.content.hasUnderscore) {
17
19
  styles['text-decoration-line'] = 'underline';
18
- styles['text-decoration-color'] = (_a = this.content.underscoreColor) !== null && _a !== void 0 ? _a : defaultColor;
20
+ styles['text-decoration-color'] = (_b = this.content.underscoreColor) !== null && _b !== void 0 ? _b : defaultColor;
19
21
  styles['text-decoration-thickness'] = '3px';
20
22
  }
21
- return (h(CustomTag, null, h("span", { style: styles }, this.content.translations[0].title)));
23
+ return (h(CustomTag, null, h("span", { style: styles }, translation === null || translation === void 0 ? void 0 : translation.title)));
22
24
  }
23
25
  static get is() { return "aico-title-content"; }
24
26
  static get encapsulation() { return "scoped"; }
@@ -54,6 +56,24 @@ export class AicoTitleContent {
54
56
  "tags": [],
55
57
  "text": ""
56
58
  }
59
+ },
60
+ "locale": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": false,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "locale",
75
+ "reflect": false,
76
+ "defaultValue": "'de'"
57
77
  }
58
78
  };
59
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-title-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnD,MAAM,OAAO,gBAAgB;;;;IAG3B,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAChE,OAAO,0BAAmB,CAAC;SAC5B;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAEpC,MAAM,YAAY,GAAG,OAAO,CAAC;QAC7B,MAAM,MAAM,GAA8B;YACxC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;SACxE,CAAC;QAEF,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC9B,MAAM,CAAC,sBAAsB,CAAC,GAAG,WAAW,CAAC;YAC7C,MAAM,CAAC,uBAAuB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,YAAY,CAAC;YAC/E,MAAM,CAAC,2BAA2B,CAAC,GAAG,KAAK,CAAC;SAC7C;QAED,OAAO,CACL,EAAC,SAAS;YACR,YAAM,KAAK,EAAE,MAAM,IAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAQ,CACtD,CACb,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-title-content',\n styleUrl: 'aico-title-content.css',\n scoped: true,\n})\nexport class AicoTitleContent {\n @Prop() content!: TitleContent;\n\n render() {\n if (!this.content.size || this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const CustomTag = this.content.size;\n\n const defaultColor = 'black';\n const styles: { [key: string]: string } = {\n color: this.content.titleColor ? this.content.titleColor : defaultColor,\n };\n\n if (this.content.hasUnderscore) {\n styles['text-decoration-line'] = 'underline';\n styles['text-decoration-color'] = this.content.underscoreColor ?? defaultColor;\n styles['text-decoration-thickness'] = '3px';\n }\n\n return (\n <CustomTag>\n <span style={styles}>{this.content.translations[0].title}</span>\n </CustomTag>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-title-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.tsx"],"names":[],"mappings":"AAAA,O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component({\n tag: 'aico-title-content',\n styleUrl: 'aico-title-content.css',\n scoped: true,\n})\nexport class AicoTitleContent {\n @Prop() content!: TitleContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n if (!this.content.size || this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const CustomTag = this.content.size;\n\n const defaultColor = 'black';\n const styles: { [key: string]: string } = {\n color: this.content.titleColor ? this.content.titleColor : defaultColor,\n };\n\n if (this.content.hasUnderscore) {\n styles['text-decoration-line'] = 'underline';\n styles['text-decoration-color'] = this.content.underscoreColor ?? defaultColor;\n styles['text-decoration-thickness'] = '3px';\n }\n\n return (\n <CustomTag>\n <span style={styles}>{translation?.title}</span>\n </CustomTag>\n );\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { html } from "lit-html";
2
2
  const meta = {
3
3
  component: 'aico-title-content',
4
4
  args: {
5
+ locale: 'de',
5
6
  content: {
6
7
  id: 1234,
7
8
  createdAt: new Date(),
@@ -19,10 +20,20 @@ const meta = {
19
20
  title: 'Title foo',
20
21
  locale: 'en-US',
21
22
  },
23
+ {
24
+ id: 1234,
25
+ createdAt: new Date(),
26
+ updatedAt: new Date(),
27
+ text: 'Text foo de',
28
+ title: 'Title foo de',
29
+ locale: 'de',
30
+ }
22
31
  ],
23
32
  },
24
33
  },
25
34
  };
26
35
  export default meta;
27
- export const Example = (args) => html `<aico-title-content .content=${args.content}></aico-title-content>`;
36
+ export const Example = (args) => {
37
+ return html `<aico-title-content .locale=${args.locale} .content=${args.content}></aico-title-content>`;
38
+ };
28
39
  //# sourceMappingURL=aico-title-content.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aico-title-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,MAAM;YAClB,aAAa,EAAE,IAAI;YACnB,eAAe,EAAE,KAAK;YACtB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,WAAW;oBAClB,MAAM,EAAE,OAAO;iBAChB;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,OAAO,GAAkC,CAAC,IAA0B,EAAE,EAAE,CAAC,IAAI,CAAA,gCAAgC,IAAI,CAAC,OAAQ,wBAAwB,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/web-components';\nimport { JSX } from '../../../components';\nimport { html } from 'lit-html';\n\nconst meta: Meta<JSX.AicoTitleContent> = {\n component: 'aico-title-content',\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n size: 'h1',\n titleColor: 'blue',\n hasUnderscore: true,\n underscoreColor: 'red',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n text: 'Text foo',\n title: 'Title foo',\n locale: 'en-US',\n },\n ],\n },\n },\n};\n\nexport default meta;\n\nexport const Example: StoryFn<JSX.AicoTitleContent> = (args: JSX.AicoTitleContent) => html`<aico-title-content .content=${args.content!}></aico-title-content>`;\n"]}
1
+ {"version":3,"file":"aico-title-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,MAAM;YAClB,aAAa,EAAE,IAAI;YACnB,eAAe,EAAE,KAAK;YACtB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,WAAW;oBAClB,MAAM,EAAE,OAAO;iBAChB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,cAAc;oBACrB,MAAM,EAAE,IAAI;iBACb;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,OAAO,GAAkC,CAAC,IAA0B,EAAE,EAAE;IACnF,OAAO,IAAI,CAAA,+BAA+B,IAAI,CAAC,MAAO,aAAa,IAAI,CAAC,OAAQ,wBAAwB,CAAA;AAC1G,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/web-components';\nimport { JSX } from '../../../components';\nimport { html } from 'lit-html';\n\nconst meta: Meta<JSX.AicoTitleContent> = {\n component: 'aico-title-content',\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n size: 'h1',\n titleColor: 'blue',\n hasUnderscore: true,\n underscoreColor: 'red',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n text: 'Text foo',\n title: 'Title foo',\n locale: 'en-US',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n text: 'Text foo de',\n title: 'Title foo de',\n locale: 'de',\n }\n ],\n },\n },\n};\n\nexport default meta;\n\nexport const Example: StoryFn<JSX.AicoTitleContent> = (args: JSX.AicoTitleContent) => {\n return html`<aico-title-content .locale=${args.locale!} .content=${args.content!}></aico-title-content>`\n};\n"]}
@@ -4,11 +4,13 @@ import ConditionalRender from "../../../utils/ConditionalRender";
4
4
  export class AicoUploadContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
+ var _a;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
10
12
  const youtubeUrl = this.content && this.content.videoUrl ? getYoutubeURL(this.content.videoUrl) : null;
11
- return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(youtubeUrl) }, h("div", { class: "ratio ratio-16x9" }, h("iframe", { allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, src: youtubeUrl }))), h(ConditionalRender, { condition: !this.content.shouldHideFile }, h("p", { class: "fs-3 mt-3" }, "Files:"), h("div", { class: "list-group list-group-flush" }, this.content.uploads.map(upload => {
13
+ return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(youtubeUrl) }, h("div", { class: "ratio ratio-16x9" }, h("iframe", { allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, src: youtubeUrl }))), h(ConditionalRender, { condition: !this.content.shouldHideFile }, h("p", { class: "fs-3 mt-3" }, "Files:"), h("div", { class: "list-group list-group-flush" }, this.content.uploads.map(upload => {
12
14
  if (strIsNullOrEmptyOrWhitespace(upload.path)) {
13
15
  return null;
14
16
  }
@@ -59,6 +61,24 @@ export class AicoUploadContent {
59
61
  "tags": [],
60
62
  "text": ""
61
63
  }
64
+ },
65
+ "locale": {
66
+ "type": "string",
67
+ "mutable": false,
68
+ "complexType": {
69
+ "original": "string",
70
+ "resolved": "string",
71
+ "references": {}
72
+ },
73
+ "required": false,
74
+ "optional": false,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": ""
78
+ },
79
+ "attribute": "locale",
80
+ "reflect": false,
81
+ "defaultValue": "'de'"
62
82
  }
63
83
  };
64
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-upload-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-upload-content/aico-upload-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,iBAAiB;;;;IAG5B,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/F,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEvG,OAAO,CACL,EAAC,IAAI;YACH,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;gBAChD,0BAAoB,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,GAAI,CAClD;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,4BAA4B,CAAC,UAAU,CAAC;gBACrE,WAAK,KAAK,EAAC,kBAAkB;oBAC3B,cAAQ,KAAK,EAAC,0FAA0F,EAAC,eAAe,QAAC,GAAG,EAAE,UAAW,GAAI,CACzI,CACY;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc;gBACxD,SAAG,KAAK,EAAC,WAAW,aAAW;gBAC/B,WAAK,KAAK,EAAC,6BAA6B,IACrC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;oBACjC,IAAI,4BAA4B,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;wBAC7C,OAAO,IAAI,CAAC;qBACb;oBAED,OAAO,CACL,SAAG,IAAI,EAAE,MAAM,CAAC,IAAK,EAAE,MAAM,EAAC,QAAQ,EAAC,KAAK,EAAC,wCAAwC,IAClF,MAAM,CAAC,IAAI,CACV,CACL,CAAC;gBACJ,CAAC,CAAC,CACE,CACY,CACf,CACR,CAAC;IACJ,CAAC;IAEO,gBAAgB,CAAC,WAAwB;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { UploadContent } from '../../../model/article/content/UploadContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport { getYoutubeURL, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-upload-content',\n styleUrl: 'aico-upload-content.css',\n scoped: true,\n})\nexport class AicoUploadContent {\n @Prop() content!: UploadContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const youtubeUrl = this.content && this.content.videoUrl ? getYoutubeURL(this.content.videoUrl) : null;\n\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(youtubeUrl)}>\n <div class=\"ratio ratio-16x9\">\n <iframe allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowFullScreen src={youtubeUrl!} />\n </div>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.shouldHideFile}>\n <p class=\"fs-3 mt-3\">Files:</p>\n <div class=\"list-group list-group-flush\">\n {this.content.uploads.map(upload => {\n if (strIsNullOrEmptyOrWhitespace(upload.path)) {\n return null;\n }\n\n return (\n <a href={upload.path!} target=\"_blank\" class=\"list-group-item list-group-item-action\">\n {upload.name}\n </a>\n );\n })}\n </div>\n </ConditionalRender>\n </Host>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"aico-upload-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-upload-content/aico-upload-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MA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,CACL,CAAC;gBACJ,CAAC,CAAC,CACE,CACY,CACf,CACR,CAAC;IACJ,CAAC;IAEO,gBAAgB,CAAC,WAAwB;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { UploadContent } from '../../../model/article/content/UploadContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport { getYoutubeURL, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-upload-content',\n styleUrl: 'aico-upload-content.css',\n scoped: true,\n})\nexport class AicoUploadContent {\n @Prop() content!: UploadContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const youtubeUrl = this.content && this.content.videoUrl ? getYoutubeURL(this.content.videoUrl) : null;\n\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(youtubeUrl)}>\n <div class=\"ratio ratio-16x9\">\n <iframe allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowFullScreen src={youtubeUrl!} />\n </div>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.shouldHideFile}>\n <p class=\"fs-3 mt-3\">Files:</p>\n <div class=\"list-group list-group-flush\">\n {this.content.uploads.map(upload => {\n if (strIsNullOrEmptyOrWhitespace(upload.path)) {\n return null;\n }\n\n return (\n <a href={upload.path!} target=\"_blank\" class=\"list-group-item list-group-item-action\">\n {upload.name}\n </a>\n );\n })}\n </div>\n </ConditionalRender>\n </Host>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -16,6 +17,13 @@ export const Example = {
16
17
  locale: 'en-GB',
17
18
  title: 'Hello :)',
18
19
  },
20
+ {
21
+ id: 1234,
22
+ createdAt: new Date(),
23
+ updatedAt: new Date(),
24
+ locale: 'de',
25
+ title: 'Hello de :)',
26
+ },
19
27
  ],
20
28
  videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
21
29
  shouldHideFile: false,
@@ -1 +1 @@
1
- {"version":3,"file":"aico-upload-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-upload-content/aico-upload-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAgC;IACxC,SAAS,EAAE,qBAAqB;CACjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,OAAO,GAAa;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,UAAU;iBAClB;aACF;YACD,QAAQ,EAAE,6CAA6C;YACvD,cAAc,EAAE,KAAK;YACrB,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,6CAA6C;iBACpD;gBACD;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,6CAA6C;iBACpD;gBACD;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,6CAA6C;iBACpD;aACF;SACe;KACnB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { UploadContent } from '../../../model/article/content/UploadContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoUploadContent> = {\n component: 'aico-upload-content',\n};\n\nexport default meta;\n\nexport const Example: StoryObj = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Hello :)',\n },\n ],\n videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n shouldHideFile: false,\n uploads: [\n {\n name: 'foo',\n path: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n {\n name: 'bar',\n path: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n {\n name: 'baz',\n path: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n ],\n } as UploadContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-upload-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-upload-content/aico-upload-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAgC;IACxC,SAAS,EAAE,qBAAqB;CACjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,OAAO,GAAa;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,UAAU;iBAClB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,aAAa;iBACrB;aACF;YACD,QAAQ,EAAE,6CAA6C;YACvD,cAAc,EAAE,KAAK;YACrB,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,6CAA6C;iBACpD;gBACD;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,6CAA6C;iBACpD;gBACD;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,6CAA6C;iBACpD;aACF;SACe;KACnB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { UploadContent } from '../../../model/article/content/UploadContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoUploadContent> = {\n component: 'aico-upload-content',\n};\n\nexport default meta;\n\nexport const Example: StoryObj = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Hello :)',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'Hello de :)',\n },\n ],\n videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n shouldHideFile: false,\n uploads: [\n {\n name: 'foo',\n path: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n {\n name: 'bar',\n path: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n {\n name: 'baz',\n path: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n ],\n } as UploadContent,\n },\n};\n"]}
@@ -4,11 +4,13 @@ import { getYoutubeURL, strIsNullOrEmptyOrWhitespace } from "../../../utils/util
4
4
  export class AicoVideoContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
+ var _a;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
10
12
  const youtubeUrl = translation && translation.videoUrl ? getYoutubeURL(translation.videoUrl) : null;
11
- return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(youtubeUrl) }, h("div", { class: "ratio ratio-16x9" }, h("iframe", { allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, src: youtubeUrl }))), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.localVideoUrl) }, h("div", { class: "ratio ratio-16x9" }, h("video", { class: "media-card-video", controls: true, playsInline: true, style: { height: this.content.isVideoMinimized ? '400px' : '100%' } }, h("source", { src: this.content.localVideoUrl, type: "video/mp4" }))))));
13
+ return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(youtubeUrl) }, h("div", { class: "ratio ratio-16x9" }, h("iframe", { allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, src: youtubeUrl }))), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.localVideoUrl) }, h("div", { class: "ratio ratio-16x9" }, h("video", { class: "media-card-video", controls: true, playsInline: true, style: { height: this.content.isVideoMinimized ? '400px' : '100%' } }, h("source", { src: this.content.localVideoUrl, type: "video/mp4" }))))));
12
14
  }
13
15
  makeTitleContent(translation) {
14
16
  var _a;
@@ -55,6 +57,24 @@ export class AicoVideoContent {
55
57
  "tags": [],
56
58
  "text": ""
57
59
  }
60
+ },
61
+ "locale": {
62
+ "type": "string",
63
+ "mutable": false,
64
+ "complexType": {
65
+ "original": "string",
66
+ "resolved": "string",
67
+ "references": {}
68
+ },
69
+ "required": false,
70
+ "optional": false,
71
+ "docs": {
72
+ "tags": [],
73
+ "text": ""
74
+ },
75
+ "attribute": "locale",
76
+ "reflect": false,
77
+ "defaultValue": "'de'"
58
78
  }
59
79
  };
60
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-video-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-video-content/aico-video-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAOnF,MAAM,OAAO,gBAAgB;;;;IAG3B,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/F,MAAM,UAAU,GAAG,WAAW,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEpG,OAAO,CACL,EAAC,IAAI;YACH,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;gBAChD,0BAAoB,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,GAAI,CAClD;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,4BAA4B,CAAC,UAAU,CAAC;gBACrE,WAAK,KAAK,EAAC,kBAAkB;oBAC3B,cAAQ,KAAK,EAAC,0FAA0F,EAAC,eAAe,QAAC,GAAG,EAAE,UAAW,GAAI,CACzI,CACY;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;gBACrF,WAAK,KAAK,EAAC,kBAAkB;oBAC3B,aAAO,KAAK,EAAC,kBAAkB,EAAC,QAAQ,QAAC,WAAW,QAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE;wBACtH,cAAQ,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,EAAC,WAAW,GAAG,CACtD,CACJ,CACY,CACf,CACR,CAAC;IACJ,CAAC;IAEO,gBAAgB,CAAC,WAAwB;;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { VideoContent } from '../../../model/article/content/VideoContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { getYoutubeURL, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\n\n@Component({\n tag: 'aico-video-content',\n styleUrl: 'aico-video-content.css',\n scoped: true,\n})\nexport class AicoVideoContent {\n @Prop() content!: VideoContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const youtubeUrl = translation && translation.videoUrl ? getYoutubeURL(translation.videoUrl) : null;\n\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(youtubeUrl)}>\n <div class=\"ratio ratio-16x9\">\n <iframe allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowFullScreen src={youtubeUrl!} />\n </div>\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.localVideoUrl)}>\n <div class=\"ratio ratio-16x9\">\n <video class=\"media-card-video\" controls playsInline style={{ height: this.content.isVideoMinimized ? '400px' : '100%' }}>\n <source src={this.content.localVideoUrl} type=\"video/mp4\" />\n </video>\n </div>\n </ConditionalRender>\n </Host>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"aico-video-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-video-content/aico-video-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAOnF,MAAM,OAAO,gBAAgB;;;sBAGF,IAAI;;IAE7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O,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { VideoContent } from '../../../model/article/content/VideoContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { getYoutubeURL, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\n\n@Component({\n tag: 'aico-video-content',\n styleUrl: 'aico-video-content.css',\n scoped: true,\n})\nexport class AicoVideoContent {\n @Prop() content!: VideoContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const youtubeUrl = translation && translation.videoUrl ? getYoutubeURL(translation.videoUrl) : null;\n\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(youtubeUrl)}>\n <div class=\"ratio ratio-16x9\">\n <iframe allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowFullScreen src={youtubeUrl!} />\n </div>\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.localVideoUrl)}>\n <div class=\"ratio ratio-16x9\">\n <video class=\"media-card-video\" controls playsInline style={{ height: this.content.isVideoMinimized ? '400px' : '100%' }}>\n <source src={this.content.localVideoUrl} type=\"video/mp4\" />\n </video>\n </div>\n </ConditionalRender>\n </Host>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Youtube = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -17,12 +18,21 @@ export const Youtube = {
17
18
  title: 'Hello :)',
18
19
  videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
19
20
  },
21
+ {
22
+ id: 1234,
23
+ createdAt: new Date(),
24
+ updatedAt: new Date(),
25
+ locale: 'de',
26
+ title: 'Hello de :)',
27
+ videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
28
+ },
20
29
  ],
21
30
  },
22
31
  },
23
32
  };
24
33
  export const HtmlVideo = {
25
34
  args: {
35
+ locale: 'de',
26
36
  content: {
27
37
  id: 1234,
28
38
  createdAt: new Date(),
@@ -35,6 +45,13 @@ export const HtmlVideo = {
35
45
  locale: 'en-GB',
36
46
  title: 'Hello :)',
37
47
  },
48
+ {
49
+ id: 1234,
50
+ createdAt: new Date(),
51
+ updatedAt: new Date(),
52
+ locale: 'de',
53
+ title: 'Hello de :)',
54
+ },
38
55
  ],
39
56
  localVideoUrl: 'https://63vod-adaptive.akamaized.net/exp=1705508449~acl=%2Fa156ad05-7584-419d-88f0-f3b8178c6856%2F%2A~hmac=c5c0e2ae58210ded1ca504ec11ff52843417d2fec0b748409741f033595117fb/a156ad05-7584-419d-88f0-f3b8178c6856/parcel/audio/e3e208cf.mp4',
40
57
  },
@@ -1 +1 @@
1
- {"version":3,"file":"aico-video-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-video-content/aico-video-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;CAChC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,UAAU;oBACjB,QAAQ,EAAE,6CAA6C;iBACxD;aACF;SACc;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,UAAU;iBAClB;aACF;YACD,aAAa,EACX,4OAA4O;SAC/N;KAClB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { VideoContent } from '../../../model/article/content/VideoContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoVideoContent> = {\n component: 'aico-video-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Youtube: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Hello :)',\n videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n ],\n } as VideoContent,\n },\n};\n\nexport const HtmlVideo: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Hello :)',\n },\n ],\n localVideoUrl:\n 'https://63vod-adaptive.akamaized.net/exp=1705508449~acl=%2Fa156ad05-7584-419d-88f0-f3b8178c6856%2F%2A~hmac=c5c0e2ae58210ded1ca504ec11ff52843417d2fec0b748409741f033595117fb/a156ad05-7584-419d-88f0-f3b8178c6856/parcel/audio/e3e208cf.mp4',\n } as VideoContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-video-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-video-content/aico-video-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;CAChC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,UAAU;oBACjB,QAAQ,EAAE,6CAA6C;iBACxD;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,aAAa;oBACpB,QAAQ,EAAE,6CAA6C;iBACxD;aACF;SACc;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,UAAU;iBAClB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,aAAa;iBACrB;aACF;YACD,aAAa,EACX,4OAA4O;SAC/N;KAClB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { VideoContent } from '../../../model/article/content/VideoContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoVideoContent> = {\n component: 'aico-video-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Youtube: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Hello :)',\n videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'Hello de :)',\n videoUrl: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n ],\n } as VideoContent,\n },\n};\n\nexport const HtmlVideo: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Hello :)',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'Hello de :)',\n },\n ],\n localVideoUrl:\n 'https://63vod-adaptive.akamaized.net/exp=1705508449~acl=%2Fa156ad05-7584-419d-88f0-f3b8178c6856%2F%2A~hmac=c5c0e2ae58210ded1ca504ec11ff52843417d2fec0b748409741f033595117fb/a156ad05-7584-419d-88f0-f3b8178c6856/parcel/audio/e3e208cf.mp4',\n } as VideoContent,\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CarouselContent.js","sourceRoot":"","sources":["../../../../src/model/article/content/CarouselContent.ts"],"names":[],"mappings":"","sourcesContent":["import { Entity } from '../../Entity';\nimport { Translation } from '../Translation';\n\nexport type CarouselImage = Entity & {\n order: number;\n picture: string;\n translations: Translation[];\n};\n\nexport type CarouselContent = Entity & {\n translations: Translation[];\n arrowsBackground?: string;\n contentCarouselImages: CarouselImage[];\n};\n"]}
1
+ {"version":3,"file":"CarouselContent.js","sourceRoot":"","sources":["../../../../src/model/article/content/CarouselContent.ts"],"names":[],"mappings":"","sourcesContent":["import { Entity } from '../../Entity';\nimport { Translation } from '../Translation';\n\nexport type CarouselImage = Entity & {\n order: number;\n picture?: string;\n translations: (Translation & {\n picture?: string;\n })[];\n};\n\nexport type CarouselContent = Entity & {\n translations: Translation[];\n arrowsBackground?: string;\n contentCarouselImages: CarouselImage[];\n};\n"]}
@@ -1,24 +1,30 @@
1
1
  import { getAuthenticatedHeaders, getAuthenticatedRequest } from "../model/AicoApiRequestInfo";
2
- export async function fetchNewsArticles(api, page, size, signal) {
2
+ export async function fetchNewsArticles(api, page, size, signal, newsChannels = []) {
3
3
  const queryParams = new URLSearchParams();
4
4
  queryParams.set('page[number]', String(page));
5
5
  queryParams.set('page[size]', String(size));
6
+ queryParams.set('sort', '-publishDate');
6
7
  queryParams.set('filter[isActive]', '1');
7
8
  queryParams.set('filter[excludeTag][]', 'Eisnull');
8
- queryParams.set('sort', '-publishDate');
9
+ for (const newsChannel of newsChannels) {
10
+ queryParams.set('filter[channel][]', newsChannel);
11
+ }
9
12
  const request = getAuthenticatedRequest(api, 'news', queryParams, signal);
10
13
  const response = await fetch(request);
11
14
  return await response.json();
12
15
  }
13
- export async function fetchSpecialNewsArticles(api, page, size, signal) {
16
+ export async function fetchSpecialNewsArticles(api, page, size, signal, newsChannels = []) {
14
17
  const queryParams = new URLSearchParams();
15
18
  queryParams.set('page[number]', String(page));
16
19
  queryParams.set('page[size]', String(size));
20
+ queryParams.set('sort', '-publishDate');
17
21
  queryParams.set('filter[isActive]', '1');
18
22
  queryParams.set('filter[isSpecialArticle]', '1');
19
23
  queryParams.set('filter[isLightVersion]', 'true');
20
24
  queryParams.set('filter[excludeTag][]', 'Eisnull');
21
- queryParams.set('sort', '-publishDate');
25
+ for (const newsChannel of newsChannels) {
26
+ queryParams.set('filter[channel][]', newsChannel);
27
+ }
22
28
  const request = getAuthenticatedRequest(api, 'news', queryParams, signal);
23
29
  const response = await fetch(request);
24
30
  return await response.json();
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGnH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAuB,EAAE,IAAY,EAAE,IAAY,EAAE,MAAmB;IAC9G,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;IAC1C,WAAW,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,WAAW,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,WAAW,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IACzC,WAAW,CAAC,GAAG,CAAC,sBAAsB,EAAE,SAAS,CA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O;YACV,OAAO,KAAK,CAAC;QACf,KAAK,aAAa,EAAE,sBAAsB;YACxC,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,MAAM,GAAG,2DAA2D,CAAC;IAC3E,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE;QAClC,OAAO,iCAAiC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,GAAmB;IAC9D,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,UAAsC;IAC7D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC5C,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACtB;KACF;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { Article } from '../components';\nimport { AicoApiRequestInfo, getAuthenticatedHeaders, getAuthenticatedRequest } from '../model/AicoApiRequestInfo';\nimport { NewsResponse } from '../model/NewsResponse';\n\nexport async function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n queryParams.set('sort', '-publishDate');\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[isSpecialArticle]', '1');\n queryParams.set('filter[isLightVersion]', 'true');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n queryParams.set('sort', '-publishDate');\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article> {\n const request = getAuthenticatedRequest(api, `news/${articleId}`, new URLSearchParams(), signal);\n const response = await fetch(request);\n const article = await response.json();\n return article.data;\n}\n\nexport async function fetchNewsArticleByHandle(api: AicoApiRequestInfo, urlHandle: string, signal: AbortSignal): Promise<Article> {\n const queryParams = new URLSearchParams();\n queryParams.set('filter[urlHandle]', urlHandle);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n const articles = await response.json();\n return articles.data[0];\n}\n\nexport async function fetchArticle(url: string, bearerToken: string, signal: AbortSignal): Promise<Article> {\n const request = new Request(new URL(url), {\n headers: getAuthenticatedHeaders(bearerToken),\n signal,\n });\n const response = await fetch(request);\n return await response.json();\n}\n\nexport function getImageWidthPrc(pictureSize?: string): string {\n switch (pictureSize) {\n case 'extra-small':\n return '28%';\n case 'small':\n return '40%';\n case 'large':\n return '80%';\n case 'extra large': // TODO: has - or not?\n return '100%';\n default:\n return '60%';\n }\n}\n\nexport function getYoutubeURL(url: string): string | null {\n const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#&?]*).*/;\n const match = url.match(regExp);\n if (match && match[1].length == 11) {\n return `https://www.youtube.com/embed/${match[1]}`;\n }\n\n return null;\n}\n\nexport function strIsNullOrEmptyOrWhitespace(str?: string | null): boolean {\n if (!str || str === ' ') {\n return true;\n }\n\n return false;\n}\n\nexport function getClass(conditions: { [key: string]: boolean }): string {\n const classes: string[] = [];\n for (const kvp of Object.entries(conditions)) {\n if (kvp[1]) {\n classes.push(kvp[0]);\n }\n }\n\n return classes.join(' ');\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGnH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAuB,EAAE,IAAY,EAAE,IAAY,EAAE,MAAmB,EAAE,eAAyB,EAAE;IAC3I,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;IAC1C,WAAW,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,WAAW,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACxC,WAAW,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IACzC,WAAW,CAAC,GAAG,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;IACnD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;QACtC,WAAW,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;KACnD;IAED,MAAM,OAAO,GAAG,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,MAAM,QAAQ,CAAC,IAAI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MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,MAAM,GAAG,2DAA2D,CAAC;IAC3E,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE;QAClC,OAAO,iCAAiC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,GAAmB;IAC9D,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,UAAsC;IAC7D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC5C,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACtB;KACF;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { Article } from '../components';\nimport { AicoApiRequestInfo, getAuthenticatedHeaders, getAuthenticatedRequest } from '../model/AicoApiRequestInfo';\nimport { NewsResponse } from '../model/NewsResponse';\n\nexport async function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels: string[] = []): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n for (const newsChannel of newsChannels) {\n queryParams.set('filter[channel][]', newsChannel);\n }\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels: string[] = []): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[isSpecialArticle]', '1');\n queryParams.set('filter[isLightVersion]', 'true');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n for (const newsChannel of newsChannels) {\n queryParams.set('filter[channel][]', newsChannel);\n }\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article> {\n const request = getAuthenticatedRequest(api, `news/${articleId}`, new URLSearchParams(), signal);\n const response = await fetch(request);\n const article = await response.json();\n return article.data;\n}\n\nexport async function fetchNewsArticleByHandle(api: AicoApiRequestInfo, urlHandle: string, signal: AbortSignal): Promise<Article> {\n const queryParams = new URLSearchParams();\n queryParams.set('filter[urlHandle]', urlHandle);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n const articles = await response.json();\n return articles.data[0];\n}\n\nexport async function fetchArticle(url: string, bearerToken: string, signal: AbortSignal): Promise<Article> {\n const request = new Request(new URL(url), {\n headers: getAuthenticatedHeaders(bearerToken),\n signal,\n });\n const response = await fetch(request);\n return await response.json();\n}\n\nexport function getImageWidthPrc(pictureSize?: string): string {\n switch (pictureSize) {\n case 'extra-small':\n return '28%';\n case 'small':\n return '40%';\n case 'large':\n return '80%';\n case 'extra large': // TODO: has - or not?\n return '100%';\n default:\n return '60%';\n }\n}\n\nexport function getYoutubeURL(url: string): string | null {\n const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#&?]*).*/;\n const match = url.match(regExp);\n if (match && match[1].length == 11) {\n return `https://www.youtube.com/embed/${match[1]}`;\n }\n\n return null;\n}\n\nexport function strIsNullOrEmptyOrWhitespace(str?: string | null): boolean {\n if (!str || str === ' ') {\n return true;\n }\n\n return false;\n}\n\nexport function getClass(conditions: { [key: string]: boolean }): string {\n const classes: string[] = [];\n for (const kvp of Object.entries(conditions)) {\n if (kvp[1]) {\n classes.push(kvp[0]);\n }\n }\n\n return classes.join(' ');\n}\n"]}
@@ -62,6 +62,7 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
62
62
  this.__registerHost();
63
63
  this.dateOptions = { day: 'numeric', month: 'long', year: 'numeric' };
64
64
  this.article = undefined;
65
+ this.locale = 'de';
65
66
  }
66
67
  render() {
67
68
  const articleDate = new Date(this.article.attributes.publishDate);
@@ -84,43 +85,43 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
84
85
  case ContentType.ALBUM:
85
86
  return h("aico-album-content", { content: content });
86
87
  case ContentType.ASKING:
87
- return h("aico-asking-content", { content: content });
88
+ return h("aico-asking-content", { content: content, locale: this.locale });
88
89
  case ContentType.BLOCK_QUOTE:
89
- return h("aico-block-quote-content", { content: content });
90
+ return h("aico-block-quote-content", { content: content, locale: this.locale });
90
91
  case ContentType.BULLET:
91
- return h("aico-bullet-content", { content: content });
92
+ return h("aico-bullet-content", { content: content, locale: this.locale });
92
93
  case ContentType.CAROUSEL:
93
- return h("aico-carousel-content", { content: content });
94
+ return h("aico-carousel-content", { content: content, locale: this.locale });
94
95
  case ContentType.CONTENT_CARD:
95
- return h("aico-content-card-content", { content: content });
96
+ return h("aico-content-card-content", { content: content, locale: this.locale });
96
97
  case ContentType.DIVIDER:
97
- return h("aico-divider-content", { content: content });
98
+ return h("aico-divider-content", { content: content, locale: this.locale });
98
99
  case ContentType.DOCUMENT:
99
- return h("aico-document-content", { content: content });
100
+ return h("aico-document-content", { content: content, locale: this.locale });
100
101
  case ContentType.FAQ:
101
- return h("aico-faq-content", { content: content });
102
+ return h("aico-faq-content", { content: content, locale: this.locale });
102
103
  case ContentType.HEADING:
103
- return h("aico-heading-content", { content: content });
104
+ return h("aico-heading-content", { content: content, locale: this.locale });
104
105
  case ContentType.HTML:
105
- return h("aico-html-content", { content: content });
106
+ return h("aico-html-content", { content: content, locale: this.locale });
106
107
  case ContentType.LINK:
107
- return h("aico-link-content", { content: content });
108
+ return h("aico-link-content", { content: content, locale: this.locale });
108
109
  case ContentType.NEWS:
109
110
  return h("aico-news-content", { content: content });
110
111
  case ContentType.PAGE:
111
- return h("aico-page-content", { content: content });
112
+ return h("aico-page-content", { content: content, locale: this.locale });
112
113
  case ContentType.TABLE:
113
- return h("aico-table-content", { content: content });
114
+ return h("aico-table-content", { content: content, locale: this.locale });
114
115
  case ContentType.TESTIMONIAL:
115
116
  return h("aico-testimonial-content", { content: content });
116
117
  case ContentType.TEXT:
117
- return h("aico-text-content", { content: content });
118
+ return h("aico-text-content", { content: content, locale: this.locale });
118
119
  case ContentType.TITLE:
119
- return h("aico-title-content", { content: content });
120
+ return h("aico-title-content", { content: content, locale: this.locale });
120
121
  case ContentType.UPLOAD:
121
- return h("aico-upload-content", { content: content });
122
+ return h("aico-upload-content", { content: content, locale: this.locale });
122
123
  case ContentType.VIDEO:
123
- return h("aico-video-content", { content: content });
124
+ return h("aico-video-content", { content: content, locale: this.locale });
124
125
  case ContentType.PRODUCT:
125
126
  case ContentType.AGENDA:
126
127
  case ContentType.LIST_ASKING:
@@ -136,7 +137,8 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
136
137
  }
137
138
  static get style() { return aicoArticleDetailCss; }
138
139
  }, [2, "aico-article-detail", {
139
- "article": [16]
140
+ "article": [16],
141
+ "locale": [1]
140
142
  }]);
141
143
  function defineCustomElement() {
142
144
  if (typeof customElements === "undefined") {