@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
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -15,6 +16,15 @@ export const Example = {
15
16
  updatedAt: new Date(),
16
17
  title: 'Table title',
17
18
  additionalText: 'Additional text',
19
+ locale: 'de'
20
+ },
21
+ {
22
+ id: 1234,
23
+ createdAt: new Date(),
24
+ updatedAt: new Date(),
25
+ title: 'Table title en',
26
+ additionalText: 'Additional text en',
27
+ locale: 'en'
18
28
  },
19
29
  ],
20
30
  tableRows: [
@@ -35,6 +45,14 @@ export const Example = {
35
45
  createdAt: new Date(),
36
46
  updatedAt: new Date(),
37
47
  columnData: 'Heading 1',
48
+ locale: 'de'
49
+ },
50
+ {
51
+ id: 1234,
52
+ createdAt: new Date(),
53
+ updatedAt: new Date(),
54
+ columnData: 'Heading 1 en',
55
+ locale: 'en'
38
56
  },
39
57
  ],
40
58
  },
@@ -48,6 +66,14 @@ export const Example = {
48
66
  createdAt: new Date(),
49
67
  updatedAt: new Date(),
50
68
  columnData: 'Heading 2',
69
+ locale: 'de'
70
+ },
71
+ {
72
+ id: 1234,
73
+ createdAt: new Date(),
74
+ updatedAt: new Date(),
75
+ columnData: 'Heading 2 en',
76
+ locale: 'en'
51
77
  },
52
78
  ],
53
79
  },
@@ -70,6 +96,14 @@ export const Example = {
70
96
  createdAt: new Date(),
71
97
  updatedAt: new Date(),
72
98
  columnData: 'Cell 1x2',
99
+ locale: 'de'
100
+ },
101
+ {
102
+ id: 1234,
103
+ createdAt: new Date(),
104
+ updatedAt: new Date(),
105
+ columnData: 'Cell 1x2 en',
106
+ locale: 'en'
73
107
  },
74
108
  ],
75
109
  },
@@ -83,6 +117,14 @@ export const Example = {
83
117
  createdAt: new Date(),
84
118
  updatedAt: new Date(),
85
119
  columnData: 'Cell 2x2',
120
+ locale: 'de'
121
+ },
122
+ {
123
+ id: 1234,
124
+ createdAt: new Date(),
125
+ updatedAt: new Date(),
126
+ columnData: 'Cell 2x2 en',
127
+ locale: 'en'
86
128
  },
87
129
  ],
88
130
  },
@@ -105,6 +147,14 @@ export const Example = {
105
147
  createdAt: new Date(),
106
148
  updatedAt: new Date(),
107
149
  columnData: 'Cell 1x1',
150
+ locale: 'de'
151
+ },
152
+ {
153
+ id: 1234,
154
+ createdAt: new Date(),
155
+ updatedAt: new Date(),
156
+ columnData: 'Cell 1x1 en',
157
+ locale: 'en'
108
158
  },
109
159
  ],
110
160
  },
@@ -118,6 +168,14 @@ export const Example = {
118
168
  createdAt: new Date(),
119
169
  updatedAt: new Date(),
120
170
  columnData: 'Cell 2x1',
171
+ locale: 'de'
172
+ },
173
+ {
174
+ id: 1234,
175
+ createdAt: new Date(),
176
+ updatedAt: new Date(),
177
+ columnData: 'Cell 2x1 en',
178
+ locale: 'en'
121
179
  },
122
180
  ],
123
181
  },
@@ -1 +1 @@
1
- {"version":3,"file":"aico-table-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-table-content/aico-table-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;CAChC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,aAAa;oBACpB,cAAc,EAAE,iBAAiB;iBAClC;aACF;Y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E,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,YAAY,EAAE;gCACZ;oCACE,EAAE,EAAE,IAAI;oCACR,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,UAAU,EAAE,UAAU;iCACvB;6BACF;yBACF;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,KAAK;oBAChB,IAAI,EAAE,CAAC;oBACP,UAAU,EAAE;wBACV;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,YAAY,EAAE;gCACZ;oCACE,EAAE,EAAE,IAAI;oCACR,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,UAAU,EAAE,UAAU;iCACvB;6BACF;yBACF;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,YAAY,EAAE;gCACZ;oCACE,EAAE,EAAE,IAAI;oCACR,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,UAAU,EAAE,UAAU;iCACvB;6BACF;yBACF;qBACF;iBACF;aACF;SACc;KAClB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoTableContent> = {\n component: 'aico-table-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Table title',\n additionalText: 'Additional text',\n },\n ],\n tableRows: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isHeading: true,\n sort: 1,\n rowColumns: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Heading 1',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Heading 2',\n },\n ],\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isHeading: false,\n sort: 3,\n rowColumns: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 1x2',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 2x2',\n },\n ],\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isHeading: false,\n sort: 2,\n rowColumns: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 1x1',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 2x1',\n },\n ],\n },\n ],\n },\n ],\n } as TableContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-table-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-table-content/aico-table-content.stories.ts"],"names":[],"mappings":"AAIA,MA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EAAE;oCACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,UAAU,EAAE,UAAU;oCACtB,MAAM,EAAE,IAAI;iCACb;gCACD;oCACE,EAAE,EAAE,IAAI;oCACR,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oCACrB,UAAU,EAAE,aAAa;oCACzB,MAAM,EAAE,IAAI;iCACb;6BACF;yBACF;qBACF;iBACF;aACF;SACc;KAClB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoTableContent> = {\n component: 'aico-table-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Table title',\n additionalText: 'Additional text',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Table title en',\n additionalText: 'Additional text en',\n locale: 'en'\n },\n ],\n tableRows: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isHeading: true,\n sort: 1,\n rowColumns: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Heading 1',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Heading 1 en',\n locale: 'en'\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Heading 2',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Heading 2 en',\n locale: 'en'\n },\n ],\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isHeading: false,\n sort: 3,\n rowColumns: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 1x2',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 1x2 en',\n locale: 'en'\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 2x2',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData:'Cell 2x2 en',\n locale: 'en'\n },\n ],\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isHeading: false,\n sort: 2,\n rowColumns: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 1x1',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 1x1 en',\n locale: 'en'\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 2x1',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n columnData: 'Cell 2x1 en',\n locale: 'en'\n },\n ],\n },\n ],\n },\n ],\n } as TableContent,\n },\n};\n"]}
@@ -6,17 +6,15 @@ import "bootstrap";
6
6
  export class AicoTextContent {
7
7
  constructor() {
8
8
  this.content = undefined;
9
+ this.locale = 'de';
9
10
  }
10
11
  render() {
11
- var _a, _b, _c;
12
- if (this.content.translations.length === 0) {
13
- return h("aico-no-content", null);
14
- }
15
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
12
+ var _a, _b, _c, _d;
13
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
16
14
  const contentStyles = {};
17
15
  if (this.content.hasBackgroundColor) {
18
- contentStyles['background-color'] = (_a = this.content.backgroundColor) !== null && _a !== void 0 ? _a : 'white';
19
- contentStyles['color'] = (_b = this.content.textColor) !== null && _b !== void 0 ? _b : 'black';
16
+ contentStyles['background-color'] = (_b = this.content.backgroundColor) !== null && _b !== void 0 ? _b : 'white';
17
+ contentStyles['color'] = (_c = this.content.textColor) !== null && _c !== void 0 ? _c : 'black';
20
18
  contentStyles['width'] = '100%';
21
19
  contentStyles['padding'] = '15px';
22
20
  contentStyles['margin-top'] = '10px';
@@ -27,9 +25,9 @@ export class AicoTextContent {
27
25
  }
28
26
  if (this.content.alignmentEnabled) {
29
27
  contentStyles['display'] = 'flex';
30
- contentStyles['align-items'] = (_c = this.content.verticalAlign) !== null && _c !== void 0 ? _c : 'flex-start';
28
+ contentStyles['align-items'] = (_d = this.content.verticalAlign) !== null && _d !== void 0 ? _d : 'flex-start';
31
29
  }
32
- 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({
30
+ 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({
33
31
  'col-md-8': true,
34
32
  'order-1': this.content.picturePosition === 'right',
35
33
  'order-2': this.content.picturePosition === 'left',
@@ -90,12 +88,12 @@ export class AicoTextContent {
90
88
  static get encapsulation() { return "scoped"; }
91
89
  static get originalStyleUrls() {
92
90
  return {
93
- "$": ["aico-text-content.css", "../content-styles.css"]
91
+ "$": ["aico-text-content.css"]
94
92
  };
95
93
  }
96
94
  static get styleUrls() {
97
95
  return {
98
- "$": ["aico-text-content.css", "../content-styles.css"]
96
+ "$": ["aico-text-content.css"]
99
97
  };
100
98
  }
101
99
  static get properties() {
@@ -120,6 +118,24 @@ export class AicoTextContent {
120
118
  "tags": [],
121
119
  "text": ""
122
120
  }
121
+ },
122
+ "locale": {
123
+ "type": "string",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "string",
127
+ "resolved": "string",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": ""
135
+ },
136
+ "attribute": "locale",
137
+ "reflect": false,
138
+ "defaultValue": "'de'"
123
139
  }
124
140
  };
125
141
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-text-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-text-content/aico-text-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAG7D,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,WAAW,CAAC;AAOnB,MAAM,OAAO,eAAe;;;;IAG1B,MAAM;;QACJ,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,0BAAmB,CAAC;SAC5B;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/F,MAAM,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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AS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YAClC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;IAEO,2BAA2B,CAAC,WAAmC;QACrE,OAAO,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAChL,CAAC;IAEO,wBAAwB,CAAC,WAAmC;QAClE,OAAO,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/K,CAAC;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;IAC5K,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"aico-text-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-text-content/aico-text-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAG7D,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,WAAW,CAAC;AAOnB,MAAM,OAAO,eAAe;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -17,6 +18,14 @@ export const Example = {
17
18
  promptText: 'Prompt text',
18
19
  locale: 'en-GB',
19
20
  },
21
+ {
22
+ id: 1234,
23
+ createdAt: new Date(),
24
+ updatedAt: new Date(),
25
+ title: 'Howdy de',
26
+ promptText: 'Prompt text de',
27
+ locale: 'de',
28
+ },
20
29
  ],
21
30
  titleSize: 'h1',
22
31
  alignmentEnabled: true,
@@ -34,6 +43,7 @@ export const Example = {
34
43
  };
35
44
  export const NoPrompt = {
36
45
  args: {
46
+ locale: 'de',
37
47
  content: {
38
48
  id: 1234,
39
49
  createdAt: new Date(),
@@ -50,6 +60,17 @@ export const NoPrompt = {
50
60
  pictureLabel: 'Picture label',
51
61
  text: 'Foo\nBar\nBaz',
52
62
  },
63
+ {
64
+ id: 1234,
65
+ createdAt: new Date(),
66
+ updatedAt: new Date(),
67
+ title: 'Howdy de',
68
+ promptText: null,
69
+ locale: 'de',
70
+ picture: 'https://source.unsplash.com/random/800x600',
71
+ pictureLabel: 'Picture label de',
72
+ text: 'Foo de\nBar de\nBaz de',
73
+ },
53
74
  ],
54
75
  picturePosition: 'center',
55
76
  pictureSize: 'small',
@@ -69,6 +90,7 @@ export const NoPrompt = {
69
90
  };
70
91
  export const TextAndImage = {
71
92
  args: {
93
+ locale: 'de',
72
94
  content: {
73
95
  id: 1234,
74
96
  createdAt: new Date(),
@@ -85,6 +107,17 @@ export const TextAndImage = {
85
107
  pictureLabel: 'Picture label',
86
108
  text: 'Foo\nBar\nBaz',
87
109
  },
110
+ {
111
+ id: 1234,
112
+ createdAt: new Date(),
113
+ updatedAt: new Date(),
114
+ title: 'Howdy de',
115
+ promptText: 'Prompt text de',
116
+ locale: 'de',
117
+ picture: 'https://source.unsplash.com/random/800x600',
118
+ pictureLabel: 'Picture label de',
119
+ text: 'Foo de\nBar de\nBaz de',
120
+ },
88
121
  ],
89
122
  picturePosition: 'center',
90
123
  pictureSize: 'small',
@@ -104,6 +137,7 @@ export const TextAndImage = {
104
137
  };
105
138
  export const OnlyImage = {
106
139
  args: {
140
+ locale: 'de',
107
141
  content: {
108
142
  id: 1234,
109
143
  createdAt: new Date(),
@@ -119,6 +153,16 @@ export const OnlyImage = {
119
153
  picture: 'https://source.unsplash.com/random/800x600',
120
154
  pictureLabel: 'Picture label',
121
155
  },
156
+ {
157
+ id: 1234,
158
+ createdAt: new Date(),
159
+ updatedAt: new Date(),
160
+ title: 'Howdy de',
161
+ promptText: 'Prompt text de',
162
+ locale: 'de',
163
+ picture: 'https://source.unsplash.com/random/800x600',
164
+ pictureLabel: 'Picture label de',
165
+ },
122
166
  ],
123
167
  picturePosition: 'center',
124
168
  pictureSize: 'small',
@@ -138,6 +182,7 @@ export const OnlyImage = {
138
182
  };
139
183
  export const OnlyText = {
140
184
  args: {
185
+ locale: 'de',
141
186
  content: {
142
187
  id: 1234,
143
188
  createdAt: new Date(),
@@ -153,6 +198,16 @@ export const OnlyText = {
153
198
  text: 'Foo\nBar\nBaz',
154
199
  pictureLabel: 'Picture label',
155
200
  },
201
+ {
202
+ id: 1234,
203
+ createdAt: new Date(),
204
+ updatedAt: new Date(),
205
+ title: 'Howdy de',
206
+ promptText: 'Prompt text de',
207
+ locale: 'de',
208
+ text: 'Foo de\nBar de\nBaz de',
209
+ pictureLabel: 'Picture label de',
210
+ },
156
211
  ],
157
212
  picturePosition: 'center',
158
213
  pictureSize: 'small',
@@ -1 +1 @@
1
- {"version":3,"file":"aico-text-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-text-content/aico-text-content.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,OAAO;oBACd,UAAU,EAAE,aAAa;oBACzB,MAAM,EAAE,OAAO;iBAChB;aACF;YAED,SAAS,EAAE,IAAI;YAEf,gBAAgB,EAAE,IAAI;YAEtB,kBAAkB,EAAE,IAA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vB,SAAS,EAAE,OAAO;YAClB,sBAAsB,EAAE,IAAI;YAC5B,0BAA0B,EAAE,KAAK;YAEjC,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM;SACpB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,OAAO;oBACd,UAAU,EAAE,aAAa;oBACzB,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,eAAe;oBACrB,YAAY,EAAE,eAAe;iBAC9B;aACF;YAED,eAAe,EAAE,QAAQ;YACzB,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,MAAM;YAE5B,gBAAgB,EAAE,IAAI;YAEtB,kBAAkB,EAAE,IAAI;YACxB,eAAe,EAAE,KAAK;YAEtB,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,OAAO;YAClB,sBAAsB,EAAE,IAAI;YAC5B,0BAA0B,EAAE,KAAK;YAEjC,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM;SACpB;KACF;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoTextContent> = {\n component: 'aico-text-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n },\n ],\n\n titleSize: 'h1',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const NoPrompt: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: null,\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\n\nexport const TextAndImage: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyImage: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyText: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n text: 'Foo\\nBar\\nBaz',\n pictureLabel: 'Picture label',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n"]}
1
+ {"version":3,"file":"aico-text-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-text-content/aico-text-content.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,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0BAA0B,EAAE,KAAK;YAEjC,iBAAiB,EAAE,IAAI;YACvB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM;SACpB;KACF;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoTextContent> = {\n component: 'aico-text-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n },\n ],\n\n titleSize: 'h1',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const NoPrompt: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: null,\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: null,\n locale: 'de',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label de',\n text: 'Foo de\\nBar de\\nBaz de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\n\nexport const TextAndImage: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n text: 'Foo\\nBar\\nBaz',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label de',\n text: 'Foo de\\nBar de\\nBaz de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyImage: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n picture: 'https://source.unsplash.com/random/800x600',\n pictureLabel: 'Picture label de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n\nexport const OnlyText: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy',\n promptText: 'Prompt text',\n locale: 'en-GB',\n text: 'Foo\\nBar\\nBaz',\n pictureLabel: 'Picture label',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Howdy de',\n promptText: 'Prompt text de',\n locale: 'de',\n text: 'Foo de\\nBar de\\nBaz de',\n pictureLabel: 'Picture label de',\n },\n ],\n\n picturePosition: 'center',\n pictureSize: 'small',\n pictureLabelPosition: 'left',\n\n alignmentEnabled: true,\n\n hasBackgroundColor: true,\n backgroundColor: 'red',\n\n shouldJustifyText: true,\n textColor: 'white',\n isButtonRightUnderText: true,\n isContentDisplayedAsPrompt: false,\n\n pictureFontOption: 'H1',\n addBorder: true,\n borderColor: 'blue',\n },\n },\n};\n"]}
@@ -2,12 +2,14 @@ import { h } from "@stencil/core";
2
2
  export class AicoTitleContent {
3
3
  constructor() {
4
4
  this.content = undefined;
5
+ this.locale = 'de';
5
6
  }
6
7
  render() {
7
- var _a;
8
+ var _a, _b;
8
9
  if (!this.content.size || this.content.translations.length === 0) {
9
10
  return h("aico-no-content", null);
10
11
  }
12
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
11
13
  const CustomTag = this.content.size;
12
14
  const defaultColor = 'black';
13
15
  const styles = {
@@ -15,10 +17,10 @@ export class AicoTitleContent {
15
17
  };
16
18
  if (this.content.hasUnderscore) {
17
19
  styles['text-decoration-line'] = 'underline';
18
- styles['text-decoration-color'] = (_a = this.content.underscoreColor) !== null && _a !== void 0 ? _a : defaultColor;
20
+ styles['text-decoration-color'] = (_b = this.content.underscoreColor) !== null && _b !== void 0 ? _b : defaultColor;
19
21
  styles['text-decoration-thickness'] = '3px';
20
22
  }
21
- return (h(CustomTag, null, h("span", { style: styles }, this.content.translations[0].title)));
23
+ return (h(CustomTag, null, h("span", { style: styles }, translation === null || translation === void 0 ? void 0 : translation.title)));
22
24
  }
23
25
  static get is() { return "aico-title-content"; }
24
26
  static get encapsulation() { return "scoped"; }
@@ -54,6 +56,24 @@ export class AicoTitleContent {
54
56
  "tags": [],
55
57
  "text": ""
56
58
  }
59
+ },
60
+ "locale": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": false,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "locale",
75
+ "reflect": false,
76
+ "defaultValue": "'de'"
57
77
  }
58
78
  };
59
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-title-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnD,MAAM,OAAO,gBAAgB;;;;IAG3B,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAChE,OAAO,0BAAmB,CAAC;SAC5B;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAEpC,MAAM,YAAY,GAAG,OAAO,CAAC;QAC7B,MAAM,MAAM,GAA8B;YACxC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;SACxE,CAAC;QAEF,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC9B,MAAM,CAAC,sBAAsB,CAAC,GAAG,WAAW,CAAC;YAC7C,MAAM,CAAC,uBAAuB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,YAAY,CAAC;YAC/E,MAAM,CAAC,2BAA2B,CAAC,GAAG,KAAK,CAAC;SAC7C;QAED,OAAO,CACL,EAAC,SAAS;YACR,YAAM,KAAK,EAAE,MAAM,IAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAQ,CACtD,CACb,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-title-content',\n styleUrl: 'aico-title-content.css',\n scoped: true,\n})\nexport class AicoTitleContent {\n @Prop() content!: TitleContent;\n\n render() {\n if (!this.content.size || this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const CustomTag = this.content.size;\n\n const defaultColor = 'black';\n const styles: { [key: string]: string } = {\n color: this.content.titleColor ? this.content.titleColor : defaultColor,\n };\n\n if (this.content.hasUnderscore) {\n styles['text-decoration-line'] = 'underline';\n styles['text-decoration-color'] = this.content.underscoreColor ?? defaultColor;\n styles['text-decoration-thickness'] = '3px';\n }\n\n return (\n <CustomTag>\n <span style={styles}>{this.content.translations[0].title}</span>\n </CustomTag>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-title-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnD,MAAM,OAAO,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,CAAC,EAAE,CAAC,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,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;SACxE,CAAC;QAEF,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC9B,MAAM,CAAC,sBAAsB,CAAC,GAAG,WAAW,CAAC;YAC7C,MAAM,CAAC,uBAAuB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,YAAY,CAAC;YAC/E,MAAM,CAAC,2BAA2B,CAAC,GAAG,KAAK,CAAC;SAC7C;QAED,OAAO,CACL,EAAC,SAAS;YACR,YAAM,KAAK,EAAE,MAAM,IAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAQ,CACtC,CACb,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-title-content',\n styleUrl: 'aico-title-content.css',\n scoped: true,\n})\nexport class AicoTitleContent {\n @Prop() content!: TitleContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n if (!this.content.size || this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const CustomTag = this.content.size;\n\n const defaultColor = 'black';\n const styles: { [key: string]: string } = {\n color: this.content.titleColor ? this.content.titleColor : defaultColor,\n };\n\n if (this.content.hasUnderscore) {\n styles['text-decoration-line'] = 'underline';\n styles['text-decoration-color'] = this.content.underscoreColor ?? defaultColor;\n styles['text-decoration-thickness'] = '3px';\n }\n\n return (\n <CustomTag>\n <span style={styles}>{translation?.title}</span>\n </CustomTag>\n );\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { html } from "lit-html";
2
2
  const meta = {
3
3
  component: 'aico-title-content',
4
4
  args: {
5
+ locale: 'de',
5
6
  content: {
6
7
  id: 1234,
7
8
  createdAt: new Date(),
@@ -19,10 +20,20 @@ const meta = {
19
20
  title: 'Title foo',
20
21
  locale: 'en-US',
21
22
  },
23
+ {
24
+ id: 1234,
25
+ createdAt: new Date(),
26
+ updatedAt: new Date(),
27
+ text: 'Text foo de',
28
+ title: 'Title foo de',
29
+ locale: 'de',
30
+ }
22
31
  ],
23
32
  },
24
33
  },
25
34
  };
26
35
  export default meta;
27
- export const Example = (args) => html `<aico-title-content .content=${args.content}></aico-title-content>`;
36
+ export const Example = (args) => {
37
+ return html `<aico-title-content .locale=${args.locale} .content=${args.content}></aico-title-content>`;
38
+ };
28
39
  //# sourceMappingURL=aico-title-content.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aico-title-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,MAAM;YAClB,aAAa,EAAE,IAAI;YACnB,eAAe,EAAE,KAAK;YACtB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,WAAW;oBAClB,MAAM,EAAE,OAAO;iBAChB;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,OAAO,GAAkC,CAAC,IAA0B,EAAE,EAAE,CAAC,IAAI,CAAA,gCAAgC,IAAI,CAAC,OAAQ,wBAAwB,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/web-components';\nimport { JSX } from '../../../components';\nimport { html } from 'lit-html';\n\nconst meta: Meta<JSX.AicoTitleContent> = {\n component: 'aico-title-content',\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n size: 'h1',\n titleColor: 'blue',\n hasUnderscore: true,\n underscoreColor: 'red',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n text: 'Text foo',\n title: 'Title foo',\n locale: 'en-US',\n },\n ],\n },\n },\n};\n\nexport default meta;\n\nexport const Example: StoryFn<JSX.AicoTitleContent> = (args: JSX.AicoTitleContent) => html`<aico-title-content .content=${args.content!}></aico-title-content>`;\n"]}
1
+ {"version":3,"file":"aico-title-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-title-content/aico-title-content.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,oBAAoB;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,MAAM;YAClB,aAAa,EAAE,IAAI;YACnB,eAAe,EAAE,KAAK;YACtB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,WAAW;oBAClB,MAAM,EAAE,OAAO;iBAChB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,cAAc;oBACrB,MAAM,EAAE,IAAI;iBACb;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,OAAO,GAAkC,CAAC,IAA0B,EAAE,EAAE;IACnF,OAAO,IAAI,CAAA,+BAA+B,IAAI,CAAC,MAAO,aAAa,IAAI,CAAC,OAAQ,wBAAwB,CAAA;AAC1G,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/web-components';\nimport { JSX } from '../../../components';\nimport { html } from 'lit-html';\n\nconst meta: Meta<JSX.AicoTitleContent> = {\n component: 'aico-title-content',\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n size: 'h1',\n titleColor: 'blue',\n hasUnderscore: true,\n underscoreColor: 'red',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n text: 'Text foo',\n title: 'Title foo',\n locale: 'en-US',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n text: 'Text foo de',\n title: 'Title foo de',\n locale: 'de',\n }\n ],\n },\n },\n};\n\nexport default meta;\n\nexport const Example: StoryFn<JSX.AicoTitleContent> = (args: JSX.AicoTitleContent) => {\n return html`<aico-title-content .locale=${args.locale!} .content=${args.content!}></aico-title-content>`\n};\n"]}
@@ -4,11 +4,13 @@ import ConditionalRender from "../../../utils/ConditionalRender";
4
4
  export class AicoUploadContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
+ var _a;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
10
12
  const youtubeUrl = this.content && this.content.videoUrl ? getYoutubeURL(this.content.videoUrl) : null;
11
- return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(youtubeUrl) }, h("div", { class: "ratio ratio-16x9" }, h("iframe", { allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, src: youtubeUrl }))), h(ConditionalRender, { condition: !this.content.shouldHideFile }, h("p", { class: "fs-3 mt-3" }, "Files:"), h("div", { class: "list-group list-group-flush" }, this.content.uploads.map(upload => {
13
+ return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(youtubeUrl) }, h("div", { class: "ratio ratio-16x9" }, h("iframe", { allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, src: youtubeUrl }))), h(ConditionalRender, { condition: !this.content.shouldHideFile }, h("p", { class: "fs-3 mt-3" }, "Files:"), h("div", { class: "list-group list-group-flush" }, this.content.uploads.map(upload => {
12
14
  if (strIsNullOrEmptyOrWhitespace(upload.path)) {
13
15
  return null;
14
16
  }
@@ -59,6 +61,24 @@ export class AicoUploadContent {
59
61
  "tags": [],
60
62
  "text": ""
61
63
  }
64
+ },
65
+ "locale": {
66
+ "type": "string",
67
+ "mutable": false,
68
+ "complexType": {
69
+ "original": "string",
70
+ "resolved": "string",
71
+ "references": {}
72
+ },
73
+ "required": false,
74
+ "optional": false,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": ""
78
+ },
79
+ "attribute": "locale",
80
+ "reflect": false,
81
+ "defaultValue": "'de'"
62
82
  }
63
83
  };
64
84
  }