@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
|
@@ -21,6 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'aico-components';
|
|
24
|
+
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 };
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Virtual DOM patching algorithm based on Snabbdom by
|
|
@@ -31,8 +32,17 @@ const NAMESPACE = 'aico-components';
|
|
|
31
32
|
* Modified for Stencil's renderer and slot projection
|
|
32
33
|
*/
|
|
33
34
|
let scopeId;
|
|
35
|
+
let contentRef;
|
|
34
36
|
let hostTagName;
|
|
37
|
+
let useNativeShadowDom = false;
|
|
38
|
+
let checkSlotFallbackVisibility = false;
|
|
39
|
+
let checkSlotRelocate = false;
|
|
40
|
+
let isSvgMode = false;
|
|
35
41
|
let queuePending = false;
|
|
42
|
+
const getAssetPath = (path) => {
|
|
43
|
+
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
44
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
45
|
+
};
|
|
36
46
|
const createTime = (fnName, tagName = '') => {
|
|
37
47
|
{
|
|
38
48
|
return () => {
|
|
@@ -55,6 +65,19 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
|
55
65
|
* support as of Stencil v4.
|
|
56
66
|
*/
|
|
57
67
|
const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
|
|
68
|
+
/**
|
|
69
|
+
* Default style mode id
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Reusable empty obj/array
|
|
73
|
+
* Don't add values to these!!
|
|
74
|
+
*/
|
|
75
|
+
const EMPTY_OBJ = {};
|
|
76
|
+
/**
|
|
77
|
+
* Namespaces
|
|
78
|
+
*/
|
|
79
|
+
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
80
|
+
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
58
81
|
const isDef = (v) => v != null;
|
|
59
82
|
/**
|
|
60
83
|
* Check whether a value is a 'complex type', defined here as an object or a
|
|
@@ -92,6 +115,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
92
115
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
93
116
|
const h = (nodeName, vnodeData, ...children) => {
|
|
94
117
|
let child = null;
|
|
118
|
+
let slotName = null;
|
|
95
119
|
let simple = false;
|
|
96
120
|
let lastSimple = false;
|
|
97
121
|
const vNodeChildren = [];
|
|
@@ -118,11 +142,35 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
118
142
|
}
|
|
119
143
|
};
|
|
120
144
|
walk(children);
|
|
145
|
+
if (vnodeData) {
|
|
146
|
+
if (vnodeData.name) {
|
|
147
|
+
slotName = vnodeData.name;
|
|
148
|
+
}
|
|
149
|
+
// normalize class / className attributes
|
|
150
|
+
{
|
|
151
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
152
|
+
if (classData) {
|
|
153
|
+
vnodeData.class =
|
|
154
|
+
typeof classData !== 'object'
|
|
155
|
+
? classData
|
|
156
|
+
: Object.keys(classData)
|
|
157
|
+
.filter((k) => classData[k])
|
|
158
|
+
.join(' ');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (typeof nodeName === 'function') {
|
|
163
|
+
// nodeName is a functional component
|
|
164
|
+
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
165
|
+
}
|
|
121
166
|
const vnode = newVNode(nodeName, null);
|
|
122
167
|
vnode.$attrs$ = vnodeData;
|
|
123
168
|
if (vNodeChildren.length > 0) {
|
|
124
169
|
vnode.$children$ = vNodeChildren;
|
|
125
170
|
}
|
|
171
|
+
{
|
|
172
|
+
vnode.$name$ = slotName;
|
|
173
|
+
}
|
|
126
174
|
return vnode;
|
|
127
175
|
};
|
|
128
176
|
/**
|
|
@@ -141,6 +189,12 @@ const newVNode = (tag, text) => {
|
|
|
141
189
|
$elm$: null,
|
|
142
190
|
$children$: null,
|
|
143
191
|
};
|
|
192
|
+
{
|
|
193
|
+
vnode.$attrs$ = null;
|
|
194
|
+
}
|
|
195
|
+
{
|
|
196
|
+
vnode.$name$ = null;
|
|
197
|
+
}
|
|
144
198
|
return vnode;
|
|
145
199
|
};
|
|
146
200
|
const Host = {};
|
|
@@ -151,6 +205,59 @@ const Host = {};
|
|
|
151
205
|
* @returns whether it's a Host node or not
|
|
152
206
|
*/
|
|
153
207
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
208
|
+
/**
|
|
209
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
210
|
+
*
|
|
211
|
+
* Note that these functions convert from {@link d.VNode} to
|
|
212
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
|
213
|
+
* interface.
|
|
214
|
+
*/
|
|
215
|
+
const vdomFnUtils = {
|
|
216
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
217
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
221
|
+
* friendlier public interface (hence, 'convertToPublic').
|
|
222
|
+
*
|
|
223
|
+
* @param node the virtual DOM node to convert
|
|
224
|
+
* @returns a converted child node
|
|
225
|
+
*/
|
|
226
|
+
const convertToPublic = (node) => ({
|
|
227
|
+
vattrs: node.$attrs$,
|
|
228
|
+
vchildren: node.$children$,
|
|
229
|
+
vkey: node.$key$,
|
|
230
|
+
vname: node.$name$,
|
|
231
|
+
vtag: node.$tag$,
|
|
232
|
+
vtext: node.$text$,
|
|
233
|
+
});
|
|
234
|
+
/**
|
|
235
|
+
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
236
|
+
* order to use the resulting object in the virtual DOM. The initial object was
|
|
237
|
+
* likely created as part of presenting a public API, so converting it back
|
|
238
|
+
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
239
|
+
*
|
|
240
|
+
* @param node the child node to convert
|
|
241
|
+
* @returns a converted virtual DOM node
|
|
242
|
+
*/
|
|
243
|
+
const convertToPrivate = (node) => {
|
|
244
|
+
if (typeof node.vtag === 'function') {
|
|
245
|
+
const vnodeData = Object.assign({}, node.vattrs);
|
|
246
|
+
if (node.vkey) {
|
|
247
|
+
vnodeData.key = node.vkey;
|
|
248
|
+
}
|
|
249
|
+
if (node.vname) {
|
|
250
|
+
vnodeData.name = node.vname;
|
|
251
|
+
}
|
|
252
|
+
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
253
|
+
}
|
|
254
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
255
|
+
vnode.$attrs$ = node.vattrs;
|
|
256
|
+
vnode.$children$ = node.vchildren;
|
|
257
|
+
vnode.$key$ = node.vkey;
|
|
258
|
+
vnode.$name$ = node.vname;
|
|
259
|
+
return vnode;
|
|
260
|
+
};
|
|
154
261
|
/**
|
|
155
262
|
* Parse a new property value for a given property type.
|
|
156
263
|
*
|
|
@@ -177,6 +284,15 @@ const isHost = (node) => node && node.$tag$ === Host;
|
|
|
177
284
|
const parsePropertyValue = (propValue, propType) => {
|
|
178
285
|
// ensure this value is of the correct prop type
|
|
179
286
|
if (propValue != null && !isComplexType(propValue)) {
|
|
287
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
288
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
289
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
290
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
291
|
+
}
|
|
292
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
293
|
+
// force it to be a number
|
|
294
|
+
return parseFloat(propValue);
|
|
295
|
+
}
|
|
180
296
|
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
181
297
|
// could have been passed as a number or boolean
|
|
182
298
|
// but we still want it as a string
|
|
@@ -189,6 +305,20 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
189
305
|
// so no need to change to a different type
|
|
190
306
|
return propValue;
|
|
191
307
|
};
|
|
308
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
309
|
+
const createEvent = (ref, name, flags) => {
|
|
310
|
+
const elm = getElement(ref);
|
|
311
|
+
return {
|
|
312
|
+
emit: (detail) => {
|
|
313
|
+
return emitEvent(elm, name, {
|
|
314
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
315
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
316
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
317
|
+
detail,
|
|
318
|
+
});
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
};
|
|
192
322
|
/**
|
|
193
323
|
* Helper function to create & dispatch a custom Event on a provided target
|
|
194
324
|
* @param elm the target of the Event
|
|
@@ -264,7 +394,7 @@ const attachStyles = (hostRef) => {
|
|
|
264
394
|
const elm = hostRef.$hostElement$;
|
|
265
395
|
const flags = cmpMeta.$flags$;
|
|
266
396
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
267
|
-
const scopeId = addStyle(elm.
|
|
397
|
+
const scopeId = addStyle(elm.getRootNode(), cmpMeta);
|
|
268
398
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
269
399
|
// only required when we're NOT using native shadow dom (slot)
|
|
270
400
|
// or this browser doesn't support native shadow dom
|
|
@@ -275,10 +405,191 @@ const attachStyles = (hostRef) => {
|
|
|
275
405
|
// DOM WRITE!!
|
|
276
406
|
elm['s-sc'] = scopeId;
|
|
277
407
|
elm.classList.add(scopeId + '-h');
|
|
408
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
|
409
|
+
elm.classList.add(scopeId + '-s');
|
|
410
|
+
}
|
|
278
411
|
}
|
|
279
412
|
endAttachStyles();
|
|
280
413
|
};
|
|
281
414
|
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
415
|
+
/**
|
|
416
|
+
* Production setAccessor() function based on Preact by
|
|
417
|
+
* Jason Miller (@developit)
|
|
418
|
+
* Licensed under the MIT License
|
|
419
|
+
* https://github.com/developit/preact/blob/master/LICENSE
|
|
420
|
+
*
|
|
421
|
+
* Modified for Stencil's compiler and vdom
|
|
422
|
+
*/
|
|
423
|
+
/**
|
|
424
|
+
* When running a VDom render set properties present on a VDom node onto the
|
|
425
|
+
* corresponding HTML element.
|
|
426
|
+
*
|
|
427
|
+
* Note that this function has special functionality for the `class`,
|
|
428
|
+
* `style`, `key`, and `ref` attributes, as well as event handlers (like
|
|
429
|
+
* `onClick`, etc). All others are just passed through as-is.
|
|
430
|
+
*
|
|
431
|
+
* @param elm the HTMLElement onto which attributes should be set
|
|
432
|
+
* @param memberName the name of the attribute to set
|
|
433
|
+
* @param oldValue the old value for the attribute
|
|
434
|
+
* @param newValue the new value for the attribute
|
|
435
|
+
* @param isSvg whether we're in an svg context or not
|
|
436
|
+
* @param flags bitflags for Vdom variables
|
|
437
|
+
*/
|
|
438
|
+
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
439
|
+
if (oldValue !== newValue) {
|
|
440
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
441
|
+
let ln = memberName.toLowerCase();
|
|
442
|
+
if (memberName === 'class') {
|
|
443
|
+
const classList = elm.classList;
|
|
444
|
+
const oldClasses = parseClassList(oldValue);
|
|
445
|
+
const newClasses = parseClassList(newValue);
|
|
446
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
447
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
448
|
+
}
|
|
449
|
+
else if (memberName === 'style') {
|
|
450
|
+
// update style attribute, css properties and values
|
|
451
|
+
{
|
|
452
|
+
for (const prop in oldValue) {
|
|
453
|
+
if (!newValue || newValue[prop] == null) {
|
|
454
|
+
if (prop.includes('-')) {
|
|
455
|
+
elm.style.removeProperty(prop);
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
elm.style[prop] = '';
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
for (const prop in newValue) {
|
|
464
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
465
|
+
if (prop.includes('-')) {
|
|
466
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
elm.style[prop] = newValue[prop];
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
else if ((!isProp ) &&
|
|
475
|
+
memberName[0] === 'o' &&
|
|
476
|
+
memberName[1] === 'n') {
|
|
477
|
+
// Event Handlers
|
|
478
|
+
// so if the member name starts with "on" and the 3rd characters is
|
|
479
|
+
// a capital letter, and it's not already a member on the element,
|
|
480
|
+
// then we're assuming it's an event listener
|
|
481
|
+
if (memberName[2] === '-') {
|
|
482
|
+
// on- prefixed events
|
|
483
|
+
// allows to be explicit about the dom event to listen without any magic
|
|
484
|
+
// under the hood:
|
|
485
|
+
// <my-cmp on-click> // listens for "click"
|
|
486
|
+
// <my-cmp on-Click> // listens for "Click"
|
|
487
|
+
// <my-cmp on-ionChange> // listens for "ionChange"
|
|
488
|
+
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
|
489
|
+
memberName = memberName.slice(3);
|
|
490
|
+
}
|
|
491
|
+
else if (isMemberInElement(win, ln)) {
|
|
492
|
+
// standard event
|
|
493
|
+
// the JSX attribute could have been "onMouseOver" and the
|
|
494
|
+
// member name "onmouseover" is on the window's prototype
|
|
495
|
+
// so let's add the listener "mouseover", which is all lowercased
|
|
496
|
+
memberName = ln.slice(2);
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
// custom event
|
|
500
|
+
// the JSX attribute could have been "onMyCustomEvent"
|
|
501
|
+
// so let's trim off the "on" prefix and lowercase the first character
|
|
502
|
+
// and add the listener "myCustomEvent"
|
|
503
|
+
// except for the first character, we keep the event name case
|
|
504
|
+
memberName = ln[2] + memberName.slice(3);
|
|
505
|
+
}
|
|
506
|
+
if (oldValue || newValue) {
|
|
507
|
+
// Need to account for "capture" events.
|
|
508
|
+
// If the event name ends with "Capture", we'll update the name to remove
|
|
509
|
+
// the "Capture" suffix and make sure the event listener is setup to handle the capture event.
|
|
510
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
511
|
+
// Make sure we only replace the last instance of "Capture"
|
|
512
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
|
|
513
|
+
if (oldValue) {
|
|
514
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
515
|
+
}
|
|
516
|
+
if (newValue) {
|
|
517
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
// Set property if it exists and it's not a SVG
|
|
523
|
+
const isComplex = isComplexType(newValue);
|
|
524
|
+
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
525
|
+
try {
|
|
526
|
+
if (!elm.tagName.includes('-')) {
|
|
527
|
+
const n = newValue == null ? '' : newValue;
|
|
528
|
+
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
529
|
+
if (memberName === 'list') {
|
|
530
|
+
isProp = false;
|
|
531
|
+
}
|
|
532
|
+
else if (oldValue == null || elm[memberName] != n) {
|
|
533
|
+
elm[memberName] = n;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
elm[memberName] = newValue;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
catch (e) {
|
|
541
|
+
/**
|
|
542
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
543
|
+
*/
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
if (newValue == null || newValue === false) {
|
|
547
|
+
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
548
|
+
{
|
|
549
|
+
elm.removeAttribute(memberName);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
554
|
+
newValue = newValue === true ? '' : newValue;
|
|
555
|
+
{
|
|
556
|
+
elm.setAttribute(memberName, newValue);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const parseClassListRegex = /\s/;
|
|
563
|
+
/**
|
|
564
|
+
* Parsed a string of classnames into an array
|
|
565
|
+
* @param value className string, e.g. "foo bar baz"
|
|
566
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
567
|
+
*/
|
|
568
|
+
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
569
|
+
const CAPTURE_EVENT_SUFFIX = 'Capture';
|
|
570
|
+
const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
|
|
571
|
+
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
572
|
+
// if the element passed in is a shadow root, which is a document fragment
|
|
573
|
+
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
574
|
+
// if it's not a shadow root, then we add attrs/props to the same element
|
|
575
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
576
|
+
? newVnode.$elm$.host
|
|
577
|
+
: newVnode.$elm$;
|
|
578
|
+
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
579
|
+
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
580
|
+
{
|
|
581
|
+
// remove attributes no longer present on the vnode by setting them to undefined
|
|
582
|
+
for (memberName in oldVnodeAttrs) {
|
|
583
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
584
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
// add new & update changed attributes
|
|
589
|
+
for (memberName in newVnodeAttrs) {
|
|
590
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
591
|
+
}
|
|
592
|
+
};
|
|
282
593
|
/**
|
|
283
594
|
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
284
595
|
*
|
|
@@ -290,18 +601,53 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
290
601
|
* @returns the newly created node
|
|
291
602
|
*/
|
|
292
603
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
604
|
+
var _a;
|
|
293
605
|
// tslint:disable-next-line: prefer-const
|
|
294
606
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
295
607
|
let i = 0;
|
|
296
608
|
let elm;
|
|
297
609
|
let childNode;
|
|
610
|
+
let oldVNode;
|
|
611
|
+
if (!useNativeShadowDom) {
|
|
612
|
+
// remember for later we need to check to relocate nodes
|
|
613
|
+
checkSlotRelocate = true;
|
|
614
|
+
if (newVNode.$tag$ === 'slot') {
|
|
615
|
+
if (scopeId) {
|
|
616
|
+
// scoped css needs to add its scoped id to the parent element
|
|
617
|
+
parentElm.classList.add(scopeId + '-s');
|
|
618
|
+
}
|
|
619
|
+
newVNode.$flags$ |= newVNode.$children$
|
|
620
|
+
? // slot element has fallback content
|
|
621
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
622
|
+
: // slot element does not have fallback content
|
|
623
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
298
626
|
if (newVNode.$text$ !== null) {
|
|
299
627
|
// create text node
|
|
300
628
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
301
629
|
}
|
|
630
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
631
|
+
// create a slot reference node
|
|
632
|
+
elm = newVNode.$elm$ =
|
|
633
|
+
doc.createTextNode('');
|
|
634
|
+
}
|
|
302
635
|
else {
|
|
636
|
+
if (!isSvgMode) {
|
|
637
|
+
isSvgMode = newVNode.$tag$ === 'svg';
|
|
638
|
+
}
|
|
303
639
|
// create element
|
|
304
|
-
elm = newVNode.$elm$ = (doc.
|
|
640
|
+
elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
641
|
+
? 'slot-fb'
|
|
642
|
+
: newVNode.$tag$)
|
|
643
|
+
);
|
|
644
|
+
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
645
|
+
isSvgMode = false;
|
|
646
|
+
}
|
|
647
|
+
// add css classes, attrs, props, listeners, etc.
|
|
648
|
+
{
|
|
649
|
+
updateElement(null, newVNode, isSvgMode);
|
|
650
|
+
}
|
|
305
651
|
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
|
306
652
|
// if there is a scopeId and this is the initial render
|
|
307
653
|
// then let's add the scopeId as a css class
|
|
@@ -310,7 +656,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
310
656
|
if (newVNode.$children$) {
|
|
311
657
|
for (i = 0; i < newVNode.$children$.length; ++i) {
|
|
312
658
|
// create the node
|
|
313
|
-
childNode = createElm(oldParentVNode, newVNode, i);
|
|
659
|
+
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
|
314
660
|
// return node could have been null
|
|
315
661
|
if (childNode) {
|
|
316
662
|
// append our new node
|
|
@@ -318,12 +664,73 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
318
664
|
}
|
|
319
665
|
}
|
|
320
666
|
}
|
|
667
|
+
{
|
|
668
|
+
if (newVNode.$tag$ === 'svg') {
|
|
669
|
+
// Only reset the SVG context when we're exiting <svg> element
|
|
670
|
+
isSvgMode = false;
|
|
671
|
+
}
|
|
672
|
+
else if (elm.tagName === 'foreignObject') {
|
|
673
|
+
// Reenter SVG context when we're exiting <foreignObject> element
|
|
674
|
+
isSvgMode = true;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
321
677
|
}
|
|
322
678
|
// This needs to always happen so we can hide nodes that are projected
|
|
323
679
|
// to another component but don't end up in a slot
|
|
324
680
|
elm['s-hn'] = hostTagName;
|
|
681
|
+
{
|
|
682
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
683
|
+
// remember the content reference comment
|
|
684
|
+
elm['s-sr'] = true;
|
|
685
|
+
// Persist the name of the slot that this slot was going to be projected into.
|
|
686
|
+
elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
|
|
687
|
+
// remember the content reference comment
|
|
688
|
+
elm['s-cr'] = contentRef;
|
|
689
|
+
// remember the slot name, or empty string for default slot
|
|
690
|
+
elm['s-sn'] = newVNode.$name$ || '';
|
|
691
|
+
// check if we've got an old vnode for this slot
|
|
692
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
693
|
+
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
|
694
|
+
{
|
|
695
|
+
// we've got an old slot vnode and the wrapper is being replaced
|
|
696
|
+
// so let's move the old slot content back to its original location
|
|
697
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
325
702
|
return elm;
|
|
326
703
|
};
|
|
704
|
+
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
705
|
+
var _a;
|
|
706
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
707
|
+
const oldSlotChildNodes = parentElm.childNodes;
|
|
708
|
+
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
709
|
+
const childNode = oldSlotChildNodes[i];
|
|
710
|
+
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
|
711
|
+
// and relocate it back to it's original location
|
|
712
|
+
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
713
|
+
// remove the old original location comment entirely
|
|
714
|
+
// later on the patch function will know what to do
|
|
715
|
+
// and move this to the correct spot if need be
|
|
716
|
+
childNode['s-ol'].remove();
|
|
717
|
+
childNode['s-ol'] = undefined;
|
|
718
|
+
// Reset so we can correctly move the node around again.
|
|
719
|
+
childNode['s-sh'] = undefined;
|
|
720
|
+
// When putting an element node back in its original location,
|
|
721
|
+
// we need to reset the `slot` attribute back to the value it originally had
|
|
722
|
+
// so we can correctly relocate it again in the future
|
|
723
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
724
|
+
childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
|
|
725
|
+
}
|
|
726
|
+
checkSlotRelocate = true;
|
|
727
|
+
}
|
|
728
|
+
if (recursive) {
|
|
729
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
733
|
+
};
|
|
327
734
|
/**
|
|
328
735
|
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
329
736
|
* add them to the DOM in the appropriate place.
|
|
@@ -340,17 +747,14 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
340
747
|
* creating DOM nodes (inclusive)
|
|
341
748
|
*/
|
|
342
749
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
343
|
-
let containerElm = (parentElm);
|
|
750
|
+
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
344
751
|
let childNode;
|
|
345
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
346
|
-
containerElm = containerElm.shadowRoot;
|
|
347
|
-
}
|
|
348
752
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
349
753
|
if (vnodes[startIdx]) {
|
|
350
|
-
childNode = createElm(null, parentVNode, startIdx);
|
|
754
|
+
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
351
755
|
if (childNode) {
|
|
352
756
|
vnodes[startIdx].$elm$ = childNode;
|
|
353
|
-
containerElm.insertBefore(childNode, before);
|
|
757
|
+
containerElm.insertBefore(childNode, referenceNode(before) );
|
|
354
758
|
}
|
|
355
759
|
}
|
|
356
760
|
}
|
|
@@ -372,6 +776,20 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
372
776
|
if (vnode) {
|
|
373
777
|
const elm = vnode.$elm$;
|
|
374
778
|
if (elm) {
|
|
779
|
+
{
|
|
780
|
+
// we're removing this element
|
|
781
|
+
// so it's possible we need to show slot fallback content now
|
|
782
|
+
checkSlotFallbackVisibility = true;
|
|
783
|
+
if (elm['s-ol']) {
|
|
784
|
+
// remove the original location comment
|
|
785
|
+
elm['s-ol'].remove();
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
// it's possible that child nodes of the node
|
|
789
|
+
// that's being removed are slot nodes
|
|
790
|
+
putBackInOriginalLocation(elm, true);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
375
793
|
// remove the vnode's element from the dom
|
|
376
794
|
elm.remove();
|
|
377
795
|
}
|
|
@@ -489,6 +907,23 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
489
907
|
newEndVnode = newCh[--newEndIdx];
|
|
490
908
|
}
|
|
491
909
|
else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
910
|
+
// case: "Vnode moved right"
|
|
911
|
+
//
|
|
912
|
+
// We've found that the last node in our window on the new children is
|
|
913
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
914
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
915
|
+
// nodes:
|
|
916
|
+
//
|
|
917
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
918
|
+
// ^^^^^^^^^^^
|
|
919
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
920
|
+
// ^^^^^^^^^^^^^
|
|
921
|
+
//
|
|
922
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
923
|
+
// and move the DOM element for `oldStartVnode`.
|
|
924
|
+
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
925
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
926
|
+
}
|
|
492
927
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
493
928
|
// We need to move the element for `oldStartVnode` into a position which
|
|
494
929
|
// will be appropriate for `newEndVnode`. For this we can use
|
|
@@ -512,6 +947,24 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
512
947
|
newEndVnode = newCh[--newEndIdx];
|
|
513
948
|
}
|
|
514
949
|
else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
950
|
+
// case: "Vnode moved left"
|
|
951
|
+
//
|
|
952
|
+
// We've found that the first node in our window on the new children is
|
|
953
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
954
|
+
// Visually, this is the layout of these two nodes:
|
|
955
|
+
//
|
|
956
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
957
|
+
// ^^^^^^^^^^^^^
|
|
958
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
959
|
+
// ^^^^^^^^^^^
|
|
960
|
+
//
|
|
961
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
962
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
963
|
+
// children etc) but we also need to move the DOM node to which
|
|
964
|
+
// `oldEndVnode` corresponds.
|
|
965
|
+
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
966
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
967
|
+
}
|
|
515
968
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
516
969
|
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
517
970
|
// the same node, so since we're here we know that they are not. Thus we
|
|
@@ -528,13 +981,13 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
|
|
|
528
981
|
// the key of the first new child OR the build is not using `key`
|
|
529
982
|
// attributes at all. In either case we need to create a new element
|
|
530
983
|
// for the new node.
|
|
531
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
984
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
|
532
985
|
newStartVnode = newCh[++newStartIdx];
|
|
533
986
|
}
|
|
534
987
|
if (node) {
|
|
535
988
|
// if we created a new node then handle inserting it to the DOM
|
|
536
989
|
{
|
|
537
|
-
oldStartVnode.$elm
|
|
990
|
+
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
538
991
|
}
|
|
539
992
|
}
|
|
540
993
|
}
|
|
@@ -573,10 +1026,21 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
573
1026
|
// compare if two vnode to see if they're "technically" the same
|
|
574
1027
|
// need to have the same element tag, and same key to be the same
|
|
575
1028
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1029
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
1030
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
1031
|
+
}
|
|
576
1032
|
return true;
|
|
577
1033
|
}
|
|
578
1034
|
return false;
|
|
579
1035
|
};
|
|
1036
|
+
const referenceNode = (node) => {
|
|
1037
|
+
// this node was relocated to a new location in the dom
|
|
1038
|
+
// because of some other component's slot
|
|
1039
|
+
// but we still have an html comment in place of where
|
|
1040
|
+
// it's original location was according to it's original vdom
|
|
1041
|
+
return (node && node['s-ol']) || node;
|
|
1042
|
+
};
|
|
1043
|
+
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
580
1044
|
/**
|
|
581
1045
|
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
582
1046
|
* it. This function handles flushing updates to the DOM and reconciling the
|
|
@@ -590,8 +1054,25 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
590
1054
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
591
1055
|
const oldChildren = oldVNode.$children$;
|
|
592
1056
|
const newChildren = newVNode.$children$;
|
|
1057
|
+
const tag = newVNode.$tag$;
|
|
593
1058
|
const text = newVNode.$text$;
|
|
1059
|
+
let defaultHolder;
|
|
594
1060
|
if (text === null) {
|
|
1061
|
+
{
|
|
1062
|
+
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
1063
|
+
// only add this to the when the compiler sees we're using an svg somewhere
|
|
1064
|
+
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
1065
|
+
}
|
|
1066
|
+
{
|
|
1067
|
+
if (tag === 'slot')
|
|
1068
|
+
;
|
|
1069
|
+
else {
|
|
1070
|
+
// either this is the first render of an element OR it's an update
|
|
1071
|
+
// AND we already know it's possible it could have changed
|
|
1072
|
+
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
1073
|
+
updateElement(oldVNode, newVNode, isSvgMode);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
595
1076
|
if (oldChildren !== null && newChildren !== null) {
|
|
596
1077
|
// looks like there's child vnodes for both the old and new vnodes
|
|
597
1078
|
// so we need to call `updateChildren` to reconcile them
|
|
@@ -610,6 +1091,13 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
610
1091
|
// no new child vnodes, but there are old child vnodes to remove
|
|
611
1092
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
612
1093
|
}
|
|
1094
|
+
if (isSvgMode && tag === 'svg') {
|
|
1095
|
+
isSvgMode = false;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
else if ((defaultHolder = elm['s-cr'])) {
|
|
1099
|
+
// this element has slotted content
|
|
1100
|
+
defaultHolder.parentNode.textContent = text;
|
|
613
1101
|
}
|
|
614
1102
|
else if (oldVNode.$text$ !== text) {
|
|
615
1103
|
// update the text content for the text only vnode
|
|
@@ -617,6 +1105,183 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
617
1105
|
elm.data = text;
|
|
618
1106
|
}
|
|
619
1107
|
};
|
|
1108
|
+
/**
|
|
1109
|
+
* Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
|
|
1110
|
+
* are slot fallbacks nodes.
|
|
1111
|
+
*
|
|
1112
|
+
* A slot fallback node should be visible by default. Then, it should be
|
|
1113
|
+
* conditionally hidden if:
|
|
1114
|
+
*
|
|
1115
|
+
* - it has a sibling with a `slot` property set to its slot name or if
|
|
1116
|
+
* - it is a default fallback slot node, in which case we hide if it has any
|
|
1117
|
+
* content
|
|
1118
|
+
*
|
|
1119
|
+
* @param elm the element of interest
|
|
1120
|
+
*/
|
|
1121
|
+
const updateFallbackSlotVisibility = (elm) => {
|
|
1122
|
+
const childNodes = elm.childNodes;
|
|
1123
|
+
for (const childNode of childNodes) {
|
|
1124
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1125
|
+
if (childNode['s-sr']) {
|
|
1126
|
+
// this is a slot fallback node
|
|
1127
|
+
// get the slot name for this slot reference node
|
|
1128
|
+
const slotName = childNode['s-sn'];
|
|
1129
|
+
// by default always show a fallback slot node
|
|
1130
|
+
// then hide it if there are other slots in the light dom
|
|
1131
|
+
childNode.hidden = false;
|
|
1132
|
+
// we need to check all of its sibling nodes in order to see if
|
|
1133
|
+
// `childNode` should be hidden
|
|
1134
|
+
for (const siblingNode of childNodes) {
|
|
1135
|
+
// Don't check the node against itself
|
|
1136
|
+
if (siblingNode !== childNode) {
|
|
1137
|
+
if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
|
|
1138
|
+
// this sibling node is from a different component OR is a named
|
|
1139
|
+
// fallback slot node
|
|
1140
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
|
1141
|
+
(slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
|
|
1142
|
+
childNode.hidden = true;
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
else {
|
|
1147
|
+
// this is a default fallback slot node
|
|
1148
|
+
// any element or text node (with content)
|
|
1149
|
+
// should hide the default fallback slot node
|
|
1150
|
+
if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1151
|
+
(siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
|
|
1152
|
+
childNode.hidden = true;
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
// keep drilling down
|
|
1160
|
+
updateFallbackSlotVisibility(childNode);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
/**
|
|
1165
|
+
* Component-global information about nodes which are either currently being
|
|
1166
|
+
* relocated or will be shortly.
|
|
1167
|
+
*/
|
|
1168
|
+
const relocateNodes = [];
|
|
1169
|
+
/**
|
|
1170
|
+
* Mark the contents of a slot for relocation via adding references to them to
|
|
1171
|
+
* the {@link relocateNodes} data structure. The actual work of relocating them
|
|
1172
|
+
* will then be handled in {@link renderVdom}.
|
|
1173
|
+
*
|
|
1174
|
+
* @param elm a render node whose child nodes need to be relocated
|
|
1175
|
+
*/
|
|
1176
|
+
const markSlotContentForRelocation = (elm) => {
|
|
1177
|
+
// tslint:disable-next-line: prefer-const
|
|
1178
|
+
let node;
|
|
1179
|
+
let hostContentNodes;
|
|
1180
|
+
let j;
|
|
1181
|
+
for (const childNode of elm.childNodes) {
|
|
1182
|
+
// we need to find child nodes which are slot references so we can then try
|
|
1183
|
+
// to match them up with nodes that need to be relocated
|
|
1184
|
+
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
1185
|
+
// first get the content reference comment node ('s-cr'), then we get
|
|
1186
|
+
// its parent, which is where all the host content is now
|
|
1187
|
+
hostContentNodes = node.parentNode.childNodes;
|
|
1188
|
+
const slotName = childNode['s-sn'];
|
|
1189
|
+
// iterate through all the nodes under the location where the host was
|
|
1190
|
+
// originally rendered
|
|
1191
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1192
|
+
node = hostContentNodes[j];
|
|
1193
|
+
// check that the node is not a content reference node or a node
|
|
1194
|
+
// reference and then check that the host name does not match that of
|
|
1195
|
+
// childNode.
|
|
1196
|
+
// In addition, check that the slot either has not already been relocated, or
|
|
1197
|
+
// that its current location's host is not childNode's host. This is essentially
|
|
1198
|
+
// a check so that we don't try to relocate (and then hide) a node that is already
|
|
1199
|
+
// where it should be.
|
|
1200
|
+
if (!node['s-cn'] &&
|
|
1201
|
+
!node['s-nr'] &&
|
|
1202
|
+
node['s-hn'] !== childNode['s-hn'] &&
|
|
1203
|
+
(!BUILD.experimentalSlotFixes )) {
|
|
1204
|
+
// if `node` is located in the slot that `childNode` refers to (via the
|
|
1205
|
+
// `'s-sn'` property) then we need to relocate it from it's current spot
|
|
1206
|
+
// (under the host element parent) to the right slot location
|
|
1207
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1208
|
+
// it's possible we've already decided to relocate this node
|
|
1209
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1210
|
+
// made some changes to slots
|
|
1211
|
+
// let's make sure we also double check
|
|
1212
|
+
// fallbacks are correctly hidden or shown
|
|
1213
|
+
checkSlotFallbackVisibility = true;
|
|
1214
|
+
// ensure that the slot-name attr is correct
|
|
1215
|
+
node['s-sn'] = node['s-sn'] || slotName;
|
|
1216
|
+
if (relocateNodeData) {
|
|
1217
|
+
relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
|
|
1218
|
+
// we marked this node for relocation previously but didn't find
|
|
1219
|
+
// out the slot reference node to which it needs to be relocated
|
|
1220
|
+
// so write it down now!
|
|
1221
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
node['s-sh'] = childNode['s-hn'];
|
|
1225
|
+
// add to our list of nodes to relocate
|
|
1226
|
+
relocateNodes.push({
|
|
1227
|
+
$slotRefNode$: childNode,
|
|
1228
|
+
$nodeToRelocate$: node,
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
if (node['s-sr']) {
|
|
1232
|
+
relocateNodes.map((relocateNode) => {
|
|
1233
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
|
1234
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1235
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1236
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1243
|
+
// the node is not found within the slot (`childNode`) that we're
|
|
1244
|
+
// currently looking at, so we stick it into `relocateNodes` to
|
|
1245
|
+
// handle later. If we never find a home for this element then
|
|
1246
|
+
// we'll need to hide it
|
|
1247
|
+
relocateNodes.push({
|
|
1248
|
+
$nodeToRelocate$: node,
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
// if we're dealing with any type of element (capable of itself being a
|
|
1255
|
+
// slot reference or containing one) then we recur
|
|
1256
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1257
|
+
markSlotContentForRelocation(childNode);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
};
|
|
1261
|
+
/**
|
|
1262
|
+
* Check whether a node is located in a given named slot.
|
|
1263
|
+
*
|
|
1264
|
+
* @param nodeToRelocate the node of interest
|
|
1265
|
+
* @param slotName the slot name to check
|
|
1266
|
+
* @returns whether the node is located in the slot or not
|
|
1267
|
+
*/
|
|
1268
|
+
const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1269
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1270
|
+
if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
|
|
1271
|
+
// if the node doesn't have a slot attribute, and the slot we're checking
|
|
1272
|
+
// is not a named slot, then we assume the node should be within the slot
|
|
1273
|
+
return true;
|
|
1274
|
+
}
|
|
1275
|
+
if (nodeToRelocate.getAttribute('slot') === slotName) {
|
|
1276
|
+
return true;
|
|
1277
|
+
}
|
|
1278
|
+
return false;
|
|
1279
|
+
}
|
|
1280
|
+
if (nodeToRelocate['s-sn'] === slotName) {
|
|
1281
|
+
return true;
|
|
1282
|
+
}
|
|
1283
|
+
return slotName === '';
|
|
1284
|
+
};
|
|
620
1285
|
/**
|
|
621
1286
|
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
622
1287
|
*
|
|
@@ -631,7 +1296,9 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
|
631
1296
|
* @param isInitialLoad whether or not this is the first call after page load
|
|
632
1297
|
*/
|
|
633
1298
|
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1299
|
+
var _a, _b, _c, _d;
|
|
634
1300
|
const hostElm = hostRef.$hostElement$;
|
|
1301
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
635
1302
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
636
1303
|
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
637
1304
|
// we need to call `h` again to wrap the children of our component in a
|
|
@@ -664,12 +1331,114 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
664
1331
|
rootVnode.$tag$ = null;
|
|
665
1332
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
666
1333
|
hostRef.$vnode$ = rootVnode;
|
|
667
|
-
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm
|
|
1334
|
+
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
668
1335
|
{
|
|
669
1336
|
scopeId = hostElm['s-sc'];
|
|
670
1337
|
}
|
|
1338
|
+
{
|
|
1339
|
+
contentRef = hostElm['s-cr'];
|
|
1340
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
1341
|
+
// always reset
|
|
1342
|
+
checkSlotFallbackVisibility = false;
|
|
1343
|
+
}
|
|
671
1344
|
// synchronous patch
|
|
672
1345
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1346
|
+
{
|
|
1347
|
+
// while we're moving nodes around existing nodes, temporarily disable
|
|
1348
|
+
// the disconnectCallback from working
|
|
1349
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1350
|
+
if (checkSlotRelocate) {
|
|
1351
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1352
|
+
for (const relocateData of relocateNodes) {
|
|
1353
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1354
|
+
if (!nodeToRelocate['s-ol']) {
|
|
1355
|
+
// add a reference node marking this node's original location
|
|
1356
|
+
// keep a reference to this node for later lookups
|
|
1357
|
+
const orgLocationNode = doc.createTextNode('');
|
|
1358
|
+
orgLocationNode['s-nr'] = nodeToRelocate;
|
|
1359
|
+
nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
for (const relocateData of relocateNodes) {
|
|
1363
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1364
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1365
|
+
if (slotRefNode) {
|
|
1366
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1367
|
+
// When determining where to insert content, the most simple case would be
|
|
1368
|
+
// to relocate the node immediately following the slot reference node. We do this
|
|
1369
|
+
// by getting a reference to the node immediately following the slot reference node
|
|
1370
|
+
// since we will use `insertBefore` to manipulate the DOM.
|
|
1371
|
+
//
|
|
1372
|
+
// If there is no node immediately following the slot reference node, then we will just
|
|
1373
|
+
// end up appending the node as the last child of the parent.
|
|
1374
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1375
|
+
// If the node we're currently planning on inserting the new node before is an element,
|
|
1376
|
+
// we need to do some additional checks to make sure we're inserting the node in the correct order.
|
|
1377
|
+
// The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
|
|
1378
|
+
// to make sure they get inserted into their new how in the same order they were declared in their original location.
|
|
1379
|
+
//
|
|
1380
|
+
// TODO(STENCIL-914): Remove `experimentalSlotFixes` check
|
|
1381
|
+
{
|
|
1382
|
+
let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
|
|
1383
|
+
while (orgLocationNode) {
|
|
1384
|
+
let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
|
|
1385
|
+
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
|
1386
|
+
refNode = refNode.nextSibling;
|
|
1387
|
+
if (!refNode || !refNode['s-nr']) {
|
|
1388
|
+
insertBeforeNode = refNode;
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
|
1396
|
+
nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1397
|
+
// we've checked that it's worth while to relocate
|
|
1398
|
+
// since that the node to relocate
|
|
1399
|
+
// has a different next sibling or parent relocated
|
|
1400
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1401
|
+
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
|
1402
|
+
// probably a component in the index.html that doesn't have its hostname set
|
|
1403
|
+
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
|
1404
|
+
}
|
|
1405
|
+
// Add it back to the dom but in its new home
|
|
1406
|
+
// If we get to this point and `insertBeforeNode` is `null`, that means
|
|
1407
|
+
// we're just going to append the node as the last child of the parent. Passing
|
|
1408
|
+
// `null` as the second arg here will trigger that behavior.
|
|
1409
|
+
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
|
1410
|
+
// Reset the `hidden` value back to what it was defined as originally
|
|
1411
|
+
// This solves a problem where a `slot` is dynamically rendered and `hidden` may have
|
|
1412
|
+
// been set on content originally, but now it has a slot to go to so it should have
|
|
1413
|
+
// the value it was defined as having in the DOM, not what we overrode it to.
|
|
1414
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1415
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
else {
|
|
1421
|
+
// this node doesn't have a slot home to go to, so let's hide it
|
|
1422
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
1423
|
+
// Store the initial value of `hidden` so we can reset it later when
|
|
1424
|
+
// moving nodes around.
|
|
1425
|
+
if (isInitialLoad) {
|
|
1426
|
+
nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
|
|
1427
|
+
}
|
|
1428
|
+
nodeToRelocate.hidden = true;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
if (checkSlotFallbackVisibility) {
|
|
1434
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1435
|
+
}
|
|
1436
|
+
// done moving nodes around
|
|
1437
|
+
// allow the disconnect callback to work again
|
|
1438
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
1439
|
+
// always reset
|
|
1440
|
+
relocateNodes.length = 0;
|
|
1441
|
+
}
|
|
673
1442
|
};
|
|
674
1443
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
675
1444
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
@@ -717,6 +1486,26 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
717
1486
|
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
718
1487
|
// called in order after `dispatchHooks` exits.
|
|
719
1488
|
let maybePromise;
|
|
1489
|
+
if (isInitialLoad) {
|
|
1490
|
+
{
|
|
1491
|
+
// If `componentWillLoad` returns a `Promise` then we want to wait on
|
|
1492
|
+
// whatever's going on in that `Promise` before we launch into
|
|
1493
|
+
// rendering the component, doing other lifecycle stuff, etc. So
|
|
1494
|
+
// in that case we assign the returned promise to the variable we
|
|
1495
|
+
// declared above to hold a possible 'queueing' Promise
|
|
1496
|
+
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
else {
|
|
1500
|
+
{
|
|
1501
|
+
// Like `componentWillLoad` above, we allow Stencil component
|
|
1502
|
+
// authors to return a `Promise` from this lifecycle callback, and
|
|
1503
|
+
// we specify that our runtime will wait for that `Promise` to
|
|
1504
|
+
// resolve before the component re-renders. So if the method
|
|
1505
|
+
// returns a `Promise` we need to keep it around!
|
|
1506
|
+
maybePromise = safeCall(instance, 'componentWillUpdate');
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
720
1509
|
endSchedule();
|
|
721
1510
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
722
1511
|
};
|
|
@@ -839,6 +1628,7 @@ const postUpdateComponent = (hostRef) => {
|
|
|
839
1628
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
840
1629
|
const elm = hostRef.$hostElement$;
|
|
841
1630
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1631
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
842
1632
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
843
1633
|
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
844
1634
|
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
@@ -846,6 +1636,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
846
1636
|
// DOM WRITE!
|
|
847
1637
|
addHydratedFlag(elm);
|
|
848
1638
|
}
|
|
1639
|
+
{
|
|
1640
|
+
safeCall(instance, 'componentDidLoad');
|
|
1641
|
+
}
|
|
849
1642
|
endPostUpdate();
|
|
850
1643
|
{
|
|
851
1644
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -881,6 +1674,27 @@ const appDidLoad = (who) => {
|
|
|
881
1674
|
}
|
|
882
1675
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
883
1676
|
};
|
|
1677
|
+
/**
|
|
1678
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
1679
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
1680
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
1681
|
+
* output bundle and this function returns `undefined`.
|
|
1682
|
+
* @param instance any object that may or may not contain methods
|
|
1683
|
+
* @param method method name
|
|
1684
|
+
* @param arg single arbitrary argument
|
|
1685
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
1686
|
+
*/
|
|
1687
|
+
const safeCall = (instance, method, arg) => {
|
|
1688
|
+
if (instance && instance[method]) {
|
|
1689
|
+
try {
|
|
1690
|
+
return instance[method](arg);
|
|
1691
|
+
}
|
|
1692
|
+
catch (e) {
|
|
1693
|
+
consoleError(e);
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
return undefined;
|
|
1697
|
+
};
|
|
884
1698
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
885
1699
|
;
|
|
886
1700
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
@@ -1091,6 +1905,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1091
1905
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1092
1906
|
}
|
|
1093
1907
|
endNewInstance();
|
|
1908
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1094
1909
|
}
|
|
1095
1910
|
if (Cstr.style) {
|
|
1096
1911
|
// this component has styles but we haven't registered them yet
|
|
@@ -1120,6 +1935,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1120
1935
|
}
|
|
1121
1936
|
};
|
|
1122
1937
|
const fireConnectedCallback = (instance) => {
|
|
1938
|
+
{
|
|
1939
|
+
safeCall(instance, 'connectedCallback');
|
|
1940
|
+
}
|
|
1123
1941
|
};
|
|
1124
1942
|
const connectedCallback = (elm) => {
|
|
1125
1943
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
@@ -1129,6 +1947,16 @@ const connectedCallback = (elm) => {
|
|
|
1129
1947
|
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1130
1948
|
// first time this component has connected
|
|
1131
1949
|
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1950
|
+
{
|
|
1951
|
+
// initUpdate
|
|
1952
|
+
// if the slot polyfill is required we'll need to put some nodes
|
|
1953
|
+
// in here to act as original content anchors as we move nodes around
|
|
1954
|
+
// host element has been connected to the DOM
|
|
1955
|
+
if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1956
|
+
cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1957
|
+
setContentReference(elm);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1132
1960
|
{
|
|
1133
1961
|
// find the first ancestor component (if there is one) and register
|
|
1134
1962
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -1161,22 +1989,40 @@ const connectedCallback = (elm) => {
|
|
|
1161
1989
|
}
|
|
1162
1990
|
else {
|
|
1163
1991
|
// fire off connectedCallback() on component instance
|
|
1164
|
-
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$)
|
|
1992
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
1993
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1994
|
+
}
|
|
1165
1995
|
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1166
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1996
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
|
|
1167
1997
|
}
|
|
1168
1998
|
}
|
|
1169
1999
|
endConnected();
|
|
1170
2000
|
}
|
|
1171
2001
|
};
|
|
2002
|
+
const setContentReference = (elm) => {
|
|
2003
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
2004
|
+
// or this browser doesn't support native shadow dom
|
|
2005
|
+
// and this host element was NOT created with SSR
|
|
2006
|
+
// let's pick out the inner content for slot projection
|
|
2007
|
+
// create a node to represent where the original
|
|
2008
|
+
// content was first placed, which is useful later on
|
|
2009
|
+
const contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
|
2010
|
+
contentRefElm['s-cn'] = true;
|
|
2011
|
+
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
2012
|
+
};
|
|
1172
2013
|
const disconnectInstance = (instance) => {
|
|
2014
|
+
{
|
|
2015
|
+
safeCall(instance, 'disconnectedCallback');
|
|
2016
|
+
}
|
|
1173
2017
|
};
|
|
1174
2018
|
const disconnectedCallback = async (elm) => {
|
|
1175
2019
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1176
2020
|
const hostRef = getHostRef(elm);
|
|
1177
|
-
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$)
|
|
2021
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
2022
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
2023
|
+
}
|
|
1178
2024
|
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1179
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
2025
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1180
2026
|
}
|
|
1181
2027
|
}
|
|
1182
2028
|
};
|
|
@@ -1219,17 +2065,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1219
2065
|
super(self);
|
|
1220
2066
|
self = this;
|
|
1221
2067
|
registerHost(self, cmpMeta);
|
|
1222
|
-
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
1223
|
-
// this component is using shadow dom
|
|
1224
|
-
// and this browser supports shadow dom
|
|
1225
|
-
// add the read-only property "shadowRoot" to the host element
|
|
1226
|
-
// adding the shadow root build conditionals to minimize runtime
|
|
1227
|
-
{
|
|
1228
|
-
{
|
|
1229
|
-
self.attachShadow({ mode: 'open' });
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
2068
|
}
|
|
1234
2069
|
connectedCallback() {
|
|
1235
2070
|
if (appLoadFallback) {
|
|
@@ -1291,6 +2126,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1291
2126
|
// Fallback appLoad event
|
|
1292
2127
|
endBootstrap();
|
|
1293
2128
|
};
|
|
2129
|
+
const Fragment = (_, children) => children;
|
|
1294
2130
|
/**
|
|
1295
2131
|
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1296
2132
|
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
@@ -1342,6 +2178,7 @@ const registerHost = (hostElement, cmpMeta) => {
|
|
|
1342
2178
|
}
|
|
1343
2179
|
return hostRefs.set(hostElement, hostRef);
|
|
1344
2180
|
};
|
|
2181
|
+
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
1345
2182
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
1346
2183
|
const cmpModules = /*@__PURE__*/ new Map();
|
|
1347
2184
|
const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
@@ -1430,10 +2267,14 @@ const flush = () => {
|
|
|
1430
2267
|
const nextTick = (cb) => promiseResolve().then(cb);
|
|
1431
2268
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1432
2269
|
|
|
2270
|
+
exports.Fragment = Fragment;
|
|
2271
|
+
exports.Host = Host;
|
|
1433
2272
|
exports.bootstrapLazy = bootstrapLazy;
|
|
2273
|
+
exports.createEvent = createEvent;
|
|
2274
|
+
exports.getAssetPath = getAssetPath;
|
|
1434
2275
|
exports.h = h;
|
|
1435
2276
|
exports.promiseResolve = promiseResolve;
|
|
1436
2277
|
exports.registerInstance = registerInstance;
|
|
1437
2278
|
exports.setNonce = setNonce;
|
|
1438
2279
|
|
|
1439
|
-
//# sourceMappingURL=index-
|
|
2280
|
+
//# sourceMappingURL=index-75c0e002.js.map
|