govuk_publishing_components 51.2.0 → 51.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db74fa9c85934d448152da8903352a36ab46a513068455227b209267bb698a3f
4
- data.tar.gz: 2fdd9cb41e512fab8054ee4005af8eabd2fa006394a19940388946e4887a31e6
3
+ metadata.gz: c50d14be7610561ed91341a0824caa29b9c767d839acb2c6f7c65b5f58514ac4
4
+ data.tar.gz: d8bd8854736387adecda29ca77c0f31af6b7e5f0d8123c30c4b9fa5223e2530e
5
5
  SHA512:
6
- metadata.gz: 1d9d34b3457fb88865bac9df441cd621abba687e5c624a661b6e1f24bb922b2ce8d0eb1f5f9737093096d10bdd0433ea3f23a04e2b20e58f58cff172a67de729
7
- data.tar.gz: 702d5378bd7d5c1278155f7ad564bea78098a0bb80883abde47c917170f1c42b010de450ba06897517af1809c69b93e1720c772bc8986faabaaed40811eba312
6
+ metadata.gz: 8a3fd0fbac03888e39e3aecd3adcc1c69dd9c1f3b179f8eeb853c14cb3edbea20df8593a00126fc3d23fa3b550af45746f6b42679a145287abf31b92e20886a1
7
+ data.tar.gz: e26f92b617d944bee8ffaee93c200eef6bf1b8596c946092e5646f4862d9043a7c4ba26e9d784ce4f0445cda143ef57f27003c94275b2c2423e8117a743553de
@@ -69,40 +69,35 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
69
69
  }.bind(this), 1000)
70
70
  }.bind(this))
71
71
 
72
- // much of the JS needed to support sending the form contents via this script is
73
- // unsupported by IE, even IE11. This check causes IE to not intercept form submits
74
- // and let them happen normally, which is handled already by the backend
75
- if (typeof window.URLSearchParams === 'function') {
76
- for (var f = 0; f < this.forms.length; f++) {
77
- this.forms[f].addEventListener('submit', function (e) {
78
- e.preventDefault()
79
- var $form = e.target
80
- var xhr = new XMLHttpRequest()
81
- var url = $form.getAttribute('action')
82
- var params = new FormData($form)
83
- params = new URLSearchParams(params).toString()
84
-
85
- this.done = function () {
86
- if (xhr.status === 200) {
87
- this.showFormSuccess(xhr.message)
88
- this.revealInitialPrompt()
89
- this.setInitialAriaAttributes()
90
- this.activeForm.hidden = true
91
- clearInterval(this.timerInterval)
92
- } else {
93
- this.showError(xhr)
94
- this.enableSubmitFormButton($form)
95
- }
96
- }.bind(this)
97
-
98
- xhr.addEventListener('loadend', this.done)
99
- xhr.open('POST', url, true)
100
- xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
101
-
102
- this.disableSubmitFormButton($form)
103
- xhr.send(params)
104
- }.bind(this))
105
- }
72
+ for (var f = 0; f < this.forms.length; f++) {
73
+ this.forms[f].addEventListener('submit', function (e) {
74
+ e.preventDefault()
75
+ var $form = e.target
76
+ var xhr = new XMLHttpRequest()
77
+ var url = $form.getAttribute('action')
78
+ var params = new FormData($form)
79
+ params = new URLSearchParams(params).toString()
80
+
81
+ this.done = function () {
82
+ if (xhr.status === 200) {
83
+ this.showFormSuccess(xhr.message)
84
+ this.revealInitialPrompt()
85
+ this.setInitialAriaAttributes()
86
+ this.activeForm.hidden = true
87
+ clearInterval(this.timerInterval)
88
+ } else {
89
+ this.showError(xhr)
90
+ this.enableSubmitFormButton($form)
91
+ }
92
+ }.bind(this)
93
+
94
+ xhr.addEventListener('loadend', this.done)
95
+ xhr.open('POST', url, true)
96
+ xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
97
+
98
+ this.disableSubmitFormButton($form)
99
+ xhr.send(params)
100
+ }.bind(this))
106
101
  }
107
102
  }
108
103
 
@@ -336,7 +336,7 @@
336
336
  return str;
337
337
  }
338
338
 
339
- var VERSION = "4.0.29";
339
+ var VERSION = "4.0.30";
340
340
  /**
341
341
  * Returns the version of the script as a float to be stored in legacy systems that do not support
342
342
  * string versions.
@@ -622,6 +622,10 @@
622
622
  }
623
623
  var MAX_SELECTOR_LENGTH = 100;
624
624
  function getNodeSelector(node, selector) {
625
+ if (selector === void 0) { selector = ""; }
626
+ return _getNodeSelector(node, selector).slice(0, MAX_SELECTOR_LENGTH);
627
+ }
628
+ function _getNodeSelector(node, selector) {
625
629
  if (selector === void 0) { selector = ""; }
626
630
  try {
627
631
  if (selector &&
@@ -668,6 +672,7 @@
668
672
  var sessionAttributions = [];
669
673
  var largestEntry;
670
674
  var maximumSessionValue = 0;
675
+ var MAX_CLS_SOURCES = 50;
671
676
  function processEntry$2(entry) {
672
677
  if (!entry.hadRecentInput) {
673
678
  var firstEntry = sessionEntries[0];
@@ -717,7 +722,7 @@
717
722
  startTime: processTimeMetric(largestEntry.startTime),
718
723
  }
719
724
  : null,
720
- sources: sessionAttributions.length ? sessionAttributions : null,
725
+ sources: sessionAttributions.length ? sessionAttributions.slice(0, MAX_CLS_SOURCES) : null,
721
726
  };
722
727
  }
723
728
 
@@ -31,12 +31,11 @@
31
31
 
32
32
  h2 {
33
33
  margin-top: $govuk-gutter;
34
- margin-bottom: 0;
34
+ margin-bottom: govuk-spacing(4);
35
35
  @include govuk-font($size: 27, $weight: bold);
36
36
 
37
37
  @include govuk-media-query($from: desktop) {
38
38
  margin-top: $govuk-gutter * 1.5;
39
- margin-bottom: 0;
40
39
  }
41
40
  }
42
41
 
@@ -3,7 +3,7 @@ description: Invites user feedback on the current page.
3
3
  body: |
4
4
  This component is designed to sit at the bottom of pages on GOV.UK to allow users to submit feedback on that page.
5
5
 
6
- This component uses JavaScript for expanding and collapsing and also for submitting form responses. This code is not compatible with Internet Explorer, so IE11 and down do not use JavaScript to submit the forms, instead falling back to a normal form submission.
6
+ This component uses JavaScript for expanding and collapsing and also for submitting form responses. Users without JavaScript will fall back to a normal form submission.
7
7
  uses_component_wrapper_helper: true
8
8
  accessibility_criteria: |
9
9
  The form must:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "51.2.0".freeze
2
+ VERSION = "51.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 51.2.0
4
+ version: 51.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-06 00:00:00.000000000 Z
10
+ date: 2025-02-11 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: govuk_app_config