@aiconomy/aico-components 0.0.14 → 0.0.57

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 (568) hide show
  1. package/README.md +67 -57
  2. package/dist/aico-components/aico-components.css +6 -0
  3. package/dist/aico-components/aico-components.esm.js +1 -1
  4. package/dist/aico-components/aico-components.esm.js.map +1 -1
  5. package/dist/aico-components/assets/slick/ajax-loader.gif +0 -0
  6. package/dist/aico-components/assets/slick/slick.eot +0 -0
  7. package/dist/aico-components/assets/slick/slick.svg +14 -0
  8. package/dist/aico-components/assets/slick/slick.ttf +0 -0
  9. package/dist/aico-components/assets/slick/slick.woff +0 -0
  10. package/dist/aico-components/p-0ca1f065.entry.js +2 -0
  11. package/dist/aico-components/p-0ca1f065.entry.js.map +1 -0
  12. package/dist/aico-components/p-1c4a07ef.entry.js +7 -0
  13. package/dist/aico-components/p-1c4a07ef.entry.js.map +1 -0
  14. package/dist/aico-components/p-406fa2e5.entry.js +2 -0
  15. package/dist/aico-components/p-406fa2e5.entry.js.map +1 -0
  16. package/dist/aico-components/p-4c0f3325.entry.js +2 -0
  17. package/dist/aico-components/p-4c0f3325.entry.js.map +1 -0
  18. package/dist/aico-components/p-5109399b.entry.js +2 -0
  19. package/dist/aico-components/p-5109399b.entry.js.map +1 -0
  20. package/dist/aico-components/p-6464810e.entry.js +2 -0
  21. package/dist/aico-components/p-6464810e.entry.js.map +1 -0
  22. package/dist/aico-components/p-68930822.entry.js +2 -0
  23. package/dist/aico-components/p-68930822.entry.js.map +1 -0
  24. package/dist/aico-components/p-86c7fdc7.js +13 -0
  25. package/dist/aico-components/p-86c7fdc7.js.map +1 -0
  26. package/dist/aico-components/p-90c2d3dc.entry.js +2 -0
  27. package/dist/aico-components/p-90c2d3dc.entry.js.map +1 -0
  28. package/dist/aico-components/p-ae20e789.js +3 -0
  29. package/dist/aico-components/p-ae20e789.js.map +1 -0
  30. package/dist/aico-components/p-b1f8308f.entry.js +2 -0
  31. package/dist/aico-components/p-b1f8308f.entry.js.map +1 -0
  32. package/dist/aico-components/p-dfd3b0d3.js +2 -0
  33. package/dist/aico-components/p-dfd3b0d3.js.map +1 -0
  34. package/dist/cjs/aico-album-content_19.cjs.entry.js +6904 -0
  35. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -0
  36. package/dist/cjs/aico-article-detail.cjs.entry.js +124 -0
  37. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -0
  38. package/dist/cjs/aico-asking-list-content.cjs.entry.js +21 -0
  39. package/dist/cjs/aico-asking-list-content.cjs.entry.js.map +1 -0
  40. package/dist/cjs/aico-collection-content.cjs.entry.js +21 -0
  41. package/dist/cjs/aico-collection-content.cjs.entry.js.map +1 -0
  42. package/dist/cjs/aico-components.cjs.js +2 -2
  43. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +44 -0
  44. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -0
  45. package/dist/cjs/aico-news-list-item.cjs.entry.js +27 -0
  46. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -0
  47. package/dist/cjs/aico-news-list.cjs.entry.js +92 -0
  48. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -0
  49. package/dist/cjs/aico-no-content_2.cjs.entry.js +49 -0
  50. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -0
  51. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +60 -0
  52. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -0
  53. package/dist/cjs/{index-222c33f1.js → index-e52034b7.js} +864 -28
  54. package/dist/cjs/index-e52034b7.js.map +1 -0
  55. package/dist/cjs/loader.cjs.js +2 -2
  56. package/dist/cjs/slick-d0dfbd94.js +13662 -0
  57. package/dist/cjs/slick-d0dfbd94.js.map +1 -0
  58. package/dist/cjs/utils-095ed22b.js +101 -0
  59. package/dist/cjs/utils-095ed22b.js.map +1 -0
  60. package/dist/collection/assets/slick/ajax-loader.gif +0 -0
  61. package/dist/collection/assets/slick/slick.eot +0 -0
  62. package/dist/collection/assets/slick/slick.svg +14 -0
  63. package/dist/collection/assets/slick/slick.ttf +0 -0
  64. package/dist/collection/assets/slick/slick.woff +0 -0
  65. package/dist/collection/collection-manifest.json +28 -1
  66. package/dist/collection/components/aico-article-detail/aico-article-detail.css +0 -0
  67. package/dist/collection/components/aico-article-detail/aico-article-detail.js +117 -0
  68. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -0
  69. package/dist/collection/components/aico-article-detail/test/aico-article-detail.e2e.js +6 -0
  70. package/dist/collection/components/aico-article-detail/test/aico-article-detail.e2e.js.map +1 -0
  71. package/dist/collection/components/aico-article-detail/test/aico-article-detail.spec.js +6 -0
  72. package/dist/collection/components/aico-article-detail/test/aico-article-detail.spec.js.map +1 -0
  73. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.css +0 -0
  74. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +121 -0
  75. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -0
  76. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js +25 -0
  77. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js.map +1 -0
  78. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.e2e.js +6 -0
  79. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.e2e.js.map +1 -0
  80. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.spec.js +6 -0
  81. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.spec.js.map +1 -0
  82. package/dist/collection/components/aico-news-list/aico-news-list.css +0 -0
  83. package/dist/collection/components/aico-news-list/aico-news-list.js +195 -0
  84. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -0
  85. package/dist/collection/components/aico-news-list/aico-news-list.stories.js +24 -0
  86. package/dist/collection/components/aico-news-list/aico-news-list.stories.js.map +1 -0
  87. package/dist/collection/components/aico-news-list/test/aico-news-list.e2e.js +6 -0
  88. package/dist/collection/components/aico-news-list/test/aico-news-list.e2e.js.map +1 -0
  89. package/dist/collection/components/aico-news-list/test/aico-news-list.spec.js +6 -0
  90. package/dist/collection/components/aico-news-list/test/aico-news-list.spec.js.map +1 -0
  91. package/dist/collection/components/aico-news-list-item/aico-news-list-item.css +0 -0
  92. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +75 -0
  93. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -0
  94. package/dist/collection/components/aico-news-list-item/aico-news-list-item.stories.js +61 -0
  95. package/dist/collection/components/aico-news-list-item/aico-news-list-item.stories.js.map +1 -0
  96. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.e2e.js +6 -0
  97. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.e2e.js.map +1 -0
  98. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.spec.js +6 -0
  99. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.spec.js.map +1 -0
  100. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.css +3 -0
  101. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +145 -0
  102. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -0
  103. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.stories.js +30 -0
  104. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.stories.js.map +1 -0
  105. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.e2e.js +6 -0
  106. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.e2e.js.map +1 -0
  107. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.spec.js +6 -0
  108. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.spec.js.map +1 -0
  109. package/dist/collection/components/content/aico-album-content/aico-album-content.css +0 -0
  110. package/dist/collection/components/content/aico-album-content/aico-album-content.js +104 -0
  111. package/dist/collection/components/content/aico-album-content/aico-album-content.js.map +1 -0
  112. package/dist/collection/components/content/aico-album-content/aico-album-content.stories.js +70 -0
  113. package/dist/collection/components/content/aico-album-content/aico-album-content.stories.js.map +1 -0
  114. package/dist/collection/components/content/aico-asking-content/aico-asking-content.css +63 -0
  115. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +49 -0
  116. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -0
  117. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +37 -0
  118. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -0
  119. package/dist/collection/components/content/aico-asking-list-content/aico-asking-list-content.css +85 -0
  120. package/dist/collection/components/content/aico-asking-list-content/aico-asking-list-content.js +19 -0
  121. package/dist/collection/components/content/aico-asking-list-content/aico-asking-list-content.js.map +1 -0
  122. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.css +0 -0
  123. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +49 -0
  124. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -0
  125. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +26 -0
  126. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -0
  127. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.css +0 -0
  128. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +79 -0
  129. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -0
  130. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +71 -0
  131. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -0
  132. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.css +1 -0
  133. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +95 -0
  134. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -0
  135. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +73 -0
  136. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -0
  137. package/dist/collection/components/content/aico-collection-content/aico-collection-content.js +19 -0
  138. package/dist/collection/components/content/aico-collection-content/aico-collection-content.js.map +1 -0
  139. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.css +0 -0
  140. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +62 -0
  141. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -0
  142. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +26 -0
  143. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -0
  144. package/dist/collection/components/content/aico-divider-content/aico-divider-content.css +0 -0
  145. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +49 -0
  146. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -0
  147. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +23 -0
  148. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -0
  149. package/dist/collection/components/content/aico-document-content/aico-document-content.css +8 -0
  150. package/dist/collection/components/content/aico-document-content/aico-document-content.js +73 -0
  151. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -0
  152. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +30 -0
  153. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -0
  154. package/dist/collection/components/content/aico-faq-content/aico-faq-content.css +0 -0
  155. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +54 -0
  156. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -0
  157. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +60 -0
  158. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -0
  159. package/dist/collection/components/content/aico-heading-content/aico-heading-content.css +36 -0
  160. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +81 -0
  161. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -0
  162. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +31 -0
  163. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -0
  164. package/dist/collection/components/content/aico-html-content/aico-html-content.css +3 -0
  165. package/dist/collection/components/content/aico-html-content/aico-html-content.js +52 -0
  166. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -0
  167. package/dist/collection/components/content/aico-link-content/aico-link-content.css +37 -0
  168. package/dist/collection/components/content/aico-link-content/aico-link-content.js +68 -0
  169. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -0
  170. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +59 -0
  171. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -0
  172. package/dist/collection/components/content/aico-news-content/aico-news-content.css +11 -0
  173. package/dist/collection/components/content/aico-news-content/aico-news-content.js +79 -0
  174. package/dist/collection/components/content/aico-news-content/aico-news-content.js.map +1 -0
  175. package/dist/collection/components/content/aico-news-content/aico-news-content.stories.js +43 -0
  176. package/dist/collection/components/content/aico-news-content/aico-news-content.stories.js.map +1 -0
  177. package/dist/collection/components/content/aico-no-content/aico-no-content.css +3 -0
  178. package/dist/collection/components/content/aico-no-content/aico-no-content.js +19 -0
  179. package/dist/collection/components/content/aico-no-content/aico-no-content.js.map +1 -0
  180. package/dist/collection/components/content/aico-page-content/aico-page-content.css +3 -0
  181. package/dist/collection/components/content/aico-page-content/aico-page-content.js +79 -0
  182. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -0
  183. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +37 -0
  184. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -0
  185. package/dist/collection/components/content/aico-table-content/aico-table-content.css +21 -0
  186. package/dist/collection/components/content/aico-table-content/aico-table-content.js +73 -0
  187. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -0
  188. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +130 -0
  189. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -0
  190. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.css +93 -0
  191. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.js +51 -0
  192. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.js.map +1 -0
  193. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.stories.js +23 -0
  194. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.stories.js.map +1 -0
  195. package/dist/collection/components/content/aico-text-content/aico-text-content.css +0 -0
  196. package/dist/collection/components/content/aico-text-content/aico-text-content.js +127 -0
  197. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -0
  198. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +173 -0
  199. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -0
  200. package/dist/collection/components/content/aico-title-content/aico-title-content.css +3 -0
  201. package/dist/collection/components/content/aico-title-content/aico-title-content.js +61 -0
  202. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -0
  203. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +28 -0
  204. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -0
  205. package/dist/collection/components/content/aico-upload-content/aico-upload-content.css +3 -0
  206. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +66 -0
  207. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -0
  208. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +39 -0
  209. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -0
  210. package/dist/collection/components/content/aico-video-content/aico-video-content.css +10 -0
  211. package/dist/collection/components/content/aico-video-content/aico-video-content.js +62 -0
  212. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -0
  213. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +43 -0
  214. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -0
  215. package/dist/collection/model/AicoApiRequestInfo.js +13 -0
  216. package/dist/collection/model/AicoApiRequestInfo.js.map +1 -0
  217. package/dist/collection/model/Article.js +2 -0
  218. package/dist/collection/model/Article.js.map +1 -0
  219. package/dist/collection/model/Entity.js +7 -0
  220. package/dist/collection/model/Entity.js.map +1 -0
  221. package/dist/collection/model/NewsCategory.js +2 -0
  222. package/dist/collection/model/NewsCategory.js.map +1 -0
  223. package/dist/collection/model/NewsResponse.js +2 -0
  224. package/dist/collection/model/NewsResponse.js.map +1 -0
  225. package/dist/collection/model/article/ContentType.js +33 -0
  226. package/dist/collection/model/article/ContentType.js.map +1 -0
  227. package/dist/collection/model/article/Translation.js +8 -0
  228. package/dist/collection/model/article/Translation.js.map +1 -0
  229. package/dist/collection/model/article/content/AlbumContent.js +2 -0
  230. package/dist/collection/model/article/content/AlbumContent.js.map +1 -0
  231. package/dist/collection/model/article/content/AskingContent.js +21 -0
  232. package/dist/collection/model/article/content/AskingContent.js.map +1 -0
  233. package/dist/collection/model/article/content/AskingListContent.js +7 -0
  234. package/dist/collection/model/article/content/AskingListContent.js.map +1 -0
  235. package/dist/collection/model/article/content/BlockQuoteContent.js +2 -0
  236. package/dist/collection/model/article/content/BlockQuoteContent.js.map +1 -0
  237. package/dist/collection/model/article/content/BulletContent.js +2 -0
  238. package/dist/collection/model/article/content/BulletContent.js.map +1 -0
  239. package/dist/collection/model/article/content/CardContent.js +2 -0
  240. package/dist/collection/model/article/content/CardContent.js.map +1 -0
  241. package/dist/collection/model/article/content/CarouselContent.js +2 -0
  242. package/dist/collection/model/article/content/CarouselContent.js.map +1 -0
  243. package/dist/collection/model/article/content/CollectionContent.js +52 -0
  244. package/dist/collection/model/article/content/CollectionContent.js.map +1 -0
  245. package/dist/collection/model/article/content/DividerContent.js +2 -0
  246. package/dist/collection/model/article/content/DividerContent.js.map +1 -0
  247. package/dist/collection/model/article/content/DocumentContent.js +2 -0
  248. package/dist/collection/model/article/content/DocumentContent.js.map +1 -0
  249. package/dist/collection/model/article/content/FaqContent.js +12 -0
  250. package/dist/collection/model/article/content/FaqContent.js.map +1 -0
  251. package/dist/collection/model/article/content/HeadingContent.js +2 -0
  252. package/dist/collection/model/article/content/HeadingContent.js.map +1 -0
  253. package/dist/collection/model/article/content/HtmlContent.js +2 -0
  254. package/dist/collection/model/article/content/HtmlContent.js.map +1 -0
  255. package/dist/collection/model/article/content/LinkContent.js +2 -0
  256. package/dist/collection/model/article/content/LinkContent.js.map +1 -0
  257. package/dist/collection/model/article/content/NewsContent.js +19 -0
  258. package/dist/collection/model/article/content/NewsContent.js.map +1 -0
  259. package/dist/collection/model/article/content/PageContent.js +37 -0
  260. package/dist/collection/model/article/content/PageContent.js.map +1 -0
  261. package/dist/collection/model/article/content/TableContet.js +2 -0
  262. package/dist/collection/model/article/content/TableContet.js.map +1 -0
  263. package/dist/collection/model/article/content/TestimonialContent.js +2 -0
  264. package/dist/collection/model/article/content/TestimonialContent.js.map +1 -0
  265. package/dist/collection/model/article/content/TextContent.js +2 -0
  266. package/dist/collection/model/article/content/TextContent.js.map +1 -0
  267. package/dist/collection/model/article/content/TitleContent.js +2 -0
  268. package/dist/collection/model/article/content/TitleContent.js.map +1 -0
  269. package/dist/collection/model/article/content/UploadContent.js +13 -0
  270. package/dist/collection/model/article/content/UploadContent.js.map +1 -0
  271. package/dist/collection/model/article/content/VideoContent.js +2 -0
  272. package/dist/collection/model/article/content/VideoContent.js.map +1 -0
  273. package/dist/collection/model/article/content/news/NewsAlbum.js +20 -0
  274. package/dist/collection/model/article/content/news/NewsAlbum.js.map +1 -0
  275. package/dist/collection/model/article/content/news/NewsArticle.js +43 -0
  276. package/dist/collection/model/article/content/news/NewsArticle.js.map +1 -0
  277. package/dist/collection/model/article/content/news/NewsCategory.js +17 -0
  278. package/dist/collection/model/article/content/news/NewsCategory.js.map +1 -0
  279. package/dist/collection/model/article/content/news/NewsTag.js +10 -0
  280. package/dist/collection/model/article/content/news/NewsTag.js.map +1 -0
  281. package/dist/collection/utils/ConditionalRender.js +5 -0
  282. package/dist/collection/utils/ConditionalRender.js.map +1 -0
  283. package/dist/collection/utils/ConditionalWrap.js +5 -0
  284. package/dist/collection/utils/ConditionalWrap.js.map +1 -0
  285. package/dist/collection/utils/utils.js +83 -2
  286. package/dist/collection/utils/utils.js.map +1 -1
  287. package/dist/collection/utils/utils.spec.js +4 -14
  288. package/dist/collection/utils/utils.spec.js.map +1 -1
  289. package/dist/components/ConditionalRender.js +7 -0
  290. package/dist/components/ConditionalRender.js.map +1 -0
  291. package/dist/components/aico-album-content.d.ts +11 -0
  292. package/dist/components/aico-album-content.js +8 -0
  293. package/dist/components/aico-album-content.js.map +1 -0
  294. package/dist/components/aico-album-content2.js +90 -0
  295. package/dist/components/aico-album-content2.js.map +1 -0
  296. package/dist/components/aico-article-detail.d.ts +11 -0
  297. package/dist/components/aico-article-detail.js +8 -0
  298. package/dist/components/aico-article-detail.js.map +1 -0
  299. package/dist/components/aico-article-detail2.js +262 -0
  300. package/dist/components/aico-article-detail2.js.map +1 -0
  301. package/dist/components/aico-asking-content.d.ts +11 -0
  302. package/dist/components/aico-asking-content.js +8 -0
  303. package/dist/components/aico-asking-content.js.map +1 -0
  304. package/dist/components/aico-asking-content2.js +36 -0
  305. package/dist/components/aico-asking-content2.js.map +1 -0
  306. package/dist/components/aico-asking-list-content.d.ts +11 -0
  307. package/dist/components/aico-asking-list-content.js +34 -0
  308. package/dist/components/aico-asking-list-content.js.map +1 -0
  309. package/dist/components/aico-block-quote-content.d.ts +11 -0
  310. package/dist/components/aico-block-quote-content.js +8 -0
  311. package/dist/components/aico-block-quote-content.js.map +1 -0
  312. package/dist/components/aico-block-quote-content2.js +36 -0
  313. package/dist/components/aico-block-quote-content2.js.map +1 -0
  314. package/dist/components/aico-bullet-content.d.ts +11 -0
  315. package/dist/components/aico-bullet-content.js +8 -0
  316. package/dist/components/aico-bullet-content.js.map +1 -0
  317. package/dist/components/aico-bullet-content2.js +78 -0
  318. package/dist/components/aico-bullet-content2.js.map +1 -0
  319. package/dist/components/aico-carousel-content.d.ts +11 -0
  320. package/dist/components/aico-carousel-content.js +8 -0
  321. package/dist/components/aico-carousel-content.js.map +1 -0
  322. package/dist/components/aico-carousel-content2.js +76 -0
  323. package/dist/components/aico-carousel-content2.js.map +1 -0
  324. package/dist/components/aico-collection-content.d.ts +11 -0
  325. package/dist/components/aico-collection-content.js +34 -0
  326. package/dist/components/aico-collection-content.js.map +1 -0
  327. package/dist/components/aico-content-card-content.d.ts +11 -0
  328. package/dist/components/aico-content-card-content.js +8 -0
  329. package/dist/components/aico-content-card-content.js.map +1 -0
  330. package/dist/components/aico-content-card-content2.js +61 -0
  331. package/dist/components/aico-content-card-content2.js.map +1 -0
  332. package/dist/components/aico-divider-content.d.ts +11 -0
  333. package/dist/components/aico-divider-content.js +8 -0
  334. package/dist/components/aico-divider-content.js.map +1 -0
  335. package/dist/components/aico-divider-content2.js +36 -0
  336. package/dist/components/aico-divider-content2.js.map +1 -0
  337. package/dist/components/aico-document-content.d.ts +11 -0
  338. package/dist/components/aico-document-content.js +8 -0
  339. package/dist/components/aico-document-content.js.map +1 -0
  340. package/dist/components/aico-document-content2.js +60 -0
  341. package/dist/components/aico-document-content2.js.map +1 -0
  342. package/dist/components/aico-faq-content.d.ts +11 -0
  343. package/dist/components/aico-faq-content.js +8 -0
  344. package/dist/components/aico-faq-content.js.map +1 -0
  345. package/dist/components/aico-faq-content2.js +41 -0
  346. package/dist/components/aico-faq-content2.js.map +1 -0
  347. package/dist/components/aico-fetch-article-detail.d.ts +11 -0
  348. package/dist/components/aico-fetch-article-detail.js +195 -0
  349. package/dist/components/aico-fetch-article-detail.js.map +1 -0
  350. package/dist/components/aico-heading-content.d.ts +11 -0
  351. package/dist/components/aico-heading-content.js +8 -0
  352. package/dist/components/aico-heading-content.js.map +1 -0
  353. package/dist/components/aico-heading-content2.js +80 -0
  354. package/dist/components/aico-heading-content2.js.map +1 -0
  355. package/dist/components/aico-html-content.d.ts +11 -0
  356. package/dist/components/aico-html-content.js +8 -0
  357. package/dist/components/aico-html-content.js.map +1 -0
  358. package/dist/components/aico-html-content2.js +45 -0
  359. package/dist/components/aico-html-content2.js.map +1 -0
  360. package/dist/components/aico-link-content.d.ts +11 -0
  361. package/dist/components/aico-link-content.js +8 -0
  362. package/dist/components/aico-link-content.js.map +1 -0
  363. package/dist/components/aico-link-content2.js +55 -0
  364. package/dist/components/aico-link-content2.js.map +1 -0
  365. package/dist/components/aico-news-content.d.ts +11 -0
  366. package/dist/components/aico-news-content.js +8 -0
  367. package/dist/components/aico-news-content.js.map +1 -0
  368. package/dist/components/aico-news-content2.js +43 -0
  369. package/dist/components/aico-news-content2.js.map +1 -0
  370. package/dist/components/aico-news-list-item.d.ts +11 -0
  371. package/dist/components/aico-news-list-item.js +8 -0
  372. package/dist/components/aico-news-list-item.js.map +1 -0
  373. package/dist/components/aico-news-list-item2.js +39 -0
  374. package/dist/components/aico-news-list-item2.js.map +1 -0
  375. package/dist/components/{my-component.d.ts → aico-news-list.d.ts} +4 -4
  376. package/dist/components/aico-news-list.js +118 -0
  377. package/dist/components/aico-news-list.js.map +1 -0
  378. package/dist/components/aico-no-content.d.ts +11 -0
  379. package/dist/components/aico-no-content.js +8 -0
  380. package/dist/components/aico-no-content.js.map +1 -0
  381. package/dist/components/aico-no-content2.js +31 -0
  382. package/dist/components/aico-no-content2.js.map +1 -0
  383. package/dist/components/aico-page-content.d.ts +11 -0
  384. package/dist/components/aico-page-content.js +8 -0
  385. package/dist/components/aico-page-content.js.map +1 -0
  386. package/dist/components/aico-page-content2.js +43 -0
  387. package/dist/components/aico-page-content2.js.map +1 -0
  388. package/dist/components/aico-special-news-carousel.d.ts +11 -0
  389. package/dist/components/aico-special-news-carousel.js +78 -0
  390. package/dist/components/aico-special-news-carousel.js.map +1 -0
  391. package/dist/components/aico-table-content.d.ts +11 -0
  392. package/dist/components/aico-table-content.js +8 -0
  393. package/dist/components/aico-table-content.js.map +1 -0
  394. package/dist/components/aico-table-content2.js +72 -0
  395. package/dist/components/aico-table-content2.js.map +1 -0
  396. package/dist/components/aico-testimonial-content.d.ts +11 -0
  397. package/dist/components/aico-testimonial-content.js +8 -0
  398. package/dist/components/aico-testimonial-content.js.map +1 -0
  399. package/dist/components/aico-testimonial-content2.js +38 -0
  400. package/dist/components/aico-testimonial-content2.js.map +1 -0
  401. package/dist/components/aico-text-content.d.ts +11 -0
  402. package/dist/components/aico-text-content.js +8 -0
  403. package/dist/components/aico-text-content.js.map +1 -0
  404. package/dist/components/aico-text-content2.js +125 -0
  405. package/dist/components/aico-text-content2.js.map +1 -0
  406. package/dist/components/aico-title-content.d.ts +11 -0
  407. package/dist/components/aico-title-content.js +8 -0
  408. package/dist/components/aico-title-content.js.map +1 -0
  409. package/dist/components/aico-title-content2.js +54 -0
  410. package/dist/components/aico-title-content2.js.map +1 -0
  411. package/dist/components/aico-upload-content.d.ts +11 -0
  412. package/dist/components/aico-upload-content.js +8 -0
  413. package/dist/components/aico-upload-content.js.map +1 -0
  414. package/dist/components/aico-upload-content2.js +65 -0
  415. package/dist/components/aico-upload-content2.js.map +1 -0
  416. package/dist/components/aico-video-content.d.ts +11 -0
  417. package/dist/components/aico-video-content.js +8 -0
  418. package/dist/components/aico-video-content.js.map +1 -0
  419. package/dist/components/aico-video-content2.js +61 -0
  420. package/dist/components/aico-video-content2.js.map +1 -0
  421. package/dist/components/assets/slick/ajax-loader.gif +0 -0
  422. package/dist/components/assets/slick/slick.eot +0 -0
  423. package/dist/components/assets/slick/slick.svg +14 -0
  424. package/dist/components/assets/slick/slick.ttf +0 -0
  425. package/dist/components/assets/slick/slick.woff +0 -0
  426. package/dist/components/bootstrap.esm.js +6265 -0
  427. package/dist/components/bootstrap.esm.js.map +1 -0
  428. package/dist/components/slick.js +13660 -0
  429. package/dist/components/slick.js.map +1 -0
  430. package/dist/components/utils.js +92 -0
  431. package/dist/components/utils.js.map +1 -0
  432. package/dist/esm/aico-album-content_19.entry.js +6882 -0
  433. package/dist/esm/aico-album-content_19.entry.js.map +1 -0
  434. package/dist/esm/aico-article-detail.entry.js +120 -0
  435. package/dist/esm/aico-article-detail.entry.js.map +1 -0
  436. package/dist/esm/aico-asking-list-content.entry.js +17 -0
  437. package/dist/esm/aico-asking-list-content.entry.js.map +1 -0
  438. package/dist/esm/aico-collection-content.entry.js +17 -0
  439. package/dist/esm/aico-collection-content.entry.js.map +1 -0
  440. package/dist/esm/aico-components.js +3 -3
  441. package/dist/esm/aico-fetch-article-detail.entry.js +40 -0
  442. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -0
  443. package/dist/esm/aico-news-list-item.entry.js +23 -0
  444. package/dist/esm/aico-news-list-item.entry.js.map +1 -0
  445. package/dist/esm/aico-news-list.entry.js +88 -0
  446. package/dist/esm/aico-news-list.entry.js.map +1 -0
  447. package/dist/esm/aico-no-content_2.entry.js +44 -0
  448. package/dist/esm/aico-no-content_2.entry.js.map +1 -0
  449. package/dist/esm/aico-special-news-carousel.entry.js +56 -0
  450. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -0
  451. package/dist/esm/{index-72708389.js → index-4621a8ba.js} +862 -29
  452. package/dist/esm/index-4621a8ba.js.map +1 -0
  453. package/dist/esm/loader.js +3 -3
  454. package/dist/esm/slick-d11cf173.js +13660 -0
  455. package/dist/esm/slick-d11cf173.js.map +1 -0
  456. package/dist/esm/utils-54ffec33.js +92 -0
  457. package/dist/esm/utils-54ffec33.js.map +1 -0
  458. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +10 -0
  459. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +26 -0
  460. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.d.ts +7 -0
  461. package/dist/types/components/aico-news-list/aico-news-list.d.ts +21 -0
  462. package/dist/types/components/aico-news-list/aico-news-list.stories.d.ts +7 -0
  463. package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +7 -0
  464. package/dist/types/components/aico-news-list-item/aico-news-list-item.stories.d.ts +6 -0
  465. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +19 -0
  466. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.stories.d.ts +7 -0
  467. package/dist/types/components/content/aico-album-content/aico-album-content.d.ts +7 -0
  468. package/dist/types/components/content/aico-album-content/aico-album-content.stories.d.ts +5 -0
  469. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +5 -0
  470. package/dist/types/components/content/aico-asking-list-content/aico-asking-list-content.d.ts +3 -0
  471. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +5 -0
  472. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.stories.d.ts +6 -0
  473. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +6 -0
  474. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.stories.d.ts +6 -0
  475. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +9 -0
  476. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.stories.d.ts +6 -0
  477. package/dist/types/components/content/aico-collection-content/aico-collection-content.d.ts +3 -0
  478. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +6 -0
  479. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.stories.d.ts +6 -0
  480. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +5 -0
  481. package/dist/types/components/content/aico-divider-content/aico-divider-content.stories.d.ts +6 -0
  482. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +5 -0
  483. package/dist/types/components/content/aico-document-content/aico-document-content.stories.d.ts +6 -0
  484. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +6 -0
  485. package/dist/types/components/content/aico-faq-content/aico-faq-content.stories.d.ts +6 -0
  486. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +6 -0
  487. package/dist/types/components/content/aico-heading-content/aico-heading-content.stories.d.ts +6 -0
  488. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +5 -0
  489. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +5 -0
  490. package/dist/types/components/content/aico-link-content/aico-link-content.stories.d.ts +7 -0
  491. package/dist/types/components/content/aico-news-content/aico-news-content.d.ts +8 -0
  492. package/dist/types/components/content/aico-news-content/aico-news-content.stories.d.ts +5 -0
  493. package/dist/types/components/content/aico-no-content/aico-no-content.d.ts +3 -0
  494. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +7 -0
  495. package/dist/types/components/content/aico-page-content/aico-page-content.stories.d.ts +5 -0
  496. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +6 -0
  497. package/dist/types/components/content/aico-table-content/aico-table-content.stories.d.ts +6 -0
  498. package/dist/types/components/content/aico-testimonial-content/aico-testimonial-content.d.ts +5 -0
  499. package/dist/types/components/content/aico-testimonial-content/aico-testimonial-content.stories.d.ts +6 -0
  500. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +12 -0
  501. package/dist/types/components/content/aico-text-content/aico-text-content.stories.d.ts +10 -0
  502. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +5 -0
  503. package/dist/types/components/content/aico-title-content/aico-title-content.stories.d.ts +5 -0
  504. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +6 -0
  505. package/dist/types/components/content/aico-upload-content/aico-upload-content.stories.d.ts +5 -0
  506. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +6 -0
  507. package/dist/types/components/content/aico-video-content/aico-video-content.stories.d.ts +7 -0
  508. package/dist/types/components.d.ts +556 -25
  509. package/dist/types/model/AicoApiRequestInfo.d.ts +6 -0
  510. package/dist/types/model/Article.d.ts +103 -0
  511. package/dist/types/model/Entity.d.ts +15 -0
  512. package/dist/types/model/NewsCategory.d.ts +14 -0
  513. package/dist/types/model/NewsResponse.d.ts +25 -0
  514. package/dist/types/model/article/ContentType.d.ts +31 -0
  515. package/dist/types/model/article/Translation.d.ts +24 -0
  516. package/dist/types/model/article/content/AlbumContent.d.ts +26 -0
  517. package/dist/types/model/article/content/AskingContent.d.ts +152 -0
  518. package/dist/types/model/article/content/AskingListContent.d.ts +17 -0
  519. package/dist/types/model/article/content/BlockQuoteContent.d.ts +11 -0
  520. package/dist/types/model/article/content/BulletContent.d.ts +14 -0
  521. package/dist/types/model/article/content/CardContent.d.ts +10 -0
  522. package/dist/types/model/article/content/CarouselContent.d.ts +12 -0
  523. package/dist/types/model/article/content/CollectionContent.d.ts +364 -0
  524. package/dist/types/model/article/content/DividerContent.d.ts +8 -0
  525. package/dist/types/model/article/content/DocumentContent.d.ts +19 -0
  526. package/dist/types/model/article/content/FaqContent.d.ts +106 -0
  527. package/dist/types/model/article/content/HeadingContent.d.ts +16 -0
  528. package/dist/types/model/article/content/HtmlContent.d.ts +5 -0
  529. package/dist/types/model/article/content/LinkContent.d.ts +23 -0
  530. package/dist/types/model/article/content/NewsContent.d.ts +836 -0
  531. package/dist/types/model/article/content/PageContent.d.ts +313 -0
  532. package/dist/types/model/article/content/TableContet.d.ts +30 -0
  533. package/dist/types/model/article/content/TestimonialContent.d.ts +9 -0
  534. package/dist/types/model/article/content/TextContent.d.ts +39 -0
  535. package/dist/types/model/article/content/TitleContent.d.ts +9 -0
  536. package/dist/types/model/article/content/UploadContent.d.ts +77 -0
  537. package/dist/types/model/article/content/VideoContent.d.ts +14 -0
  538. package/dist/types/model/article/content/news/NewsAlbum.d.ts +150 -0
  539. package/dist/types/model/article/content/news/NewsArticle.d.ts +577 -0
  540. package/dist/types/model/article/content/news/NewsCategory.d.ts +88 -0
  541. package/dist/types/model/article/content/news/NewsTag.d.ts +63 -0
  542. package/dist/types/utils/ConditionalRender.d.ts +6 -0
  543. package/dist/types/utils/ConditionalWrap.d.ts +7 -0
  544. package/dist/types/utils/utils.d.ts +14 -1
  545. package/package.json +13 -4
  546. package/dist/aico-components/p-23b28a55.js +0 -3
  547. package/dist/aico-components/p-23b28a55.js.map +0 -1
  548. package/dist/aico-components/p-efd6913d.entry.js +0 -2
  549. package/dist/aico-components/p-efd6913d.entry.js.map +0 -1
  550. package/dist/cjs/index-222c33f1.js.map +0 -1
  551. package/dist/cjs/my-component.cjs.entry.js +0 -31
  552. package/dist/cjs/my-component.cjs.entry.js.map +0 -1
  553. package/dist/collection/components/my-component/my-component.e2e.js +0 -26
  554. package/dist/collection/components/my-component/my-component.e2e.js.map +0 -1
  555. package/dist/collection/components/my-component/my-component.js +0 -83
  556. package/dist/collection/components/my-component/my-component.js.map +0 -1
  557. package/dist/collection/components/my-component/my-component.spec.js +0 -35
  558. package/dist/collection/components/my-component/my-component.spec.js.map +0 -1
  559. package/dist/collection/components/my-component/my-component.stories.js +0 -13
  560. package/dist/collection/components/my-component/my-component.stories.js.map +0 -1
  561. package/dist/components/my-component.js +0 -49
  562. package/dist/components/my-component.js.map +0 -1
  563. package/dist/esm/index-72708389.js.map +0 -1
  564. package/dist/esm/my-component.entry.js +0 -27
  565. package/dist/esm/my-component.entry.js.map +0 -1
  566. package/dist/types/components/my-component/my-component.d.ts +0 -16
  567. /package/dist/collection/components/{my-component/my-component.css → content/aico-collection-content/aico-collection-content.css} +0 -0
  568. /package/dist/types/components/{my-component/my-component.stories.d.ts → content/aico-asking-content/aico-asking-content.stories.d.ts} +0 -0
@@ -1,4 +1,5 @@
1
1
  const NAMESPACE = 'aico-components';
2
+ const BUILD = /* aico-components */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: true, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: false };
2
3
 
3
4
  /**
4
5
  * Virtual DOM patching algorithm based on Snabbdom by
@@ -9,7 +10,12 @@ const NAMESPACE = 'aico-components';
9
10
  * Modified for Stencil's renderer and slot projection
10
11
  */
11
12
  let scopeId;
13
+ let contentRef;
12
14
  let hostTagName;
15
+ let useNativeShadowDom = false;
16
+ let checkSlotFallbackVisibility = false;
17
+ let checkSlotRelocate = false;
18
+ let isSvgMode = false;
13
19
  let queuePending = false;
14
20
  const createTime = (fnName, tagName = '') => {
15
21
  {
@@ -33,6 +39,19 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
33
39
  * support as of Stencil v4.
34
40
  */
35
41
  const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
42
+ /**
43
+ * Default style mode id
44
+ */
45
+ /**
46
+ * Reusable empty obj/array
47
+ * Don't add values to these!!
48
+ */
49
+ const EMPTY_OBJ = {};
50
+ /**
51
+ * Namespaces
52
+ */
53
+ const SVG_NS = 'http://www.w3.org/2000/svg';
54
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
36
55
  const isDef = (v) => v != null;
37
56
  /**
38
57
  * Check whether a value is a 'complex type', defined here as an object or a
@@ -70,6 +89,7 @@ function queryNonceMetaTagContent(doc) {
70
89
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
71
90
  const h = (nodeName, vnodeData, ...children) => {
72
91
  let child = null;
92
+ let slotName = null;
73
93
  let simple = false;
74
94
  let lastSimple = false;
75
95
  const vNodeChildren = [];
@@ -96,11 +116,35 @@ const h = (nodeName, vnodeData, ...children) => {
96
116
  }
97
117
  };
98
118
  walk(children);
119
+ if (vnodeData) {
120
+ if (vnodeData.name) {
121
+ slotName = vnodeData.name;
122
+ }
123
+ // normalize class / className attributes
124
+ {
125
+ const classData = vnodeData.className || vnodeData.class;
126
+ if (classData) {
127
+ vnodeData.class =
128
+ typeof classData !== 'object'
129
+ ? classData
130
+ : Object.keys(classData)
131
+ .filter((k) => classData[k])
132
+ .join(' ');
133
+ }
134
+ }
135
+ }
136
+ if (typeof nodeName === 'function') {
137
+ // nodeName is a functional component
138
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
139
+ }
99
140
  const vnode = newVNode(nodeName, null);
100
141
  vnode.$attrs$ = vnodeData;
101
142
  if (vNodeChildren.length > 0) {
102
143
  vnode.$children$ = vNodeChildren;
103
144
  }
145
+ {
146
+ vnode.$name$ = slotName;
147
+ }
104
148
  return vnode;
105
149
  };
106
150
  /**
@@ -119,6 +163,12 @@ const newVNode = (tag, text) => {
119
163
  $elm$: null,
120
164
  $children$: null,
121
165
  };
166
+ {
167
+ vnode.$attrs$ = null;
168
+ }
169
+ {
170
+ vnode.$name$ = null;
171
+ }
122
172
  return vnode;
123
173
  };
124
174
  const Host = {};
@@ -129,6 +179,59 @@ const Host = {};
129
179
  * @returns whether it's a Host node or not
130
180
  */
131
181
  const isHost = (node) => node && node.$tag$ === Host;
182
+ /**
183
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
184
+ *
185
+ * Note that these functions convert from {@link d.VNode} to
186
+ * {@link d.ChildNode} to give functional component developers a friendly
187
+ * interface.
188
+ */
189
+ const vdomFnUtils = {
190
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
191
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
192
+ };
193
+ /**
194
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
195
+ * friendlier public interface (hence, 'convertToPublic').
196
+ *
197
+ * @param node the virtual DOM node to convert
198
+ * @returns a converted child node
199
+ */
200
+ const convertToPublic = (node) => ({
201
+ vattrs: node.$attrs$,
202
+ vchildren: node.$children$,
203
+ vkey: node.$key$,
204
+ vname: node.$name$,
205
+ vtag: node.$tag$,
206
+ vtext: node.$text$,
207
+ });
208
+ /**
209
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
210
+ * order to use the resulting object in the virtual DOM. The initial object was
211
+ * likely created as part of presenting a public API, so converting it back
212
+ * involved making it 'private' again (hence, `convertToPrivate`).
213
+ *
214
+ * @param node the child node to convert
215
+ * @returns a converted virtual DOM node
216
+ */
217
+ const convertToPrivate = (node) => {
218
+ if (typeof node.vtag === 'function') {
219
+ const vnodeData = Object.assign({}, node.vattrs);
220
+ if (node.vkey) {
221
+ vnodeData.key = node.vkey;
222
+ }
223
+ if (node.vname) {
224
+ vnodeData.name = node.vname;
225
+ }
226
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
227
+ }
228
+ const vnode = newVNode(node.vtag, node.vtext);
229
+ vnode.$attrs$ = node.vattrs;
230
+ vnode.$children$ = node.vchildren;
231
+ vnode.$key$ = node.vkey;
232
+ vnode.$name$ = node.vname;
233
+ return vnode;
234
+ };
132
235
  /**
133
236
  * Parse a new property value for a given property type.
134
237
  *
@@ -155,6 +258,15 @@ const isHost = (node) => node && node.$tag$ === Host;
155
258
  const parsePropertyValue = (propValue, propType) => {
156
259
  // ensure this value is of the correct prop type
157
260
  if (propValue != null && !isComplexType(propValue)) {
261
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
262
+ // per the HTML spec, any string value means it is a boolean true value
263
+ // but we'll cheat here and say that the string "false" is the boolean false
264
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
265
+ }
266
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
267
+ // force it to be a number
268
+ return parseFloat(propValue);
269
+ }
158
270
  if (propType & 1 /* MEMBER_FLAGS.String */) {
159
271
  // could have been passed as a number or boolean
160
272
  // but we still want it as a string
@@ -167,6 +279,20 @@ const parsePropertyValue = (propValue, propType) => {
167
279
  // so no need to change to a different type
168
280
  return propValue;
169
281
  };
282
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
283
+ const createEvent = (ref, name, flags) => {
284
+ const elm = getElement(ref);
285
+ return {
286
+ emit: (detail) => {
287
+ return emitEvent(elm, name, {
288
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
289
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
290
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
291
+ detail,
292
+ });
293
+ },
294
+ };
295
+ };
170
296
  /**
171
297
  * Helper function to create & dispatch a custom Event on a provided target
172
298
  * @param elm the target of the Event
@@ -242,7 +368,7 @@ const attachStyles = (hostRef) => {
242
368
  const elm = hostRef.$hostElement$;
243
369
  const flags = cmpMeta.$flags$;
244
370
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
245
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
371
+ const scopeId = addStyle(elm.getRootNode(), cmpMeta);
246
372
  if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
247
373
  // only required when we're NOT using native shadow dom (slot)
248
374
  // or this browser doesn't support native shadow dom
@@ -253,10 +379,191 @@ const attachStyles = (hostRef) => {
253
379
  // DOM WRITE!!
254
380
  elm['s-sc'] = scopeId;
255
381
  elm.classList.add(scopeId + '-h');
382
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
383
+ elm.classList.add(scopeId + '-s');
384
+ }
256
385
  }
257
386
  endAttachStyles();
258
387
  };
259
388
  const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
389
+ /**
390
+ * Production setAccessor() function based on Preact by
391
+ * Jason Miller (@developit)
392
+ * Licensed under the MIT License
393
+ * https://github.com/developit/preact/blob/master/LICENSE
394
+ *
395
+ * Modified for Stencil's compiler and vdom
396
+ */
397
+ /**
398
+ * When running a VDom render set properties present on a VDom node onto the
399
+ * corresponding HTML element.
400
+ *
401
+ * Note that this function has special functionality for the `class`,
402
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
403
+ * `onClick`, etc). All others are just passed through as-is.
404
+ *
405
+ * @param elm the HTMLElement onto which attributes should be set
406
+ * @param memberName the name of the attribute to set
407
+ * @param oldValue the old value for the attribute
408
+ * @param newValue the new value for the attribute
409
+ * @param isSvg whether we're in an svg context or not
410
+ * @param flags bitflags for Vdom variables
411
+ */
412
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
413
+ if (oldValue !== newValue) {
414
+ let isProp = isMemberInElement(elm, memberName);
415
+ let ln = memberName.toLowerCase();
416
+ if (memberName === 'class') {
417
+ const classList = elm.classList;
418
+ const oldClasses = parseClassList(oldValue);
419
+ const newClasses = parseClassList(newValue);
420
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
421
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
422
+ }
423
+ else if (memberName === 'style') {
424
+ // update style attribute, css properties and values
425
+ {
426
+ for (const prop in oldValue) {
427
+ if (!newValue || newValue[prop] == null) {
428
+ if (prop.includes('-')) {
429
+ elm.style.removeProperty(prop);
430
+ }
431
+ else {
432
+ elm.style[prop] = '';
433
+ }
434
+ }
435
+ }
436
+ }
437
+ for (const prop in newValue) {
438
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
439
+ if (prop.includes('-')) {
440
+ elm.style.setProperty(prop, newValue[prop]);
441
+ }
442
+ else {
443
+ elm.style[prop] = newValue[prop];
444
+ }
445
+ }
446
+ }
447
+ }
448
+ else if ((!isProp ) &&
449
+ memberName[0] === 'o' &&
450
+ memberName[1] === 'n') {
451
+ // Event Handlers
452
+ // so if the member name starts with "on" and the 3rd characters is
453
+ // a capital letter, and it's not already a member on the element,
454
+ // then we're assuming it's an event listener
455
+ if (memberName[2] === '-') {
456
+ // on- prefixed events
457
+ // allows to be explicit about the dom event to listen without any magic
458
+ // under the hood:
459
+ // <my-cmp on-click> // listens for "click"
460
+ // <my-cmp on-Click> // listens for "Click"
461
+ // <my-cmp on-ionChange> // listens for "ionChange"
462
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
463
+ memberName = memberName.slice(3);
464
+ }
465
+ else if (isMemberInElement(win, ln)) {
466
+ // standard event
467
+ // the JSX attribute could have been "onMouseOver" and the
468
+ // member name "onmouseover" is on the window's prototype
469
+ // so let's add the listener "mouseover", which is all lowercased
470
+ memberName = ln.slice(2);
471
+ }
472
+ else {
473
+ // custom event
474
+ // the JSX attribute could have been "onMyCustomEvent"
475
+ // so let's trim off the "on" prefix and lowercase the first character
476
+ // and add the listener "myCustomEvent"
477
+ // except for the first character, we keep the event name case
478
+ memberName = ln[2] + memberName.slice(3);
479
+ }
480
+ if (oldValue || newValue) {
481
+ // Need to account for "capture" events.
482
+ // If the event name ends with "Capture", we'll update the name to remove
483
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
484
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
485
+ // Make sure we only replace the last instance of "Capture"
486
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
487
+ if (oldValue) {
488
+ plt.rel(elm, memberName, oldValue, capture);
489
+ }
490
+ if (newValue) {
491
+ plt.ael(elm, memberName, newValue, capture);
492
+ }
493
+ }
494
+ }
495
+ else {
496
+ // Set property if it exists and it's not a SVG
497
+ const isComplex = isComplexType(newValue);
498
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
499
+ try {
500
+ if (!elm.tagName.includes('-')) {
501
+ const n = newValue == null ? '' : newValue;
502
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
503
+ if (memberName === 'list') {
504
+ isProp = false;
505
+ }
506
+ else if (oldValue == null || elm[memberName] != n) {
507
+ elm[memberName] = n;
508
+ }
509
+ }
510
+ else {
511
+ elm[memberName] = newValue;
512
+ }
513
+ }
514
+ catch (e) {
515
+ /**
516
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
517
+ */
518
+ }
519
+ }
520
+ if (newValue == null || newValue === false) {
521
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
522
+ {
523
+ elm.removeAttribute(memberName);
524
+ }
525
+ }
526
+ }
527
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
528
+ newValue = newValue === true ? '' : newValue;
529
+ {
530
+ elm.setAttribute(memberName, newValue);
531
+ }
532
+ }
533
+ }
534
+ }
535
+ };
536
+ const parseClassListRegex = /\s/;
537
+ /**
538
+ * Parsed a string of classnames into an array
539
+ * @param value className string, e.g. "foo bar baz"
540
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
541
+ */
542
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
543
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
544
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
545
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
546
+ // if the element passed in is a shadow root, which is a document fragment
547
+ // then we want to be adding attrs/props to the shadow root's "host" element
548
+ // if it's not a shadow root, then we add attrs/props to the same element
549
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
550
+ ? newVnode.$elm$.host
551
+ : newVnode.$elm$;
552
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
553
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
554
+ {
555
+ // remove attributes no longer present on the vnode by setting them to undefined
556
+ for (memberName in oldVnodeAttrs) {
557
+ if (!(memberName in newVnodeAttrs)) {
558
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
559
+ }
560
+ }
561
+ }
562
+ // add new & update changed attributes
563
+ for (memberName in newVnodeAttrs) {
564
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
565
+ }
566
+ };
260
567
  /**
261
568
  * Create a DOM Node corresponding to one of the children of a given VNode.
262
569
  *
@@ -268,18 +575,53 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
268
575
  * @returns the newly created node
269
576
  */
270
577
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
578
+ var _a;
271
579
  // tslint:disable-next-line: prefer-const
272
580
  const newVNode = newParentVNode.$children$[childIndex];
273
581
  let i = 0;
274
582
  let elm;
275
583
  let childNode;
584
+ let oldVNode;
585
+ if (!useNativeShadowDom) {
586
+ // remember for later we need to check to relocate nodes
587
+ checkSlotRelocate = true;
588
+ if (newVNode.$tag$ === 'slot') {
589
+ if (scopeId) {
590
+ // scoped css needs to add its scoped id to the parent element
591
+ parentElm.classList.add(scopeId + '-s');
592
+ }
593
+ newVNode.$flags$ |= newVNode.$children$
594
+ ? // slot element has fallback content
595
+ 2 /* VNODE_FLAGS.isSlotFallback */
596
+ : // slot element does not have fallback content
597
+ 1 /* VNODE_FLAGS.isSlotReference */;
598
+ }
599
+ }
276
600
  if (newVNode.$text$ !== null) {
277
601
  // create text node
278
602
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
279
603
  }
604
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
605
+ // create a slot reference node
606
+ elm = newVNode.$elm$ =
607
+ doc.createTextNode('');
608
+ }
280
609
  else {
610
+ if (!isSvgMode) {
611
+ isSvgMode = newVNode.$tag$ === 'svg';
612
+ }
281
613
  // create element
282
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
614
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
615
+ ? 'slot-fb'
616
+ : newVNode.$tag$)
617
+ );
618
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
619
+ isSvgMode = false;
620
+ }
621
+ // add css classes, attrs, props, listeners, etc.
622
+ {
623
+ updateElement(null, newVNode, isSvgMode);
624
+ }
283
625
  if (isDef(scopeId) && elm['s-si'] !== scopeId) {
284
626
  // if there is a scopeId and this is the initial render
285
627
  // then let's add the scopeId as a css class
@@ -288,7 +630,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
288
630
  if (newVNode.$children$) {
289
631
  for (i = 0; i < newVNode.$children$.length; ++i) {
290
632
  // create the node
291
- childNode = createElm(oldParentVNode, newVNode, i);
633
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
292
634
  // return node could have been null
293
635
  if (childNode) {
294
636
  // append our new node
@@ -296,12 +638,73 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
296
638
  }
297
639
  }
298
640
  }
641
+ {
642
+ if (newVNode.$tag$ === 'svg') {
643
+ // Only reset the SVG context when we're exiting <svg> element
644
+ isSvgMode = false;
645
+ }
646
+ else if (elm.tagName === 'foreignObject') {
647
+ // Reenter SVG context when we're exiting <foreignObject> element
648
+ isSvgMode = true;
649
+ }
650
+ }
299
651
  }
300
652
  // This needs to always happen so we can hide nodes that are projected
301
653
  // to another component but don't end up in a slot
302
654
  elm['s-hn'] = hostTagName;
655
+ {
656
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
657
+ // remember the content reference comment
658
+ elm['s-sr'] = true;
659
+ // Persist the name of the slot that this slot was going to be projected into.
660
+ elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
661
+ // remember the content reference comment
662
+ elm['s-cr'] = contentRef;
663
+ // remember the slot name, or empty string for default slot
664
+ elm['s-sn'] = newVNode.$name$ || '';
665
+ // check if we've got an old vnode for this slot
666
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
667
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
668
+ {
669
+ // we've got an old slot vnode and the wrapper is being replaced
670
+ // so let's move the old slot content back to its original location
671
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
672
+ }
673
+ }
674
+ }
675
+ }
303
676
  return elm;
304
677
  };
678
+ const putBackInOriginalLocation = (parentElm, recursive) => {
679
+ var _a;
680
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
681
+ const oldSlotChildNodes = parentElm.childNodes;
682
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
683
+ const childNode = oldSlotChildNodes[i];
684
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
685
+ // and relocate it back to it's original location
686
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
687
+ // remove the old original location comment entirely
688
+ // later on the patch function will know what to do
689
+ // and move this to the correct spot if need be
690
+ childNode['s-ol'].remove();
691
+ childNode['s-ol'] = undefined;
692
+ // Reset so we can correctly move the node around again.
693
+ childNode['s-sh'] = undefined;
694
+ // When putting an element node back in its original location,
695
+ // we need to reset the `slot` attribute back to the value it originally had
696
+ // so we can correctly relocate it again in the future
697
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
698
+ childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
699
+ }
700
+ checkSlotRelocate = true;
701
+ }
702
+ if (recursive) {
703
+ putBackInOriginalLocation(childNode, recursive);
704
+ }
705
+ }
706
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
707
+ };
305
708
  /**
306
709
  * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
307
710
  * add them to the DOM in the appropriate place.
@@ -318,17 +721,14 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
318
721
  * creating DOM nodes (inclusive)
319
722
  */
320
723
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
321
- let containerElm = (parentElm);
724
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
322
725
  let childNode;
323
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
324
- containerElm = containerElm.shadowRoot;
325
- }
326
726
  for (; startIdx <= endIdx; ++startIdx) {
327
727
  if (vnodes[startIdx]) {
328
- childNode = createElm(null, parentVNode, startIdx);
728
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
329
729
  if (childNode) {
330
730
  vnodes[startIdx].$elm$ = childNode;
331
- containerElm.insertBefore(childNode, before);
731
+ containerElm.insertBefore(childNode, referenceNode(before) );
332
732
  }
333
733
  }
334
734
  }
@@ -350,6 +750,20 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
350
750
  if (vnode) {
351
751
  const elm = vnode.$elm$;
352
752
  if (elm) {
753
+ {
754
+ // we're removing this element
755
+ // so it's possible we need to show slot fallback content now
756
+ checkSlotFallbackVisibility = true;
757
+ if (elm['s-ol']) {
758
+ // remove the original location comment
759
+ elm['s-ol'].remove();
760
+ }
761
+ else {
762
+ // it's possible that child nodes of the node
763
+ // that's being removed are slot nodes
764
+ putBackInOriginalLocation(elm, true);
765
+ }
766
+ }
353
767
  // remove the vnode's element from the dom
354
768
  elm.remove();
355
769
  }
@@ -467,6 +881,23 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
467
881
  newEndVnode = newCh[--newEndIdx];
468
882
  }
469
883
  else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
884
+ // case: "Vnode moved right"
885
+ //
886
+ // We've found that the last node in our window on the new children is
887
+ // the same VNode as the _first_ node in our window on the old children
888
+ // we're dealing with now. Visually, this is the layout of these two
889
+ // nodes:
890
+ //
891
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
892
+ // ^^^^^^^^^^^
893
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
894
+ // ^^^^^^^^^^^^^
895
+ //
896
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
897
+ // and move the DOM element for `oldStartVnode`.
898
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
899
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
900
+ }
470
901
  patch(oldStartVnode, newEndVnode, isInitialRender);
471
902
  // We need to move the element for `oldStartVnode` into a position which
472
903
  // will be appropriate for `newEndVnode`. For this we can use
@@ -490,6 +921,24 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
490
921
  newEndVnode = newCh[--newEndIdx];
491
922
  }
492
923
  else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
924
+ // case: "Vnode moved left"
925
+ //
926
+ // We've found that the first node in our window on the new children is
927
+ // the same VNode as the _last_ node in our window on the old children.
928
+ // Visually, this is the layout of these two nodes:
929
+ //
930
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
931
+ // ^^^^^^^^^^^^^
932
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
933
+ // ^^^^^^^^^^^
934
+ //
935
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
936
+ // (which will handle updating any changed attributes, reconciling their
937
+ // children etc) but we also need to move the DOM node to which
938
+ // `oldEndVnode` corresponds.
939
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
940
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
941
+ }
493
942
  patch(oldEndVnode, newStartVnode, isInitialRender);
494
943
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
495
944
  // the same node, so since we're here we know that they are not. Thus we
@@ -506,13 +955,13 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
506
955
  // the key of the first new child OR the build is not using `key`
507
956
  // attributes at all. In either case we need to create a new element
508
957
  // for the new node.
509
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
958
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
510
959
  newStartVnode = newCh[++newStartIdx];
511
960
  }
512
961
  if (node) {
513
962
  // if we created a new node then handle inserting it to the DOM
514
963
  {
515
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
964
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
516
965
  }
517
966
  }
518
967
  }
@@ -551,10 +1000,21 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
551
1000
  // compare if two vnode to see if they're "technically" the same
552
1001
  // need to have the same element tag, and same key to be the same
553
1002
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1003
+ if (leftVNode.$tag$ === 'slot') {
1004
+ return leftVNode.$name$ === rightVNode.$name$;
1005
+ }
554
1006
  return true;
555
1007
  }
556
1008
  return false;
557
1009
  };
1010
+ const referenceNode = (node) => {
1011
+ // this node was relocated to a new location in the dom
1012
+ // because of some other component's slot
1013
+ // but we still have an html comment in place of where
1014
+ // it's original location was according to it's original vdom
1015
+ return (node && node['s-ol']) || node;
1016
+ };
1017
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
558
1018
  /**
559
1019
  * Handle reconciling an outdated VNode with a new one which corresponds to
560
1020
  * it. This function handles flushing updates to the DOM and reconciling the
@@ -568,8 +1028,25 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
568
1028
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
569
1029
  const oldChildren = oldVNode.$children$;
570
1030
  const newChildren = newVNode.$children$;
1031
+ const tag = newVNode.$tag$;
571
1032
  const text = newVNode.$text$;
1033
+ let defaultHolder;
572
1034
  if (text === null) {
1035
+ {
1036
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1037
+ // only add this to the when the compiler sees we're using an svg somewhere
1038
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1039
+ }
1040
+ {
1041
+ if (tag === 'slot')
1042
+ ;
1043
+ else {
1044
+ // either this is the first render of an element OR it's an update
1045
+ // AND we already know it's possible it could have changed
1046
+ // this updates the element's css classes, attrs, props, listeners, etc.
1047
+ updateElement(oldVNode, newVNode, isSvgMode);
1048
+ }
1049
+ }
573
1050
  if (oldChildren !== null && newChildren !== null) {
574
1051
  // looks like there's child vnodes for both the old and new vnodes
575
1052
  // so we need to call `updateChildren` to reconcile them
@@ -588,6 +1065,13 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
588
1065
  // no new child vnodes, but there are old child vnodes to remove
589
1066
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
590
1067
  }
1068
+ if (isSvgMode && tag === 'svg') {
1069
+ isSvgMode = false;
1070
+ }
1071
+ }
1072
+ else if ((defaultHolder = elm['s-cr'])) {
1073
+ // this element has slotted content
1074
+ defaultHolder.parentNode.textContent = text;
591
1075
  }
592
1076
  else if (oldVNode.$text$ !== text) {
593
1077
  // update the text content for the text only vnode
@@ -595,6 +1079,183 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
595
1079
  elm.data = text;
596
1080
  }
597
1081
  };
1082
+ /**
1083
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1084
+ * are slot fallbacks nodes.
1085
+ *
1086
+ * A slot fallback node should be visible by default. Then, it should be
1087
+ * conditionally hidden if:
1088
+ *
1089
+ * - it has a sibling with a `slot` property set to its slot name or if
1090
+ * - it is a default fallback slot node, in which case we hide if it has any
1091
+ * content
1092
+ *
1093
+ * @param elm the element of interest
1094
+ */
1095
+ const updateFallbackSlotVisibility = (elm) => {
1096
+ const childNodes = elm.childNodes;
1097
+ for (const childNode of childNodes) {
1098
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1099
+ if (childNode['s-sr']) {
1100
+ // this is a slot fallback node
1101
+ // get the slot name for this slot reference node
1102
+ const slotName = childNode['s-sn'];
1103
+ // by default always show a fallback slot node
1104
+ // then hide it if there are other slots in the light dom
1105
+ childNode.hidden = false;
1106
+ // we need to check all of its sibling nodes in order to see if
1107
+ // `childNode` should be hidden
1108
+ for (const siblingNode of childNodes) {
1109
+ // Don't check the node against itself
1110
+ if (siblingNode !== childNode) {
1111
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1112
+ // this sibling node is from a different component OR is a named
1113
+ // fallback slot node
1114
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1115
+ (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1116
+ childNode.hidden = true;
1117
+ break;
1118
+ }
1119
+ }
1120
+ else {
1121
+ // this is a default fallback slot node
1122
+ // any element or text node (with content)
1123
+ // should hide the default fallback slot node
1124
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1125
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1126
+ childNode.hidden = true;
1127
+ break;
1128
+ }
1129
+ }
1130
+ }
1131
+ }
1132
+ }
1133
+ // keep drilling down
1134
+ updateFallbackSlotVisibility(childNode);
1135
+ }
1136
+ }
1137
+ };
1138
+ /**
1139
+ * Component-global information about nodes which are either currently being
1140
+ * relocated or will be shortly.
1141
+ */
1142
+ const relocateNodes = [];
1143
+ /**
1144
+ * Mark the contents of a slot for relocation via adding references to them to
1145
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1146
+ * will then be handled in {@link renderVdom}.
1147
+ *
1148
+ * @param elm a render node whose child nodes need to be relocated
1149
+ */
1150
+ const markSlotContentForRelocation = (elm) => {
1151
+ // tslint:disable-next-line: prefer-const
1152
+ let node;
1153
+ let hostContentNodes;
1154
+ let j;
1155
+ for (const childNode of elm.childNodes) {
1156
+ // we need to find child nodes which are slot references so we can then try
1157
+ // to match them up with nodes that need to be relocated
1158
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1159
+ // first get the content reference comment node ('s-cr'), then we get
1160
+ // its parent, which is where all the host content is now
1161
+ hostContentNodes = node.parentNode.childNodes;
1162
+ const slotName = childNode['s-sn'];
1163
+ // iterate through all the nodes under the location where the host was
1164
+ // originally rendered
1165
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1166
+ node = hostContentNodes[j];
1167
+ // check that the node is not a content reference node or a node
1168
+ // reference and then check that the host name does not match that of
1169
+ // childNode.
1170
+ // In addition, check that the slot either has not already been relocated, or
1171
+ // that its current location's host is not childNode's host. This is essentially
1172
+ // a check so that we don't try to relocate (and then hide) a node that is already
1173
+ // where it should be.
1174
+ if (!node['s-cn'] &&
1175
+ !node['s-nr'] &&
1176
+ node['s-hn'] !== childNode['s-hn'] &&
1177
+ (!BUILD.experimentalSlotFixes )) {
1178
+ // if `node` is located in the slot that `childNode` refers to (via the
1179
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1180
+ // (under the host element parent) to the right slot location
1181
+ if (isNodeLocatedInSlot(node, slotName)) {
1182
+ // it's possible we've already decided to relocate this node
1183
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1184
+ // made some changes to slots
1185
+ // let's make sure we also double check
1186
+ // fallbacks are correctly hidden or shown
1187
+ checkSlotFallbackVisibility = true;
1188
+ // ensure that the slot-name attr is correct
1189
+ node['s-sn'] = node['s-sn'] || slotName;
1190
+ if (relocateNodeData) {
1191
+ relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1192
+ // we marked this node for relocation previously but didn't find
1193
+ // out the slot reference node to which it needs to be relocated
1194
+ // so write it down now!
1195
+ relocateNodeData.$slotRefNode$ = childNode;
1196
+ }
1197
+ else {
1198
+ node['s-sh'] = childNode['s-hn'];
1199
+ // add to our list of nodes to relocate
1200
+ relocateNodes.push({
1201
+ $slotRefNode$: childNode,
1202
+ $nodeToRelocate$: node,
1203
+ });
1204
+ }
1205
+ if (node['s-sr']) {
1206
+ relocateNodes.map((relocateNode) => {
1207
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1208
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1209
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1210
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1211
+ }
1212
+ }
1213
+ });
1214
+ }
1215
+ }
1216
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1217
+ // the node is not found within the slot (`childNode`) that we're
1218
+ // currently looking at, so we stick it into `relocateNodes` to
1219
+ // handle later. If we never find a home for this element then
1220
+ // we'll need to hide it
1221
+ relocateNodes.push({
1222
+ $nodeToRelocate$: node,
1223
+ });
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1228
+ // if we're dealing with any type of element (capable of itself being a
1229
+ // slot reference or containing one) then we recur
1230
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1231
+ markSlotContentForRelocation(childNode);
1232
+ }
1233
+ }
1234
+ };
1235
+ /**
1236
+ * Check whether a node is located in a given named slot.
1237
+ *
1238
+ * @param nodeToRelocate the node of interest
1239
+ * @param slotName the slot name to check
1240
+ * @returns whether the node is located in the slot or not
1241
+ */
1242
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1243
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1244
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1245
+ // if the node doesn't have a slot attribute, and the slot we're checking
1246
+ // is not a named slot, then we assume the node should be within the slot
1247
+ return true;
1248
+ }
1249
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1250
+ return true;
1251
+ }
1252
+ return false;
1253
+ }
1254
+ if (nodeToRelocate['s-sn'] === slotName) {
1255
+ return true;
1256
+ }
1257
+ return slotName === '';
1258
+ };
598
1259
  /**
599
1260
  * The main entry point for Stencil's virtual DOM-based rendering engine
600
1261
  *
@@ -609,7 +1270,9 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
609
1270
  * @param isInitialLoad whether or not this is the first call after page load
610
1271
  */
611
1272
  const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1273
+ var _a, _b, _c, _d;
612
1274
  const hostElm = hostRef.$hostElement$;
1275
+ const cmpMeta = hostRef.$cmpMeta$;
613
1276
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
614
1277
  // if `renderFnResults` is a Host node then we can use it directly. If not,
615
1278
  // we need to call `h` again to wrap the children of our component in a
@@ -642,12 +1305,114 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
642
1305
  rootVnode.$tag$ = null;
643
1306
  rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
644
1307
  hostRef.$vnode$ = rootVnode;
645
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1308
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
646
1309
  {
647
1310
  scopeId = hostElm['s-sc'];
648
1311
  }
1312
+ {
1313
+ contentRef = hostElm['s-cr'];
1314
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1315
+ // always reset
1316
+ checkSlotFallbackVisibility = false;
1317
+ }
649
1318
  // synchronous patch
650
1319
  patch(oldVNode, rootVnode, isInitialLoad);
1320
+ {
1321
+ // while we're moving nodes around existing nodes, temporarily disable
1322
+ // the disconnectCallback from working
1323
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1324
+ if (checkSlotRelocate) {
1325
+ markSlotContentForRelocation(rootVnode.$elm$);
1326
+ for (const relocateData of relocateNodes) {
1327
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1328
+ if (!nodeToRelocate['s-ol']) {
1329
+ // add a reference node marking this node's original location
1330
+ // keep a reference to this node for later lookups
1331
+ const orgLocationNode = doc.createTextNode('');
1332
+ orgLocationNode['s-nr'] = nodeToRelocate;
1333
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1334
+ }
1335
+ }
1336
+ for (const relocateData of relocateNodes) {
1337
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1338
+ const slotRefNode = relocateData.$slotRefNode$;
1339
+ if (slotRefNode) {
1340
+ const parentNodeRef = slotRefNode.parentNode;
1341
+ // When determining where to insert content, the most simple case would be
1342
+ // to relocate the node immediately following the slot reference node. We do this
1343
+ // by getting a reference to the node immediately following the slot reference node
1344
+ // since we will use `insertBefore` to manipulate the DOM.
1345
+ //
1346
+ // If there is no node immediately following the slot reference node, then we will just
1347
+ // end up appending the node as the last child of the parent.
1348
+ let insertBeforeNode = slotRefNode.nextSibling;
1349
+ // If the node we're currently planning on inserting the new node before is an element,
1350
+ // we need to do some additional checks to make sure we're inserting the node in the correct order.
1351
+ // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1352
+ // to make sure they get inserted into their new how in the same order they were declared in their original location.
1353
+ //
1354
+ // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1355
+ {
1356
+ let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1357
+ while (orgLocationNode) {
1358
+ let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1359
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1360
+ refNode = refNode.nextSibling;
1361
+ if (!refNode || !refNode['s-nr']) {
1362
+ insertBeforeNode = refNode;
1363
+ break;
1364
+ }
1365
+ }
1366
+ orgLocationNode = orgLocationNode.previousSibling;
1367
+ }
1368
+ }
1369
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1370
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1371
+ // we've checked that it's worth while to relocate
1372
+ // since that the node to relocate
1373
+ // has a different next sibling or parent relocated
1374
+ if (nodeToRelocate !== insertBeforeNode) {
1375
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1376
+ // probably a component in the index.html that doesn't have its hostname set
1377
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1378
+ }
1379
+ // Add it back to the dom but in its new home
1380
+ // If we get to this point and `insertBeforeNode` is `null`, that means
1381
+ // we're just going to append the node as the last child of the parent. Passing
1382
+ // `null` as the second arg here will trigger that behavior.
1383
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1384
+ // Reset the `hidden` value back to what it was defined as originally
1385
+ // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1386
+ // been set on content originally, but now it has a slot to go to so it should have
1387
+ // the value it was defined as having in the DOM, not what we overrode it to.
1388
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1389
+ nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1390
+ }
1391
+ }
1392
+ }
1393
+ }
1394
+ else {
1395
+ // this node doesn't have a slot home to go to, so let's hide it
1396
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1397
+ // Store the initial value of `hidden` so we can reset it later when
1398
+ // moving nodes around.
1399
+ if (isInitialLoad) {
1400
+ nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1401
+ }
1402
+ nodeToRelocate.hidden = true;
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+ if (checkSlotFallbackVisibility) {
1408
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1409
+ }
1410
+ // done moving nodes around
1411
+ // allow the disconnect callback to work again
1412
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1413
+ // always reset
1414
+ relocateNodes.length = 0;
1415
+ }
651
1416
  };
652
1417
  const attachToAncestor = (hostRef, ancestorComponent) => {
653
1418
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
@@ -695,6 +1460,26 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
695
1460
  // 2. If all functions added to the queue are asynchronous they'll all be
696
1461
  // called in order after `dispatchHooks` exits.
697
1462
  let maybePromise;
1463
+ if (isInitialLoad) {
1464
+ {
1465
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1466
+ // whatever's going on in that `Promise` before we launch into
1467
+ // rendering the component, doing other lifecycle stuff, etc. So
1468
+ // in that case we assign the returned promise to the variable we
1469
+ // declared above to hold a possible 'queueing' Promise
1470
+ maybePromise = safeCall(instance, 'componentWillLoad');
1471
+ }
1472
+ }
1473
+ else {
1474
+ {
1475
+ // Like `componentWillLoad` above, we allow Stencil component
1476
+ // authors to return a `Promise` from this lifecycle callback, and
1477
+ // we specify that our runtime will wait for that `Promise` to
1478
+ // resolve before the component re-renders. So if the method
1479
+ // returns a `Promise` we need to keep it around!
1480
+ maybePromise = safeCall(instance, 'componentWillUpdate');
1481
+ }
1482
+ }
698
1483
  endSchedule();
699
1484
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
700
1485
  };
@@ -817,6 +1602,7 @@ const postUpdateComponent = (hostRef) => {
817
1602
  const tagName = hostRef.$cmpMeta$.$tagName$;
818
1603
  const elm = hostRef.$hostElement$;
819
1604
  const endPostUpdate = createTime('postUpdate', tagName);
1605
+ const instance = hostRef.$lazyInstance$ ;
820
1606
  const ancestorComponent = hostRef.$ancestorComponent$;
821
1607
  if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
822
1608
  hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
@@ -824,6 +1610,9 @@ const postUpdateComponent = (hostRef) => {
824
1610
  // DOM WRITE!
825
1611
  addHydratedFlag(elm);
826
1612
  }
1613
+ {
1614
+ safeCall(instance, 'componentDidLoad');
1615
+ }
827
1616
  endPostUpdate();
828
1617
  {
829
1618
  hostRef.$onReadyResolve$(elm);
@@ -859,6 +1648,27 @@ const appDidLoad = (who) => {
859
1648
  }
860
1649
  nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
861
1650
  };
1651
+ /**
1652
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1653
+ * e.g. custom element node. If a build figures out that e.g. no component
1654
+ * has a `componentDidLoad` method, the instance method gets removed from the
1655
+ * output bundle and this function returns `undefined`.
1656
+ * @param instance any object that may or may not contain methods
1657
+ * @param method method name
1658
+ * @param arg single arbitrary argument
1659
+ * @returns result of method call if it exists, otherwise `undefined`
1660
+ */
1661
+ const safeCall = (instance, method, arg) => {
1662
+ if (instance && instance[method]) {
1663
+ try {
1664
+ return instance[method](arg);
1665
+ }
1666
+ catch (e) {
1667
+ consoleError(e);
1668
+ }
1669
+ }
1670
+ return undefined;
1671
+ };
862
1672
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
863
1673
  ;
864
1674
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1069,6 +1879,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1069
1879
  hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1070
1880
  }
1071
1881
  endNewInstance();
1882
+ fireConnectedCallback(hostRef.$lazyInstance$);
1072
1883
  }
1073
1884
  if (Cstr.style) {
1074
1885
  // this component has styles but we haven't registered them yet
@@ -1098,6 +1909,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1098
1909
  }
1099
1910
  };
1100
1911
  const fireConnectedCallback = (instance) => {
1912
+ {
1913
+ safeCall(instance, 'connectedCallback');
1914
+ }
1101
1915
  };
1102
1916
  const connectedCallback = (elm) => {
1103
1917
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
@@ -1107,6 +1921,16 @@ const connectedCallback = (elm) => {
1107
1921
  if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1108
1922
  // first time this component has connected
1109
1923
  hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1924
+ {
1925
+ // initUpdate
1926
+ // if the slot polyfill is required we'll need to put some nodes
1927
+ // in here to act as original content anchors as we move nodes around
1928
+ // host element has been connected to the DOM
1929
+ if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
1930
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1931
+ setContentReference(elm);
1932
+ }
1933
+ }
1110
1934
  {
1111
1935
  // find the first ancestor component (if there is one) and register
1112
1936
  // this component as one of the actively loading child components for its ancestor
@@ -1139,22 +1963,40 @@ const connectedCallback = (elm) => {
1139
1963
  }
1140
1964
  else {
1141
1965
  // fire off connectedCallback() on component instance
1142
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1966
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1967
+ fireConnectedCallback(hostRef.$lazyInstance$);
1968
+ }
1143
1969
  else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1144
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1970
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1145
1971
  }
1146
1972
  }
1147
1973
  endConnected();
1148
1974
  }
1149
1975
  };
1976
+ const setContentReference = (elm) => {
1977
+ // only required when we're NOT using native shadow dom (slot)
1978
+ // or this browser doesn't support native shadow dom
1979
+ // and this host element was NOT created with SSR
1980
+ // let's pick out the inner content for slot projection
1981
+ // create a node to represent where the original
1982
+ // content was first placed, which is useful later on
1983
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1984
+ contentRefElm['s-cn'] = true;
1985
+ elm.insertBefore(contentRefElm, elm.firstChild);
1986
+ };
1150
1987
  const disconnectInstance = (instance) => {
1988
+ {
1989
+ safeCall(instance, 'disconnectedCallback');
1990
+ }
1151
1991
  };
1152
1992
  const disconnectedCallback = async (elm) => {
1153
1993
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1154
1994
  const hostRef = getHostRef(elm);
1155
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1995
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1996
+ disconnectInstance(hostRef.$lazyInstance$);
1997
+ }
1156
1998
  else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1157
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1999
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1158
2000
  }
1159
2001
  }
1160
2002
  };
@@ -1197,17 +2039,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1197
2039
  super(self);
1198
2040
  self = this;
1199
2041
  registerHost(self, cmpMeta);
1200
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1201
- // this component is using shadow dom
1202
- // and this browser supports shadow dom
1203
- // add the read-only property "shadowRoot" to the host element
1204
- // adding the shadow root build conditionals to minimize runtime
1205
- {
1206
- {
1207
- self.attachShadow({ mode: 'open' });
1208
- }
1209
- }
1210
- }
1211
2042
  }
1212
2043
  connectedCallback() {
1213
2044
  if (appLoadFallback) {
@@ -1269,6 +2100,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1269
2100
  // Fallback appLoad event
1270
2101
  endBootstrap();
1271
2102
  };
2103
+ const Fragment = (_, children) => children;
1272
2104
  /**
1273
2105
  * Assigns the given value to the nonce property on the runtime platform object.
1274
2106
  * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
@@ -1320,6 +2152,7 @@ const registerHost = (hostElement, cmpMeta) => {
1320
2152
  }
1321
2153
  return hostRefs.set(hostElement, hostRef);
1322
2154
  };
2155
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1323
2156
  const consoleError = (e, el) => (0, console.error)(e, el);
1324
2157
  const cmpModules = /*@__PURE__*/ new Map();
1325
2158
  const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
@@ -1408,6 +2241,6 @@ const flush = () => {
1408
2241
  const nextTick = (cb) => promiseResolve().then(cb);
1409
2242
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1410
2243
 
1411
- export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
2244
+ export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r, setNonce as s };
1412
2245
 
1413
- //# sourceMappingURL=index-72708389.js.map
2246
+ //# sourceMappingURL=index-4621a8ba.js.map