govuk_publishing_components 66.2.0 → 66.3.0

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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +15 -9
  3. data/app/assets/javascripts/govuk_publishing_components/initialise-vars.js +1 -0
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -1
  5. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -3
  6. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
  7. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +7 -0
  8. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -1
  9. data/lib/govuk_publishing_components/version.rb +1 -1
  10. data/node_modules/axe-core/axe.js +7 -4
  11. data/node_modules/axe-core/axe.min.js +2 -2
  12. data/node_modules/axe-core/package.json +1 -1
  13. data/node_modules/axe-core/sri-history.json +4 -0
  14. data/node_modules/choices.js/package.json +1 -1
  15. data/node_modules/choices.js/public/assets/scripts/choices.js +17 -9
  16. data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
  17. data/node_modules/choices.js/public/assets/scripts/choices.mjs +17 -9
  18. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +17 -9
  19. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
  20. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +17 -9
  21. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +17 -9
  22. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
  23. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +17 -9
  24. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +17 -9
  25. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
  26. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +17 -9
  27. data/node_modules/choices.js/src/scripts/components/input.ts +17 -11
  28. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86e6747e7ac2fbe09ae4b993c0220e43a0b95c72cb1916254bc26301fedf68ba
4
- data.tar.gz: e70984d80ef1fb018177f52f10683b535af24665990ceb8c421802c23915afad
3
+ metadata.gz: cc3ef8ff8392927e31bf3958896fec3586bc86c3ae8bce1dc9095a05905d9933
4
+ data.tar.gz: 015ccdd4c183f254539d0770068caab00e05a0d40eb80a5c7a62c7bb9ec55741
5
5
  SHA512:
6
- metadata.gz: c0393a75efbc028df6501454f07a78aa1b7f9a8cf029becea313a3881c05d0fd57f5d566551fcb631687de92dbcc379943ca846d97929bef8dd7623892006916
7
- data.tar.gz: 19a5dfc0d677181f71c3d47553c9f0a5f05a1feef93fded11ba4b0f39151ae397d47e240d646f7423f3affb5a448805423b2838f04822cdabdccd1e0c3e0650f
6
+ metadata.gz: 76ac1ee03256eb413747840e7e6943d8770a2c346d30d28b4de2a04a72b10d92a574ec2dab4dc37bda6e3ce065fcdbe6961fb6f828d4bb280d2054682384c4e1
7
+ data.tar.gz: 16419ad32e7670da648c76e49e110cf3199e2c53f1e7a0adb253f049be96b34bba7ab775f4297baf4c9fa05ccb5d4b83a2b8552d0d8b8165fa0ad0b8f32bfa36
@@ -6,17 +6,23 @@ var initFunction = function () {
6
6
  window.GOVUK.analyticsGa4.vars.internalDomains.push(window.GOVUK.analyticsGa4.core.trackFunctions.getHostname())
7
7
  window.GOVUK.analyticsGa4.core.trackFunctions.appendDomainsWithoutWWW(window.GOVUK.analyticsGa4.vars.internalDomains)
8
8
  window.GOVUK.analyticsGa4.core.load()
9
- var analyticsModules = window.GOVUK.analyticsGa4.analyticsModules
10
- for (var property in analyticsModules) {
11
- var module = analyticsModules[property]
12
- if (typeof module.init === 'function') {
13
- try {
14
- module.init()
15
- } catch (e) {
16
- // if there's a problem with the module, catch the error to allow other modules to start
17
- console.warn('Error starting analytics module ' + property + ': ' + e.message, window.location)
9
+
10
+ if (!window.GOVUK.analyticsGa4.analyticsModulesStarted) {
11
+ // Initialise analytics modules that start on page load
12
+ // https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/analytics.md#code-structure
13
+ var analyticsModules = window.GOVUK.analyticsGa4.analyticsModules
14
+ for (var property in analyticsModules) {
15
+ var module = analyticsModules[property]
16
+ if (typeof module.init === 'function') {
17
+ try {
18
+ module.init()
19
+ } catch (e) {
20
+ // if there's a problem with the module, catch the error to allow other modules to start
21
+ console.warn('Error starting analytics module ' + property + ': ' + e.message, window.location)
22
+ }
18
23
  }
19
24
  }
25
+ window.GOVUK.analyticsGa4.analyticsModulesStarted = true
20
26
  }
21
27
  } else {
22
28
  window.addEventListener('cookie-consent', window.GOVUK.analyticsGa4.init)
@@ -5,3 +5,4 @@ window.GOVUK = window.GOVUK || {}
5
5
  window.GOVUK.Modules = window.GOVUK.Modules || {}
6
6
  window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
7
7
  window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analyticsModules || {}
8
+ window.GOVUK.analyticsGa4.analyticsModulesStarted = false
@@ -194,7 +194,7 @@
194
194
 
195
195
  window.GOVUK.expireCookie = function (cookie, value = '') {
196
196
  // We need to handle deleting cookies on the domain and the .domain
197
- var thePast = new Date(0) // 0 = 0 seconds since UTC started (1970/01/01)
197
+ var thePast = new Date(0).toUTCString() // 0 = 0 seconds since UTC started (1970/01/01)
198
198
  document.cookie = cookie + '=' + value + ';expires=' + thePast + ';'
199
199
  document.cookie = cookie + '=' + value + ';expires=' + thePast + ';domain=' + window.location.hostname + ';path=/'
200
200
  }
@@ -45,9 +45,7 @@ module GovukPublishingComponents
45
45
  end
46
46
 
47
47
  def components_in_use_sass
48
- additional_files = "@import 'govuk_publishing_components/govuk_frontend_support';\n"
49
- additional_files << "@import 'govuk_publishing_components/component_support';\n"
50
-
48
+ additional_files = "@import 'govuk_publishing_components/specific-components';\n"
51
49
  components = find_all_partials_in(get_used_component_names)
52
50
 
53
51
  components.map { |component|
@@ -18,6 +18,7 @@
18
18
  draft_watermark ||= false
19
19
  title ||= "GOV.UK - The best place to find government services and information"
20
20
  title_lang ||= nil
21
+ body_classes ||= nil
21
22
 
22
23
  show_account_layout ||= false
23
24
  account_nav_location ||= nil
@@ -27,6 +28,7 @@
27
28
  body_css_classes = %w(gem-c-layout-for-public govuk-template__body)
28
29
  body_css_classes << "gem-c-layout-for-public--draft" if draft_watermark
29
30
  body_css_classes << "global-banner-present" if global_banner.present?
31
+ body_css_classes << body_classes if body_classes
30
32
  -%>
31
33
  <!DOCTYPE html>
32
34
  <html class="govuk-template govuk-template--rebranded" lang="<%= html_lang %>">
@@ -116,3 +116,10 @@ examples:
116
116
  title_lang: 'cy'
117
117
  block: |
118
118
  <h1>Page content goes here</h1>
119
+ with_body_classes:
120
+ description: Allows a class to be passed to the body element. Note that this does not work in preview in this guide.
121
+ data:
122
+ title: 'Example layout'
123
+ body_classes: 'example__class'
124
+ block: |
125
+ <h1>Page content goes here</h1>
@@ -39,7 +39,6 @@
39
39
  class: "gem-c-feedback__prompt-link",
40
40
  role: "button",
41
41
  hidden: "hidden",
42
- 'aria-hidden': "true",
43
42
  } do %>
44
43
  <%= t("components.feedback.maybe") %>
45
44
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "66.2.0".freeze
2
+ VERSION = "66.3.0".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- /*! axe v4.11.3
1
+ /*! axe v4.11.4
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.11.3';
25
+ axe.version = '4.11.4';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -10991,7 +10991,7 @@
10991
10991
  return Array.from(doc.querySelectorAll(selector));
10992
10992
  });
10993
10993
  function generateAncestry(node) {
10994
- var nodeName2 = node.nodeName.toLowerCase();
10994
+ var nodeName2 = escape_selector_default(node.nodeName.toLowerCase());
10995
10995
  var parentElement = node.parentElement;
10996
10996
  var parentNode = node.parentNode;
10997
10997
  var nthChild = '';
@@ -16968,7 +16968,10 @@
16968
16968
  if (!virtualNode) {
16969
16969
  return false;
16970
16970
  }
16971
- if (virtualNode.props.nodeType !== 1 || context.includeHidden) {
16971
+ if (context.includeHidden && !nativelyHidden(virtualNode)) {
16972
+ return false;
16973
+ }
16974
+ if (virtualNode.props.nodeType !== 1) {
16972
16975
  return false;
16973
16976
  }
16974
16977
  return !_isVisibleToScreenReaders(virtualNode);