govuk_publishing_components 45.4.1 → 45.5.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/vendor/lux/lux-reporter.js +11 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -15
- data/app/views/govuk_publishing_components/components/_chart.html.erb +9 -5
- data/app/views/govuk_publishing_components/components/docs/chart.yml +75 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4609ce45817837b00359ee2799de40d7c65d25f0e3980db4af6f2da14cae010
|
4
|
+
data.tar.gz: 0b38ffa5529b9cf6ecc95ecc25fc9bb2c2929c5a036c37baace13931a919e04a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee5ecdc7c7a3bd7ef8630d383f71a646e164956e3959ca7a44df145116a7a626a6e622682a149bc24a14cce8092e8a0120ff8c53c050ceb056f403459b87e334
|
7
|
+
data.tar.gz: d715613daa240e57363b618cf5bcc19b30160b03fd776b3185519a3afe05e671dfb3565d0699b97bbfb156b59dd683cc90bfc1d06c425c703094078fae6e6858
|
@@ -259,7 +259,7 @@
|
|
259
259
|
PostBeaconCancelled: 85,
|
260
260
|
PostBeaconStopRecording: 86,
|
261
261
|
PostBeaconMetricRejected: 87,
|
262
|
-
PostBeaconDisabled: 88,
|
262
|
+
// PostBeaconDisabled: 88, // Not used
|
263
263
|
PostBeaconSendFailed: 89,
|
264
264
|
PostBeaconCSPViolation: 90,
|
265
265
|
};
|
@@ -336,7 +336,7 @@
|
|
336
336
|
return str;
|
337
337
|
}
|
338
338
|
|
339
|
-
var VERSION = "4.0.
|
339
|
+
var VERSION = "4.0.28";
|
340
340
|
/**
|
341
341
|
* Returns the version of the script as a float to be stored in legacy systems that do not support
|
342
342
|
* string versions.
|
@@ -360,7 +360,10 @@
|
|
360
360
|
* was prerendered or restored from BF cache
|
361
361
|
*/
|
362
362
|
function shouldReportValue(value) {
|
363
|
-
|
363
|
+
if (getPageRestoreTime() || wasPrerendered()) {
|
364
|
+
return value >= 0;
|
365
|
+
}
|
366
|
+
return value > 0;
|
364
367
|
}
|
365
368
|
/**
|
366
369
|
* Fit an array of user timing delimited strings into a URL and return both the entries that fit and
|
@@ -457,10 +460,6 @@
|
|
457
460
|
};
|
458
461
|
Beacon.prototype.send = function () {
|
459
462
|
this.logger.logEvent(LogEvent.PostBeaconSendCalled);
|
460
|
-
if (!this.config.enablePostBeacon) {
|
461
|
-
this.logger.logEvent(LogEvent.PostBeaconDisabled);
|
462
|
-
return;
|
463
|
-
}
|
464
463
|
for (var _i = 0, _a = this.onBeforeSendCbs; _i < _a.length; _i++) {
|
465
464
|
var cb = _a[_i];
|
466
465
|
cb();
|
@@ -531,7 +530,6 @@
|
|
531
530
|
conversions: getProperty(obj, "conversions"),
|
532
531
|
cookieDomain: getProperty(obj, "cookieDomain"),
|
533
532
|
customerid: getProperty(obj, "customerid"),
|
534
|
-
enablePostBeacon: getProperty(obj, "enablePostBeacon", true),
|
535
533
|
errorBeaconUrl: getProperty(obj, "errorBeaconUrl", luxOrigin + "/error/"),
|
536
534
|
interactionBeaconDelay: getProperty(obj, "interactionBeaconDelay", 200),
|
537
535
|
jspagelabel: getProperty(obj, "jspagelabel"),
|
@@ -743,6 +741,9 @@
|
|
743
741
|
function processEntry$1(entry) {
|
744
742
|
if (entry.interactionId || (entry.entryType === "first-input" && !entryExists(entry))) {
|
745
743
|
var duration = entry.duration, startTime = entry.startTime, interactionId = entry.interactionId, name_1 = entry.name, processingStart = entry.processingStart, processingEnd = entry.processingEnd, target = entry.target;
|
744
|
+
if (duration < 0) {
|
745
|
+
return;
|
746
|
+
}
|
746
747
|
var processingTime = processingEnd - processingStart;
|
747
748
|
var existingEntry = slowestEntriesMap[interactionId];
|
748
749
|
var selector = target ? getNodeSelector(target) : null;
|
@@ -858,14 +859,14 @@
|
|
858
859
|
};
|
859
860
|
}
|
860
861
|
}
|
861
|
-
var value =
|
862
|
+
var value = lcpEntry.startTime;
|
862
863
|
if (!shouldReportValue(value)) {
|
863
864
|
// It's possible the LCP entry we have occurred before the current page was initialised. In
|
864
865
|
// this case, we don't want to report the LCP value.
|
865
866
|
return undefined;
|
866
867
|
}
|
867
868
|
return {
|
868
|
-
value: value,
|
869
|
+
value: processTimeMetric(value),
|
869
870
|
subParts: subParts,
|
870
871
|
attribution: lcpEntry.element
|
871
872
|
? {
|
@@ -128,25 +128,12 @@ $column-width: 9.5em;
|
|
128
128
|
|
129
129
|
.gem-c-share-links--square-icons {
|
130
130
|
.gem-c-share-links__link-icon {
|
131
|
-
background-color: govuk-colour("
|
132
|
-
color: govuk-colour("
|
131
|
+
background-color: govuk-colour("light-grey");
|
132
|
+
color: govuk-colour("black");
|
133
133
|
padding: govuk-spacing(2);
|
134
134
|
}
|
135
135
|
|
136
|
-
.gem-c-share-links__link:hover {
|
137
|
-
.gem-c-share-links__link-icon {
|
138
|
-
background-color: govuk-colour("black");
|
139
|
-
}
|
140
|
-
}
|
141
|
-
|
142
|
-
.gem-c-share-links__link:focus {
|
143
|
-
.gem-c-share-links__link-icon {
|
144
|
-
background-color: govuk-colour("black");
|
145
|
-
}
|
146
|
-
}
|
147
|
-
|
148
136
|
.gem-c-share-links__label {
|
149
|
-
color: govuk-colour("black");
|
150
137
|
@include govuk-font(19, $weight: bold);
|
151
138
|
}
|
152
139
|
}
|
@@ -19,6 +19,8 @@
|
|
19
19
|
link ||= false
|
20
20
|
height ||= 400
|
21
21
|
padding ||= false
|
22
|
+
point_size ||= 10
|
23
|
+
y_axis_auto_adjust ||= false
|
22
24
|
|
23
25
|
chart_id = "chart-id-#{SecureRandom.hex(4)}"
|
24
26
|
table_id = "table-id-#{SecureRandom.hex(4)}"
|
@@ -39,12 +41,13 @@
|
|
39
41
|
font_19 = { color: '#000', fontName: 'GDS Transport', fontSize: '19', italic: false }
|
40
42
|
legend = 'none'
|
41
43
|
legend = { position: 'top', textStyle: font_16 } unless hide_legend
|
42
|
-
|
43
|
-
pointSize = 0 if minimal
|
44
|
+
point_size = 0 if minimal
|
44
45
|
enableInteractivity = true
|
45
46
|
enableInteractivity = false if minimal
|
46
47
|
textPosition = nil
|
47
48
|
textPosition = 'none' if minimal
|
49
|
+
y_axis_view_window_min = 0
|
50
|
+
y_axis_view_window_min = "auto" if y_axis_auto_adjust
|
48
51
|
|
49
52
|
if !minimal && !chart_heading
|
50
53
|
raise ArgumentError, "A chart heading must be provided for accessibility purposes."
|
@@ -56,22 +59,23 @@
|
|
56
59
|
curveType: 'none',
|
57
60
|
enableInteractivity: enableInteractivity,
|
58
61
|
legend: legend,
|
59
|
-
pointSize:
|
62
|
+
pointSize: point_size,
|
60
63
|
height: height,
|
61
64
|
tooltip: { isHtml: true },
|
62
65
|
hAxis: {
|
63
66
|
textStyle: font_16,
|
64
|
-
format: 'd MMM Y', # https://developers.google.com/chart/interactive/docs/reference#dateformatter
|
65
67
|
title: h_axis_title,
|
66
68
|
titleTextStyle: font_19,
|
67
69
|
textPosition: textPosition,
|
68
70
|
},
|
69
71
|
vAxis: {
|
70
|
-
format: '#,###,###',
|
71
72
|
textStyle: font_16,
|
72
73
|
title: v_axis_title,
|
73
74
|
titleTextStyle: font_19,
|
74
75
|
textPosition: textPosition,
|
76
|
+
viewWindow: {
|
77
|
+
min: y_axis_view_window_min
|
78
|
+
}
|
75
79
|
},
|
76
80
|
}
|
77
81
|
|
@@ -6,7 +6,7 @@ body: |
|
|
6
6
|
The chart relies upon chartkick and renders using JavaScript, so the table is provided as a fallback for a lack of JavaScript,
|
7
7
|
an accessible view on the data for screenreaders, and a simple view of the raw data for all users.
|
8
8
|
|
9
|
-
The `chart_overview` option can be used to provide an explanation for screen reader users of what the
|
9
|
+
The `chart_overview` option can be used to provide an explanation for screen reader users of what the chart shows.
|
10
10
|
accessibility_criteria: |
|
11
11
|
Charts must:
|
12
12
|
|
@@ -137,6 +137,80 @@ examples:
|
|
137
137
|
- 118
|
138
138
|
- 85
|
139
139
|
- 80
|
140
|
+
with_a_different_point_size:
|
141
|
+
description: For some charts it may be better to reduce the point size so that the line is clearer. However it is recommended that the point size is larger to make it easier for users to move the mouse over them.
|
142
|
+
data:
|
143
|
+
chart_heading: Page views chart
|
144
|
+
h_axis_title: Day
|
145
|
+
v_axis_title: Views
|
146
|
+
chart_overview: This chart shows page views for January 2015.
|
147
|
+
point_size: 0
|
148
|
+
keys:
|
149
|
+
- "2015-01-01"
|
150
|
+
- "2015-01-02"
|
151
|
+
- "2015-01-03"
|
152
|
+
- "2015-01-04"
|
153
|
+
- "2015-01-05"
|
154
|
+
- "2015-01-06"
|
155
|
+
- "2015-01-07"
|
156
|
+
- "2015-01-08"
|
157
|
+
- "2015-01-09"
|
158
|
+
- "2015-01-10"
|
159
|
+
rows:
|
160
|
+
- label: January 2015
|
161
|
+
values:
|
162
|
+
- 600
|
163
|
+
- 690
|
164
|
+
- 740
|
165
|
+
- 820
|
166
|
+
- 570
|
167
|
+
- 950
|
168
|
+
- 810
|
169
|
+
- 610
|
170
|
+
- 770
|
171
|
+
- 530
|
172
|
+
scale_y_axis_based_on_data:
|
173
|
+
description: |
|
174
|
+
By default the Y-axis will always start at zero, but this may not always be required.
|
175
|
+
|
176
|
+
If there are empty items in the data the chart line will either discontinue or leave a gap, as shown.
|
177
|
+
data:
|
178
|
+
chart_heading: Page views chart
|
179
|
+
h_axis_title: Day
|
180
|
+
v_axis_title: Views
|
181
|
+
chart_overview: This chart shows page views for January 2015.
|
182
|
+
hide_legend: true
|
183
|
+
y_axis_auto_adjust: true
|
184
|
+
keys:
|
185
|
+
- "2015-01-01"
|
186
|
+
- "2015-01-02"
|
187
|
+
- "2015-01-03"
|
188
|
+
- "2015-01-04"
|
189
|
+
- "2015-01-05"
|
190
|
+
- "2015-01-06"
|
191
|
+
- "2015-01-07"
|
192
|
+
- "2015-01-08"
|
193
|
+
- "2015-01-09"
|
194
|
+
- "2015-01-10"
|
195
|
+
- "2015-01-11"
|
196
|
+
- "2015-01-12"
|
197
|
+
- "2015-01-13"
|
198
|
+
rows:
|
199
|
+
- label: January 2015
|
200
|
+
values:
|
201
|
+
- 1500
|
202
|
+
- 1190
|
203
|
+
- 1740
|
204
|
+
- 1820
|
205
|
+
- 1270
|
206
|
+
-
|
207
|
+
-
|
208
|
+
- 1450
|
209
|
+
- 1110
|
210
|
+
- 1210
|
211
|
+
- 1670
|
212
|
+
- 1430
|
213
|
+
- 1352
|
140
214
|
with_a_different_heading_level:
|
141
215
|
description: Use a different heading level for the chart heading. It defaults to a H2.
|
142
216
|
data:
|
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: 45.
|
4
|
+
version: 45.5.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-11-
|
11
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|