govuk_publishing_components 30.5.1 → 30.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aaf755f85b8026ae4db7ba3b16e3c0940ae637cbd4fefc845e3dc6986ba04dc
4
- data.tar.gz: 9160f6eaab747fc9a75d42692e95a85e999d66c654e38aabb03367cd8d894ea6
3
+ metadata.gz: 178902a1869836f809fc3fafe80831ad0a0753638e2fb4b46f4c760cfd0fba1b
4
+ data.tar.gz: 3eaacf55a4346752e05f12b2d20265e974ebf7728d967a6b135855627e95c871
5
5
  SHA512:
6
- metadata.gz: 1d82fbcb7a72a89928cf3d622105212e58fa1600575f42a1ace4bf35db2bd4842e216bbc8c95f424a852f3547c0456282cc11d896031d43d7559ea71edfd95a4
7
- data.tar.gz: 2a315750a2897941cbfd673b9dcecaf6ff679389ed3c379a826de53e3437f47508dd070237dba918e05e88d0c629fe0ed336d747ee44072088fb79097b341706
6
+ metadata.gz: 46f582f73738fbcdc4a7a3aec8ec7f41e939df54d9f2acda6bc37b29119b78206d71b0c46901421d2e7719c56712b7885d292c51c7dc56dab4695c2b0809a4f3
7
+ data.tar.gz: 41abae03a79188f968dcb298680b51019dc5e87707025f5363cb916c04e06beb63c2095d00f05ae9b6c218d67c7485c3a447fe85019758ce6c90474b9150599d
@@ -0,0 +1,30 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
3
+
4
+ (function (analytics) {
5
+ 'use strict'
6
+
7
+ var core = {
8
+ load: function () {
9
+ /* eslint-disable */
10
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
11
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
12
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
13
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl+ '&gtm_auth=' + window.GOVUK.analyticsGA4.vars.auth + '&gtm_preview=' + window.GOVUK.analyticsGA4.vars.preview + '&gtm_cookies_win=x';f.parentNode.insertBefore(j,f);
14
+ })(window,document,'script','dataLayer',window.GOVUK.analyticsGA4.vars.id);
15
+ window.dataLayer.push({ 'gtm.blocklist' : ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
16
+ /* eslint-enable */
17
+ },
18
+
19
+ sendData: function (data) {
20
+ data.govuk_gem_version = this.getGemVersion()
21
+ window.dataLayer.push(data)
22
+ },
23
+
24
+ getGemVersion: function () {
25
+ return '<%= GovukPublishingComponents::VERSION %>'
26
+ }
27
+ }
28
+
29
+ analytics.core = core
30
+ })(window.GOVUK.analyticsGA4)
@@ -84,7 +84,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
84
84
  }
85
85
  }
86
86
 
87
- window.dataLayer.push(schema)
87
+ window.GOVUK.analyticsGA4.core.sendData(schema)
88
88
  }
89
89
  }
90
90
 
@@ -73,7 +73,7 @@ window.GOVUK.analyticsGA4.analyticsModules = window.GOVUK.analyticsGA4.analytics
73
73
  }
74
74
  }
75
75
 
76
- window.dataLayer.push(schema)
76
+ window.GOVUK.analyticsGA4.core.sendData(schema)
77
77
  }
78
78
  },
79
79
 
@@ -45,7 +45,7 @@ window.GOVUK.analyticsGA4.analyticsModules = window.GOVUK.analyticsGA4.analytics
45
45
  world_locations: this.getMetaContent('analytics:world-locations')
46
46
  }
47
47
  }
48
- window.dataLayer.push(data)
48
+ window.GOVUK.analyticsGA4.core.sendData(data)
49
49
  }
50
50
  },
51
51
 
@@ -7,6 +7,8 @@ var initFunction = function () {
7
7
  var consentCookie = window.GOVUK.getConsentCookie()
8
8
 
9
9
  if (consentCookie && consentCookie.usage) {
10
+ window.GOVUK.analyticsGA4.core.load()
11
+
10
12
  var analyticsModules = window.GOVUK.analyticsGA4.analyticsModules
11
13
  for (var property in analyticsModules) {
12
14
  var module = analyticsModules[property]
@@ -14,12 +16,9 @@ var initFunction = function () {
14
16
  module.init()
15
17
  }
16
18
  }
17
- // to be added: attach JS from Google to the DOM and execute
18
19
  // to be added: cross domain tracking code
19
20
  } else {
20
- window.addEventListener('cookie-consent', function () {
21
- window.GOVUK.analyticsGA4.init()
22
- })
21
+ window.addEventListener('cookie-consent', window.GOVUK.analyticsGA4.init)
23
22
  }
24
23
  }
25
24
 
@@ -1,4 +1,5 @@
1
1
  // The following modules are imported in a specific order
2
+ //= require ./analytics-ga4/ga4-core
2
3
  //= require ./analytics-ga4/ga4-schemas
3
4
  //= require ./analytics-ga4/pii-remover
4
5
  //= require ./analytics-ga4/ga4-page-views
@@ -55,7 +55,8 @@
55
55
 
56
56
  .gem-c-image-card__image {
57
57
  display: block;
58
- max-width: 100%;
58
+ height: auto;
59
+ width: 100%;
59
60
  border-top: 1px solid $govuk-border-colour;
60
61
  border-left: none;
61
62
  border-right: none;
@@ -21,7 +21,7 @@
21
21
  dismiss_href = intervention_helper.dismiss_link
22
22
 
23
23
  suggestion_tag_options = {
24
- class: "govuk-link gem-c-intervention__suggestion-link",
24
+ class: "govuk-link",
25
25
  href: suggestion_link_url,
26
26
  data: suggestion_data_attributes,
27
27
  }
@@ -53,7 +53,7 @@
53
53
 
54
54
  <% if dismiss_text %>
55
55
  <p class="govuk-body">
56
- <%= tag.a class: "govuk-link gem-c-intervention__dismiss", href: dismiss_href, data: dismiss_data_attributes do %>
56
+ <%= tag.a class: "govuk-link", href: dismiss_href, data: dismiss_data_attributes do %>
57
57
  <svg class="gem-c-intervention__dismiss-icon"
58
58
  width="19" height="19" viewBox="0 0 19 19"
59
59
  aria-hidden="true"
@@ -4,6 +4,8 @@ body: |
4
4
  An image and links, meant for use for news articles and people. Includes optional paragraph and additional links.
5
5
 
6
6
  The component is generally to be used within a grid column but has no grid of its own, so the text and the images in the examples below may not always line up. This will normally look tidier, for example [on pages like this](https://www.gov.uk/government/organisations/attorney-generals-office).
7
+
8
+ Images should have an aspect ratio of 3:2.
7
9
  accessibility_criteria: |
8
10
  The component must:
9
11
 
@@ -12,6 +14,10 @@ accessibility_criteria: |
12
14
  - if the contents of the component are in a different language than the rest of the document, include an appropriate `lang` attribute to correctly identify the language used in the component
13
15
  shared_accessibility_criteria:
14
16
  - link
17
+ embed: |
18
+ <div class="govuk-!-width-one-third">
19
+ <%= component %>
20
+ </div>
15
21
  examples:
16
22
  default:
17
23
  data:
@@ -195,6 +201,10 @@ examples:
195
201
  text: "Announcement"
196
202
  heading_text: "Something has happened nearby possibly"
197
203
  description: "Following a news report that something has happened, further details are emerging of the thing that has happened and what that means for you."
204
+ embed: |
205
+ <div class="govuk-!-width-full">
206
+ <%= component %>
207
+ </div>
198
208
  with_data_attributes:
199
209
  description: Data attributes can be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
200
210
  data:
@@ -283,3 +293,7 @@ examples:
283
293
  /assets/govuk_publishing_components/image-card-srcset/cop26-320.jpg: 320w
284
294
  /assets/govuk_publishing_components/image-card-srcset/cop26-240.jpg: 240w
285
295
  /assets/govuk_publishing_components/image-card-srcset/cop26-170.jpg: 170w
296
+ embed: |
297
+ <div class="govuk-!-width-full">
298
+ <%= component %>
299
+ </div>
@@ -46,6 +46,8 @@ module GovukPublishingComponents
46
46
  loading: @image_loading,
47
47
  sizes: @sizes,
48
48
  srcset: @srcset,
49
+ height: 200,
50
+ width: 300,
49
51
  )
50
52
  end
51
53
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "30.5.1".freeze
2
+ VERSION = "30.6.0".freeze
3
3
  end
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: 30.5.1
4
+ version: 30.6.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: 2022-09-09 00:00:00.000000000 Z
11
+ date: 2022-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -436,6 +436,7 @@ files:
436
436
  - app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
437
437
  - app/assets/javascripts/govuk_publishing_components/all_components.js
438
438
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4.js
439
+ - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js.erb
439
440
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js
440
441
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js
441
442
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js