@aiconomy/aico-components 0.0.53 → 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 (265) hide show
  1. package/README.md +67 -57
  2. package/dist/aico-components/aico-components.css +1 -1
  3. package/dist/aico-components/aico-components.esm.js +1 -1
  4. package/dist/aico-components/aico-components.esm.js.map +1 -1
  5. package/dist/aico-components/p-0b6e7469.entry.js +2 -0
  6. package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
  7. package/dist/aico-components/p-19752961.entry.js +2 -0
  8. package/dist/aico-components/p-19752961.entry.js.map +1 -0
  9. package/dist/aico-components/p-2677f2ab.js +2 -0
  10. package/dist/aico-components/p-2677f2ab.js.map +1 -0
  11. package/dist/aico-components/{p-a58972e9.entry.js → p-368503ee.entry.js} +3 -3
  12. package/dist/aico-components/p-368503ee.entry.js.map +1 -0
  13. package/dist/aico-components/{p-b78d7799.entry.js → p-68930822.entry.js} +2 -2
  14. package/dist/aico-components/p-7e0074f7.entry.js +2 -0
  15. package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
  16. package/dist/aico-components/{p-1a6625c0.entry.js → p-90c2d3dc.entry.js} +2 -2
  17. package/dist/aico-components/p-9ea26390.entry.js +2 -0
  18. package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
  19. package/dist/aico-components/p-ae20e789.js +3 -0
  20. package/dist/aico-components/{p-2aae1a0e.js.map → p-ae20e789.js.map} +1 -1
  21. package/dist/aico-components/p-bccf08d0.entry.js +2 -0
  22. package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
  23. package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
  24. package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
  25. package/dist/cjs/aico-album-content_19.cjs.entry.js +78 -57
  26. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
  27. package/dist/cjs/aico-article-detail.cjs.entry.js +19 -18
  28. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
  29. package/dist/cjs/aico-asking-list-content.cjs.entry.js +1 -1
  30. package/dist/cjs/aico-collection-content.cjs.entry.js +1 -1
  31. package/dist/cjs/aico-components.cjs.js +2 -2
  32. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +12 -3
  33. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  34. package/dist/cjs/aico-news-list-item.cjs.entry.js +6 -3
  35. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
  36. package/dist/cjs/aico-news-list.cjs.entry.js +9 -8
  37. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  38. package/dist/cjs/aico-no-content_2.cjs.entry.js +6 -4
  39. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
  40. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +5 -4
  41. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  42. package/dist/cjs/{index-75c0e002.js → index-e52034b7.js} +1 -6
  43. package/dist/cjs/index-e52034b7.js.map +1 -0
  44. package/dist/cjs/loader.cjs.js +2 -2
  45. package/dist/cjs/{utils-406a9df3.js → utils-c1b7a052.js} +20 -5
  46. package/dist/cjs/utils-c1b7a052.js.map +1 -0
  47. package/dist/collection/collection-manifest.json +0 -1
  48. package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
  49. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  50. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +49 -5
  51. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  52. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js +6 -0
  53. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js.map +1 -1
  54. package/dist/collection/components/aico-news-list/aico-news-list.css +0 -113
  55. package/dist/collection/components/aico-news-list/aico-news-list.js +23 -6
  56. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  57. package/dist/collection/components/aico-news-list/aico-news-list.stories.js +3 -0
  58. package/dist/collection/components/aico-news-list/aico-news-list.stories.js.map +1 -1
  59. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +6 -3
  60. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  61. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
  62. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  63. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
  64. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
  65. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
  66. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
  67. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
  68. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
  69. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
  70. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
  71. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
  72. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
  73. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
  74. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
  75. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
  76. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
  77. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
  78. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
  79. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
  80. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
  81. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
  82. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
  83. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
  84. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
  85. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
  86. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
  87. package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
  88. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
  89. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
  90. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
  91. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
  92. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
  93. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
  94. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
  95. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
  96. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
  97. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
  98. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
  99. package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
  100. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
  101. package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
  102. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
  103. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
  104. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
  105. package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
  106. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
  107. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
  108. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
  109. package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
  110. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
  111. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
  112. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
  113. package/dist/collection/components/content/aico-text-content/aico-text-content.js +27 -11
  114. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
  115. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
  116. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
  117. package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
  118. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
  119. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
  120. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
  121. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
  122. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
  123. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
  124. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
  125. package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
  126. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
  127. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
  128. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
  129. package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
  130. package/dist/collection/utils/utils.js +18 -4
  131. package/dist/collection/utils/utils.js.map +1 -1
  132. package/dist/components/aico-article-detail2.js +20 -18
  133. package/dist/components/aico-article-detail2.js.map +1 -1
  134. package/dist/components/aico-asking-content2.js +6 -4
  135. package/dist/components/aico-asking-content2.js.map +1 -1
  136. package/dist/components/aico-block-quote-content2.js +5 -2
  137. package/dist/components/aico-block-quote-content2.js.map +1 -1
  138. package/dist/components/aico-bullet-content2.js +9 -6
  139. package/dist/components/aico-bullet-content2.js.map +1 -1
  140. package/dist/components/aico-carousel-content2.js +9 -4
  141. package/dist/components/aico-carousel-content2.js.map +1 -1
  142. package/dist/components/aico-content-card-content2.js +6 -4
  143. package/dist/components/aico-content-card-content2.js.map +1 -1
  144. package/dist/components/aico-divider-content2.js +5 -2
  145. package/dist/components/aico-divider-content2.js.map +1 -1
  146. package/dist/components/aico-document-content2.js +6 -4
  147. package/dist/components/aico-document-content2.js.map +1 -1
  148. package/dist/components/aico-faq-content2.js +5 -2
  149. package/dist/components/aico-faq-content2.js.map +1 -1
  150. package/dist/components/aico-fetch-article-detail.js +14 -3
  151. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  152. package/dist/components/aico-heading-content2.js +6 -3
  153. package/dist/components/aico-heading-content2.js.map +1 -1
  154. package/dist/components/aico-html-content2.js +7 -12
  155. package/dist/components/aico-html-content2.js.map +1 -1
  156. package/dist/components/aico-link-content2.js +6 -4
  157. package/dist/components/aico-link-content2.js.map +1 -1
  158. package/dist/components/aico-news-list-item2.js +5 -2
  159. package/dist/components/aico-news-list-item2.js.map +1 -1
  160. package/dist/components/aico-news-list.js +9 -7
  161. package/dist/components/aico-news-list.js.map +1 -1
  162. package/dist/components/aico-page-content2.js +7 -5
  163. package/dist/components/aico-page-content2.js.map +1 -1
  164. package/dist/components/aico-special-news-carousel.js +5 -3
  165. package/dist/components/aico-special-news-carousel.js.map +1 -1
  166. package/dist/components/aico-table-content2.js +10 -7
  167. package/dist/components/aico-table-content2.js.map +1 -1
  168. package/dist/components/aico-text-content2.js +10 -13
  169. package/dist/components/aico-text-content2.js.map +1 -1
  170. package/dist/components/aico-title-content2.js +7 -4
  171. package/dist/components/aico-title-content2.js.map +1 -1
  172. package/dist/components/aico-upload-content2.js +6 -3
  173. package/dist/components/aico-upload-content2.js.map +1 -1
  174. package/dist/components/aico-video-content2.js +6 -3
  175. package/dist/components/aico-video-content2.js.map +1 -1
  176. package/dist/components/utils.js +19 -5
  177. package/dist/components/utils.js.map +1 -1
  178. package/dist/esm/aico-album-content_19.entry.js +78 -57
  179. package/dist/esm/aico-album-content_19.entry.js.map +1 -1
  180. package/dist/esm/aico-article-detail.entry.js +19 -18
  181. package/dist/esm/aico-article-detail.entry.js.map +1 -1
  182. package/dist/esm/aico-asking-list-content.entry.js +1 -1
  183. package/dist/esm/aico-collection-content.entry.js +1 -1
  184. package/dist/esm/aico-components.js +3 -3
  185. package/dist/esm/aico-fetch-article-detail.entry.js +12 -3
  186. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  187. package/dist/esm/aico-news-list-item.entry.js +6 -3
  188. package/dist/esm/aico-news-list-item.entry.js.map +1 -1
  189. package/dist/esm/aico-news-list.entry.js +9 -8
  190. package/dist/esm/aico-news-list.entry.js.map +1 -1
  191. package/dist/esm/aico-no-content_2.entry.js +6 -4
  192. package/dist/esm/aico-no-content_2.entry.js.map +1 -1
  193. package/dist/esm/aico-special-news-carousel.entry.js +5 -4
  194. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  195. package/dist/esm/{index-f9f11572.js → index-4621a8ba.js} +2 -6
  196. package/dist/esm/index-4621a8ba.js.map +1 -0
  197. package/dist/esm/loader.js +3 -3
  198. package/dist/esm/{utils-2b7ec879.js → utils-b4eec8e9.js} +20 -6
  199. package/dist/esm/utils-b4eec8e9.js.map +1 -0
  200. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
  201. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +15 -1
  202. package/dist/types/components/aico-news-list/aico-news-list.d.ts +2 -1
  203. package/dist/types/components/aico-news-list/aico-news-list.stories.d.ts +2 -1
  204. package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +1 -1
  205. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
  206. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
  207. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
  208. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
  209. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
  210. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
  211. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
  212. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
  213. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
  214. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
  215. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
  216. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
  217. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
  218. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
  219. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
  220. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
  221. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
  222. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
  223. package/dist/types/components.d.ts +62 -19
  224. package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
  225. package/dist/types/utils/utils.d.ts +3 -2
  226. package/package.json +3 -2
  227. package/dist/aico-components/p-2aae1a0e.js +0 -3
  228. package/dist/aico-components/p-31666f10.js +0 -2
  229. package/dist/aico-components/p-31666f10.js.map +0 -1
  230. package/dist/aico-components/p-42b98baf.entry.js +0 -2
  231. package/dist/aico-components/p-42b98baf.entry.js.map +0 -1
  232. package/dist/aico-components/p-54708dd0.entry.js +0 -2
  233. package/dist/aico-components/p-54708dd0.entry.js.map +0 -1
  234. package/dist/aico-components/p-776352ba.entry.js +0 -2
  235. package/dist/aico-components/p-776352ba.entry.js.map +0 -1
  236. package/dist/aico-components/p-7c05cd02.entry.js +0 -2
  237. package/dist/aico-components/p-7c05cd02.entry.js.map +0 -1
  238. package/dist/aico-components/p-83655dd4.entry.js +0 -2
  239. package/dist/aico-components/p-83655dd4.entry.js.map +0 -1
  240. package/dist/aico-components/p-a58972e9.entry.js.map +0 -1
  241. package/dist/aico-components/p-b0325a83.entry.js +0 -2
  242. package/dist/aico-components/p-b0325a83.entry.js.map +0 -1
  243. package/dist/aico-components/p-c99617a8.entry.js +0 -2
  244. package/dist/aico-components/p-c99617a8.entry.js.map +0 -1
  245. package/dist/cjs/bootstrap-slick-test.cjs.entry.js +0 -38
  246. package/dist/cjs/bootstrap-slick-test.cjs.entry.js.map +0 -1
  247. package/dist/cjs/index-75c0e002.js.map +0 -1
  248. package/dist/cjs/utils-406a9df3.js.map +0 -1
  249. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.css +0 -6
  250. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js +0 -37
  251. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js.map +0 -1
  252. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js +0 -6
  253. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js.map +0 -1
  254. package/dist/collection/components/content/content-styles.css +0 -113
  255. package/dist/components/bootstrap-slick-test.d.ts +0 -11
  256. package/dist/components/bootstrap-slick-test.js +0 -51
  257. package/dist/components/bootstrap-slick-test.js.map +0 -1
  258. package/dist/esm/bootstrap-slick-test.entry.js +0 -34
  259. package/dist/esm/bootstrap-slick-test.entry.js.map +0 -1
  260. package/dist/esm/index-f9f11572.js.map +0 -1
  261. package/dist/esm/utils-2b7ec879.js.map +0 -1
  262. package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.d.ts +0 -5
  263. package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.stories.d.ts +0 -5
  264. /package/dist/aico-components/{p-b78d7799.entry.js.map → p-68930822.entry.js.map} +0 -0
  265. /package/dist/aico-components/{p-1a6625c0.entry.js.map → p-90c2d3dc.entry.js.map} +0 -0
@@ -1,19 +1,20 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { c as fetchNewsArticles } from './utils.js';
2
+ import { d as fetchNewsArticles } from './utils.js';
3
3
  import { d as defineCustomElement$2 } from './aico-news-list-item2.js';
4
4
 
5
- const aicoNewsListCss = "*/\n\n\n\n\n\n\n */";
5
+ const aicoNewsListCss = "";
6
6
 
7
7
  const AicoNewsList$1 = /*@__PURE__*/ proxyCustomElement(class AicoNewsList extends HTMLElement {
8
8
  constructor() {
9
9
  super();
10
10
  this.__registerHost();
11
- this.articleClicked = createEvent(this, "articleClicked", 7);
11
+ this.articleClick = createEvent(this, "articleClick", 7);
12
12
  this.pageSize = 16;
13
13
  this.newsResponse = undefined;
14
14
  this.pageNumber = 1;
15
15
  this.aicoUrl = undefined;
16
16
  this.aicoBearerToken = undefined;
17
+ this.newsChannels = [];
17
18
  this.nextButtonText = 'Next';
18
19
  this.previousButtonText = 'Previous';
19
20
  }
@@ -26,17 +27,17 @@ const AicoNewsList$1 = /*@__PURE__*/ proxyCustomElement(class AicoNewsList exten
26
27
  this.newsListFetchController.abort('disconnected');
27
28
  }
28
29
  async componentWillLoad() {
29
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
30
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
30
31
  }
31
32
  async componentWillUpdate() {
32
33
  this.newsListFetchController = new AbortController();
33
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
34
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
34
35
  }
35
36
  render() {
36
37
  var _a, _b, _c;
37
- return (h(Host, null, h("div", { class: "axaxa row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map(article => (h("div", { class: "col" }, h("aico-news-list-item", { article: article, onArticleClicked: e => {
38
+ return (h(Host, null, h("div", { class: "row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map(article => (h("div", { class: "col" }, h("aico-news-list-item", { article: article, onArticleClick: e => {
38
39
  var _a;
39
- (_a = this.articleClicked) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
40
+ (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
40
41
  } }))))), h("nav", { class: "w-100", "aria-label": "News navigation" }, h("ul", { class: "pagination justify-content-center" }, h("li", { class: `page-item page-link user-select-none d-flex align-items-center ${!((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.links.prev) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
41
42
  if (this.pageNumber > 1) {
42
43
  this.pageNumber -= 1;
@@ -86,6 +87,7 @@ const AicoNewsList$1 = /*@__PURE__*/ proxyCustomElement(class AicoNewsList exten
86
87
  }, [2, "aico-news-list", {
87
88
  "aicoUrl": [1, "aico-url"],
88
89
  "aicoBearerToken": [1, "aico-bearer-token"],
90
+ "newsChannels": [16],
89
91
  "nextButtonText": [1, "next-button-text"],
90
92
  "previousButtonText": [1, "previous-button-text"],
91
93
  "newsResponse": [32],
@@ -1 +1 @@
1
- {"file":"aico-news-list.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,qBAAqB;;MCWhCA,cAAY;;;;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;8BAMU,MAAM;kCAEF,UAAU;;IAO/C,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UA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ACrD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACpB;SACF;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YACnF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoNewsList"],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["/* :host { */\n/* display: block; */\n/* } */\n/**/\n/* .grid-wrapper { */\n/* display: grid; */\n/* height: 100%; */\n/* width: 100%; */\n/* justify-items: center; */\n/* align-items: stretch; */\n/* grid-template-columns: repeat(4, minmax(auto, 1fr)); */\n/* grid-auto-rows: minmax(0, 1fr); */\n/* grid-gap: 10px; */\n/* } */\n/**/\n/* .navigation-wrapper { */\n/* display: flex; */\n/* justify-content: space-around; */\n/* justify-items: center; */\n/* align-content: center; */\n/* } */\n/**/\n/* .navigation-button { */\n/* display: inline-block; */\n/* outline: none; */\n/* cursor: pointer; */\n/* font-size: 14px; */\n/* padding: 0 12px; */\n/* line-height: 20px; */\n/* height: 30px; */\n/* max-height: 30px; */\n/* background: none; */\n/* font-weight: 700; */\n/* border: 0; */\n/* border-radius: 0; */\n/* color: #9ca3af; */\n/* transition-timing-function: ease-in-out; */\n/* transition-property: background; */\n/* transition-duration: 150ms; */\n/* box-shadow: none; */\n/* &:enabled &:hover { */\n/* color: #374151; */\n/* } */\n/* } */\n/**/\n/* .navigation-pages { */\n/* display: inline-flex; */\n/* list-style-type: none; */\n/* margin: 0; */\n/* padding: 0; */\n/* margin-left: -1px; */\n/* font-size: 14px; */\n/* line-height: 20px; */\n/* } */\n/**/\n/* .navigation-pages > li { */\n/* display: flex; */\n/* padding-left: 12px; */\n/* padding-right: 12px; */\n/* justify-content: center; */\n/* align-items: center; */\n/* border-width: 1px; */\n/* border-color: #d1d5db; */\n/* border-radius: 8px; */\n/* height: 2rem; */\n/* line-height: 1.25; */\n/* color: #6b7280; */\n/* background-color: #ffffff; */\n/* } */\n/**/\n/* .navigation-pages > li.page-number { */\n/* cursor: pointer; */\n/* &:hover { */\n/* color: #374151; */\n/* background-color: #f3f4f6; */\n/* } */\n/* } */\n/**/\n/* .navigation-pages > li.page-selected { */\n/* display: flex; */\n/* padding-left: 12px; */\n/* padding-right: 12px; */\n/* justify-content: center; */\n/* align-items: center; */\n/* border-width: 1px; */\n/* border-color: #d1d5db; */\n/* border-radius: 8px; */\n/* height: 2rem; */\n/* color: #2563eb; */\n/* background-color: #eff6ff; */\n/**/\n/* &:hover { */\n/* color: #1d4ed8; */\n/* background-color: #dbeafe; */\n/* } */\n/* } */\n/**/\n/* /* Tablet */ */\n/* @media only screen and (min-width: 768px) and (max-width: 1023px) { */\n/* .grid-wrapper { */\n/* grid-template-columns: repeat(2, minmax(auto, 1fr)); */\n/* } */\n/* } */\n/**/\n/* /* Mobile */ */\n/* @media only screen and (max-width: 767px) { */\n/* .grid-wrapper { */\n/* grid-template-columns: minmax(auto, 1fr); */\n/* } */\n/* .navigation-pages { */\n/* display: none; */\n/* } */\n/* } */\n","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal);\n }\n\n render() {\n return (\n <Host>\n <div class=\"axaxa row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClicked={e => {\n this.articleClicked?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
1
+ {"file":"aico-news-list.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,EAAE;;MCWbA,cAAY;;;;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;4BAMU,EAAE;8BAEF,MAAM;kCAEF,UAAU;;IAO/C,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,uBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;KACjJ;IAED,MAAM,mBAAmB;QACvB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;KAChJ;I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-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
@@ -10,19 +10,21 @@ const AicoPageContent = /*@__PURE__*/ proxyCustomElement(class AicoPageContent e
10
10
  this.__registerHost();
11
11
  this.pageClicked = createEvent(this, "pageClicked", 7);
12
12
  this.content = undefined;
13
+ this.locale = 'de';
13
14
  }
14
15
  render() {
15
- var _a, _b, _c, _d;
16
- const translation = this.content.landingPage.translations.length > 0 ? this.content.landingPage.translations[0] : null;
17
- return (h(Host, { style: { 'max-width': '300px' } }, h("div", { class: "card pe-auto" }, h("div", { class: "ratio ratio-4x3" }, h("img", { class: "card-img-top img-fluid object-fit-cover", style: { 'object-position': 'center' }, src: (_a = this.content.landingPage.image) !== null && _a !== void 0 ? _a : 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w', alt: (_b = translation === null || translation === void 0 ? void 0 : translation.imageAlt) !== null && _b !== void 0 ? _b : 'Landing page image' })), h("div", { class: "card-body", style: { 'min-height': '6rem' } }, h("h5", { class: "card-title" }, translation === null || translation === void 0 ? void 0 : translation.name), h(ConditionalRender, { condition: this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink) }, h("a", { href: this.content.externalLink, class: "card-link" }, (_c = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _c !== void 0 ? _c : 'Navigate to page')), h(ConditionalRender, { condition: !this.content.openExternalLink }, h("a", { href: "#", class: "card-link", onClick: e => {
16
+ var _a, _b, _c, _d, _e;
17
+ const translation = (_a = this.content.landingPage.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
18
+ return (h(Host, { style: { 'max-width': '300px' } }, h("div", { class: "card pe-auto" }, h("div", { class: "ratio ratio-4x3" }, h("img", { class: "card-img-top img-fluid object-fit-cover", style: { 'object-position': 'center' }, src: (_b = this.content.landingPage.image) !== null && _b !== void 0 ? _b : 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w', alt: (_c = translation === null || translation === void 0 ? void 0 : translation.imageAlt) !== null && _c !== void 0 ? _c : 'Landing page image' })), h("div", { class: "card-body", style: { 'min-height': '6rem' } }, h("h5", { class: "card-title" }, translation === null || translation === void 0 ? void 0 : translation.name), h(ConditionalRender, { condition: this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink) }, h("a", { href: this.content.externalLink, class: "card-link" }, (_d = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _d !== void 0 ? _d : 'Navigate to page')), h(ConditionalRender, { condition: !this.content.openExternalLink }, h("a", { href: "#", class: "card-link", onClick: e => {
18
19
  var _a;
19
20
  e.preventDefault();
20
21
  (_a = this.pageClicked) === null || _a === void 0 ? void 0 : _a.emit(this.content);
21
- } }, (_d = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _d !== void 0 ? _d : 'Navigate to page'))), h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt) }, h("div", { class: "card-footer" }, h("small", { class: "text-muted" }, translation === null || translation === void 0 ? void 0 : translation.excerpt))))));
22
+ } }, (_e = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _e !== void 0 ? _e : 'Navigate to page'))), h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt) }, h("div", { class: "card-footer" }, h("small", { class: "text-muted" }, translation === null || translation === void 0 ? void 0 : translation.excerpt))))));
22
23
  }
23
24
  static get style() { return aicoPageContentCss; }
24
25
  }, [2, "aico-page-content", {
25
- "content": [16]
26
+ "content": [16],
27
+ "locale": [1]
26
28
  }]);
27
29
  function defineCustomElement() {
28
30
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-page-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,wCAAwC;;MCUtD,eAAe;;;;;;;IAK1B,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QACvH,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,IACnC,WAAK,KAAK,EAAC,cAAc,IACvB,WAAK,KAAK,EAAC,iBAAiB,IAC1B,WACE,KAAK,EAAC,yCAAyC,EAC/C,KAAK,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EACtC,GAAG,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,mCAAI,oGAAoG,EAC3I,GAAG,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,mCAAI,oBAAoB,GAClD,CACE,EACN,WAAK,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,IACpD,UAAI,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAM,EAC/C,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IACrH,SAAG,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAa,EAAE,KAAK,EAAC,WAAW,IACnD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,EACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAC1D,SACE,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,CAAC;;gBACR,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACtC,IAEA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,CAChB,EACN,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,IACtG,WAAK,KAAK,EAAC,aAAa,IACtB,aAAO,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-page-content/aico-page-content.css?tag=aico-page-content&encapsulation=scoped","src/components/content/aico-page-content/aico-page-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-page-content',\n styleUrl: 'aico-page-content.css',\n scoped: true,\n})\nexport class AicoPageContent {\n @Prop() content!: PageContent;\n\n @Event() pageClicked?: EventEmitter<PageContent>;\n\n render() {\n const translation = this.content.landingPage.translations.length > 0 ? this.content.landingPage.translations[0] : null;\n return (\n <Host style={{ 'max-width': '300px' }}>\n <div class=\"card pe-auto\">\n <div class=\"ratio ratio-4x3\">\n <img\n class=\"card-img-top img-fluid object-fit-cover\"\n style={{ 'object-position': 'center' }}\n src={this.content.landingPage.image ?? 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w'}\n alt={translation?.imageAlt ?? 'Landing page image'}\n />\n </div>\n <div class=\"card-body\" style={{ 'min-height': '6rem' }}>\n <h5 class=\"card-title\">{translation?.name}</h5>\n <ConditionalRender condition={this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink)}>\n <a href={this.content.externalLink!} class=\"card-link\">\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.openExternalLink}>\n <a\n href=\"#\"\n class=\"card-link\"\n onClick={e => {\n e.preventDefault();\n this.pageClicked?.emit(this.content);\n }}\n >\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n </div>\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt)}>\n <div class=\"card-footer\">\n <small class=\"text-muted\">{translation?.excerpt}</small>\n </div>\n </ConditionalRender>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-page-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,wCAAwC;;MCUtD,eAAe;;;;;;sBAGD,IAAI;;IAI7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC1H,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,IACnC,WAAK,KAAK,EAAC,cAAc,IACvB,WAAK,KAAK,EAAC,iBAAiB,IAC1B,WAC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,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-page-content/aico-page-content.css?tag=aico-page-content&encapsulation=scoped","src/components/content/aico-page-content/aico-page-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-page-content',\n styleUrl: 'aico-page-content.css',\n scoped: true,\n})\nexport class AicoPageContent {\n @Prop() content!: PageContent;\n\n @Prop() locale: string = 'de';\n\n @Event() pageClicked?: EventEmitter<PageContent>;\n\n render() {\n const translation = this.content.landingPage.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <Host style={{ 'max-width': '300px' }}>\n <div class=\"card pe-auto\">\n <div class=\"ratio ratio-4x3\">\n <img\n class=\"card-img-top img-fluid object-fit-cover\"\n style={{ 'object-position': 'center' }}\n src={this.content.landingPage.image ?? 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w'}\n alt={translation?.imageAlt ?? 'Landing page image'}\n />\n </div>\n <div class=\"card-body\" style={{ 'min-height': '6rem' }}>\n <h5 class=\"card-title\">{translation?.name}</h5>\n <ConditionalRender condition={this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink)}>\n <a href={this.content.externalLink!} class=\"card-link\">\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.openExternalLink}>\n <a\n href=\"#\"\n class=\"card-link\"\n onClick={e => {\n e.preventDefault();\n this.pageClicked?.emit(this.content);\n }}\n >\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n </div>\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt)}>\n <div class=\"card-footer\">\n <small class=\"text-muted\">{translation?.excerpt}</small>\n </div>\n </ConditionalRender>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { d as fetchSpecialNewsArticles } from './utils.js';
2
+ import { e as fetchSpecialNewsArticles } from './utils.js';
3
3
  import { j as jquery } from './slick.js';
4
4
 
5
5
  const aicoSpecialNewsCarouselCss = ".slick-slide.sc-aico-special-news-carousel>div.sc-aico-special-news-carousel{height:100% !important}";
@@ -12,6 +12,7 @@ const AicoSpecialNewsCarousel$1 = /*@__PURE__*/ proxyCustomElement(class AicoSpe
12
12
  this.newsResponse = undefined;
13
13
  this.aicoUrl = undefined;
14
14
  this.aicoBearerToken = undefined;
15
+ this.newsChannels = [];
15
16
  this.numberOfArticles = 6;
16
17
  }
17
18
  connectedCallback() {
@@ -22,11 +23,11 @@ const AicoSpecialNewsCarousel$1 = /*@__PURE__*/ proxyCustomElement(class AicoSpe
22
23
  this.newsListFetchController.abort('disconnected');
23
24
  }
24
25
  async componentWillLoad() {
25
- this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
26
+ this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
26
27
  }
27
28
  async componentWillUpdate() {
28
29
  this.newsListFetchController = new AbortController();
29
- this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
30
+ this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
30
31
  }
31
32
  componentDidLoad() {
32
33
  jquery('.carousel').slick({
@@ -53,6 +54,7 @@ const AicoSpecialNewsCarousel$1 = /*@__PURE__*/ proxyCustomElement(class AicoSpe
53
54
  }, [2, "aico-special-news-carousel", {
54
55
  "aicoUrl": [1, "aico-url"],
55
56
  "aicoBearerToken": [1, "aico-bearer-token"],
57
+ "newsChannels": [16],
56
58
  "numberOfArticles": [2, "number-of-articles"],
57
59
  "newsResponse": [32]
58
60
  }]);
@@ -1 +1 @@
1
- {"file":"aico-special-news-carousel.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5HA,yBAAuB;;;;;;;;gCAOC,CAAC;;IAOpC,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,uBAAwB,CAAC,MAAM,CAAC,CAAC;KAC/H;IAED,MAAM,mBAAmB;QACvB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;KAC9H;IAED,gBAAgB;QACdC,MAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,KAAK;YACb,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;KACJ;IAED,MAAM;QACJ,QACE,WAAK,KAAK,EAAC,UAAU,IAClB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO;;YACjC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,QAAQ,CAAC;YAC1G,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,QAAQ,CAAC;YAC1G,QACE,WAAK,KAAK,EAAC,6BAA6B,IACtC,WAAK,KAAK,EAAC,WAAW,IACpB,UAAI,KAAK,EAAC,uCAAuC,IAC/C,SACE,KAAK,EAAC,iCAAiC,EACvC,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,CAAC;;oBACR,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,MAAA,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;iBACpC,IAEA,OAAO,CAAC,UAAU,CAAC,IAAI,CACtB,CACD,CACD,EACN,WAAK,KAAK,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IACjE,WACE,KAAK,EAAC,kCAAkC,EACxC,KAAK,EAAE,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eACP,MAAA,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,OAAO,CAAC,UAAU,CAAC,KAAK,GACxE,CACE,CACF,EACN;SACH,CAAC,CACE,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoSpecialNewsCarousel","$"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController.signal);\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-special-news-carousel.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5HA,yBAAuB;;;;;;;;4BAOD,EAAE;gCAEA,CAAC;;IAOpC,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,uBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;KAClJ;IAED,MAAM,mBAAmB;QACvB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;KACjJ;IAED,gBAAgB;QACdC,MAAC,CAAC,WAAW,CAAC,CAAC,KAAK,C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;;;;;;;;;;;;","names":["AicoSpecialNewsCarousel","$"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}
@@ -10,17 +10,19 @@ const AicoTableContent = /*@__PURE__*/ proxyCustomElement(class AicoTableContent
10
10
  super();
11
11
  this.__registerHost();
12
12
  this.content = undefined;
13
+ this.locale = 'de';
13
14
  }
14
15
  render() {
15
- var _a, _b;
16
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
17
- const firstBackgroundColor = (_a = this.content.firstColor) !== null && _a !== void 0 ? _a : '#d6dfe1';
18
- const secondBackgroundColor = (_b = this.content.secondColor) !== null && _b !== void 0 ? _b : '#e6eced';
19
- return (h("div", { class: "content-table card" }, h("div", { class: "card-body" }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { class: "card-title mt-0", content: this.makeTitleContent(translation) }), h("p", { class: "card-text" }, translation.additionalText)), h("table", { class: "table-content" }, this.content.tableRows
16
+ var _a, _b, _c;
17
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
18
+ const firstBackgroundColor = (_b = this.content.firstColor) !== null && _b !== void 0 ? _b : '#d6dfe1';
19
+ const secondBackgroundColor = (_c = this.content.secondColor) !== null && _c !== void 0 ? _c : '#e6eced';
20
+ return (h("div", { class: "content-table card" }, h("div", { class: "card-body" }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { class: "card-title mt-0", content: this.makeTitleContent(translation), locale: this.locale }), h("p", { class: "card-text" }, translation.additionalText)), h("table", { class: "table-content" }, this.content.tableRows
20
21
  .sort((a, b) => a.sort - b.sort)
21
22
  .map((row, index) => {
22
23
  return (h("tr", { style: { 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor } }, row.rowColumns.map(col => {
23
- const translation = col.translations.length > 0 ? col.translations[0] : null;
24
+ var _a;
25
+ const translation = (_a = col.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
24
26
  if (!translation) {
25
27
  return row.isHeading ? h("th", null) : h("td", null);
26
28
  }
@@ -41,7 +43,8 @@ const AicoTableContent = /*@__PURE__*/ proxyCustomElement(class AicoTableContent
41
43
  }
42
44
  static get style() { return aicoTableContentCss; }
43
45
  }, [2, "aico-table-content", {
44
- "content": [16]
46
+ "content": [16],
47
+ "locale": [1]
45
48
  }]);
46
49
  function defineCustomElement() {
47
50
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-table-content2.js","mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,shBAAshB;;MCWriB,gBAAgB;;;;;;IAG3B,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAE/F,MAAM,oBAAoB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,mCAAI,SAAS,CAAC;QAClE,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,mCAAI,SAAS,CAAC;QAEpE,QACE,WAAK,KAAK,EAAC,oBAAoB,IAC7B,WAAK,KAAK,EAAC,WAAW,IACpB,EAAC,iBAAiB,IAAC,SAA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AAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-table-content/aico-table-content.css?tag=aico-table-content&encapsulation=scoped","src/components/content/aico-table-content/aico-table-content.tsx"],"sourcesContent":[".table-content {\n width: 100%;\n overflow-x: auto;\n white-space: nowrap;\n text-align: center;\n}\n\n.table-content:not([class]) td,\n.table-content:not([class]) th {\n padding: 10px !important;\n border: none !important;\n}\n\n.table-content th {\n font-weight: 700 !important;\n}\n\n.table-content td,\n.table-content th {\n white-space: pre-line;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-table-content',\n styleUrl: 'aico-table-content.css',\n scoped: true,\n})\nexport class AicoTableContent {\n @Prop() content!: TableContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n\n const firstBackgroundColor = this.content.firstColor ?? '#d6dfe1';\n const secondBackgroundColor = this.content.secondColor ?? '#e6eced';\n\n return (\n <div class=\"content-table card\">\n <div class=\"card-body\">\n <ConditionalRender condition={translation !== null}>\n <aico-title-content class=\"card-title mt-0\" content={this.makeTitleContent(translation!)} />\n <p class=\"card-text\">{translation!.additionalText}</p>\n </ConditionalRender>\n <table class=\"table-content\">\n {this.content.tableRows\n .sort((a, b) => a.sort - b.sort)\n .map((row, index) => {\n return (\n <tr style={{ 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor }}>\n {row.rowColumns.map(col => {\n const translation = col.translations.length > 0 ? col.translations[0] : null;\n if (!translation) {\n return row.isHeading ? <th></th> : <td></td>;\n }\n\n return row.isHeading ? <th>{translation.columnData}</th> : <td>{translation.columnData}</td>;\n })}\n </tr>\n );\n })}\n </table>\n </div>\n </div>\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"],"version":3}
1
+ {"file":"aico-table-content2.js","mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,shBAAshB;;MCWriB,gBAAgB;;;;;sBAGF,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAE9G,MAAM,oBAAoB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,mCAAI,SAAS,CAAC;QAClE,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,mCAAI,SAAS,CAAC;QAEpE,QACE,WAAK,KAAK,EAAC,oBAAoB,IAC7B,WAAK,KAAK,EAAC,WAAW,IACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAChD,0BAAoB,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,EACjH,SAAG,KAAK,EAAC,WAAW,IAAE,WAAY,CAAC,cAAc,CAAK,CACpC,EACpB,aAAO,KAAK,EAAC,eAAe,IACzB,IAAI,CAAC,OAAO,CAAC,SAAS;aACpB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;aAC/B,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK;YACd,QACE,UAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,oBAAoB,GAAG,qBAAqB,EAAE,IACpH,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG;;gBACrB,MAAM,WAAW,GAAG,MAAA,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;gBACrG,IAAI,CAAC,WAAW,EAAE;oBAChB,OAAO,GAAG,CAAC,SAAS,GAAG,aAAS,GAAG,aAAS,CAAC;iBAC9C;gBAED,OAAO,GAAG,CAAC,SAAS,GAAG,cAAK,WAAW,CAAC,UAAU,CAAM,GAAG,cAAK,WAAW,CAAC,UAAU,CAAM,CAAC;aAC9F,CAAC,CACC,EACL;SACH,CAAC,CACE,CACJ,CACF,EACN;KACH;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;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-table-content/aico-table-content.css?tag=aico-table-content&encapsulation=scoped","src/components/content/aico-table-content/aico-table-content.tsx"],"sourcesContent":[".table-content {\n width: 100%;\n overflow-x: auto;\n white-space: nowrap;\n text-align: center;\n}\n\n.table-content:not([class]) td,\n.table-content:not([class]) th {\n padding: 10px !important;\n border: none !important;\n}\n\n.table-content th {\n font-weight: 700 !important;\n}\n\n.table-content td,\n.table-content th {\n white-space: pre-line;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-table-content',\n styleUrl: 'aico-table-content.css',\n scoped: true,\n})\nexport class AicoTableContent {\n @Prop() content!: TableContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n const firstBackgroundColor = this.content.firstColor ?? '#d6dfe1';\n const secondBackgroundColor = this.content.secondColor ?? '#e6eced';\n\n return (\n <div class=\"content-table card\">\n <div class=\"card-body\">\n <ConditionalRender condition={translation !== null}>\n <aico-title-content class=\"card-title mt-0\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n <p class=\"card-text\">{translation!.additionalText}</p>\n </ConditionalRender>\n <table class=\"table-content\">\n {this.content.tableRows\n .sort((a, b) => a.sort - b.sort)\n .map((row, index) => {\n return (\n <tr style={{ 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor }}>\n {row.rowColumns.map(col => {\n const translation = col.translations.find(translation => translation.locale === this.locale) ?? null;\n if (!translation) {\n return row.isHeading ? <th></th> : <td></td>;\n }\n\n return row.isHeading ? <th>{translation.columnData}</th> : <td>{translation.columnData}</td>;\n })}\n </tr>\n );\n })}\n </table>\n </div>\n </div>\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"],"version":3}
@@ -11,24 +11,20 @@ const ConditionalWrap = ({ condition, wrap }, children) => {
11
11
 
12
12
  const aicoTextContentCss = "";
13
13
 
14
- const contentStylesCss = ".so-tab.sc-aico-text-content{position:relative;width:100%;margin:10px 0}.so-tab.sc-aico-text-content label.sc-aico-text-content{position:relative;display:block;padding:0 25px 0 0;line-height:normal;cursor:pointer}.so-tab.sc-aico-text-content input.sc-aico-text-content{position:absolute;opacity:0;z-index:-1}.so-tab-content.sc-aico-text-content{max-height:0;overflow:hidden;transition:max-height 0.35s;line-height:1.2;font-size:15px}.so-tab.sc-aico-text-content input.sc-aico-text-content:checked~.so-tab-content.sc-aico-text-content{max-height:none}.so-tab.sc-aico-text-content label.sc-aico-text-content::before{position:absolute;top:0;left:0;display:inline-block;-webkit-transition:all 0.35s;-o-transition:all 0.35s;transition:all 0.35s}.so-tab.sc-aico-text-content label.sc-aico-text-content{font-size:15px}.so-tab.sc-aico-text-content input[type='checkbox'].sc-aico-text-content+label.sc-aico-text-content::before{content:'+';font-size:14px;font-weight:bold;line-height:0.6;color:#637381;width:15px;height:15px;position:absolute;overflow:visible;text-align:center;top:2px;padding-top:2px;padding-left:10px;left:-10px}.so-tab.sc-aico-text-content input[type='radio'].sc-aico-text-content+label.sc-aico-text-content::before{content:'\\25B3'}.so-tab.sc-aico-text-content input[type='checkbox'].sc-aico-text-content:checked+label.sc-aico-text-content::before{transform:rotate(315deg);line-height:0.5 !important}.so-tab.sc-aico-text-content input[type='radio'].sc-aico-text-content:checked+label.sc-aico-text-content::before{transform:rotateX(180deg)}blockquote.sc-aico-text-content::before{content:open-quote;font-weight:bold;font-size:100px;position:absolute;top:-75px;left:-50px;height:50px;width:50px}blockquote.sc-aico-text-content::after{content:close-quote;font-weight:bold;font-size:100px;position:absolute;bottom:15px;right:-50px;height:50px;width:50px}blockquote.sc-aico-text-content{quotes:'\\201C''\\201D''\\2018''\\2019';position:relative;border:none;font-family:'Tusker Grotesk 6500', serif}@media screen and (max-width: 768px){.content-column.sc-aico-text-content{width:100% !important;margin:0 auto !important}}";
15
-
16
14
  const AicoTextContent = /*@__PURE__*/ proxyCustomElement(class AicoTextContent extends HTMLElement {
17
15
  constructor() {
18
16
  super();
19
17
  this.__registerHost();
20
18
  this.content = undefined;
19
+ this.locale = 'de';
21
20
  }
22
21
  render() {
23
- var _a, _b, _c;
24
- if (this.content.translations.length === 0) {
25
- return h("aico-no-content", null);
26
- }
27
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
22
+ var _a, _b, _c, _d;
23
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
28
24
  const contentStyles = {};
29
25
  if (this.content.hasBackgroundColor) {
30
- contentStyles['background-color'] = (_a = this.content.backgroundColor) !== null && _a !== void 0 ? _a : 'white';
31
- contentStyles['color'] = (_b = this.content.textColor) !== null && _b !== void 0 ? _b : 'black';
26
+ contentStyles['background-color'] = (_b = this.content.backgroundColor) !== null && _b !== void 0 ? _b : 'white';
27
+ contentStyles['color'] = (_c = this.content.textColor) !== null && _c !== void 0 ? _c : 'black';
32
28
  contentStyles['width'] = '100%';
33
29
  contentStyles['padding'] = '15px';
34
30
  contentStyles['margin-top'] = '10px';
@@ -39,9 +35,9 @@ const AicoTextContent = /*@__PURE__*/ proxyCustomElement(class AicoTextContent e
39
35
  }
40
36
  if (this.content.alignmentEnabled) {
41
37
  contentStyles['display'] = 'flex';
42
- contentStyles['align-items'] = (_c = this.content.verticalAlign) !== null && _c !== void 0 ? _c : 'flex-start';
38
+ contentStyles['align-items'] = (_d = this.content.verticalAlign) !== null && _d !== void 0 ? _d : 'flex-start';
43
39
  }
44
- return (h(ConditionalRender, { condition: translation !== null }, h(ConditionalWrap, { condition: !strIsNullOrEmptyOrWhitespace(translation.promptText), wrap: children => (h("div", { class: "accordion", id: "aico-text-content" }, h("div", { class: "accordion-item" }, h("h2", { class: "accordion-header", id: "heading" }, h("button", { class: "accordion-button collapsed", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse", "aria-expanded": "false", "aria-controls": "collapse" }, translation.promptText)), h("div", { id: "collapse", class: "accordion-collapse collapse", "aria-labelledby": "heading", "data-bs-parent": "#aico-text-content" }, h("div", { class: "accordion-body" }, children))))) }, h("div", { class: "card", style: contentStyles }, h("div", { class: "card-body w-100 border-0" }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation) }), h(ConditionalRender, { condition: this.shouldDisplayTextAndPicture(translation) }, h("div", { class: "row g-4" }, h("div", { class: getClass({
40
+ return (h(ConditionalRender, { condition: translation !== null }, h(ConditionalWrap, { condition: !strIsNullOrEmptyOrWhitespace(translation.promptText), wrap: children => (h("div", { class: "accordion", id: "aico-text-content" }, h("div", { class: "accordion-item" }, h("h2", { class: "accordion-header", id: "heading" }, h("button", { class: "accordion-button collapsed", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse", "aria-expanded": "false", "aria-controls": "collapse" }, translation.promptText)), h("div", { id: "collapse", class: "accordion-collapse collapse", "aria-labelledby": "heading", "data-bs-parent": "#aico-text-content" }, h("div", { class: "accordion-body" }, children))))) }, h("div", { class: "card", style: contentStyles }, h("div", { class: "card-body w-100 border-0" }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation), locale: this.locale }), h(ConditionalRender, { condition: this.shouldDisplayTextAndPicture(translation) }, h("div", { class: "row g-4" }, h("div", { class: getClass({
45
41
  'col-md-8': true,
46
42
  'order-1': this.content.picturePosition === 'right',
47
43
  'order-2': this.content.picturePosition === 'left',
@@ -94,9 +90,10 @@ const AicoTextContent = /*@__PURE__*/ proxyCustomElement(class AicoTextContent e
94
90
  shouldDisplayOnlyText(translation) {
95
91
  return !strIsNullOrEmptyOrWhitespace(translation.text) && strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) && strIsNullOrEmptyOrWhitespace(translation.picture);
96
92
  }
97
- static get style() { return aicoTextContentCss + contentStylesCss; }
93
+ static get style() { return aicoTextContentCss; }
98
94
  }, [2, "aico-text-content", {
99
- "content": [16]
95
+ "content": [16],
96
+ "locale": [1]
100
97
  }]);
101
98
  function defineCustomElement() {
102
99
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-text-content2.js","mappings":";;;;;;;AAOA,MAAM,eAAe,GAA8C,CAAC,EAA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W,CAAC,OAAO,CAAC,CAAC,CAAC;KAC9K;IAEO,qBAAqB,CAAC,WAAmC;QAC/D,OAAO,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC3K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/ConditionalWrap.tsx","src/components/content/aico-text-content/aico-text-content.css?tag=aico-text-content&encapsulation=scoped","src/components/content/content-styles.css?tag=aico-text-content&encapsulation=scoped","src/components/content/aico-text-content/aico-text-content.tsx"],"sourcesContent":["import { FunctionalComponent, VNode } from '@stencil/core';\n\nexport type ConditionalWrapProps = {\n condition: boolean;\n wrap: (children: VNode | VNode[]) => VNode;\n};\n\nconst ConditionalWrap: FunctionalComponent<ConditionalWrapProps> = ({ condition, wrap }, children) => {\n return condition ? wrap(children) : children;\n};\n\nexport default ConditionalWrap;\n","",".so-tab {\n position: relative;\n width: 100%;\n margin: 10px 0;\n}\n\n.so-tab label {\n position: relative;\n display: block;\n padding: 0 25px 0 0;\n line-height: normal;\n cursor: pointer;\n}\n\n.so-tab input {\n position: absolute;\n opacity: 0;\n z-index: -1;\n}\n\n.so-tab-content {\n max-height: 0;\n overflow: hidden;\n transition: max-height 0.35s;\n line-height: 1.2;\n font-size: 15px;\n}\n\n/* :checked */\n.so-tab input:checked ~ .so-tab-content {\n max-height: none;\n}\n\n/* Icon */\n.so-tab label::before {\n position: absolute;\n top: 0;\n left: 0;\n display: inline-block;\n -webkit-transition: all 0.35s;\n -o-transition: all 0.35s;\n transition: all 0.35s;\n}\n\n.so-tab label {\n font-size: 15px;\n}\n\n.so-tab input[type='checkbox'] + label::before {\n content: '+';\n font-size: 14px;\n font-weight: bold;\n line-height: 0.6;\n color: #637381;\n width: 15px;\n height: 15px;\n position: absolute;\n overflow: visible;\n text-align: center;\n top: 2px;\n padding-top: 2px;\n padding-left: 10px;\n left: -10px;\n}\n\n.so-tab input[type='radio'] + label::before {\n content: '\\25B3';\n}\n\n.so-tab input[type='checkbox']:checked + label::before {\n transform: rotate(315deg);\n line-height: 0.5 !important;\n}\n\n.so-tab input[type='radio']:checked + label::before {\n transform: rotateX(180deg);\n}\n\nblockquote::before {\n content: open-quote;\n font-weight: bold;\n font-size: 100px;\n position: absolute;\n top: -75px;\n left: -50px;\n height: 50px;\n width: 50px;\n}\n\nblockquote::after {\n content: close-quote;\n font-weight: bold;\n font-size: 100px;\n position: absolute;\n bottom: 15px;\n right: -50px;\n height: 50px;\n width: 50px;\n}\n\nblockquote {\n quotes: '\\201C''\\201D''\\2018''\\2019';\n position: relative;\n border: none;\n font-family: 'Tusker Grotesk 6500', serif;\n}\n\n@media screen and (max-width: 768px) {\n .content-column {\n width: 100% !important;\n margin: 0 auto !important;\n }\n}\n","import { Component, Prop, VNode, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport ConditionalWrap from '../../../utils/ConditionalWrap';\nimport type { TextContent, TextContentTranslation } from '../../../model/article/content/TextContent';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport { getClass, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport 'bootstrap';\n\n@Component({\n tag: 'aico-text-content',\n styleUrls: ['aico-text-content.css', '../content-styles.css'],\n scoped: true,\n})\nexport class AicoTextContent {\n @Prop() content!: TextContent;\n\n render() {\n if (this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const contentStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.hasBackgroundColor) {\n contentStyles['background-color'] = this.content.backgroundColor ?? 'white';\n contentStyles['color'] = this.content.textColor ?? 'black';\n contentStyles['width'] = '100%';\n contentStyles['padding'] = '15px';\n contentStyles['margin-top'] = '10px';\n }\n\n if (this.content.addBorder) {\n contentStyles['border'] = `3px solid ${this.content.borderColor}`;\n contentStyles['margin-top'] = '-3px';\n }\n\n if (this.content.alignmentEnabled) {\n contentStyles['display'] = 'flex';\n contentStyles['align-items'] = this.content.verticalAlign ?? 'flex-start';\n }\n\n return (\n <ConditionalRender condition={translation !== null}>\n <ConditionalWrap\n condition={!strIsNullOrEmptyOrWhitespace(translation!.promptText)}\n wrap={children => (\n <div class=\"accordion\" id=\"aico-text-content\">\n <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id=\"heading\">\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapse\" aria-expanded=\"false\" aria-controls=\"collapse\">\n {translation!.promptText}\n </button>\n </h2>\n <div id=\"collapse\" class=\"accordion-collapse collapse\" aria-labelledby=\"heading\" data-bs-parent=\"#aico-text-content\">\n <div class=\"accordion-body\">{children}</div>\n </div>\n </div>\n </div>\n )}\n >\n <div class=\"card\" style={contentStyles}>\n <div class=\"card-body w-100 border-0\">\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} />\n <ConditionalRender condition={this.shouldDisplayTextAndPicture(translation!)}>\n <div class=\"row g-4\">\n <div\n class={getClass({\n 'col-md-8': true,\n 'order-1': this.content.picturePosition === 'right',\n 'order-2': this.content.picturePosition === 'left',\n })}\n >\n {this.getTextComponent(translation!)}\n </div>\n <div\n class={getClass({\n 'col-md-4 justify-content-center': true,\n 'order-2': this.content.picturePosition === 'right',\n 'order-1': this.content.picturePosition === 'left',\n })}\n >\n {this.getImageComponent(translation!)}\n </div>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyPicture(translation!)}>{this.getImageComponent(translation!)}</ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyText(translation!)}>{this.getTextComponent(translation!)}</ConditionalRender>\n </div>\n </div>\n </ConditionalWrap>\n </ConditionalRender>\n );\n }\n\n private getImageComponent(translation: TextContentTranslation): VNode {\n const imageStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.focusXPercentage && this.content.focusYCoordinate) {\n imageStyles['object-position'] = `${this.content.focusXPercentage}% ${this.content.focusYPercentage}%`;\n }\n\n return (\n <div class=\"card text-bg-dark text-white\">\n <img class=\"card-img img-fluid object-fit-contain\" src={translation.optimizedPicture ?? translation.picture} />\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation.pictureLabel)}>\n <div class=\"card-img-overlay\">\n <p\n class={getClass({\n 'card-text': true,\n 'text-end': this.content.pictureLabelPosition === 'right',\n 'text-center': this.content.pictureLabelPosition === 'center',\n })}\n >\n {translation.pictureLabel}\n </p>\n </div>\n </ConditionalRender>\n </div>\n );\n }\n\n private getTextComponent(translation: TextContentTranslation): VNode {\n const textStyles: { [key: string]: string | undefined } = { 'line-height': '1.3', 'white-space': 'pre-line' };\n if (this.content.fontSize) {\n textStyles['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n textStyles['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.shouldJustifyText) {\n textStyles['text-align'] = 'justify';\n textStyles['text-justify'] = 'inner-word';\n }\n\n return (\n <p class=\"card-text\" style={textStyles}>\n {translation.text}\n </p>\n );\n }\n\n private makeTitleContent(translation: TextContentTranslation): 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 ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n\n private shouldDisplayTextAndPicture(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyPicture(translation: TextContentTranslation): boolean {\n return strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyText(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) && strIsNullOrEmptyOrWhitespace(translation.picture);\n }\n}\n"],"version":3}
1
+ {"file":"aico-text-content2.js","mappings":";;;;;;;AAOA,MAAM,eAAe,GAA8C,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,QAAQ;IAC/F,OAAO,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAC/C,CAAC;;ACTD,MAAM,kBAAkB,GAAG,EAAE;;MCahB,eAAe;;;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,aAAa,GAA0C,EAAE,CAAC;QAEhE,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;YACnC,aAAa,CAAC,kBAAkB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,OAAO,CAAC;YAC5E,aAAa,CAAC,OAAO,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,OAAO,CAAC;YAC3D,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;YAChC,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;YAClC,aAAa,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;SACtC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YAC1B,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAClE,aAAa,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;SACtC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;YACjC,aAA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WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;KAC9K;IAEO,qBAAqB,CAAC,WAAmC;QAC/D,OAAO,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC3K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/ConditionalWrap.tsx","src/components/content/aico-text-content/aico-text-content.css?tag=aico-text-content&encapsulation=scoped","src/components/content/aico-text-content/aico-text-content.tsx"],"sourcesContent":["import { FunctionalComponent, VNode } from '@stencil/core';\n\nexport type ConditionalWrapProps = {\n condition: boolean;\n wrap: (children: VNode | VNode[]) => VNode;\n};\n\nconst ConditionalWrap: FunctionalComponent<ConditionalWrapProps> = ({ condition, wrap }, children) => {\n return condition ? wrap(children) : children;\n};\n\nexport default ConditionalWrap;\n","","import { Component, Prop, VNode, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport ConditionalWrap from '../../../utils/ConditionalWrap';\nimport type { TextContent, TextContentTranslation } from '../../../model/article/content/TextContent';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport { getClass, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport 'bootstrap';\n\n@Component({\n tag: 'aico-text-content',\n styleUrl: 'aico-text-content.css',\n scoped: true,\n})\nexport class AicoTextContent {\n @Prop() content!: TextContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const contentStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.hasBackgroundColor) {\n contentStyles['background-color'] = this.content.backgroundColor ?? 'white';\n contentStyles['color'] = this.content.textColor ?? 'black';\n contentStyles['width'] = '100%';\n contentStyles['padding'] = '15px';\n contentStyles['margin-top'] = '10px';\n }\n\n if (this.content.addBorder) {\n contentStyles['border'] = `3px solid ${this.content.borderColor}`;\n contentStyles['margin-top'] = '-3px';\n }\n\n if (this.content.alignmentEnabled) {\n contentStyles['display'] = 'flex';\n contentStyles['align-items'] = this.content.verticalAlign ?? 'flex-start';\n }\n\n return (\n <ConditionalRender condition={translation !== null}>\n <ConditionalWrap\n condition={!strIsNullOrEmptyOrWhitespace(translation!.promptText)}\n wrap={children => (\n <div class=\"accordion\" id=\"aico-text-content\">\n <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id=\"heading\">\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapse\" aria-expanded=\"false\" aria-controls=\"collapse\">\n {translation!.promptText}\n </button>\n </h2>\n <div id=\"collapse\" class=\"accordion-collapse collapse\" aria-labelledby=\"heading\" data-bs-parent=\"#aico-text-content\">\n <div class=\"accordion-body\">{children}</div>\n </div>\n </div>\n </div>\n )}\n >\n <div class=\"card\" style={contentStyles}>\n <div class=\"card-body w-100 border-0\">\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n <ConditionalRender condition={this.shouldDisplayTextAndPicture(translation!)}>\n <div class=\"row g-4\">\n <div\n class={getClass({\n 'col-md-8': true,\n 'order-1': this.content.picturePosition === 'right',\n 'order-2': this.content.picturePosition === 'left',\n })}\n >\n {this.getTextComponent(translation!)}\n </div>\n <div\n class={getClass({\n 'col-md-4 justify-content-center': true,\n 'order-2': this.content.picturePosition === 'right',\n 'order-1': this.content.picturePosition === 'left',\n })}\n >\n {this.getImageComponent(translation!)}\n </div>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyPicture(translation!)}>{this.getImageComponent(translation!)}</ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyText(translation!)}>{this.getTextComponent(translation!)}</ConditionalRender>\n </div>\n </div>\n </ConditionalWrap>\n </ConditionalRender>\n );\n }\n\n private getImageComponent(translation: TextContentTranslation): VNode {\n const imageStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.focusXPercentage && this.content.focusYCoordinate) {\n imageStyles['object-position'] = `${this.content.focusXPercentage}% ${this.content.focusYPercentage}%`;\n }\n\n return (\n <div class=\"card text-bg-dark text-white\">\n <img class=\"card-img img-fluid object-fit-contain\" src={translation.optimizedPicture ?? translation.picture} />\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation.pictureLabel)}>\n <div class=\"card-img-overlay\">\n <p\n class={getClass({\n 'card-text': true,\n 'text-end': this.content.pictureLabelPosition === 'right',\n 'text-center': this.content.pictureLabelPosition === 'center',\n })}\n >\n {translation.pictureLabel}\n </p>\n </div>\n </ConditionalRender>\n </div>\n );\n }\n\n private getTextComponent(translation: TextContentTranslation): VNode {\n const textStyles: { [key: string]: string | undefined } = { 'line-height': '1.3', 'white-space': 'pre-line' };\n if (this.content.fontSize) {\n textStyles['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n textStyles['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.shouldJustifyText) {\n textStyles['text-align'] = 'justify';\n textStyles['text-justify'] = 'inner-word';\n }\n\n return (\n <p class=\"card-text\" style={textStyles}>\n {translation.text}\n </p>\n );\n }\n\n private makeTitleContent(translation: TextContentTranslation): 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 ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n\n private shouldDisplayTextAndPicture(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyPicture(translation: TextContentTranslation): boolean {\n return strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyText(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) && strIsNullOrEmptyOrWhitespace(translation.picture);\n }\n}\n"],"version":3}
@@ -8,12 +8,14 @@ const AicoTitleContent = /*@__PURE__*/ proxyCustomElement(class AicoTitleContent
8
8
  super();
9
9
  this.__registerHost();
10
10
  this.content = undefined;
11
+ this.locale = 'de';
11
12
  }
12
13
  render() {
13
- var _a;
14
+ var _a, _b;
14
15
  if (!this.content.size || this.content.translations.length === 0) {
15
16
  return h("aico-no-content", null);
16
17
  }
18
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
17
19
  const CustomTag = this.content.size;
18
20
  const defaultColor = 'black';
19
21
  const styles = {
@@ -21,14 +23,15 @@ const AicoTitleContent = /*@__PURE__*/ proxyCustomElement(class AicoTitleContent
21
23
  };
22
24
  if (this.content.hasUnderscore) {
23
25
  styles['text-decoration-line'] = 'underline';
24
- styles['text-decoration-color'] = (_a = this.content.underscoreColor) !== null && _a !== void 0 ? _a : defaultColor;
26
+ styles['text-decoration-color'] = (_b = this.content.underscoreColor) !== null && _b !== void 0 ? _b : defaultColor;
25
27
  styles['text-decoration-thickness'] = '3px';
26
28
  }
27
- return (h(CustomTag, null, h("span", { style: styles }, this.content.translations[0].title)));
29
+ return (h(CustomTag, null, h("span", { style: styles }, translation === null || translation === void 0 ? void 0 : translation.title)));
28
30
  }
29
31
  static get style() { return aicoTitleContentCss; }
30
32
  }, [2, "aico-title-content", {
31
- "content": [16]
33
+ "content": [16],
34
+ "locale": [1]
32
35
  }]);
33
36
  function defineCustomElement() {
34
37
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-title-content2.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,yCAAyC;;MCQxD,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,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,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,QACE,EAAC,SAAS,QACR,YAAM,KAAK,EAAE,MAAM,IAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAQ,CACtD,EACZ;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-title-content/aico-title-content.css?tag=aico-title-content&encapsulation=scoped","src/components/content/aico-title-content/aico-title-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","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"],"version":3}
1
+ {"file":"aico-title-content2.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,yCAAyC;;MCQxD,gBAAgB;;;;;sBAGF,IAAI;;IAE7B,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,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,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,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,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,QACE,EAAC,SAAS,QACR,YAAM,KAAK,EAAE,MAAM,IAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAQ,CACtC,EACZ;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-title-content/aico-title-content.css?tag=aico-title-content&encapsulation=scoped","src/components/content/aico-title-content/aico-title-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","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 @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"],"version":3}
@@ -11,11 +11,13 @@ const AicoUploadContent = /*@__PURE__*/ proxyCustomElement(class AicoUploadConte
11
11
  super();
12
12
  this.__registerHost();
13
13
  this.content = undefined;
14
+ this.locale = 'de';
14
15
  }
15
16
  render() {
16
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
17
+ var _a;
18
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
17
19
  const youtubeUrl = this.content && this.content.videoUrl ? getYoutubeURL(this.content.videoUrl) : null;
18
- 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 => {
20
+ 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 => {
19
21
  if (strIsNullOrEmptyOrWhitespace(upload.path)) {
20
22
  return null;
21
23
  }
@@ -34,7 +36,8 @@ const AicoUploadContent = /*@__PURE__*/ proxyCustomElement(class AicoUploadConte
34
36
  }
35
37
  static get style() { return aicoUploadContentCss; }
36
38
  }, [2, "aico-upload-content", {
37
- "content": [16]
39
+ "content": [16],
40
+ "locale": [1]
38
41
  }]);
39
42
  function defineCustomElement() {
40
43
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-upload-content2.js","mappings":";;;;;;AAAA,MAAM,oBAAoB,GAAG,0CAA0C;;MCY1D,iBAAiB;;;;;;IAG5B,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAC/F,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,aAAa,CAAC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ico-upload-content&encapsulation=scoped","src/components/content/aico-upload-content/aico-upload-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","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"],"version":3}
1
+ {"file":"aico-upload-content2.js","mappings":";;;;;;AAAA,MAAM,oBAA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BAAgB,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;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-upload-content/aico-upload-content.css?tag=aico-upload-content&encapsulation=scoped","src/components/content/aico-upload-content/aico-upload-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","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"],"version":3}
@@ -11,11 +11,13 @@ const AicoVideoContent = /*@__PURE__*/ proxyCustomElement(class AicoVideoContent
11
11
  super();
12
12
  this.__registerHost();
13
13
  this.content = undefined;
14
+ this.locale = 'de';
14
15
  }
15
16
  render() {
16
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
17
+ var _a;
18
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
17
19
  const youtubeUrl = translation && translation.videoUrl ? getYoutubeURL(translation.videoUrl) : null;
18
- 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" }))))));
20
+ 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" }))))));
19
21
  }
20
22
  makeTitleContent(translation) {
21
23
  var _a;
@@ -30,7 +32,8 @@ const AicoVideoContent = /*@__PURE__*/ proxyCustomElement(class AicoVideoContent
30
32
  }
31
33
  static get style() { return aicoVideoContentCss; }
32
34
  }, [2, "aico-video-content", {
33
- "content": [16]
35
+ "content": [16],
36
+ "locale": [1]
34
37
  }]);
35
38
  function defineCustomElement() {
36
39
  if (typeof customElements === "undefined") {