govuk_publishing_components 35.18.0 → 35.20.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/images/govuk_publishing_components/icon-close.svg +1 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +7 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +8 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +14 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js +24 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js +4 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +3 -5
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +21 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +31 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +13 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -0
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +9 -13
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +6 -9
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +6 -10
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +14 -24
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +2 -6
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -4
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +4 -8
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +2 -4
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +4 -6
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +3 -3
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +6 -8
- data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -3
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +3 -3
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +6 -2
- data/lib/govuk_publishing_components/presenters/layout_footer_helper.rb +3 -5
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/axe.js +679 -11
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/locales/ja.json +12 -12
- data/node_modules/axe-core/package.json +1 -1
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1878b4cfefb05ba090334ac9990ead5cd73b519b0dd5086fa15d48715f7fc13
|
4
|
+
data.tar.gz: 3916e46d02628289d1667218a570c67b7b809c584da24064412cc948be37fd23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 764549f50e7ea206131c5cbbbe6ac12e693ed6a8e08c4e27ab2575eac6adf0788a725cda4790b388d58bb3f81884f98e6ff7902b57b906730db6b550cd60acee
|
7
|
+
data.tar.gz: 1d3a83a6d8fb0e602e5b3fdcb54713f79d83e7266b4aa1fe873c41f941489fcac11edac78e03d7ebf655d35aee37c5c4a7cd0c9fe690ec0305b5f4a68567138b
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none"><path fill="#0B0C0C" d="M2 15.435 15.435 2l2.121 2.121L4.121 17.556z"/><path fill="#0B0C0C" d="M15.436 17.557 2 4.122l2.12-2.121 13.436 13.435z"/></svg>
|
@@ -325,6 +325,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
325
325
|
var target = data.event.target
|
326
326
|
ecommerceSchema.search_results.ecommerce.items.push({
|
327
327
|
item_id: target.getAttribute('data-ga4-ecommerce-path'),
|
328
|
+
item_content_id: target.getAttribute('data-ga4-ecommerce-content-id') || undefined,
|
328
329
|
item_name: target.textContent,
|
329
330
|
item_list_name: listTitle,
|
330
331
|
index: window.GOVUK.analyticsGa4.core.ecommerceHelperFunctions.getIndex(target, startPosition)
|
@@ -335,6 +336,11 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
335
336
|
}
|
336
337
|
} else {
|
337
338
|
for (var i = 0; i < items.length; i++) {
|
339
|
+
// GA4 limits us to 200 items, so we should limit the array to this size.
|
340
|
+
if (i === 200) {
|
341
|
+
break
|
342
|
+
}
|
343
|
+
|
338
344
|
var item = items[i]
|
339
345
|
var path = item.getAttribute('data-ga4-ecommerce-path')
|
340
346
|
|
@@ -346,6 +352,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
346
352
|
|
347
353
|
ecommerceSchema.search_results.ecommerce.items.push({
|
348
354
|
item_id: path,
|
355
|
+
item_content_id: item.getAttribute('data-ga4-ecommerce-content-id') || undefined,
|
349
356
|
item_list_name: listTitle,
|
350
357
|
index: window.GOVUK.analyticsGa4.core.ecommerceHelperFunctions.getIndex(item, startPosition)
|
351
358
|
})
|
@@ -9,6 +9,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
9
9
|
this.trackingTrigger = 'data-ga4-form' // elements with this attribute get tracked
|
10
10
|
this.includeTextInputValues = this.module.hasAttribute('data-ga4-form-include-text')
|
11
11
|
this.redacted = false
|
12
|
+
this.useFallbackValue = this.module.hasAttribute('data-ga4-form-no-answer-undefined') ? undefined : 'No answer given'
|
12
13
|
}
|
13
14
|
|
14
15
|
Ga4FormTracker.prototype.init = function () {
|
@@ -43,7 +44,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
43
44
|
|
44
45
|
var formInputs = this.getFormInputs()
|
45
46
|
var formData = this.getInputValues(formInputs)
|
46
|
-
data.text = data.text ||
|
47
|
+
data.text = data.text || this.combineGivenAnswers(formData) || this.useFallbackValue
|
47
48
|
|
48
49
|
if (data.action === 'search') {
|
49
50
|
data.text = data.text.toLowerCase()
|
@@ -95,6 +95,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
95
95
|
data.external = trackFunctions.isExternalLink(data.url) ? 'true' : 'false'
|
96
96
|
data.index = this.setIndex(data.index, event.target)
|
97
97
|
|
98
|
+
// flatten the attributes in index into the main data
|
99
|
+
if (data.index) {
|
100
|
+
for (var prop in data.index) {
|
101
|
+
data[prop] = data.index[prop]
|
102
|
+
}
|
103
|
+
delete data.index
|
104
|
+
}
|
105
|
+
|
98
106
|
if (data.type === 'smart answer' && data.action === 'change response') {
|
99
107
|
data.section = this.PIIRemover.stripPIIWithOverride(data.section, true, true)
|
100
108
|
}
|
@@ -117,7 +125,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
117
125
|
if (target.getAttribute('data-ga4-index')) {
|
118
126
|
try {
|
119
127
|
var indexLink = JSON.parse(target.getAttribute('data-ga4-index'))
|
120
|
-
|
121
128
|
// Check whether the index object already exists on a parent element, as is the case with tracking accordion links.
|
122
129
|
// If true, combine data-ga4-index with the index object. Otherwise, just return indexLink
|
123
130
|
index = index ? window.GOVUK.extendObject(index, indexLink) : indexLink
|
@@ -126,7 +133,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
126
133
|
return
|
127
134
|
}
|
128
135
|
}
|
129
|
-
|
130
136
|
return index
|
131
137
|
}
|
132
138
|
|
@@ -20,6 +20,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
20
20
|
referrer: this.getReferrer(referrer),
|
21
21
|
title: this.getTitle(),
|
22
22
|
status_code: this.getStatusCode(),
|
23
|
+
viewport_size: this.getViewPort(),
|
23
24
|
|
24
25
|
ab_test: this.getMetaContent('ab-test'),
|
25
26
|
document_type: this.getMetaContent('format'),
|
@@ -89,6 +90,8 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
89
90
|
}
|
90
91
|
|
91
92
|
searchTerm = searchTerm[0].replace('keywords=', '')
|
93
|
+
searchTerm = searchTerm.replace(/\++/g, ' ')
|
94
|
+
searchTerm = window.GOVUK.analyticsGa4.core.trackFunctions.removeLinesAndExtraSpaces(searchTerm)
|
92
95
|
searchTerm = this.PIIRemover.stripPIIWithOverride(searchTerm, true, true)
|
93
96
|
return searchTerm
|
94
97
|
},
|
@@ -129,10 +132,20 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
129
132
|
}
|
130
133
|
},
|
131
134
|
|
135
|
+
getViewPort: function () {
|
136
|
+
var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
|
137
|
+
var vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
|
138
|
+
return vw + 'x' + vh
|
139
|
+
},
|
140
|
+
|
132
141
|
getMetaContent: function (name) {
|
133
142
|
var tag = document.querySelector('meta[name="govuk:' + name + '"]')
|
134
143
|
if (tag) {
|
135
|
-
|
144
|
+
var contentAttribute = tag.getAttribute('content')
|
145
|
+
if (contentAttribute === '') {
|
146
|
+
return undefined
|
147
|
+
}
|
148
|
+
return contentAttribute
|
136
149
|
} else {
|
137
150
|
return this.nullValue
|
138
151
|
}
|
data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
2
|
+
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
|
3
|
+
window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analyticsModules || {};
|
4
|
+
|
5
|
+
(function (analyticsModules) {
|
6
|
+
'use strict'
|
7
|
+
|
8
|
+
var Ga4PrintIntentTracker = {
|
9
|
+
init: function () {
|
10
|
+
window.addEventListener('beforeprint', function () {
|
11
|
+
var data = {
|
12
|
+
event_name: 'print_page',
|
13
|
+
type: 'print page',
|
14
|
+
method: 'browser print'
|
15
|
+
}
|
16
|
+
var schema = new window.GOVUK.analyticsGa4.Schemas()
|
17
|
+
schema = schema.mergeProperties(data, 'event_data')
|
18
|
+
window.GOVUK.analyticsGa4.core.sendData(schema)
|
19
|
+
})
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
analyticsModules.Ga4PrintIntentTracker = Ga4PrintIntentTracker
|
24
|
+
})(window.GOVUK.analyticsGa4.analyticsModules)
|
@@ -118,7 +118,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
118
118
|
// following will be undefined if tracking percentages
|
119
119
|
data.text = node.eventData.text
|
120
120
|
data.section = node.eventData.text
|
121
|
-
data.
|
121
|
+
data.index_section = node.eventData.index_section
|
122
|
+
data.index_section_count = node.eventData.index_section_count
|
122
123
|
// following will be undefined if tracking headings
|
123
124
|
data.percent_scrolled = node.eventData.percent_scrolled
|
124
125
|
|
@@ -165,10 +166,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
165
166
|
eventData: {
|
166
167
|
type: type,
|
167
168
|
text: heading.textContent.replace(/\s+/g, ' ').trim(),
|
168
|
-
|
169
|
-
|
170
|
-
index_section_count: totalHeadings
|
171
|
-
}
|
169
|
+
index_section: i + 1,
|
170
|
+
index_section_count: totalHeadings
|
172
171
|
}
|
173
172
|
})
|
174
173
|
}
|
@@ -3,6 +3,7 @@
|
|
3
3
|
//= require ./analytics-ga4/ga4-schemas
|
4
4
|
//= require ./analytics-ga4/pii-remover
|
5
5
|
//= require ./analytics-ga4/ga4-page-views
|
6
|
+
//= require ./analytics-ga4/ga4-print-intent-tracker
|
6
7
|
//= require ./analytics-ga4/ga4-specialist-link-tracker
|
7
8
|
//= require ./analytics-ga4/ga4-link-tracker
|
8
9
|
//= require ./analytics-ga4/ga4-event-tracker
|
@@ -62,7 +62,7 @@ window.GOVUK.Modules.GovukAccordion = window.GOVUKFrontend.Accordion;
|
|
62
62
|
var isGa4Enabled = dataModule ? dataModule.indexOf('ga4-event-tracker') !== -1 : false
|
63
63
|
if (isGa4Enabled) {
|
64
64
|
var indexTotal = this.$module.querySelectorAll('.govuk-accordion__section').length
|
65
|
-
var showAllAttributesGa4 = { event_name: 'select_content', type: 'accordion',
|
65
|
+
var showAllAttributesGa4 = { event_name: 'select_content', type: 'accordion', index_section: 0, index_section_count: indexTotal }
|
66
66
|
showAll = this.$module.querySelector(this.showAllControls)
|
67
67
|
showAll.setAttribute('data-ga4-event', JSON.stringify(showAllAttributesGa4))
|
68
68
|
}
|
@@ -84,7 +84,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
84
84
|
|
85
85
|
// if GA4 is enabled, set attributes on 'show all sections' for tracking using ga4-event-tracker
|
86
86
|
if (this.$module.isGa4Enabled) {
|
87
|
-
var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step',
|
87
|
+
var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step', index_section: 0, index_section_count: this.$module.totalSteps }
|
88
88
|
this.$module.showOrHideAllButton.setAttribute('data-ga4-event', JSON.stringify(showAllAttributesGa4))
|
89
89
|
}
|
90
90
|
}
|
@@ -196,10 +196,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
196
196
|
event_name: 'select_content',
|
197
197
|
type: 'step by step',
|
198
198
|
text: titleText.trim(),
|
199
|
-
|
200
|
-
|
201
|
-
index_section_count: this.$module.totalSteps
|
202
|
-
},
|
199
|
+
index_section: i + 1,
|
200
|
+
index_section_count: this.$module.totalSteps,
|
203
201
|
index_total: thisel.querySelectorAll('a').length
|
204
202
|
}
|
205
203
|
|
@@ -366,11 +366,9 @@
|
|
366
366
|
if (!entry.hadRecentInput) {
|
367
367
|
var firstEntry = sessionEntries[0];
|
368
368
|
var latestEntry = sessionEntries[sessionEntries.length - 1];
|
369
|
-
if (sessionEntries.length &&
|
370
|
-
|
371
|
-
|
372
|
-
sessionValue = entry.value;
|
373
|
-
sessionEntries = [entry];
|
369
|
+
if (sessionEntries.length && (entry.startTime - latestEntry.startTime >= 1000 || entry.startTime - firstEntry.startTime >= 5000)) {
|
370
|
+
sessionValue = entry.value;
|
371
|
+
sessionEntries = [entry];
|
374
372
|
}
|
375
373
|
else {
|
376
374
|
sessionValue += entry.value;
|
@@ -445,7 +443,8 @@
|
|
445
443
|
|
446
444
|
var ALL_ENTRIES = [];
|
447
445
|
function observe(type, callback, options) {
|
448
|
-
if (typeof PerformanceObserver === "function" &&
|
446
|
+
if (typeof PerformanceObserver === "function" &&
|
447
|
+
PerformanceObserver.supportedEntryTypes.includes(type)) {
|
449
448
|
var po = new PerformanceObserver(function (list) {
|
450
449
|
list.getEntries().forEach(function (entry) { return callback(entry); });
|
451
450
|
});
|
@@ -547,7 +546,7 @@
|
|
547
546
|
// -------------------------------------------------------------------------
|
548
547
|
/// End
|
549
548
|
// -------------------------------------------------------------------------
|
550
|
-
var SCRIPT_VERSION = "
|
549
|
+
var SCRIPT_VERSION = "312";
|
551
550
|
var logger = new Logger();
|
552
551
|
var globalConfig = fromObject(LUX);
|
553
552
|
logger.logEvent(LogEvent.EvaluationStart, [SCRIPT_VERSION]);
|
@@ -695,7 +694,7 @@
|
|
695
694
|
// Record the FIRST input delay.
|
696
695
|
function recordDelay(delay) {
|
697
696
|
if (!gFirstInputDelay) {
|
698
|
-
gFirstInputDelay = delay;
|
697
|
+
gFirstInputDelay = floor(delay);
|
699
698
|
// remove event listeners
|
700
699
|
gaEventTypes.forEach(function (eventType) {
|
701
700
|
removeEventListener(eventType, onInput, ghListenerOptions);
|
@@ -1265,10 +1264,7 @@
|
|
1265
1264
|
var num = 0;
|
1266
1265
|
for (var i = 0, len = aElems.length; i < len; i++) {
|
1267
1266
|
var e = aElems[i];
|
1268
|
-
if (e.src &&
|
1269
|
-
!e.async &&
|
1270
|
-
!e.defer &&
|
1271
|
-
0 !== (e.compareDocumentPosition(lastViewportElem) & 4)) {
|
1267
|
+
if (e.src && !e.async && !e.defer && 0 !== (e.compareDocumentPosition(lastViewportElem) & 4)) {
|
1272
1268
|
// If the script has a SRC and async is false and it occurs BEFORE the last viewport element,
|
1273
1269
|
// then increment the counter.
|
1274
1270
|
num++;
|
@@ -1498,8 +1494,6 @@
|
|
1498
1494
|
}
|
1499
1495
|
return getHighPercentileINP();
|
1500
1496
|
}
|
1501
|
-
// function simplified for our use, original would get the customerid from the script src URL
|
1502
|
-
// but we set it inside the code in this file, so this function just returns that
|
1503
1497
|
function getCustomerId() {
|
1504
1498
|
return LUX.customerid || "";
|
1505
1499
|
}
|
@@ -1609,12 +1603,7 @@
|
|
1609
1603
|
var vw = document.documentElement.clientWidth;
|
1610
1604
|
// Return true if the top-left corner is in the viewport and it has width & height.
|
1611
1605
|
var lt = findPos(e);
|
1612
|
-
return (lt[0] >= 0 &&
|
1613
|
-
lt[1] >= 0 &&
|
1614
|
-
lt[0] < vw &&
|
1615
|
-
lt[1] < vh &&
|
1616
|
-
e.offsetWidth > 0 &&
|
1617
|
-
e.offsetHeight > 0);
|
1606
|
+
return (lt[0] >= 0 && lt[1] >= 0 && lt[0] < vw && lt[1] < vh && e.offsetWidth > 0 && e.offsetHeight > 0);
|
1618
1607
|
}
|
1619
1608
|
// Return an array containing the top & left coordinates of the element.
|
1620
1609
|
// from http://www.quirksmode.org/js/findpos.html
|
@@ -1838,7 +1827,7 @@
|
|
1838
1827
|
!gSyncId ||
|
1839
1828
|
!_sample() || // OUTSIDE the sampled range
|
1840
1829
|
!gbLuxSent // LUX has NOT been sent yet, so wait to include it there
|
1841
|
-
|
1830
|
+
) {
|
1842
1831
|
return;
|
1843
1832
|
}
|
1844
1833
|
var sCustomerData = valuesToString(getUpdatedCustomData());
|
@@ -2083,6 +2072,14 @@
|
|
2083
2072
|
// Set "LUX.auto=false" to disable send results automatically and
|
2084
2073
|
// instead you must call LUX.send() explicitly.
|
2085
2074
|
if (globalConfig.auto) {
|
2075
|
+
var sendBeaconWhenVisible_1 = function () {
|
2076
|
+
if (globalConfig.trackHiddenPages) {
|
2077
|
+
_sendLux();
|
2078
|
+
}
|
2079
|
+
else {
|
2080
|
+
onVisible(_sendLux);
|
2081
|
+
}
|
2082
|
+
};
|
2086
2083
|
var sendBeaconAfterMinimumMeasureTime_1 = function () {
|
2087
2084
|
var elapsedTime = _now();
|
2088
2085
|
var timeRemaining = globalConfig.minMeasureTime - elapsedTime;
|
@@ -2093,12 +2090,12 @@
|
|
2093
2090
|
]);
|
2094
2091
|
if (document.readyState === "complete") {
|
2095
2092
|
// If onload has already passed, send the beacon now.
|
2096
|
-
|
2093
|
+
sendBeaconWhenVisible_1();
|
2097
2094
|
}
|
2098
2095
|
else {
|
2099
2096
|
// Ow, send the beacon slightly after window.onload.
|
2100
2097
|
addListener("load", function () {
|
2101
|
-
setTimeout(
|
2098
|
+
setTimeout(sendBeaconWhenVisible_1, 200);
|
2102
2099
|
});
|
2103
2100
|
}
|
2104
2101
|
}
|
@@ -2107,14 +2104,7 @@
|
|
2107
2104
|
setTimeout(sendBeaconAfterMinimumMeasureTime_1, timeRemaining);
|
2108
2105
|
}
|
2109
2106
|
};
|
2110
|
-
|
2111
|
-
// The trackHiddenPages config forces the beacon to be sent even when the page is not visible.
|
2112
|
-
sendBeaconAfterMinimumMeasureTime_1();
|
2113
|
-
}
|
2114
|
-
else {
|
2115
|
-
// Otherwise we only send the beacon when the page is visible.
|
2116
|
-
onVisible(sendBeaconAfterMinimumMeasureTime_1);
|
2117
|
-
}
|
2107
|
+
sendBeaconAfterMinimumMeasureTime_1();
|
2118
2108
|
}
|
2119
2109
|
// When newBeaconOnPageShow = true, we initiate a new page view whenever a page is restored from
|
2120
2110
|
// bfcache. Since we have no "onload" event to hook into after a bfcache restore, we rely on the
|
@@ -14,8 +14,8 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey", $legacy: "grey-3");
|
|
14
14
|
@include govuk-clearfix;
|
15
15
|
position: relative;
|
16
16
|
|
17
|
-
.govuk-
|
18
|
-
|
17
|
+
.govuk-details {
|
18
|
+
margin: govuk-spacing(3) 0;
|
19
19
|
}
|
20
20
|
}
|
21
21
|
|
@@ -41,13 +41,6 @@
|
|
41
41
|
}
|
42
42
|
}
|
43
43
|
|
44
|
-
@include govuk-media-query($from: tablet) {
|
45
|
-
.gem-c-image-card.gem-c-image-card--two-thirds {
|
46
|
-
margin: 0 (- govuk-spacing(3)) govuk-spacing(6) (- govuk-spacing(3));
|
47
|
-
display: block;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
44
|
@include govuk-media-query($from: mobile, $until: tablet) {
|
52
45
|
.gem-c-image-card {
|
53
46
|
margin: 0 (- govuk-spacing(3)) govuk-spacing(6) (- govuk-spacing(3));
|
@@ -77,7 +70,6 @@
|
|
77
70
|
|
78
71
|
.gem-c-image-card__text-wrapper.gem-c-image-card__text-wrapper--two-thirds {
|
79
72
|
@include govuk-grid-column($width: two-thirds, $float: right, $at: tablet);
|
80
|
-
padding-left: 0;
|
81
73
|
}
|
82
74
|
}
|
83
75
|
|
@@ -91,6 +83,37 @@
|
|
91
83
|
border-bottom: none;
|
92
84
|
}
|
93
85
|
|
86
|
+
.gem-c-image-card.gem-c-image-card--two-thirds {
|
87
|
+
// Change default flex-direction from column-reverse
|
88
|
+
// so that the image and text appear in the same row,
|
89
|
+
// with the image to the left
|
90
|
+
flex-direction: row-reverse;
|
91
|
+
-ms-flex-direction: row-reverse;
|
92
|
+
// Wrap flex items onto a new line and ensure
|
93
|
+
// that items are aligned correctly
|
94
|
+
flex-wrap: wrap-reverse;
|
95
|
+
-ms-flex-wrap: wrap-reverse;
|
96
|
+
justify-content: flex-end;
|
97
|
+
align-items: flex-end;
|
98
|
+
}
|
99
|
+
|
100
|
+
.gem-c-image-card__image-wrapper.gem-c-image-card__image-wrapper--one-third {
|
101
|
+
// The first two values set flex-grow and flex-basis to 0
|
102
|
+
// This ensures that the flex item does not grow or shrink
|
103
|
+
// The the last value, sets flex-basis to 95px
|
104
|
+
// padding-left is set to 15px and the image used is 80px wide
|
105
|
+
flex: 0 0 95px;
|
106
|
+
padding-right: 0;
|
107
|
+
}
|
108
|
+
|
109
|
+
.gem-c-image-card__text-wrapper.gem-c-image-card__text-wrapper--two-thirds {
|
110
|
+
// The first two values set flex-grow and flex-basis to 1
|
111
|
+
// This allows the flex item contain the image card text to grow or shrink
|
112
|
+
// The last value, sets flex-basis to 70%
|
113
|
+
// If the width of the flex-item shrinks below 70%, it will wrap onto a new line
|
114
|
+
flex: 1 1 70%;
|
115
|
+
}
|
116
|
+
|
94
117
|
.gem-c-image-card__title {
|
95
118
|
margin: 0;
|
96
119
|
}
|
@@ -877,6 +877,13 @@ $after-button-padding-left: govuk-spacing(4);
|
|
877
877
|
}
|
878
878
|
}
|
879
879
|
|
880
|
+
// Ensure the total space to the left of the logo for mobile screen sizes is 24px (margin is 15px)
|
881
|
+
@include govuk-media-query($until: tablet) {
|
882
|
+
.gem-c-layout-super-navigation-header__header-logo--large-navbar {
|
883
|
+
padding-left: 9px;
|
884
|
+
}
|
885
|
+
}
|
886
|
+
|
880
887
|
@include govuk-media-query($from: desktop) {
|
881
888
|
// can't use govuk-spacing here because the navbar height
|
882
889
|
// isn't a multiple of 5 :(
|
@@ -91,6 +91,19 @@ $large-input-size: 50px;
|
|
91
91
|
&:focus {
|
92
92
|
@include gem-c-search-input-focus;
|
93
93
|
}
|
94
|
+
|
95
|
+
// Note: this is a non-standard CSS feature and will not do anything in Firefox. https://bugzilla.mozilla.org/show_bug.cgi?id=1417753
|
96
|
+
&::-webkit-search-cancel-button {
|
97
|
+
-webkit-appearance: none;
|
98
|
+
background-image: image-url("govuk_publishing_components/icon-close.svg");
|
99
|
+
background-position: center;
|
100
|
+
background-repeat: no-repeat;
|
101
|
+
cursor: pointer;
|
102
|
+
height: 20px;
|
103
|
+
margin-left: 0;
|
104
|
+
margin-right: 0;
|
105
|
+
width: 20px;
|
106
|
+
}
|
94
107
|
}
|
95
108
|
|
96
109
|
@mixin icon-positioning($container-size) {
|
data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
// Scope attachment and attachment-link component styles to gem-c-govspeak
|
13
13
|
@import "../attachment-link";
|
14
14
|
@import "../attachment";
|
15
|
+
@import "../details";
|
15
16
|
|
16
17
|
// This block is duplicated from Whitehall as a transitional step, see the
|
17
18
|
// commit message for 2d893c10ee3f2cab27162b9aba38b12379a71d07 before making
|
@@ -46,14 +46,12 @@
|
|
46
46
|
event_name: "select_content",
|
47
47
|
type: "accordion",
|
48
48
|
text: heading_text,
|
49
|
-
|
50
|
-
|
51
|
-
index_section_count: items.length,
|
52
|
-
},
|
49
|
+
index_section: index,
|
50
|
+
index_section_count: items.length,
|
53
51
|
}.to_json
|
54
52
|
|
55
|
-
# These attributes have been created separately from the item[:data_attributes]
|
56
|
-
# object in order to keep them from colliding with GA4 event tracking and UA
|
53
|
+
# These attributes have been created separately from the item[:data_attributes]
|
54
|
+
# object in order to keep them from colliding with GA4 event tracking and UA
|
57
55
|
# tracking attributes
|
58
56
|
ga4_link_data_attributes = {}
|
59
57
|
ga4_link_data_attributes[:module] = "ga4-link-tracker"
|
@@ -63,10 +61,8 @@
|
|
63
61
|
event_name: "navigation",
|
64
62
|
type: "accordion",
|
65
63
|
section: heading_text,
|
66
|
-
|
67
|
-
|
68
|
-
index_section_count: (items.length),
|
69
|
-
}
|
64
|
+
index_section: index,
|
65
|
+
index_section_count: (items.length),
|
70
66
|
}.to_json
|
71
67
|
end
|
72
68
|
|
@@ -94,9 +90,9 @@
|
|
94
90
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
95
91
|
<% end %>
|
96
92
|
<%= tag.div(
|
97
|
-
item[:content][:html],
|
98
|
-
id: "#{id}-content-#{index}",
|
99
|
-
class: "govuk-accordion__section-content",
|
93
|
+
item[:content][:html],
|
94
|
+
id: "#{id}-content-#{index}",
|
95
|
+
class: "govuk-accordion__section-content",
|
100
96
|
'aria-labelledby': "#{id}-heading-#{index}",
|
101
97
|
data: ga4_link_data_attributes
|
102
98
|
) %>
|
@@ -16,7 +16,8 @@
|
|
16
16
|
ga4_data = {
|
17
17
|
event_name: "navigation",
|
18
18
|
section: t("components.contents_list.contents", locale: :en) || "",
|
19
|
-
|
19
|
+
type: "contents list",
|
20
|
+
index_total: cl_helper.get_index_total,
|
20
21
|
} if ga4_tracking
|
21
22
|
local_assigns[:aria] ||= {}
|
22
23
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
@@ -42,10 +43,8 @@
|
|
42
43
|
<li class="<%= cl_helper.list_item_classes(contents_item, false) %>" <%= "aria-current=true" if contents_item[:active] %>>
|
43
44
|
<% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : contents_item[:text]
|
44
45
|
if ga4_tracking
|
45
|
-
ga4_data[:
|
46
|
-
|
47
|
-
}
|
48
|
-
ga4_data[:type] = cl_helper.get_ga4_type(contents_item[:href]) if contents_item[:href]
|
46
|
+
ga4_data[:event_name] = cl_helper.get_ga4_event_name(contents_item[:href]) if contents_item[:href]
|
47
|
+
ga4_data[:index_link] = index_link
|
49
48
|
end
|
50
49
|
%>
|
51
50
|
<%= link_to_if !contents_item[:active], link_text, contents_item[:href],
|
@@ -67,10 +66,8 @@
|
|
67
66
|
<li class="<%= cl_helper.list_item_classes(nested_contents_item, true) %>" <%= "aria-current=true" if nested_contents_item[:active] %>>
|
68
67
|
<%
|
69
68
|
if ga4_tracking
|
70
|
-
ga4_data[:
|
71
|
-
|
72
|
-
}
|
73
|
-
ga4_data[:type] = cl_helper.get_ga4_type(nested_contents_item[:href]) if nested_contents_item[:href]
|
69
|
+
ga4_data[:event_name] = cl_helper.get_ga4_event_name(nested_contents_item[:href]) if nested_contents_item[:href]
|
70
|
+
ga4_data[:index_link] = index_link
|
74
71
|
end
|
75
72
|
%>
|
76
73
|
<%= link_to_if !nested_contents_item[:active], nested_contents_item[:text], nested_contents_item[:href],
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<%
|
2
2
|
add_gem_component_stylesheet("govspeak")
|
3
|
+
|
3
4
|
inverse ||= false
|
4
5
|
direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
|
5
6
|
disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
ga4_tracking ||= false
|
36
36
|
suggestion_data_attributes[:module] = "#{suggestion_data_attributes[:module]} ga4-link-tracker".strip if ga4_tracking
|
37
|
-
suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text,
|
37
|
+
suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text, index_link: 1, index_total: 1 }.to_json if ga4_tracking
|
38
38
|
data_attributes[:ga4_intervention_banner] = "" if ga4_tracking # Added to the parent element for the GA4 pageview object to use
|
39
39
|
|
40
40
|
suggestion_tag_options = {
|
@@ -107,11 +107,9 @@
|
|
107
107
|
data-ga4-link="<%= {
|
108
108
|
"event_name": "navigation",
|
109
109
|
"section": "Licence",
|
110
|
-
"
|
111
|
-
|
112
|
-
|
113
|
-
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
114
|
-
},
|
110
|
+
"index_section": layout_footer_helper.ga4_ogl_link_index_section.to_s,
|
111
|
+
"index_link": "1",
|
112
|
+
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
115
113
|
"text": "Open Government Licence v3.0",
|
116
114
|
"index_total": "1",
|
117
115
|
"type": "footer",
|
@@ -132,11 +130,9 @@
|
|
132
130
|
data-ga4-link="<%= {
|
133
131
|
"event_name": "navigation",
|
134
132
|
"section": "Copyright",
|
135
|
-
"
|
136
|
-
|
137
|
-
|
138
|
-
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
139
|
-
},
|
133
|
+
"index_section": layout_footer_helper.ga4_copyright_link_index_section.to_s,
|
134
|
+
"index_link": "1",
|
135
|
+
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
140
136
|
"text": "© Crown copyright",
|
141
137
|
"index_total": "1",
|
142
138
|
"type": "footer",
|