govuk_publishing_components 35.21.0 → 35.21.2

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: 3bc95850fa0d38a7b0783eed1d3e5b1fd846c9b11c8ae5562d8fa8f7111696f4
4
- data.tar.gz: edafc5b87bd54a90cce6cfe616589eddb820eb6dc3d0d4d0e8f17953ad51a74f
3
+ metadata.gz: bb0f9b39701d51e7c540675b4edcd276a9ee485b4c277c7d2fbbdcdf913933d0
4
+ data.tar.gz: 1b3148fd18a2211bee6c0ff59686e074a15970116b8216649fadb71018d38c86
5
5
  SHA512:
6
- metadata.gz: 576b4d036af878138116870dcf1045cf91cdb9ba31a9f68b1b8571fac840f7728d177f9d3293c83e921a3f93a5a3110b19e681568367706ca89280dc995abe8d
7
- data.tar.gz: bf87713f8b29033d63800bd4851bbca0778968a4318432b828a907a60e83a85da966307394ef77c43b3bb715ee14a23ebe81b9984303bf11a1fe5e1b2f5550f1
6
+ metadata.gz: a432b034c1f6de19813d82e68394fe4637d0b851d7617933dd1fc4f56b820ac5f7d2e3320f1dc15aebd1c2e2ec5896de41d7bac4a7244e398d5a0bb30f51e45e
7
+ data.tar.gz: ba80773b85de541a717533b35c438e7c4e2500363c8477c00c371bd638cec74f9f14d38f2820f6778d92f89680c949b27ceedc4dea98bf2d53ddd916a56fe865
@@ -281,7 +281,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
281
281
  },
282
282
 
283
283
  getIndex: function (element, startPosition) {
284
- var index = element.getAttribute('data-ecommerce-index')
284
+ var index = element.getAttribute('data-ga4-ecommerce-index')
285
285
 
286
286
  if (!index) {
287
287
  return null
@@ -307,7 +307,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
307
307
  var element = data.element
308
308
  var resultsId = data.resultsId
309
309
  var isClickEvent = data.event !== undefined
310
- var isSearchResult = element.getAttribute('data-search-query')
310
+ var isSearchResult = element.getAttribute('data-ga4-search-query')
311
311
 
312
312
  var ecommerceSchema = new window.GOVUK.analyticsGa4.Schemas().ecommerceSchema()
313
313
  var PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
@@ -315,14 +315,14 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
315
315
 
316
316
  if (isSearchResult) {
317
317
  // Limiting to 100 characters to avoid noise from extra long search queries and to stop the size of the payload going over 8k limit.
318
- var searchQuery = PIIRemover.stripPII(element.getAttribute('data-search-query')).substring(0, 100).toLowerCase()
319
- var variant = element.getAttribute('data-ecommerce-variant')
318
+ var searchQuery = PIIRemover.stripPII(element.getAttribute('data-ga4-search-query')).substring(0, 100).toLowerCase()
319
+ var variant = element.getAttribute('data-ga4-ecommerce-variant')
320
320
  DEFAULT_LIST_TITLE = 'Site search results'
321
321
  }
322
322
 
323
323
  var items = element.querySelectorAll('[data-ga4-ecommerce-path]')
324
- var listTitle = element.getAttribute('data-list-title') || DEFAULT_LIST_TITLE
325
- var startPosition = parseInt(element.getAttribute('data-ecommerce-start-index'), 10)
324
+ var listTitle = element.getAttribute('data-ga4-list-title') || DEFAULT_LIST_TITLE
325
+ var startPosition = parseInt(element.getAttribute('data-ga4-ecommerce-start-index'), 10)
326
326
 
327
327
  ecommerceSchema.event = 'search_results'
328
328
  ecommerceSchema.search_results.event_name = isClickEvent ? 'select_item' : 'view_item_list'
@@ -353,10 +353,10 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
353
353
  var item = items[i]
354
354
  var path = item.getAttribute('data-ga4-ecommerce-path')
355
355
 
356
- // If the element does not have a data-ecommerce-index attribute, we set one so that we can use it later when setting the index property
356
+ // If the element does not have a data-ga4-ecommerce-index attribute, we set one so that we can use it later when setting the index property
357
357
  // on the ecommerce object.
358
- if (!item.getAttribute('data-ecommerce-index')) {
359
- item.setAttribute('data-ecommerce-index', i + 1)
358
+ if (!item.getAttribute('data-ga4-ecommerce-index')) {
359
+ item.setAttribute('data-ga4-ecommerce-index', i + 1)
360
360
  }
361
361
 
362
362
  ecommerceSchema.search_results.ecommerce.items.push({
@@ -851,11 +851,6 @@ $after-button-padding-left: govuk-spacing(4);
851
851
  }
852
852
  }
853
853
 
854
- .gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__navigation-second-item-link {
855
- font-size: 19px;
856
- font-size: govuk-px-to-rem(19px);
857
- }
858
-
859
854
  .gem-c-layout-super-navigation-header__navigation-second-item-link--with-description {
860
855
  font-size: 16px;
861
856
  font-size: govuk-px-to-rem(16px);
@@ -881,13 +876,11 @@ $after-button-padding-left: govuk-spacing(4);
881
876
  }
882
877
 
883
878
  .gem-c-layout-super-navigation-header__navigation-second-item-description {
884
- margin-top: govuk-spacing(1);
885
- }
886
-
887
- .gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__navigation-second-item-description {
888
- font-size: 19px;
889
- font-size: govuk-px-to-rem(19px);
890
- margin-top: govuk-spacing(2);
879
+ @include govuk-typography-common;
880
+ font-size: 16px;
881
+ font-size: govuk-px-to-rem(16px);
882
+ font-weight: normal;
883
+ margin: govuk-spacing(1) 0 0 0;
891
884
  }
892
885
 
893
886
  .gem-c-layout-super-navigation-header__search-form {
@@ -911,11 +904,6 @@ $after-button-padding-left: govuk-spacing(4);
911
904
  }
912
905
  }
913
906
 
914
- .gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__popular-link {
915
- font-size: 19px;
916
- font-size: govuk-px-to-rem(19px);
917
- }
918
-
919
907
  .gem-c-layout-super-navigation-header__width-container {
920
908
  @include govuk-media-query($until: "desktop") {
921
909
  margin: 0;
@@ -24,13 +24,13 @@ module GovukPublishingComponents
24
24
 
25
25
  def wrap_numbers_with_spans(content_item_link)
26
26
  content_item_text = strip_tags(content_item_link) # just the text of the link
27
-
27
+ content_item_text_stripped = content_item_text.strip # strip trailing spaces for the regex. Keep original content_item_text for the string replacement.
28
28
  # Must start with a number
29
29
  # Number must be between 1 and 999 (ie not 2014)
30
30
  # Must be followed by a space
31
31
  # May contain a period `1.`
32
32
  # May be a decimal `1.2`
33
- number = /^\d{1,3}(\.?|\.\d{1,2})(?=\s)/.match(content_item_text)
33
+ number = /^\d{1,3}(\.?|\.\d{1,2})(?=\s)/.match(content_item_text_stripped)
34
34
 
35
35
  if number
36
36
  words = content_item_text.sub(number.to_s, "").strip # remove the number from the text
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.21.0".freeze
2
+ VERSION = "35.21.2".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: 35.21.0
4
+ version: 35.21.2
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-10-26 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config