@aiconomy/aico-components 0.0.82 → 0.0.100

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 (92) hide show
  1. package/README.md +50 -36
  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-368addda.entry.js +2 -0
  5. package/dist/aico-components/p-368addda.entry.js.map +1 -0
  6. package/dist/aico-components/p-7f6fcb2e.entry.js +2 -0
  7. package/dist/aico-components/p-7f6fcb2e.entry.js.map +1 -0
  8. package/dist/aico-components/{p-c900f292.entry.js → p-c69f0ecc.entry.js} +2 -2
  9. package/dist/aico-components/{p-c900f292.entry.js.map → p-c69f0ecc.entry.js.map} +1 -1
  10. package/dist/aico-components/p-e187bbea.js +2 -0
  11. package/dist/aico-components/p-e187bbea.js.map +1 -0
  12. package/dist/aico-components/{p-7ea04e72.entry.js → p-eee603da.entry.js} +2 -2
  13. package/dist/cjs/aico-album-content_19.cjs.entry.js +1 -1
  14. package/dist/cjs/aico-components.cjs.js +1 -1
  15. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +1 -1
  16. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  17. package/dist/cjs/aico-news-list.cjs.entry.js +6 -3
  18. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  19. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +6 -3
  20. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/{utils-9ae3486f.js → utils-3d8a97f6.js} +16 -9
  23. package/dist/cjs/utils-3d8a97f6.js.map +1 -0
  24. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +2 -2
  25. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  26. package/dist/collection/components/aico-news-list/aico-news-list.js +53 -2
  27. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  28. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +53 -2
  29. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  30. package/dist/collection/utils/utils.js +15 -8
  31. package/dist/collection/utils/utils.js.map +1 -1
  32. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  33. package/dist/components/aico-news-list.js +8 -2
  34. package/dist/components/aico-news-list.js.map +1 -1
  35. package/dist/components/aico-special-news-carousel.js +8 -2
  36. package/dist/components/aico-special-news-carousel.js.map +1 -1
  37. package/dist/components/utils.js +15 -8
  38. package/dist/components/utils.js.map +1 -1
  39. package/dist/esm/aico-album-content_19.entry.js +1 -1
  40. package/dist/esm/aico-components.js +1 -1
  41. package/dist/esm/aico-fetch-article-detail.entry.js +1 -1
  42. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  43. package/dist/esm/aico-news-list.entry.js +6 -3
  44. package/dist/esm/aico-news-list.entry.js.map +1 -1
  45. package/dist/esm/aico-special-news-carousel.entry.js +6 -3
  46. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  47. package/dist/esm/loader.js +1 -1
  48. package/dist/esm/{utils-25eef7c7.js → utils-f81eb958.js} +16 -9
  49. package/dist/esm/utils-f81eb958.js.map +1 -0
  50. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +2 -4
  51. package/dist/types/components/aico-news-list/aico-news-list.d.ts +3 -0
  52. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +3 -0
  53. package/dist/types/components.d.ts +16 -4
  54. package/dist/types/utils/utils.d.ts +2 -2
  55. package/docs/components/aico-article-detail/readme.md +83 -0
  56. package/docs/components/aico-fetch-article-detail/readme.md +63 -0
  57. package/docs/components/aico-news-list/readme.md +44 -0
  58. package/docs/components/aico-news-list-item/readme.md +37 -0
  59. package/docs/components/aico-special-news-carousel/readme.md +30 -0
  60. package/docs/components/content/aico-album-content/readme.md +30 -0
  61. package/docs/components/content/aico-asking-content/readme.md +31 -0
  62. package/docs/components/content/aico-asking-list-content/readme.md +10 -0
  63. package/docs/components/content/aico-block-quote-content/readme.md +31 -0
  64. package/docs/components/content/aico-bullet-content/readme.md +37 -0
  65. package/docs/components/content/aico-carousel-content/readme.md +38 -0
  66. package/docs/components/content/aico-collection-content/readme.md +10 -0
  67. package/docs/components/content/aico-content-card-content/readme.md +37 -0
  68. package/docs/components/content/aico-divider-content/readme.md +31 -0
  69. package/docs/components/content/aico-document-content/readme.md +31 -0
  70. package/docs/components/content/aico-faq-content/readme.md +31 -0
  71. package/docs/components/content/aico-heading-content/readme.md +37 -0
  72. package/docs/components/content/aico-html-content/readme.md +31 -0
  73. package/docs/components/content/aico-link-content/readme.md +31 -0
  74. package/docs/components/content/aico-news-content/readme.md +37 -0
  75. package/docs/components/content/aico-no-content/readme.md +23 -0
  76. package/docs/components/content/aico-page-content/readme.md +38 -0
  77. package/docs/components/content/aico-table-content/readme.md +37 -0
  78. package/docs/components/content/aico-testimonial-content/readme.md +30 -0
  79. package/docs/components/content/aico-text-content/readme.md +37 -0
  80. package/docs/components/content/aico-title-content/readme.md +52 -0
  81. package/docs/components/content/aico-upload-content/readme.md +37 -0
  82. package/docs/components/content/aico-video-content/readme.md +37 -0
  83. package/package.json +3 -2
  84. package/dist/aico-components/p-59bfd021.js +0 -2
  85. package/dist/aico-components/p-59bfd021.js.map +0 -1
  86. package/dist/aico-components/p-80cb133a.entry.js +0 -2
  87. package/dist/aico-components/p-80cb133a.entry.js.map +0 -1
  88. package/dist/aico-components/p-918b9928.entry.js +0 -2
  89. package/dist/aico-components/p-918b9928.entry.js.map +0 -1
  90. package/dist/cjs/utils-9ae3486f.js.map +0 -1
  91. package/dist/esm/utils-25eef7c7.js.map +0 -1
  92. /package/dist/aico-components/{p-7ea04e72.entry.js.map → p-eee603da.entry.js.map} +0 -0
package/README.md CHANGED
@@ -32,9 +32,9 @@ There are three strategies we recommend for using web components built with Sten
32
32
  - Put the following tags in the head of your `index.html`:
33
33
 
34
34
  ```html
35
- <link rel="stylesheet" href="https://unpkg.com/@aiconomy/aico-components@<version>/dist/aico-components/aico-components.css" />
36
- <script type="module" src="https://unpkg.com/@aiconomy/aico-components@<version>/dist/aico-components/aico-components.esm.js"></script>
37
- <script nomodule src="https://unpkg.com/@aiconomy/aico-components@<version>/dist/esm/aico-components.js"></script>
35
+ <link rel="stylesheet" href="node_modules/@aiconomy/aico-components/dist/aico-components/aico-components.css"/>
36
+ <script type="module" src="node_modules/@aiconomy/aico-components/dist/aico-components/aico-components.esm.js"></script>
37
+ <script nomodule src="node_modules/@aiconomy/aico-components/dist/esm/aico-components.js"></script>
38
38
  ```
39
39
 
40
40
  - Then you can use the elements anywhere in your template, JSX, html etc
@@ -45,41 +45,55 @@ There are three strategies we recommend for using web components built with Sten
45
45
  - Add an import to the npm packages `import needed-aico-component;`
46
46
  - Then you can use the elements anywhere in your template, JSX, html etc
47
47
 
48
- ## Listening to element
48
+ ## Listening to element events
49
49
 
50
50
  Please check out [Stencil's documentation](https://stenciljs.com/docs/events#listening-to-events-from-a-non-jsx-element).
51
51
 
52
52
  ## Aiconomy components
53
53
 
54
- ### Primary components
55
-
56
- - [aico-article-detail](/src/components/aico-article-detail/readme.md)
57
- - [aico-fetch-article-detail](/src/components/aico-fetch-article-detail/readme.md)
58
- - [aico-news-list](/src/components/aico-news-list/readme.md)
59
- - [aico-news-list-item](/src/components/aico-news-list-item/readme.md)
60
- - [aico-special-news-carousel](/src/components/aico-special-news-carousel/readme.md)
61
-
62
- ### Secondary components
63
-
64
- These are used by the [aico-article-detail](/src/components/aico-article-detail/readme.md) component to be able to render the article's content.
65
-
66
- - [aico-album-content](/src/components/content/aico-album-content/readme.md)
67
- - [aico-asking-content](/src/components/content/aico-asking-content/readme.md)
68
- - [aico-block-quote-content](/src/components/content/aico-block-quote-content/readme.md)
69
- - [aico-bullet-content](/src/components/content/aico-bullet-content/readme.md)
70
- - [aico-carousel-content](/src/components/content/aico-carousel-content/readme.md)
71
- - [aico-content-card-content](/src/components/content/aico-content-card-content/readme.md)
72
- - [aico-divider-content](/src/components/content/aico-divider-content/readme.md)
73
- - [aico-document-content](/src/components/content/aico-document-content/readme.md)
74
- - [aico-faq-content](/src/components/content/aico-faq-content/readme.md)
75
- - [aico-heading-content](/src/components/content/aico-heading-content/readme.md)
76
- - [aico-html-content](/src/components/content/aico-html-content/readme.md)
77
- - [aico-link-content](/src/components/content/aico-link-content/readme.md)
78
- - [aico-news-content](/src/components/content/aico-news-content/readme.md)
79
- - [aico-page-content](/src/components/content/aico-page-content/readme.md)
80
- - [aico-table-content](/src/components/content/aico-table-content/readme.md)
81
- - [aico-testimonial-content](/src/components/content/aico-testimonial-content/readme.md)
82
- - [aico-text-content](/src/components/content/aico-text-content/readme.md)
83
- - [aico-title-content](/src/components/content/aico-title-content/readme.md)
84
- - [aico-upload-content](/src/components/content/aico-upload-content/readme.md)
85
- - [aico-video-content](/src/components/content/aico-video-content/readme.md)
54
+ Check the [docs](docs/) directory.
55
+
56
+ ## Additional example
57
+
58
+ ```html
59
+ <aico-fetch-article-detail
60
+ aico-url="<url>"
61
+ aico-bearer-token="<token>"
62
+ article-url-handle="<handle>"
63
+ locale="de_CH"
64
+ ></aico-fetch-article-detail>
65
+
66
+ <br /><br /><br />
67
+
68
+ <aico-special-news-carousel
69
+ aico-url="<url>"
70
+ aico-bearer-token="<token>"
71
+ ></aico-special-news-carousel>
72
+
73
+ <br /><br /><br />
74
+
75
+ <aico-news-list
76
+ aico-url="<url>"
77
+ aico-bearer-token="<token>"
78
+ ></aico-news-list>
79
+
80
+ <script>
81
+ function navigateToArticle(article) {
82
+ const url = new URL(window.location.href);
83
+ url.pathname = `pages/news-article/${article.attributes.urlHandle}`;
84
+ window.location.href = url.toString();
85
+ }
86
+
87
+ const newsList = document.querySelector("aico-news-list");
88
+ newsList.addEventListener("articleClick", (event) => {
89
+ navigateToArticle(event.detail);
90
+ });
91
+ newsList.newsChannels = []; // Add one or more channels
92
+
93
+ const newsCarousel = document.querySelector("aico-special-news-carousel");
94
+ newsCarousel.addEventListener("articleClicked", (event) => {
95
+ navigateToArticle(event.detail);
96
+ });
97
+ newsCarousel.newsChannels = []; // Add one or more channels
98
+ </script>
99
+ ```
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-ae20e789.js";export{s as setNonce}from"./p-ae20e789.js";const o=()=>{const t=import.meta.url;const o={};if(t!==""){o.resourcesUrl=new URL(".",t).href}return e(o)};o().then((e=>t([["p-c900f292",[[2,"aico-fetch-article-detail",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],locale:[1],articleId:[1,"article-id"],articleUrlHandle:[1,"article-url-handle"],article:[32]}]]],["p-80cb133a",[[2,"aico-news-list",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],nextButtonText:[1,"next-button-text"],previousButtonText:[1,"previous-button-text"],newsResponse:[32],pageNumber:[32]}]]],["p-68930822",[[6,"aico-asking-list-content"]]],["p-90c2d3dc",[[6,"aico-collection-content"]]],["p-918b9928",[[2,"aico-special-news-carousel",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],numberOfArticles:[2,"number-of-articles"],newsResponse:[32]}]]],["p-0b6e7469",[[2,"aico-title-content",{content:[16],locale:[1]}],[2,"aico-no-content"]]],["p-7ea04e72",[[2,"aico-bullet-content",{content:[16],locale:[1]}],[2,"aico-carousel-content",{content:[16],hasArrows:[4,"has-arrows"],locale:[1]}],[2,"aico-content-card-content",{content:[16],locale:[1]}],[2,"aico-heading-content",{content:[16],locale:[1]}],[2,"aico-table-content",{content:[16],locale:[1]}],[2,"aico-text-content",{content:[16],locale:[1]}],[2,"aico-upload-content",{content:[16],locale:[1]}],[2,"aico-video-content",{content:[16],locale:[1]}],[2,"aico-album-content",{content:[16]}],[2,"aico-asking-content",{content:[16],locale:[1]}],[2,"aico-block-quote-content",{content:[16],locale:[1]}],[2,"aico-divider-content",{content:[16],locale:[1]}],[2,"aico-document-content",{content:[16],locale:[1]}],[2,"aico-faq-content",{content:[16],locale:[1]}],[2,"aico-html-content",{content:[16],locale:[1]}],[2,"aico-link-content",{content:[16],locale:[1]}],[2,"aico-news-content",{content:[16]}],[2,"aico-page-content",{content:[16],locale:[1]}],[2,"aico-testimonial-content",{content:[16]}]]],["p-19752961",[[2,"aico-article-detail",{article:[16],locale:[1]}]]],["p-9ea26390",[[2,"aico-news-list-item",{article:[16]}]]]],e)));
1
+ import{p as e,b as t}from"./p-ae20e789.js";export{s as setNonce}from"./p-ae20e789.js";const n=()=>{const t=import.meta.url;const n={};if(t!==""){n.resourcesUrl=new URL(".",t).href}return e(n)};n().then((e=>t([["p-c69f0ecc",[[2,"aico-fetch-article-detail",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],locale:[1],articleId:[1,"article-id"],articleUrlHandle:[1,"article-url-handle"],article:[32]}]]],["p-368addda",[[2,"aico-news-list",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],newsSellerIds:[16],newsBrandIds:[16],newsLanguageLocales:[16],nextButtonText:[1,"next-button-text"],previousButtonText:[1,"previous-button-text"],newsResponse:[32],pageNumber:[32]}]]],["p-68930822",[[6,"aico-asking-list-content"]]],["p-90c2d3dc",[[6,"aico-collection-content"]]],["p-7f6fcb2e",[[2,"aico-special-news-carousel",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],newsSellerIds:[16],newsBrandIds:[16],newsLanguageLocales:[16],numberOfArticles:[2,"number-of-articles"],newsResponse:[32]}]]],["p-0b6e7469",[[2,"aico-title-content",{content:[16],locale:[1]}],[2,"aico-no-content"]]],["p-eee603da",[[2,"aico-bullet-content",{content:[16],locale:[1]}],[2,"aico-carousel-content",{content:[16],hasArrows:[4,"has-arrows"],locale:[1]}],[2,"aico-content-card-content",{content:[16],locale:[1]}],[2,"aico-heading-content",{content:[16],locale:[1]}],[2,"aico-table-content",{content:[16],locale:[1]}],[2,"aico-text-content",{content:[16],locale:[1]}],[2,"aico-upload-content",{content:[16],locale:[1]}],[2,"aico-video-content",{content:[16],locale:[1]}],[2,"aico-album-content",{content:[16]}],[2,"aico-asking-content",{content:[16],locale:[1]}],[2,"aico-block-quote-content",{content:[16],locale:[1]}],[2,"aico-divider-content",{content:[16],locale:[1]}],[2,"aico-document-content",{content:[16],locale:[1]}],[2,"aico-faq-content",{content:[16],locale:[1]}],[2,"aico-html-content",{content:[16],locale:[1]}],[2,"aico-link-content",{content:[16],locale:[1]}],[2,"aico-news-content",{content:[16]}],[2,"aico-page-content",{content:[16],locale:[1]}],[2,"aico-testimonial-content",{content:[16]}]]],["p-19752961",[[2,"aico-article-detail",{article:[16],locale:[1]}]]],["p-9ea26390",[[2,"aico-news-list-item",{article:[16]}]]]],e)));
2
2
  //# sourceMappingURL=aico-components.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","aicoUrl","aicoBearerToken","locale","articleId","articleUrlHandle","article","newsChannels","nextButtonText","previousButtonText","newsResponse","pageNumber","numberOfArticles","content","hasArrows"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.9.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAc,+CAAuC,CAAAC,QAAA,eAAAC,gBAAA,wBAAAC,OAAA,IAAAC,UAAA,iBAAAC,iBAAA,yBAAAC,QAAA,6CAAAL,QAAA,eAAAC,gBAAA,wBAAAK,aAAA,KAAAC,eAAA,uBAAAC,mBAAA,2BAAAC,aAAA,KAAAC,WAAA,wJAAAV,QAAA,eAAAC,gBAAA,wBAAAK,aAAA,KAAAK,iBAAA,yBAAAF,aAAA,iDAAAG,QAAA,KAAAV,OAAA,uEAAAU,QAAA,KAAAV,OAAA,kCAAAU,QAAA,KAAAC,UAAA,iBAAAX,OAAA,sCAAAU,QAAA,KAAAV,OAAA,iCAAAU,QAAA,KAAAV,OAAA,+BAAAU,QAAA,KAAAV,OAAA,8BAAAU,QAAA,KAAAV,OAAA,gCAAAU,QAAA,KAAAV,OAAA,+BAAAU,QAAA,KAAAV,OAAA,+BAAAU,QAAA,iCAAAA,QAAA,KAAAV,OAAA,qCAAAU,QAAA,KAAAV,OAAA,iCAAAU,QAAA,KAAAV,OAAA,kCAAAU,QAAA,KAAAV,OAAA,6BAAAU,QAAA,KAAAV,OAAA,8BAAAU,QAAA,KAAAV,OAAA,8BAAAU,QAAA,KAAAV,OAAA,8BAAAU,QAAA,+BAAAA,QAAA,KAAAV,OAAA,qCAAAU,QAAA,kDAAAP,QAAA,KAAAH,OAAA,iDAAAG,QAAA,UAAAP"}
1
+ {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","aicoUrl","aicoBearerToken","locale","articleId","articleUrlHandle","article","newsChannels","newsSellerIds","newsBrandIds","newsLanguageLocales","nextButtonText","previousButtonText","newsResponse","pageNumber","numberOfArticles","content","hasArrows"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.9.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAc,+CAAuC,CAAAC,QAAA,eAAAC,gBAAA,wBAAAC,OAAA,IAAAC,UAAA,iBAAAC,iBAAA,yBAAAC,QAAA,6CAAAL,QAAA,eAAAC,gBAAA,wBAAAK,aAAA,KAAAC,cAAA,KAAAC,aAAA,KAAAC,oBAAA,KAAAC,eAAA,uBAAAC,mBAAA,2BAAAC,aAAA,KAAAC,WAAA,wJAAAb,QAAA,eAAAC,gBAAA,wBAAAK,aAAA,KAAAC,cAAA,KAAAC,aAAA,KAAAC,oBAAA,KAAAK,iBAAA,yBAAAF,aAAA,iDAAAG,QAAA,KAAAb,OAAA,uEAAAa,QAAA,KAAAb,OAAA,kCAAAa,QAAA,KAAAC,UAAA,iBAAAd,OAAA,sCAAAa,QAAA,KAAAb,OAAA,iCAAAa,QAAA,KAAAb,OAAA,+BAAAa,QAAA,KAAAb,OAAA,8BAAAa,QAAA,KAAAb,OAAA,gCAAAa,QAAA,KAAAb,OAAA,+BAAAa,QAAA,KAAAb,OAAA,+BAAAa,QAAA,iCAAAA,QAAA,KAAAb,OAAA,qCAAAa,QAAA,KAAAb,OAAA,iCAAAa,QAAA,KAAAb,OAAA,kCAAAa,QAAA,KAAAb,OAAA,6BAAAa,QAAA,KAAAb,OAAA,8BAAAa,QAAA,KAAAb,OAAA,8BAAAa,QAAA,KAAAb,OAAA,8BAAAa,QAAA,+BAAAA,QAAA,KAAAb,OAAA,qCAAAa,QAAA,kDAAAV,QAAA,KAAAH,OAAA,iDAAAG,QAAA,UAAAP"}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as s,h as t,H as e}from"./p-ae20e789.js";import{b as l}from"./p-e187bbea.js";const o="";const n=class{constructor(t){i(this,t);this.articleClick=s(this,"articleClick",7);this.pageSize=16;this.newsResponse=undefined;this.pageNumber=1;this.aicoUrl=undefined;this.aicoBearerToken=undefined;this.newsChannels=[];this.newsSellerIds=[];this.newsBrandIds=[];this.newsLanguageLocales=[];this.nextButtonText="Next";this.previousButtonText="Previous"}connectedCallback(){this.newsListFetchController=new AbortController;this.pageNumber=1;this.api={baseApi:this.aicoUrl,bearerToken:this.aicoBearerToken}}disconnectedCallback(){this.newsListFetchController.abort("disconnected")}async componentWillLoad(){this.newsResponse=await l(this.api,this.pageNumber,this.pageSize,this.newsListFetchController.signal,this.newsChannels,this.newsSellerIds,this.newsBrandIds,this.newsLanguageLocales)}async componentWillUpdate(){this.newsListFetchController=new AbortController;this.newsResponse=await l(this.api,this.pageNumber,this.pageSize,this.newsListFetchController.signal,this.newsChannels,this.newsSellerIds,this.newsBrandIds,this.newsLanguageLocales)}render(){var i,s,l;return t(e,null,t("div",{class:"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4"},(i=this.newsResponse)===null||i===void 0?void 0:i.data.map((i=>t("div",{class:"col"},t("aico-news-list-item",{article:i,onArticleClick:i=>{var s;(s=this.articleClick)===null||s===void 0?void 0:s.emit(i.detail)}}))))),t("nav",{class:"w-100","aria-label":"News navigation"},t("ul",{class:"pagination justify-content-center"},t("li",{class:`page-item page-link user-select-none d-flex align-items-center ${!((s=this.newsResponse)===null||s===void 0?void 0:s.links.prev)?"disabled":""}`,style:{cursor:"pointer"},onClick:()=>{if(this.pageNumber>1){this.pageNumber-=1}return false}},t("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"},t("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"})),this.previousButtonText),this.getViewablePages().map((i=>t("li",{class:`page-item page-link user-select-none ${i==="..."?"disabled":Number(i)===this.pageNumber?"active":""}`,style:{cursor:"pointer"},onClick:()=>{if(i!=="..."){this.pageNumber=Number(i)}return false}},i))),t("li",{class:`page-item page-link user-select-none d-flex align-items-center ${!((l=this.newsResponse)===null||l===void 0?void 0:l.links.next)?"disabled":""}`,style:{cursor:"pointer"},onClick:()=>{var i,s;if(((i=this.newsResponse)===null||i===void 0?void 0:i.meta.page.lastPage)&&this.pageNumber<((s=this.newsResponse)===null||s===void 0?void 0:s.meta.page.lastPage)){this.pageNumber+=1}}},this.nextButtonText,t("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"},t("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"}))))))}getViewablePages(i=2){var s,t,e,l,o,n,h;const a=[];if(this.pageNumber-i>=2){a.push("1")}if(this.pageNumber-i>2){a.push("...")}for(let s=this.pageNumber-i;s<this.pageNumber;s+=1){if(s>=1){a.push(`${s}`)}}a.push(`${this.pageNumber}`);for(let e=this.pageNumber+1;e<=this.pageNumber+i;e+=1){if(e<=((t=(s=this.newsResponse)===null||s===void 0?void 0:s.meta.page.lastPage)!==null&&t!==void 0?t:0)){a.push(`${e}`)}}if(this.pageNumber+i<((l=(e=this.newsResponse)===null||e===void 0?void 0:e.meta.page.lastPage)!==null&&l!==void 0?l:0)-1){a.push("...")}if(this.pageNumber+i<=((n=(o=this.newsResponse)===null||o===void 0?void 0:o.meta.page.lastPage)!==null&&n!==void 0?n:0)-1){a.push(`${(h=this.newsResponse)===null||h===void 0?void 0:h.meta.page.lastPage}`)}return a}};n.style=o;export{n as aico_news_list};
2
+ //# sourceMappingURL=p-368addda.entry.js.map
@@ -0,0 +1 @@
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?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as s,h as e}from"./p-ae20e789.js";import{c as i}from"./p-e187bbea.js";import{j as a}from"./p-86c7fdc7.js";const o=".slick-slide.sc-aico-special-news-carousel>div.sc-aico-special-news-carousel{height:100% !important}";const c=class{constructor(e){t(this,e);this.articleClicked=s(this,"articleClicked",7);this.newsResponse=undefined;this.aicoUrl=undefined;this.aicoBearerToken=undefined;this.newsChannels=[];this.newsSellerIds=[];this.newsBrandIds=[];this.newsLanguageLocales=[];this.numberOfArticles=6}connectedCallback(){this.newsListFetchController=new AbortController;this.api={baseApi:this.aicoUrl,bearerToken:this.aicoBearerToken}}disconnectedCallback(){this.newsListFetchController.abort("disconnected")}async componentWillLoad(){this.newsResponse=await i(this.api,1,this.numberOfArticles,this.newsListFetchController.signal,this.newsChannels,this.newsSellerIds,this.newsBrandIds,this.newsLanguageLocales)}async componentWillUpdate(){this.newsListFetchController=new AbortController;this.newsResponse=await i(this.api,1,this.numberOfArticles,this.newsListFetchController.signal,this.newsChannels,this.newsSellerIds,this.newsBrandIds,this.newsLanguageLocales)}componentDidLoad(){a(".carousel").slick({autoplay:true,autoplaySpeed:6e3,dots:true,arrows:false,pauseOnDotsHover:true})}render(){return e("div",{class:"carousel"},this.newsResponse.data.map((t=>{var s;const i=t.attributes.focusXPercentage?`${t.attributes.focusXPercentage}%`:"center";const a=t.attributes.focusYPercentage?`${t.attributes.focusYPercentage}%`:"center";return e("div",{class:"carousel-item card border-0"},e("div",{class:"card-body"},e("h5",{class:"card-title text-center text-uppercase"},e("a",{class:"text-reset text-decoration-none",href:"#",onClick:s=>{var e;s.preventDefault();(e=this.articleClicked)===null||e===void 0?void 0:e.emit(t)}},t.attributes.name))),e("div",{class:"ratio ratio-16x9 mx-auto",style:{"max-width":"50%"}},e("img",{class:"card-img-bottom object-fit-cover",style:{"object-position":`${i} ${a}`,"min-height":"15rem"},alt:"News Picture","data-lazy":(s=t.attributes.optimizedImage)!==null&&s!==void 0?s:t.attributes.image})))})))}};c.style=o;export{c as aico_special_news_carousel};
2
+ //# sourceMappingURL=p-7f6fcb2e.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["aicoSpecialNewsCarouselCss","AicoSpecialNewsCarousel","connectedCallback","this","newsListFetchController","AbortController","api","baseApi","aicoUrl","bearerToken","aicoBearerToken","disconnectedCallback","abort","componentWillLoad","newsResponse","fetchSpecialNewsArticles","numberOfArticles","signal","newsChannels","newsSellerIds","newsBrandIds","newsLanguageLocales","componentWillUpdate","componentDidLoad","$","slick","autoplay","autoplaySpeed","dots","arrows","pauseOnDotsHover","render","h","class","data","map","article","focusX","attributes","focusXPercentage","focusY","focusYPercentage","href","onClick","e","preventDefault","_a","articleClicked","emit","name","style","alt","optimizedImage","image"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() newsSellerIds: string[] = [];\n\n @Prop() newsBrandIds: string[] = [];\n\n @Prop() newsLanguageLocales: string[] = [];\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\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 fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"mappings":"0HAAA,MAAMA,EAA6B,uG,MCctBC,EAAuB,M,4KAOD,G,mBAEC,G,kBAED,G,yBAEO,G,sBAEL,C,CAOnC,iBAAAC,GACEC,KAAKC,wBAA0B,IAAIC,gBACnCF,KAAKG,IAAM,CAAEC,QAASJ,KAAKK,QAASC,YAAaN,KAAKO,gB,CAGxD,oBAAAC,GACER,KAAKC,wBAAyBQ,MAAM,e,CAGtC,uBAAMC,GACJV,KAAKW,mBAAqBC,EACxBZ,KAAKG,IACL,EACAH,KAAKa,iBACLb,KAAKC,wBAAyBa,OAC9Bd,KAAKe,aACLf,KAAKgB,cACLhB,KAAKiB,aACLjB,KAAKkB,oB,CAIT,yBAAMC,GACJnB,KAAKC,wBAA0B,IAAIC,gBACnCF,KAAKW,mBAAqBC,EACxBZ,KAAKG,IACL,EACAH,KAAKa,iBACLb,KAAKC,wBAAwBa,OAC7Bd,KAAKe,aACLf,KAAKgB,cACLhB,KAAKiB,aACLjB,KAAKkB,oB,CAIT,gBAAAE,GACEC,EAAE,aAAaC,MAAM,CACnBC,SAAU,KACVC,cAAe,IACfC,KAAM,KACNC,OAAQ,MACRC,iBAAkB,M,CAItB,MAAAC,GACE,OACEC,EAAA,OAAKC,MAAM,YACR9B,KAAKW,aAAaoB,KAAKC,KAAIC,I,MAC1B,MAAMC,EAASD,EAAQE,WAAWC,iBAAmB,GAAGH,EAAQE,WAAWC,oBAAsB,SACjG,MAAMC,EAASJ,EAAQE,WAAWG,iBAAmB,GAAGL,EAAQE,WAAWG,oBAAsB,SACjG,OACET,EAAA,OAAKC,MAAM,+BACTD,EAAA,OAAKC,MAAM,aACTD,EAAA,MAAIC,MAAM,yCACRD,EAAA,KACEC,MAAM,kCACNS,KAAK,IACLC,QAASC,I,MACPA,EAAEC,kBACFC,EAAA3C,KAAK4C,kBAAc,MAAAD,SAAA,SAAAA,EAAEE,KAAKZ,EAAQ,GAGnCA,EAAQE,WAAWW,QAI1BjB,EAAA,OAAKC,MAAM,2BAA2BiB,MAAO,CAAE,YAAa,QAC1DlB,EAAA,OACEC,MAAM,mCACNiB,MAAO,CAAE,kBAAmB,GAAGb,KAAUG,IAAU,aAAc,SACjEW,IAAI,eAAc,aACPL,EAAAV,EAAQE,WAAWc,kBAAc,MAAAN,SAAA,EAAAA,EAAIV,EAAQE,WAAWe,SAGnE,I"}
@@ -1,2 +1,2 @@
1
- import{r as t,h as i}from"./p-ae20e789.js";import{f as e,a as s}from"./p-59bfd021.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-c900f292.entry.js.map
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 +1 @@
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 {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * 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 {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * 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,yDAqBzB,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"}
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"}
@@ -0,0 +1,2 @@
1
+ const e=e=>{const t=new Headers;t.append("Accept","application/vnd.api+json");t.append("Authorization",`Bearer ${e}`);return t};const t=(t,n,r,a)=>new Request(new URL(`${n}?${r.toString()}`,t.baseApi),{headers:e(t.bearerToken),signal:a});function n(e,t,n){for(const r of n){e.append(t,r)}}async function r(e,r,a,s,c=[],i=[],u=[],l=[]){const o=new URLSearchParams;o.set("page[number]",String(r));o.set("page[size]",String(a));o.set("sort","-publishDate");o.set("filter[isActive]","1");o.set("filter[excludeTag][]","Eisnull");n(o,"filter[channel][]",c);n(o,"filter[sellerIds][]",i);n(o,"filter[brandId][]",u);n(o,"filter[newsLanguage][]",l);const f=t(e,"news",o,s);const w=await fetch(f);return await w.json()}async function a(e,r,a,s,c=[],i=[],u=[],l=[]){const o=new URLSearchParams;o.set("page[number]",String(r));o.set("page[size]",String(a));o.set("sort","-publishDate");o.set("filter[isActive]","1");o.set("filter[isSpecialArticle]","1");o.set("filter[isLightVersion]","true");o.set("filter[excludeTag][]","Eisnull");n(o,"filter[channel][]",c);n(o,"filter[sellerIds][]",i);n(o,"filter[brandId][]",u);n(o,"filter[newsLanguage][]",l);const f=t(e,"news",o,s);const w=await fetch(f);return await w.json()}async function s(e,n,r){const a=t(e,`news/${n}`,new URLSearchParams,r);const s=await fetch(a);const c=await s.json();return c.data}async function c(e,n,r){const a=new URLSearchParams;a.set("filter[urlHandle]",n);const s=t(e,"news",a,r);const c=await fetch(s);const i=await c.json();return i.data[0]}function i(e){switch(e){case"extra-small":return"28%";case"small":return"40%";case"large":return"80%";case"extra large":return"100%";default:return"60%"}}function u(e){const t=/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;const n=e.match(t);if(n&&n[1].length==11){return`https://www.youtube.com/embed/${n[1]}`}return null}function l(e){if(!e||e===" "){return true}return false}function o(e){const t=[];for(const n of Object.entries(e)){if(n[1]){t.push(n[0])}}return t.join(" ")}export{s as a,r as b,a as c,o as d,u as e,c as f,i as g,l as s};
2
+ //# sourceMappingURL=p-e187bbea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getAuthenticatedHeaders","bearerToken","headers","Headers","append","getAuthenticatedRequest","api","route","query","signal","Request","URL","toString","baseApi","setArrayFilter","queryParams","key","values","value","async","fetchNewsArticles","page","size","newsChannels","newsSellerIds","newsBrandIds","newsLanguageLocales","URLSearchParams","set","String","request","response","fetch","json","fetchSpecialNewsArticles","fetchNewsArticle","articleId","article","data","fetchNewsArticleByHandle","urlHandle","articles","getImageWidthPrc","pictureSize","getYoutubeURL","url","regExp","match","length","strIsNullOrEmptyOrWhitespace","str","getClass","conditions","classes","kvp","Object","entries","push","join"],"sources":["src/model/AicoApiRequestInfo.ts","src/utils/utils.ts"],"sourcesContent":["export type AicoApiRequestInfo = {\n baseApi: string;\n bearerToken: string;\n};\n\nexport const getAuthenticatedHeaders = (bearerToken: string): Headers => {\n const headers = new Headers();\n headers.append('Accept', 'application/vnd.api+json');\n headers.append('Authorization', `Bearer ${bearerToken}`);\n return headers;\n};\n\nexport const getAuthenticatedRequest = (api: AicoApiRequestInfo, route: string, query: URLSearchParams, signal?: AbortSignal): Request => {\n return new Request(new URL(`${route}?${query.toString()}`, api.baseApi), {\n headers: getAuthenticatedHeaders(api.bearerToken),\n signal,\n });\n};\n","import { Article } from '../components';\nimport { AicoApiRequestInfo, getAuthenticatedHeaders, getAuthenticatedRequest } from '../model/AicoApiRequestInfo';\nimport { NewsResponse } from '../model/NewsResponse';\n\nfunction setArrayFilter(queryParams: URLSearchParams, key: string, values: string[]) {\n for (const value of values) {\n queryParams.append(key, value);\n }\n}\n\nexport async function fetchNewsArticles(\n api: AicoApiRequestInfo,\n page: number,\n size: number,\n signal: AbortSignal,\n newsChannels: string[] = [],\n newsSellerIds: string[] = [],\n newsBrandIds: string[] = [],\n newsLanguageLocales: string[] = [],\n): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n setArrayFilter(queryParams, 'filter[channel][]', newsChannels);\n setArrayFilter(queryParams, 'filter[sellerIds][]', newsSellerIds);\n setArrayFilter(queryParams, 'filter[brandId][]', newsBrandIds);\n setArrayFilter(queryParams, 'filter[newsLanguage][]', newsLanguageLocales);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchSpecialNewsArticles(\n api: AicoApiRequestInfo,\n page: number,\n size: number,\n signal: AbortSignal,\n newsChannels: string[] = [],\n newsSellerIds: string[] = [],\n newsBrandIds: string[] = [],\n newsLanguageLocales: string[] = [],\n): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[isSpecialArticle]', '1');\n queryParams.set('filter[isLightVersion]', 'true');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n setArrayFilter(queryParams, 'filter[channel][]', newsChannels);\n setArrayFilter(queryParams, 'filter[sellerIds][]', newsSellerIds);\n setArrayFilter(queryParams, 'filter[brandId][]', newsBrandIds);\n setArrayFilter(queryParams, 'filter[newsLanguage][]', newsLanguageLocales);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article> {\n const request = getAuthenticatedRequest(api, `news/${articleId}`, new URLSearchParams(), signal);\n const response = await fetch(request);\n const article = await response.json();\n return article.data;\n}\n\nexport async function fetchNewsArticleByHandle(api: AicoApiRequestInfo, urlHandle: string, signal: AbortSignal): Promise<Article> {\n const queryParams = new URLSearchParams();\n queryParams.set('filter[urlHandle]', urlHandle);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n const articles = await response.json();\n return articles.data[0];\n}\n\nexport async function fetchArticle(url: string, bearerToken: string, signal: AbortSignal): Promise<Article> {\n const request = new Request(new URL(url), {\n headers: getAuthenticatedHeaders(bearerToken),\n signal,\n });\n const response = await fetch(request);\n return await response.json();\n}\n\nexport function getImageWidthPrc(pictureSize?: string): string {\n switch (pictureSize) {\n case 'extra-small':\n return '28%';\n case 'small':\n return '40%';\n case 'large':\n return '80%';\n case 'extra large': // TODO: has - or not?\n return '100%';\n default:\n return '60%';\n }\n}\n\nexport function getYoutubeURL(url: string): string | null {\n const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#&?]*).*/;\n const match = url.match(regExp);\n if (match && match[1].length == 11) {\n return `https://www.youtube.com/embed/${match[1]}`;\n }\n\n return null;\n}\n\nexport function strIsNullOrEmptyOrWhitespace(str?: string | null): boolean {\n if (!str || str === ' ') {\n return true;\n }\n\n return false;\n}\n\nexport function getClass(conditions: { [key: string]: boolean }): string {\n const classes: string[] = [];\n for (const kvp of Object.entries(conditions)) {\n if (kvp[1]) {\n classes.push(kvp[0]);\n }\n }\n\n return classes.join(' ');\n}\n"],"mappings":"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"}