govuk_publishing_components 17.21.0 → 18.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/all_components.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +1 -1
- data/app/assets/stylesheets/component_guide/application.scss +5 -7
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +3 -15
- data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +28 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +1 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +18 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +6 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +8 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +6 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +10 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +17 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +8 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +5 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +4 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +1 -1
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +14 -12
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_button.html.erb +16 -2
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +5 -1
- data/app/views/govuk_publishing_components/components/_details.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_title.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/contents_list.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/fieldset.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/label.yml +4 -1
- data/app/views/govuk_publishing_components/components/docs/table.yml +1 -0
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +2 -2
- data/config/initializers/assets.rb +3 -3
- data/config/locales/en.yml +0 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/README.md +4 -9
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +4 -5
- data/node_modules/govuk-frontend/{all-ie8.scss → govuk/all-ie8.scss} +0 -0
- data/node_modules/govuk-frontend/{all.js → govuk/all.js} +116 -63
- data/node_modules/govuk-frontend/{all.scss → govuk/all.scss} +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/bold-affa96571d-v2.woff +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-crest-2x.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-crest.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-logotype-crown.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-mask-icon.svg +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/{common.js → govuk/common.js} +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/_accordion.scss +48 -28
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/accordion.js +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/macro-options.json +8 -2
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/template.njk +1 -3
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/_back-link.scss +17 -9
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/_breadcrumbs.scss +10 -11
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/button/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/button/_button.scss +76 -46
- data/node_modules/govuk-frontend/{components → govuk/components}/button/button.js +168 -17
- data/node_modules/govuk-frontend/{components → govuk/components}/button/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/button/macro.njk +0 -0
- data/node_modules/govuk-frontend/govuk/components/button/template.njk +60 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/_character-count.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/character-count.js +5 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/template.njk +2 -2
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/_checkboxes.scss +4 -6
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/checkboxes.js +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/template.njk +18 -5
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/_date-input.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/details/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/_details.scss +12 -13
- data/node_modules/govuk-frontend/{components → govuk/components}/details/details.js +3 -4
- data/node_modules/govuk-frontend/{components → govuk/components}/details/implementation.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/_error-message.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/_error-summary.scss +4 -17
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/error-summary.js +0 -10
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/_fieldset.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/macro-options.json +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +81 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/_footer.scss +47 -16
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/macro-options.json +5 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/header/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/header/_header.scss +34 -21
- data/node_modules/govuk-frontend/{components → govuk/components}/header/header.js +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/header/macro-options.json +2 -2
- data/node_modules/govuk-frontend/{components → govuk/components}/header/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/header/template.njk +6 -9
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/_hint.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/_input.scss +24 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/input/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/_inset-text.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/_label.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/_panel.scss +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/_phase-banner.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/template.njk +5 -7
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/_radios.scss +7 -9
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/radios.js +24 -11
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/template.njk +15 -5
- data/node_modules/govuk-frontend/{components → govuk/components}/select/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/select/_select.scss +23 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/select/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/select/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/select/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/_skip-link.scss +6 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/_summary-list.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/macro-options.json +7 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/table/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/_table.scss +1 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/template.njk +14 -14
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +142 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/tabs.js +59 -5
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/template.njk +4 -6
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +44 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +55 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/_warning-text.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/template.njk +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_global-styles.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_links.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_lists.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_section-break.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_template.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_typography.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_all.scss +1 -1
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_clearfix.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_colour.scss +23 -1
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_device-pixels.scss +0 -0
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +28 -0
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
- data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +60 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_links.scss +15 -1
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_media-queries.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_shape-arrow.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_spacing.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_typography.scss +23 -5
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_visually-hidden.scss +4 -2
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_form-group.scss +0 -0
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_grid.scss +2 -2
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_main-wrapper.scss +15 -1
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_width-container.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_display.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_spacing.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_typography.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_width.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_assets.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_colours-applied.scss +9 -8
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_colours-organisations.scss +1 -1
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +101 -0
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +75 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_global-styles.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_ie8.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_measurements.scss +2 -2
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_media-queries.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_spacing.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-font-families.scss +11 -1
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-font.scss +27 -7
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-responsive.scss +9 -10
- data/node_modules/govuk-frontend/{template.njk → govuk/template.njk} +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_compatibility.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_exports.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_font-url.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_ie8.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_iff.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_image-url.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_px-to-em.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_px-to-rem.scss +0 -0
- data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_clearfix.scss +0 -0
- data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_visually-hidden.scss +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/_sass-mq.scss +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/DOMTokenList.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Document.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/classList.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/closest.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/matches.js +0 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +259 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +257 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Event.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Function/prototype/bind.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Object/defineProperty.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Window.js +0 -0
- data/node_modules/govuk-frontend/package.json +21 -21
- data/node_modules/react-is/README.md +2 -12
- data/node_modules/react-is/build-info.json +5 -5
- data/node_modules/react-is/cjs/react-is.development.js +7 -2
- data/node_modules/react-is/cjs/react-is.production.min.js +6 -6
- data/node_modules/react-is/package.json +13 -13
- data/node_modules/react-is/umd/react-is.development.js +7 -2
- data/node_modules/react-is/umd/react-is.production.min.js +5 -5
- data/node_modules/type/CHANGELOG.md +62 -50
- data/node_modules/type/LICENSE +15 -0
- data/node_modules/type/README.md +19 -19
- data/node_modules/type/error/is.js +28 -7
- data/node_modules/type/package.json +36 -22
- data/node_modules/type/test/error/is.js +13 -5
- metadata +247 -344
- data/app/assets/javascripts/govuk_publishing_components/components/accessible-autocomplete.js +0 -79
- data/app/assets/stylesheets/govuk_publishing_components/components/_accessible-autocomplete.scss +0 -41
- data/app/views/govuk_publishing_components/components/_accessible_autocomplete.html.erb +0 -35
- data/app/views/govuk_publishing_components/components/docs/accessible_autocomplete.yml +0 -49
- data/node_modules/accessible-autocomplete/CHANGELOG.md +0 -269
- data/node_modules/accessible-autocomplete/CONTRIBUTING.md +0 -150
- data/node_modules/accessible-autocomplete/LICENSE.txt +0 -20
- data/node_modules/accessible-autocomplete/Procfile +0 -1
- data/node_modules/accessible-autocomplete/README.md +0 -416
- data/node_modules/accessible-autocomplete/accessibility-criteria.md +0 -42
- data/node_modules/accessible-autocomplete/app.json +0 -15
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +0 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +0 -2
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +0 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +0 -2
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +0 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +0 -2
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +0 -1
- data/node_modules/accessible-autocomplete/examples/form.html +0 -671
- data/node_modules/accessible-autocomplete/examples/index.html +0 -665
- data/node_modules/accessible-autocomplete/examples/multiselect.html +0 -134
- data/node_modules/accessible-autocomplete/examples/preact/index.html +0 -346
- data/node_modules/accessible-autocomplete/examples/react/index.html +0 -347
- data/node_modules/accessible-autocomplete/package-lock.json +0 -14491
- data/node_modules/accessible-autocomplete/package.json +0 -173
- data/node_modules/accessible-autocomplete/preact.js +0 -1
- data/node_modules/accessible-autocomplete/react.js +0 -1
- data/node_modules/accessible-autocomplete/scripts/check-staged.js +0 -14
- data/node_modules/accessible-autocomplete/src/autocomplete.css +0 -192
- data/node_modules/accessible-autocomplete/src/autocomplete.js +0 -618
- data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +0 -11
- data/node_modules/accessible-autocomplete/src/status.js +0 -80
- data/node_modules/accessible-autocomplete/src/wrapper.js +0 -76
- data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +0 -44
- data/node_modules/accessible-autocomplete/test/functional/index.js +0 -485
- data/node_modules/accessible-autocomplete/test/functional/wrapper.js +0 -318
- data/node_modules/accessible-autocomplete/test/integration/index.js +0 -188
- data/node_modules/accessible-autocomplete/test/karma.config.js +0 -42
- data/node_modules/accessible-autocomplete/test/wdio.config.js +0 -80
- data/node_modules/accessible-autocomplete/webpack.config.babel.js +0 -193
- data/node_modules/govuk-frontend/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-fb2676462a-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-458f8ea81c-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-arrow-left.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-important.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer-2x.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer.png +0 -0
- data/node_modules/govuk-frontend/components/button/template.njk +0 -35
- data/node_modules/govuk-frontend/components/file-upload/_file-upload.scss +0 -19
- data/node_modules/govuk-frontend/components/tabs/_tabs.scss +0 -130
- data/node_modules/govuk-frontend/components/tag/_tag.scss +0 -33
- data/node_modules/govuk-frontend/components/textarea/_textarea.scss +0 -32
- data/node_modules/govuk-frontend/helpers/_focusable.scss +0 -34
- data/node_modules/govuk-frontend/helpers/_font-faces.scss +0 -67
- data/node_modules/govuk-frontend/helpers/_grid.scss +0 -107
- data/node_modules/govuk-frontend/settings/_colours-palette.scss +0 -37
- data/node_modules/govuk-frontend/settings/_compatibility.scss +0 -51
- data/node_modules/preact/LICENSE +0 -21
- data/node_modules/preact/README.md +0 -592
- data/node_modules/preact/debug.js +0 -740
- data/node_modules/preact/debug.js.map +0 -1
- data/node_modules/preact/debug/dist/debug.js +0 -2
- data/node_modules/preact/debug/dist/debug.js.map +0 -1
- data/node_modules/preact/debug/dist/debug.mjs +0 -681
- data/node_modules/preact/debug/dist/debug.mjs.map +0 -1
- data/node_modules/preact/debug/dist/debug.module.js +0 -2
- data/node_modules/preact/debug/dist/debug.module.js.map +0 -1
- data/node_modules/preact/debug/dist/debug.umd.js +0 -2
- data/node_modules/preact/debug/dist/debug.umd.js.map +0 -1
- data/node_modules/preact/debug/index.js +0 -122
- data/node_modules/preact/devtools.js +0 -403
- data/node_modules/preact/devtools.js.map +0 -1
- data/node_modules/preact/devtools/devtools.js +0 -395
- data/node_modules/preact/devtools/index.js +0 -4
- data/node_modules/preact/dist/preact.d.ts +0 -1712
- data/node_modules/preact/dist/preact.dev.js +0 -727
- data/node_modules/preact/dist/preact.dev.js.map +0 -1
- data/node_modules/preact/dist/preact.js +0 -414
- data/node_modules/preact/dist/preact.js.flow +0 -25
- data/node_modules/preact/dist/preact.js.map +0 -1
- data/node_modules/preact/dist/preact.min.js +0 -2
- data/node_modules/preact/dist/preact.min.js.map +0 -1
- data/node_modules/preact/dist/preact.mjs +0 -724
- data/node_modules/preact/dist/preact.mjs.map +0 -1
- data/node_modules/preact/dist/preact.umd.js +0 -751
- data/node_modules/preact/dist/preact.umd.js.map +0 -1
- data/node_modules/preact/package.json +0 -226
- data/node_modules/preact/src/clone-element.js +0 -18
- data/node_modules/preact/src/component.js +0 -90
- data/node_modules/preact/src/constants.js +0 -17
- data/node_modules/preact/src/dom/index.js +0 -139
- data/node_modules/preact/src/h.js +0 -86
- data/node_modules/preact/src/options.js +0 -22
- data/node_modules/preact/src/preact.d.ts +0 -1712
- data/node_modules/preact/src/preact.js +0 -32
- data/node_modules/preact/src/preact.js.flow +0 -25
- data/node_modules/preact/src/render-queue.js +0 -27
- data/node_modules/preact/src/render.js +0 -22
- data/node_modules/preact/src/util.js +0 -30
- data/node_modules/preact/src/vdom/component-recycler.js +0 -48
- data/node_modules/preact/src/vdom/component.js +0 -296
- data/node_modules/preact/src/vdom/diff.js +0 -337
- data/node_modules/preact/src/vdom/index.js +0 -54
- data/node_modules/preact/src/vnode.js +0 -9
- data/node_modules/preact/typings.json +0 -5
@@ -1,337 +0,0 @@
|
|
1
|
-
import { ATTR_KEY } from '../constants';
|
2
|
-
import { isSameNodeType, isNamedNode } from './index';
|
3
|
-
import { buildComponentFromVNode } from './component';
|
4
|
-
import { createNode, setAccessor } from '../dom/index';
|
5
|
-
import { unmountComponent } from './component';
|
6
|
-
import options from '../options';
|
7
|
-
import { applyRef } from '../util';
|
8
|
-
import { removeNode } from '../dom/index';
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Queue of components that have been mounted and are awaiting componentDidMount
|
12
|
-
* @type {Array<import('../component').Component>}
|
13
|
-
*/
|
14
|
-
export const mounts = [];
|
15
|
-
|
16
|
-
/** Diff recursion count, used to track the end of the diff cycle. */
|
17
|
-
export let diffLevel = 0;
|
18
|
-
|
19
|
-
/** Global flag indicating if the diff is currently within an SVG */
|
20
|
-
let isSvgMode = false;
|
21
|
-
|
22
|
-
/** Global flag indicating if the diff is performing hydration */
|
23
|
-
let hydrating = false;
|
24
|
-
|
25
|
-
/** Invoke queued componentDidMount lifecycle methods */
|
26
|
-
export function flushMounts() {
|
27
|
-
let c;
|
28
|
-
while ((c = mounts.shift())) {
|
29
|
-
if (options.afterMount) options.afterMount(c);
|
30
|
-
if (c.componentDidMount) c.componentDidMount();
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
/**
|
36
|
-
* Apply differences in a given vnode (and it's deep children) to a real DOM Node.
|
37
|
-
* @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`
|
38
|
-
* @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing
|
39
|
-
* the desired DOM structure
|
40
|
-
* @param {object} context The current context
|
41
|
-
* @param {boolean} mountAll Whether or not to immediately mount all components
|
42
|
-
* @param {Element} parent ?
|
43
|
-
* @param {boolean} componentRoot ?
|
44
|
-
* @returns {import('../dom').PreactElement} The created/mutated element
|
45
|
-
* @private
|
46
|
-
*/
|
47
|
-
export function diff(dom, vnode, context, mountAll, parent, componentRoot) {
|
48
|
-
// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)
|
49
|
-
if (!diffLevel++) {
|
50
|
-
// when first starting the diff, check if we're diffing an SVG or within an SVG
|
51
|
-
isSvgMode = parent!=null && parent.ownerSVGElement!==undefined;
|
52
|
-
|
53
|
-
// hydration is indicated by the existing element to be diffed not having a prop cache
|
54
|
-
hydrating = dom!=null && !(ATTR_KEY in dom);
|
55
|
-
}
|
56
|
-
|
57
|
-
let ret = idiff(dom, vnode, context, mountAll, componentRoot);
|
58
|
-
|
59
|
-
// append the element if its a new parent
|
60
|
-
if (parent && ret.parentNode!==parent) parent.appendChild(ret);
|
61
|
-
|
62
|
-
// diffLevel being reduced to 0 means we're exiting the diff
|
63
|
-
if (!--diffLevel) {
|
64
|
-
hydrating = false;
|
65
|
-
// invoke queued componentDidMount lifecycle methods
|
66
|
-
if (!componentRoot) flushMounts();
|
67
|
-
}
|
68
|
-
|
69
|
-
return ret;
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing.
|
75
|
-
* @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`
|
76
|
-
* @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure
|
77
|
-
* @param {object} context The current context
|
78
|
-
* @param {boolean} mountAll Whether or not to immediately mount all components
|
79
|
-
* @param {boolean} [componentRoot] ?
|
80
|
-
* @private
|
81
|
-
*/
|
82
|
-
function idiff(dom, vnode, context, mountAll, componentRoot) {
|
83
|
-
let out = dom,
|
84
|
-
prevSvgMode = isSvgMode;
|
85
|
-
|
86
|
-
// empty values (null, undefined, booleans) render as empty Text nodes
|
87
|
-
if (vnode==null || typeof vnode==='boolean') vnode = '';
|
88
|
-
|
89
|
-
|
90
|
-
// Fast case: Strings & Numbers create/update Text nodes.
|
91
|
-
if (typeof vnode==='string' || typeof vnode==='number') {
|
92
|
-
|
93
|
-
// update if it's already a Text node:
|
94
|
-
if (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {
|
95
|
-
/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */
|
96
|
-
if (dom.nodeValue!=vnode) {
|
97
|
-
dom.nodeValue = vnode;
|
98
|
-
}
|
99
|
-
}
|
100
|
-
else {
|
101
|
-
// it wasn't a Text node: replace it with one and recycle the old Element
|
102
|
-
out = document.createTextNode(vnode);
|
103
|
-
if (dom) {
|
104
|
-
if (dom.parentNode) dom.parentNode.replaceChild(out, dom);
|
105
|
-
recollectNodeTree(dom, true);
|
106
|
-
}
|
107
|
-
}
|
108
|
-
|
109
|
-
out[ATTR_KEY] = true;
|
110
|
-
|
111
|
-
return out;
|
112
|
-
}
|
113
|
-
|
114
|
-
|
115
|
-
// If the VNode represents a Component, perform a component diff:
|
116
|
-
let vnodeName = vnode.nodeName;
|
117
|
-
if (typeof vnodeName==='function') {
|
118
|
-
return buildComponentFromVNode(dom, vnode, context, mountAll);
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
// Tracks entering and exiting SVG namespace when descending through the tree.
|
123
|
-
isSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode;
|
124
|
-
|
125
|
-
|
126
|
-
// If there's no existing element or it's the wrong type, create a new one:
|
127
|
-
vnodeName = String(vnodeName);
|
128
|
-
if (!dom || !isNamedNode(dom, vnodeName)) {
|
129
|
-
out = createNode(vnodeName, isSvgMode);
|
130
|
-
|
131
|
-
if (dom) {
|
132
|
-
// move children into the replacement node
|
133
|
-
while (dom.firstChild) out.appendChild(dom.firstChild);
|
134
|
-
|
135
|
-
// if the previous Element was mounted into the DOM, replace it inline
|
136
|
-
if (dom.parentNode) dom.parentNode.replaceChild(out, dom);
|
137
|
-
|
138
|
-
// recycle the old element (skips non-Element node types)
|
139
|
-
recollectNodeTree(dom, true);
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
let fc = out.firstChild,
|
145
|
-
props = out[ATTR_KEY],
|
146
|
-
vchildren = vnode.children;
|
147
|
-
|
148
|
-
if (props==null) {
|
149
|
-
props = out[ATTR_KEY] = {};
|
150
|
-
for (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value;
|
151
|
-
}
|
152
|
-
|
153
|
-
// Optimization: fast-path for elements containing a single TextNode:
|
154
|
-
if (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {
|
155
|
-
if (fc.nodeValue!=vchildren[0]) {
|
156
|
-
fc.nodeValue = vchildren[0];
|
157
|
-
}
|
158
|
-
}
|
159
|
-
// otherwise, if there are existing or new children, diff them:
|
160
|
-
else if (vchildren && vchildren.length || fc!=null) {
|
161
|
-
innerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null);
|
162
|
-
}
|
163
|
-
|
164
|
-
|
165
|
-
// Apply attributes/props from VNode to the DOM Element:
|
166
|
-
diffAttributes(out, vnode.attributes, props);
|
167
|
-
|
168
|
-
|
169
|
-
// restore previous SVG mode: (in case we're exiting an SVG namespace)
|
170
|
-
isSvgMode = prevSvgMode;
|
171
|
-
|
172
|
-
return out;
|
173
|
-
}
|
174
|
-
|
175
|
-
|
176
|
-
/**
|
177
|
-
* Apply child and attribute changes between a VNode and a DOM Node to the DOM.
|
178
|
-
* @param {import('../dom').PreactElement} dom Element whose children should be compared & mutated
|
179
|
-
* @param {Array<import('../vnode').VNode>} vchildren Array of VNodes to compare to `dom.childNodes`
|
180
|
-
* @param {object} context Implicitly descendant context object (from most
|
181
|
-
* recent `getChildContext()`)
|
182
|
-
* @param {boolean} mountAll Whether or not to immediately mount all components
|
183
|
-
* @param {boolean} isHydrating if `true`, consumes externally created elements
|
184
|
-
* similar to hydration
|
185
|
-
*/
|
186
|
-
function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {
|
187
|
-
let originalChildren = dom.childNodes,
|
188
|
-
children = [],
|
189
|
-
keyed = {},
|
190
|
-
keyedLen = 0,
|
191
|
-
min = 0,
|
192
|
-
len = originalChildren.length,
|
193
|
-
childrenLen = 0,
|
194
|
-
vlen = vchildren ? vchildren.length : 0,
|
195
|
-
j, c, f, vchild, child;
|
196
|
-
|
197
|
-
// Build up a map of keyed children and an Array of unkeyed children:
|
198
|
-
if (len!==0) {
|
199
|
-
for (let i=0; i<len; i++) {
|
200
|
-
let child = originalChildren[i],
|
201
|
-
props = child[ATTR_KEY],
|
202
|
-
key = vlen && props ? child._component ? child._component.__key : props.key : null;
|
203
|
-
if (key!=null) {
|
204
|
-
keyedLen++;
|
205
|
-
keyed[key] = child;
|
206
|
-
}
|
207
|
-
else if (props || (child.splitText!==undefined ? (isHydrating ? child.nodeValue.trim() : true) : isHydrating)) {
|
208
|
-
children[childrenLen++] = child;
|
209
|
-
}
|
210
|
-
}
|
211
|
-
}
|
212
|
-
|
213
|
-
if (vlen!==0) {
|
214
|
-
for (let i=0; i<vlen; i++) {
|
215
|
-
vchild = vchildren[i];
|
216
|
-
child = null;
|
217
|
-
|
218
|
-
// attempt to find a node based on key matching
|
219
|
-
let key = vchild.key;
|
220
|
-
if (key!=null) {
|
221
|
-
if (keyedLen && keyed[key]!==undefined) {
|
222
|
-
child = keyed[key];
|
223
|
-
keyed[key] = undefined;
|
224
|
-
keyedLen--;
|
225
|
-
}
|
226
|
-
}
|
227
|
-
// attempt to pluck a node of the same type from the existing children
|
228
|
-
else if (min<childrenLen) {
|
229
|
-
for (j=min; j<childrenLen; j++) {
|
230
|
-
if (children[j]!==undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {
|
231
|
-
child = c;
|
232
|
-
children[j] = undefined;
|
233
|
-
if (j===childrenLen-1) childrenLen--;
|
234
|
-
if (j===min) min++;
|
235
|
-
break;
|
236
|
-
}
|
237
|
-
}
|
238
|
-
}
|
239
|
-
|
240
|
-
// morph the matched/found/created DOM child to match vchild (deep)
|
241
|
-
child = idiff(child, vchild, context, mountAll);
|
242
|
-
|
243
|
-
f = originalChildren[i];
|
244
|
-
if (child && child!==dom && child!==f) {
|
245
|
-
if (f==null) {
|
246
|
-
dom.appendChild(child);
|
247
|
-
}
|
248
|
-
else if (child===f.nextSibling) {
|
249
|
-
removeNode(f);
|
250
|
-
}
|
251
|
-
else {
|
252
|
-
dom.insertBefore(child, f);
|
253
|
-
}
|
254
|
-
}
|
255
|
-
}
|
256
|
-
}
|
257
|
-
|
258
|
-
|
259
|
-
// remove unused keyed children:
|
260
|
-
if (keyedLen) {
|
261
|
-
for (let i in keyed) if (keyed[i]!==undefined) recollectNodeTree(keyed[i], false);
|
262
|
-
}
|
263
|
-
|
264
|
-
// remove orphaned unkeyed children:
|
265
|
-
while (min<=childrenLen) {
|
266
|
-
if ((child = children[childrenLen--])!==undefined) recollectNodeTree(child, false);
|
267
|
-
}
|
268
|
-
}
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
/**
|
273
|
-
* Recursively recycle (or just unmount) a node and its descendants.
|
274
|
-
* @param {import('../dom').PreactElement} node DOM node to start
|
275
|
-
* unmount/removal from
|
276
|
-
* @param {boolean} [unmountOnly=false] If `true`, only triggers unmount
|
277
|
-
* lifecycle, skips removal
|
278
|
-
*/
|
279
|
-
export function recollectNodeTree(node, unmountOnly) {
|
280
|
-
let component = node._component;
|
281
|
-
if (component) {
|
282
|
-
// if node is owned by a Component, unmount that component (ends up recursing back here)
|
283
|
-
unmountComponent(component);
|
284
|
-
}
|
285
|
-
else {
|
286
|
-
// If the node's VNode had a ref function, invoke it with null here.
|
287
|
-
// (this is part of the React spec, and smart for unsetting references)
|
288
|
-
if (node[ATTR_KEY]!=null) applyRef(node[ATTR_KEY].ref, null);
|
289
|
-
|
290
|
-
if (unmountOnly===false || node[ATTR_KEY]==null) {
|
291
|
-
removeNode(node);
|
292
|
-
}
|
293
|
-
|
294
|
-
removeChildren(node);
|
295
|
-
}
|
296
|
-
}
|
297
|
-
|
298
|
-
|
299
|
-
/**
|
300
|
-
* Recollect/unmount all children.
|
301
|
-
* - we use .lastChild here because it causes less reflow than .firstChild
|
302
|
-
* - it's also cheaper than accessing the .childNodes Live NodeList
|
303
|
-
*/
|
304
|
-
export function removeChildren(node) {
|
305
|
-
node = node.lastChild;
|
306
|
-
while (node) {
|
307
|
-
let next = node.previousSibling;
|
308
|
-
recollectNodeTree(node, true);
|
309
|
-
node = next;
|
310
|
-
}
|
311
|
-
}
|
312
|
-
|
313
|
-
|
314
|
-
/**
|
315
|
-
* Apply differences in attributes from a VNode to the given DOM Element.
|
316
|
-
* @param {import('../dom').PreactElement} dom Element with attributes to diff `attrs` against
|
317
|
-
* @param {object} attrs The desired end-state key-value attribute pairs
|
318
|
-
* @param {object} old Current/previous attributes (from previous VNode or
|
319
|
-
* element's prop cache)
|
320
|
-
*/
|
321
|
-
function diffAttributes(dom, attrs, old) {
|
322
|
-
let name;
|
323
|
-
|
324
|
-
// remove attributes no longer present on the vnode by setting them to undefined
|
325
|
-
for (name in old) {
|
326
|
-
if (!(attrs && attrs[name]!=null) && old[name]!=null) {
|
327
|
-
setAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);
|
328
|
-
}
|
329
|
-
}
|
330
|
-
|
331
|
-
// add new & update changed attributes
|
332
|
-
for (name in attrs) {
|
333
|
-
if (name!=='children' && name!=='innerHTML' && (!(name in old) || attrs[name]!==(name==='value' || name==='checked' ? dom[name] : old[name]))) {
|
334
|
-
setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);
|
335
|
-
}
|
336
|
-
}
|
337
|
-
}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import { extend } from '../util';
|
2
|
-
|
3
|
-
|
4
|
-
/**
|
5
|
-
* Check if two nodes are equivalent.
|
6
|
-
* @param {import('../dom').PreactElement} node DOM Node to compare
|
7
|
-
* @param {import('../vnode').VNode} vnode Virtual DOM node to compare
|
8
|
-
* @param {boolean} [hydrating=false] If true, ignores component constructors
|
9
|
-
* when comparing.
|
10
|
-
* @private
|
11
|
-
*/
|
12
|
-
export function isSameNodeType(node, vnode, hydrating) {
|
13
|
-
if (typeof vnode==='string' || typeof vnode==='number') {
|
14
|
-
return node.splitText!==undefined;
|
15
|
-
}
|
16
|
-
if (typeof vnode.nodeName==='string') {
|
17
|
-
return !node._componentConstructor && isNamedNode(node, vnode.nodeName);
|
18
|
-
}
|
19
|
-
return hydrating || node._componentConstructor===vnode.nodeName;
|
20
|
-
}
|
21
|
-
|
22
|
-
|
23
|
-
/**
|
24
|
-
* Check if an Element has a given nodeName, case-insensitively.
|
25
|
-
* @param {import('../dom').PreactElement} node A DOM Element to inspect the name of.
|
26
|
-
* @param {string} nodeName Unnormalized name to compare against.
|
27
|
-
*/
|
28
|
-
export function isNamedNode(node, nodeName) {
|
29
|
-
return node.normalizedNodeName===nodeName || node.nodeName.toLowerCase()===nodeName.toLowerCase();
|
30
|
-
}
|
31
|
-
|
32
|
-
|
33
|
-
/**
|
34
|
-
* Reconstruct Component-style `props` from a VNode.
|
35
|
-
* Ensures default/fallback values from `defaultProps`:
|
36
|
-
* Own-properties of `defaultProps` not present in `vnode.attributes` are added.
|
37
|
-
* @param {import('../vnode').VNode} vnode The VNode to get props for
|
38
|
-
* @returns {object} The props to use for this VNode
|
39
|
-
*/
|
40
|
-
export function getNodeProps(vnode) {
|
41
|
-
let props = extend({}, vnode.attributes);
|
42
|
-
props.children = vnode.children;
|
43
|
-
|
44
|
-
let defaultProps = vnode.nodeName.defaultProps;
|
45
|
-
if (defaultProps!==undefined) {
|
46
|
-
for (let i in defaultProps) {
|
47
|
-
if (props[i]===undefined) {
|
48
|
-
props[i] = defaultProps[i];
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
return props;
|
54
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Virtual DOM Node
|
3
|
-
* @typedef VNode
|
4
|
-
* @property {string | function} nodeName The string of the DOM node to create or Component constructor to render
|
5
|
-
* @property {Array<VNode | string>} children The children of node
|
6
|
-
* @property {string | number | undefined} key The key used to identify this VNode in a list
|
7
|
-
* @property {object} attributes The properties of this VNode
|
8
|
-
*/
|
9
|
-
export const VNode = function VNode() {};
|