govuk_publishing_components 37.8.0 → 37.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-focus-loss-tracker.js +61 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -17
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -46
- data/app/views/govuk_publishing_components/components/_option_select.html.erb +1 -1
- data/config/locales/ar.yml +0 -2
- data/config/locales/az.yml +0 -2
- data/config/locales/be.yml +0 -2
- data/config/locales/bg.yml +0 -2
- data/config/locales/bn.yml +0 -2
- data/config/locales/cs.yml +0 -2
- data/config/locales/cy.yml +0 -2
- data/config/locales/da.yml +0 -2
- data/config/locales/de.yml +0 -2
- data/config/locales/dr.yml +0 -2
- data/config/locales/el.yml +0 -2
- data/config/locales/en.yml +0 -14
- data/config/locales/es-419.yml +0 -2
- data/config/locales/es.yml +0 -2
- data/config/locales/et.yml +0 -2
- data/config/locales/fa.yml +0 -2
- data/config/locales/fi.yml +0 -2
- data/config/locales/fr.yml +0 -2
- data/config/locales/gd.yml +0 -2
- data/config/locales/gu.yml +0 -2
- data/config/locales/he.yml +0 -2
- data/config/locales/hi.yml +0 -2
- data/config/locales/hr.yml +0 -2
- data/config/locales/hu.yml +0 -2
- data/config/locales/hy.yml +0 -2
- data/config/locales/id.yml +0 -2
- data/config/locales/is.yml +0 -2
- data/config/locales/it.yml +0 -2
- data/config/locales/ja.yml +0 -2
- data/config/locales/ka.yml +0 -2
- data/config/locales/kk.yml +0 -2
- data/config/locales/ko.yml +0 -2
- data/config/locales/lt.yml +0 -2
- data/config/locales/lv.yml +0 -2
- data/config/locales/ms.yml +0 -2
- data/config/locales/mt.yml +0 -2
- data/config/locales/nl.yml +0 -2
- data/config/locales/no.yml +0 -2
- data/config/locales/pa-pk.yml +0 -2
- data/config/locales/pa.yml +0 -2
- data/config/locales/pl.yml +0 -2
- data/config/locales/ps.yml +0 -2
- data/config/locales/pt.yml +0 -2
- data/config/locales/ro.yml +0 -2
- data/config/locales/ru.yml +0 -2
- data/config/locales/si.yml +0 -2
- data/config/locales/sk.yml +0 -2
- data/config/locales/sl.yml +0 -2
- data/config/locales/so.yml +0 -2
- data/config/locales/sq.yml +0 -2
- data/config/locales/sr.yml +0 -2
- data/config/locales/sv.yml +0 -2
- data/config/locales/sw.yml +0 -2
- data/config/locales/ta.yml +0 -2
- data/config/locales/th.yml +0 -2
- data/config/locales/tk.yml +0 -2
- data/config/locales/tr.yml +0 -2
- data/config/locales/uk.yml +0 -2
- data/config/locales/ur.yml +0 -2
- data/config/locales/uz.yml +0 -2
- data/config/locales/vi.yml +0 -2
- data/config/locales/zh-hk.yml +0 -2
- data/config/locales/zh-tw.yml +0 -2
- data/config/locales/zh.yml +0 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 620e260c7be413ed137d8e74b40dc48c19319aec32a0a7d19cc595ac63f88ace
|
4
|
+
data.tar.gz: aa8cc4913d9db8852e43c7eb3e47f43716b749c640ba31b4004ad60f78c88ea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de3cdf70234ce290d51b5132f6cde36fc6c43f5c2281fc5f094a468ee5b496bbc49325e4633ff01836bcafa4c6e4ac30af496e40034c50dd2e6da27b847ed2f1
|
7
|
+
data.tar.gz: 56b4d106d440fbc30dd4ad64108cc9f3dbdba4c65a23a37df3147e80e8703ccc3e91349cfe65d7ee484068abe0ee07366ea8a1abc742798f19c68d5877c02513
|
data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-focus-loss-tracker.js
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
2
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
3
|
+
|
4
|
+
(function (Modules) {
|
5
|
+
'use strict'
|
6
|
+
|
7
|
+
function Ga4FocusLossTracker (module) {
|
8
|
+
this.module = module
|
9
|
+
this.trackingTrigger = 'data-ga4-focus-loss' // elements with this attribute get tracked
|
10
|
+
}
|
11
|
+
|
12
|
+
Ga4FocusLossTracker.prototype.init = function () {
|
13
|
+
var consentCookie = window.GOVUK.getConsentCookie()
|
14
|
+
|
15
|
+
if (consentCookie && consentCookie.usage) {
|
16
|
+
this.startModule()
|
17
|
+
} else {
|
18
|
+
this.start = this.startModule.bind(this)
|
19
|
+
window.addEventListener('cookie-consent', this.start)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
// triggered by cookie-consent event, which happens when users consent to cookies
|
24
|
+
Ga4FocusLossTracker.prototype.startModule = function () {
|
25
|
+
if (window.dataLayer) {
|
26
|
+
window.removeEventListener('cookie-consent', this.start)
|
27
|
+
this.module.addEventListener('blur', this.trackFocusLoss.bind(this))
|
28
|
+
this.module.piiRemover = new window.GOVUK.analyticsGa4.PIIRemover()
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
Ga4FocusLossTracker.prototype.trackFocusLoss = function (event) {
|
33
|
+
var data = event.target.getAttribute(this.trackingTrigger)
|
34
|
+
if (!data) {
|
35
|
+
return
|
36
|
+
}
|
37
|
+
|
38
|
+
try {
|
39
|
+
data = JSON.parse(data)
|
40
|
+
} catch (e) {
|
41
|
+
// if there's a problem with the config, don't start the tracker
|
42
|
+
console.warn('GA4 configuration error: ' + e.message, window.location)
|
43
|
+
return
|
44
|
+
}
|
45
|
+
|
46
|
+
var tagName = event.target.tagName
|
47
|
+
var inputType = event.target.getAttribute('type')
|
48
|
+
|
49
|
+
if (data.text) {
|
50
|
+
data.text = this.module.piiRemover.stripPIIWithOverride(data.text, true, true)
|
51
|
+
} else {
|
52
|
+
if (tagName === 'INPUT' && (inputType === 'search' || inputType === 'text')) {
|
53
|
+
data.text = window.GOVUK.analyticsGa4.core.trackFunctions.standardiseSearchTerm(this.module.value)
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
window.GOVUK.analyticsGa4.core.applySchemaAndSendData(data, 'event_data')
|
58
|
+
}
|
59
|
+
|
60
|
+
Modules.Ga4FocusLossTracker = Ga4FocusLossTracker
|
61
|
+
})(window.GOVUK.Modules)
|
@@ -884,7 +884,11 @@ $after-button-padding-left: govuk-spacing(4);
|
|
884
884
|
}
|
885
885
|
|
886
886
|
.gem-c-layout-super-navigation-header__search-form {
|
887
|
-
padding: 0
|
887
|
+
padding: 0;
|
888
|
+
|
889
|
+
@include govuk-media-query($from: "desktop") {
|
890
|
+
padding-bottom: govuk-spacing(2);
|
891
|
+
}
|
888
892
|
}
|
889
893
|
|
890
894
|
// Popular links.
|
@@ -893,17 +897,6 @@ $after-button-padding-left: govuk-spacing(4);
|
|
893
897
|
padding: govuk-spacing(1) 0;
|
894
898
|
}
|
895
899
|
|
896
|
-
.gem-c-layout-super-navigation-header__popular-link {
|
897
|
-
display: inline-block;
|
898
|
-
font-size: 16px;
|
899
|
-
font-size: govuk-px-to-rem(16px);
|
900
|
-
padding: 0;
|
901
|
-
|
902
|
-
&::after {
|
903
|
-
@include make-selectable-area-bigger;
|
904
|
-
}
|
905
|
-
}
|
906
|
-
|
907
900
|
.gem-c-layout-super-navigation-header__width-container {
|
908
901
|
@include govuk-media-query($until: "desktop") {
|
909
902
|
margin: 0;
|
@@ -988,11 +981,6 @@ $after-button-padding-left: govuk-spacing(4);
|
|
988
981
|
}
|
989
982
|
|
990
983
|
@include govuk-media-query($until: tablet) {
|
991
|
-
.gem-c-layout-super-navigation-header__popular-links-heading--large-navbar {
|
992
|
-
font-size: 24px;
|
993
|
-
font-size: govuk-px-to-rem(24px);
|
994
|
-
}
|
995
|
-
|
996
984
|
// can't disable responsive styling because using override classes
|
997
985
|
// from govuk-frontend which are all responsive so have to supply
|
998
986
|
// custom class to the label of the search component to turn off
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -15,8 +15,6 @@
|
|
15
15
|
navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
|
16
16
|
navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading")
|
17
17
|
navigation_search_subheading = t("components.layout_super_navigation_header.navigation_search_subheading")
|
18
|
-
popular_links = t("components.layout_super_navigation_header.popular_links")
|
19
|
-
popular_links_heading = t("components.layout_super_navigation_header.popular_links_heading")
|
20
18
|
search_text = t("components.layout_super_navigation_header.search_text")
|
21
19
|
|
22
20
|
hide_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "search")
|
@@ -68,9 +66,6 @@
|
|
68
66
|
dropdown_menu_classes = %w(gem-c-layout-super-navigation-header__navigation-dropdown-menu)
|
69
67
|
dropdown_menu_classes << "gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar" if large_navbar
|
70
68
|
|
71
|
-
popular_links_heading_classes = %w(govuk-heading-m)
|
72
|
-
popular_links_heading_classes << "gem-c-layout-super-navigation-header__popular-links-heading--large-navbar" if large_navbar
|
73
|
-
|
74
69
|
absolute_links_helper = GovukPublishingComponents::Presenters::AbsoluteLinksHelper.new()
|
75
70
|
%>
|
76
71
|
<%= content_tag("header",
|
@@ -328,7 +323,7 @@
|
|
328
323
|
"type": "header menu bar",
|
329
324
|
"index_section": column_index + 1,
|
330
325
|
"index_link": index + 1,
|
331
|
-
"index_section_count":
|
326
|
+
"index_section_count": 3,
|
332
327
|
"index_total": index_total,
|
333
328
|
"section": column[:label],
|
334
329
|
}
|
@@ -348,7 +343,7 @@
|
|
348
343
|
id: "super-search-menu",
|
349
344
|
hidden: "",
|
350
345
|
class: dropdown_menu_classes,
|
351
|
-
}) do %>
|
346
|
+
}) do %>
|
352
347
|
<div class="govuk-width-container gem-c-layout-super-navigation-header__search-container gem-c-layout-super-navigation-header__search-items">
|
353
348
|
<h3 class="govuk-visually-hidden">
|
354
349
|
<%= navigation_search_subheading %>
|
@@ -385,45 +380,6 @@
|
|
385
380
|
</form>
|
386
381
|
</div>
|
387
382
|
</div>
|
388
|
-
<div class="govuk-grid-row">
|
389
|
-
<div class="govuk-grid-column-full">
|
390
|
-
<%= content_tag(:h3, {
|
391
|
-
class: popular_links_heading_classes
|
392
|
-
}) do %>
|
393
|
-
<%= popular_links_heading %>
|
394
|
-
<% end %>
|
395
|
-
<ul class="govuk-list">
|
396
|
-
<% index_total = popular_links.length %>
|
397
|
-
<% popular_links.each_with_index do | popular_link, index | %>
|
398
|
-
<li class="gem-c-layout-super-navigation-header__popular-item">
|
399
|
-
<% link_href = absolute_links_helper.make_url_absolute(popular_link[:href]) %>
|
400
|
-
<%= link_to popular_link[:label], link_href, {
|
401
|
-
class: [
|
402
|
-
"govuk-link",
|
403
|
-
"gem-c-layout-super-navigation-header__popular-link",
|
404
|
-
],
|
405
|
-
data: {
|
406
|
-
track_action: "popularLink",
|
407
|
-
track_category: "headerClicked",
|
408
|
-
track_label: popular_link[:href],
|
409
|
-
track_dimension: popular_link[:label],
|
410
|
-
track_dimension_index: "29",
|
411
|
-
ga4_link: {
|
412
|
-
"event_name": "navigation",
|
413
|
-
"type": "header menu bar",
|
414
|
-
"index_section": 4,
|
415
|
-
"index_link": index + 1,
|
416
|
-
"index_section_count": 4,
|
417
|
-
"index_total": index_total,
|
418
|
-
"section": popular_links_heading,
|
419
|
-
}
|
420
|
-
}
|
421
|
-
} %>
|
422
|
-
</li>
|
423
|
-
<% end %>
|
424
|
-
</ul>
|
425
|
-
</div>
|
426
|
-
</div>
|
427
383
|
</div>
|
428
384
|
<% end %>
|
429
385
|
</nav>
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--down" aria-hidden="true" focusable="false"><path d="m225.84 414.16l256 256c16.683 16.683 43.691 16.683 60.331 0l256-256c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.84 225.84-225.84-225.84c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331z"/></svg>
|
51
51
|
</h3>
|
52
52
|
|
53
|
-
<%= content_tag(:div,
|
53
|
+
<%= content_tag(:div, class: options_container_classes, id: options_container_id, tabindex: "-1") do %>
|
54
54
|
<div class="gem-c-option-select__container-inner js-auto-height-inner">
|
55
55
|
<% if show_filter %>
|
56
56
|
<span id="<%= checkboxes_count_id %>"
|
data/config/locales/ar.yml
CHANGED
data/config/locales/az.yml
CHANGED
data/config/locales/be.yml
CHANGED
data/config/locales/bg.yml
CHANGED
data/config/locales/bn.yml
CHANGED
data/config/locales/cs.yml
CHANGED
data/config/locales/cy.yml
CHANGED
data/config/locales/da.yml
CHANGED
data/config/locales/de.yml
CHANGED
data/config/locales/dr.yml
CHANGED
data/config/locales/el.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -231,20 +231,6 @@ en:
|
|
231
231
|
navigation_menu_heading: Navigation menu
|
232
232
|
navigation_search_heading: Search and popular pages
|
233
233
|
navigation_search_subheading: Search
|
234
|
-
popular_links:
|
235
|
-
- label: Get support with the cost of living
|
236
|
-
href: "/cost-of-living"
|
237
|
-
- label: Find out about help you can get with your energy bills
|
238
|
-
href: "/get-help-energy-bills"
|
239
|
-
- label: Find a job
|
240
|
-
href: "/find-a-job"
|
241
|
-
- label: 'Universal Credit account: sign in'
|
242
|
-
href: "/sign-in-universal-credit"
|
243
|
-
- label: Check your National Insurance record
|
244
|
-
href: "/check-national-insurance-record"
|
245
|
-
- label: 'Check MOT history of a vehicle'
|
246
|
-
href: /check-mot-history
|
247
|
-
popular_links_heading: Popular on GOV.UK
|
248
234
|
search_text: Search GOV.UK
|
249
235
|
metadata:
|
250
236
|
from: From
|
data/config/locales/es-419.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/et.yml
CHANGED
data/config/locales/fa.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/gd.yml
CHANGED
data/config/locales/gu.yml
CHANGED
data/config/locales/he.yml
CHANGED
data/config/locales/hi.yml
CHANGED
data/config/locales/hr.yml
CHANGED
data/config/locales/hu.yml
CHANGED
data/config/locales/hy.yml
CHANGED
data/config/locales/id.yml
CHANGED
data/config/locales/is.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/ja.yml
CHANGED
data/config/locales/ka.yml
CHANGED
data/config/locales/kk.yml
CHANGED
data/config/locales/ko.yml
CHANGED
data/config/locales/lt.yml
CHANGED
data/config/locales/lv.yml
CHANGED
data/config/locales/ms.yml
CHANGED
data/config/locales/mt.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/no.yml
CHANGED
data/config/locales/pa-pk.yml
CHANGED
data/config/locales/pa.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/ps.yml
CHANGED
data/config/locales/pt.yml
CHANGED
data/config/locales/ro.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/si.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/so.yml
CHANGED
data/config/locales/sq.yml
CHANGED
data/config/locales/sr.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/sw.yml
CHANGED
data/config/locales/ta.yml
CHANGED
data/config/locales/th.yml
CHANGED
data/config/locales/tk.yml
CHANGED
data/config/locales/tr.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/config/locales/ur.yml
CHANGED
data/config/locales/uz.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-hk.yml
CHANGED
data/config/locales/zh-tw.yml
CHANGED
data/config/locales/zh.yml
CHANGED
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: 37.
|
4
|
+
version: 37.9.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: 2024-03-
|
11
|
+
date: 2024-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -456,6 +456,7 @@ files:
|
|
456
456
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js
|
457
457
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js
|
458
458
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js
|
459
|
+
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-focus-loss-tracker.js
|
459
460
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js
|
460
461
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js
|
461
462
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js
|