govuk_publishing_components 37.2.3 → 37.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +4 -3
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +0 -19
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-auto-tracker.js +4 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +1 -1
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +4 -3
  7. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +5 -4
  8. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +16 -5
  9. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +17 -9
  10. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js +4 -3
  11. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-smart-answer-results-tracker.js +4 -3
  12. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +1 -0
  13. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +1 -8
  14. data/app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js +4 -4
  15. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +1 -0
  16. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -3
  17. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +20 -12
  18. data/app/assets/javascripts/govuk_publishing_components/modules.js +1 -1
  19. data/app/assets/javascripts/govuk_publishing_components/rum-loader.js +2 -3
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +5 -16
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +2 -2
  22. data/app/models/govuk_publishing_components/audit_comparer.rb +0 -1
  23. data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -1
  24. data/app/views/govuk_publishing_components/components/_back_link.html.erb +17 -7
  25. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +1 -1
  26. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +17 -2
  27. data/app/views/govuk_publishing_components/components/_warning_text.html.erb +10 -1
  28. data/app/views/govuk_publishing_components/components/docs/attachment.yml +13 -0
  29. data/app/views/govuk_publishing_components/components/docs/back_link.yml +5 -3
  30. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
  31. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +9 -0
  32. data/app/views/govuk_publishing_components/components/docs/warning_text.yml +7 -0
  33. data/lib/govuk_publishing_components/version.rb +1 -1
  34. data/node_modules/sortablejs/Sortable.js +23 -26
  35. data/node_modules/sortablejs/Sortable.min.js +2 -2
  36. data/node_modules/sortablejs/modular/sortable.complete.esm.js +23 -26
  37. data/node_modules/sortablejs/modular/sortable.core.esm.js +23 -26
  38. data/node_modules/sortablejs/modular/sortable.esm.js +23 -26
  39. data/node_modules/sortablejs/package.json +1 -1
  40. metadata +3 -3
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * Sortable 1.15.1
2
+ * Sortable 1.15.2
3
3
  * @author RubaXa <trash@rubaxa.org>
4
4
  * @author owenm <owen23355@gmail.com>
5
5
  * @license MIT
@@ -128,7 +128,7 @@ function _nonIterableSpread() {
128
128
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
129
129
  }
130
130
 
131
- var version = "1.15.1";
131
+ var version = "1.15.2";
132
132
 
133
133
  function userAgent(pattern) {
134
134
  if (typeof window !== 'undefined' && window.navigator) {
@@ -329,26 +329,6 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
329
329
  };
330
330
  }
331
331
 
332
- /**
333
- * Returns the content rect of the element (bounding rect minus border and padding)
334
- * @param {HTMLElement} el
335
- */
336
- function getContentRect(el) {
337
- var rect = getRect(el);
338
- var paddingLeft = parseInt(css(el, 'padding-left')),
339
- paddingTop = parseInt(css(el, 'padding-top')),
340
- paddingRight = parseInt(css(el, 'padding-right')),
341
- paddingBottom = parseInt(css(el, 'padding-bottom'));
342
- rect.top += paddingTop + parseInt(css(el, 'border-top-width'));
343
- rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));
344
- // Client Width/Height includes padding only
345
- rect.width = el.clientWidth - paddingLeft - paddingRight;
346
- rect.height = el.clientHeight - paddingTop - paddingBottom;
347
- rect.bottom = rect.top + rect.height;
348
- rect.right = rect.left + rect.width;
349
- return rect;
350
- }
351
-
352
332
  /**
353
333
  * Checks if a side of an element is scrolled past a side of its parents
354
334
  * @param {HTMLElement} el The element who's side being scrolled out of view is in question
@@ -555,6 +535,23 @@ function unsetRect(el) {
555
535
  css(el, 'width', '');
556
536
  css(el, 'height', '');
557
537
  }
538
+ function getChildContainingRectFromElement(container, options, ghostEl) {
539
+ var rect = {};
540
+ Array.from(container.children).forEach(function (child) {
541
+ var _rect$left, _rect$top, _rect$right, _rect$bottom;
542
+ if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
543
+ var childRect = getRect(child);
544
+ rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
545
+ rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
546
+ rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
547
+ rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
548
+ });
549
+ rect.width = rect.right - rect.left;
550
+ rect.height = rect.bottom - rect.top;
551
+ rect.x = rect.left;
552
+ rect.y = rect.top;
553
+ return rect;
554
+ }
558
555
  var expando = 'Sortable' + new Date().getTime();
559
556
 
560
557
  function AnimationStateManager() {
@@ -2247,15 +2244,15 @@ function _unsilent() {
2247
2244
  }
2248
2245
  function _ghostIsFirst(evt, vertical, sortable) {
2249
2246
  var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
2250
- var sortableContentRect = getContentRect(sortable.el);
2247
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2251
2248
  var spacer = 10;
2252
- return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2249
+ return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2253
2250
  }
2254
2251
  function _ghostIsLast(evt, vertical, sortable) {
2255
2252
  var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
2256
- var sortableContentRect = getContentRect(sortable.el);
2253
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2257
2254
  var spacer = 10;
2258
- return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
2255
+ return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
2259
2256
  }
2260
2257
  function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
2261
2258
  var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sortablejs",
3
3
  "exportName": "Sortable",
4
- "version": "1.15.1",
4
+ "version": "1.15.2",
5
5
  "devDependencies": {
6
6
  "@babel/core": "^7.4.4",
7
7
  "@babel/plugin-transform-object-assign": "^7.2.0",
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: 37.2.3
4
+ version: 37.3.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: 2024-01-17 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -1497,7 +1497,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1497
1497
  - !ruby/object:Gem::Version
1498
1498
  version: '0'
1499
1499
  requirements: []
1500
- rubygems_version: 3.5.4
1500
+ rubygems_version: 3.5.6
1501
1501
  signing_key:
1502
1502
  specification_version: 4
1503
1503
  summary: A gem to document components in GOV.UK frontend applications