govuk_publishing_components 35.21.2 → 35.21.4
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/analytics-ga4/ga4-auto-tracker.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +15 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +0 -1
- data/app/views/govuk_publishing_components/components/docs/metadata.yml +4 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09872f8fc97beac2824b83f22c6a74adda184c945984bb878d899452192052ce'
|
|
4
|
+
data.tar.gz: 9f7689553e25cb9e72e7de26935311ea1ae95bee9327c09cd9e374bbe437c972
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 215a4cce5c28672ef092448b974f1fc2ab5f54292f0559f2fe916417c446664a02f4e315ba94ae12eb6a3e41fb21a1ecbfc6088fd47190746753a4c0e9d85012
|
|
7
|
+
data.tar.gz: a7911d856eef0bf64ebaa5d8198a2673dda51c3c76ae496c6546cac7ee26ba72d740fcaec92b70c9461d515d871ef54a9a2694f8da360d47039fe92390532cd4
|
|
@@ -7,6 +7,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
7
7
|
function Ga4AutoTracker (module) {
|
|
8
8
|
this.module = module
|
|
9
9
|
this.trackingTrigger = 'data-ga4-auto'
|
|
10
|
+
this.PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
Ga4AutoTracker.prototype.init = function () {
|
|
@@ -35,6 +36,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
35
36
|
return
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
data.text = this.PIIRemover.stripPIIWithOverride(data.text, true, true)
|
|
38
40
|
var schemas = new window.GOVUK.analyticsGa4.Schemas()
|
|
39
41
|
var schema = schemas.mergeProperties(data, 'event_data')
|
|
40
42
|
|
|
@@ -43,6 +43,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
|
43
43
|
data.govuk_gem_version = this.getGemVersion()
|
|
44
44
|
// set this in the console as a debugging aid
|
|
45
45
|
if (window.GOVUK.analyticsGa4.showDebug) {
|
|
46
|
+
data.event_data = this.sortEventData(data.event_data)
|
|
46
47
|
console.info(JSON.stringify(data, null, ' '))
|
|
47
48
|
}
|
|
48
49
|
window.dataLayer.push(data)
|
|
@@ -52,6 +53,20 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
|
52
53
|
return window.GOVUK.analyticsGa4.vars.gem_version || 'not found'
|
|
53
54
|
},
|
|
54
55
|
|
|
56
|
+
sortEventData: function (eventData) {
|
|
57
|
+
if (!Object.keys) { // check for IE9 and below
|
|
58
|
+
return eventData
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var keys = Object.keys(eventData)
|
|
62
|
+
keys.sort()
|
|
63
|
+
var newEventData = {}
|
|
64
|
+
for (var i = 0; i < keys.length; i++) {
|
|
65
|
+
newEventData[keys[i]] = eventData[keys[i]]
|
|
66
|
+
}
|
|
67
|
+
return newEventData
|
|
68
|
+
},
|
|
69
|
+
|
|
55
70
|
trackFunctions: {
|
|
56
71
|
|
|
57
72
|
getDomainRegex: function () {
|
|
@@ -355,6 +355,8 @@ examples:
|
|
|
355
355
|
see_updates_link: true
|
|
356
356
|
other:
|
|
357
357
|
Applies to: England, Scotland, and Wales (see detailed guidance for <a href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for" rel="external">Northern Ireland</a>)
|
|
358
|
+
context:
|
|
359
|
+
dark_background: true
|
|
358
360
|
on_a_dark_background_without_padding:
|
|
359
361
|
description: By default the inverse option includes extra spacing around the component. This option removes this padding. Note that both the `inverse` and `inverse_compress` options must be supplied.
|
|
360
362
|
data:
|
|
@@ -375,6 +377,8 @@ examples:
|
|
|
375
377
|
see_updates_link: true
|
|
376
378
|
other:
|
|
377
379
|
Applies to: England, Scotland, and Wales (see detailed guidance for <a href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for" rel="external">Northern Ireland</a>)
|
|
380
|
+
context:
|
|
381
|
+
dark_background: true
|
|
378
382
|
with_custom_margin_bottom:
|
|
379
383
|
description: |
|
|
380
384
|
The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to the `margin-bottom` values defined in the [responsive-bottom-margin mixin](https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss#L1)
|
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: 35.21.
|
|
4
|
+
version: 35.21.4
|
|
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: 2023-
|
|
11
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|
|
@@ -1478,7 +1478,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1478
1478
|
- !ruby/object:Gem::Version
|
|
1479
1479
|
version: '0'
|
|
1480
1480
|
requirements: []
|
|
1481
|
-
rubygems_version: 3.4.
|
|
1481
|
+
rubygems_version: 3.4.22
|
|
1482
1482
|
signing_key:
|
|
1483
1483
|
specification_version: 4
|
|
1484
1484
|
summary: A gem to document components in GOV.UK frontend applications
|