govuk_publishing_components 34.2.0 → 34.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/youtube-play-icon.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/youtube-play-icon.svg +4 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +135 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/image-card.js +19 -0
  6. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +9 -0
  7. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -2
  8. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +113 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +15 -19
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +81 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +26 -9
  13. data/app/controllers/govuk_publishing_components/application_controller.rb +0 -13
  14. data/app/views/govuk_publishing_components/components/_accordion.html.erb +2 -2
  15. data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +2 -0
  16. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +7 -3
  17. data/app/views/govuk_publishing_components/components/_error_message.html.erb +2 -1
  18. data/app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb +2 -2
  19. data/app/views/govuk_publishing_components/components/_hint.html.erb +2 -1
  20. data/app/views/govuk_publishing_components/components/_image_card.html.erb +12 -9
  21. data/app/views/govuk_publishing_components/components/_input.html.erb +8 -2
  22. data/app/views/govuk_publishing_components/components/_label.html.erb +4 -3
  23. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +2 -2
  24. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +6 -2
  25. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +12 -6
  26. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  27. data/app/views/govuk_publishing_components/components/_textarea.html.erb +10 -2
  28. data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +43 -0
  29. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +58 -0
  30. data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +3 -1
  31. data/app/views/govuk_publishing_components/components/docs/error_message.yml +13 -0
  32. data/app/views/govuk_publishing_components/components/docs/hint.yml +6 -0
  33. data/app/views/govuk_publishing_components/components/docs/image_card.yml +24 -1
  34. data/app/views/govuk_publishing_components/components/docs/input.yml +32 -0
  35. data/app/views/govuk_publishing_components/components/docs/intervention.yml +2 -1
  36. data/app/views/govuk_publishing_components/components/docs/label.yml +11 -0
  37. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +1 -0
  38. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +2 -0
  39. data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +27 -0
  40. data/app/views/govuk_publishing_components/components/docs/textarea.yml +31 -0
  41. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +2 -0
  42. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
  43. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +4 -2
  44. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +18 -8
  45. data/app/views/layouts/govuk_publishing_components/application.html.erb +2 -2
  46. data/config/locales/ar.yml +4 -4
  47. data/config/locales/az.yml +4 -4
  48. data/config/locales/be.yml +4 -4
  49. data/config/locales/bg.yml +4 -4
  50. data/config/locales/bn.yml +4 -4
  51. data/config/locales/cs.yml +4 -4
  52. data/config/locales/cy.yml +4 -4
  53. data/config/locales/da.yml +4 -4
  54. data/config/locales/de.yml +4 -4
  55. data/config/locales/dr.yml +4 -4
  56. data/config/locales/el.yml +4 -4
  57. data/config/locales/en.yml +4 -4
  58. data/config/locales/es-419.yml +4 -4
  59. data/config/locales/es.yml +4 -4
  60. data/config/locales/et.yml +4 -4
  61. data/config/locales/fa.yml +4 -4
  62. data/config/locales/fi.yml +4 -4
  63. data/config/locales/fr.yml +4 -4
  64. data/config/locales/gd.yml +4 -4
  65. data/config/locales/gu.yml +4 -4
  66. data/config/locales/he.yml +4 -4
  67. data/config/locales/hi.yml +4 -4
  68. data/config/locales/hr.yml +4 -4
  69. data/config/locales/hu.yml +4 -4
  70. data/config/locales/hy.yml +4 -4
  71. data/config/locales/id.yml +4 -4
  72. data/config/locales/is.yml +4 -4
  73. data/config/locales/it.yml +4 -4
  74. data/config/locales/ja.yml +4 -4
  75. data/config/locales/ka.yml +4 -4
  76. data/config/locales/kk.yml +4 -4
  77. data/config/locales/ko.yml +4 -4
  78. data/config/locales/lt.yml +4 -4
  79. data/config/locales/lv.yml +4 -4
  80. data/config/locales/ms.yml +4 -4
  81. data/config/locales/mt.yml +4 -4
  82. data/config/locales/nl.yml +4 -4
  83. data/config/locales/no.yml +4 -4
  84. data/config/locales/pa-pk.yml +4 -4
  85. data/config/locales/pa.yml +4 -4
  86. data/config/locales/pl.yml +4 -4
  87. data/config/locales/ps.yml +4 -4
  88. data/config/locales/pt.yml +4 -4
  89. data/config/locales/ro.yml +4 -4
  90. data/config/locales/ru.yml +4 -4
  91. data/config/locales/si.yml +4 -4
  92. data/config/locales/sk.yml +4 -4
  93. data/config/locales/sl.yml +4 -4
  94. data/config/locales/so.yml +4 -4
  95. data/config/locales/sq.yml +4 -4
  96. data/config/locales/sr.yml +4 -4
  97. data/config/locales/sv.yml +4 -4
  98. data/config/locales/sw.yml +4 -4
  99. data/config/locales/ta.yml +4 -4
  100. data/config/locales/th.yml +4 -4
  101. data/config/locales/tk.yml +4 -4
  102. data/config/locales/tr.yml +4 -4
  103. data/config/locales/uk.yml +4 -4
  104. data/config/locales/ur.yml +4 -4
  105. data/config/locales/uz.yml +4 -4
  106. data/config/locales/vi.yml +4 -4
  107. data/config/locales/zh-hk.yml +4 -4
  108. data/config/locales/zh-tw.yml +4 -4
  109. data/config/locales/zh.yml +4 -4
  110. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +65 -2
  111. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
  112. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +4 -0
  113. data/lib/govuk_publishing_components/version.rb +1 -1
  114. data/node_modules/axe-core/axe.js +7 -8
  115. data/node_modules/axe-core/axe.min.js +3 -3
  116. data/node_modules/axe-core/package.json +1 -1
  117. data/node_modules/axe-core/sri-history.json +4 -0
  118. metadata +8 -3
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  sq:
3
3
  common:
4
+ hide: Fshih
5
+ show: Shfaq
6
+ toggle_less: Shfaq më pak
7
+ toggle_more: "%{show} %{number} më tepër"
4
8
  translations: Përkthimet
5
9
  components:
6
10
  accordion:
7
- hide: Fshih
8
11
  hide_all: Fshih të gjitha seksionet
9
- show: Shfaq
10
12
  show_all: Shfaq të gjitha seksionet
11
13
  this_section_visually_hidden: " këtë seksion"
12
14
  article_schema:
@@ -126,8 +128,6 @@ sq:
126
128
  part_of: Pjesë e
127
129
  published: Publikuar
128
130
  see_all_updates: Shih të gjitha përditësimet
129
- toggle_less: Shfaq më pak
130
- toggle_more: "+ %{number} më tepër"
131
131
  modal_dialogue:
132
132
  close_modal: Mbyll dialogun modal
133
133
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  sr:
3
3
  common:
4
+ hide: Sakrij
5
+ show: Prikaži
6
+ toggle_less: Prikaži manje
7
+ toggle_more: još %{number}
4
8
  translations: Prevodi
5
9
  components:
6
10
  accordion:
7
- hide: Sakrij
8
11
  hide_all: Sakrij sve odeljke
9
- show: Prikaži
10
12
  show_all: Prikaži sve odeljke
11
13
  this_section_visually_hidden: " ovaj odeljak"
12
14
  article_schema:
@@ -127,8 +129,6 @@ sr:
127
129
  part_of: Deo
128
130
  published: Objavljeno
129
131
  see_all_updates: Pogledajte sva ažuriranja
130
- toggle_less: Prikaži manje
131
- toggle_more: još %{number}
132
132
  modal_dialogue:
133
133
  close_modal: Zatvori modalni dijalog
134
134
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  sv:
3
3
  common:
4
+ hide: Dölj
5
+ show: Visa
6
+ toggle_less: Visa färre
7
+ toggle_more: "%{show} %{number} mer"
4
8
  translations: Översättningar
5
9
  components:
6
10
  accordion:
7
- hide: Dölj
8
11
  hide_all: Dölj alla avsnitt
9
- show: Visa
10
12
  show_all: Visa alla avsnitt
11
13
  this_section_visually_hidden: " detta avsnitt"
12
14
  article_schema:
@@ -126,8 +128,6 @@ sv:
126
128
  part_of: Del av
127
129
  published: Publicerad
128
130
  see_all_updates: Se alla uppdateringar
129
- toggle_less: Visa färre
130
- toggle_more: "+ %{number} mer"
131
131
  modal_dialogue:
132
132
  close_modal: Stäng den modala dialogen
133
133
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  sw:
3
3
  common:
4
+ hide: Ficha
5
+ show: Onyesha
6
+ toggle_less: Onyesha chache
7
+ toggle_more: "%{show} %{number} zaidi"
4
8
  translations: Tafsiri
5
9
  components:
6
10
  accordion:
7
- hide: Ficha
8
11
  hide_all: Ficha sehemu zote
9
- show: Onyesha
10
12
  show_all: Onyesha sehemu zote
11
13
  this_section_visually_hidden: " sehemu hii"
12
14
  article_schema:
@@ -126,8 +128,6 @@ sw:
126
128
  part_of: Sehemu ya
127
129
  published: Ilichapishwa
128
130
  see_all_updates: Angalia taarifa zote
129
- toggle_less: Onyesha chache
130
- toggle_more: "+ %{number} zaidi"
131
131
  modal_dialogue:
132
132
  close_modal: Funga dirisha ibukizi
133
133
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  ta:
3
3
  common:
4
+ hide: மறை
5
+ show: காட்டு
6
+ toggle_less: குறைவாகக் காட்டு
7
+ toggle_more: மேலும் %{show} %{number}
4
8
  translations: மொழிபெயர்ப்புகள்
5
9
  components:
6
10
  accordion:
7
- hide: மறை
8
11
  hide_all: அனைத்துப் பிரிவுகளையும் மறை
9
- show: காட்டு
10
12
  show_all: அனைத்துப் பிரிவுகளையும் காட்டு
11
13
  this_section_visually_hidden: " இந்தப் பிரிவு"
12
14
  article_schema:
@@ -127,8 +129,6 @@ ta:
127
129
  part_of: பகுதி
128
130
  published: வெளியிடப்பட்டது
129
131
  see_all_updates: அனைத்து புதுப்பித்தல்களையும் பார்
130
- toggle_less: குறைவாகக் காட்டு
131
- toggle_more: மேலும் + %{number}
132
132
  modal_dialogue:
133
133
  close_modal: மாதிரி உரையாடலை மூடு
134
134
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  th:
3
3
  common:
4
+ hide: ซ่อน
5
+ show: แสดง
6
+ toggle_less: แสดงน้อยลง
7
+ toggle_more: เพิ่มเติม %{show} %{number} รายการ
4
8
  translations: ข้อความแปล
5
9
  components:
6
10
  accordion:
7
- hide: ซ่อน
8
11
  hide_all: ซ่อนทุกส่วน
9
- show: แสดง
10
12
  show_all: แสดงส่วนทั้งหมด
11
13
  this_section_visually_hidden: " ส่วนนี้"
12
14
  article_schema:
@@ -124,8 +126,6 @@ th:
124
126
  part_of: ส่วนหนึ่งของ
125
127
  published: เผยแพร่แล้ว
126
128
  see_all_updates: ดูอัปเดตทั้งหมด
127
- toggle_less: แสดงน้อยลง
128
- toggle_more: เพิ่มเติม + %{number} รายการ
129
129
  modal_dialogue:
130
130
  close_modal: ปิดการสนทนาโมดอล
131
131
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  tk:
3
3
  common:
4
+ hide: Gizle
5
+ show: görkez
6
+ toggle_less: Azrak görkez
7
+ toggle_more: "%{show} %{number} köpeltmek üçin"
4
8
  translations: Terjimeler
5
9
  components:
6
10
  accordion:
7
- hide: Gizle
8
11
  hide_all: Ähli bölümleri gizle
9
- show: görkez
10
12
  show_all: Ähli bölümleri görkez
11
13
  this_section_visually_hidden: " Bu bölüm"
12
14
  article_schema:
@@ -127,8 +129,6 @@ tk:
127
129
  part_of: Bir bölegi
128
130
  published: Çap edilen
129
131
  see_all_updates: Ähli täzelenmelere serediň
130
- toggle_less: Azrak görkez
131
- toggle_more: "+ %{number} köpeltmek üçin"
132
132
  modal_dialogue:
133
133
  close_modal: Modal gepleşikleri tamamlamak
134
134
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  tr:
3
3
  common:
4
+ hide: Gizle
5
+ show: Göster
6
+ toggle_less: Daha az göster
7
+ toggle_more: "%{show} %{number} daha fazla"
4
8
  translations: Tercümeler
5
9
  components:
6
10
  accordion:
7
- hide: Gizle
8
11
  hide_all: Tüm bölümleri gizle
9
- show: Göster
10
12
  show_all: Tüm bölümleri göster
11
13
  this_section_visually_hidden: " Bu bölüm"
12
14
  article_schema:
@@ -127,8 +129,6 @@ tr:
127
129
  part_of: Şunun kısmı
128
130
  published: Yayınlanan
129
131
  see_all_updates: Tüm güncellemeleri görün
130
- toggle_less: Daha az göster
131
- toggle_more: "+ %{number} daha fazla"
132
132
  modal_dialogue:
133
133
  close_modal: Model diyaloğu kapat
134
134
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  uk:
3
3
  common:
4
+ hide: Приховати
5
+ show: Показати
6
+ toggle_less: Показати менше
7
+ toggle_more: "%{show} %{number} більше"
4
8
  translations: Переклади
5
9
  components:
6
10
  accordion:
7
- hide: Приховати
8
11
  hide_all: приховати всі розділи
9
- show: Показати
10
12
  show_all: Показати всі розділи
11
13
  this_section_visually_hidden: " цей розділ"
12
14
  article_schema:
@@ -133,8 +135,6 @@ uk:
133
135
  part_of: Частина
134
136
  published: Опубліковано
135
137
  see_all_updates: Переглянути всі оновлення
136
- toggle_less: Показати менше
137
- toggle_more: "+ %{number} більше"
138
138
  modal_dialogue:
139
139
  close_modal: Закрити модальний діалог
140
140
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  ur:
3
3
  common:
4
+ hide: پوشیدہ کریں
5
+ show: دکھائی
6
+ toggle_less: کم دکھائیں
7
+ toggle_more: "%{show} %{number} مزید"
4
8
  translations: تراجم
5
9
  components:
6
10
  accordion:
7
- hide: پوشیدہ کریں
8
11
  hide_all: تمام سیکشنز کو پوشیدہ کریں
9
- show: دکھائی
10
12
  show_all: تمام سیکشنز دکھائیں
11
13
  this_section_visually_hidden: " یہ سیکشن"
12
14
  article_schema:
@@ -123,8 +125,6 @@ ur:
123
125
  part_of: حصہ از
124
126
  published: شائع کردہ
125
127
  see_all_updates: تمام اپ ڈیٹس دیکھیں
126
- toggle_less: کم دکھائیں
127
- toggle_more: "+ %{number} مزید"
128
128
  modal_dialogue:
129
129
  close_modal: محدود موڈل ڈائیلاگ
130
130
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  uz:
3
3
  common:
4
+ hide: Яшириш
5
+ show: Кўрсатиш
6
+ toggle_less: Камроқ кўрсатиш
7
+ toggle_more: "%{show} %{number} кўпроқ"
4
8
  translations: Таржималар
5
9
  components:
6
10
  accordion:
7
- hide: Яшириш
8
11
  hide_all: Бўлимларни барчасини яшириш
9
- show: Кўрсатиш
10
12
  show_all: Бўлимларни барчасини кўрсатиш
11
13
  this_section_visually_hidden: " ушбу бўлим"
12
14
  article_schema:
@@ -128,8 +130,6 @@ uz:
128
130
  part_of: Қисм
129
131
  published: Нашр қилинган
130
132
  see_all_updates: Барча янгиланишларни кўриш
131
- toggle_less: Камроқ кўрсатиш
132
- toggle_more: "+ %{number} кўпроқ"
133
133
  modal_dialogue:
134
134
  close_modal: Модал мулоқотни ёпиш
135
135
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  vi:
3
3
  common:
4
+ hide: Ẩn
5
+ show: Hiển thị
6
+ toggle_less: Ẩn bớt
7
+ toggle_more: "%{show} thêm %{number}"
4
8
  translations: Bản dịch
5
9
  components:
6
10
  accordion:
7
- hide: Ẩn
8
11
  hide_all: Ẩn tất cả các phần
9
- show: Hiển thị
10
12
  show_all: Hiển thị tất cả các phần
11
13
  this_section_visually_hidden: " phần này"
12
14
  article_schema:
@@ -125,8 +127,6 @@ vi:
125
127
  part_of: Một phần của
126
128
  published: Đã xuất bản
127
129
  see_all_updates: Xem tất cả nội dung cập nhật
128
- toggle_less: Ẩn bớt
129
- toggle_more: "+ thêm %{number}"
130
130
  modal_dialogue:
131
131
  close_modal: Đóng đối thoại phương thức
132
132
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  zh-hk:
3
3
  common:
4
+ hide: 隱藏
5
+ show: 顯示
6
+ toggle_less: 顯示更少內容
7
+ toggle_more: "%{show} %{number} more"
4
8
  translations: 譯文
5
9
  components:
6
10
  accordion:
7
- hide: 隱藏
8
11
  hide_all: 隱藏所有部份
9
- show: 顯示
10
12
  show_all: 顯示所有部份
11
13
  this_section_visually_hidden: 此部份
12
14
  article_schema:
@@ -124,8 +126,6 @@ zh-hk:
124
126
  part_of: 部份
125
127
  published: 已發佈
126
128
  see_all_updates: 查閱所有更新項
127
- toggle_less: 顯示更少內容
128
- toggle_more: "+ %{number} more"
129
129
  modal_dialogue:
130
130
  close_modal: 關閉互動視窗對話
131
131
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  zh-tw:
3
3
  common:
4
+ hide: 隱藏
5
+ show: 展開
6
+ toggle_less: 顯示部分
7
+ toggle_more: "%{show} %{number}更多"
4
8
  translations: 翻譯
5
9
  components:
6
10
  accordion:
7
- hide: 隱藏
8
11
  hide_all: 隱藏所有區段
9
- show: 展開
10
12
  show_all: 展開所有區段
11
13
  this_section_visually_hidden: " 這個區段"
12
14
  article_schema:
@@ -124,8 +126,6 @@ zh-tw:
124
126
  part_of: 部分
125
127
  published: 發布
126
128
  see_all_updates: 查看所有更新
127
- toggle_less: 顯示部分
128
- toggle_more: "+ %{number}更多"
129
129
  modal_dialogue:
130
130
  close_modal: 關閉模態對話
131
131
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  zh:
3
3
  common:
4
+ hide: 隐藏
5
+ show: 显示
6
+ toggle_less: 显示更少
7
+ toggle_more: "%{show} %{number}更多"
4
8
  translations: 翻译
5
9
  components:
6
10
  accordion:
7
- hide: 隐藏
8
11
  hide_all: 隐藏所有小节
9
- show: 显示
10
12
  show_all: 显示所有小节
11
13
  this_section_visually_hidden: " 本小节"
12
14
  article_schema:
@@ -124,8 +126,6 @@ zh:
124
126
  part_of: 一部分
125
127
  published: 已发布
126
128
  see_all_updates: 查看全部更新
127
- toggle_less: 显示更少
128
- toggle_more: "+ %{number}更多"
129
129
  modal_dialogue:
130
130
  close_modal: 关闭模态对话
131
131
  notice:
@@ -4,14 +4,15 @@ module GovukPublishingComponents
4
4
  include ActionView::Helpers
5
5
  include ActionView::Context
6
6
 
7
- attr_reader :href, :href_data_attributes, :extra_details, :large, :extra_details_no_indent, :heading_text, :metadata, :lang, :image_loading
7
+ attr_reader :href_data_attributes, :extra_details, :extra_details_no_indent, :heading_text, :metadata, :lang, :image_loading, :youtube_video_id, :image_src
8
8
 
9
- def initialize(local_assigns)
9
+ def initialize(local_assigns, brand_helper)
10
10
  @href = local_assigns[:href]
11
11
  @href_data_attributes = local_assigns[:href_data_attributes]
12
12
  @extra_details = local_assigns[:extra_details] || []
13
13
  @image_src = local_assigns[:image_src]
14
14
  @image_alt = local_assigns[:image_alt] || ""
15
+ @youtube_video_alt = local_assigns[:youtube_video_alt]
15
16
  @image_loading = local_assigns[:image_loading] || "auto"
16
17
  @srcset = local_assigns[:srcset] || nil
17
18
  @sizes = local_assigns[:sizes] || nil
@@ -23,6 +24,22 @@ module GovukPublishingComponents
23
24
  @extra_details_no_indent = local_assigns[:extra_details_no_indent]
24
25
  @metadata = local_assigns[:metadata]
25
26
  @lang = local_assigns[:lang]
27
+ @youtube_video_id = local_assigns[:youtube_video_id] || nil
28
+
29
+ @brand_helper = brand_helper
30
+ end
31
+
32
+ def href
33
+ return youtube_href if @youtube_video_id
34
+
35
+ @href
36
+ end
37
+
38
+ def large
39
+ # if youtube video, we don't want to use
40
+ # the small variant, large will be always
41
+ # true if a youtube_video_id is supplied
42
+ @youtube_video_id || @large
26
43
  end
27
44
 
28
45
  def is_tracking?
@@ -36,6 +53,12 @@ module GovukPublishingComponents
36
53
  false
37
54
  end
38
55
 
56
+ def media
57
+ return youtube_link if @youtube_video_id
58
+
59
+ image
60
+ end
61
+
39
62
  def image
40
63
  if @image_src
41
64
  content_tag(:figure, class: "gem-c-image-card__image-wrapper") do
@@ -75,6 +98,46 @@ module GovukPublishingComponents
75
98
  def description
76
99
  content_tag(:div, @description, class: "gem-c-image-card__description") if @description
77
100
  end
101
+
102
+ def youtube_href
103
+ "https://www.youtube.com/watch?v=#{@youtube_video_id}"
104
+ end
105
+
106
+ def youtube_thumbnail_url
107
+ "https://img.youtube.com/vi/#{@youtube_video_id}/maxresdefault.jpg"
108
+ end
109
+
110
+ def youtube_thumbnail
111
+ thumbnail = content_tag(:div, class: "gem-c-image-card__youtube-thumbnail-image-container") do
112
+ image_tag(
113
+ youtube_thumbnail_url,
114
+ class: "gem-c-image-card__image gem-c-image-card__youtube-thumbnail-image",
115
+ alt: "",
116
+ loading: @image_loading,
117
+ )
118
+ end
119
+ thumbnail + content_tag(:figcaption, @youtube_video_alt, class: "gem-c-image-card__youtube-thumbnail-container-text govuk-link #{@brand_helper.color_class}")
120
+ end
121
+
122
+ def youtube_link
123
+ content_tag(
124
+ :figure,
125
+ class: "gem-c-image-card__image-wrapper gem-c-image-card__image-wrapper--youtube-embed",
126
+ ) do
127
+ content_tag(:div) do
128
+ link_to(
129
+ href,
130
+ {
131
+ class: "govuk-body govuk-link gem-c-image-card__youtube-thumbnail-container js-youtube-card-embed",
132
+ "data-youtube-player-analytics": true,
133
+ "data-youtube-player-analytics-category": "EmbeddedYoutube",
134
+ },
135
+ ) do
136
+ youtube_thumbnail
137
+ end
138
+ end
139
+ end
140
+ end
78
141
  end
79
142
  end
80
143
  end
@@ -77,7 +77,7 @@ module GovukPublishingComponents
77
77
  if show_sidebar?
78
78
  @sidebar ||= current_step_nav.content.tap do |sb|
79
79
  configure_for_sidebar(sb)
80
- sb.merge!(small: true, heading_level: 3, tracking_id: current_step_nav.content_id)
80
+ sb.merge!(small: true, heading_level: 3, tracking_id: current_step_nav.content_id, ga4_tracking: @query_parameters[:ga4_tracking])
81
81
  end
82
82
  end
83
83
  end
@@ -65,6 +65,10 @@ module GovukPublishingComponents
65
65
  end
66
66
  end
67
67
 
68
+ def component_title
69
+ I18n.t("components.related_#{@context}_navigation.related_content", default: I18n.t("components.related_navigation.related_content"))
70
+ end
71
+
68
72
  def section_css_class(css_class, section_title, link: {}, link_is_inline: false)
69
73
  css_classes = [css_class]
70
74
  css_classes << "#{css_class}--#{@context}" unless @context.nil?
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "34.2.0".freeze
2
+ VERSION = "34.4.0".freeze
3
3
  end
@@ -1,5 +1,5 @@
1
- /*! axe v4.6.1
2
- * Copyright (c) 2022 Deque Systems, Inc.
1
+ /*! axe v4.6.2
2
+ * Copyright (c) 2023 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
5
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -22,7 +22,7 @@
22
22
  }, _typeof(obj);
23
23
  }
24
24
  var axe = axe || {};
25
- axe.version = '4.6.1';
25
+ axe.version = '4.6.2';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -18127,16 +18127,15 @@
18127
18127
  function fullyEncompasses(node, rects) {
18128
18128
  rects = Array.isArray(rects) ? rects : [ rects ];
18129
18129
  var nodeRect = node.getBoundingClientRect();
18130
+ var right = nodeRect.right, bottom = nodeRect.bottom;
18130
18131
  var style = window.getComputedStyle(node);
18131
18132
  var overflow = style.getPropertyValue('overflow');
18132
18133
  if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) {
18133
- nodeRect.width = node.scrollWidth;
18134
- nodeRect.height = node.scrollHeight;
18135
- nodeRect.right = nodeRect.left + nodeRect.width;
18136
- nodeRect.bottom = nodeRect.top + nodeRect.height;
18134
+ right = nodeRect.left + node.scrollWidth;
18135
+ bottom = nodeRect.top + node.scrollHeight;
18137
18136
  }
18138
18137
  return rects.every(function(rect) {
18139
- return rect.top >= nodeRect.top && rect.bottom <= nodeRect.bottom && rect.left >= nodeRect.left && rect.right <= nodeRect.right;
18138
+ return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right;
18140
18139
  });
18141
18140
  }
18142
18141
  function normalizeBlendMode(blendmode) {