govuk_publishing_components 33.0.0 → 34.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/govuk_publishing_components_manifest.js +0 -1
  3. data/app/assets/javascripts/component_guide/accessibility-test.js +0 -1
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js +3 -3
  5. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +22 -1
  6. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +58 -106
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +28 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +11 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +19 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +20 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +6 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +6 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +8 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +83 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +6 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +15 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +6 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +16 -0
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +10 -0
  20. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss +0 -1
  21. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +6 -9
  22. data/app/views/govuk_publishing_components/component_guide/_application_stylesheet.html.erb +0 -3
  23. data/app/views/govuk_publishing_components/component_guide/index.html.erb +0 -7
  24. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +1 -2
  25. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +0 -1
  26. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +4 -1
  27. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +34 -0
  28. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +1 -1
  30. data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -2
  31. data/config/locales/ar.yml +0 -7
  32. data/config/locales/az.yml +1 -7
  33. data/config/locales/be.yml +0 -7
  34. data/config/locales/bg.yml +0 -7
  35. data/config/locales/bn.yml +0 -7
  36. data/config/locales/cs.yml +0 -7
  37. data/config/locales/cy.yml +0 -7
  38. data/config/locales/da.yml +0 -7
  39. data/config/locales/de.yml +0 -7
  40. data/config/locales/dr.yml +0 -7
  41. data/config/locales/el.yml +0 -7
  42. data/config/locales/en.yml +0 -7
  43. data/config/locales/es-419.yml +0 -7
  44. data/config/locales/es.yml +0 -7
  45. data/config/locales/et.yml +0 -7
  46. data/config/locales/fa.yml +1 -7
  47. data/config/locales/fi.yml +0 -7
  48. data/config/locales/fr.yml +0 -7
  49. data/config/locales/gd.yml +0 -7
  50. data/config/locales/gu.yml +0 -7
  51. data/config/locales/he.yml +0 -7
  52. data/config/locales/hi.yml +0 -7
  53. data/config/locales/hr.yml +0 -7
  54. data/config/locales/hu.yml +0 -7
  55. data/config/locales/hy.yml +0 -7
  56. data/config/locales/id.yml +0 -7
  57. data/config/locales/is.yml +0 -7
  58. data/config/locales/it.yml +0 -7
  59. data/config/locales/ja.yml +0 -7
  60. data/config/locales/ka.yml +0 -7
  61. data/config/locales/kk.yml +0 -7
  62. data/config/locales/ko.yml +0 -7
  63. data/config/locales/lt.yml +0 -7
  64. data/config/locales/lv.yml +0 -7
  65. data/config/locales/ms.yml +0 -7
  66. data/config/locales/mt.yml +0 -7
  67. data/config/locales/nl.yml +0 -7
  68. data/config/locales/no.yml +0 -7
  69. data/config/locales/pa-pk.yml +0 -7
  70. data/config/locales/pa.yml +0 -7
  71. data/config/locales/pl.yml +0 -7
  72. data/config/locales/ps.yml +0 -7
  73. data/config/locales/pt.yml +0 -7
  74. data/config/locales/ro.yml +0 -7
  75. data/config/locales/ru.yml +0 -7
  76. data/config/locales/si.yml +0 -7
  77. data/config/locales/sk.yml +0 -7
  78. data/config/locales/sl.yml +0 -7
  79. data/config/locales/so.yml +0 -7
  80. data/config/locales/sq.yml +0 -7
  81. data/config/locales/sr.yml +0 -7
  82. data/config/locales/sv.yml +0 -7
  83. data/config/locales/sw.yml +0 -7
  84. data/config/locales/ta.yml +0 -7
  85. data/config/locales/th.yml +0 -7
  86. data/config/locales/tk.yml +0 -7
  87. data/config/locales/tr.yml +0 -7
  88. data/config/locales/uk.yml +0 -7
  89. data/config/locales/ur.yml +0 -7
  90. data/config/locales/uz.yml +0 -7
  91. data/config/locales/vi.yml +0 -7
  92. data/config/locales/zh-hk.yml +0 -7
  93. data/config/locales/zh-tw.yml +0 -7
  94. data/config/locales/zh.yml +0 -7
  95. data/lib/govuk_publishing_components/config.rb +0 -3
  96. data/lib/govuk_publishing_components/presenters/button_helper.rb +2 -1
  97. data/lib/govuk_publishing_components/version.rb +1 -1
  98. metadata +2 -17
  99. data/app/assets/stylesheets/component_guide/print.scss +0 -1
  100. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +0 -18
  101. data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +0 -28
  102. data/app/assets/stylesheets/govuk_publishing_components/components/print/_button.scss +0 -8
  103. data/app/assets/stylesheets/govuk_publishing_components/components/print/_cards.scss +0 -4
  104. data/app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss +0 -19
  105. data/app/assets/stylesheets/govuk_publishing_components/components/print/_emergency-banner.scss +0 -3
  106. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss +0 -5
  107. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +0 -80
  108. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +0 -3
  109. data/app/assets/stylesheets/govuk_publishing_components/components/print/_organisation-logo.scss +0 -7
  110. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +0 -7
  111. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +0 -116
  112. data/app/assets/stylesheets/govuk_publishing_components/components/print/_textarea.scss +0 -13
  113. data/app/assets/stylesheets/govuk_publishing_components/components/print/_title.scss +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72c594630cfc9f9359ae29eaff51094d512f4060cff0ad23e96319f264b0bae6
4
- data.tar.gz: d074f64d7b59bd3657e0e84c2a44f9de23a8a5db99e71e832b2eab98a617fb8e
3
+ metadata.gz: d27a853451e7e5d792f6d4844c3192d325093a13bb352e726a7d5917186d9207
4
+ data.tar.gz: f564406c3fe69d492b3c1f86713b0d8e7fd4f9bba214e3056fa4de42cea452b4
5
5
  SHA512:
6
- metadata.gz: 77cde1c322a721bc97a30a348e53b84d369c029afa32cd81fc7def30577aea67324f4c60ecc5c6f03e1c77dc3697d6a2ab5339a177c3946276ddcaa26bb72303
7
- data.tar.gz: 7134f8030b4d16a4b4e38dc5ba6aa8d9c08aa0bc2ef319e7710b407685a8cbace2ce9c32c5330883cd93412690687387f5960246667a63a8808cc20949c02de1
6
+ metadata.gz: e4323ecea03126f79bf1dc2e173a6c19504341b956a92bd8bcf85dd82bcd6003fe68dec8a835f3c35874044b4e7bd6542b029ad885976fc6efc18527ab6e707a
7
+ data.tar.gz: f5463262a5c4069311287fd9ba13f36191a4675bcc6c70e0c6b36d0a04f7c3a11d4229bc2f5caa9d194194dbda264264723d0d65846b85aa62b29c289892f716
@@ -12,4 +12,3 @@
12
12
  //= link govuk_publishing_components/vendor/lux/lux-reporter.js
13
13
  //= link govuk_publishing_components/vendor/lux/lux-measurer.js
14
14
  //= link component_guide/application.css
15
- //= link component_guide/print.css
@@ -24,7 +24,6 @@
24
24
  })
25
25
 
26
26
  var axeOptions = {
27
- include: [selector],
28
27
  rules: axeRules
29
28
  }
30
29
 
@@ -50,7 +50,7 @@
50
50
  var schema = this.populateEcommerceSchema(searchResultsBlock, false, null)
51
51
 
52
52
  this.clearPreviousEcommerceObject()
53
- window.dataLayer.push(schema)
53
+ GOVUK.analyticsGa4.core.sendData(schema)
54
54
  },
55
55
 
56
56
  handleClick: function (event) {
@@ -62,7 +62,7 @@
62
62
  var schema = this.populateEcommerceSchema(searchResultsBlock, true, searchResult)
63
63
 
64
64
  this.clearPreviousEcommerceObject()
65
- window.dataLayer.push(schema)
65
+ GOVUK.analyticsGa4.core.sendData(schema)
66
66
  }
67
67
  },
68
68
 
@@ -127,7 +127,7 @@
127
127
  },
128
128
 
129
129
  clearPreviousEcommerceObject: function () {
130
- window.dataLayer.push({ search_results: { ecommerce: null } })
130
+ GOVUK.analyticsGa4.core.sendData({ search_results: { ecommerce: null } })
131
131
  },
132
132
 
133
133
  getResultsCount: function (searchResultsBlock) {
@@ -36,6 +36,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
36
36
 
37
37
  this.$module.uniqueId = this.$module.getAttribute('data-id') || false
38
38
 
39
+ this.$module.dataModule = this.$module.getAttribute('data-module')
40
+ this.$module.isGa4Enabled = this.$module.dataModule ? this.$module.dataModule.indexOf('ga4-event-tracker') !== -1 : false
41
+
39
42
  if (this.$module.uniqueId) {
40
43
  this.$module.sessionStoreLink = this.$module.sessionStoreLink + '_' + this.$module.uniqueId
41
44
  }
@@ -78,6 +81,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
78
81
 
79
82
  this.$module.insertBefore(showAll, steps)
80
83
  this.$module.showOrHideAllButton = this.$module.querySelectorAll('.js-step-controls-button')[0]
84
+
85
+ // if GA4 is enabled, set attributes on 'show all sections' for tracking using ga4-event-tracker
86
+ if (this.$module.isGa4Enabled) {
87
+ var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step', index: 0, index_total: this.$module.totalSteps }
88
+ this.$module.showOrHideAllButton.setAttribute('data-ga4-event', JSON.stringify(showAllAttributesGa4))
89
+ }
81
90
  }
82
91
 
83
92
  Gemstepnav.prototype.addShowHideToggle = function () {
@@ -169,12 +178,24 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
169
178
  var title = thisel.querySelectorAll('.js-step-title')[0]
170
179
  var contentId = thisel.querySelectorAll('.js-panel')[0].getAttribute('id')
171
180
  var titleText = title.textContent || title.innerText // IE8 fallback
181
+ var ga4Data = ''
182
+
183
+ if (this.$module.isGa4Enabled) {
184
+ var ga4JSON = {
185
+ event_name: 'select_content',
186
+ type: 'step by step',
187
+ text: titleText.trim(),
188
+ index: i + 1,
189
+ index_total: this.$module.totalSteps
190
+ }
191
+ ga4Data = "data-ga4-event='" + JSON.stringify(ga4JSON) + "'" // Construct GA4 data-attributes for ga4-event-tracker.
192
+ }
172
193
 
173
194
  title.outerHTML =
174
195
  '<span class="js-step-title">' +
175
196
  '<button ' +
176
197
  'class="gem-c-step-nav__button gem-c-step-nav__button--title js-step-title-button" ' +
177
- 'aria-expanded="false" aria-controls="' + contentId + '">' +
198
+ 'aria-expanded="false" aria-controls="' + contentId + '" ' + ga4Data + '>' +
178
199
  '<span class="gem-c-step-nav____title-text-focus">' +
179
200
  '<span class="gem-c-step-nav__title-text js-step-title-text">' + titleText + '</span>' +
180
201
  '<span class="govuk-visually-hidden gem-c-step-nav__section-heading-divider">, </span>' +
@@ -38,6 +38,8 @@
38
38
  errorBeaconUrl: getProperty(obj, "errorBeaconUrl", "https://lux.speedcurve.com/error/"),
39
39
  jspagelabel: getProperty(obj, "jspagelabel", undefined),
40
40
  label: getProperty(obj, "label", undefined),
41
+ maxBeaconUrlLength: getProperty(obj, "maxBeaconUrlLength", 8190),
42
+ maxBeaconUTEntries: getProperty(obj, "maxBeaconUTEntries", 20),
41
43
  maxErrors: getProperty(obj, "maxErrors", 5),
42
44
  maxMeasureTime: getProperty(obj, "maxMeasureTime", 60000),
43
45
  measureUntil: getProperty(obj, "measureUntil", "onload"),
@@ -276,6 +278,23 @@
276
278
  return Matching;
277
279
  }());
278
280
 
281
+ /**
282
+ * Fit an array of user timing delimited strings into a URL and return both the entries that fit and
283
+ * the remaining entries that didn't fit.
284
+ */
285
+ function fitUserTimingEntries(utValues, config, url) {
286
+ // Start with the maximum allowed UT entries per beacon
287
+ var beaconUtValues = utValues.slice(0, config.maxBeaconUTEntries);
288
+ var remainingUtValues = utValues.slice(config.maxBeaconUTEntries);
289
+ // Trim UT entries until they fit within the maximum URL length, ensuring at least one UT entry
290
+ // is included.
291
+ while ((url + "&UT=" + beaconUtValues.join(",")).length > config.maxBeaconUrlLength &&
292
+ beaconUtValues.length > 1) {
293
+ remainingUtValues.unshift(beaconUtValues.pop());
294
+ }
295
+ return [beaconUtValues, remainingUtValues];
296
+ }
297
+
279
298
  var LUX = window.LUX || {};
280
299
  var scriptEndTime = scriptStartTime;
281
300
  LUX = (function () {
@@ -288,7 +307,7 @@
288
307
  /// End
289
308
  // -------------------------------------------------------------------------
290
309
 
291
- var SCRIPT_VERSION = "304";
310
+ var SCRIPT_VERSION = "305";
292
311
  var logger = new Logger();
293
312
  var globalConfig = fromObject(LUX);
294
313
  logger.logEvent(LogEvent.EvaluationStart, [SCRIPT_VERSION]);
@@ -382,7 +401,6 @@
382
401
  var gUid = refreshUniqueId(gSyncId); // cookie for this session ("Unique ID")
383
402
  var gCustomerDataTimeout; // setTimeout timer for sending a Customer Data beacon after onload
384
403
  var gMaxMeasureTimeout; // setTimeout timer for sending the beacon after a maximum measurement time
385
- var gMaxQuerystring = 8190; // split the beacon querystring if it gets longer than this
386
404
  if (_sample()) {
387
405
  logger.logEvent(LogEvent.SessionIsSampled, [globalConfig.samplerate]);
388
406
  }
@@ -701,7 +719,7 @@
701
719
  }
702
720
  aUT.push(utParts.join("|"));
703
721
  }
704
- return aUT.join(",");
722
+ return aUT;
705
723
  }
706
724
  // Return a string of Element Timing Metrics formatted for beacon querystring.
707
725
  function elementTimingValues() {
@@ -1406,8 +1424,28 @@
1406
1424
  clearTimeout(gMaxMeasureTimeout);
1407
1425
  }
1408
1426
  }
1427
+ function _getBeaconUrl() {
1428
+ var queryParams = [
1429
+ "v=" + SCRIPT_VERSION,
1430
+ "id=" + getCustomerId(),
1431
+ "sid=" + gSyncId,
1432
+ "uid=" + gUid,
1433
+ "l=" + encodeURIComponent(_getPageLabel()),
1434
+ "HN=" + encodeURIComponent(document.location.hostname),
1435
+ "PN=" + encodeURIComponent(document.location.pathname),
1436
+ ];
1437
+ if (gFlags) {
1438
+ queryParams.push("fl=" + gFlags);
1439
+ }
1440
+ var customerData = customerDataValues();
1441
+ if (customerData) {
1442
+ queryParams.push("CD=" + customerData);
1443
+ }
1444
+ return globalConfig.beaconUrl + "?" + queryParams.join("&");
1445
+ }
1409
1446
  // Beacon back the LUX data.
1410
1447
  function _sendLux() {
1448
+ var _a;
1411
1449
  clearMaxMeasureTimeout();
1412
1450
  var customerid = getCustomerId();
1413
1451
  if (!customerid ||
@@ -1425,9 +1463,7 @@
1425
1463
  // with LUX.markLoadTime()
1426
1464
  _markLoadTime();
1427
1465
  }
1428
- var sUT = userTimingValues(); // User Timing data
1429
1466
  var sET = elementTimingValues(); // Element Timing data
1430
- var sCustomerData = customerDataValues(); // customer data
1431
1467
  var sIx = ""; // Interaction Metrics
1432
1468
  if (!gbIxSent) {
1433
1469
  // It is possible for the IX beacon to be sent BEFORE the "main" window.onload LUX beacon.
@@ -1442,21 +1478,10 @@
1442
1478
  }
1443
1479
  // We want ALL beacons to have ALL the data used for query filters (geo, pagelabel, browser, & customerdata).
1444
1480
  // So we create a base URL that has all the necessary information:
1445
- var baseUrl = globalConfig.beaconUrl +
1446
- "?v=" +
1447
- SCRIPT_VERSION +
1448
- "&id=" +
1449
- customerid +
1450
- "&sid=" +
1451
- gSyncId +
1452
- "&uid=" +
1453
- gUid +
1454
- (sCustomerData ? "&CD=" + sCustomerData : "") +
1455
- "&l=" +
1456
- encodeURIComponent(_getPageLabel());
1481
+ var baseUrl = _getBeaconUrl();
1457
1482
  var is = inlineTagSize("script");
1458
1483
  var ic = inlineTagSize("style");
1459
- var querystring =
1484
+ var metricsQueryString =
1460
1485
  // only send Nav Timing and lux.js metrics on initial pageload (not for SPA page views)
1461
1486
  (gbNavSent ? "" : "&NT=" + getNavTiming()) +
1462
1487
  (gbFirstPV ? "&LJS=" + sLuxjs : "") +
@@ -1497,31 +1522,15 @@
1497
1522
  (sIx ? "&IX=" + sIx : "") +
1498
1523
  (typeof gFirstInputDelay !== "undefined" ? "&FID=" + gFirstInputDelay : "") +
1499
1524
  (sCPU ? "&CPU=" + sCPU : "") +
1500
- (gFlags ? "&fl=" + gFlags : "") +
1501
1525
  (sET ? "&ET=" + sET : "") + // element timing
1502
- "&HN=" +
1503
- encodeURIComponent(document.location.hostname) +
1504
- (DCLS !== false ? "&CLS=" + DCLS : "") +
1505
- "&PN=" +
1506
- encodeURIComponent(document.location.pathname);
1507
- // User Timing marks & measures
1508
- var sUT_remainder = "";
1509
- if (sUT) {
1510
- var curLen = baseUrl.length + querystring.length;
1511
- if (curLen + sUT.length <= gMaxQuerystring) {
1512
- // Add all User Timing
1513
- querystring += "&UT=" + sUT;
1514
- }
1515
- else {
1516
- // Only add a substring of User Timing
1517
- var avail_1 = gMaxQuerystring - curLen; // how much room is left in the querystring
1518
- var iComma = sUT.lastIndexOf(",", avail_1); // as many UT tuples as possible
1519
- querystring += "&UT=" + sUT.substring(0, iComma);
1520
- sUT_remainder = sUT.substring(iComma + 1);
1521
- }
1522
- }
1526
+ (DCLS !== false ? "&CLS=" + DCLS : "");
1527
+ // We add the user timing entries last so that we can split them to reduce the URL size if necessary.
1528
+ var utValues = userTimingValues();
1529
+ var _b = fitUserTimingEntries(utValues, globalConfig, baseUrl + metricsQueryString), beaconUtValues = _b[0], remainingUtValues = _b[1];
1523
1530
  // Send the MAIN LUX beacon.
1524
- var mainBeaconUrl = baseUrl + querystring;
1531
+ var mainBeaconUrl = baseUrl +
1532
+ metricsQueryString +
1533
+ (beaconUtValues.length > 0 ? "&UT=" + beaconUtValues.join(",") : "");
1525
1534
  logger.logEvent(LogEvent.MainBeaconSent, [mainBeaconUrl]);
1526
1535
  _sendBeacon(mainBeaconUrl);
1527
1536
  // Set some states.
@@ -1529,34 +1538,9 @@
1529
1538
  gbNavSent = 1;
1530
1539
  gbIxSent = sIx ? 1 : 0;
1531
1540
  // Send other beacons for JUST User Timing.
1532
- var avail = gMaxQuerystring - baseUrl.length;
1533
- while (sUT_remainder) {
1534
- var sUT_cur = "";
1535
- if (sUT_remainder.length <= avail) {
1536
- // We can fit ALL the remaining UT params.
1537
- sUT_cur = sUT_remainder;
1538
- sUT_remainder = "";
1539
- }
1540
- else {
1541
- // We have to take a subset of the remaining UT params.
1542
- var iComma = sUT_remainder.lastIndexOf(",", avail); // as many UT tuples as possible
1543
- if (-1 === iComma) {
1544
- // Trouble: we have SO LITTLE available space we can not fit the first UT tuple.
1545
- // Try it anyway but find it by searching from the front.
1546
- iComma = sUT_remainder.indexOf(",");
1547
- }
1548
- if (-1 === iComma) {
1549
- // The is only one UT tuple left, but it is bigger than the available space.
1550
- // Take the whole tuple even tho it is too big.
1551
- sUT_cur = sUT_remainder;
1552
- sUT_remainder = "";
1553
- }
1554
- else {
1555
- sUT_cur = sUT_remainder.substring(0, iComma);
1556
- sUT_remainder = sUT_remainder.substring(iComma + 1);
1557
- }
1558
- }
1559
- var utBeaconUrl = baseUrl + "&UT=" + sUT_cur;
1541
+ while (remainingUtValues.length) {
1542
+ _a = fitUserTimingEntries(remainingUtValues, globalConfig, baseUrl), beaconUtValues = _a[0], remainingUtValues = _a[1];
1543
+ var utBeaconUrl = baseUrl + "&UT=" + beaconUtValues.join(",");
1560
1544
  logger.logEvent(LogEvent.UserTimingBeaconSent, [utBeaconUrl]);
1561
1545
  _sendBeacon(utBeaconUrl);
1562
1546
  }
@@ -1574,26 +1558,10 @@
1574
1558
  }
1575
1559
  var sIx = ixValues(); // Interaction Metrics
1576
1560
  if (sIx) {
1577
- var sCustomerData = customerDataValues(); // customer data
1578
- var querystring = "?v=" +
1579
- SCRIPT_VERSION +
1580
- "&id=" +
1581
- customerid +
1582
- "&sid=" +
1583
- gSyncId +
1584
- "&uid=" +
1585
- gUid +
1586
- (sCustomerData ? "&CD=" + sCustomerData : "") +
1587
- "&l=" +
1588
- encodeURIComponent(_getPageLabel()) +
1589
- "&IX=" +
1590
- sIx +
1591
- (gFirstInputDelay ? "&FID=" + gFirstInputDelay : "") +
1592
- "&HN=" +
1593
- encodeURIComponent(document.location.hostname) +
1594
- "&PN=" +
1595
- encodeURIComponent(document.location.pathname);
1596
- var beaconUrl = globalConfig.beaconUrl + querystring;
1561
+ var beaconUrl = _getBeaconUrl() +
1562
+ "&IX=" +
1563
+ sIx +
1564
+ (typeof gFirstInputDelay !== "undefined" ? "&FID=" + gFirstInputDelay : "");
1597
1565
  logger.logEvent(LogEvent.InteractionBeaconSent, [beaconUrl]);
1598
1566
  _sendBeacon(beaconUrl);
1599
1567
  gbIxSent = 1;
@@ -1612,23 +1580,7 @@
1612
1580
  }
1613
1581
  var sCustomerData = customerDataValues(); // customer data
1614
1582
  if (sCustomerData) {
1615
- var querystring = "?v=" +
1616
- SCRIPT_VERSION +
1617
- "&id=" +
1618
- customerid +
1619
- "&sid=" +
1620
- gSyncId +
1621
- "&uid=" +
1622
- gUid +
1623
- "&CD=" +
1624
- sCustomerData +
1625
- "&l=" +
1626
- encodeURIComponent(_getPageLabel()) +
1627
- "&HN=" +
1628
- encodeURIComponent(document.location.hostname) +
1629
- "&PN=" +
1630
- encodeURIComponent(document.location.pathname);
1631
- var beaconUrl = globalConfig.beaconUrl + querystring;
1583
+ var beaconUrl = _getBeaconUrl();
1632
1584
  logger.logEvent(LogEvent.CustomDataBeaconSent, [beaconUrl]);
1633
1585
  _sendBeacon(beaconUrl);
1634
1586
  }
@@ -5,3 +5,31 @@
5
5
  .gem-c-accordion__show-all > * {
6
6
  pointer-events: none;
7
7
  }
8
+
9
+ // This is in place until a proper fix comes through from GOV.UK Frontend.
10
+ //
11
+ // TODO: Replace with the print styles that will come from GOV.UK Frontend.
12
+
13
+ @include govuk-media-query($media-type: print) {
14
+ // Open all of the accordion sections.
15
+ .govuk-accordion__section-content {
16
+ display: block !important; // stylelint-disable-line declaration-no-important
17
+ }
18
+
19
+ // Change the colour from the blue link colour to black.
20
+ .govuk-accordion__section-button {
21
+ color: govuk-colour("black") !important; // stylelint-disable-line declaration-no-important
22
+ }
23
+
24
+ // Change the summary subheading size.
25
+ .govuk-accordion__section-summary {
26
+ @include govuk-typography-common;
27
+ @include govuk-typography-responsive($size: 16, $important: true);
28
+ }
29
+
30
+ // Hide the unusable "Show all" and "Show" sections.
31
+ .govuk-accordion__show-all,
32
+ .govuk-accordion__section-toggle {
33
+ display: none !important; // stylelint-disable-line declaration-no-important
34
+ }
35
+ }
@@ -100,3 +100,14 @@
100
100
  content: none;
101
101
  }
102
102
  }
103
+
104
+ @include govuk-media-query($media-type: print) {
105
+ .gem-c-button {
106
+ @include govuk-font(14);
107
+ display: inline-block;
108
+ padding: govuk-spacing(1);
109
+ border: solid 1px govuk-colour("black");
110
+ color: $govuk-text-colour;
111
+ text-decoration: none;
112
+ }
113
+ }
@@ -107,3 +107,22 @@
107
107
  .gem-c-cards__description {
108
108
  margin: 0 govuk-spacing(-6) 0 0;
109
109
  }
110
+
111
+ @include govuk-media-query($media-type: print) {
112
+ .gem-c-cards__list {
113
+ display: block;
114
+ }
115
+
116
+ .gem-c-cards__list-item {
117
+ padding-bottom: 0;
118
+ }
119
+
120
+ .gem-c-cards__sub-heading {
121
+ margin-top: govuk-spacing(4);
122
+ margin-bottom: govuk-spacing(1);
123
+ }
124
+
125
+ .gem-c-cards__link:before {
126
+ display: none;
127
+ }
128
+ }
@@ -74,3 +74,23 @@
74
74
  vertical-align: top;
75
75
  }
76
76
  }
77
+
78
+ @include govuk-media-query($media-type: print) {
79
+ // Override default browser indentation
80
+ .gem-c-contents-list__list,
81
+ .gem-c-contents-list__nested-list {
82
+ padding-left: 0;
83
+ margin-left: 0;
84
+ }
85
+
86
+ // Put indentation back where we use list style types
87
+ .gem-c-contents-list__list-item--dashed {
88
+ margin-left: govuk-spacing(3);
89
+ list-style-type: disc;
90
+ }
91
+
92
+ .gem-c-contents-list__list-item--numbered,
93
+ .gem-c-contents-list__list-item--parent {
94
+ list-style-type: none;
95
+ }
96
+ }
@@ -77,3 +77,9 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
77
77
  margin-bottom: - govuk-spacing(2);
78
78
  }
79
79
  }
80
+
81
+ @include govuk-media-query($media-type: print) {
82
+ .gem-c-cookie-banner {
83
+ display: none !important; // stylelint-disable-line declaration-no-important
84
+ }
85
+ }
@@ -74,3 +74,9 @@
74
74
  // the contrast was too low with white text
75
75
  background-color: #00847d;
76
76
  }
77
+
78
+ @include govuk-media-query($media-type: print) {
79
+ .gem-c-emergency-banner {
80
+ display: none;
81
+ }
82
+ }
@@ -137,3 +137,11 @@
137
137
  // stylelint-enable selector-no-qualifying-type
138
138
  }
139
139
  }
140
+
141
+ @include govuk-media-query($media-type: print) {
142
+ .gem-c-govspeak-html-publication {
143
+ .govuk-sticky-element {
144
+ display: none;
145
+ }
146
+ }
147
+ }
@@ -27,3 +27,86 @@
27
27
  text-align: start;
28
28
  }
29
29
  }
30
+
31
+ @include govuk-media-query($media-type: print) {
32
+ // stylelint-disable max-nesting-depth
33
+
34
+ .gem-c-govspeak {
35
+ .media-player {
36
+ display: none;
37
+ }
38
+
39
+ .info-notice,
40
+ .help-notice,
41
+ .call-to-action {
42
+ margin: govuk-spacing(3) 0;
43
+ }
44
+
45
+ .call-to-action {
46
+ background: none;
47
+ border: 1pt solid $govuk-border-colour;
48
+ padding: govuk-spacing(3);
49
+ }
50
+
51
+ .help-notice p {
52
+ font-weight: 700;
53
+ }
54
+
55
+ .fraction {
56
+ img {
57
+ display: inline-block;
58
+ margin-bottom: -7px;
59
+ }
60
+ }
61
+
62
+ .attachment {
63
+ margin: govuk-spacing(6) 0;
64
+
65
+ &:first-child {
66
+ margin-top: 0;
67
+ }
68
+
69
+ .attachment-thumb {
70
+ display: none;
71
+ }
72
+
73
+ .attachment-details {
74
+ .download {
75
+ display: block;
76
+ }
77
+ }
78
+
79
+ .accessibility-warning {
80
+ h2 {
81
+ @include govuk-font(14);
82
+ }
83
+
84
+ .toggler {
85
+ display: none;
86
+ }
87
+ }
88
+ }
89
+
90
+ .footnotes {
91
+ border-top: 1px solid $govuk-text-colour;
92
+
93
+ a[role="doc-backlink"] {
94
+ display: none;
95
+ }
96
+ }
97
+
98
+ .legislative-list {
99
+ padding-left: 0;
100
+
101
+ &,
102
+ ol {
103
+ list-style: none;
104
+ }
105
+ }
106
+
107
+ .mc-toggle-button,
108
+ .mc-chart-container {
109
+ display: none;
110
+ }
111
+ }
112
+ }
@@ -999,3 +999,9 @@ $after-button-padding-left: govuk-spacing(5);
999
999
  margin: 0;
1000
1000
  }
1001
1001
  }
1002
+
1003
+ @include govuk-media-query($media-type: print) {
1004
+ .gem-c-layout-super-navigation-header__content {
1005
+ display: none;
1006
+ }
1007
+ }
@@ -17,3 +17,18 @@
17
17
  @include govuk-font(19, $weight: bold);
18
18
  display: block;
19
19
  }
20
+
21
+ @include govuk-media-query($media-type: print) {
22
+ .gem-c-step-nav-header {
23
+ padding: 0 0 govuk-spacing(4) 0;
24
+ background: none;
25
+ }
26
+
27
+ .gem-c-step-nav-header__part-of {
28
+ display: block;
29
+ }
30
+
31
+ .gem-c-step-nav-header__title {
32
+ @include govuk-font(24, $weight: bold);
33
+ }
34
+ }
@@ -532,3 +532,9 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
532
532
  content: " \2013\00a0"; // dash followed by &nbsp;
533
533
  }
534
534
  }
535
+
536
+ @include govuk-media-query($media-type: print) {
537
+ .gem-c-step-nav__panel {
538
+ display: block !important; // stylelint-disable-line declaration-no-important
539
+ }
540
+ }
@@ -9,3 +9,19 @@
9
9
  }
10
10
  }
11
11
  }
12
+
13
+ @include govuk-media-query($media-type: print) {
14
+ .gem-c-textarea {
15
+ .gem-c-label,
16
+ .gem-c-error-message,
17
+ .govuk-hint,
18
+ .govuk-character-count__message {
19
+ display: block;
20
+ }
21
+
22
+ .govuk-textarea {
23
+ width: 400px;
24
+ height: 40px;
25
+ }
26
+ }
27
+ }
@@ -28,3 +28,13 @@
28
28
  .gem-c-title__text {
29
29
  margin: 0;
30
30
  }
31
+
32
+ @include govuk-media-query($media-type: print) {
33
+ .gem-c-title__context {
34
+ margin: 0;
35
+ }
36
+
37
+ .gem-c-title__text {
38
+ margin-top: 0;
39
+ }
40
+ }
@@ -1,4 +1,3 @@
1
- // Contents list helper is used in both print and screen stylesheets
2
1
  .gem-c-contents-list__list-item--numbered {
3
2
  .gem-c-contents-list__link {
4
3
  display: table;