@nanoporetech-digital/components 3.7.1 → 3.8.1
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/CHANGELOG.md +37 -0
- package/dist/cjs/{algolia-data-9152d0ef.js → algolia-data-fb13160a.js} +2 -2
- package/dist/cjs/{algolia-data-9152d0ef.js.map → algolia-data-fb13160a.js.map} +1 -1
- package/dist/cjs/{algoliasearch.umd-7ee60729.js → algoliasearch.umd-689c1560.js} +3 -3
- package/dist/cjs/{algoliasearch.umd-7ee60729.js.map → algoliasearch.umd-689c1560.js.map} +1 -1
- package/dist/cjs/{component-store-d7c8c326.js → component-store-b80bdb26.js} +25 -12
- package/dist/cjs/component-store-b80bdb26.js.map +1 -0
- package/dist/cjs/{dom-d7c33f11.js → dom-7acf7afd.js} +15 -15
- package/dist/cjs/dom-7acf7afd.js.map +1 -0
- package/dist/cjs/{form-control-57c71246.js → form-control-845951ac.js} +4 -4
- package/dist/cjs/form-control-845951ac.js.map +1 -0
- package/dist/{esm/global-8047b4ff.js → cjs/global-3a6a7873.js} +5 -14
- package/dist/cjs/global-3a6a7873.js.map +1 -0
- package/dist/cjs/{index-bb2a6ab8.js → index-5e11be36.js} +2 -2
- package/dist/cjs/{index-bb2a6ab8.js.map → index-5e11be36.js.map} +1 -1
- package/dist/cjs/{index-ece1cb9e.js → index-72ee0363.js} +2 -10
- package/dist/cjs/index-72ee0363.js.map +1 -0
- package/dist/cjs/{index-41582c2a.js → index-e1b5c3ea.js} +1438 -516
- package/dist/cjs/index-e1b5c3ea.js.map +1 -0
- package/dist/cjs/index.cjs.js +18 -35
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +5 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{modal-e4defcc3.js → modal-5884a6de.js} +3 -2
- package/dist/cjs/modal-5884a6de.js.map +1 -0
- package/dist/cjs/nano-accordion.cjs.entry.js +4 -7
- package/dist/cjs/nano-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-alert.cjs.entry.js +25 -19
- package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-algolia-filter.cjs.entry.js +5 -5
- package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-algolia-input.cjs.entry.js +4 -4
- package/dist/cjs/nano-algolia-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-algolia-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia-results.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia.cjs.entry.js +8 -8
- package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox-group.cjs.entry.js +52 -9
- package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js +8 -8
- package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-components.cjs.js +8 -4
- package/dist/cjs/nano-components.cjs.js.map +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +46 -36
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js +6 -6
- package/dist/cjs/nano-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js +4 -4
- package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-demo.cjs.entry.js +13 -9
- package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-details.cjs.entry.js +4 -4
- package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-dialog.cjs.entry.js +6 -6
- package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-drawer.cjs.entry.js +5 -5
- package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-dropdown.cjs.entry.js +9 -4
- package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-field-validator.cjs.entry.js +4 -3
- package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-file-upload.cjs.entry.js +5 -5
- package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +54 -67
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav.cjs.entry.js +54 -26
- package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-search-results.cjs.entry.js +6 -4
- package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js +8 -7
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-hero.cjs.entry.js +4 -2
- package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js +7 -14
- package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +19 -33
- package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-menu-drawer.cjs.entry.js +3 -3
- package/dist/cjs/nano-menu-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-progress-bar_2.cjs.entry.js +4 -4
- package/dist/cjs/nano-progress-bar_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +4 -4
- package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-rating.cjs.entry.js +2 -2
- package/dist/cjs/nano-rating.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +18 -10
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/nano-slides.cjs.entry.js +11 -21
- package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-spinner.cjs.entry.js +3 -3
- package/dist/cjs/nano-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js +15 -13
- package/dist/cjs/nano-split-pane.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +6 -4
- package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-content.cjs.entry.js +9 -3
- package/dist/cjs/nano-tab-content.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +18 -12
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-820b04d5.js → nano-table-e76a8dde.js} +115 -150
- package/dist/cjs/nano-table-e76a8dde.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +3 -3
- package/dist/cjs/{popover-508bcedb.js → popover-088646b2.js} +61 -50
- package/dist/cjs/popover-088646b2.js.map +1 -0
- package/dist/cjs/{scroll-9bb5e060.js → scroll-a197d9c4.js} +2 -2
- package/dist/cjs/{scroll-9bb5e060.js.map → scroll-a197d9c4.js.map} +1 -1
- package/dist/cjs/{table.worker-9e238d16.js → table.worker-988d87da.js} +4 -4
- package/dist/cjs/table.worker-988d87da.js.map +1 -0
- package/dist/cjs/{theme-50275e1a.js → theme-9cbe28c5.js} +2 -7
- package/dist/cjs/theme-9cbe28c5.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/accordion/accordion.js +1 -4
- package/dist/collection/components/accordion/accordion.js.map +1 -1
- package/dist/collection/components/alert/alert.css +4 -3
- package/dist/collection/components/alert/alert.helpers.js +6 -24
- package/dist/collection/components/alert/alert.helpers.js.map +1 -1
- package/dist/collection/components/alert/alert.js +19 -13
- package/dist/collection/components/alert/alert.js.map +1 -1
- package/dist/collection/components/algolia/algolia-filter.js +2 -2
- package/dist/collection/components/algolia/algolia-filter.js.map +1 -1
- package/dist/collection/components/algolia/algolia-input.js.map +1 -1
- package/dist/collection/components/algolia/algolia.css +2 -1
- package/dist/collection/components/algolia/algolia.js +3 -3
- package/dist/collection/components/algolia/algolia.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox-group.css +16 -10
- package/dist/collection/components/checkbox/checkbox-group.js +91 -7
- package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.css +14 -12
- package/dist/collection/components/checkbox/checkbox.js +5 -5
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/datalist/datalist.js +39 -31
- package/dist/collection/components/datalist/datalist.js.map +1 -1
- package/dist/collection/components/date-input/date-input.css +3 -3
- package/dist/collection/components/date-input/date-input.js +3 -3
- package/dist/collection/components/date-input/date-input.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.css +15 -11
- package/dist/collection/components/date-picker/date-picker.js +1 -1
- package/dist/collection/components/date-picker/date-picker.js.map +1 -1
- package/dist/collection/components/demo/demo.js +12 -8
- package/dist/collection/components/demo/demo.js.map +1 -1
- package/dist/collection/components/details/details.css +2 -1
- package/dist/collection/components/details/details.js +1 -1
- package/dist/collection/components/details/details.js.map +1 -1
- package/dist/collection/components/dialog/dialog.css +8 -5
- package/dist/collection/components/dialog/dialog.helpers.js +3 -11
- package/dist/collection/components/dialog/dialog.helpers.js.map +1 -1
- package/dist/collection/components/drawer/drawer.css +2 -2
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +6 -1
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/field-validator/field-validator.js +2 -1
- package/dist/collection/components/field-validator/field-validator.js.map +1 -1
- package/dist/collection/components/file-upload/file-upload.css +35 -25
- package/dist/collection/components/file-upload/file-upload.js +4 -4
- package/dist/collection/components/file-upload/file-upload.js.map +1 -1
- package/dist/collection/components/form-control/form-control.js +2 -2
- package/dist/collection/components/form-control/form-control.js.map +1 -1
- package/dist/collection/components/global-nav/global-nav-user-profile.js +6 -7
- package/dist/collection/components/global-nav/global-nav-user-profile.js.map +1 -1
- package/dist/collection/components/global-nav/global-nav.js +61 -11
- package/dist/collection/components/global-nav/global-nav.js.map +1 -1
- package/dist/collection/components/global-nav/style/global-nav.css +92 -48
- package/dist/collection/components/global-search-results/global-search-results.css +83 -44
- package/dist/collection/components/global-search-results/global-search-results.js +4 -2
- package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
- package/dist/collection/components/grid/grid-item.css +1 -1
- package/dist/collection/components/grid/grid.css +1 -0
- package/dist/collection/components/grid/grid.js +2 -0
- package/dist/collection/components/grid/grid.js.map +1 -1
- package/dist/collection/components/hero/hero.css +110 -18
- package/dist/collection/components/hero/hero.js +2 -0
- package/dist/collection/components/hero/hero.js.map +1 -1
- package/dist/collection/components/icon/icon.css +2 -2
- package/dist/collection/components/icon/icon.js +3 -10
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.css +1 -1
- package/dist/collection/components/img/img.css +0 -1
- package/dist/collection/components/img/img.js +3 -4
- package/dist/collection/components/img/img.js.map +1 -1
- package/dist/collection/components/input/input.css +54 -32
- package/dist/collection/components/input/input.js +14 -28
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/menu/menu.js +4 -2
- package/dist/collection/components/menu/menu.js.map +1 -1
- package/dist/collection/components/menu-drawer/menu-drawer.css +20 -13
- package/dist/collection/components/menu-drawer/menu-drawer.js +1 -1
- package/dist/collection/components/menu-drawer/menu-drawer.js.map +1 -1
- package/dist/collection/components/nav-item/nav-item.css +31 -16
- package/dist/collection/components/nav-item/nav-item.js +4 -4
- package/dist/collection/components/nav-item/nav-item.js.map +1 -1
- package/dist/collection/components/option/option.css +4 -2
- package/dist/collection/components/progress-bar/progress-bar.css +4 -4
- package/dist/collection/components/range/range.css +11 -9
- package/dist/collection/components/rating/rating.css +9 -5
- package/dist/collection/components/resize-observe/resize-observe.js +17 -6
- package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
- package/dist/collection/components/select/select.css +59 -34
- package/dist/collection/components/select/select.js +42 -55
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/skeleton/skeleton.css +5 -5
- package/dist/collection/components/slides/slides.css +4 -2
- package/dist/collection/components/slides/slides.js +9 -19
- package/dist/collection/components/slides/slides.js.map +1 -1
- package/dist/collection/components/spinner/spinner.css +13 -8
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/spinner/spinner.js.map +1 -1
- package/dist/collection/components/split-pane/split-pane.css +1 -1
- package/dist/collection/components/split-pane/split-pane.js +13 -11
- package/dist/collection/components/split-pane/split-pane.js.map +1 -1
- package/dist/collection/components/sticker/sticker.js +4 -2
- package/dist/collection/components/sticker/sticker.js.map +1 -1
- package/dist/collection/components/table/table.cell.js +8 -8
- package/dist/collection/components/table/table.cell.js.map +1 -1
- package/dist/collection/components/table/table.css +46 -25
- package/dist/collection/components/table/table.header.js +6 -19
- package/dist/collection/components/table/table.header.js.map +1 -1
- package/dist/collection/components/table/table.js +85 -93
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +8 -8
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.store.js +2 -1
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.utils.js +8 -7
- package/dist/collection/components/table/table.utils.js.map +1 -1
- package/dist/collection/components/tabs/tab-content.css +7 -2
- package/dist/collection/components/tabs/tab-content.js +12 -1
- package/dist/collection/components/tabs/tab-content.js.map +1 -1
- package/dist/collection/components/tabs/tab-group.css +13 -10
- package/dist/collection/components/tabs/tab-group.js +17 -7
- package/dist/collection/components/tabs/tab-group.js.map +1 -1
- package/dist/collection/components/tabs/tab.css +21 -12
- package/dist/collection/components/tooltip/tooltip.css +25 -16
- package/dist/collection/global/script/global.js +2 -13
- package/dist/collection/global/script/global.js.map +1 -1
- package/dist/collection/index.js +17 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/dom.js +16 -15
- package/dist/collection/utils/dom.js.map +1 -1
- package/dist/collection/utils/fetch.js +15 -12
- package/dist/collection/utils/fetch.js.map +1 -1
- package/dist/collection/utils/gesture/index.js +1 -9
- package/dist/collection/utils/gesture/index.js.map +1 -1
- package/dist/collection/utils/modal.js +2 -1
- package/dist/collection/utils/modal.js.map +1 -1
- package/dist/collection/utils/store/get-set.js +1 -1
- package/dist/collection/utils/store/get-set.js.map +1 -1
- package/dist/collection/utils/testing/index.js +1 -0
- package/dist/collection/utils/testing/index.js.map +1 -1
- package/dist/collection/utils/theme.js +1 -6
- package/dist/collection/utils/theme.js.map +1 -1
- package/dist/components/algolia.js +3 -3
- package/dist/components/algolia.js.map +1 -1
- package/dist/components/algoliasearch.umd.js +2 -2
- package/dist/components/algoliasearch.umd.js.map +1 -1
- package/dist/components/component-store.js +23 -10
- package/dist/components/component-store.js.map +1 -1
- package/dist/components/datalist.js +39 -31
- package/dist/components/datalist.js.map +1 -1
- package/dist/components/date-picker.js +2 -2
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dom.js +17 -15
- package/dist/components/dom.js.map +1 -1
- package/dist/components/dropdown.js +7 -2
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/form-control.js +2 -2
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/global-nav-user-profile.js +4 -3
- package/dist/components/global-nav-user-profile.js.map +1 -1
- package/dist/components/grid-item.js +1 -1
- package/dist/components/grid-item.js.map +1 -1
- package/dist/components/grid.js +3 -1
- package/dist/components/grid.js.map +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon.js +4 -11
- package/dist/components/icon.js.map +1 -1
- package/dist/components/img.js +4 -5
- package/dist/components/img.js.map +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +23 -52
- package/dist/components/index.js.map +1 -1
- package/dist/components/index3.js +635 -1069
- package/dist/components/index3.js.map +1 -1
- package/dist/components/input.js +15 -29
- package/dist/components/input.js.map +1 -1
- package/dist/components/menu.js +4 -2
- package/dist/components/menu.js.map +1 -1
- package/dist/components/modal.js +2 -1
- package/dist/components/modal.js.map +1 -1
- package/dist/components/nano-accordion.js +1 -4
- package/dist/components/nano-accordion.js.map +1 -1
- package/dist/components/nano-alert.js +20 -14
- package/dist/components/nano-alert.js.map +1 -1
- package/dist/components/nano-algolia-filter.js +2 -2
- package/dist/components/nano-algolia-filter.js.map +1 -1
- package/dist/components/nano-algolia-input.js.map +1 -1
- package/dist/components/nano-checkbox-group.js +53 -9
- package/dist/components/nano-checkbox-group.js.map +1 -1
- package/dist/components/nano-checkbox.js +6 -6
- package/dist/components/nano-checkbox.js.map +1 -1
- package/dist/components/nano-date-input.js +4 -4
- package/dist/components/nano-date-input.js.map +1 -1
- package/dist/components/nano-demo.js +12 -8
- package/dist/components/nano-demo.js.map +1 -1
- package/dist/components/nano-details.js +2 -2
- package/dist/components/nano-details.js.map +1 -1
- package/dist/components/nano-dialog.js +1 -1
- package/dist/components/nano-dialog.js.map +1 -1
- package/dist/components/nano-drawer.js +1 -1
- package/dist/components/nano-drawer.js.map +1 -1
- package/dist/components/nano-field-validator.js +2 -1
- package/dist/components/nano-field-validator.js.map +1 -1
- package/dist/components/nano-file-upload.js +4 -4
- package/dist/components/nano-file-upload.js.map +1 -1
- package/dist/components/nano-global-nav.js +51 -22
- package/dist/components/nano-global-nav.js.map +1 -1
- package/dist/components/nano-global-search-results.js +5 -3
- package/dist/components/nano-global-search-results.js.map +1 -1
- package/dist/components/nano-hero.js +3 -1
- package/dist/components/nano-hero.js.map +1 -1
- package/dist/components/nano-menu-drawer.js +2 -2
- package/dist/components/nano-menu-drawer.js.map +1 -1
- package/dist/components/nano-range.js +2 -2
- package/dist/components/nano-range.js.map +1 -1
- package/dist/components/nano-rating.js +1 -1
- package/dist/components/nano-rating.js.map +1 -1
- package/dist/components/nano-slides.js +10 -20
- package/dist/components/nano-slides.js.map +1 -1
- package/dist/components/nano-split-pane.js +14 -12
- package/dist/components/nano-split-pane.js.map +1 -1
- package/dist/components/nano-tab-content.js +10 -3
- package/dist/components/nano-tab-content.js.map +1 -1
- package/dist/components/nano-tab-group.js +18 -8
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/nano-tab.js +1 -1
- package/dist/components/nano-tab.js.map +1 -1
- package/dist/components/nav-item.js +5 -5
- package/dist/components/nav-item.js.map +1 -1
- package/dist/components/option.js +1 -1
- package/dist/components/option.js.map +1 -1
- package/dist/components/popover.js +60 -49
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress-bar.js +1 -1
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/resize-observe.js +16 -8
- package/dist/components/resize-observe.js.map +1 -1
- package/dist/components/select.js +43 -56
- package/dist/components/select.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/spinner.js +2 -2
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/sticker.js +4 -2
- package/dist/components/sticker.js.map +1 -1
- package/dist/components/table.js +117 -152
- package/dist/components/table.js.map +1 -1
- package/dist/components/theme.js +1 -6
- package/dist/components/theme.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/esm/{algolia-data-b5cd0c58.js → algolia-data-c4ed188c.js} +2 -2
- package/dist/esm/{algolia-data-b5cd0c58.js.map → algolia-data-c4ed188c.js.map} +1 -1
- package/dist/esm/{algoliasearch.umd-86359963.js → algoliasearch.umd-4f7efa84.js} +3 -3
- package/dist/esm/{algoliasearch.umd-86359963.js.map → algoliasearch.umd-4f7efa84.js.map} +1 -1
- package/dist/esm/{component-store-ec512820.js → component-store-6eccd724.js} +25 -12
- package/dist/esm/component-store-6eccd724.js.map +1 -0
- package/dist/esm/{dom-d3ad49e2.js → dom-311c9e1e.js} +15 -15
- package/dist/esm/dom-311c9e1e.js.map +1 -0
- package/dist/esm/{form-control-84bac7a2.js → form-control-3284c2c9.js} +4 -4
- package/dist/esm/form-control-3284c2c9.js.map +1 -0
- package/dist/{cjs/global-989678ec.js → esm/global-f6e05656.js} +3 -16
- package/dist/esm/global-f6e05656.js.map +1 -0
- package/dist/esm/{index-c752dae1.js → index-38484737.js} +2 -2
- package/dist/esm/{index-c752dae1.js.map → index-38484737.js.map} +1 -1
- package/dist/esm/{index-3c280603.js → index-b4e277ad.js} +1438 -517
- package/dist/esm/index-b4e277ad.js.map +1 -0
- package/dist/{components/index4.js → esm/index-f626f476.js} +2 -10
- package/dist/esm/index-f626f476.js.map +1 -0
- package/dist/esm/index.js +18 -36
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{modal-5c9ce466.js → modal-1f3223cd.js} +3 -2
- package/dist/esm/modal-1f3223cd.js.map +1 -0
- package/dist/esm/nano-accordion.entry.js +4 -7
- package/dist/esm/nano-accordion.entry.js.map +1 -1
- package/dist/esm/nano-alert.entry.js +25 -19
- package/dist/esm/nano-alert.entry.js.map +1 -1
- package/dist/esm/nano-algolia-filter.entry.js +5 -5
- package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
- package/dist/esm/nano-algolia-input.entry.js +4 -4
- package/dist/esm/nano-algolia-input.entry.js.map +1 -1
- package/dist/esm/nano-algolia-pagination.entry.js +2 -2
- package/dist/esm/nano-algolia-results.entry.js +2 -2
- package/dist/esm/nano-algolia.entry.js +8 -8
- package/dist/esm/nano-algolia.entry.js.map +1 -1
- package/dist/esm/nano-aspect-ratio.entry.js +1 -1
- package/dist/esm/nano-checkbox-group.entry.js +52 -9
- package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
- package/dist/esm/nano-checkbox.entry.js +8 -8
- package/dist/esm/nano-checkbox.entry.js.map +1 -1
- package/dist/esm/nano-components.js +5 -4
- package/dist/esm/nano-components.js.map +1 -1
- package/dist/esm/nano-datalist_3.entry.js +46 -36
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-date-input.entry.js +6 -6
- package/dist/esm/nano-date-input.entry.js.map +1 -1
- package/dist/esm/nano-date-picker.entry.js +4 -4
- package/dist/esm/nano-date-picker.entry.js.map +1 -1
- package/dist/esm/nano-demo.entry.js +13 -9
- package/dist/esm/nano-demo.entry.js.map +1 -1
- package/dist/esm/nano-details.entry.js +4 -4
- package/dist/esm/nano-details.entry.js.map +1 -1
- package/dist/esm/nano-dialog.entry.js +6 -6
- package/dist/esm/nano-dialog.entry.js.map +1 -1
- package/dist/esm/nano-drawer.entry.js +5 -5
- package/dist/esm/nano-drawer.entry.js.map +1 -1
- package/dist/esm/nano-dropdown.entry.js +9 -4
- package/dist/esm/nano-dropdown.entry.js.map +1 -1
- package/dist/esm/nano-field-validator.entry.js +4 -3
- package/dist/esm/nano-field-validator.entry.js.map +1 -1
- package/dist/esm/nano-file-upload.entry.js +5 -5
- package/dist/esm/nano-file-upload.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +54 -67
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-global-nav.entry.js +54 -26
- package/dist/esm/nano-global-nav.entry.js.map +1 -1
- package/dist/esm/nano-global-search-results.entry.js +6 -4
- package/dist/esm/nano-global-search-results.entry.js.map +1 -1
- package/dist/esm/nano-grid_3.entry.js +8 -7
- package/dist/esm/nano-grid_3.entry.js.map +1 -1
- package/dist/esm/nano-hero.entry.js +4 -2
- package/dist/esm/nano-hero.entry.js.map +1 -1
- package/dist/esm/nano-icon-button.entry.js +2 -2
- package/dist/esm/nano-icon-button.entry.js.map +1 -1
- package/dist/esm/nano-icon.entry.js +7 -14
- package/dist/esm/nano-icon.entry.js.map +1 -1
- package/dist/esm/nano-input.entry.js +19 -33
- package/dist/esm/nano-input.entry.js.map +1 -1
- package/dist/esm/nano-menu-drawer.entry.js +3 -3
- package/dist/esm/nano-menu-drawer.entry.js.map +1 -1
- package/dist/esm/nano-progress-bar_2.entry.js +4 -4
- package/dist/esm/nano-progress-bar_2.entry.js.map +1 -1
- package/dist/esm/nano-range.entry.js +4 -4
- package/dist/esm/nano-range.entry.js.map +1 -1
- package/dist/esm/nano-rating.entry.js +2 -2
- package/dist/esm/nano-rating.entry.js.map +1 -1
- package/dist/esm/nano-resize-observe_2.entry.js +18 -10
- package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/nano-slides.entry.js +11 -21
- package/dist/esm/nano-slides.entry.js.map +1 -1
- package/dist/esm/nano-spinner.entry.js +3 -3
- package/dist/esm/nano-spinner.entry.js.map +1 -1
- package/dist/esm/nano-split-pane.entry.js +15 -13
- package/dist/esm/nano-split-pane.entry.js.map +1 -1
- package/dist/esm/nano-sticker.entry.js +6 -4
- package/dist/esm/nano-sticker.entry.js.map +1 -1
- package/dist/esm/nano-tab-content.entry.js +9 -3
- package/dist/esm/nano-tab-content.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +18 -12
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/nano-tab.entry.js +2 -2
- package/dist/esm/nano-tab.entry.js.map +1 -1
- package/dist/esm/{nano-table-1f4fe4ad.js → nano-table-5ff91f0f.js} +115 -150
- package/dist/esm/nano-table-5ff91f0f.js.map +1 -0
- package/dist/esm/nano-table.entry.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{popover-e748bb61.js → popover-02e6714d.js} +61 -50
- package/dist/esm/popover-02e6714d.js.map +1 -0
- package/dist/esm/{scroll-a1e59d8c.js → scroll-e5825d8d.js} +2 -2
- package/dist/esm/{scroll-a1e59d8c.js.map → scroll-e5825d8d.js.map} +1 -1
- package/dist/esm/{table.worker-ddbd23c3.js → table.worker-5c1bb1ce.js} +4 -4
- package/dist/esm/table.worker-5c1bb1ce.js.map +1 -0
- package/dist/esm/{theme-931bd452.js → theme-82feb8cf.js} +2 -7
- package/dist/esm/theme-82feb8cf.js.map +1 -0
- package/dist/nano-components/index.esm.js +1 -1
- package/dist/nano-components/index.esm.js.map +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/{p-1a8e60c4.entry.js → p-0411f019.entry.js} +2 -2
- package/dist/nano-components/p-0411f019.entry.js.map +1 -0
- package/dist/nano-components/p-13b2d70c.entry.js +5 -0
- package/dist/nano-components/p-13b2d70c.entry.js.map +1 -0
- package/dist/nano-components/p-167b9165.js.map +1 -1
- package/dist/nano-components/p-1d21b2ce.entry.js +5 -0
- package/dist/nano-components/p-1d21b2ce.entry.js.map +1 -0
- package/dist/nano-components/p-2155fc2c.js.map +1 -1
- package/dist/nano-components/p-257432ff.js +5 -0
- package/dist/nano-components/p-257432ff.js.map +1 -0
- package/dist/nano-components/p-264903b5.entry.js +5 -0
- package/dist/nano-components/p-264903b5.entry.js.map +1 -0
- package/dist/nano-components/p-320366a2.entry.js +5 -0
- package/dist/nano-components/p-320366a2.entry.js.map +1 -0
- package/dist/nano-components/p-364434b4.entry.js +5 -0
- package/dist/nano-components/p-364434b4.entry.js.map +1 -0
- package/dist/nano-components/{p-3f25fc76.entry.js → p-36d5a41d.entry.js} +2 -2
- package/dist/nano-components/p-36d5a41d.entry.js.map +1 -0
- package/dist/nano-components/{p-1e709f87.entry.js → p-371fe61d.entry.js} +2 -2
- package/dist/nano-components/p-371fe61d.entry.js.map +1 -0
- package/dist/nano-components/p-3d658ce2.entry.js +5 -0
- package/dist/nano-components/p-3d658ce2.entry.js.map +1 -0
- package/dist/nano-components/p-3e95778d.entry.js +5 -0
- package/dist/nano-components/p-3e95778d.entry.js.map +1 -0
- package/dist/nano-components/p-400d698f.entry.js +5 -0
- package/dist/nano-components/p-400d698f.entry.js.map +1 -0
- package/dist/nano-components/p-411bb8f1.js +5 -0
- package/dist/nano-components/p-411bb8f1.js.map +1 -0
- package/dist/nano-components/p-41811365.js +5 -0
- package/dist/nano-components/p-41811365.js.map +1 -0
- package/dist/nano-components/p-45abbbdd.js.map +1 -1
- package/dist/nano-components/{p-885b6950.js → p-45b7682a.js} +2 -2
- package/dist/nano-components/p-45b7682a.js.map +1 -0
- package/dist/nano-components/p-4b1d73e9.entry.js +5 -0
- package/dist/nano-components/p-4b1d73e9.entry.js.map +1 -0
- package/dist/nano-components/{p-69e5a37d.entry.js → p-4e104cb1.entry.js} +2 -2
- package/dist/nano-components/p-4e104cb1.entry.js.map +1 -0
- package/dist/nano-components/p-51bc8b59.js +5 -0
- package/dist/nano-components/p-51bc8b59.js.map +1 -0
- package/dist/nano-components/p-5a466c9f.entry.js +5 -0
- package/dist/nano-components/p-5a466c9f.entry.js.map +1 -0
- package/dist/nano-components/{p-bd05b3aa.entry.js → p-5f1b94f0.entry.js} +2 -2
- package/dist/nano-components/{p-bd05b3aa.entry.js.map → p-5f1b94f0.entry.js.map} +1 -1
- package/dist/nano-components/p-60823325.entry.js +5 -0
- package/dist/nano-components/p-60823325.entry.js.map +1 -0
- package/dist/nano-components/p-6760e54a.entry.js +5 -0
- package/dist/nano-components/p-6760e54a.entry.js.map +1 -0
- package/dist/nano-components/p-69774e99.entry.js +5 -0
- package/dist/nano-components/p-69774e99.entry.js.map +1 -0
- package/dist/nano-components/p-69a3e911.js.map +1 -1
- package/dist/nano-components/p-6bca2d00.entry.js +5 -0
- package/dist/nano-components/p-6bca2d00.entry.js.map +1 -0
- package/dist/nano-components/p-74a7fc4f.js.map +1 -1
- package/dist/nano-components/{p-dba8a88d.entry.js → p-78169835.entry.js} +2 -2
- package/dist/nano-components/p-78169835.entry.js.map +1 -0
- package/dist/nano-components/p-817eda34.entry.js +5 -0
- package/dist/nano-components/p-817eda34.entry.js.map +1 -0
- package/dist/nano-components/p-866c73c0.entry.js +5 -0
- package/dist/nano-components/p-866c73c0.entry.js.map +1 -0
- package/dist/nano-components/p-87a76a81.entry.js +5 -0
- package/dist/nano-components/{p-41addb3a.entry.js.map → p-87a76a81.entry.js.map} +1 -1
- package/dist/nano-components/p-8907dd24.entry.js +5 -0
- package/dist/nano-components/p-8907dd24.entry.js.map +1 -0
- package/dist/nano-components/p-90365d7b.entry.js +5 -0
- package/dist/nano-components/p-90365d7b.entry.js.map +1 -0
- package/dist/nano-components/p-909a424c.js +5 -0
- package/dist/nano-components/p-909a424c.js.map +1 -0
- package/dist/nano-components/p-9746b0a5.js.map +1 -1
- package/dist/nano-components/p-9cf5fda3.entry.js +5 -0
- package/dist/nano-components/p-9cf5fda3.entry.js.map +1 -0
- package/dist/nano-components/p-9fcd383f.entry.js +5 -0
- package/dist/nano-components/p-9fcd383f.entry.js.map +1 -0
- package/dist/nano-components/p-9fda481b.entry.js +5 -0
- package/dist/nano-components/p-9fda481b.entry.js.map +1 -0
- package/dist/nano-components/p-abd6b774.entry.js +5 -0
- package/dist/nano-components/p-abd6b774.entry.js.map +1 -0
- package/dist/nano-components/p-b933f3c8.js.map +1 -1
- package/dist/nano-components/{p-2828788c.js → p-bb07c3d0.js} +2 -2
- package/dist/nano-components/p-bb07c3d0.js.map +1 -0
- package/dist/nano-components/p-bb6f7c39.js +5 -0
- package/dist/nano-components/p-bb6f7c39.js.map +1 -0
- package/dist/nano-components/p-bf91c50e.js +6 -0
- package/dist/nano-components/p-bf91c50e.js.map +1 -0
- package/dist/nano-components/{p-b40eedcb.entry.js → p-bfbfec85.entry.js} +2 -2
- package/dist/nano-components/p-bfbfec85.entry.js.map +1 -0
- package/dist/nano-components/{p-447a5910.entry.js → p-c0681b2b.entry.js} +2 -2
- package/dist/nano-components/p-c0681b2b.entry.js.map +1 -0
- package/dist/nano-components/p-c0ca353b.entry.js +5 -0
- package/dist/nano-components/p-c0ca353b.entry.js.map +1 -0
- package/dist/nano-components/p-c4e8d584.entry.js +5 -0
- package/dist/nano-components/p-c4e8d584.entry.js.map +1 -0
- package/dist/nano-components/p-cecb9af1.js.map +1 -1
- package/dist/nano-components/p-d4f6ec9f.js +5 -0
- package/dist/nano-components/p-d4f6ec9f.js.map +1 -0
- package/dist/nano-components/p-d753f35a.entry.js +5 -0
- package/dist/nano-components/p-d753f35a.entry.js.map +1 -0
- package/dist/nano-components/{p-651b3264.js → p-d7ff8f12.js} +2 -2
- package/dist/nano-components/p-d7ff8f12.js.map +1 -0
- package/dist/nano-components/{p-0582afcc.js → p-d92b762b.js} +2 -2
- package/dist/nano-components/p-d92b762b.js.map +1 -0
- package/dist/nano-components/p-de25ba80.entry.js +5 -0
- package/dist/nano-components/p-de25ba80.entry.js.map +1 -0
- package/dist/nano-components/{p-c9a7c7ea.js → p-e04f2333.js} +2 -2
- package/dist/nano-components/p-e04f2333.js.map +1 -0
- package/dist/nano-components/p-e19d6a92.entry.js +5 -0
- package/dist/nano-components/p-e19d6a92.entry.js.map +1 -0
- package/dist/nano-components/{p-63834d50.js → p-ed2e6f32.js} +2 -2
- package/dist/nano-components/p-ed2e6f32.js.map +1 -0
- package/dist/nano-components/p-ed69b27b.entry.js +5 -0
- package/dist/nano-components/p-ed69b27b.entry.js.map +1 -0
- package/dist/nano-components/{p-a0b93616.js → p-ed6adde2.js} +3 -3
- package/dist/nano-components/p-ed6adde2.js.map +1 -0
- package/dist/nano-components/p-ee045579.js.map +1 -1
- package/dist/nano-components/{p-151aad1e.entry.js → p-f2875bf0.entry.js} +4 -4
- package/dist/nano-components/p-f2875bf0.entry.js.map +1 -0
- package/dist/nano-components/p-f28c802d.entry.js +5 -0
- package/dist/nano-components/p-f28c802d.entry.js.map +1 -0
- package/dist/nano-components/{p-a2d0d7b9.entry.js → p-f47776fd.entry.js} +2 -2
- package/dist/nano-components/p-f47776fd.entry.js.map +1 -0
- package/dist/nano-components/p-f8f89998.js.map +1 -1
- package/dist/nano-components/p-fccd59e4.entry.js +5 -0
- package/dist/nano-components/p-fccd59e4.entry.js.map +1 -0
- package/dist/nano-components/p-fe1446cd.entry.js +5 -0
- package/dist/nano-components/p-fe1446cd.entry.js.map +1 -0
- package/dist/themes/london-calling.css +1 -1
- package/dist/themes/london-calling.css.map +1 -1
- package/dist/themes/nanopore.css +1 -1
- package/dist/themes/nanopore.css.map +1 -1
- package/dist/types/components/alert/alert-interface.d.ts +1 -1
- package/dist/types/components/algolia/algolia-input.d.ts +1 -1
- package/dist/types/components/algolia/algolia.d.ts +2 -2
- package/dist/types/components/checkbox/checkbox-group.d.ts +11 -0
- package/dist/types/components/date-picker/date-picker-interface.d.ts +2 -2
- package/dist/types/components/date-picker/duet-date-picker/date-adapter.d.ts +3 -3
- package/dist/types/components/date-picker/duet-date-picker/date-localization.d.ts +3 -3
- package/dist/types/components/date-picker/duet-date-picker/date-picker-day.d.ts +1 -1
- package/dist/types/components/date-picker/duet-date-picker/date-picker-month.d.ts +1 -1
- package/dist/types/components/field-validator/field-validator-interface.d.ts +4 -4
- package/dist/types/components/file-upload/file-upload.d.ts +1 -1
- package/dist/types/components/global-nav/global-nav.d.ts +12 -6
- package/dist/types/components/icon/icon.d.ts +3 -3
- package/dist/types/components/menu/menu.d.ts +1 -1
- package/dist/types/components/nav-item/nav-item.d.ts +1 -1
- package/dist/types/components/range/range-interface.d.ts +2 -2
- package/dist/types/components/resize-observe/resize-observe.d.ts +1 -0
- package/dist/types/components/slides/slides-interface.d.ts +2 -2
- package/dist/types/components/slides/slides.d.ts +0 -2
- package/dist/types/components/table/table.cell.d.ts +1 -1
- package/dist/types/components/table/table.d.ts +9 -14
- package/dist/types/components/table/table.header.d.ts +1 -1
- package/dist/types/components/table/table.row.d.ts +2 -2
- package/dist/types/components/table/table.utils.d.ts +2 -1
- package/dist/types/components/tabs/tab-content.d.ts +2 -0
- package/dist/types/components.d.ts +829 -9
- package/dist/types/index.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/types/utils/dom.d.ts +9 -0
- package/dist/types/utils/gesture/index.d.ts +1 -1
- package/dist/types/utils/popover.d.ts +1 -1
- package/dist/types/utils/store/component-store.d.ts +2 -2
- package/dist/types/utils/testing/index.d.ts +1 -1
- package/docs-json.json +89 -50
- package/docs-vscode.json +8 -4
- package/hydrate/index.d.ts +853 -0
- package/{dist/custom-elements → hydrate}/index.js +11476 -7950
- package/hydrate/package.json +6 -0
- package/loader/index.d.ts +9 -0
- package/package.json +24 -16
- package/dist/cjs/component-store-d7c8c326.js.map +0 -1
- package/dist/cjs/dom-d7c33f11.js.map +0 -1
- package/dist/cjs/form-control-57c71246.js.map +0 -1
- package/dist/cjs/global-989678ec.js.map +0 -1
- package/dist/cjs/index-41582c2a.js.map +0 -1
- package/dist/cjs/index-75b61776.js +0 -1077
- package/dist/cjs/index-75b61776.js.map +0 -1
- package/dist/cjs/index-ece1cb9e.js.map +0 -1
- package/dist/cjs/modal-e4defcc3.js.map +0 -1
- package/dist/cjs/nano-table-820b04d5.js.map +0 -1
- package/dist/cjs/popover-508bcedb.js.map +0 -1
- package/dist/cjs/table.worker-9e238d16.js.map +0 -1
- package/dist/cjs/theme-50275e1a.js.map +0 -1
- package/dist/components/index4.js.map +0 -1
- package/dist/custom-elements/index.d.ts +0 -339
- package/dist/custom-elements/index.js.map +0 -1
- package/dist/esm/component-store-ec512820.js.map +0 -1
- package/dist/esm/dom-d3ad49e2.js.map +0 -1
- package/dist/esm/form-control-84bac7a2.js.map +0 -1
- package/dist/esm/global-8047b4ff.js.map +0 -1
- package/dist/esm/index-3bbaffe4.js +0 -1075
- package/dist/esm/index-3bbaffe4.js.map +0 -1
- package/dist/esm/index-3c280603.js.map +0 -1
- package/dist/esm/index-dc076ea6.js +0 -649
- package/dist/esm/index-dc076ea6.js.map +0 -1
- package/dist/esm/modal-5c9ce466.js.map +0 -1
- package/dist/esm/nano-table-1f4fe4ad.js.map +0 -1
- package/dist/esm/popover-e748bb61.js.map +0 -1
- package/dist/esm/table.worker-ddbd23c3.js.map +0 -1
- package/dist/esm/theme-931bd452.js.map +0 -1
- package/dist/nano-components/p-0582afcc.js.map +0 -1
- package/dist/nano-components/p-135fed16.entry.js +0 -5
- package/dist/nano-components/p-135fed16.entry.js.map +0 -1
- package/dist/nano-components/p-151aad1e.entry.js.map +0 -1
- package/dist/nano-components/p-15543295.entry.js +0 -5
- package/dist/nano-components/p-15543295.entry.js.map +0 -1
- package/dist/nano-components/p-1a8e60c4.entry.js.map +0 -1
- package/dist/nano-components/p-1e709f87.entry.js.map +0 -1
- package/dist/nano-components/p-1f347342.entry.js +0 -5
- package/dist/nano-components/p-1f347342.entry.js.map +0 -1
- package/dist/nano-components/p-1fe12320.js +0 -6
- package/dist/nano-components/p-1fe12320.js.map +0 -1
- package/dist/nano-components/p-23575705.entry.js +0 -5
- package/dist/nano-components/p-23575705.entry.js.map +0 -1
- package/dist/nano-components/p-2828788c.js.map +0 -1
- package/dist/nano-components/p-284dd9a2.entry.js +0 -5
- package/dist/nano-components/p-284dd9a2.entry.js.map +0 -1
- package/dist/nano-components/p-2a97ef51.entry.js +0 -5
- package/dist/nano-components/p-2a97ef51.entry.js.map +0 -1
- package/dist/nano-components/p-36842a50.entry.js +0 -5
- package/dist/nano-components/p-36842a50.entry.js.map +0 -1
- package/dist/nano-components/p-3a1026d1.entry.js +0 -5
- package/dist/nano-components/p-3a1026d1.entry.js.map +0 -1
- package/dist/nano-components/p-3f25fc76.entry.js.map +0 -1
- package/dist/nano-components/p-41addb3a.entry.js +0 -5
- package/dist/nano-components/p-447a5910.entry.js.map +0 -1
- package/dist/nano-components/p-4b69178e.entry.js +0 -5
- package/dist/nano-components/p-4b69178e.entry.js.map +0 -1
- package/dist/nano-components/p-559a6492.entry.js +0 -5
- package/dist/nano-components/p-559a6492.entry.js.map +0 -1
- package/dist/nano-components/p-5d149792.entry.js +0 -5
- package/dist/nano-components/p-5d149792.entry.js.map +0 -1
- package/dist/nano-components/p-63834d50.js.map +0 -1
- package/dist/nano-components/p-651b3264.js.map +0 -1
- package/dist/nano-components/p-69e5a37d.entry.js.map +0 -1
- package/dist/nano-components/p-6ad194e4.entry.js +0 -5
- package/dist/nano-components/p-6ad194e4.entry.js.map +0 -1
- package/dist/nano-components/p-6cb77d5c.entry.js +0 -5
- package/dist/nano-components/p-6cb77d5c.entry.js.map +0 -1
- package/dist/nano-components/p-73860775.js +0 -5
- package/dist/nano-components/p-73860775.js.map +0 -1
- package/dist/nano-components/p-77cad8d1.js +0 -5
- package/dist/nano-components/p-77cad8d1.js.map +0 -1
- package/dist/nano-components/p-793588d1.js +0 -5
- package/dist/nano-components/p-793588d1.js.map +0 -1
- package/dist/nano-components/p-7b3638b7.js +0 -5
- package/dist/nano-components/p-7b3638b7.js.map +0 -1
- package/dist/nano-components/p-845ae77e.js +0 -5
- package/dist/nano-components/p-845ae77e.js.map +0 -1
- package/dist/nano-components/p-885b6950.js.map +0 -1
- package/dist/nano-components/p-8d747891.js +0 -5
- package/dist/nano-components/p-8d747891.js.map +0 -1
- package/dist/nano-components/p-9059c8c1.entry.js +0 -5
- package/dist/nano-components/p-9059c8c1.entry.js.map +0 -1
- package/dist/nano-components/p-92504f7f.entry.js +0 -5
- package/dist/nano-components/p-92504f7f.entry.js.map +0 -1
- package/dist/nano-components/p-99fbae74.entry.js +0 -5
- package/dist/nano-components/p-99fbae74.entry.js.map +0 -1
- package/dist/nano-components/p-9a4297e1.entry.js +0 -5
- package/dist/nano-components/p-9a4297e1.entry.js.map +0 -1
- package/dist/nano-components/p-9eeed8f5.entry.js +0 -5
- package/dist/nano-components/p-9eeed8f5.entry.js.map +0 -1
- package/dist/nano-components/p-a0b93616.js.map +0 -1
- package/dist/nano-components/p-a183e3c7.entry.js +0 -5
- package/dist/nano-components/p-a183e3c7.entry.js.map +0 -1
- package/dist/nano-components/p-a2d0d7b9.entry.js.map +0 -1
- package/dist/nano-components/p-a5abfed9.entry.js +0 -5
- package/dist/nano-components/p-a5abfed9.entry.js.map +0 -1
- package/dist/nano-components/p-b25e79b8.entry.js +0 -5
- package/dist/nano-components/p-b25e79b8.entry.js.map +0 -1
- package/dist/nano-components/p-b40eedcb.entry.js.map +0 -1
- package/dist/nano-components/p-b55ffa92.entry.js +0 -5
- package/dist/nano-components/p-b55ffa92.entry.js.map +0 -1
- package/dist/nano-components/p-b87539f0.entry.js +0 -5
- package/dist/nano-components/p-b87539f0.entry.js.map +0 -1
- package/dist/nano-components/p-c9a7c7ea.js.map +0 -1
- package/dist/nano-components/p-ca567f01.entry.js +0 -5
- package/dist/nano-components/p-ca567f01.entry.js.map +0 -1
- package/dist/nano-components/p-cc5e7acb.entry.js +0 -5
- package/dist/nano-components/p-cc5e7acb.entry.js.map +0 -1
- package/dist/nano-components/p-d5303933.entry.js +0 -5
- package/dist/nano-components/p-d5303933.entry.js.map +0 -1
- package/dist/nano-components/p-d565991d.entry.js +0 -5
- package/dist/nano-components/p-d565991d.entry.js.map +0 -1
- package/dist/nano-components/p-dba8a88d.entry.js.map +0 -1
- package/dist/nano-components/p-dc50b93c.entry.js +0 -5
- package/dist/nano-components/p-dc50b93c.entry.js.map +0 -1
- package/dist/nano-components/p-e3860f00.js +0 -5
- package/dist/nano-components/p-e3860f00.js.map +0 -1
- package/dist/nano-components/p-e5408bc8.entry.js +0 -5
- package/dist/nano-components/p-e5408bc8.entry.js.map +0 -1
- package/dist/nano-components/p-ea2de992.js +0 -19
- package/dist/nano-components/p-ea2de992.js.map +0 -1
- package/dist/nano-components/p-f7471cca.entry.js +0 -5
- package/dist/nano-components/p-f7471cca.entry.js.map +0 -1
- package/dist/nano-components/p-fe94eeff.entry.js +0 -5
- package/dist/nano-components/p-fe94eeff.entry.js.map +0 -1
@@ -66,7 +66,15 @@ const uniqueTime = (key, measureText) => {
|
|
66
66
|
};
|
67
67
|
}
|
68
68
|
};
|
69
|
+
const CONTENT_REF_ID = 'r';
|
70
|
+
const ORG_LOCATION_ID = 'o';
|
71
|
+
const SLOT_NODE_ID = 's';
|
72
|
+
const TEXT_NODE_ID = 't';
|
73
|
+
const HYDRATE_ID = 's-id';
|
74
|
+
const HYDRATED_STYLE_ID = 'sty-id';
|
75
|
+
const HYDRATE_CHILD_ID = 'c-id';
|
69
76
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
77
|
+
const HYDRATED_SLOT_FALLBACK_ID = 'sf-id';
|
70
78
|
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
71
79
|
/**
|
72
80
|
* Default style mode id
|
@@ -82,6 +90,18 @@ const isComplexType = (o) => {
|
|
82
90
|
o = typeof o;
|
83
91
|
return o === 'object' || o === 'function';
|
84
92
|
};
|
93
|
+
/**
|
94
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
95
|
+
* out of a DOM's head.
|
96
|
+
*
|
97
|
+
* @param doc The DOM containing the `head` to query against
|
98
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
99
|
+
* exists or the tag has no content.
|
100
|
+
*/
|
101
|
+
function queryNonceMetaTagContent(doc) {
|
102
|
+
var _a, _b, _c;
|
103
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
104
|
+
}
|
85
105
|
/**
|
86
106
|
* Production h() function based on Preact by
|
87
107
|
* Jason Miller (@developit)
|
@@ -90,7 +110,6 @@ const isComplexType = (o) => {
|
|
90
110
|
*
|
91
111
|
* Modified for Stencil's compiler and vdom
|
92
112
|
*/
|
93
|
-
// const stack: any[] = [];
|
94
113
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
95
114
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
96
115
|
const h = (nodeName, vnodeData, ...children) => {
|
@@ -181,6 +200,13 @@ const newVNode = (tag, text) => {
|
|
181
200
|
};
|
182
201
|
const Host = {};
|
183
202
|
const isHost = (node) => node && node.$tag$ === Host;
|
203
|
+
/**
|
204
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
205
|
+
*
|
206
|
+
* Note that these functions convert from {@link d.VNode} to
|
207
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
208
|
+
* interface.
|
209
|
+
*/
|
184
210
|
const vdomFnUtils = {
|
185
211
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
186
212
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
@@ -212,394 +238,204 @@ const convertToPrivate = (node) => {
|
|
212
238
|
return vnode;
|
213
239
|
};
|
214
240
|
/**
|
215
|
-
*
|
216
|
-
*
|
217
|
-
*
|
218
|
-
*
|
219
|
-
* 1. `any`, the type given to `propValue` in the function signature
|
220
|
-
* 2. the type stored from `propType`.
|
221
|
-
*
|
222
|
-
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
223
|
-
*
|
224
|
-
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
225
|
-
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
226
|
-
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
227
|
-
* ```tsx
|
228
|
-
* <my-cmp prop-val={0}></my-cmp>
|
229
|
-
* ```
|
230
|
-
*
|
231
|
-
* HTML prop values on the other hand, will always a string
|
232
|
-
*
|
233
|
-
* @param propValue the new value to coerce to some type
|
234
|
-
* @param propType the type of the prop, expressed as a binary number
|
235
|
-
* @returns the parsed/coerced value
|
241
|
+
* Show or hide a slot nodes children
|
242
|
+
* @param slotNode a slot node, the 'children' of which should be shown or hidden
|
243
|
+
* @param hide whether to hide the slot node 'children'
|
244
|
+
* @returns
|
236
245
|
*/
|
237
|
-
const
|
238
|
-
//
|
239
|
-
if (
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
246
|
+
const renderSlotFallbackContent = (slotNode, hide) => {
|
247
|
+
// if this slot doesn't have fallback content, return
|
248
|
+
if (!slotNode['s-hsf'] || !slotNode.parentNode)
|
249
|
+
return;
|
250
|
+
// in non-shadow component, slot nodes are just empty text nodes or comment nodes
|
251
|
+
// the 'children' nodes are therefore placed next to it.
|
252
|
+
// let's loop through those now
|
253
|
+
let childNodes = (slotNode.parentNode.__childNodes ||
|
254
|
+
slotNode.parentNode.childNodes);
|
255
|
+
let childNode;
|
256
|
+
const childNodesLen = childNodes.length;
|
257
|
+
let i = 0;
|
258
|
+
for (i; i < childNodesLen; i++) {
|
259
|
+
childNode = childNodes[i];
|
260
|
+
if (childNode['s-sr'] && hide && childNode['s-psn'] === slotNode['s-sn']) {
|
261
|
+
// if this child node is a nested slot
|
262
|
+
// drill into it's children to hide them in-turn
|
263
|
+
renderSlotFallbackContent(childNode, true);
|
264
|
+
continue;
|
244
265
|
}
|
245
|
-
|
246
|
-
|
247
|
-
|
266
|
+
// this child node doesn't relate to this slot?
|
267
|
+
if (childNode['s-sn'] !== slotNode['s-sn'])
|
268
|
+
continue;
|
269
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */ && childNode['s-sf']) {
|
270
|
+
// we found an fallback element. Hide or show
|
271
|
+
childNode.hidden = hide;
|
272
|
+
childNode.style.display = hide ? 'none' : '';
|
248
273
|
}
|
249
|
-
if (
|
250
|
-
//
|
251
|
-
|
252
|
-
|
274
|
+
else if (!!childNode['s-sfc']) {
|
275
|
+
// this child has fallback text. Add or remove it
|
276
|
+
if (hide) {
|
277
|
+
childNode['s-sfc'] = childNode.textContent || undefined;
|
278
|
+
childNode.textContent = '';
|
279
|
+
}
|
280
|
+
else if (!childNode.textContent || childNode.textContent.trim() === '') {
|
281
|
+
childNode.textContent = childNode['s-sfc'];
|
282
|
+
}
|
253
283
|
}
|
254
|
-
// redundant return here for better minification
|
255
|
-
return propValue;
|
256
284
|
}
|
257
|
-
// not sure exactly what type we want
|
258
|
-
// so no need to change to a different type
|
259
|
-
return propValue;
|
260
|
-
};
|
261
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
262
|
-
const createEvent = (ref, name, flags) => {
|
263
|
-
const elm = getElement(ref);
|
264
|
-
return {
|
265
|
-
emit: (detail) => {
|
266
|
-
return emitEvent(elm, name, {
|
267
|
-
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
268
|
-
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
269
|
-
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
270
|
-
detail,
|
271
|
-
});
|
272
|
-
},
|
273
|
-
};
|
274
285
|
};
|
275
286
|
/**
|
276
|
-
*
|
277
|
-
*
|
278
|
-
*
|
279
|
-
* @param
|
280
|
-
* @returns the custom Event
|
287
|
+
* Function applied to non-shadow component nodes to mimic native shadowDom behaviour:
|
288
|
+
* - When slotted node/s are not present, show `<slot>` node children
|
289
|
+
* - When slotted node/s *are* present, hide `<slot>` node children
|
290
|
+
* @param node an entry whose children to iterate over
|
281
291
|
*/
|
282
|
-
const
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
let
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
292
|
+
const updateFallbackSlotVisibility = (node) => {
|
293
|
+
if (!node)
|
294
|
+
return;
|
295
|
+
const childNodes = node.__childNodes || node.childNodes;
|
296
|
+
let slotNode;
|
297
|
+
let i;
|
298
|
+
let ilen;
|
299
|
+
let j;
|
300
|
+
let slotNameAttr;
|
301
|
+
let nodeType;
|
302
|
+
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
303
|
+
// slot reference node?
|
304
|
+
if (childNodes[i]['s-sr']) {
|
305
|
+
// this component uses slots and we're on a slot node
|
306
|
+
// let's find all it's slotted children or lack thereof
|
307
|
+
// and show or hide fallback nodes (`<slot />` children)
|
308
|
+
// get the slot name for this slot reference node
|
309
|
+
slotNameAttr = childNodes[i]['s-sn'];
|
310
|
+
slotNode = childNodes[i];
|
311
|
+
// by default always show a fallback slot node
|
312
|
+
// then hide it if there are other slotted nodes in the light dom
|
313
|
+
renderSlotFallbackContent(slotNode, false);
|
314
|
+
// because we found a slot fallback node let's loop over all
|
315
|
+
// the children again to
|
316
|
+
for (j = 0; j < ilen; j++) {
|
317
|
+
nodeType = childNodes[j].nodeType;
|
318
|
+
// ignore slot fallback nodes
|
319
|
+
if (childNodes[j]['s-sf'])
|
320
|
+
continue;
|
321
|
+
// is sibling node is from a different component OR is a named fallback slot node?
|
322
|
+
if (childNodes[j]['s-hn'] !== slotNode['s-hn'] || slotNameAttr !== '') {
|
323
|
+
// you can't slot a textNode in a named slot
|
324
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j]['s-sn']) {
|
325
|
+
// we found a slotted element!
|
326
|
+
// let's hide all the fallback nodes
|
327
|
+
renderSlotFallbackContent(slotNode, true);
|
328
|
+
// patches this node's removal methods
|
329
|
+
// so if it gets removed in the future
|
330
|
+
// re-asses the fallback node status
|
331
|
+
patchRemove(childNodes[j]);
|
332
|
+
break;
|
323
333
|
}
|
324
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
325
334
|
}
|
326
|
-
if (
|
327
|
-
|
335
|
+
else if (childNodes[j]['s-sn'] === slotNameAttr) {
|
336
|
+
// this is a default fallback slot node
|
337
|
+
// any element or text node (with content)
|
338
|
+
// should hide the default fallback slot node
|
339
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
340
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ &&
|
341
|
+
childNodes[j] &&
|
342
|
+
childNodes[j].textContent &&
|
343
|
+
childNodes[j].textContent.trim() !== '')) {
|
344
|
+
// we found a slotted something
|
345
|
+
// let's hide all the fallback nodes
|
346
|
+
renderSlotFallbackContent(slotNode, true);
|
347
|
+
// patches this node's removal methods
|
348
|
+
// so if it gets removed in the future
|
349
|
+
// re-asses the fallback node status
|
350
|
+
patchRemove(childNodes[j]);
|
351
|
+
break;
|
352
|
+
}
|
328
353
|
}
|
329
354
|
}
|
330
355
|
}
|
331
|
-
|
332
|
-
|
333
|
-
}
|
356
|
+
// keep drilling down
|
357
|
+
updateFallbackSlotVisibility(childNodes[i]);
|
334
358
|
}
|
335
|
-
return scopeId;
|
336
359
|
};
|
337
|
-
const
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
// DOM WRITE!!
|
351
|
-
elm['s-sc'] = scopeId;
|
352
|
-
elm.classList.add(scopeId + '-h');
|
353
|
-
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
354
|
-
elm.classList.add(scopeId + '-s');
|
355
|
-
}
|
356
|
-
}
|
357
|
-
endAttachStyles();
|
360
|
+
const patchPseudoShadowDom = (HostElementPrototype) => {
|
361
|
+
patchChildNodes(HostElementPrototype);
|
362
|
+
patchInsertBefore(HostElementPrototype);
|
363
|
+
patchAppendChild(HostElementPrototype);
|
364
|
+
patchAppend(HostElementPrototype);
|
365
|
+
patchPrepend(HostElementPrototype);
|
366
|
+
patchInsertAdjacentHTML(HostElementPrototype);
|
367
|
+
patchInsertAdjacentText(HostElementPrototype);
|
368
|
+
patchInsertAdjacentElement(HostElementPrototype);
|
369
|
+
patchReplaceChildren(HostElementPrototype);
|
370
|
+
patchInnerHTML(HostElementPrototype);
|
371
|
+
patchInnerText(HostElementPrototype);
|
372
|
+
patchTextContent(HostElementPrototype);
|
358
373
|
};
|
359
|
-
|
374
|
+
////// non-shadow host component patches
|
360
375
|
/**
|
361
|
-
*
|
362
|
-
*
|
363
|
-
* Licensed under the MIT License
|
364
|
-
* https://github.com/developit/preact/blob/master/LICENSE
|
365
|
-
*
|
366
|
-
* Modified for Stencil's compiler and vdom
|
376
|
+
* Patch `cloneNode()` for non-shadow components ()
|
377
|
+
* @param HostElementPrototype the host prototype to polyfill
|
367
378
|
*/
|
368
|
-
const
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
379
|
+
const patchCloneNode = (HostElementPrototype) => {
|
380
|
+
HostElementPrototype.__cloneNode = HostElementPrototype.cloneNode;
|
381
|
+
HostElementPrototype.cloneNode = function (deep) {
|
382
|
+
const srcNode = this;
|
383
|
+
const clonedNode = HostElementPrototype.__cloneNode.call(srcNode, false);
|
384
|
+
if (deep) {
|
385
|
+
let i = 0;
|
386
|
+
let slotted, nonStencilNode;
|
387
|
+
const stencilPrivates = [
|
388
|
+
's-id',
|
389
|
+
's-cr',
|
390
|
+
's-lr',
|
391
|
+
's-rc',
|
392
|
+
's-sc',
|
393
|
+
's-p',
|
394
|
+
's-cn',
|
395
|
+
's-sr',
|
396
|
+
's-sn',
|
397
|
+
's-hn',
|
398
|
+
's-ol',
|
399
|
+
's-nr',
|
400
|
+
's-si',
|
401
|
+
's-sf',
|
402
|
+
's-sfc',
|
403
|
+
's-hsf',
|
404
|
+
];
|
405
|
+
for (; i < srcNode.__childNodes.length; i++) {
|
406
|
+
slotted = srcNode.__childNodes[i]['s-nr'];
|
407
|
+
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.__childNodes[i][privateField]);
|
408
|
+
if (slotted) {
|
409
|
+
clonedNode.__appendChild(slotted.cloneNode(true));
|
391
410
|
}
|
392
|
-
|
393
|
-
|
394
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
395
|
-
if (prop.includes('-')) {
|
396
|
-
elm.style.setProperty(prop, newValue[prop]);
|
397
|
-
}
|
398
|
-
else {
|
399
|
-
elm.style[prop] = newValue[prop];
|
400
|
-
}
|
401
|
-
}
|
402
|
-
}
|
403
|
-
}
|
404
|
-
else if (memberName === 'key')
|
405
|
-
;
|
406
|
-
else if (memberName === 'ref') {
|
407
|
-
// minifier will clean this up
|
408
|
-
if (newValue) {
|
409
|
-
newValue(elm);
|
410
|
-
}
|
411
|
-
}
|
412
|
-
else if ((!isProp ) &&
|
413
|
-
memberName[0] === 'o' &&
|
414
|
-
memberName[1] === 'n') {
|
415
|
-
// Event Handlers
|
416
|
-
// so if the member name starts with "on" and the 3rd characters is
|
417
|
-
// a capital letter, and it's not already a member on the element,
|
418
|
-
// then we're assuming it's an event listener
|
419
|
-
if (memberName[2] === '-') {
|
420
|
-
// on- prefixed events
|
421
|
-
// allows to be explicit about the dom event to listen without any magic
|
422
|
-
// under the hood:
|
423
|
-
// <my-cmp on-click> // listens for "click"
|
424
|
-
// <my-cmp on-Click> // listens for "Click"
|
425
|
-
// <my-cmp on-ionChange> // listens for "ionChange"
|
426
|
-
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
427
|
-
memberName = memberName.slice(3);
|
428
|
-
}
|
429
|
-
else if (isMemberInElement(win, ln)) {
|
430
|
-
// standard event
|
431
|
-
// the JSX attribute could have been "onMouseOver" and the
|
432
|
-
// member name "onmouseover" is on the window's prototype
|
433
|
-
// so let's add the listener "mouseover", which is all lowercased
|
434
|
-
memberName = ln.slice(2);
|
435
|
-
}
|
436
|
-
else {
|
437
|
-
// custom event
|
438
|
-
// the JSX attribute could have been "onMyCustomEvent"
|
439
|
-
// so let's trim off the "on" prefix and lowercase the first character
|
440
|
-
// and add the listener "myCustomEvent"
|
441
|
-
// except for the first character, we keep the event name case
|
442
|
-
memberName = ln[2] + memberName.slice(3);
|
443
|
-
}
|
444
|
-
if (oldValue) {
|
445
|
-
plt.rel(elm, memberName, oldValue, false);
|
446
|
-
}
|
447
|
-
if (newValue) {
|
448
|
-
plt.ael(elm, memberName, newValue, false);
|
449
|
-
}
|
450
|
-
}
|
451
|
-
else {
|
452
|
-
// Set property if it exists and it's not a SVG
|
453
|
-
const isComplex = isComplexType(newValue);
|
454
|
-
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
455
|
-
try {
|
456
|
-
if (!elm.tagName.includes('-')) {
|
457
|
-
const n = newValue == null ? '' : newValue;
|
458
|
-
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
459
|
-
if (memberName === 'list') {
|
460
|
-
isProp = false;
|
461
|
-
}
|
462
|
-
else if (oldValue == null || elm[memberName] != n) {
|
463
|
-
elm[memberName] = n;
|
464
|
-
}
|
465
|
-
}
|
466
|
-
else {
|
467
|
-
elm[memberName] = newValue;
|
468
|
-
}
|
469
|
-
}
|
470
|
-
catch (e) { }
|
471
|
-
}
|
472
|
-
/**
|
473
|
-
* Need to manually update attribute if:
|
474
|
-
* - memberName is not an attribute
|
475
|
-
* - if we are rendering the host element in order to reflect attribute
|
476
|
-
* - if it's a SVG, since properties might not work in <svg>
|
477
|
-
* - if the newValue is null/undefined or 'false'.
|
478
|
-
*/
|
479
|
-
let xlink = false;
|
480
|
-
{
|
481
|
-
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
482
|
-
memberName = ln;
|
483
|
-
xlink = true;
|
484
|
-
}
|
485
|
-
}
|
486
|
-
if (newValue == null || newValue === false) {
|
487
|
-
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
488
|
-
if (xlink) {
|
489
|
-
elm.removeAttributeNS(XLINK_NS, memberName);
|
490
|
-
}
|
491
|
-
else {
|
492
|
-
elm.removeAttribute(memberName);
|
493
|
-
}
|
494
|
-
}
|
495
|
-
}
|
496
|
-
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
497
|
-
newValue = newValue === true ? '' : newValue;
|
498
|
-
if (xlink) {
|
499
|
-
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
500
|
-
}
|
501
|
-
else {
|
502
|
-
elm.setAttribute(memberName, newValue);
|
503
|
-
}
|
504
|
-
}
|
505
|
-
}
|
506
|
-
}
|
507
|
-
};
|
508
|
-
const parseClassListRegex = /\s/;
|
509
|
-
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
510
|
-
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
511
|
-
// if the element passed in is a shadow root, which is a document fragment
|
512
|
-
// then we want to be adding attrs/props to the shadow root's "host" element
|
513
|
-
// if it's not a shadow root, then we add attrs/props to the same element
|
514
|
-
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
515
|
-
? newVnode.$elm$.host
|
516
|
-
: newVnode.$elm$;
|
517
|
-
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
518
|
-
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
519
|
-
{
|
520
|
-
// remove attributes no longer present on the vnode by setting them to undefined
|
521
|
-
for (memberName in oldVnodeAttrs) {
|
522
|
-
if (!(memberName in newVnodeAttrs)) {
|
523
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
524
|
-
}
|
525
|
-
}
|
526
|
-
}
|
527
|
-
// add new & update changed attributes
|
528
|
-
for (memberName in newVnodeAttrs) {
|
529
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
530
|
-
}
|
531
|
-
};
|
532
|
-
/**
|
533
|
-
* Polyfills `cloneNode()` for slot polyfilled components ()
|
534
|
-
* @param HostElementPrototype the host prototype to polyfill
|
535
|
-
*/
|
536
|
-
const patchCloneNode = (HostElementPrototype) => {
|
537
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
538
|
-
HostElementPrototype.cloneNode = function (deep) {
|
539
|
-
const srcNode = this;
|
540
|
-
const clonedNode = orgCloneNode.call(srcNode, false);
|
541
|
-
if (deep) {
|
542
|
-
let i = 0;
|
543
|
-
let slotted, nonStencilNode;
|
544
|
-
const stencilPrivates = [
|
545
|
-
's-id',
|
546
|
-
's-cr',
|
547
|
-
's-lr',
|
548
|
-
's-rc',
|
549
|
-
's-sc',
|
550
|
-
's-p',
|
551
|
-
's-cn',
|
552
|
-
's-sr',
|
553
|
-
's-sn',
|
554
|
-
's-hn',
|
555
|
-
's-ol',
|
556
|
-
's-nr',
|
557
|
-
's-si',
|
558
|
-
's-sf',
|
559
|
-
's-sfc',
|
560
|
-
's-hsf',
|
561
|
-
];
|
562
|
-
for (; i < srcNode.__childNodes.length; i++) {
|
563
|
-
slotted = srcNode.__childNodes[i]['s-nr'];
|
564
|
-
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.__childNodes[i][privateField]);
|
565
|
-
if (slotted) {
|
566
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
567
|
-
}
|
568
|
-
if (nonStencilNode) {
|
569
|
-
clonedNode.__appendChild(srcNode.__childNodes[i].cloneNode(true));
|
411
|
+
if (nonStencilNode) {
|
412
|
+
clonedNode.__appendChild(srcNode.__childNodes[i].cloneNode(true));
|
570
413
|
}
|
571
414
|
}
|
572
415
|
}
|
573
416
|
return clonedNode;
|
574
417
|
};
|
575
418
|
};
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
patchSlotReplaceChildren(HostElementPrototype);
|
585
|
-
patchSlotInnerHTML(HostElementPrototype);
|
586
|
-
patchSlotInnerText(HostElementPrototype);
|
587
|
-
patchTextContent(HostElementPrototype);
|
588
|
-
patchNodeRemoveChild(HostElementPrototype);
|
589
|
-
};
|
590
|
-
const patchChildSlotNodes = (HostElementPrototype) => {
|
419
|
+
/**
|
420
|
+
* Patches children accessors of a non-shadow component.
|
421
|
+
* (`childNodes`, `children`, `firstChild`, `lastChild` and `childElementCount`)
|
422
|
+
* @param HostElementPrototype
|
423
|
+
*/
|
424
|
+
const patchChildNodes = (HostElementPrototype) => {
|
425
|
+
if (!globalThis.Node)
|
426
|
+
return;
|
591
427
|
class FakeNodeList extends Array {
|
592
428
|
item(n) {
|
593
429
|
return this[n];
|
594
430
|
}
|
595
431
|
}
|
596
|
-
|
432
|
+
let childNodesDesc = Object.getOwnPropertyDescriptor(Node.prototype, 'childNodes');
|
433
|
+
if (!childNodesDesc) {
|
434
|
+
childNodesDesc = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Node.prototype), 'childNodes');
|
435
|
+
}
|
597
436
|
if (childNodesDesc)
|
598
437
|
Object.defineProperty(HostElementPrototype, '__childNodes', childNodesDesc);
|
599
438
|
let childrenDesc = Object.getOwnPropertyDescriptor(Element.prototype, 'children');
|
600
|
-
// on IE it's on HTMLElement.prototype
|
601
|
-
if (!childrenDesc)
|
602
|
-
childrenDesc = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'children');
|
603
439
|
// MockNode won't have these
|
604
440
|
if (childrenDesc)
|
605
441
|
Object.defineProperty(HostElementPrototype, '__children', childrenDesc);
|
@@ -610,7 +446,7 @@ const patchChildSlotNodes = (HostElementPrototype) => {
|
|
610
446
|
get() {
|
611
447
|
return this.childNodes
|
612
448
|
.map((n) => {
|
613
|
-
if (n.nodeType === 1)
|
449
|
+
if (n.nodeType === 1 /* NODE_TYPE.ElementNode */)
|
614
450
|
return n;
|
615
451
|
else
|
616
452
|
return null;
|
@@ -618,6 +454,16 @@ const patchChildSlotNodes = (HostElementPrototype) => {
|
|
618
454
|
.filter((n) => !!n);
|
619
455
|
},
|
620
456
|
});
|
457
|
+
Object.defineProperty(HostElementPrototype, 'firstChild', {
|
458
|
+
get() {
|
459
|
+
return this.childNodes[0];
|
460
|
+
},
|
461
|
+
});
|
462
|
+
Object.defineProperty(HostElementPrototype, 'lastChild', {
|
463
|
+
get() {
|
464
|
+
return this.childNodes[this.childNodes.length - 1];
|
465
|
+
},
|
466
|
+
});
|
621
467
|
Object.defineProperty(HostElementPrototype, 'childElementCount', {
|
622
468
|
get() {
|
623
469
|
return HostElementPrototype.children.length;
|
@@ -630,16 +476,23 @@ const patchChildSlotNodes = (HostElementPrototype) => {
|
|
630
476
|
const childNodes = this.__childNodes;
|
631
477
|
const result = new FakeNodeList();
|
632
478
|
for (let i = 0; i < childNodes.length; i++) {
|
633
|
-
const
|
634
|
-
if (
|
635
|
-
|
479
|
+
const slottedNode = childNodes[i]['s-nr'];
|
480
|
+
if (slottedNode &&
|
481
|
+
(slottedNode.nodeType !== 8 /* NODE_TYPE.CommentNode */ || slottedNode.nodeValue.indexOf(ORG_LOCATION_ID + '.') !== 0)) {
|
482
|
+
result.push(slottedNode);
|
636
483
|
}
|
637
484
|
}
|
638
485
|
return result;
|
639
486
|
},
|
640
487
|
});
|
641
488
|
};
|
642
|
-
|
489
|
+
/**
|
490
|
+
* Patches the inner html accessors of a non-shadow component
|
491
|
+
* @param HostElementPrototype the host `Element` to be patched
|
492
|
+
*/
|
493
|
+
const patchInnerHTML = (HostElementPrototype) => {
|
494
|
+
if (!globalThis.Element)
|
495
|
+
return;
|
643
496
|
let descriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'innerHTML');
|
644
497
|
// on IE it's on HTMLElement.prototype
|
645
498
|
if (!descriptor)
|
@@ -663,7 +516,13 @@ const patchSlotInnerHTML = (HostElementPrototype) => {
|
|
663
516
|
},
|
664
517
|
});
|
665
518
|
};
|
666
|
-
|
519
|
+
/**
|
520
|
+
* Patches the inner text accessors of a non-shadow component
|
521
|
+
* @param HostElementPrototype the host `Element` to be patched
|
522
|
+
*/
|
523
|
+
const patchInnerText = (HostElementPrototype) => {
|
524
|
+
if (!globalThis.Element)
|
525
|
+
return;
|
667
526
|
let descriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'innerText');
|
668
527
|
// on IE it's on HTMLElement.prototype
|
669
528
|
if (!descriptor)
|
@@ -693,10 +552,12 @@ const patchSlotInnerText = (HostElementPrototype) => {
|
|
693
552
|
});
|
694
553
|
};
|
695
554
|
/**
|
696
|
-
* Patches the text content accessors of a
|
555
|
+
* Patches the text content accessors of a non-shadow component
|
697
556
|
* @param HostElementPrototype the host `Element` to be patched
|
698
557
|
*/
|
699
558
|
const patchTextContent = (HostElementPrototype) => {
|
559
|
+
if (!globalThis.Node)
|
560
|
+
return;
|
700
561
|
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
|
701
562
|
// MockNode won't have these
|
702
563
|
if (descriptor)
|
@@ -717,66 +578,88 @@ const patchTextContent = (HostElementPrototype) => {
|
|
717
578
|
},
|
718
579
|
});
|
719
580
|
};
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
}
|
729
|
-
return this.__remove();
|
730
|
-
};
|
731
|
-
};
|
732
|
-
const patchNodeRemoveChild = (ElementPrototype) => {
|
733
|
-
if (!ElementPrototype || ElementPrototype.__removeChild)
|
581
|
+
/**
|
582
|
+
* Patches the `insertBefore` of a non-shadow component.
|
583
|
+
* The problem solved being that the 'current' node to insert before may not be in the root of our component.
|
584
|
+
* This tries to find where the 'current' node lives within the component and insert the new node before it
|
585
|
+
* @param HostElementPrototype the host `Element` to be patched
|
586
|
+
*/
|
587
|
+
const patchInsertBefore = (HostElementPrototype) => {
|
588
|
+
if (HostElementPrototype.__insertBefore)
|
734
589
|
return;
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
590
|
+
HostElementPrototype.__insertBefore = HostElementPrototype.insertBefore;
|
591
|
+
HostElementPrototype.insertBefore = function (newChild, curChild) {
|
592
|
+
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
593
|
+
const slotNode = getHostSlotNode(this.__childNodes, slotName);
|
594
|
+
if (slotNode) {
|
595
|
+
let found = false;
|
596
|
+
this.childNodes.forEach((childNode) => {
|
597
|
+
// we found the node in our list of other 'lightDOM' / slotted nodes
|
598
|
+
if (childNode === curChild || curChild === null) {
|
599
|
+
found = true;
|
600
|
+
addSlotRelocateNode(newChild, slotNode);
|
601
|
+
if (curChild === null) {
|
602
|
+
this.__append(newChild);
|
603
|
+
return;
|
604
|
+
}
|
605
|
+
if (slotName === curChild['s-sn']) {
|
606
|
+
// current child ('slot before' node) is 'in' the same slot
|
607
|
+
const insertBefore = curChild.parentNode.__insertBefore || curChild.parentNode.insertBefore;
|
608
|
+
insertBefore.call(curChild.parentNode, newChild, curChild);
|
609
|
+
patchRemove(newChild);
|
610
|
+
}
|
611
|
+
else {
|
612
|
+
// current child is not in the same slot as 'slot before' node
|
613
|
+
// so just toss the node in wherever
|
614
|
+
this.__append(newChild);
|
615
|
+
}
|
616
|
+
return;
|
617
|
+
}
|
618
|
+
});
|
619
|
+
if (found) {
|
620
|
+
return newChild;
|
742
621
|
}
|
743
|
-
return;
|
744
622
|
}
|
745
|
-
return this.
|
623
|
+
return this.__insertBefore(newChild, curChild);
|
746
624
|
};
|
747
625
|
};
|
748
|
-
|
626
|
+
/**
|
627
|
+
* Patches the `appendChild` method of a non-shadow component
|
628
|
+
* @param HostElementPrototype the host `Element` to be patched
|
629
|
+
*/
|
630
|
+
const patchAppendChild = (HostElementPrototype) => {
|
749
631
|
if (HostElementPrototype.__appendChild)
|
750
632
|
return;
|
751
633
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
752
634
|
HostElementPrototype.appendChild = function (newChild) {
|
753
635
|
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
754
|
-
const slotNode = getHostSlotNode(this.__childNodes, slotName);
|
636
|
+
const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName);
|
755
637
|
if (slotNode) {
|
756
|
-
|
757
|
-
|
758
|
-
if (slotNode['s-cr'] && slotNode['s-cr'].parentNode) {
|
759
|
-
slotNode['s-cr'].parentNode.__appendChild(slotPlaceholder);
|
760
|
-
}
|
761
|
-
newChild['s-ol'] = slotPlaceholder;
|
762
|
-
patchNodeRemove(newChild);
|
763
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
638
|
+
addSlotRelocateNode(newChild, slotNode);
|
639
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode);
|
764
640
|
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
765
641
|
if (appendAfter.parentNode) {
|
766
|
-
appendAfter.parentNode
|
642
|
+
const parent = appendAfter.parentNode;
|
643
|
+
parent.__insertBefore
|
644
|
+
? parent.__insertBefore(newChild, appendAfter.nextSibling)
|
645
|
+
: parent.insertBefore(newChild, appendAfter.nextSibling);
|
646
|
+
patchRemove(newChild);
|
767
647
|
}
|
768
|
-
patchNodeRemoveChild(newChild.parentNode);
|
769
648
|
if (slotNode['s-hsf']) {
|
770
649
|
updateFallbackSlotVisibility(slotNode.parentNode);
|
771
650
|
}
|
772
|
-
return;
|
651
|
+
return newChild;
|
773
652
|
}
|
774
|
-
if (newChild.nodeType === 1 && !!newChild.getAttribute('slot') && this.__childNodes)
|
653
|
+
if (newChild.nodeType === 1 /* NODE_TYPE.ElementNode */ && !!newChild.getAttribute('slot') && this.__childNodes)
|
775
654
|
newChild.hidden = true;
|
776
655
|
return this.__appendChild(newChild);
|
777
656
|
};
|
778
657
|
};
|
779
|
-
|
658
|
+
/**
|
659
|
+
* Patches the `prepend` method of a non-shadow component
|
660
|
+
* @param HostElementPrototype the host `Element` to be patched
|
661
|
+
*/
|
662
|
+
const patchPrepend = (HostElementPrototype) => {
|
780
663
|
if (HostElementPrototype.__prepend)
|
781
664
|
return;
|
782
665
|
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
@@ -788,31 +671,29 @@ const patchSlotPrepend = (HostElementPrototype) => {
|
|
788
671
|
const slotName = (newChild['s-sn'] = getSlotName(newChild));
|
789
672
|
const slotNode = getHostSlotNode(this.__childNodes, slotName);
|
790
673
|
if (slotNode) {
|
791
|
-
|
792
|
-
|
793
|
-
if (slotNode['s-cr'] && slotNode['s-cr'].parentNode) {
|
794
|
-
slotNode['s-cr'].parentNode.__appendChild(slotPlaceholder);
|
795
|
-
}
|
796
|
-
newChild['s-ol'] = slotPlaceholder;
|
797
|
-
patchNodeRemove(newChild);
|
798
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
674
|
+
addSlotRelocateNode(newChild, slotNode);
|
675
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode);
|
799
676
|
const appendAfter = slotChildNodes[0];
|
800
677
|
if (appendAfter.parentNode) {
|
801
678
|
appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
|
679
|
+
patchRemove(newChild);
|
802
680
|
}
|
803
|
-
patchNodeRemoveChild(newChild.parentNode);
|
804
681
|
if (slotNode['s-hsf']) {
|
805
682
|
updateFallbackSlotVisibility(slotNode.parentNode);
|
806
683
|
}
|
807
684
|
return;
|
808
685
|
}
|
809
|
-
if (newChild.nodeType === 1 && !!newChild.getAttribute('slot') && this.__childNodes)
|
686
|
+
if (newChild.nodeType === 1 /* NODE_TYPE.ElementNode */ && !!newChild.getAttribute('slot') && this.__childNodes)
|
810
687
|
newChild.hidden = true;
|
811
688
|
return this.__prepend(newChild);
|
812
689
|
});
|
813
690
|
};
|
814
691
|
};
|
815
|
-
|
692
|
+
/**
|
693
|
+
* Patches the `append` method of a non-shadow component
|
694
|
+
* @param HostElementPrototype the host `Element` to be patched
|
695
|
+
*/
|
696
|
+
const patchAppend = (HostElementPrototype) => {
|
816
697
|
if (HostElementPrototype.__append)
|
817
698
|
return;
|
818
699
|
HostElementPrototype.__append = HostElementPrototype.append;
|
@@ -825,14 +706,18 @@ const patchSlotAppend = (HostElementPrototype) => {
|
|
825
706
|
});
|
826
707
|
};
|
827
708
|
};
|
828
|
-
|
709
|
+
/**
|
710
|
+
* Patches the `replaceChildren` method of a non-shadow component
|
711
|
+
* @param HostElementPrototype the host `Element` to be patched
|
712
|
+
*/
|
713
|
+
const patchReplaceChildren = (HostElementPrototype) => {
|
829
714
|
if (HostElementPrototype.__replaceChildren)
|
830
715
|
return;
|
831
716
|
HostElementPrototype.__replaceChildren = HostElementPrototype.replaceChildren;
|
832
717
|
HostElementPrototype.replaceChildren = function (...newChildren) {
|
833
718
|
const slotNode = getHostSlotNode(this.__childNodes, '');
|
834
719
|
if (slotNode) {
|
835
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode
|
720
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode);
|
836
721
|
slotChildNodes.forEach((node) => {
|
837
722
|
if (!node['s-sr']) {
|
838
723
|
node.remove();
|
@@ -842,7 +727,11 @@ const patchSlotReplaceChildren = (HostElementPrototype) => {
|
|
842
727
|
}
|
843
728
|
};
|
844
729
|
};
|
845
|
-
|
730
|
+
/**
|
731
|
+
* Patches the `insertAdjacentHTML` method of a non-shadow component
|
732
|
+
* @param HostElementPrototype the host `Element` to be patched
|
733
|
+
*/
|
734
|
+
const patchInsertAdjacentHTML = (HostElementPrototype) => {
|
846
735
|
if (HostElementPrototype.__insertAdjacentHTML)
|
847
736
|
return;
|
848
737
|
HostElementPrototype.__insertAdjacentHTML = HostElementPrototype.insertAdjacentHTML;
|
@@ -865,7 +754,11 @@ const patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
865
754
|
}
|
866
755
|
};
|
867
756
|
};
|
868
|
-
|
757
|
+
/**
|
758
|
+
* Patches the `insertAdjacentText` method of a non-shadow component
|
759
|
+
* @param HostElementPrototype the host `Element` to be patched
|
760
|
+
*/
|
761
|
+
const patchInsertAdjacentText = (HostElementPrototype) => {
|
869
762
|
if (HostElementPrototype.__insertAdjacentText)
|
870
763
|
return;
|
871
764
|
HostElementPrototype.__insertAdjacentText = HostElementPrototype.insertAdjacentText;
|
@@ -873,7 +766,11 @@ const patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
873
766
|
this.insertAdjacentHTML(position, text);
|
874
767
|
};
|
875
768
|
};
|
876
|
-
|
769
|
+
/**
|
770
|
+
* Patches the `insertAdjacentElement` method of a non-shadow component
|
771
|
+
* @param HostElementPrototype the host `Element` to be patched
|
772
|
+
*/
|
773
|
+
const patchInsertAdjacentElement = (HostElementPrototype) => {
|
877
774
|
if (HostElementPrototype.__insertAdjacentElement)
|
878
775
|
return;
|
879
776
|
HostElementPrototype.__insertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
@@ -889,110 +786,1072 @@ const patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
889
786
|
}
|
890
787
|
};
|
891
788
|
};
|
892
|
-
|
789
|
+
////// Slotted node patches
|
893
790
|
/**
|
894
|
-
*
|
895
|
-
*
|
896
|
-
* @param
|
897
|
-
* @returns a reference to the slot node that matches the provided name, `null` otherwise
|
791
|
+
* Patches sibling accessors (`nextSibling`, `nextSiblingElement`, `previousSibling`, `previousSiblingElement`)
|
792
|
+
* of a 'slotted' node within a non-shadow component.
|
793
|
+
* @param NodePrototype the slotted node to be patched
|
898
794
|
*/
|
899
|
-
const
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
795
|
+
const patchNextPrev = (NodePrototype) => {
|
796
|
+
// Especially relevant when rendering components via SSR.
|
797
|
+
// Frameworks will often try to reconcile their VDOM with the real DOM
|
798
|
+
// by stepping through nodes with 'nextSibling' (and similar).
|
799
|
+
// This works with a shadowDOM; the lightDOM matches the framework's VDOM.
|
800
|
+
// This doesn't work without shadowDOM
|
801
|
+
if (!NodePrototype || NodePrototype.__nextSibling || !globalThis.Node)
|
802
|
+
return;
|
803
|
+
patchNextSibling(NodePrototype);
|
804
|
+
patchPreviousSibling(NodePrototype);
|
805
|
+
patchNextElementSibling(NodePrototype);
|
806
|
+
patchPreviousElementSibling(NodePrototype);
|
807
|
+
};
|
808
|
+
/**
|
809
|
+
* Patches the `nextSibling` accessor of a non-shadow slotted node
|
810
|
+
* @param NodePrototype the slotted node to be patched
|
811
|
+
*/
|
812
|
+
const patchNextSibling = (NodePrototype) => {
|
813
|
+
if (!NodePrototype || NodePrototype.__nextSibling)
|
814
|
+
return;
|
815
|
+
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'nextSibling');
|
816
|
+
// MockNode might not have these
|
817
|
+
if (descriptor)
|
818
|
+
Object.defineProperty(NodePrototype, '__nextSibling', descriptor);
|
819
|
+
else {
|
820
|
+
NodePrototype.__nextSibling = NodePrototype.nextSibling || true;
|
821
|
+
}
|
822
|
+
Object.defineProperty(NodePrototype, 'nextSibling', {
|
823
|
+
get: function () {
|
824
|
+
var _a;
|
825
|
+
const parentNodes = (_a = this['s-ol']) === null || _a === void 0 ? void 0 : _a.parentNode.childNodes;
|
826
|
+
const index = parentNodes === null || parentNodes === void 0 ? void 0 : parentNodes.indexOf(this);
|
827
|
+
if (parentNodes && index > -1) {
|
828
|
+
return parentNodes[index + 1];
|
829
|
+
}
|
830
|
+
return this.__nextSibling;
|
831
|
+
},
|
832
|
+
});
|
833
|
+
};
|
834
|
+
/**
|
835
|
+
* Patches the `nextElementSibling` accessor of a non-shadow slotted node
|
836
|
+
* @param NodePrototype the slotted node to be patched
|
837
|
+
*/
|
838
|
+
const patchNextElementSibling = (ElementPrototype) => {
|
839
|
+
if (!ElementPrototype || ElementPrototype.__nextElementSibling || !ElementPrototype.nextSiblingElement)
|
840
|
+
return;
|
841
|
+
const descriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'nextElementSibling');
|
842
|
+
// MockNode won't have these
|
843
|
+
if (descriptor)
|
844
|
+
Object.defineProperty(ElementPrototype, '__nextElementSibling', descriptor);
|
845
|
+
else {
|
846
|
+
ElementPrototype.__nextElementSibling = ElementPrototype.nextSiblingElement || true;
|
847
|
+
}
|
848
|
+
Object.defineProperty(ElementPrototype, 'nextElementSibling', {
|
849
|
+
get: function () {
|
850
|
+
var _a;
|
851
|
+
const parentEles = (_a = this['s-ol']) === null || _a === void 0 ? void 0 : _a.parentNode.children;
|
852
|
+
const index = parentEles === null || parentEles === void 0 ? void 0 : parentEles.indexOf(this);
|
853
|
+
if (parentEles && index > -1) {
|
854
|
+
return parentEles[index + 1];
|
855
|
+
}
|
856
|
+
return this.__nextElementSibling;
|
857
|
+
},
|
858
|
+
});
|
859
|
+
};
|
860
|
+
/**
|
861
|
+
* Patches the `previousSibling` accessor of a non-shadow slotted node
|
862
|
+
* @param NodePrototype the slotted node to be patched
|
863
|
+
*/
|
864
|
+
const patchPreviousSibling = (NodePrototype) => {
|
865
|
+
if (!NodePrototype || NodePrototype.__previousSibling)
|
866
|
+
return;
|
867
|
+
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'previousSibling');
|
868
|
+
// MockNode won't have these
|
869
|
+
if (descriptor)
|
870
|
+
Object.defineProperty(NodePrototype, '__previousSibling', descriptor);
|
871
|
+
else {
|
872
|
+
NodePrototype.__previousSibling = NodePrototype.previousSibling || true;
|
873
|
+
}
|
874
|
+
Object.defineProperty(NodePrototype, 'previousSibling', {
|
875
|
+
get: function () {
|
876
|
+
var _a;
|
877
|
+
const parentNodes = (_a = this['s-ol']) === null || _a === void 0 ? void 0 : _a.parentNode.childNodes;
|
878
|
+
const index = parentNodes === null || parentNodes === void 0 ? void 0 : parentNodes.indexOf(this);
|
879
|
+
if (parentNodes && index > -1) {
|
880
|
+
return parentNodes[index - 1];
|
881
|
+
}
|
882
|
+
return this.__previousSibling;
|
883
|
+
},
|
884
|
+
});
|
885
|
+
};
|
886
|
+
/**
|
887
|
+
* Patches the `previousElementSibling` accessor of a non-shadow slotted node
|
888
|
+
* @param ElementPrototype the slotted node to be patched
|
889
|
+
*/
|
890
|
+
const patchPreviousElementSibling = (ElementPrototype) => {
|
891
|
+
if (!ElementPrototype || ElementPrototype.__previousElementSibling || !ElementPrototype.previousElementSibling)
|
892
|
+
return;
|
893
|
+
const descriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'previousElementSibling');
|
894
|
+
// MockNode won't have these
|
895
|
+
if (descriptor)
|
896
|
+
Object.defineProperty(ElementPrototype, '__previousElementSibling', descriptor);
|
897
|
+
else {
|
898
|
+
ElementPrototype.__previousElementSibling = ElementPrototype.previousSiblingElement || true;
|
899
|
+
}
|
900
|
+
Object.defineProperty(ElementPrototype, 'previousElementSibling', {
|
901
|
+
get: function () {
|
902
|
+
var _a;
|
903
|
+
const parentNodes = (_a = this['s-ol']) === null || _a === void 0 ? void 0 : _a.parentNode.children;
|
904
|
+
const index = parentNodes === null || parentNodes === void 0 ? void 0 : parentNodes.indexOf(this);
|
905
|
+
if (parentNodes && index > -1) {
|
906
|
+
return parentNodes[index - 1];
|
907
|
+
}
|
908
|
+
return this.__previousElementSibling;
|
909
|
+
},
|
910
|
+
});
|
911
|
+
};
|
912
|
+
/**
|
913
|
+
* Patches the `remove` method of a non-shadow slotted node
|
914
|
+
* @param NodePrototype the slotted node to be patched
|
915
|
+
*/
|
916
|
+
const patchRemove = (NodePrototype) => {
|
917
|
+
if (!NodePrototype || NodePrototype.__remove)
|
918
|
+
return;
|
919
|
+
NodePrototype.__remove = NodePrototype.remove || true;
|
920
|
+
patchRemoveChild(NodePrototype.parentNode);
|
921
|
+
NodePrototype.remove = function () {
|
922
|
+
if (this.parentNode) {
|
923
|
+
return this.parentNode.removeChild(this);
|
924
|
+
}
|
925
|
+
return this.__remove();
|
926
|
+
};
|
927
|
+
};
|
928
|
+
/**
|
929
|
+
* Patches the `removeChild` method of a non-shadow slotted node
|
930
|
+
* @param NodePrototype the slotted node to be patched
|
931
|
+
*/
|
932
|
+
const patchRemoveChild = (ElementPrototype) => {
|
933
|
+
if (!ElementPrototype || ElementPrototype.__removeChild)
|
934
|
+
return;
|
935
|
+
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
936
|
+
ElementPrototype.removeChild = function (toRemove) {
|
937
|
+
if (toRemove && typeof toRemove['s-sn'] !== 'undefined') {
|
938
|
+
const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, toRemove['s-sn']);
|
939
|
+
toRemove.parentElement.__removeChild(toRemove);
|
940
|
+
if (slotNode && slotNode['s-hsf']) {
|
941
|
+
updateFallbackSlotVisibility(slotNode.parentElement);
|
942
|
+
}
|
943
|
+
return;
|
944
|
+
}
|
945
|
+
return this.__removeChild(toRemove);
|
946
|
+
};
|
947
|
+
};
|
948
|
+
////// Utils
|
949
|
+
/**
|
950
|
+
* When non-shadow component VDom re-renders,
|
951
|
+
* they sometimes need a place to temporarily put their 'lightDOM' elements.
|
952
|
+
* This function creates that node.
|
953
|
+
* @param newChild - A node that's going to be added to the component
|
954
|
+
* @param slotNode - The slot node that the node will be added to
|
955
|
+
*/
|
956
|
+
const addSlotRelocateNode = (newChild, slotNode) => {
|
957
|
+
if (newChild['s-ol'] && newChild['s-ol'].isConnected)
|
958
|
+
return;
|
959
|
+
const slotPlaceholder = document.createTextNode('');
|
960
|
+
slotPlaceholder['s-nr'] = newChild;
|
961
|
+
if (slotNode['s-cr'] && slotNode['s-cr'].parentNode) {
|
962
|
+
const appendChild = slotNode['s-cr'].parentNode.__appendChild || slotNode['s-cr'].parentNode.appendChild;
|
963
|
+
appendChild.call(slotNode['s-cr'].parentNode, slotPlaceholder);
|
964
|
+
}
|
965
|
+
newChild['s-ol'] = slotPlaceholder;
|
966
|
+
};
|
967
|
+
/**
|
968
|
+
* Find the slot name of a given node
|
969
|
+
* @param node
|
970
|
+
* @returns the node's slot name
|
971
|
+
*/
|
972
|
+
const getSlotName = (node) => node['s-sn'] ||
|
973
|
+
(node.nodeType === 1 /* NODE_TYPE.ElementNode */ && node.getAttribute('slot')) ||
|
974
|
+
node.slot ||
|
975
|
+
'';
|
976
|
+
/**
|
977
|
+
* Recursively searches a series of child nodes for a slot with the provided name.
|
978
|
+
* @param childNodes the nodes to search for a slot with a specific name.
|
979
|
+
* @param slotName the name of the slot to match on.
|
980
|
+
* @returns a reference to the slot node that matches the provided name, `null` otherwise
|
981
|
+
*/
|
982
|
+
const getHostSlotNode = (childNodes, slotName) => {
|
983
|
+
let i = 0;
|
984
|
+
let childNode;
|
985
|
+
if (!childNodes)
|
986
|
+
return null;
|
987
|
+
for (; i < childNodes.length; i++) {
|
988
|
+
childNode = childNodes[i];
|
989
|
+
if (childNode['s-sr'] && childNode['s-sn'] === slotName) {
|
990
|
+
return childNode;
|
991
|
+
}
|
992
|
+
childNode = getHostSlotNode(childNode.childNodes, slotName);
|
993
|
+
if (childNode) {
|
994
|
+
return childNode;
|
995
|
+
}
|
996
|
+
}
|
997
|
+
return null;
|
998
|
+
};
|
999
|
+
/**
|
1000
|
+
* Get all nodes currently assigned to any given slot node
|
1001
|
+
* @param slotNode - the slot node to check
|
1002
|
+
* @returns - all child node 'within' the checked slot node
|
1003
|
+
*/
|
1004
|
+
const getHostSlotChildNodes = (slotNode) => {
|
1005
|
+
const childNodes = [slotNode];
|
1006
|
+
const slotName = slotNode['s-sn'] || '';
|
1007
|
+
while ((slotNode = slotNode.nextSibling) && slotNode['s-sn'] === slotName) {
|
1008
|
+
childNodes.push(slotNode);
|
1009
|
+
}
|
1010
|
+
return childNodes;
|
1011
|
+
};
|
1012
|
+
/**
|
1013
|
+
* Takes an SSR rendered document, as annotated by 'vdom-annotations.ts' and:
|
1014
|
+
* 1) Recreate an accurate VDOM tree to reconcile with during 'vdom-render.ts'
|
1015
|
+
* (a failure to do so will result in DOM nodes being duplicated when rendering)
|
1016
|
+
* 2) Add `shadow: true` DOM trees to their document-fragment
|
1017
|
+
* 3) Move slotted nodes out of shadowDOMs
|
1018
|
+
* 4) Add meta nodes to non-shadow DOMs and their 'slotted' nodes
|
1019
|
+
*
|
1020
|
+
* @param hostElm - the current custom element being hydrated
|
1021
|
+
* @param tagName - the custom element's tag
|
1022
|
+
* @param hostId - a unique custom element id
|
1023
|
+
* @param hostRef - the VNode representing this custom element
|
1024
|
+
*/
|
1025
|
+
const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
1026
|
+
const endHydrate = createTime('hydrateClient', tagName);
|
1027
|
+
const shadowRoot = hostElm.shadowRoot;
|
1028
|
+
const childRenderNodes = [];
|
1029
|
+
const slotNodes = [];
|
1030
|
+
const slottedNodes = [];
|
1031
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
1032
|
+
let vnode = newVNode(tagName, null);
|
1033
|
+
vnode.$elm$ = hostElm;
|
1034
|
+
if (!plt.$orgLocNodes$) {
|
1035
|
+
// this is the first pass over of this whole document
|
1036
|
+
// does a quick scrape to construct a 'bare-bones' tree of
|
1037
|
+
// what elements we have and where content has been moved from
|
1038
|
+
initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
1039
|
+
}
|
1040
|
+
hostElm[HYDRATE_ID] = hostId;
|
1041
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
1042
|
+
hostRef.$vnode$ = clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId, slottedNodes);
|
1043
|
+
let crIndex = 0;
|
1044
|
+
const crLength = childRenderNodes.length;
|
1045
|
+
let childRenderNode;
|
1046
|
+
// Steps through childNodes we found.
|
1047
|
+
// If moved from an original location (by nature of being rendered in SSR markup)
|
1048
|
+
// we might be able to move it back there now,
|
1049
|
+
// so slotted nodes don't get added to internal shadowDOMs
|
1050
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
1051
|
+
childRenderNode = childRenderNodes[crIndex];
|
1052
|
+
const orgLocationId = childRenderNode.$hostId$ + '.' + childRenderNode.$nodeId$;
|
1053
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
1054
|
+
const node = childRenderNode.$elm$;
|
1055
|
+
if (!shadowRoot) {
|
1056
|
+
node['s-hn'] = tagName.toUpperCase();
|
1057
|
+
if (childRenderNode.$tag$ === 'slot') {
|
1058
|
+
// if this is a 'mock slot'
|
1059
|
+
// add it's content position reference now.
|
1060
|
+
// otherwise vdom-render will try to add nodes to it
|
1061
|
+
// (it's a comment node so will error)
|
1062
|
+
node['s-cr'] = hostElm['s-cr'];
|
1063
|
+
}
|
1064
|
+
}
|
1065
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
1066
|
+
if (shadowRoot && orgLocationNode['s-en'] === '') {
|
1067
|
+
// if this node is within a shadowDOM, with an original location home
|
1068
|
+
// we're safe to move it now
|
1069
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
1070
|
+
}
|
1071
|
+
// Remove original location comment now regardless:
|
1072
|
+
// 1) Stops SSR frameworks complaining about mismatches
|
1073
|
+
// 2) is un-required for non-shadow, slotted nodes as
|
1074
|
+
// we'll add all the meta nodes we need when we deal with *all* slotted nodes ↓↓↓
|
1075
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
1076
|
+
}
|
1077
|
+
// remove the original location from the map
|
1078
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
1079
|
+
}
|
1080
|
+
const hosts = [];
|
1081
|
+
let snIndex = 0;
|
1082
|
+
const snLen = slottedNodes.length;
|
1083
|
+
let slotGroup;
|
1084
|
+
let snGroupIdx;
|
1085
|
+
let snGroupLen;
|
1086
|
+
let slottedItem;
|
1087
|
+
// Loops through all the slotted nodes we found while
|
1088
|
+
// stepping through this component
|
1089
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
1090
|
+
slotGroup = slottedNodes[snIndex];
|
1091
|
+
if (!slotGroup || !slotGroup.length)
|
1092
|
+
continue;
|
1093
|
+
snGroupLen = slotGroup.length;
|
1094
|
+
snGroupIdx = 0;
|
1095
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
1096
|
+
slottedItem = slotGroup[snGroupIdx];
|
1097
|
+
if (!hosts[slottedItem.hostId]) {
|
1098
|
+
// cache this host for other grouped slotted nodes
|
1099
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
1100
|
+
}
|
1101
|
+
// this shouldn't happen
|
1102
|
+
// as we collect all the custom elements first in `initializeDocumentHydrate`
|
1103
|
+
if (!hosts[slottedItem.hostId])
|
1104
|
+
continue;
|
1105
|
+
const hostEle = hosts[slottedItem.hostId];
|
1106
|
+
// this node is either slotted in a non-shadow host, OR
|
1107
|
+
// *that* host is nested in a non-shadow host
|
1108
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
1109
|
+
// try to set an appropriate content position reference
|
1110
|
+
// (CR) node for this host element
|
1111
|
+
// a CR already set on the host?
|
1112
|
+
slottedItem.slot['s-cr'] = hostEle['s-cr'];
|
1113
|
+
if (!slottedItem.slot['s-cr'] && hostEle.shadowRoot) {
|
1114
|
+
// host is shadowDOM - just use the host itself as the CR for native slotting
|
1115
|
+
slottedItem.slot['s-cr'] = hostEle;
|
1116
|
+
}
|
1117
|
+
else {
|
1118
|
+
// if all else fails - just set the CR as the first child
|
1119
|
+
// (9/10 if node['s-cr'] hasn't been set, the node will be at the element root)
|
1120
|
+
const hostChildren = hostEle.__childNodes || hostEle.childNodes;
|
1121
|
+
slottedItem.slot['s-cr'] = hostChildren[0];
|
1122
|
+
}
|
1123
|
+
// create our original location node
|
1124
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot);
|
1125
|
+
// patch this node for accessors like `nextSibling` (et al)
|
1126
|
+
patchNextPrev(slottedItem.node);
|
1127
|
+
}
|
1128
|
+
if (hostEle.shadowRoot) {
|
1129
|
+
// shadowDOM - move the item to the element root for
|
1130
|
+
// native slotting
|
1131
|
+
hostEle.appendChild(slottedItem.node);
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
if (shadowRoot) {
|
1136
|
+
// add all the root nodes in the shadowDOM
|
1137
|
+
// (a root node can have a whole nested DOM tree)
|
1138
|
+
let rnIdex = 0;
|
1139
|
+
const rnLen = shadowRootNodes.length;
|
1140
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
1141
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
1142
|
+
}
|
1143
|
+
// tidy up left-over / unnecessary comments to stop
|
1144
|
+
// frameworks complaining about DOM mismatches
|
1145
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
1146
|
+
if (node.nodeType === 8 /* NODE_TYPE.CommentNode */ && typeof node['s-sn'] !== 'string') {
|
1147
|
+
node.parentNode.removeChild(node);
|
1148
|
+
}
|
1149
|
+
});
|
1150
|
+
}
|
1151
|
+
hostRef.$hostElement$ = hostElm;
|
1152
|
+
endHydrate();
|
1153
|
+
};
|
1154
|
+
/**
|
1155
|
+
* Recursively step through a nodes' SSR DOM.
|
1156
|
+
* Constructs a VDOM. Finds and adds nodes to master arrays
|
1157
|
+
* (`childRenderNodes`, `shadowRootNodes` and `slottedNodes`)
|
1158
|
+
* these are used later for special consideration:
|
1159
|
+
* - Add `shadow: true` DOM trees to their document-fragment
|
1160
|
+
* - Move slotted nodes out of shadowDOMs
|
1161
|
+
* - Add meta nodes to non-shadow DOMs and their 'slotted' nodes
|
1162
|
+
* @param parentVNode - this nodes current parent vnode
|
1163
|
+
* @param childRenderNodes - flat array of all child vnodes
|
1164
|
+
* @param slotNodes - nodes that represent an element's `<slot />`s
|
1165
|
+
* @param shadowRootNodes - nodes that are at the root of this hydrating element
|
1166
|
+
* @param hostElm - the root, hydrating element
|
1167
|
+
* @param node - the node currently being iterated over
|
1168
|
+
* @param hostId - the root, hydrating element id
|
1169
|
+
* @param slottedNodes - nodes that have been slotted
|
1170
|
+
* @returns - the constructed VNode
|
1171
|
+
*/
|
1172
|
+
const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
1173
|
+
let childNodeType;
|
1174
|
+
let childIdSplt;
|
1175
|
+
let childVNode;
|
1176
|
+
let i;
|
1177
|
+
const scopeId = hostElm['s-sc'];
|
1178
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
1179
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
1180
|
+
if (childNodeType) {
|
1181
|
+
// got the node data from the element's attribute
|
1182
|
+
// `${hostId}.${nodeId}.${depth}.${index}`
|
1183
|
+
childIdSplt = childNodeType.split('.');
|
1184
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
|
1185
|
+
childVNode = createSimpleVNode({
|
1186
|
+
$hostId$: childIdSplt[0],
|
1187
|
+
$nodeId$: childIdSplt[1],
|
1188
|
+
$depth$: childIdSplt[2],
|
1189
|
+
$index$: childIdSplt[3],
|
1190
|
+
$tag$: node.tagName.toLowerCase(),
|
1191
|
+
$elm$: node,
|
1192
|
+
// if we don't add the initial classes to the VNode,
|
1193
|
+
// the first vdom-render patch / reconciliation will fail;
|
1194
|
+
// any client side change before componentDidLoad will be ignored,
|
1195
|
+
// `setAccessor` will just take the element's initial classes
|
1196
|
+
$attrs$: { class: node.className },
|
1197
|
+
});
|
1198
|
+
childRenderNodes.push(childVNode);
|
1199
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
1200
|
+
// this is a new child vnode
|
1201
|
+
// so ensure it's parent vnode has the vchildren array
|
1202
|
+
if (!parentVNode.$children$) {
|
1203
|
+
parentVNode.$children$ = [];
|
1204
|
+
}
|
1205
|
+
// test if this element was 'slotted'
|
1206
|
+
// recreate node attributes
|
1207
|
+
const slotName = childVNode.$elm$.getAttribute('s-sn');
|
1208
|
+
if (typeof slotName === 'string') {
|
1209
|
+
childVNode.$elm$['s-sn'] = slotName;
|
1210
|
+
childVNode.$elm$.removeAttribute('s-sn');
|
1211
|
+
}
|
1212
|
+
// test if this node is the child (a slot fallback node) of a slot
|
1213
|
+
const slotFbId = childVNode.$elm$.getAttribute(HYDRATED_SLOT_FALLBACK_ID);
|
1214
|
+
if (slotFbId) {
|
1215
|
+
childVNode.$elm$.removeAttribute(HYDRATED_SLOT_FALLBACK_ID);
|
1216
|
+
// find the relevant slot node
|
1217
|
+
const slotNode = slotNodes.find((slot) => slot.$elm$['s-sn'] === childVNode.$elm$['s-sn'] || slot.$name$ === childVNode.$elm$['s-sn']);
|
1218
|
+
// add the relationship to the VDOM to stop re-renders
|
1219
|
+
if (slotNode) {
|
1220
|
+
childVNode.$elm$['s-sf'] = true;
|
1221
|
+
childVNode.$elm$['s-hn'] = hostElm.tagName;
|
1222
|
+
slotNode.$children$ = slotNode.$children$ || [];
|
1223
|
+
slotNode.$children$[childVNode.$index$] = childVNode;
|
1224
|
+
// if the slot is an actual `<slot>`
|
1225
|
+
// that's a newly created node (↓↓↓)
|
1226
|
+
// move this element there now
|
1227
|
+
if (slotNode.$elm$.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
1228
|
+
slotNode.$elm$.appendChild(childVNode.$elm$);
|
1229
|
+
}
|
1230
|
+
}
|
1231
|
+
}
|
1232
|
+
else if (childVNode.$index$ !== undefined) {
|
1233
|
+
// add our child vnode to a specific index of the vnode's children
|
1234
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
1235
|
+
}
|
1236
|
+
// host is `scoped: true` - add that flag to child.
|
1237
|
+
// used in 'setAccessor' to make sure our scoped class is present
|
1238
|
+
if (scopeId)
|
1239
|
+
node['s-si'] = scopeId;
|
1240
|
+
// this is now the new parent vnode for all the next child checks
|
1241
|
+
parentVNode = childVNode;
|
1242
|
+
if (shadowRootNodes &&
|
1243
|
+
childVNode.$depth$ === '0' &&
|
1244
|
+
// don't move slot fallback node into the root nodes array
|
1245
|
+
// they'll be moved into a new slot element ↓↓↓
|
1246
|
+
!slotFbId) {
|
1247
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
1248
|
+
}
|
1249
|
+
}
|
1250
|
+
}
|
1251
|
+
// recursively drill down, end to start so we can
|
1252
|
+
// construct a VDOM and add meta to nodes
|
1253
|
+
const nonShadowChildNodes = node.__childNodes || node.childNodes;
|
1254
|
+
for (i = nonShadowChildNodes.length - 1; i >= 0; i--) {
|
1255
|
+
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, nonShadowChildNodes[i], hostId, slottedNodes);
|
1256
|
+
}
|
1257
|
+
if (node.shadowRoot) {
|
1258
|
+
// keep drilling down through the shadow root nodes
|
1259
|
+
for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
|
1260
|
+
clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId, slottedNodes);
|
1261
|
+
}
|
1262
|
+
}
|
1263
|
+
}
|
1264
|
+
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
1265
|
+
// `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}.${isSlotFallbackText}.${slotName}`
|
1266
|
+
childIdSplt = node.nodeValue.split('.');
|
1267
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
|
1268
|
+
// comment node for either the host id or a 0 host id
|
1269
|
+
childNodeType = childIdSplt[0];
|
1270
|
+
childVNode = createSimpleVNode({
|
1271
|
+
$hostId$: childIdSplt[1],
|
1272
|
+
$nodeId$: childIdSplt[2],
|
1273
|
+
$depth$: childIdSplt[3],
|
1274
|
+
$index$: childIdSplt[4] || '0',
|
1275
|
+
$elm$: node,
|
1276
|
+
});
|
1277
|
+
if (childNodeType === TEXT_NODE_ID) {
|
1278
|
+
let textNode = (childVNode.$elm$ = node.nextSibling);
|
1279
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
1280
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
1281
|
+
childRenderNodes.push(childVNode);
|
1282
|
+
// remove the text comment since it's no longer needed
|
1283
|
+
node.remove();
|
1284
|
+
// test to see if this is slot fallback text
|
1285
|
+
if (childIdSplt[5] === '1') {
|
1286
|
+
textNode['s-sf'] = true;
|
1287
|
+
textNode['s-sn'] = childIdSplt[6] || '';
|
1288
|
+
textNode['s-sfc'] = textNode.textContent;
|
1289
|
+
textNode['s-hn'] = hostElm.tagName;
|
1290
|
+
// find the relevant slot node
|
1291
|
+
const slotNode = slotNodes.find((slot) => slot.$elm$['s-sn'] === textNode['s-sn'] || slot.$name$ === textNode['s-sn']);
|
1292
|
+
// add the relationship to the VDOM to stop re-renders
|
1293
|
+
if (slotNode) {
|
1294
|
+
slotNode.$children$ = slotNode.$children$ || [];
|
1295
|
+
slotNode.$children$[childVNode.$index$] = childVNode;
|
1296
|
+
// if the slot is an actual `<slot>`
|
1297
|
+
// that's a newly created node (↓↓↓)
|
1298
|
+
// move this text node there now
|
1299
|
+
if (slotNode.$elm$.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
1300
|
+
slotNode.$elm$.appendChild(textNode);
|
1301
|
+
}
|
1302
|
+
}
|
1303
|
+
}
|
1304
|
+
else {
|
1305
|
+
// check to make sure this node actually belongs to this host.
|
1306
|
+
// If it was slotted from another component, we don't want to add it
|
1307
|
+
// to this host's vdom; it can be removed on render reconciliation.
|
1308
|
+
// We want slotting logic to take care of it
|
1309
|
+
if (hostId === childVNode.$hostId$) {
|
1310
|
+
if (!parentVNode.$children$) {
|
1311
|
+
parentVNode.$children$ = [];
|
1312
|
+
}
|
1313
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
1314
|
+
}
|
1315
|
+
if (shadowRootNodes && childVNode.$depth$ === '0') {
|
1316
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
1317
|
+
}
|
1318
|
+
}
|
1319
|
+
}
|
1320
|
+
}
|
1321
|
+
else if (childVNode.$hostId$ === hostId) {
|
1322
|
+
// this comment node is specifically for this host id
|
1323
|
+
if (childNodeType === SLOT_NODE_ID) {
|
1324
|
+
// `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}.${hasSlotFallback}.${slotFallbackText}`;
|
1325
|
+
childVNode.$tag$ = 'slot';
|
1326
|
+
// TODO: this is clunky.
|
1327
|
+
// Clear out parent VNode attrs so the initial element state is used as a reference.
|
1328
|
+
// The reason: this is a slot container element and requires special scope classes
|
1329
|
+
// This does mean any class changes client-side before 'componentDidLoad',
|
1330
|
+
// will not be respected.
|
1331
|
+
parentVNode.$attrs$ = undefined;
|
1332
|
+
// add slot name
|
1333
|
+
const slotName = (node['s-sn'] = childVNode.$name$ = childIdSplt[5] || '');
|
1334
|
+
node['s-sr'] = true;
|
1335
|
+
// this slot node has fallback nodes?
|
1336
|
+
if (childIdSplt[6] === '1') {
|
1337
|
+
node['s-hsf'] = true;
|
1338
|
+
}
|
1339
|
+
if (childIdSplt[7] === '1') {
|
1340
|
+
// this slot has fallback text
|
1341
|
+
// it should be held in the previous comment node
|
1342
|
+
// (white-space depending)
|
1343
|
+
let foundFallbackText = node.previousSibling;
|
1344
|
+
while (!!foundFallbackText && foundFallbackText.nodeType !== 8 /* NODE_TYPE.CommentNode */) {
|
1345
|
+
foundFallbackText = foundFallbackText.previousSibling;
|
1346
|
+
}
|
1347
|
+
// this slot node has fallback text?
|
1348
|
+
// (if so, the previous node comment will have that text)
|
1349
|
+
node['s-sfc'] = foundFallbackText.nodeValue;
|
1350
|
+
}
|
1351
|
+
// find this slots' current host parent as dictated by the vdom tree.
|
1352
|
+
// this is important because where it is now in the constructed SSR markup
|
1353
|
+
// might be different to where to should be
|
1354
|
+
const parentNodeId = (parentVNode === null || parentVNode === void 0 ? void 0 : parentVNode.$elm$)
|
1355
|
+
? parentVNode.$elm$['s-id'] || parentVNode.$elm$.getAttribute('s-id')
|
1356
|
+
: '';
|
1357
|
+
if (shadowRootNodes) {
|
1358
|
+
/* SHADOW */
|
1359
|
+
// browser supports shadowRoot and this is a shadow dom component
|
1360
|
+
// create an actual slot element
|
1361
|
+
const slot = (childVNode.$elm$ = doc.createElement(childVNode.$tag$));
|
1362
|
+
if (childVNode.$name$) {
|
1363
|
+
// add the slot name attribute
|
1364
|
+
childVNode.$elm$.setAttribute('name', slotName);
|
1365
|
+
}
|
1366
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
1367
|
+
// shadow component's slot is placed inside a nested component's shadowDOM;
|
1368
|
+
// it doesn't belong to this host - it was forwarded by the SSR markup.
|
1369
|
+
// Insert it in the root of this host; it's lightDOM.
|
1370
|
+
// It doesn't really matter where in the host root; the component will take care of it.
|
1371
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
1372
|
+
}
|
1373
|
+
else {
|
1374
|
+
// insert the new slot element before the slot comment
|
1375
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
1376
|
+
}
|
1377
|
+
addSlottedNodes(slottedNodes, childIdSplt[2], slotName, node, childVNode.$hostId$);
|
1378
|
+
// remove the slot comment since it's not needed for shadow
|
1379
|
+
node.remove();
|
1380
|
+
if (childVNode.$depth$ === '0') {
|
1381
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
1382
|
+
}
|
1383
|
+
}
|
1384
|
+
else {
|
1385
|
+
/* NON-SHADOW */
|
1386
|
+
const slot = childVNode.$elm$;
|
1387
|
+
// test to see if this non-shadow component's mock 'slot' is placed
|
1388
|
+
// inside a nested component's shadowDOM. If so, it doesn't belong here;
|
1389
|
+
// it was forwarded by the SSR markup. So we'll insert it into the root of this host;
|
1390
|
+
// it's lightDOM with accompanying 'slotted' nodes
|
1391
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
1392
|
+
// attempt to find any mock slotted nodes which we'll move later
|
1393
|
+
addSlottedNodes(slottedNodes, childIdSplt[2], slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
1394
|
+
if (shouldMove) {
|
1395
|
+
// move slot comment node (to after any other comment nodes)
|
1396
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
1397
|
+
}
|
1398
|
+
childRenderNodes.push(childVNode);
|
1399
|
+
}
|
1400
|
+
slotNodes.push(childVNode);
|
1401
|
+
if (!parentVNode.$children$) {
|
1402
|
+
parentVNode.$children$ = [];
|
1403
|
+
}
|
1404
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
1405
|
+
}
|
1406
|
+
else if (childNodeType === CONTENT_REF_ID) {
|
1407
|
+
// `${CONTENT_REF_ID}.${hostId}`;
|
1408
|
+
if (shadowRootNodes) {
|
1409
|
+
// remove the content ref comment since it's not needed for shadow
|
1410
|
+
node.remove();
|
1411
|
+
}
|
1412
|
+
else {
|
1413
|
+
hostElm['s-cr'] = node;
|
1414
|
+
node['s-cn'] = true;
|
1415
|
+
}
|
1416
|
+
}
|
1417
|
+
}
|
1418
|
+
}
|
1419
|
+
}
|
1420
|
+
else if (parentVNode && parentVNode.$tag$ === 'style') {
|
1421
|
+
const vnode = newVNode(null, node.textContent);
|
1422
|
+
vnode.$elm$ = node;
|
1423
|
+
vnode.$index$ = '0';
|
1424
|
+
parentVNode.$children$ = [vnode];
|
1425
|
+
}
|
1426
|
+
return parentVNode;
|
1427
|
+
};
|
1428
|
+
/**
|
1429
|
+
* Skims whole SSR document to create
|
1430
|
+
* a map of component IDs and 'original location ID's.
|
1431
|
+
* original location ID's are derived from comment nodes placed by 'vdom-annotations.ts'.
|
1432
|
+
* They relate to lightDOM nodes that were moved deeper into the SSR markup.
|
1433
|
+
* e.g. `<!--o.1-->` maps to `<div c-id="0.1">`
|
1434
|
+
*
|
1435
|
+
* @param node - a node in the document. If an element, will recursively drill down
|
1436
|
+
* @param orgLocNodes - a master map to add component ids and original location ids to
|
1437
|
+
*/
|
1438
|
+
const initializeDocumentHydrate = (node, orgLocNodes) => {
|
1439
|
+
if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
1440
|
+
// add all the loaded component IDs in this document
|
1441
|
+
// they're required to find nodes later
|
1442
|
+
// when deciding where slotted nodes should live
|
1443
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
1444
|
+
if (componentId) {
|
1445
|
+
orgLocNodes.set(componentId, node);
|
1446
|
+
}
|
1447
|
+
let i = 0;
|
1448
|
+
const nonShadowChildNodes = node.__childNodes || node.childNodes;
|
1449
|
+
for (; i < nonShadowChildNodes.length; i++) {
|
1450
|
+
initializeDocumentHydrate(nonShadowChildNodes[i], orgLocNodes);
|
1451
|
+
}
|
1452
|
+
if (node.shadowRoot) {
|
1453
|
+
for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
|
1454
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
|
1455
|
+
}
|
1456
|
+
}
|
1457
|
+
}
|
1458
|
+
else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
|
1459
|
+
const childIdSplt = node.nodeValue.split('.');
|
1460
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
1461
|
+
orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
|
1462
|
+
// useful to know if the original location is
|
1463
|
+
// the root light-dom of a shadow dom component
|
1464
|
+
node['s-en'] = childIdSplt[3];
|
1465
|
+
}
|
1466
|
+
}
|
1467
|
+
};
|
1468
|
+
/**
|
1469
|
+
* Creates a vnode to add to a hydrated component vdom
|
1470
|
+
* @param vnode - a vnode partial which will be augmented
|
1471
|
+
* @returns an complete vnode
|
1472
|
+
*/
|
1473
|
+
const createSimpleVNode = (vnode) => {
|
1474
|
+
const defaultVNode = {
|
1475
|
+
$flags$: 0,
|
1476
|
+
$hostId$: null,
|
1477
|
+
$nodeId$: null,
|
1478
|
+
$depth$: null,
|
1479
|
+
$index$: '0',
|
1480
|
+
$elm$: null,
|
1481
|
+
$attrs$: null,
|
1482
|
+
$children$: null,
|
1483
|
+
$key$: null,
|
1484
|
+
$name$: null,
|
1485
|
+
$tag$: null,
|
1486
|
+
$text$: null,
|
1487
|
+
};
|
1488
|
+
return Object.assign(Object.assign({}, defaultVNode), vnode);
|
1489
|
+
};
|
1490
|
+
/**
|
1491
|
+
* Adds groups of slotted nodes (grouped by slot ID)
|
1492
|
+
* to this host element's 'master' array. We'll use this after
|
1493
|
+
* the host element's VDOM is completely constructed to
|
1494
|
+
* finally position or / and add meta information required by non-shadow slotted nodes
|
1495
|
+
* @param slottedNodes - the main host element 'master' array to add to
|
1496
|
+
* @param slotNodeId - the slot node unique ID
|
1497
|
+
* @param slotName - the slot node name (can be '')
|
1498
|
+
* @param slotNode - the slot node
|
1499
|
+
* @param hostId - the host element id where this node should be slotted
|
1500
|
+
*/
|
1501
|
+
const addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
1502
|
+
let slottedNode = slotNode.nextSibling;
|
1503
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
1504
|
+
// looking for nodes that match this slot's name,
|
1505
|
+
// OR are text / comment nodes and the slot is a default slot (no name)
|
1506
|
+
// (text / comments cannot be direct descendants of named slots)
|
1507
|
+
// also ignore slot fallback nodes
|
1508
|
+
while (slottedNode &&
|
1509
|
+
(slottedNode['s-sn'] === slotName ||
|
1510
|
+
(slotName === '' &&
|
1511
|
+
!slottedNode['s-sn'] &&
|
1512
|
+
((slottedNode.nodeType === 8 /* NODE_TYPE.CommentNode */ && slottedNode.nodeValue.indexOf('.') !== 1) ||
|
1513
|
+
slottedNode.nodeType === 3 /* NODE_TYPE.TextNode */))) &&
|
1514
|
+
!slottedNode['s-sf']) {
|
1515
|
+
slottedNode['s-sn'] = slotName;
|
1516
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
1517
|
+
slottedNode = slottedNode.nextSibling;
|
1518
|
+
}
|
1519
|
+
};
|
1520
|
+
// Private
|
1521
|
+
const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
|
1522
|
+
/**
|
1523
|
+
* Parse a new property value for a given property type.
|
1524
|
+
*
|
1525
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
1526
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
1527
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
1528
|
+
* 2. the type stored from `propType`.
|
1529
|
+
*
|
1530
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
1531
|
+
*
|
1532
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
1533
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
1534
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
1535
|
+
* ```tsx
|
1536
|
+
* <my-cmp prop-val={0}></my-cmp>
|
1537
|
+
* ```
|
1538
|
+
*
|
1539
|
+
* HTML prop values on the other hand, will always a string
|
1540
|
+
*
|
1541
|
+
* @param propValue the new value to coerce to some type
|
1542
|
+
* @param propType the type of the prop, expressed as a binary number
|
1543
|
+
* @returns the parsed/coerced value
|
1544
|
+
*/
|
1545
|
+
const parsePropertyValue = (propValue, propType) => {
|
1546
|
+
// ensure this value is of the correct prop type
|
1547
|
+
if (propValue != null && !isComplexType(propValue)) {
|
1548
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
1549
|
+
// per the HTML spec, any string value means it is a boolean true value
|
1550
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
1551
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
1552
|
+
}
|
1553
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
1554
|
+
// force it to be a number
|
1555
|
+
return parseFloat(propValue);
|
1556
|
+
}
|
1557
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
1558
|
+
// could have been passed as a number or boolean
|
1559
|
+
// but we still want it as a string
|
1560
|
+
return String(propValue);
|
1561
|
+
}
|
1562
|
+
// redundant return here for better minification
|
1563
|
+
return propValue;
|
1564
|
+
}
|
1565
|
+
// not sure exactly what type we want
|
1566
|
+
// so no need to change to a different type
|
1567
|
+
return propValue;
|
1568
|
+
};
|
1569
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
1570
|
+
const createEvent = (ref, name, flags) => {
|
1571
|
+
const elm = getElement(ref);
|
1572
|
+
return {
|
1573
|
+
emit: (detail) => {
|
1574
|
+
return emitEvent(elm, name, {
|
1575
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
1576
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
1577
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
1578
|
+
detail,
|
1579
|
+
});
|
1580
|
+
},
|
1581
|
+
};
|
1582
|
+
};
|
1583
|
+
/**
|
1584
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
1585
|
+
* @param elm the target of the Event
|
1586
|
+
* @param name the name to give the custom Event
|
1587
|
+
* @param opts options for configuring a custom Event
|
1588
|
+
* @returns the custom Event
|
1589
|
+
*/
|
1590
|
+
const emitEvent = (elm, name, opts) => {
|
1591
|
+
const ev = plt.ce(name, opts);
|
1592
|
+
elm.dispatchEvent(ev);
|
1593
|
+
return ev;
|
1594
|
+
};
|
1595
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
1596
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
1597
|
+
let style = styles.get(scopeId);
|
1598
|
+
if (supportsConstructableStylesheets && allowCS) {
|
1599
|
+
style = (style || new CSSStyleSheet());
|
1600
|
+
if (typeof style === 'string') {
|
1601
|
+
style = cssText;
|
1602
|
+
}
|
1603
|
+
else {
|
1604
|
+
style.replaceSync(cssText);
|
1605
|
+
}
|
1606
|
+
}
|
1607
|
+
else {
|
1608
|
+
style = cssText;
|
1609
|
+
}
|
1610
|
+
styles.set(scopeId, style);
|
1611
|
+
};
|
1612
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
1613
|
+
var _a;
|
1614
|
+
let scopeId = getScopeId(cmpMeta);
|
1615
|
+
const style = styles.get(scopeId);
|
1616
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
1617
|
+
// so the fallback is to always use the document for the root node in those cases
|
1618
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
1619
|
+
if (style) {
|
1620
|
+
if (typeof style === 'string') {
|
1621
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
1622
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
1623
|
+
let styleElm;
|
1624
|
+
if (!appliedStyles) {
|
1625
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
1626
|
+
}
|
1627
|
+
if (!appliedStyles.has(scopeId)) {
|
1628
|
+
if (styleContainerNode.host &&
|
1629
|
+
(styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
|
1630
|
+
// This is only happening on native shadow-dom, do not needs CSS var shim
|
1631
|
+
styleElm.innerHTML = style;
|
1632
|
+
}
|
1633
|
+
else {
|
1634
|
+
{
|
1635
|
+
styleElm = doc.createElement('style');
|
1636
|
+
styleElm.innerHTML = style;
|
1637
|
+
}
|
1638
|
+
// Apply CSP nonce to the style tag if it exists
|
1639
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
1640
|
+
if (nonce != null) {
|
1641
|
+
styleElm.setAttribute('nonce', nonce);
|
1642
|
+
}
|
1643
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
1644
|
+
}
|
1645
|
+
if (appliedStyles) {
|
1646
|
+
appliedStyles.add(scopeId);
|
1647
|
+
}
|
1648
|
+
}
|
908
1649
|
}
|
909
|
-
|
910
|
-
|
911
|
-
return childNode;
|
1650
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
1651
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
912
1652
|
}
|
913
1653
|
}
|
914
|
-
return
|
1654
|
+
return scopeId;
|
915
1655
|
};
|
916
|
-
const
|
917
|
-
const
|
918
|
-
|
919
|
-
|
1656
|
+
const attachStyles = (hostRef) => {
|
1657
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
1658
|
+
const elm = hostRef.$hostElement$;
|
1659
|
+
const flags = cmpMeta.$flags$;
|
1660
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
1661
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
1662
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
1663
|
+
// only required when we're NOT using native shadow dom (slot)
|
1664
|
+
// or this browser doesn't support native shadow dom
|
1665
|
+
// and this host element was NOT created with SSR
|
1666
|
+
// let's pick out the inner content for slot projection
|
1667
|
+
// create a node to represent where the original
|
1668
|
+
// content was first placed, which is useful later on
|
1669
|
+
// DOM WRITE!!
|
1670
|
+
elm['s-sc'] = scopeId;
|
1671
|
+
elm.classList.add(scopeId + '-h');
|
1672
|
+
if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
1673
|
+
elm.classList.add(scopeId + '-s');
|
1674
|
+
}
|
920
1675
|
}
|
921
|
-
|
1676
|
+
endAttachStyles();
|
922
1677
|
};
|
923
|
-
const
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
1678
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
1679
|
+
const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
|
1680
|
+
/**
|
1681
|
+
* Production setAccessor() function based on Preact by
|
1682
|
+
* Jason Miller (@developit)
|
1683
|
+
* Licensed under the MIT License
|
1684
|
+
* https://github.com/developit/preact/blob/master/LICENSE
|
1685
|
+
*
|
1686
|
+
* Modified for Stencil's compiler and vdom
|
1687
|
+
*/
|
1688
|
+
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
1689
|
+
if (oldValue !== newValue) {
|
1690
|
+
let isProp = isMemberInElement(elm, memberName);
|
1691
|
+
let ln = memberName.toLowerCase();
|
1692
|
+
if (memberName === 'class') {
|
1693
|
+
const classList = elm.classList;
|
1694
|
+
const oldClasses = parseClassList(oldValue);
|
1695
|
+
const newClasses = parseClassList(newValue);
|
1696
|
+
// for `scoped: true` components, new nodes after initial hydration
|
1697
|
+
// from SSR don't have the slotted class added. Let's add that now
|
1698
|
+
if (elm['s-si'] && newClasses.indexOf(elm['s-si']) < 0) {
|
1699
|
+
newClasses.push(elm['s-si']);
|
1700
|
+
}
|
1701
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
1702
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
931
1703
|
}
|
932
|
-
if (
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
1704
|
+
else if (memberName === 'style') {
|
1705
|
+
// update style attribute, css properties and values
|
1706
|
+
{
|
1707
|
+
for (const prop in oldValue) {
|
1708
|
+
if (!newValue || newValue[prop] == null) {
|
1709
|
+
if (prop.includes('-')) {
|
1710
|
+
elm.style.removeProperty(prop);
|
1711
|
+
}
|
1712
|
+
else {
|
1713
|
+
elm.style[prop] = '';
|
1714
|
+
}
|
1715
|
+
}
|
1716
|
+
}
|
1717
|
+
}
|
1718
|
+
for (const prop in newValue) {
|
1719
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
1720
|
+
if (prop.includes('-')) {
|
1721
|
+
elm.style.setProperty(prop, newValue[prop]);
|
1722
|
+
}
|
1723
|
+
else {
|
1724
|
+
elm.style[prop] = newValue[prop];
|
1725
|
+
}
|
1726
|
+
}
|
1727
|
+
}
|
937
1728
|
}
|
938
|
-
else if (
|
939
|
-
|
940
|
-
|
941
|
-
|
1729
|
+
else if (memberName === 'key')
|
1730
|
+
;
|
1731
|
+
else if (memberName === 'ref') {
|
1732
|
+
// minifier will clean this up
|
1733
|
+
if (newValue) {
|
1734
|
+
newValue(elm);
|
1735
|
+
}
|
1736
|
+
}
|
1737
|
+
else if ((!isProp ) &&
|
1738
|
+
memberName[0] === 'o' &&
|
1739
|
+
memberName[1] === 'n') {
|
1740
|
+
// Event Handlers
|
1741
|
+
// so if the member name starts with "on" and the 3rd characters is
|
1742
|
+
// a capital letter, and it's not already a member on the element,
|
1743
|
+
// then we're assuming it's an event listener
|
1744
|
+
if (memberName[2] === '-') {
|
1745
|
+
// on- prefixed events
|
1746
|
+
// allows to be explicit about the dom event to listen without any magic
|
1747
|
+
// under the hood:
|
1748
|
+
// <my-cmp on-click> // listens for "click"
|
1749
|
+
// <my-cmp on-Click> // listens for "Click"
|
1750
|
+
// <my-cmp on-ionChange> // listens for "ionChange"
|
1751
|
+
// <my-cmp on-EVENTS> // listens for "EVENTS"
|
1752
|
+
memberName = memberName.slice(3);
|
1753
|
+
}
|
1754
|
+
else if (isMemberInElement(win, ln)) {
|
1755
|
+
// standard event
|
1756
|
+
// the JSX attribute could have been "onMouseOver" and the
|
1757
|
+
// member name "onmouseover" is on the window's prototype
|
1758
|
+
// so let's add the listener "mouseover", which is all lowercased
|
1759
|
+
memberName = ln.slice(2);
|
1760
|
+
}
|
1761
|
+
else {
|
1762
|
+
// custom event
|
1763
|
+
// the JSX attribute could have been "onMyCustomEvent"
|
1764
|
+
// so let's trim off the "on" prefix and lowercase the first character
|
1765
|
+
// and add the listener "myCustomEvent"
|
1766
|
+
// except for the first character, we keep the event name case
|
1767
|
+
memberName = ln[2] + memberName.slice(3);
|
1768
|
+
}
|
1769
|
+
if (oldValue) {
|
1770
|
+
plt.rel(elm, memberName, oldValue, false);
|
942
1771
|
}
|
943
|
-
|
944
|
-
|
1772
|
+
if (newValue) {
|
1773
|
+
plt.ael(elm, memberName, newValue, false);
|
945
1774
|
}
|
946
1775
|
}
|
947
|
-
|
948
|
-
|
949
|
-
const
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
// then hide it if there are other slots in the light dom
|
965
|
-
renderSlotFallbackContent(childNode, false);
|
966
|
-
for (j = 0; j < ilen; j++) {
|
967
|
-
nodeType = childNodes[j].nodeType;
|
968
|
-
if (childNodes[j]['s-sf'])
|
969
|
-
continue;
|
970
|
-
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
971
|
-
// this sibling node is from a different component OR is a named fallback slot node
|
972
|
-
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j]['s-sn']) {
|
973
|
-
renderSlotFallbackContent(childNode, true);
|
974
|
-
patchNodeRemove(childNodes[j]);
|
975
|
-
break;
|
1776
|
+
else {
|
1777
|
+
// Set property if it exists and it's not a SVG
|
1778
|
+
const isComplex = isComplexType(newValue);
|
1779
|
+
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
1780
|
+
try {
|
1781
|
+
if (!elm.tagName.includes('-')) {
|
1782
|
+
const n = newValue == null ? '' : newValue;
|
1783
|
+
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
1784
|
+
if (memberName === 'list') {
|
1785
|
+
isProp = false;
|
1786
|
+
}
|
1787
|
+
else if (oldValue == null || elm[memberName] != n) {
|
1788
|
+
elm[memberName] = n;
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
else {
|
1792
|
+
elm[memberName] = newValue;
|
976
1793
|
}
|
977
1794
|
}
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
1795
|
+
catch (e) { }
|
1796
|
+
}
|
1797
|
+
/**
|
1798
|
+
* Need to manually update attribute if:
|
1799
|
+
* - memberName is not an attribute
|
1800
|
+
* - if we are rendering the host element in order to reflect attribute
|
1801
|
+
* - if it's a SVG, since properties might not work in <svg>
|
1802
|
+
* - if the newValue is null/undefined or 'false'.
|
1803
|
+
*/
|
1804
|
+
let xlink = false;
|
1805
|
+
{
|
1806
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
1807
|
+
memberName = ln;
|
1808
|
+
xlink = true;
|
1809
|
+
}
|
1810
|
+
}
|
1811
|
+
if (newValue == null || newValue === false) {
|
1812
|
+
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
1813
|
+
if (xlink) {
|
1814
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
1815
|
+
}
|
1816
|
+
else {
|
1817
|
+
elm.removeAttribute(memberName);
|
990
1818
|
}
|
991
1819
|
}
|
992
1820
|
}
|
1821
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
1822
|
+
newValue = newValue === true ? '' : newValue;
|
1823
|
+
if (xlink) {
|
1824
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
1825
|
+
}
|
1826
|
+
else {
|
1827
|
+
elm.setAttribute(memberName, newValue);
|
1828
|
+
}
|
1829
|
+
}
|
993
1830
|
}
|
994
|
-
|
995
|
-
|
1831
|
+
}
|
1832
|
+
};
|
1833
|
+
const parseClassListRegex = /\s/;
|
1834
|
+
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
1835
|
+
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
1836
|
+
// if the element passed in is a shadow root, which is a document fragment
|
1837
|
+
// then we want to be adding attrs/props to the shadow root's "host" element
|
1838
|
+
// if it's not a shadow root, then we add attrs/props to the same element
|
1839
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
1840
|
+
? newVnode.$elm$.host
|
1841
|
+
: newVnode.$elm$;
|
1842
|
+
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
1843
|
+
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
1844
|
+
{
|
1845
|
+
// remove attributes no longer present on the vnode by setting them to undefined
|
1846
|
+
for (memberName in oldVnodeAttrs) {
|
1847
|
+
if (!(memberName in newVnodeAttrs)) {
|
1848
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
}
|
1852
|
+
// add new & update changed attributes
|
1853
|
+
for (memberName in newVnodeAttrs) {
|
1854
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
996
1855
|
}
|
997
1856
|
};
|
998
1857
|
/**
|
@@ -1069,30 +1928,41 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
1069
1928
|
elm['s-cr'] = contentRef;
|
1070
1929
|
// remember the slot name, or empty string for default slot
|
1071
1930
|
elm['s-sn'] = newVNode.$name$ || '';
|
1072
|
-
if
|
1931
|
+
// if this slot is nested within another parent slot, add that slot's name.
|
1932
|
+
// (used in 'renderSlotFallbackContent')
|
1933
|
+
if (newParentVNode.$name$) {
|
1073
1934
|
elm['s-psn'] = newParentVNode.$name$;
|
1935
|
+
}
|
1074
1936
|
if (newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */) {
|
1075
1937
|
if (newVNode.$children$) {
|
1938
|
+
// this slot has fallback nodes
|
1076
1939
|
for (i = 0; i < newVNode.$children$.length; ++i) {
|
1077
1940
|
// create the node
|
1078
|
-
let containerElm = elm.nodeType === 1 ? elm : parentElm;
|
1079
|
-
while (containerElm.nodeType !== 1) {
|
1941
|
+
let containerElm = elm.nodeType === 1 /* NODE_TYPE.ElementNode */ ? elm : parentElm;
|
1942
|
+
while (containerElm.nodeType !== 1 /* NODE_TYPE.ElementNode */) {
|
1080
1943
|
containerElm = containerElm.parentNode;
|
1081
1944
|
}
|
1082
1945
|
childNode = createElm(oldParentVNode, newVNode, i, containerElm);
|
1946
|
+
// add new node meta.
|
1947
|
+
// slot has fallback and childnode is slot fallback
|
1083
1948
|
childNode['s-sf'] = elm['s-hsf'] = true;
|
1084
|
-
if (typeof childNode['s-sn'] === 'undefined')
|
1949
|
+
if (typeof childNode['s-sn'] === 'undefined') {
|
1085
1950
|
childNode['s-sn'] = newVNode.$name$ || '';
|
1951
|
+
}
|
1086
1952
|
if (childNode.nodeType === 3 /* NODE_TYPE.TextNode */) {
|
1087
1953
|
childNode['s-sfc'] = childNode.textContent;
|
1088
1954
|
}
|
1089
|
-
//
|
1090
|
-
|
1955
|
+
// make sure a node was created
|
1956
|
+
// and we don't have a node already present
|
1957
|
+
// (if a node is already attached, we'll just patch it)
|
1958
|
+
if (childNode && (!oldParentVNode || !oldParentVNode.$children$)) {
|
1091
1959
|
// append our new node
|
1092
|
-
containerElm.
|
1960
|
+
containerElm.appendChild(childNode);
|
1093
1961
|
}
|
1094
1962
|
}
|
1095
1963
|
}
|
1964
|
+
if (oldParentVNode && oldParentVNode.$children$)
|
1965
|
+
patch(oldParentVNode, newVNode);
|
1096
1966
|
}
|
1097
1967
|
// check if we've got an old vnode for this slot
|
1098
1968
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
@@ -1459,7 +2329,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
1459
2329
|
fbSlotsIdx = fbSlots.length - 1;
|
1460
2330
|
for (i = 0; i <= fbSlotsIdx; ++i) {
|
1461
2331
|
fbSlot = fbSlots[i];
|
1462
|
-
if (
|
2332
|
+
if (typeof fbNodes[fbSlot['s-sn']] === 'undefined')
|
1463
2333
|
continue;
|
1464
2334
|
fbNodesIdx = fbNodes[fbSlot['s-sn']].length - 1;
|
1465
2335
|
for (j = 0; j <= fbNodesIdx; ++j) {
|
@@ -1720,13 +2590,14 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
1720
2590
|
// by default we're just going to insert it directly
|
1721
2591
|
// after the slot reference node
|
1722
2592
|
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
1723
|
-
insertBeforeNode =
|
2593
|
+
insertBeforeNode =
|
2594
|
+
relocateData.$slotRefNode$.__nextSibling || relocateData.$slotRefNode$.nextSibling;
|
1724
2595
|
orgLocationNode = nodeToRelocate['s-ol'];
|
1725
2596
|
ogInsertBeforeNode = insertBeforeNode;
|
1726
|
-
while ((orgLocationNode = orgLocationNode.previousSibling)) {
|
2597
|
+
while ((orgLocationNode = (orgLocationNode.__previousSibling || orgLocationNode.previousSibling))) {
|
1727
2598
|
refNode = orgLocationNode['s-nr'];
|
1728
2599
|
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
1729
|
-
refNode = refNode.nextSibling;
|
2600
|
+
refNode = refNode.__nextSibling || refNode.nextSibling;
|
1730
2601
|
if (!refNode || !refNode['s-nr']) {
|
1731
2602
|
insertBeforeNode = refNode;
|
1732
2603
|
break;
|
@@ -1734,7 +2605,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
1734
2605
|
}
|
1735
2606
|
}
|
1736
2607
|
if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
|
1737
|
-
nodeToRelocate.nextSibling !== insertBeforeNode) {
|
2608
|
+
(nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling) !== insertBeforeNode) {
|
1738
2609
|
// we've checked that it's worth while to relocate
|
1739
2610
|
// since that the node to relocate
|
1740
2611
|
// has a different next sibling or parent relocated
|
@@ -2272,7 +3143,22 @@ const connectedCallback = (elm) => {
|
|
2272
3143
|
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
2273
3144
|
// first time this component has connected
|
2274
3145
|
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
3146
|
+
let hostId;
|
2275
3147
|
{
|
3148
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
3149
|
+
if (hostId) {
|
3150
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
3151
|
+
const scopeId = addStyle(elm.shadowRoot, cmpMeta);
|
3152
|
+
elm.classList.remove(scopeId + '-h', scopeId + '-s');
|
3153
|
+
}
|
3154
|
+
else if (cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
|
3155
|
+
let scopeId = getScopeId(cmpMeta);
|
3156
|
+
elm['s-sc'] = scopeId;
|
3157
|
+
}
|
3158
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
3159
|
+
}
|
3160
|
+
}
|
3161
|
+
if (!hostId) {
|
2276
3162
|
// initUpdate
|
2277
3163
|
// if the slot polyfill is required we'll need to put some nodes
|
2278
3164
|
// in here to act as original content anchors as we move nodes around
|
@@ -2288,7 +3174,10 @@ const connectedCallback = (elm) => {
|
|
2288
3174
|
while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
2289
3175
|
// climb up the ancestors looking for the first
|
2290
3176
|
// component that hasn't finished its lifecycle update yet
|
2291
|
-
if (ancestorComponent
|
3177
|
+
if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
|
3178
|
+
ancestorComponent.hasAttribute('s-id') &&
|
3179
|
+
ancestorComponent['s-p']) ||
|
3180
|
+
ancestorComponent['s-p']) {
|
2292
3181
|
// we found this components first ancestor component
|
2293
3182
|
// keep a reference to this component's ancestor component
|
2294
3183
|
attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
|
@@ -2352,6 +3241,7 @@ const disconnectedCallback = (elm) => {
|
|
2352
3241
|
}
|
2353
3242
|
};
|
2354
3243
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
3244
|
+
var _a;
|
2355
3245
|
const endBootstrap = createTime();
|
2356
3246
|
const cmpTags = [];
|
2357
3247
|
const exclude = options.exclude || [];
|
@@ -2360,10 +3250,16 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2360
3250
|
const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
|
2361
3251
|
const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
|
2362
3252
|
const deferredConnectedCallbacks = [];
|
3253
|
+
const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
2363
3254
|
let appLoadFallback;
|
2364
3255
|
let isBootstrapping = true;
|
2365
3256
|
Object.assign(plt, options);
|
2366
3257
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
3258
|
+
{
|
3259
|
+
// If the app is already hydrated there is not point to disable the
|
3260
|
+
// async queue. This will improve the first input delay
|
3261
|
+
plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
|
3262
|
+
}
|
2367
3263
|
lazyBundles.map((lazyBundle) => {
|
2368
3264
|
lazyBundle[1].map((compactMeta) => {
|
2369
3265
|
const cmpMeta = {
|
@@ -2393,6 +3289,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2393
3289
|
// @ts-ignore
|
2394
3290
|
super(self);
|
2395
3291
|
self = this;
|
3292
|
+
{
|
3293
|
+
const scopeId = getScopeId(cmpMeta, computeMode(self));
|
3294
|
+
const style = Array.from(styles).find((style) => style.getAttribute(HYDRATED_STYLE_ID) === scopeId);
|
3295
|
+
if (style) {
|
3296
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
3297
|
+
registerStyle(scopeId, convertScopedToShadow(style.innerHTML), true);
|
3298
|
+
}
|
3299
|
+
else {
|
3300
|
+
registerStyle(scopeId, style.innerHTML, false);
|
3301
|
+
}
|
3302
|
+
}
|
3303
|
+
}
|
2396
3304
|
registerHost(self, cmpMeta);
|
2397
3305
|
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
2398
3306
|
// this component is using shadow dom
|
@@ -2443,6 +3351,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2443
3351
|
{
|
2444
3352
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
2445
3353
|
visibilityStyle.setAttribute('data-styles', '');
|
3354
|
+
// Apply CSP nonce to the style tag if it exists
|
3355
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
3356
|
+
if (nonce != null) {
|
3357
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
3358
|
+
}
|
2446
3359
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
2447
3360
|
}
|
2448
3361
|
// Process deferred connectedCallbacks now all components have been registered
|
@@ -2495,6 +3408,13 @@ const getHostListenerTarget = (elm, flags) => {
|
|
2495
3408
|
};
|
2496
3409
|
// prettier-ignore
|
2497
3410
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
3411
|
+
/**
|
3412
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
3413
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
3414
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
3415
|
+
* @returns void
|
3416
|
+
*/
|
3417
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
2498
3418
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
2499
3419
|
const getHostRef = (ref) => hostRefs.get(ref);
|
2500
3420
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
@@ -2720,6 +3640,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
2720
3640
|
});
|
2721
3641
|
};
|
2722
3642
|
const styles = /*@__PURE__*/ new Map();
|
3643
|
+
const modeResolutionChain = [];
|
2723
3644
|
const win = typeof window !== 'undefined' ? window : {};
|
2724
3645
|
const doc = win.document || { head: {} };
|
2725
3646
|
const H = (win.HTMLElement || class {
|
@@ -2802,6 +3723,7 @@ exports.h = h;
|
|
2802
3723
|
exports.promiseResolve = promiseResolve;
|
2803
3724
|
exports.readTask = readTask;
|
2804
3725
|
exports.registerInstance = registerInstance;
|
3726
|
+
exports.setNonce = setNonce;
|
2805
3727
|
exports.writeTask = writeTask;
|
2806
3728
|
|
2807
|
-
//# sourceMappingURL=index-
|
3729
|
+
//# sourceMappingURL=index-e1b5c3ea.js.map
|