govuk_publishing_components 70.0.0 → 70.0.1
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +29 -18
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +4 -60
- data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +8 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +4 -0
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +19 -16
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +0 -2
- data/app/views/govuk_publishing_components/components/docs/cross_service_header.yml +0 -1
- data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +0 -1
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -2
- data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +0 -2
- data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +0 -2
- data/app/views/govuk_publishing_components/components/docs/service_navigation.yml +0 -1
- data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +9 -6
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8ba839c9e37ab74e7b66ba8b6b32e81b9c99f1ad3b31ad8425a0c2e91e7df7f
|
|
4
|
+
data.tar.gz: 635783cf55c655079398c02c541a4aa09a7ecb67c8a8b8b1802e06f4e327806a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aae0a87278ac959798cbfa23c6c5884c1e2edc33918d963acb45cdf8b7a3656233912a4d67b605bc0cef5e567f9471bcab96d78d6970877f8f75a03f4721a85a
|
|
7
|
+
data.tar.gz: 96f01ce33679f119d9d9d77462d762f3a9bba38413bd640b5ef46b72f70d5d274fc3435e3f586f71fa5804e7d556020d5948ae91279e535ca3caa20c9f2840a8
|
|
@@ -108,29 +108,40 @@
|
|
|
108
108
|
GemToggle.prototype.toggleOnClick = function () {
|
|
109
109
|
var that = this
|
|
110
110
|
|
|
111
|
+
this.$module.toggleTrigger.addEventListener('keydown', function (event) {
|
|
112
|
+
if (event.key === ' ') {
|
|
113
|
+
event.preventDefault()
|
|
114
|
+
that.toggle(this)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
111
118
|
this.$module.toggleTrigger.addEventListener('click', function (event) {
|
|
112
119
|
event.preventDefault()
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.setAttribute('aria-expanded', false)
|
|
117
|
-
for (var i = 0; i < that.$module.targets.length; i++) {
|
|
118
|
-
that.$module.targets[i].classList.add(that.$module.toggleClass)
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
121
|
-
this.setAttribute('aria-expanded', true)
|
|
122
|
-
for (var j = 0; j < that.$module.targets.length; j++) {
|
|
123
|
-
that.$module.targets[j].classList.remove(that.$module.toggleClass)
|
|
124
|
-
}
|
|
125
|
-
}
|
|
120
|
+
that.toggle(this)
|
|
121
|
+
})
|
|
122
|
+
}
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
GemToggle.prototype.toggle = function ($trigger) {
|
|
125
|
+
var expanded = $trigger.getAttribute('aria-expanded') === 'true'
|
|
128
126
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
if (expanded) {
|
|
128
|
+
$trigger.setAttribute('aria-expanded', false)
|
|
129
|
+
for (var i = 0; i < this.$module.targets.length; i++) {
|
|
130
|
+
this.$module.targets[i].classList.add(this.$module.toggleClass)
|
|
132
131
|
}
|
|
133
|
-
}
|
|
132
|
+
} else {
|
|
133
|
+
$trigger.setAttribute('aria-expanded', true)
|
|
134
|
+
for (var j = 0; j < this.$module.targets.length; j++) {
|
|
135
|
+
this.$module.targets[j].classList.remove(this.$module.toggleClass)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
var toggledText = $trigger.getAttribute('data-toggled-text')
|
|
140
|
+
|
|
141
|
+
if (typeof toggledText === 'string') {
|
|
142
|
+
$trigger.setAttribute('data-toggled-text', $trigger.innerHTML)
|
|
143
|
+
$trigger.innerHTML = toggledText
|
|
144
|
+
}
|
|
134
145
|
}
|
|
135
146
|
|
|
136
147
|
Modules.GemToggle = GemToggle
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
return sendBeaconImpl(url, data);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
var version = "4.5.
|
|
301
|
+
var version = "4.5.2";
|
|
302
302
|
var pkg = {
|
|
303
303
|
version: version};
|
|
304
304
|
|
|
@@ -1377,10 +1377,8 @@
|
|
|
1377
1377
|
observe("element", processAndLogEntry);
|
|
1378
1378
|
observe("paint", processAndLogEntry);
|
|
1379
1379
|
if (observe("largest-contentful-paint", function (entry) {
|
|
1380
|
-
// Process the LCP entry for the legacy beacon
|
|
1381
|
-
processAndLogEntry(entry);
|
|
1382
|
-
// Process the LCP entry for the new beacon
|
|
1383
1380
|
processEntry(entry);
|
|
1381
|
+
logEntry(entry);
|
|
1384
1382
|
})) {
|
|
1385
1383
|
beaconCollectors[push]([BeaconMetricKey.LCP, getData$2]);
|
|
1386
1384
|
}
|
|
@@ -2129,7 +2127,6 @@
|
|
|
2129
2127
|
var navEntry_1 = getNavigationEntry();
|
|
2130
2128
|
var startRender = getStartRender();
|
|
2131
2129
|
var fcp = getFcp();
|
|
2132
|
-
var lcp = getLcp();
|
|
2133
2130
|
var prefixNTValue = function (key, prefix, ignoreZero) {
|
|
2134
2131
|
if (typeof navEntry_1[key] === "number") {
|
|
2135
2132
|
var value = navEntry_1[key];
|
|
@@ -2178,7 +2175,6 @@
|
|
|
2178
2175
|
loadEventEndStr,
|
|
2179
2176
|
typeof startRender !== "undefined" ? "sr" + startRender : "",
|
|
2180
2177
|
typeof fcp !== "undefined" ? "fc" + fcp : "",
|
|
2181
|
-
typeof lcp !== "undefined" ? "lc" + lcp : "",
|
|
2182
2178
|
].join("");
|
|
2183
2179
|
}
|
|
2184
2180
|
else if (endMark) {
|
|
@@ -2210,19 +2206,6 @@
|
|
|
2210
2206
|
}
|
|
2211
2207
|
return undefined;
|
|
2212
2208
|
}
|
|
2213
|
-
// Return Largest Contentful Paint or undefined if not supported.
|
|
2214
|
-
function getLcp() {
|
|
2215
|
-
var lcpEntries = getEntries("largest-contentful-paint");
|
|
2216
|
-
if (lcpEntries[length]) {
|
|
2217
|
-
var lastEntry = lcpEntries[lcpEntries[length] - 1];
|
|
2218
|
-
var value = processTimeMetric(lastEntry[startTime$1]);
|
|
2219
|
-
if (shouldReportValue(value)) {
|
|
2220
|
-
logger.logEvent(43 /* LogEvent.PerformanceEntryProcessed */, [lastEntry]);
|
|
2221
|
-
return value;
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
return undefined;
|
|
2225
|
-
}
|
|
2226
2209
|
// Return best guess at Start Render time (in ms).
|
|
2227
2210
|
// Mostly works on just Chrome and IE.
|
|
2228
2211
|
// Return undefined if not supported.
|
|
@@ -2247,33 +2230,6 @@
|
|
|
2247
2230
|
logger.logEvent(72 /* LogEvent.PaintTimingNotSupported */);
|
|
2248
2231
|
return undefined;
|
|
2249
2232
|
}
|
|
2250
|
-
function getINPDetails() {
|
|
2251
|
-
if (!("PerformanceEventTiming" in self)) {
|
|
2252
|
-
return undefined;
|
|
2253
|
-
}
|
|
2254
|
-
return getHighPercentileInteraction();
|
|
2255
|
-
}
|
|
2256
|
-
/**
|
|
2257
|
-
* Build the query string for the INP parameters:
|
|
2258
|
-
*
|
|
2259
|
-
* - INP: The duration of the P98 interaction
|
|
2260
|
-
* - INPs: The selector of the P98 interaction element
|
|
2261
|
-
* - INPt: The timestamp of the P98 interaction start time
|
|
2262
|
-
* - INPi: The input delay subpart of the P98 interaction
|
|
2263
|
-
* - INPp: The processing time subpart of the P98 interaction
|
|
2264
|
-
* - INPd: The presentation delay subpart of the P98 interaction
|
|
2265
|
-
*/
|
|
2266
|
-
function getINPString(details) {
|
|
2267
|
-
return [
|
|
2268
|
-
"&INP=" + details[duration],
|
|
2269
|
-
details[selector] ? "&INPs=" + encodeURIComponent(details[selector]) : "",
|
|
2270
|
-
"&INPt=" + floor(details[startTime$1]),
|
|
2271
|
-
"&INPi=" + clamp(floor(details[processingStart] - details[startTime$1])),
|
|
2272
|
-
"&INPp=" + clamp(floor(details[processingTime])),
|
|
2273
|
-
"&INPd=" +
|
|
2274
|
-
clamp(floor(details[startTime$1] + details[duration] - details[processingEnd])),
|
|
2275
|
-
].join("");
|
|
2276
|
-
}
|
|
2277
2233
|
function getCustomerId() {
|
|
2278
2234
|
return String(_thisCustomerId);
|
|
2279
2235
|
}
|
|
@@ -2493,20 +2449,13 @@
|
|
|
2493
2449
|
addCustomDataValue("_" + key, trackingParams[key]);
|
|
2494
2450
|
}
|
|
2495
2451
|
var sIx = "";
|
|
2496
|
-
var INP = getINPDetails();
|
|
2497
2452
|
// If we haven't already sent an interaction beacon, check for interaction metrics and include
|
|
2498
2453
|
// them in the main beacon.
|
|
2499
2454
|
if (!gbIxSent) {
|
|
2500
2455
|
sIx = ixValues();
|
|
2501
|
-
if (sIx === "") {
|
|
2502
|
-
// If there are no interaction metrics, we wait to send INP with the IX beacon to increase
|
|
2503
|
-
// the chance that we capture a valid INP.
|
|
2504
|
-
INP = undefined;
|
|
2505
|
-
}
|
|
2506
2456
|
}
|
|
2507
2457
|
var sET = elementTimingValues(); // Element Timing data
|
|
2508
2458
|
var sCPU = cpuTimes();
|
|
2509
|
-
var clsData = getData$5(globalConfig);
|
|
2510
2459
|
var sLuxjs = selfLoading();
|
|
2511
2460
|
if (!isVisible()) {
|
|
2512
2461
|
gFlags = addFlag(gFlags, 8 /* Flags.VisibilityStateNotVisible */);
|
|
@@ -2585,10 +2534,7 @@
|
|
|
2585
2534
|
(sIx ? "&IX=" + sIx : "") +
|
|
2586
2535
|
(typeof gFirstInputDelay !== "undefined" ? "&FID=" + gFirstInputDelay : "") +
|
|
2587
2536
|
(sCPU ? "&CPU=" + sCPU : "") +
|
|
2588
|
-
(sET ? "&ET=" + sET : "")
|
|
2589
|
-
(clsData ? "&CLS=" + clsData.value.toFixed(6) : "") +
|
|
2590
|
-
// INP and sub-parts
|
|
2591
|
-
(INP ? getINPString(INP) : "");
|
|
2537
|
+
(sET ? "&ET=" + sET : ""); // element timing
|
|
2592
2538
|
// We add the user timing entries last so that we can split them to reduce the URL size if necessary.
|
|
2593
2539
|
var utValues = userTimingValues();
|
|
2594
2540
|
var _b = fitUserTimingEntries(utValues, globalConfig, baseUrl + metricsQueryString), beaconUtValues = _b[0], remainingUtValues = _b[1];
|
|
@@ -2627,13 +2573,11 @@
|
|
|
2627
2573
|
return;
|
|
2628
2574
|
}
|
|
2629
2575
|
var sIx = ixValues(); // Interaction Metrics
|
|
2630
|
-
var INP = getINPDetails();
|
|
2631
2576
|
if (sIx) {
|
|
2632
2577
|
var beaconUrl = _getBeaconUrl(getUpdatedCustomData()) +
|
|
2633
2578
|
"&IX=" +
|
|
2634
2579
|
sIx +
|
|
2635
|
-
(typeof gFirstInputDelay !== "undefined" ? "&FID=" + gFirstInputDelay : "")
|
|
2636
|
-
(typeof INP !== "undefined" ? getINPString(INP) : "");
|
|
2580
|
+
(typeof gFirstInputDelay !== "undefined" ? "&FID=" + gFirstInputDelay : "");
|
|
2637
2581
|
logger.logEvent(25 /* LogEvent.InteractionBeaconSent */, [beaconUrl]);
|
|
2638
2582
|
_sendBeacon(beaconUrl);
|
|
2639
2583
|
gbIxSent = 1;
|
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
padding-left: govuk-spacing(4);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
.govuk-details__summary::before {
|
|
84
|
+
@include govuk-shape-arrow($direction: right, $base: 12px);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&[open] .govuk-details__summary::before {
|
|
88
|
+
@include govuk-shape-arrow($direction: down, $base: 12px);
|
|
89
|
+
}
|
|
90
|
+
|
|
83
91
|
.govuk-details__summary-text,
|
|
84
92
|
.govuk-details__text {
|
|
85
93
|
@include govuk-font(16);
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
<% if from.any? %>
|
|
57
57
|
<dt class="gem-c-metadata__term"><%= t("components.metadata.from") %>:</dt>
|
|
58
58
|
<dd class="gem-c-metadata__definition">
|
|
59
|
-
<%= render "govuk_publishing_components/components/metadata/sentence", items: from, toggle_id: "from-#{SecureRandom.hex(4)}" %>
|
|
59
|
+
<%= render "govuk_publishing_components/components/metadata/sentence", items: from, toggle_id: "from-#{SecureRandom.hex(4)}", inverse: inverse %>
|
|
60
60
|
</dd>
|
|
61
61
|
<% end %>
|
|
62
62
|
<% if part_of.any? %>
|
|
63
63
|
<dt class="gem-c-metadata__term"><%= t("components.metadata.part_of") %>:</dt>
|
|
64
64
|
<dd class="gem-c-metadata__definition">
|
|
65
|
-
<%= render "govuk_publishing_components/components/metadata/sentence", items: part_of, toggle_id: "part-of-#{SecureRandom.hex(4)}" %>
|
|
65
|
+
<%= render "govuk_publishing_components/components/metadata/sentence", items: part_of, toggle_id: "part-of-#{SecureRandom.hex(4)}", inverse: inverse %>
|
|
66
66
|
</dd>
|
|
67
67
|
<% end %>
|
|
68
68
|
<% if local_assigns.include?(:history) %>
|
|
@@ -84,19 +84,22 @@
|
|
|
84
84
|
</a>
|
|
85
85
|
<% end %>
|
|
86
86
|
<% if page_history.any? %>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
<div class="gem-c-metadata__details-wrapper">
|
|
88
|
+
<%= render "govuk_publishing_components/components/details", {
|
|
89
|
+
title: t("components.metadata.show_all_updates", locale: :en),
|
|
90
|
+
small: true,
|
|
91
|
+
inverse: inverse,
|
|
92
|
+
} do %>
|
|
93
|
+
<ol class="gem-c-metadata__change-history">
|
|
94
|
+
<% page_history.each do |change| %>
|
|
95
|
+
<li class="gem-c-metadata__change-history-item">
|
|
96
|
+
<time class="gem-c-metadata__change-date" datetime="<%= change[:timestamp] %>"><%= change[:display_time] %></time>
|
|
97
|
+
<p class="gem-c-metadata__change-note"><%= change[:note].strip %></p>
|
|
98
|
+
</li>
|
|
99
|
+
<% end %>
|
|
100
|
+
</ol>
|
|
101
|
+
<% end %>
|
|
102
|
+
</div>
|
|
100
103
|
<% end %>
|
|
101
104
|
</dd>
|
|
102
105
|
<% end %>
|
|
@@ -113,7 +116,7 @@
|
|
|
113
116
|
data-module="ga4-link-tracker"
|
|
114
117
|
data-ga4-link="<%= ga4_object %>"
|
|
115
118
|
<% end %>>
|
|
116
|
-
<%= render "govuk_publishing_components/components/metadata/sentence", items: definition, toggle_id: "#{index}-#{SecureRandom.hex(4)}" %>
|
|
119
|
+
<%= render "govuk_publishing_components/components/metadata/sentence", items: definition, toggle_id: "#{index}-#{SecureRandom.hex(4)}", inverse: inverse %>
|
|
117
120
|
</dd>
|
|
118
121
|
<% end %>
|
|
119
122
|
<% end %>
|
|
@@ -10,8 +10,6 @@ accessibility_criteria: |
|
|
|
10
10
|
Text in the cookie banner must be clear and unambiguous and should provide a way to dismiss the message.
|
|
11
11
|
shared_accessibility_criteria:
|
|
12
12
|
- link
|
|
13
|
-
accessibility_excluded_rules:
|
|
14
|
-
- 'duplicate-id' # a banner should have a unique id for a given page. However, this page contains multiple examples of the banner with the same id.
|
|
15
13
|
examples:
|
|
16
14
|
default:
|
|
17
15
|
data: {}
|
|
@@ -9,7 +9,6 @@ uses_component_wrapper_helper: true
|
|
|
9
9
|
shared_accessibility_criteria:
|
|
10
10
|
- link
|
|
11
11
|
accessibility_excluded_rules:
|
|
12
|
-
- duplicate-id-aria # IDs will be duplicated in component examples list
|
|
13
12
|
- landmark-unique # aria-label attributes will be duplicated in component examples list
|
|
14
13
|
examples:
|
|
15
14
|
default:
|
|
@@ -9,8 +9,6 @@ uses_component_wrapper_helper: true
|
|
|
9
9
|
capture_full_width_screenshot: true
|
|
10
10
|
accessibility_excluded_rules:
|
|
11
11
|
- landmark-banner-is-top-level # The header element can not be top level in the examples
|
|
12
|
-
- duplicate-id # IDs will be duplicated in component examples list
|
|
13
|
-
- duplicate-id-aria # IDs will be duplicated in component examples list
|
|
14
12
|
- form-field-multiple-labels # Form labels will be ambiguous in component examples list
|
|
15
13
|
- landmark-no-duplicate-banner # banners will be duplicated in component examples list
|
|
16
14
|
- landmark-unique # aria-label attributes will be duplicated in component examples list
|
data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml
CHANGED
|
@@ -19,8 +19,6 @@ accessibility_criteria: |
|
|
|
19
19
|
* sit within the primary header element (<header>) provided by the page layout
|
|
20
20
|
accessibility_excluded_rules:
|
|
21
21
|
# Banners will be duplicated in component examples list.
|
|
22
|
-
- duplicate-id
|
|
23
|
-
- duplicate-id-active
|
|
24
22
|
- duplicate-id-aria
|
|
25
23
|
- landmark-no-duplicate-banner
|
|
26
24
|
- landmark-unique
|
|
@@ -5,7 +5,6 @@ accessibility_criteria: |
|
|
|
5
5
|
- text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
|
6
6
|
- the icon must not be focusable or shown to screenreaders
|
|
7
7
|
accessibility_excluded_rules:
|
|
8
|
-
- duplicate-id-aria
|
|
9
8
|
- landmark-unique
|
|
10
9
|
uses_component_wrapper_helper: true
|
|
11
10
|
capture_full_width_screenshot: true
|
|
@@ -9,10 +9,13 @@
|
|
|
9
9
|
%>
|
|
10
10
|
<%= items.to_sentence(two_words_connector: connector, last_word_connector: connector).html_safe %>
|
|
11
11
|
<% if remaining.any? %>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
<div class="gem-c-metadata__details-wrapper">
|
|
13
|
+
<%= render "govuk_publishing_components/components/details", {
|
|
14
|
+
title: t("common.toggle_more", show: t("common.show"), number: remaining.length),
|
|
15
|
+
small: true,
|
|
16
|
+
inverse: inverse,
|
|
17
|
+
} do %>
|
|
18
|
+
<%= remaining.to_sentence.html_safe %>
|
|
19
|
+
<% end %>
|
|
20
|
+
</div>
|
|
18
21
|
<% end %>
|