govuk_publishing_components 21.55.1 → 21.56.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +5 -4
  3. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +1 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +1 -4
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +18 -5
  6. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_link.scss +17 -0
  7. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +26 -16
  8. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +11 -7
  9. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +34 -14
  10. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +27 -0
  11. data/config/locales/en.yml +3 -0
  12. data/lib/govuk_publishing_components.rb +2 -1
  13. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +52 -44
  14. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb +41 -0
  15. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +1 -0
  16. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +4 -0
  17. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb +38 -0
  18. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +15 -4
  19. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +3 -1
  20. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +18 -17
  21. data/lib/govuk_publishing_components/version.rb +1 -1
  22. data/node_modules/axe-core/CHANGELOG.md +11 -0
  23. data/node_modules/axe-core/axe.js +36 -9
  24. data/node_modules/axe-core/axe.min.js +2 -2
  25. data/node_modules/axe-core/bower.json +1 -1
  26. data/node_modules/axe-core/lib/checks/color/color-contrast.js +2 -2
  27. data/node_modules/axe-core/lib/checks/lists/listitem.js +1 -1
  28. data/node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js +3 -0
  29. data/node_modules/axe-core/lib/commons/dom/is-visible.js +37 -19
  30. data/node_modules/axe-core/lib/core/public/configure.js +26 -0
  31. data/node_modules/axe-core/lib/rules/aria-input-field-name.json +1 -1
  32. data/node_modules/axe-core/package.json +12 -12
  33. data/node_modules/axe-core/sri-history.json +4 -0
  34. metadata +5 -3
  35. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_parent.rb +0 -39
@@ -44,14 +44,40 @@ function configureChecksRulesAndBranding(spec) {
44
44
  }
45
45
 
46
46
  if (spec.checks) {
47
+ if (!Array.isArray(spec.checks)) {
48
+ throw new TypeError('Checks property must be an array');
49
+ }
50
+
47
51
  spec.checks.forEach(function(check) {
52
+ if (!check.id) {
53
+ throw new TypeError(
54
+ // eslint-disable-next-line max-len
55
+ `Configured check ${JSON.stringify(
56
+ check
57
+ )} is invalid. Checks must be an object with at least an id property`
58
+ );
59
+ }
60
+
48
61
  audit.addCheck(check);
49
62
  });
50
63
  }
51
64
 
52
65
  const modifiedRules = [];
53
66
  if (spec.rules) {
67
+ if (!Array.isArray(spec.rules)) {
68
+ throw new TypeError('Rules property must be an array');
69
+ }
70
+
54
71
  spec.rules.forEach(function(rule) {
72
+ if (!rule.id) {
73
+ throw new TypeError(
74
+ // eslint-disable-next-line max-len
75
+ `Configured rule ${JSON.stringify(
76
+ rule
77
+ )} is invalid. Rules must be an object with at least an id property`
78
+ );
79
+ }
80
+
55
81
  modifiedRules.push(rule.id);
56
82
  audit.addRule(rule);
57
83
  });
@@ -5,7 +5,7 @@
5
5
  "tags": ["wcag2a", "wcag412"],
6
6
  "metadata": {
7
7
  "description": "Ensures every ARIA input field has an accessible name",
8
- "help": "ARIA input fields have an accessible name"
8
+ "help": "ARIA input fields must have an accessible name"
9
9
  },
10
10
  "all": [],
11
11
  "any": ["aria-label", "aria-labelledby", "non-empty-title"],
@@ -15,13 +15,13 @@
15
15
  ],
16
16
  "_from": "axe-core@>=3.5.4 <4.0.0",
17
17
  "_hasShrinkwrap": false,
18
- "_id": "axe-core@3.5.4",
18
+ "_id": "axe-core@3.5.5",
19
19
  "_inCache": true,
20
20
  "_location": "/axe-core",
21
- "_nodeVersion": "10.20.1",
21
+ "_nodeVersion": "10.21.0",
22
22
  "_npmOperationalInternal": {
23
23
  "host": "s3://npm-registry-packages",
24
- "tmp": "tmp/axe-core_3.5.4_1590595109579_0.2715696176994664"
24
+ "tmp": "tmp/axe-core_3.5.5_1592406217427_0.7348143825163969"
25
25
  },
26
26
  "_npmUser": {
27
27
  "name": "npmdeque",
@@ -41,8 +41,8 @@
41
41
  "_requiredBy": [
42
42
  "/"
43
43
  ],
44
- "_resolved": "https://registry.npmjs.org/axe-core/-/axe-core-3.5.4.tgz",
45
- "_shasum": "5a7b49ba8c989cd59cde219810ccfb0b7cf72e97",
44
+ "_resolved": "https://registry.npmjs.org/axe-core/-/axe-core-3.5.5.tgz",
45
+ "_shasum": "84315073b53fa3c0c51676c588d59da09a192227",
46
46
  "_shrinkwrap": null,
47
47
  "_spec": "axe-core@^3.5.4",
48
48
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
@@ -132,17 +132,17 @@
132
132
  },
133
133
  "directories": {},
134
134
  "dist": {
135
- "integrity": "sha512-JRuxixN5bPHre+815qnyqBQzNpRTqGxLWflvjr4REpGZ5o0WXm+ik2IS4PZ01EnacWmVRB4jCPWFiYENMiiasA==",
136
- "shasum": "5a7b49ba8c989cd59cde219810ccfb0b7cf72e97",
137
- "tarball": "https://registry.npmjs.org/axe-core/-/axe-core-3.5.4.tgz",
135
+ "integrity": "sha512-5P0QZ6J5xGikH780pghEdbEKijCTrruK9KxtPZCFWUpef0f6GipO+xEZ5GKCb020mmqgbiNO6TcA55CriL784Q==",
136
+ "shasum": "84315073b53fa3c0c51676c588d59da09a192227",
137
+ "tarball": "https://registry.npmjs.org/axe-core/-/axe-core-3.5.5.tgz",
138
138
  "fileCount": 596,
139
- "unpackedSize": 2638774,
140
- "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezo4mCRA9TVsSAnZWagAAOjMP+wazInaKLcswUycB8GG7\nAIpeOVCHJT64ROZmM7UWMg/GP6h3QKqfz99pVpWYRB6ywwff+O8GPnt7cnD3\nnGiRfWlUpwD9UhMtOPgbE2/S0FSSPGcBWdx6+qGm71UvCb6lS2PuMwvDxtoB\nndSKr644+ZDEIAMtV7vNKgDnChg+u8OvoBr4Pmm1WQy+aAKK9UgDrL5r2XjL\nXq5IBWhOyxv011YxLU4NzDcLfWMaKGJdNKscf79xGC0r7ySgbODuhMETjrbd\nwqpr+lIl4A0niSVj5KSag7DYc1c82ztBB+jJ5x+igfzk2o2BlOfrYGMu4VEk\nt9Vz5FiTp+EjRfDmDHa4lpyNekvJUzb0+XwMs3zWeLBCBvHUO9exjtS3DqHv\nJsdcec0X2tUGY3jXhu9j9uSkYQwx2rr5ZqIu7WWImUM0qNLJELLq3VbAwAvA\nQP++gFpe4sQOP/WBBPRuez4MROb1kPo7/Rk1+BI5PHvrQOGyGt5f+8TvC3hh\nAqQiqXigNGdsE4T8wb2zDaVB8mw73aV1H8hthp4Gi7h971bjwFzg87tOa3wu\nnFN/4y/IxE7bQtw3qSAod12zOaimdSs2Rw7r+wiDHQWQfrDAUGq00GeinlTe\niiSawwFjgSCYd4ok7U7edT4XzX10XSvBwy+/X09sm+G1zjMps8qPz4NopD7H\nxT/N\r\n=U9ln\r\n-----END PGP SIGNATURE-----\r\n"
139
+ "unpackedSize": 2642777,
140
+ "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6jDJCRA9TVsSAnZWagAAGCMQAJ1oBZRRo34GrgSa/2t6\nYeU2J8z5qkLNFILI65HVEzcu2e/TL8rHFgi9Q1Ga4szh41PTXJd0YfnPvYWt\nx+EiZ+TSoeSSksj5VoS3wjQFn2cQ55LyUOW0lQ3s1sPwEgALZPG3pLCn7GW+\nZiOW+Ai1FHESY/dbxZ1Rl1IrOt+jbOZqsczb0yk8PkZ9QwPJjZL70iLI8DRL\n5JMGoAmO4dJ3Vk+t2Dhy7vnwz+bFbs9lRKZaBJp4dYqY0F8HHC91hROv9pTP\n4hCNXevA6SKSf/Ddl7ub51EN1qQalYHQTQ0al4i0isv6NPlUnPVYaGzTHpZE\n2OTvoZ+dVqSDnCJqYH/WrIRfO0xA3bKTlRn6HyMkHFJOcXmi6NR/47uQfY/6\nr5a/N7nBsWh92aaoEw9ZVoNyMAgeEJlOt5uzXQgOWgJM8WIpqbTUJOeqXfEe\nI9FC2NhNU8Gqw9Ee24KCrCg8PWeODV/r47IHkQRdHqoqh1+/hzkUUhVP1smC\n6eI8qFTnhwws+EwNbxvBg73BCwsEiRwXaE7U0PToPLQvxyr0CRjqzJsl6Hhi\nOowldaReyMQALfJTipnc/Eb1VqCVQ1ABaYltnyVRnCL22mZUJGgq65OINJjT\nYGr9pWAh8r+C4MkIJf8C05eYJB6QL8+kry8YDDDtd2NdUHW8IKOax1p3MuqD\nG8u9\r\n=lmaS\r\n-----END PGP SIGNATURE-----\r\n"
141
141
  },
142
142
  "engines": {
143
143
  "node": ">=4"
144
144
  },
145
- "gitHead": "f47997758312755d753c88b0ac7ee2927da8854e",
145
+ "gitHead": "c19c8b616f9ed836fb72f14aaaff53072ea13fdc",
146
146
  "homepage": "https://www.deque.com/axe/",
147
147
  "keywords": [
148
148
  "Accessibility",
@@ -218,5 +218,5 @@
218
218
  }
219
219
  },
220
220
  "typings": "axe.d.ts",
221
- "version": "3.5.4"
221
+ "version": "3.5.5"
222
222
  }
@@ -186,5 +186,9 @@
186
186
  "3.5.4": {
187
187
  "axe.js": "sha256-4f1ZZbAr3xgoAputB3oZK5ASoazrNIw6SU2M1Nnb4bg=",
188
188
  "axe.min.js": "sha256-XDhCakYtcQtOpujvhE876/a4fUyZjiKtNn8xniP03Ek="
189
+ },
190
+ "3.5.5": {
191
+ "axe.js": "sha256-u+Xkb1EmxyRof8YJD9nPMbq9e3VXBj5cO99aEtr2uEs=",
192
+ "axe.min.js": "sha256-ODhTB+pG6Fxp1+zEO2uNekC30gj1q8gQ4iCZZpMQhuE="
189
193
  }
190
194
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.55.1
4
+ version: 21.56.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-04 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters
@@ -548,6 +548,7 @@ files:
548
548
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss
549
549
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss
550
550
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss
551
+ - app/assets/stylesheets/govuk_publishing_components/components/helpers/_link.scss
551
552
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
552
553
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss
553
554
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss
@@ -768,9 +769,10 @@ files:
768
769
  - lib/govuk_publishing_components/presenters/breadcrumbs.rb
769
770
  - lib/govuk_publishing_components/presenters/button_helper.rb
770
771
  - lib/govuk_publishing_components/presenters/checkboxes_helper.rb
771
- - lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_parent.rb
772
+ - lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb
772
773
  - lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb
773
774
  - lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb
775
+ - lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb
774
776
  - lib/govuk_publishing_components/presenters/content_item.rb
775
777
  - lib/govuk_publishing_components/presenters/contents_list_helper.rb
776
778
  - lib/govuk_publishing_components/presenters/contextual_navigation.rb
@@ -1,39 +0,0 @@
1
- module GovukPublishingComponents
2
- module Presenters
3
- # @private
4
- class ContentBreadcrumbsBasedOnParent
5
- def initialize(content_item)
6
- @content_item = ContentItem.new(content_item)
7
- end
8
-
9
- def breadcrumbs
10
- ordered_parents = all_parents.map do |parent|
11
- { title: parent.title, url: parent.base_path }
12
- end
13
-
14
- ordered_parents << { title: "Home", url: "/" }
15
-
16
- {
17
- breadcrumbs: ordered_parents.reverse,
18
- }
19
- end
20
-
21
- private
22
-
23
- attr_reader :content_item
24
-
25
- def all_parents
26
- parents = []
27
-
28
- direct_parent = content_item.parent
29
- while direct_parent
30
- parents << direct_parent
31
-
32
- direct_parent = direct_parent.parent
33
- end
34
-
35
- parents
36
- end
37
- end
38
- end
39
- end