@aiconomy/aico-components 0.0.100 → 0.0.114

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 (100) hide show
  1. package/README.md +671 -32
  2. package/dist/aico-components/aico-components.esm.js +1 -1
  3. package/dist/aico-components/aico-components.esm.js.map +1 -1
  4. package/dist/aico-components/p-34bd96ca.js +2 -0
  5. package/dist/aico-components/p-34bd96ca.js.map +1 -0
  6. package/dist/aico-components/p-7f6fcb2e.entry.js.map +1 -1
  7. package/dist/aico-components/p-a4f7ae53.entry.js +2 -0
  8. package/dist/aico-components/p-a4f7ae53.entry.js.map +1 -0
  9. package/dist/aico-components/p-b61bc8e9.entry.js +2 -0
  10. package/dist/aico-components/p-b61bc8e9.entry.js.map +1 -0
  11. package/dist/aico-components/{p-eee603da.entry.js → p-b9bc0400.entry.js} +3 -3
  12. package/dist/aico-components/p-b9bc0400.entry.js.map +1 -0
  13. package/dist/aico-components/{p-368addda.entry.js → p-bf3db54a.entry.js} +2 -2
  14. package/dist/aico-components/p-bf3db54a.entry.js.map +1 -0
  15. package/dist/cjs/ConditionalRender-52579540.js +9 -0
  16. package/dist/cjs/ConditionalRender-52579540.js.map +1 -0
  17. package/dist/cjs/aico-album-content_19.cjs.entry.js +21 -24
  18. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
  19. package/dist/cjs/aico-article-detail.cjs.entry.js +11 -1
  20. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
  21. package/dist/cjs/aico-components.cjs.js +1 -1
  22. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +3 -1
  23. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  24. package/dist/cjs/aico-news-list.cjs.entry.js +1 -1
  25. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  26. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/collection/components/aico-article-detail/aico-article-detail.js +48 -2
  29. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  30. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +42 -4
  31. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  32. package/dist/collection/components/aico-news-list/aico-news-list.js +28 -10
  33. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  34. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +8 -8
  35. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  36. package/dist/collection/model/Article.js.map +1 -1
  37. package/dist/collection/model/NewsTag.js +2 -0
  38. package/dist/collection/model/NewsTag.js.map +1 -0
  39. package/dist/components/aico-article-detail2.js +14 -2
  40. package/dist/components/aico-article-detail2.js.map +1 -1
  41. package/dist/components/aico-fetch-article-detail.js +5 -1
  42. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  43. package/dist/components/aico-news-list.js +2 -1
  44. package/dist/components/aico-news-list.js.map +1 -1
  45. package/dist/components/aico-special-news-carousel.js.map +1 -1
  46. package/dist/esm/ConditionalRender-7460c386.js +7 -0
  47. package/dist/esm/ConditionalRender-7460c386.js.map +1 -0
  48. package/dist/esm/aico-album-content_19.entry.js +1 -4
  49. package/dist/esm/aico-album-content_19.entry.js.map +1 -1
  50. package/dist/esm/aico-article-detail.entry.js +11 -1
  51. package/dist/esm/aico-article-detail.entry.js.map +1 -1
  52. package/dist/esm/aico-components.js +1 -1
  53. package/dist/esm/aico-fetch-article-detail.entry.js +3 -1
  54. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  55. package/dist/esm/aico-news-list.entry.js +1 -1
  56. package/dist/esm/aico-news-list.entry.js.map +1 -1
  57. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  58. package/dist/esm/loader.js +1 -1
  59. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +13 -0
  60. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +19 -0
  61. package/dist/types/components/aico-news-list/aico-news-list.d.ts +33 -1
  62. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +26 -0
  63. package/dist/types/components.d.ts +160 -0
  64. package/dist/types/model/Article.d.ts +2 -1
  65. package/dist/types/model/NewsTag.d.ts +8 -0
  66. package/package.json +2 -3
  67. package/dist/aico-components/p-19752961.entry.js +0 -2
  68. package/dist/aico-components/p-19752961.entry.js.map +0 -1
  69. package/dist/aico-components/p-368addda.entry.js.map +0 -1
  70. package/dist/aico-components/p-c69f0ecc.entry.js +0 -2
  71. package/dist/aico-components/p-c69f0ecc.entry.js.map +0 -1
  72. package/dist/aico-components/p-eee603da.entry.js.map +0 -1
  73. package/docs/components/aico-article-detail/readme.md +0 -83
  74. package/docs/components/aico-fetch-article-detail/readme.md +0 -63
  75. package/docs/components/aico-news-list/readme.md +0 -44
  76. package/docs/components/aico-news-list-item/readme.md +0 -37
  77. package/docs/components/aico-special-news-carousel/readme.md +0 -30
  78. package/docs/components/content/aico-album-content/readme.md +0 -30
  79. package/docs/components/content/aico-asking-content/readme.md +0 -31
  80. package/docs/components/content/aico-asking-list-content/readme.md +0 -10
  81. package/docs/components/content/aico-block-quote-content/readme.md +0 -31
  82. package/docs/components/content/aico-bullet-content/readme.md +0 -37
  83. package/docs/components/content/aico-carousel-content/readme.md +0 -38
  84. package/docs/components/content/aico-collection-content/readme.md +0 -10
  85. package/docs/components/content/aico-content-card-content/readme.md +0 -37
  86. package/docs/components/content/aico-divider-content/readme.md +0 -31
  87. package/docs/components/content/aico-document-content/readme.md +0 -31
  88. package/docs/components/content/aico-faq-content/readme.md +0 -31
  89. package/docs/components/content/aico-heading-content/readme.md +0 -37
  90. package/docs/components/content/aico-html-content/readme.md +0 -31
  91. package/docs/components/content/aico-link-content/readme.md +0 -31
  92. package/docs/components/content/aico-news-content/readme.md +0 -37
  93. package/docs/components/content/aico-no-content/readme.md +0 -23
  94. package/docs/components/content/aico-page-content/readme.md +0 -38
  95. package/docs/components/content/aico-table-content/readme.md +0 -37
  96. package/docs/components/content/aico-testimonial-content/readme.md +0 -30
  97. package/docs/components/content/aico-text-content/readme.md +0 -37
  98. package/docs/components/content/aico-title-content/readme.md +0 -52
  99. package/docs/components/content/aico-upload-content/readme.md +0 -37
  100. package/docs/components/content/aico-video-content/readme.md +0 -37
@@ -55,6 +55,17 @@ export namespace Components {
55
55
  }
56
56
  interface AicoArticleDetail {
57
57
  "article": Article;
58
+ /**
59
+ * Determines if the article category and tags are shown or not.
60
+ */
61
+ "hideCategoryAndTags": boolean;
62
+ /**
63
+ * Determines if the article date and author are shown or not.
64
+ */
65
+ "hideDateAndAuthor": boolean;
66
+ /**
67
+ * The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
68
+ */
58
69
  "locale": string;
59
70
  }
60
71
  interface AicoAskingContent {
@@ -95,7 +106,13 @@ export namespace Components {
95
106
  "locale": string;
96
107
  }
97
108
  interface AicoFetchArticleDetail {
109
+ /**
110
+ * The token used to authenticate against he Aico Api.
111
+ */
98
112
  "aicoBearerToken": string;
113
+ /**
114
+ * The url of the Aico Api that will be used to retrieve the article.
115
+ */
99
116
  "aicoUrl": string;
100
117
  /**
101
118
  * The id will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
@@ -105,6 +122,17 @@ export namespace Components {
105
122
  * The url handle will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
106
123
  */
107
124
  "articleUrlHandle"?: string;
125
+ /**
126
+ * Determines if the article category and tags are shown or not.
127
+ */
128
+ "hideCategoryAndTags": boolean;
129
+ /**
130
+ * Determines if the article date and author are shown or not.
131
+ */
132
+ "hideDateAndAuthor": boolean;
133
+ /**
134
+ * The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
135
+ */
108
136
  "locale": string;
109
137
  }
110
138
  interface AicoHeadingContent {
@@ -123,13 +151,41 @@ export namespace Components {
123
151
  "content": NewsContent;
124
152
  }
125
153
  interface AicoNewsList {
154
+ /**
155
+ * The token used to authenticate against he Aico Api.
156
+ */
126
157
  "aicoBearerToken": string;
158
+ /**
159
+ * The url of the Aico Api that will be used to retrieve the article.
160
+ */
127
161
  "aicoUrl": string;
162
+ /**
163
+ * Brands used to filter the results.
164
+ */
128
165
  "newsBrandIds": string[];
166
+ /**
167
+ * Channel names used to filter the results.
168
+ */
129
169
  "newsChannels": string[];
170
+ /**
171
+ * Language locales used to filter the results.
172
+ */
130
173
  "newsLanguageLocales": string[];
174
+ /**
175
+ * Sellers used to filter the results.
176
+ */
131
177
  "newsSellerIds": string[];
178
+ /**
179
+ * The text used by the next button in the pagination component.
180
+ */
132
181
  "nextButtonText": string;
182
+ /**
183
+ * The page size. Prefer this number to be even.
184
+ */
185
+ "pageSize": number;
186
+ /**
187
+ * The text used by the previous button in the pagination component.
188
+ */
133
189
  "previousButtonText": string;
134
190
  }
135
191
  interface AicoNewsListItem {
@@ -142,12 +198,33 @@ export namespace Components {
142
198
  "locale": string;
143
199
  }
144
200
  interface AicoSpecialNewsCarousel {
201
+ /**
202
+ * The token used to authenticate against he Aico Api.
203
+ */
145
204
  "aicoBearerToken": string;
205
+ /**
206
+ * The url of the Aico Api that will be used to retrieve the article.
207
+ */
146
208
  "aicoUrl": string;
209
+ /**
210
+ * Brands used to filter the results.
211
+ */
147
212
  "newsBrandIds": string[];
213
+ /**
214
+ * Channel names used to filter the results.
215
+ */
148
216
  "newsChannels": string[];
217
+ /**
218
+ * Language locales used to filter the results.
219
+ */
149
220
  "newsLanguageLocales": string[];
221
+ /**
222
+ * Sellers used to filter the results.
223
+ */
150
224
  "newsSellerIds": string[];
225
+ /**
226
+ * The number of articles shown in the carousel. Prefer this number to be small.
227
+ */
151
228
  "numberOfArticles": number;
152
229
  }
153
230
  interface AicoTableContent {
@@ -455,6 +532,17 @@ declare namespace LocalJSX {
455
532
  }
456
533
  interface AicoArticleDetail {
457
534
  "article": Article;
535
+ /**
536
+ * Determines if the article category and tags are shown or not.
537
+ */
538
+ "hideCategoryAndTags"?: boolean;
539
+ /**
540
+ * Determines if the article date and author are shown or not.
541
+ */
542
+ "hideDateAndAuthor"?: boolean;
543
+ /**
544
+ * The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
545
+ */
458
546
  "locale"?: string;
459
547
  }
460
548
  interface AicoAskingContent {
@@ -495,7 +583,13 @@ declare namespace LocalJSX {
495
583
  "locale"?: string;
496
584
  }
497
585
  interface AicoFetchArticleDetail {
586
+ /**
587
+ * The token used to authenticate against he Aico Api.
588
+ */
498
589
  "aicoBearerToken": string;
590
+ /**
591
+ * The url of the Aico Api that will be used to retrieve the article.
592
+ */
499
593
  "aicoUrl": string;
500
594
  /**
501
595
  * The id will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
@@ -505,6 +599,17 @@ declare namespace LocalJSX {
505
599
  * The url handle will be used to fetch the article. If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.
506
600
  */
507
601
  "articleUrlHandle"?: string;
602
+ /**
603
+ * Determines if the article category and tags are shown or not.
604
+ */
605
+ "hideCategoryAndTags"?: boolean;
606
+ /**
607
+ * Determines if the article date and author are shown or not.
608
+ */
609
+ "hideDateAndAuthor"?: boolean;
610
+ /**
611
+ * The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
612
+ */
508
613
  "locale"?: string;
509
614
  }
510
615
  interface AicoHeadingContent {
@@ -524,14 +629,45 @@ declare namespace LocalJSX {
524
629
  "onNewsArticleClicked"?: (event: AicoNewsContentCustomEvent<NewsArticle>) => void;
525
630
  }
526
631
  interface AicoNewsList {
632
+ /**
633
+ * The token used to authenticate against he Aico Api.
634
+ */
527
635
  "aicoBearerToken": string;
636
+ /**
637
+ * The url of the Aico Api that will be used to retrieve the article.
638
+ */
528
639
  "aicoUrl": string;
640
+ /**
641
+ * Brands used to filter the results.
642
+ */
529
643
  "newsBrandIds"?: string[];
644
+ /**
645
+ * Channel names used to filter the results.
646
+ */
530
647
  "newsChannels"?: string[];
648
+ /**
649
+ * Language locales used to filter the results.
650
+ */
531
651
  "newsLanguageLocales"?: string[];
652
+ /**
653
+ * Sellers used to filter the results.
654
+ */
532
655
  "newsSellerIds"?: string[];
656
+ /**
657
+ * The text used by the next button in the pagination component.
658
+ */
533
659
  "nextButtonText"?: string;
660
+ /**
661
+ * Event emitted when a user clicks an article. The handler receives the entire Article entity.
662
+ */
534
663
  "onArticleClick"?: (event: AicoNewsListCustomEvent<Article>) => void;
664
+ /**
665
+ * The page size. Prefer this number to be even.
666
+ */
667
+ "pageSize"?: number;
668
+ /**
669
+ * The text used by the previous button in the pagination component.
670
+ */
535
671
  "previousButtonText"?: string;
536
672
  }
537
673
  interface AicoNewsListItem {
@@ -546,13 +682,37 @@ declare namespace LocalJSX {
546
682
  "onPageClicked"?: (event: AicoPageContentCustomEvent<PageContent>) => void;
547
683
  }
548
684
  interface AicoSpecialNewsCarousel {
685
+ /**
686
+ * The token used to authenticate against he Aico Api.
687
+ */
549
688
  "aicoBearerToken": string;
689
+ /**
690
+ * The url of the Aico Api that will be used to retrieve the article.
691
+ */
550
692
  "aicoUrl": string;
693
+ /**
694
+ * Brands used to filter the results.
695
+ */
551
696
  "newsBrandIds"?: string[];
697
+ /**
698
+ * Channel names used to filter the results.
699
+ */
552
700
  "newsChannels"?: string[];
701
+ /**
702
+ * Language locales used to filter the results.
703
+ */
553
704
  "newsLanguageLocales"?: string[];
705
+ /**
706
+ * Sellers used to filter the results.
707
+ */
554
708
  "newsSellerIds"?: string[];
709
+ /**
710
+ * The number of articles shown in the carousel. Prefer this number to be small.
711
+ */
555
712
  "numberOfArticles"?: number;
713
+ /**
714
+ * Event emitted when a user clicks an article title. The handler receives the entire Article entity.
715
+ */
556
716
  "onArticleClicked"?: (event: AicoSpecialNewsCarouselCustomEvent<Article>) => void;
557
717
  }
558
718
  interface AicoTableContent {
@@ -1,5 +1,6 @@
1
1
  import { Entity } from './Entity';
2
2
  import { NewsCategory } from './NewsCategory';
3
+ import { NewsTag } from './NewsTag';
3
4
  import { ContentType } from './article/ContentType';
4
5
  export type ArticleTranslation = Entity & {
5
6
  locale: string;
@@ -54,7 +55,7 @@ export type ArticleAttributes = {
54
55
  publishDate: Date;
55
56
  endDatePermanentNews?: Date;
56
57
  newsCategory: NewsCategory;
57
- newsTags: object[];
58
+ newsTags: NewsTag[];
58
59
  soccerTeams: object[];
59
60
  brands: object[];
60
61
  album?: object;
@@ -0,0 +1,8 @@
1
+ import { Entity } from './Entity';
2
+ import { Translation } from './article/Translation';
3
+ export type NewsTag = Entity & {
4
+ translations: (Translation & {
5
+ name?: string | null;
6
+ webName?: string | null;
7
+ })[];
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiconomy/aico-components",
3
- "version": "0.0.100",
3
+ "version": "0.0.114",
4
4
  "description": "Aiconomy components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -12,8 +12,7 @@
12
12
  "unpkg": "dist/aico-components/aico-components.esm.js",
13
13
  "files": [
14
14
  "dist/",
15
- "loader/",
16
- "docs/"
15
+ "loader/"
17
16
  ],
18
17
  "scripts": {
19
18
  "dev": "npm run stencil & npm run storybook",
@@ -1,2 +0,0 @@
1
- import{r as t,h as e,H as n}from"./p-ae20e789.js";var c;(function(t){t["BULLET"]="BULLET";t["TEXT"]="TEXT";t["VIDEO"]="VIDEO";t["TABLE"]="TABLE";t["HEADING"]="HEADING";t["TITLE"]="TITLE";t["CONTENT_CARD"]="CONTENT_CARD";t["TESTIMONIAL"]="TESTIMONIAL";t["PRODUCT"]="PRODUCT";t["NEWS"]="NEWS";t["ASKING"]="ASKING";t["AGENDA"]="AGENDA";t["LIST_ASKING"]="LIST_ASKING";t["LIST_AGENDA"]="LIST_AGENDA";t["CRM"]="CRM";t["B2B"]="B2B";t["FORM_BUILDER"]="FORM_BUILDER";t["BLOCK_QUOTE"]="BLOCK_QUOTE";t["FAQ"]="FAQ";t["COURSE"]="COURSE";t["DOCUMENT"]="DOCUMENT";t["LINK"]="LINK";t["HTML"]="HTML";t["DIVIDER"]="DIVIDER";t["COLLECTION"]="COLLECTION";t["CAROUSEL"]="CAROUSEL";t["PAGE"]="PAGE";t["ALBUM"]="ALBUM";t["UPLOAD"]="UPLOAD"})(c||(c={}));const o="";const a=class{constructor(e){t(this,e);this.dateOptions={day:"numeric",month:"long",year:"numeric"};this.article=undefined;this.locale="de"}render(){const t=new Date(this.article.attributes.publishDate);const c=this.article.attributes.contentBuilder.rows.sort(((t,e)=>t.order-e.order)).map(((t,e)=>this.mapRowContent(t,e)));return e(n,null,e("figure",null,e("blockquote",{class:"blockquote"},e("h2",{class:"text-uppercase"},this.article.attributes.name)),e("figcaption",{class:"blockquote-footer"},t.toLocaleDateString("en-US",this.dateOptions)," by ",e("cite",{title:"Author"},this.article.attributes.author))),e("div",{class:"content-wrapper"},c))}mapRowContent(t,n){const c=t.columns.map(((t,e)=>this.mapColumnContent(t,e)));return e("div",{class:`content-row content-row-index-${n}`},c)}mapColumnContent(t,n){const c=t.contentContainer.contents.sort(((t,e)=>{var n,c;return((n=t.sort)!==null&&n!==void 0?n:0)-((c=e.sort)!==null&&c!==void 0?c:0)})).map(((t,e)=>this.mapContent(t,e)));return e("div",{class:`content-column content-column-index-${n}`},c)}mapContent(t,n){return e("div",{class:`content-data-wrapper content-data-wrapper-index-${n}`},this.mapContentData(t.type,t.contentData))}mapContentData(t,n){switch(t){case c.ALBUM:return e("aico-album-content",{content:n});case c.ASKING:return e("aico-asking-content",{content:n,locale:this.locale});case c.BLOCK_QUOTE:return e("aico-block-quote-content",{content:n,locale:this.locale});case c.BULLET:return e("aico-bullet-content",{content:n,locale:this.locale});case c.CAROUSEL:return e("aico-carousel-content",{content:n,locale:this.locale});case c.CONTENT_CARD:return e("aico-content-card-content",{content:n,locale:this.locale});case c.DIVIDER:return e("aico-divider-content",{content:n,locale:this.locale});case c.DOCUMENT:return e("aico-document-content",{content:n,locale:this.locale});case c.FAQ:return e("aico-faq-content",{content:n,locale:this.locale});case c.HEADING:return e("aico-heading-content",{content:n,locale:this.locale});case c.HTML:return e("aico-html-content",{content:n,locale:this.locale});case c.LINK:return e("aico-link-content",{content:n,locale:this.locale});case c.NEWS:return e("aico-news-content",{content:n});case c.PAGE:return e("aico-page-content",{content:n,locale:this.locale});case c.TABLE:return e("aico-table-content",{content:n,locale:this.locale});case c.TESTIMONIAL:return e("aico-testimonial-content",{content:n});case c.TEXT:return e("aico-text-content",{content:n,locale:this.locale});case c.TITLE:return e("aico-title-content",{content:n,locale:this.locale});case c.UPLOAD:return e("aico-upload-content",{content:n,locale:this.locale});case c.VIDEO:return e("aico-video-content",{content:n,locale:this.locale});case c.PRODUCT:case c.AGENDA:case c.LIST_ASKING:case c.LIST_AGENDA:case c.CRM:case c.B2B:case c.FORM_BUILDER:case c.COURSE:case c.COLLECTION:default:return e("div",{class:"content-data content-data-not-handled"},"Content type not handled.")}}};a.style=o;export{a as aico_article_detail};
2
- //# sourceMappingURL=p-19752961.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ContentType","aicoArticleDetailCss","AicoArticleDetail","this","dateOptions","day","month","year","render","articleDate","Date","article","attributes","publishDate","content","contentBuilder","rows","sort","a","b","order","map","row","index","mapRowContent","h","Host","class","name","toLocaleDateString","title","author","rowContent","columns","column","columnIndex","mapColumnContent","columnContent","contentContainer","contents","_a","_b","contentIndex","mapContent","mapContentData","type","contentData","contentType","ALBUM","ASKING","locale","BLOCK_QUOTE","BULLET","CAROUSEL","CONTENT_CARD","DIVIDER","DOCUMENT","FAQ","HEADING","HTML","LINK","NEWS","PAGE","TABLE","TESTIMONIAL","TEXT","TITLE","UPLOAD","VIDEO","PRODUCT","AGENDA","LIST_ASKING","LIST_AGENDA","CRM","B2B","FORM_BUILDER","COURSE","COLLECTION"],"sources":["src/model/article/ContentType.ts","src/components/aico-article-detail/aico-article-detail.css?tag=aico-article-detail&encapsulation=scoped","src/components/aico-article-detail/aico-article-detail.tsx"],"sourcesContent":["export enum ContentType {\n BULLET = 'BULLET',\n TEXT = 'TEXT',\n VIDEO = 'VIDEO',\n TABLE = 'TABLE',\n HEADING = 'HEADING',\n TITLE = 'TITLE',\n CONTENT_CARD = 'CONTENT_CARD',\n TESTIMONIAL = 'TESTIMONIAL',\n PRODUCT = 'PRODUCT',\n NEWS = 'NEWS',\n ASKING = 'ASKING',\n AGENDA = 'AGENDA',\n LIST_ASKING = 'LIST_ASKING',\n LIST_AGENDA = 'LIST_AGENDA',\n CRM = 'CRM',\n B2B = 'B2B',\n FORM_BUILDER = 'FORM_BUILDER',\n BLOCK_QUOTE = 'BLOCK_QUOTE',\n FAQ = 'FAQ',\n COURSE = 'COURSE',\n DOCUMENT = 'DOCUMENT',\n LINK = 'LINK',\n HTML = 'HTML',\n DIVIDER = 'DIVIDER',\n COLLECTION = 'COLLECTION',\n CAROUSEL = 'CAROUSEL',\n PAGE = 'PAGE',\n ALBUM = 'ALBUM',\n UPLOAD = 'UPLOAD',\n}\n",null,"import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n @Prop() locale: string = 'de';\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <figcaption class=\"blockquote-footer\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n </Host>\n );\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"],"mappings":"kDAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,mBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,iBACAA,EAAA,qBACAA,EAAA,iBACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,qBACAA,EAAA,eACAA,EAAA,mBACAA,EAAA,mBACAA,EAAA,6BACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,aACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,mBACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,eACAA,EAAA,qBACAA,EAAA,2BACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,kBACD,EA9BD,CAAYA,MAAW,KCAvB,MAAMC,EAAuB,G,MC6BhBC,EAAiB,M,yBAKXC,KAAAC,YAA0C,CAAEC,IAAK,UAAWC,MAAO,OAAQC,KAAM,W,mCAFzE,I,CAIzB,MAAAC,GACE,MAAMC,EAAc,IAAIC,KAAKP,KAAKQ,QAAQC,WAAWC,aACrD,MAAMC,EAAUX,KAAKQ,QAAQC,WAAWG,eAAeC,KAAKC,MAAK,CAACC,EAAGC,IAAMD,EAAEE,MAAQD,EAAEC,QAAOC,KAAI,CAACC,EAAKC,IAAUpB,KAAKqB,cAAcF,EAAKC,KAC1I,OACEE,EAACC,EAAI,KACHD,EAAA,cACEA,EAAA,cAAYE,MAAM,cAChBF,EAAA,MAAIE,MAAM,kBAAkBxB,KAAKQ,QAAQC,WAAWgB,OAEtDH,EAAA,cAAYE,MAAM,qBACflB,EAAYoB,mBAAmB,QAAS1B,KAAKC,aAAY,OAAKqB,EAAA,QAAMK,MAAM,UAAU3B,KAAKQ,QAAQC,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YuE,YACjB,KAAKvE,EAAYwE,YACjB,KAAKxE,EAAYyE,IACjB,KAAKzE,EAAY0E,IACjB,KAAK1E,EAAY2E,aACjB,KAAK3E,EAAY4E,OACjB,KAAK5E,EAAY6E,WACjB,QACE,OAAOpD,EAAA,OAAKE,MAAM,yCAAuC,6B"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["aicoNewsListCss","AicoNewsList","this","pageSize","connectedCallback","newsListFetchController","AbortController","pageNumber","api","baseApi","aicoUrl","bearerToken","aicoBearerToken","disconnectedCallback","abort","componentWillLoad","newsResponse","fetchNewsArticles","signal","newsChannels","newsSellerIds","newsBrandIds","newsLanguageLocales","componentWillUpdate","render","h","Host","class","_a","data","map","article","onArticleClick","e","articleClick","emit","detail","_b","links","prev","style","cursor","onClick","xmlns","fill","width","height","viewBox","d","previousButtonText","getViewablePages","page","Number","_c","next","meta","lastPage","nextButtonText","lookAhead","pages","push","i","_d","_f","_e","_g"],"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":[null,"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() newsSellerIds: string[] = [];\n\n @Prop() newsBrandIds: string[] = [];\n\n @Prop() newsLanguageLocales: 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(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController!.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\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?.me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AI3D,KAAKK,WAAamD,EAAWG,EAAI3D,KAAKK,WAAYsD,GAAK,EAAG,CACrE,GAAIA,GAAK,EAAG,CACVF,EAAMC,KAAK,GAAGC,I,EAIlBF,EAAMC,KAAK,GAAG1D,KAAKK,cACnB,IAAK,IAAIsD,EAAI3D,KAAKK,WAAa,EAAGsD,GAAK3D,KAAKK,WAAamD,EAAWG,GAAK,EAAG,CAC1E,GAAIA,KAAMxB,GAAAT,EAAA1B,KAAKc,gBAAY,MAAAY,SAAA,SAAAA,EAAE2B,KAAKJ,KAAKK,YAAQ,MAAAnB,SAAA,EAAAA,EAAI,GAAI,CACrDsB,EAAMC,KAAK,GAAGC,I,EAIlB,GAAI3D,KAAKK,WAAamD,IAAaI,GAAAT,EAAAnD,KAAKc,gBAAY,MAAAqC,SAAA,SAAAA,EAAEE,KAAKJ,KAAKK,YAAQ,MAAAM,SAAA,EAAAA,EAAI,GAAK,EAAG,CAClFH,EAAMC,KAAK,M,CAGb,GAAI1D,KAAKK,WAAamD,KAAcK,GAAAC,EAAA9D,KAAKc,gBAAY,MAAAgD,SAAA,SAAAA,EAAET,KAAKJ,KAAKK,YAAQ,MAAAO,SAAA,EAAAA,EAAI,GAAK,EAAG,CACnFJ,EAAMC,KAAK,IAAGK,EAAA/D,KAAKc,gBAAY,MAAAiD,SAAA,SAAAA,EAAEV,KAAKJ,KAAKK,W,CAG7C,OAAOG,C"}
@@ -1,2 +0,0 @@
1
- import{r as t,h as i}from"./p-ae20e789.js";import{f as e,a as s}from"./p-e187bbea.js";const h="";const r=class{constructor(i){t(this,i);this.article=undefined;this.aicoUrl=undefined;this.aicoBearerToken=undefined;this.locale="de";this.articleId=undefined;this.articleUrlHandle=undefined}connectedCallback(){this.articleFetchController=new AbortController;this.api={baseApi:this.aicoUrl,bearerToken:this.aicoBearerToken}}disconnectedCallback(){this.articleFetchController.abort("disconnected")}async componentWillLoad(){if(!this.articleId&&!this.articleUrlHandle){throw new Error("Either the article id or the url handle must be provided.")}if(this.articleUrlHandle){this.article=await e(this.api,this.articleUrlHandle,this.articleFetchController.signal);return}this.article=await s(this.api,this.articleId,this.articleFetchController.signal)}render(){return i("aico-article-detail",{article:this.article,locale:this.locale})}};r.style=h;export{r as aico_fetch_article_detail};
2
- //# sourceMappingURL=p-c69f0ecc.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["aicoFetchArticleDetailCss","AicoFetchArticleDetail","connectedCallback","this","articleFetchController","AbortController","api","baseApi","aicoUrl","bearerToken","aicoBearerToken","disconnectedCallback","abort","componentWillLoad","articleId","articleUrlHandle","Error","article","fetchNewsArticleByHandle","signal","fetchNewsArticle","render","h","locale"],"sources":["src/components/aico-fetch-article-detail/aico-fetch-article-detail.css?tag=aico-fetch-article-detail&encapsulation=scoped","src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"sourcesContent":[null,"import { Component, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\n\n@Component({\n tag: 'aico-fetch-article-detail',\n styleUrl: 'aico-fetch-article-detail.css',\n scoped: true,\n})\nexport class AicoFetchArticleDetail {\n @State() article!: Article;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() locale: string = 'de';\n\n /**\n * The id will be used to fetch the article.\n *\n * If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleId?: string;\n\n /**\n * The url handle will be used to fetch the article.\n *\n * If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleUrlHandle?: string;\n\n private api?: AicoApiRequestInfo;\n private articleFetchController?: AbortController;\n\n connectedCallback() {\n this.articleFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.articleFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n if (!this.articleId && !this.articleUrlHandle) {\n throw new Error('Either the article id or the url handle must be provided.');\n }\n\n if (this.articleUrlHandle) {\n this.article = await fetchNewsArticleByHandle(this.api!, this.articleUrlHandle, this.articleFetchController!.signal);\n return;\n }\n\n this.article = await fetchNewsArticle(this.api!, this.articleId!, this.articleFetchController!.signal);\n }\n\n render() {\n return <aico-article-detail article={this.article} locale={this.locale} />;\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAA4B,G,MCUrBC,EAAsB,M,kHAOR,K,yDAmBzB,iBAAAC,GACEC,KAAKC,uBAAyB,IAAIC,gBAClCF,KAAKG,IAAM,CAAEC,QAASJ,KAAKK,QAASC,YAAaN,KAAKO,gB,CAGxD,oBAAAC,GACER,KAAKC,uBAAwBQ,MAAM,e,CAGrC,uBAAMC,GACJ,IAAKV,KAAKW,YAAcX,KAAKY,iBAAkB,CAC7C,MAAM,IAAIC,MAAM,4D,CAGlB,GAAIb,KAAKY,iBAAkB,CACzBZ,KAAKc,cAAgBC,EAAyBf,KAAKG,IAAMH,KAAKY,iBAAkBZ,KAAKC,uBAAwBe,QAC7G,M,CAGFhB,KAAKc,cAAgBG,EAAiBjB,KAAKG,IAAMH,KAAKW,UAAYX,KAAKC,uBAAwBe,O,CAGjG,MAAAE,GACE,OAAOC,EAAA,uBAAqBL,QAASd,KAAKc,QAASM,OAAQpB,KAAKoB,Q"}