govuk_publishing_components 29.7.0 → 29.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +72 -73
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +11 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-click-tracking.js +49 -0
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +0 -1
  7. data/app/assets/javascripts/govuk_publishing_components/modules.js +0 -1
  8. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-measurer.js +28 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +11 -4
  10. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -1
  11. data/app/views/govuk_publishing_components/component_guide/index.html.erb +2 -2
  12. data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
  13. data/app/views/govuk_publishing_components/components/_cards.html.erb +13 -11
  14. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +1 -1
  15. data/app/views/govuk_publishing_components/components/docs/document_list.yml +4 -4
  16. data/app/views/govuk_publishing_components/components/docs/heading.yml +1 -1
  17. data/app/views/govuk_publishing_components/components/docs/image_card.yml +1 -1
  18. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +4 -4
  19. data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -1
  20. data/app/views/govuk_publishing_components/components/docs/share_links.yml +1 -1
  21. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +1 -1
  22. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +1 -2
  23. data/lib/generators/govuk_publishing_components/templates/_component.html.erb +1 -1
  24. data/lib/govuk_publishing_components/app_helpers/brand_helper.rb +1 -1
  25. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +0 -1
  26. data/lib/govuk_publishing_components/version.rb +1 -1
  27. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b74221682d0047e390f314e968edf8acd3b89efebfe41d833239d9ca44413c86
4
- data.tar.gz: 1f87c5a4288b2a69da1e32598422162bc5017f2dab4ac577b326b582cbd9e8e9
3
+ metadata.gz: 4cef8771d15136a9e4ebbe4fc0cbedb616731c433ea12db09af6fa12c1613594
4
+ data.tar.gz: 721a1fb8532f1952e49aa9ff61a6aa075d3719f8a774c387319858da6c153edf
5
5
  SHA512:
6
- metadata.gz: 14d60ae3e9876edbbcac836010f6dbfd1655c3be4798119f79ac064cb70cfef71a612694d7b31ae6475c31f9813ca9d7775fb1ab3b3153707643bd61190e057d
7
- data.tar.gz: 4e69c991fd6db0d47136d6a7e489fd516e1aa9c62b1422ccf87ed35164e7f6641a60fd64392281f5c99b84c4b9caef8be78bbd73faa922b604d27c227ec7080f
6
+ metadata.gz: f1544190ffc2c00a4f1576c84c74c89e1bc647d4916bccd72deb7f571a9b3f010ebba18abec66a1d67868b86de280dd83cbe4c5bc34677b5a1150bf1a54fdf16
7
+ data.tar.gz: 868c8e7d02ab075e08fa196c526c39f02e6583dada12cfbb70f0384326a22728471cffe310d16692712d985960c4f78ec1e0f3ad5e8daeae84a4596398cf21a9
@@ -1,89 +1,88 @@
1
- ;(function (global) {
2
- 'use strict'
3
-
4
- var GOVUK = global.GOVUK || {}
5
- GOVUK.Modules = GOVUK.Modules || {}
6
-
7
- GOVUK.Modules.ExplicitCrossDomainLinks = function () {
8
- this.start = function ($module) {
9
- this.element = $module[0]
10
- this.attribute = 'href'
11
- this.attributeValue = this.element.getAttribute(this.attribute)
12
- this.eventType = 'click'
13
- if (!this.attributeValue) {
14
- this.attribute = 'action'
15
- this.attributeValue = this.element.getAttribute(this.attribute)
16
- this.eventType = 'submit'
17
- }
18
-
19
- this.handleEvent = this.handleEvent.bind(this)
20
- this.handleCookiesAccepted = this.handleCookiesAccepted.bind(this)
21
- // Listens for the 'submit' event if the element is a form, and the 'click' event if it is a link
22
- this.element.addEventListener(this.eventType, this.handleEvent)
23
- }
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ function ExplicitCrossDomainLinks ($module) {
6
+ this.$module = $module
7
+ }
24
8
 
25
- this.handleEvent = function (e) {
26
- // prevent default: we want the link href and/or form action to be decorated before we navigate away
27
- e.preventDefault()
28
- var cookieBannerEngaged = GOVUK.cookie('cookies_preferences_set')
29
- var cookieConsent = GOVUK.getConsentCookie()
30
-
31
- if (cookieBannerEngaged !== 'true') {
32
- // If not engaged, append only ?cookie_consent=not-engaged
33
- this.decorate(this.element, 'cookie_consent=not-engaged', this.attribute)
34
- } else if (cookieConsent && cookieConsent.usage === true) {
35
- this.handleCookiesAccepted()
36
- } else {
37
- this.decorate(this.element, 'cookie_consent=reject', this.attribute)
38
- }
39
-
40
- // remove the event listener to avoid an infinite loop
41
- this.element.removeEventListener(this.eventType, this.handleEvent)
42
-
43
- // if the element is a form, submit it. If it is a link, click it
44
- if (this.eventType === 'submit') {
45
- this.element.submit()
46
- } else {
47
- this.element.click()
48
- }
9
+ ExplicitCrossDomainLinks.prototype.init = function () {
10
+ this.attribute = 'href'
11
+ this.attributeValue = this.$module.getAttribute(this.attribute)
12
+ this.eventType = 'click'
13
+ if (!this.attributeValue) {
14
+ this.attribute = 'action'
15
+ this.attributeValue = this.$module.getAttribute(this.attribute)
16
+ this.eventType = 'submit'
49
17
  }
50
18
 
51
- this.handleCookiesAccepted = function () {
52
- // If the cookie banner was engaged and usage cookie accepted, append ?_ga=clientid if available and cookie_consent=accept
53
- var element = this.element
54
- var attribute = this.attribute
55
- this.decorate(element, 'cookie_consent=accept', attribute)
19
+ this.handleEvent = this.handleEvent.bind(this)
20
+ this.handleCookiesAccepted = this.handleCookiesAccepted.bind(this)
21
+ // Listens for the 'submit' event if the element is a form, and the 'click' event if it is a link
22
+ this.$module.addEventListener(this.eventType, this.handleEvent)
23
+ }
56
24
 
57
- if (!global.ga) {
58
- return
59
- }
25
+ ExplicitCrossDomainLinks.prototype.decorate = function (element, param, attribute) {
26
+ var attributeValue = element.getAttribute(attribute)
60
27
 
61
- global.ga(function () {
62
- var trackers = global.ga.getAll()
28
+ if (!attributeValue) { return }
63
29
 
64
- if (!trackers.length) { return }
30
+ if (attributeValue.indexOf('?') !== -1) {
31
+ attributeValue += '&' + param
32
+ } else {
33
+ attributeValue += '?' + param
34
+ }
65
35
 
66
- var linker = new global.gaplugins.Linker(trackers[0])
67
- var attrValue = element.getAttribute(attribute)
36
+ element.setAttribute(attribute, attributeValue)
37
+ }
68
38
 
69
- element.setAttribute(attribute, linker.decorate(attrValue))
70
- })
39
+ ExplicitCrossDomainLinks.prototype.handleEvent = function (e) {
40
+ // prevent default: we want the link href and/or form action to be decorated before we navigate away
41
+ e.preventDefault()
42
+ var cookieBannerEngaged = window.GOVUK.cookie('cookies_preferences_set')
43
+ var cookieConsent = window.GOVUK.getConsentCookie()
44
+
45
+ if (cookieBannerEngaged !== 'true') {
46
+ // If not engaged, append only ?cookie_consent=not-engaged
47
+ this.decorate(this.$module, 'cookie_consent=not-engaged', this.attribute)
48
+ } else if (cookieConsent && cookieConsent.usage === true) {
49
+ this.handleCookiesAccepted()
50
+ } else {
51
+ this.decorate(this.$module, 'cookie_consent=reject', this.attribute)
71
52
  }
72
53
 
73
- this.decorate = function (element, param, attribute) {
74
- var attributeValue = element.getAttribute(attribute)
54
+ // remove the event listener to avoid an infinite loop
55
+ this.$module.removeEventListener(this.eventType, this.handleEvent)
75
56
 
76
- if (!attributeValue) { return }
57
+ // if the element is a form, submit it. If it is a link, click it
58
+ if (this.eventType === 'submit') {
59
+ this.$module.submit()
60
+ } else {
61
+ this.$module.click()
62
+ }
63
+ }
77
64
 
78
- if (attributeValue.indexOf('?') !== -1) {
79
- attributeValue += '&' + param
80
- } else {
81
- attributeValue += '?' + param
82
- }
65
+ ExplicitCrossDomainLinks.prototype.handleCookiesAccepted = function () {
66
+ // If the cookie banner was engaged and usage cookie accepted, append ?_ga=clientid if available and cookie_consent=accept
67
+ var element = this.$module
68
+ var attribute = this.attribute
69
+ this.decorate(element, 'cookie_consent=accept', attribute)
83
70
 
84
- element.setAttribute(attribute, attributeValue)
71
+ if (!window.ga) {
72
+ return
85
73
  }
74
+
75
+ window.ga(function () {
76
+ var trackers = window.ga.getAll()
77
+
78
+ if (!trackers.length) { return }
79
+
80
+ var linker = new window.gaplugins.Linker(trackers[0])
81
+ var attrValue = element.getAttribute(attribute)
82
+
83
+ element.setAttribute(attribute, linker.decorate(attrValue))
84
+ })
86
85
  }
87
86
 
88
- global.GOVUK = GOVUK
89
- })(window)
87
+ Modules.ExplicitCrossDomainLinks = ExplicitCrossDomainLinks
88
+ })(window.GOVUK.Modules)
@@ -13,6 +13,10 @@
13
13
  return document.querySelectorAll('[data-track-count="accordionSection"]').length
14
14
  case isDocumentCollectionPage():
15
15
  return document.querySelectorAll('.document-collection .group-title').length
16
+ case isNewBrowsePageLevelTwo():
17
+ // if there are no accordion sections on the browse level 2 page
18
+ // then it is a default page with only one section
19
+ return document.querySelectorAll('[data-track-count="accordionSection"]').length || 1
16
20
  case isNewBrowsePage():
17
21
  return document.querySelectorAll('[data-track-count="cardList"]').length
18
22
  case isMainstreamBrowsePage():
@@ -46,6 +50,8 @@
46
50
  return document.querySelectorAll('a[data-track-category="navAccordionLinkClicked"]').length
47
51
  case isDocumentCollectionPage():
48
52
  return document.querySelectorAll('.document-collection .group-document-list li a').length
53
+ case isNewBrowsePageLevelTwo():
54
+ return document.querySelectorAll('[data-track-count="contentLink"]').length
49
55
  case isNewBrowsePage():
50
56
  return document.querySelectorAll('[data-track-count="cardLink"]').length
51
57
  case isMainstreamBrowsePage():
@@ -98,6 +104,11 @@
98
104
  getMetaAttribute(metaNavigationTypeSelector) === 'leaf'
99
105
  }
100
106
 
107
+ function isNewBrowsePageLevelTwo () {
108
+ return getMetaAttribute(metaApplicationSelector) === 'collections' &&
109
+ getMetaAttribute(metaNavigationTypeSelector) === 'browse level 2'
110
+ }
111
+
101
112
  function isNewBrowsePage () {
102
113
  return getMetaAttribute(metaApplicationSelector) === 'collections' &&
103
114
  getMetaAttribute(metaSectionSelector) === 'new_browse_page' &&
@@ -0,0 +1,49 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ 'use strict'
6
+
7
+ function GtmClickTracking (module) {
8
+ this.module = module
9
+ this.trackingTrigger = 'data-gtm-event-name' // elements with this attribute get tracked
10
+ }
11
+
12
+ GtmClickTracking.prototype.init = function () {
13
+ var trackClicksOn = [this.module]
14
+ if (!this.module.getAttribute(this.trackingTrigger)) {
15
+ trackClicksOn = this.module.querySelectorAll('[' + this.trackingTrigger + ']')
16
+ }
17
+
18
+ for (var i = 0; i < trackClicksOn.length; i++) {
19
+ trackClicksOn[i].addEventListener('click', this.trackClick.bind(this))
20
+ }
21
+ }
22
+
23
+ GtmClickTracking.prototype.trackClick = function (event) {
24
+ if (window.dataLayer) {
25
+ var target = event.currentTarget
26
+ var data = {
27
+ event: 'analytics',
28
+ event_name: target.getAttribute('data-gtm-event-name'),
29
+ // get entire URL apart from domain
30
+ link_url: window.location.href.substring(window.location.origin.length),
31
+ ui: JSON.parse(target.getAttribute('data-gtm-attributes'))
32
+ }
33
+ var ariaExpanded = this.checkExpandedState(target)
34
+ if (ariaExpanded) {
35
+ data.ui.state = ariaExpanded === 'false' ? 'opened' : 'closed'
36
+ }
37
+ window.dataLayer.push(data)
38
+ }
39
+ }
40
+
41
+ GtmClickTracking.prototype.checkExpandedState = function (clicked) {
42
+ var expanded = clicked.querySelector('[aria-expanded]')
43
+ if (expanded) {
44
+ return expanded.getAttribute('aria-expanded')
45
+ }
46
+ }
47
+
48
+ Modules.GtmClickTracking = GtmClickTracking
49
+ })(window.GOVUK.Modules)
@@ -0,0 +1 @@
1
+ //= require ./analytics-ga4/gtm-click-tracking
@@ -131,7 +131,6 @@ window.GOVUK.Modules.GovukAccordion = window.GOVUKFrontend.Accordion;
131
131
 
132
132
  if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
133
133
  window.GOVUK.analytics.trackEvent('pageElementInteraction', action, options)
134
- console.log('pageElementInteraction', action, options)
135
134
  }
136
135
  }
137
136
 
@@ -35,7 +35,6 @@
35
35
  for (var j = 0, k = moduleNames.length; j < k; j++) {
36
36
  var moduleName = camelCaseAndCapitalise(moduleNames[j])
37
37
  var started = element.getAttribute('data-' + moduleNames[j] + '-module-started')
38
-
39
38
  if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
40
39
  // Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend Modules
41
40
  if (GOVUK.Modules[moduleName].prototype.init) {
@@ -157,3 +157,31 @@ if (
157
157
  LongTaskObserver.observe({ type: ["longtask"] });
158
158
  } catch (e) {}
159
159
  }
160
+
161
+ // As per RFC 147[1], this adds in monitoring of the type of HTTP protocol that
162
+ // is used when a browser loads a page.
163
+ //
164
+ // The User Timing API (aka window.performance) is used to record the data - to
165
+ // avoid the use of this from breaking the JavaScript for the small number of
166
+ // browsers that don't support it, it's been wrapped in a try/catch block plus a
167
+ // couple of checks to prevent "is not defined" errors.
168
+ //
169
+ // Because the `nextHopProtocol` isn't immediately available - it seems to need
170
+ // a request to be made before it's populated - we need to wait for the
171
+ // `DOMContentReady` event before we can see what the HTTP version is.
172
+ //
173
+ // [1]: https://github.com/alphagov/govuk-rfcs/pull/148
174
+ try {
175
+ if (typeof performance !== 'undefined') {
176
+ document.addEventListener('DOMContentLoaded', function () {
177
+ var getEntriesByType = performance.getEntriesByType('navigation')
178
+
179
+ if (getEntriesByType.length > 0) {
180
+ var httpProtocol = performance.getEntriesByType('navigation')[0].nextHopProtocol
181
+ LUX.addData("http-protocol", httpProtocol)
182
+ }
183
+ })
184
+ }
185
+ } catch (e) {
186
+ console.error('Error in LUX reporting the HTTP protocol (' + window.location + '):', e)
187
+ }
@@ -50,12 +50,19 @@
50
50
  // We use grid to split the container into column widths, so manage the horizontal spacing with
51
51
  // internal margins.
52
52
  margin: 0 govuk-spacing(3);
53
- padding: govuk-spacing(3) 0 govuk-spacing(6) 0;
53
+ padding: govuk-spacing(1) 0 govuk-spacing(4) 0;
54
+ }
55
+
56
+ .gem-c-cards__list-item-wrapper {
57
+ // this wrapper ensures that the clickable area of the card only
58
+ // covers the area of the card containing text so in a grid of cards
59
+ // there is space above and below each link
60
+ padding: govuk-spacing(2) govuk-spacing(6) govuk-spacing(2) 0;
54
61
  position: relative;
55
62
  }
56
63
 
57
64
  .gem-c-cards__sub-heading {
58
- margin: 0 govuk-spacing(6) govuk-spacing(2) 0;
65
+ margin-bottom: govuk-spacing(2);
59
66
  }
60
67
 
61
68
  .gem-c-cards__link {
@@ -79,7 +86,7 @@
79
86
  height: $dimension;
80
87
  position: absolute;
81
88
  right: govuk-spacing(1);
82
- top: govuk-spacing(4);
89
+ top: govuk-spacing(3);
83
90
  @include prefixed-transform($rotate: 45deg);
84
91
  width: $dimension;
85
92
  }
@@ -98,5 +105,5 @@
98
105
  }
99
106
 
100
107
  .gem-c-cards__description {
101
- margin: 0;
108
+ margin: 0 govuk-spacing(-6) 0 0;
102
109
  }
@@ -16,7 +16,7 @@
16
16
  // This block is duplicated from Whitehall as a transitional step, see the
17
17
  // commit message for 2d893c10ee3f2cab27162b9aba38b12379a71d07 before making
18
18
  // changes, original version:
19
- // https://github.com/alphagov/whitehall/blob/master/app/assets/stylesheets/frontend/helpers/_attachment.scss
19
+ // https://github.com/alphagov/whitehall/blob/main/app/assets/stylesheets/frontend/helpers/_attachment.scss
20
20
  $thumbnail-width: 99px;
21
21
 
22
22
  .attachment {
@@ -20,7 +20,7 @@
20
20
  <p>Components are packages of template, style, behaviour and documentation that live in your application.</p>
21
21
  <p>See the <a href="https://github.com/alphagov/govuk_publishing_components">govuk_publishing_components gem</a> for further details, or <a href="https://docs.publishing.service.gov.uk/manual/components.html#component-guides">a list of all component guides</a>.</p>
22
22
  <ul>
23
- <li>Read about how to <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/publishing-to-rubygems.md">release a new version of the gem</a></li>
23
+ <li>Read about how to <a href="https://github.com/alphagov/govuk_publishing_components/blob/main/docs/publishing-to-rubygems.md">release a new version of the gem</a></li>
24
24
  <% if ENV["MAIN_COMPONENT_GUIDE"] %>
25
25
  <li><a href="/component-guide/audit">View component audits</a></li>
26
26
  <% end %>
@@ -105,5 +105,5 @@
105
105
  </ul>
106
106
 
107
107
  <div class="component-markdown">
108
- <p class="govuk-body">If you cannot find a suitable component consider extending an existing component or <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/generate-a-new-component.md">creating a new one</a>.</p>
108
+ <p class="govuk-body">If you cannot find a suitable component consider extending an existing component or <a href="https://github.com/alphagov/govuk_publishing_components/blob/main/docs/generate-a-new-component.md">creating a new one</a>.</p>
109
109
  </div>
@@ -13,7 +13,7 @@
13
13
  <% if !@component_doc.accessibility_criteria.present? %>
14
14
  <div class="component-violation">
15
15
  <h2 class="component-violation__title">This component is not valid</h2>
16
- <a class="component-violation__link" href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/accessibility_acceptance_criteria.md">Please define accessibility acceptance criteria for this component.</a>
16
+ <a class="component-violation__link" href="https://github.com/alphagov/govuk_publishing_components/blob/main/docs/accessibility_acceptance_criteria.md">Please define accessibility acceptance criteria for this component.</a>
17
17
  </div>
18
18
  <% end %>
19
19
  <%= render 'govuk_publishing_components/components/lead_paragraph', text: @component_doc.description %>
@@ -31,17 +31,19 @@
31
31
  end
32
32
  %>
33
33
  <li class="gem-c-cards__list-item">
34
- <%= content_tag("h#{sub_heading_level}", class: "gem-c-cards__sub-heading govuk-heading-s") do %>
35
- <%=
36
- link_to link[:text], link[:path],
37
- class: "govuk-link gem-c-cards__link",
38
- data: link[:data_attributes],
39
- "data-track-count": "cardLink"
40
- %>
41
- <% end %>
42
- <% if item[:description] %>
43
- <p class="govuk-body gem-c-cards__description"><%= item[:description] %></p>
44
- <% end %>
34
+ <div class="gem-c-cards__list-item-wrapper">
35
+ <%= content_tag("h#{sub_heading_level}", class: "gem-c-cards__sub-heading govuk-heading-s") do %>
36
+ <%=
37
+ link_to link[:text], link[:path],
38
+ class: "govuk-link gem-c-cards__link",
39
+ data: link[:data_attributes],
40
+ "data-track-count": "cardLink"
41
+ %>
42
+ <% end %>
43
+ <% if item[:description] %>
44
+ <p class="govuk-body gem-c-cards__description"><%= item[:description] %></p>
45
+ <% end %>
46
+ </div>
45
47
  </li>
46
48
  <% end %>
47
49
  <% end %>
@@ -191,7 +191,7 @@ examples:
191
191
  context:
192
192
  right_to_left: true
193
193
  with_branding:
194
- description: Where this component could be used on an organisation page (such as the [Attorney General's Office](https://www.gov.uk/government/organisations/attorney-generals-office)) branding can be applied for link colours and border colours. See the [branding documentation](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) for more details.
194
+ description: Where this component could be used on an organisation page (such as the [Attorney General's Office](https://www.gov.uk/government/organisations/attorney-generals-office)) branding can be applied for link colours and border colours. See the [branding documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) for more details.
195
195
  data:
196
196
  brand: 'department-for-environment-food-rural-affairs'
197
197
  format_numbers: true
@@ -2,7 +2,7 @@ name: Document list
2
2
  description: An ordered list of documents including a document type, when updated and a link.
3
3
  body: |
4
4
  Outputs a list to documents, based on an array of document data. A "document" in this context can be an asset (such as a ODT or other downloadable document) or a web page.
5
-
5
+
6
6
  The component can display:
7
7
 
8
8
  * a document title
@@ -116,7 +116,7 @@ examples:
116
116
  public_updated_at: 2017-07-19 15:01:48
117
117
  document_type: 'Statutory guidance'
118
118
  with_branding:
119
- description: Where this component could be used on an organisation page (such as the [Attorney General's Office](https://www.gov.uk/government/organisations/attorney-generals-office)) branding can be applied for link colours and border colours. See the [branding documentation](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) for more details.
119
+ description: Where this component could be used on an organisation page (such as the [Attorney General's Office](https://www.gov.uk/government/organisations/attorney-generals-office)) branding can be applied for link colours and border colours. See the [branding documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) for more details.
120
120
  data:
121
121
  brand: 'attorney-generals-office'
122
122
  items:
@@ -308,9 +308,9 @@ examples:
308
308
  with_rel_link_attribute:
309
309
  description: |
310
310
  The [rel attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel) is an option attribute to dictate the relationship between the document being linked to and the current page. This is predominantly used by search engines to help index journeys through a website.
311
-
311
+
312
312
  On GOV.UK, this is typically used to dictate an external website being linked to with `rel="external"`, however this component supports:
313
-
313
+
314
314
  - external
315
315
  - nofollow
316
316
  - noopener
@@ -65,7 +65,7 @@ examples:
65
65
  padding: true
66
66
  border_top: 2
67
67
  with_branding:
68
- description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown, if a top border is included.
68
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown, if a top border is included.
69
69
  data:
70
70
  text: 'Branding'
71
71
  brand: 'department-for-environment-food-rural-affairs'
@@ -166,7 +166,7 @@ examples:
166
166
  heading_text: 'John McJohnson'
167
167
  description: 'Deputy director for Parks and Small Trees'
168
168
  with_branding:
169
- description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
169
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
170
170
  data:
171
171
  brand: "department-for-work-pensions"
172
172
  href: "/again-not-a-page"
@@ -4,9 +4,9 @@ body: |
4
4
  This takes a content-store links hash like object which it can then turn into
5
5
  the correct analytics identifier metadata tags.
6
6
 
7
- These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
7
+ These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
8
8
 
9
- The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
9
+ The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
10
10
  accessibility_criteria: |
11
11
  The analytics meta tags component should not be visible to any users.
12
12
  display_html: true
@@ -24,7 +24,7 @@ examples:
24
24
  with_content_history_tags:
25
25
  description: |
26
26
  The tags in this object will generate the `content-has-history` tag, set to true. This tag is triggered when either, within `content_item`:
27
-
27
+
28
28
  1. `public_updated_at` and `first_public_at` within `details` are both present and they aren't the same value
29
29
  2. `change_history` within `details` is present and it has a value of more than 1
30
30
 
@@ -121,4 +121,4 @@ examples:
121
121
  content_item:
122
122
  links:
123
123
  secondary_to_step_navs:
124
- - content_id: "22222222-2222-2222-2222-222222222222"
124
+ - content_id: "22222222-2222-2222-2222-222222222222"
@@ -359,7 +359,7 @@ examples:
359
359
  dark_background: true
360
360
  with_custom_margin_bottom:
361
361
  description: |
362
- The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to the `margin-bottom` values defined in the [responsive-bottom-margin mixin](https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss#L1)
362
+ The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to the `margin-bottom` values defined in the [responsive-bottom-margin mixin](https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss#L1)
363
363
  data:
364
364
  first_published: 14 June 2014
365
365
  last_updated: 10 September 2015
@@ -80,7 +80,7 @@ examples:
80
80
  }
81
81
  ]
82
82
  with_branding:
83
- description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
83
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
84
84
  data:
85
85
  brand: 'attorney-generals-office'
86
86
  links: [
@@ -46,7 +46,7 @@ examples:
46
46
  email_signup_link: '/foreign-travel-advice/singapore/email-signup'
47
47
  feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
48
48
  with_branding:
49
- description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
49
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
50
50
  data:
51
51
  brand: 'attorney-generals-office'
52
52
  email_signup_link: '/foreign-travel-advice/singapore/email-signup'
@@ -60,7 +60,7 @@ examples:
60
60
  context:
61
61
  right_to_left: true
62
62
  with_branding:
63
- description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
63
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
64
64
  data:
65
65
  brand: 'wales-office'
66
66
  translations:
@@ -134,4 +134,3 @@ examples:
134
134
  dimension29: 'dimension29Welsh'
135
135
  context:
136
136
  dark_background: true
137
-
@@ -1,3 +1,3 @@
1
1
  <div class="<%= @component_prefix %><%= @public_name %>">
2
- <h2><a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_conventions.md">How to build a component</a></h2>
2
+ <h2><a href="https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_conventions.md">How to build a component</a></h2>
3
3
  </div>
@@ -7,7 +7,7 @@ module GovukPublishingComponents
7
7
 
8
8
  # Apply government organisation branding to individual components, specifically
9
9
  # link colour and border colour
10
- # see https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md
10
+ # see https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md
11
11
 
12
12
  def brand_class
13
13
  "brand--#{@brand}" if @brand
@@ -7,7 +7,6 @@ module GovukPublishingComponents
7
7
  # Currently DfE, DWP and DVSA are participating in the pilot.
8
8
  EMAILS_IN_ACCESSIBLE_FORMAT_REQUEST_PILOT = %w[govuk_publishing_components@example.com
9
9
  alternative.formats@education.gov.uk
10
- accessible.formats@dwp.gov.uk
11
10
  gov.uk.publishing@dvsa.gov.uk].freeze
12
11
 
13
12
  delegate :opendocument?, :document?, :spreadsheet?, to: :content_type
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "29.7.0".freeze
2
+ VERSION = "29.8.0".freeze
3
3
  end
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: 29.7.0
4
+ version: 29.8.0
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: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -433,6 +433,8 @@ files:
433
433
  - app/assets/javascripts/component_guide/vendor/bind-polyfill.js
434
434
  - app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
435
435
  - app/assets/javascripts/govuk_publishing_components/all_components.js
436
+ - app/assets/javascripts/govuk_publishing_components/analytics-ga4.js
437
+ - app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-click-tracking.js
436
438
  - app/assets/javascripts/govuk_publishing_components/analytics.js
437
439
  - app/assets/javascripts/govuk_publishing_components/analytics/analytics.js
438
440
  - app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js
@@ -1891,7 +1893,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1891
1893
  - !ruby/object:Gem::Version
1892
1894
  version: '0'
1893
1895
  requirements: []
1894
- rubygems_version: 3.3.12
1896
+ rubygems_version: 3.3.13
1895
1897
  signing_key:
1896
1898
  specification_version: 4
1897
1899
  summary: A gem to document components in GOV.UK frontend applications