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