govuk_publishing_components 30.5.2 → 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: 073dc54341c48d15d952800db0ebbfd5d4d87de9f26a6d07b94250ef9bc0ed9d
4
- data.tar.gz: 201402f75e2b8461f236e7776e4d797a34c040a12058ea18eef10f4a32d9b760
3
+ metadata.gz: 178902a1869836f809fc3fafe80831ad0a0753638e2fb4b46f4c760cfd0fba1b
4
+ data.tar.gz: 3eaacf55a4346752e05f12b2d20265e974ebf7728d967a6b135855627e95c871
5
5
  SHA512:
6
- metadata.gz: 990eb134bb9dafa279cc4a4953a09942340744a892d9ab064ebd5e951a49895ad8dce0bd40f631a08a2ca144373537ee70fa730cd1112354aa01ce05a2e7ba52
7
- data.tar.gz: 0b6224f2181204e5ba0db96cd8b87f81d2d288b1c3589a200ed88bcc150761d44ac26d2d8e180ccecfb18a0ba07991cd127991595a72ad8d85f6c4da7f4e5c1b
6
+ metadata.gz: 46f582f73738fbcdc4a7a3aec8ec7f41e939df54d9f2acda6bc37b29119b78206d71b0c46901421d2e7719c56712b7885d292c51c7dc56dab4695c2b0809a4f3
7
+ data.tar.gz: 41abae03a79188f968dcb298680b51019dc5e87707025f5363cb916c04e06beb63c2095d00f05ae9b6c218d67c7485c3a447fe85019758ce6c90474b9150599d
@@ -12,7 +12,17 @@ window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
12
12
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
13
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
14
  })(window,document,'script','dataLayer',window.GOVUK.analyticsGA4.vars.id);
15
+ window.dataLayer.push({ 'gtm.blocklist' : ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
15
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 %>'
16
26
  }
17
27
  }
18
28
 
@@ -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
 
@@ -18,9 +18,7 @@ var initFunction = function () {
18
18
  }
19
19
  // to be added: cross domain tracking code
20
20
  } else {
21
- window.addEventListener('cookie-consent', function () {
22
- window.GOVUK.analyticsGA4.init()
23
- })
21
+ window.addEventListener('cookie-consent', window.GOVUK.analyticsGA4.init)
24
22
  }
25
23
  }
26
24
 
@@ -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.2".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.2
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-13 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,7 +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
439
+ - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js.erb
440
440
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js
441
441
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js
442
442
  - app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js