govuk_publishing_components 66.6.0 → 66.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab8154e3861817b4b3715d2eea62bb92736ad4bd6fe842774b92aaf677252812
4
- data.tar.gz: 2ba507170514ffb2c67ea8fc9bd2241c1943688d004c5ae0ce16ef2790b6b5fc
3
+ metadata.gz: 15dc9f3d8df89afd884073edc445ee356db19847cadca1102a003d3a63b02ef3
4
+ data.tar.gz: 729ba4b1052993fa429a1f43cd1ff2f0832a7ad18fddbac4698aff13a04dbaf3
5
5
  SHA512:
6
- metadata.gz: 3e297e668a6c2cce7746b0408d1652b6293a9c737c755c6db89b42912c872428ab74b8ede5423e8c2efc9ac1fffcbc94b29500e648696fb0ea6aa1df337bb9ca
7
- data.tar.gz: 8a5df50c254dcb946ca52b0d1f0efcb7df2ae1b30abcf100f75bac2c0a1d4e3e3dbfef068ec283bcf0e7379d430c9924d6218e6800196f40c746443b6e2ab26d
6
+ metadata.gz: ce997f38b851195443763ffb14970e5d48f5eb5b46db659959152d00e56cc0e183ce702b33972c9597f82922982e21685b2620bbe1fcbf4aa58dabf555e0dfff
7
+ data.tar.gz: 755231805c81bea3994908507f771ae0fe37de4d6412c6bd9cc3cba86b98143e9d69d66d5a0e60dd32323be7cc63e4029c86f36522b27905f67ab69f2d351b48
@@ -16,10 +16,21 @@
16
16
  FilterList.prototype.appendFilterInput = function () {
17
17
  const form = document.createElement('div')
18
18
  form.classList.add('govuk-form-group')
19
- form.innerHTML = `
20
- <label for="filterInput" class="gem-c-label govuk-label">${this.labelText}</label>
21
- <input class="gem-c-input govuk-input" id="filterInput" name="name" spellcheck="false" type="text">
22
- `
19
+
20
+ const formLabel = document.createElement('label')
21
+ formLabel.htmlFor = 'filterInput'
22
+ formLabel.classList.add('gem-c-label', 'govuk-label')
23
+ formLabel.textContent = this.labelText
24
+
25
+ const formInput = document.createElement('input')
26
+ formInput.classList.add('gem-c-input', 'govuk-input')
27
+ formInput.id = 'filterInput'
28
+ formInput.name = 'name'
29
+ formInput.spellcheck = false
30
+ formInput.type = 'text'
31
+
32
+ form.append(formLabel, formInput)
33
+
23
34
  this.module.prepend(form)
24
35
  const input = form.querySelector('.govuk-input')
25
36
  input.addEventListener('submit', function (e) { e.preventDefault() })
@@ -30,6 +30,13 @@
30
30
  }
31
31
  }
32
32
 
33
+ // restore styles for cards component inside govspeak
34
+ .gem-c-cards__list {
35
+ list-style: none;
36
+ padding: 0;
37
+ margin: 0;
38
+ }
39
+
33
40
  // Block quotes
34
41
 
35
42
  blockquote {
@@ -64,6 +64,7 @@ module GovukPublishingComponents
64
64
  tests_path: "spec/components/",
65
65
  javascript_tests_path: "spec/javascripts/components/",
66
66
  helpers_path: "app/helpers/",
67
+ helpers_tests_path: "spec/helpers/",
67
68
  }
68
69
  application_components = AuditComponents.new(path, options)
69
70
  application_components = application_components.data if application_components
@@ -11,6 +11,7 @@ module GovukPublishingComponents
11
11
  @tests_path = options[:tests_path] || "spec/components"
12
12
  @javascript_tests_path = options[:javascript_tests_path] || "spec/javascripts/components"
13
13
  @helpers_path = options[:helpers_path] || "lib/govuk_publishing_components/presenters"
14
+ @helpers_tests_path = options[:helpers_tests_path] || "spec/lib/govuk_publishing_components/presenters"
14
15
 
15
16
  @application_name = options[:application_name] || "govuk_publishing_components"
16
17
  @application_dir = options[:application_dir] || "govuk_publishing_components"
@@ -27,6 +28,7 @@ module GovukPublishingComponents
27
28
  test: 0,
28
29
  javascript_test: 0,
29
30
  helper: 0,
31
+ helper_test: 0,
30
32
  }
31
33
 
32
34
  @data = {
@@ -91,6 +93,10 @@ module GovukPublishingComponents
91
93
  type: "helper",
92
94
  file: "#{[path, @helpers_path].join('/')}/#{component.gsub(' ', '_')}_helper.rb",
93
95
  },
96
+ {
97
+ type: "helper_test",
98
+ file: "#{[path, @helpers_tests_path].join('/')}/#{component.gsub(' ', '_')}_helper_spec.rb",
99
+ },
94
100
  ]
95
101
  file_details.each do |detail|
96
102
  component_detail = component_detail.merge(get_component_asset_detail(detail, component))
@@ -162,6 +168,7 @@ module GovukPublishingComponents
162
168
  .gsub(".js", "")
163
169
  .gsub("spec", "")
164
170
  .gsub("helper.rb", "")
171
+ .gsub("helper_spec.rb", "")
165
172
  .gsub(".rb", "")
166
173
  .strip
167
174
  end
@@ -244,6 +251,7 @@ module GovukPublishingComponents
244
251
  link = "#{url}/#{repo}/#{blob}/#{@tests_path}/#{component.gsub(' ', '_')}_spec.rb" if a_thing == "test"
245
252
  link = "#{url}/#{repo}/#{blob}/#{@javascript_tests_path}/#{component.gsub(' ', '-')}-spec.js" if a_thing == "javascript_test"
246
253
  link = "#{url}/#{repo}/#{blob}/#{@helpers_path}/#{component.gsub(' ', '_')}_helper.rb" if a_thing == "helper"
254
+ link = "#{url}/#{repo}/#{blob}/#{@helpers_tests_path}/#{component.gsub(' ', '_')}_helper_spec.rb" if a_thing == "helper_test"
247
255
 
248
256
  link
249
257
  end
@@ -60,6 +60,12 @@
60
60
  <span class="component__count"><%= passed_components[:component_numbers][:helper] %></span>
61
61
  <% end %>
62
62
  </th>
63
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="helper_test" title="Component has a helper test file">
64
+ Helper test
65
+ <% unless show_application_name %>
66
+ <span class="component__count"><%= passed_components[:component_numbers][:helper_test] %></span>
67
+ <% end %>
68
+ </th>
63
69
  </tr>
64
70
  </thead>
65
71
  <tbody class="govuk-table__body" <% if show_application_name %> data-audit-list<% end %>>
@@ -148,6 +154,14 @@
148
154
  </a>
149
155
  <% end %>
150
156
  </td>
157
+ <td class="govuk-table__cell" data-component-type="helper_test">
158
+ <% if component[:helper_test_exists] %>
159
+ <a href="<%= component[:helper_test_link] %>" class="govuk-link" title="This file has <%= component[:helper_test_lines] %> lines">
160
+ <%= component[:helper_test_lines] %>
161
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> helper test</span>
162
+ </a>
163
+ <% end %>
164
+ </td>
151
165
  </tr>
152
166
  <% end %>
153
167
  </tbody>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "66.6.0".freeze
2
+ VERSION = "66.6.1".freeze
3
3
  end
@@ -352,7 +352,7 @@ declare namespace axe {
352
352
  helpUrl: string;
353
353
  tags: string[];
354
354
  actIds?: string[];
355
- enabled: boolean;
355
+ enabled?: boolean;
356
356
  }
357
357
  interface SerialDqElement {
358
358
  source: string;
@@ -623,7 +623,9 @@ declare namespace axe {
623
623
  * @param {Array} tags Optional array of tags
624
624
  * @return {Array} Array of rules
625
625
  */
626
- function getRules(tags?: string[]): RuleMetadata[];
626
+ function getRules(
627
+ tags?: string[]
628
+ ): (Omit<RuleMetadata, 'enabled'> & { enabled: boolean })[];
627
629
 
628
630
  /**
629
631
  * Restores the default axe configuration
@@ -1,4 +1,4 @@
1
- /*! axe v4.12.0
1
+ /*! axe v4.12.1
2
2
  * Copyright (c) 2015 - 2026 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
@@ -22,7 +22,7 @@
22
22
  }, _typeof(o);
23
23
  }
24
24
  var axe = axe || {};
25
- axe.version = '4.12.0';
25
+ axe.version = '4.12.1';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -6889,12 +6889,18 @@
6889
6889
  Object.freeze(constants.resultGroupMap);
6890
6890
  Object.freeze(constants);
6891
6891
  var constants_default = constants;
6892
+ var logger;
6892
6893
  function log() {
6893
- if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
6894
- Function.prototype.apply.call(console.log, console, arguments);
6894
+ if (logger) {
6895
+ logger.apply(void 0, arguments);
6896
+ } else if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
6897
+ var _console;
6898
+ (_console = console).log.apply(_console, arguments);
6895
6899
  }
6896
6900
  }
6897
- var log_default = log;
6901
+ function setLogger(fn) {
6902
+ logger = fn;
6903
+ }
6898
6904
  var whitespaceRegex = /[\t\r\n\f]/g;
6899
6905
  var AbstractVirtualNode = function() {
6900
6906
  function AbstractVirtualNode() {
@@ -11706,7 +11712,7 @@
11706
11712
  err2 = e;
11707
11713
  setTimeout(function() {
11708
11714
  if (err2 !== void 0 && err2 !== null) {
11709
- log_default('Uncaught error (of queue)', err2);
11715
+ log('Uncaught error (of queue)', err2);
11710
11716
  }
11711
11717
  }, 1);
11712
11718
  };
@@ -12193,7 +12199,7 @@
12193
12199
  var win = node.contentWindow;
12194
12200
  var pingWaitTime = (_parameters$options$p = (_parameters$options = parameters.options) === null || _parameters$options === void 0 ? void 0 : _parameters$options.pingWaitTime) !== null && _parameters$options$p !== void 0 ? _parameters$options$p : 500;
12195
12201
  if (!win) {
12196
- log_default('Frame does not have a content window', node);
12202
+ log('Frame does not have a content window', node);
12197
12203
  resolve(null);
12198
12204
  return;
12199
12205
  }
@@ -16876,7 +16882,7 @@
16876
16882
  return accName || step(virtualNode, context);
16877
16883
  }, '');
16878
16884
  if (context.debug) {
16879
- log_default(valueString || '{empty-value}', actualNode, context);
16885
+ log(valueString || '{empty-value}', actualNode, context);
16880
16886
  }
16881
16887
  return valueString;
16882
16888
  }
@@ -19730,7 +19736,7 @@
19730
19736
  axeStartTime = now();
19731
19737
  },
19732
19738
  _log: function _log(message) {
19733
- log_default(message);
19739
+ log(message);
19734
19740
  }
19735
19741
  };
19736
19742
  }();
@@ -20784,12 +20790,12 @@
20784
20790
  }
20785
20791
  function _loadElementInternals() {
20786
20792
  _loadElementInternals = _asyncToGenerator(_regenerator().m(function _callee2() {
20787
- var logger, promiseValue, internalsMap, _i43, _internalsMap$_i, internals, ancestry, node, vNode, _i44, _Object$entries, _Object$entries$_i, _key12, val, type2, value, _args2 = arguments;
20793
+ var logger2, promiseValue, internalsMap, _i43, _internalsMap$_i, internals, ancestry, node, vNode, _i44, _Object$entries, _Object$entries$_i, _key12, val, type2, value, _args2 = arguments;
20788
20794
  return _regenerator().w(function(_context3) {
20789
20795
  while (1) {
20790
20796
  switch (_context3.n) {
20791
20797
  case 0:
20792
- logger = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : log_default;
20798
+ logger2 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : log;
20793
20799
  if (getElementInternals2) {
20794
20800
  _context3.n = 1;
20795
20801
  break;
@@ -20808,7 +20814,7 @@
20808
20814
  _context3.n = 3;
20809
20815
  break;
20810
20816
  }
20811
- logger('externalAPIs.getElementInternals() did not return an array');
20817
+ logger2('externalAPIs.getElementInternals() did not return an array');
20812
20818
  return _context3.a(2);
20813
20819
 
20814
20820
  case 3:
@@ -20823,7 +20829,7 @@
20823
20829
  _context3.n = 5;
20824
20830
  break;
20825
20831
  }
20826
- logger('externalAPIs.getElementInternals()['.concat(_i43, '] is not an object'));
20832
+ logger2('externalAPIs.getElementInternals()['.concat(_i43, '] is not an object'));
20827
20833
  return _context3.a(3, 13);
20828
20834
 
20829
20835
  case 5:
@@ -20833,7 +20839,7 @@
20833
20839
  _context3.n = 6;
20834
20840
  break;
20835
20841
  }
20836
- logger('externalAPIs.getElementInternals()['.concat(_i43, '].internals is not an object'));
20842
+ logger2('externalAPIs.getElementInternals()['.concat(_i43, '].internals is not an object'));
20837
20843
  return _context3.a(3, 13);
20838
20844
 
20839
20845
  case 6:
@@ -20841,7 +20847,7 @@
20841
20847
  _context3.n = 7;
20842
20848
  break;
20843
20849
  }
20844
- logger('externalAPIs.getElementInternals()['.concat(_i43, '].ancestry is not a string or an array of strings'));
20850
+ logger2('externalAPIs.getElementInternals()['.concat(_i43, '].ancestry is not a string or an array of strings'));
20845
20851
  return _context3.a(3, 13);
20846
20852
 
20847
20853
  case 7:
@@ -20851,7 +20857,7 @@
20851
20857
  _context3.n = 8;
20852
20858
  break;
20853
20859
  }
20854
- logger('Unable to locate node using selector '.concat(ancestry, ' from externalAPIs.getElementInternals()[').concat(_i43, ']'));
20860
+ logger2('Unable to locate node using selector '.concat(ancestry, ' from externalAPIs.getElementInternals()[').concat(_i43, ']'));
20855
20861
  return _context3.a(3, 13);
20856
20862
 
20857
20863
  case 8:
@@ -20873,10 +20879,10 @@
20873
20879
  case 10:
20874
20880
  type2 = val.type, value = val.value;
20875
20881
  if (!type2) {
20876
- logger('externalAPIs.getElementInternals()['.concat(_i43, '].internals.').concat(_key12, ' is an object but has no "type" property'));
20882
+ logger2('externalAPIs.getElementInternals()['.concat(_i43, '].internals.').concat(_key12, ' is an object but has no "type" property'));
20877
20883
  }
20878
20884
  if (!value) {
20879
- logger('externalAPIs.getElementInternals()['.concat(_i43, '].internals.').concat(_key12, ' is an object but has no "value" property'));
20885
+ logger2('externalAPIs.getElementInternals()['.concat(_i43, '].internals.').concat(_key12, ' is an object but has no "value" property'));
20880
20886
  }
20881
20887
  if (type2 === 'HTMLElement') {
20882
20888
  setHTMLElement(internals, _key12, value);
@@ -20954,12 +20960,13 @@
20954
20960
  }
20955
20961
  function getRules(tags) {
20956
20962
  tags = tags || [];
20957
- var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) {
20963
+ var _axe$_audit = axe._audit, rules = _axe$_audit.rules, data = _axe$_audit.data, tagExclude = _axe$_audit.tagExclude;
20964
+ var matchingRules = !tags.length ? rules : rules.filter(function(item) {
20958
20965
  return !!tags.filter(function(tag) {
20959
20966
  return item.tags.indexOf(tag) !== -1;
20960
20967
  }).length;
20961
20968
  });
20962
- var ruleData = axe._audit.data.rules || {};
20969
+ var ruleData = data.rules || {};
20963
20970
  return matchingRules.map(function(matchingRule) {
20964
20971
  var rd = ruleData[matchingRule.id] || {};
20965
20972
  return {
@@ -20969,7 +20976,9 @@
20969
20976
  helpUrl: rd.helpUrl,
20970
20977
  tags: matchingRule.tags,
20971
20978
  actIds: matchingRule.actIds,
20972
- enabled: matchingRule.enabled
20979
+ enabled: matchingRule.enabled && !matchingRule.tags.some(function(tag) {
20980
+ return tagExclude.includes(tag);
20981
+ })
20973
20982
  };
20974
20983
  });
20975
20984
  }
@@ -28874,7 +28883,7 @@
28874
28883
  this._markChecksEnd = 'mark_runchecks_end_' + this.id;
28875
28884
  };
28876
28885
  Rule.prototype._logGatherPerformance = function _logGatherPerformance(nodes) {
28877
- log_default('gather for '.concat(this.id, ' (').concat(nodes.length, ' nodes): ').concat(performance_timer_default.timeElapsed(), 'ms'));
28886
+ log('gather for '.concat(this.id, ' (').concat(nodes.length, ' nodes): ').concat(performance_timer_default.timeElapsed(), 'ms'));
28878
28887
  performance_timer_default.mark(this._markChecksStart);
28879
28888
  };
28880
28889
  Rule.prototype._logRulePerformance = function _logRulePerformance() {
@@ -29613,7 +29622,7 @@
29613
29622
  resolve(results, teardown_default);
29614
29623
  } catch (e) {
29615
29624
  teardown_default();
29616
- log_default(e);
29625
+ log(e);
29617
29626
  }
29618
29627
  } catch (e) {
29619
29628
  teardown_default();
@@ -29753,7 +29762,7 @@
29753
29762
  });
29754
29763
  }
29755
29764
  function normalizeRunParams(_ref147) {
29756
- var _ref149, _options$reporter, _axe$_audit;
29765
+ var _ref149, _options$reporter, _axe$_audit2;
29757
29766
  var _ref148 = _slicedToArray(_ref147, 3), context = _ref148[0], options = _ref148[1], callback = _ref148[2];
29758
29767
  var typeErr = new TypeError('axe.run arguments are invalid');
29759
29768
  if (!_isContextSpec(context)) {
@@ -29775,7 +29784,7 @@
29775
29784
  throw typeErr;
29776
29785
  }
29777
29786
  options = clone2(options);
29778
- options.reporter = (_ref149 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref149 !== void 0 ? _ref149 : 'v1';
29787
+ options.reporter = (_ref149 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref149 !== void 0 ? _ref149 : 'v1';
29779
29788
  return {
29780
29789
  context: context,
29781
29790
  options: options,
@@ -29924,14 +29933,14 @@
29924
29933
  });
29925
29934
  }
29926
29935
  function finishRun(partialResults) {
29927
- var _ref152, _options$reporter2, _axe$_audit2;
29936
+ var _ref152, _options$reporter2, _axe$_audit3;
29928
29937
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29929
29938
  options = clone2(options);
29930
29939
  var _ref151 = partialResults.find(function(r) {
29931
29940
  return r.environmentData;
29932
29941
  }) || {}, environmentData = _ref151.environmentData;
29933
29942
  _normalizeRunOptions(options);
29934
- options.reporter = (_ref152 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref152 !== void 0 ? _ref152 : 'v1';
29943
+ options.reporter = (_ref152 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit3 = axe._audit) === null || _axe$_audit3 === void 0 ? void 0 : _axe$_audit3.reporter) !== null && _ref152 !== void 0 ? _ref152 : 'v1';
29935
29944
  setFrameSpec(partialResults);
29936
29945
  var results = merge_results_default(partialResults);
29937
29946
  results = axe._audit.after(results, options);
@@ -30125,7 +30134,8 @@
30125
30134
  var exposed_for_testing_default = _thisWillBeDeletedDoNotUse;
30126
30135
  axe._thisWillBeDeletedDoNotUse = exposed_for_testing_default;
30127
30136
  axe.constants = constants_default;
30128
- axe.log = log_default;
30137
+ axe.log = log;
30138
+ axe._setLogger = setLogger;
30129
30139
  axe.AbstractVirtualNode = abstract_virtual_node_default;
30130
30140
  axe.SerialVirtualNode = serial_virtual_node_default;
30131
30141
  axe.VirtualNode = virtual_node_default;