govuk_publishing_components 34.0.0 → 34.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +16 -27
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +2 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +4 -4
  5. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +12 -69
  6. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +14 -13
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +247 -412
  8. data/app/views/govuk_publishing_components/components/_label.html.erb +3 -2
  9. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +94 -143
  10. data/app/views/govuk_publishing_components/components/docs/label.yml +6 -0
  11. data/config/locales/ar.yml +4 -1
  12. data/config/locales/az.yml +4 -1
  13. data/config/locales/be.yml +4 -1
  14. data/config/locales/bg.yml +4 -1
  15. data/config/locales/bn.yml +4 -1
  16. data/config/locales/cs.yml +4 -1
  17. data/config/locales/cy.yml +4 -1
  18. data/config/locales/da.yml +4 -1
  19. data/config/locales/de.yml +4 -1
  20. data/config/locales/dr.yml +4 -1
  21. data/config/locales/el.yml +4 -1
  22. data/config/locales/en.yml +6 -10
  23. data/config/locales/es-419.yml +4 -1
  24. data/config/locales/es.yml +4 -1
  25. data/config/locales/et.yml +4 -1
  26. data/config/locales/fa.yml +4 -1
  27. data/config/locales/fi.yml +4 -1
  28. data/config/locales/fr.yml +4 -1
  29. data/config/locales/gd.yml +4 -1
  30. data/config/locales/gu.yml +4 -1
  31. data/config/locales/he.yml +4 -1
  32. data/config/locales/hi.yml +4 -1
  33. data/config/locales/hr.yml +4 -1
  34. data/config/locales/hu.yml +4 -1
  35. data/config/locales/hy.yml +4 -1
  36. data/config/locales/id.yml +4 -1
  37. data/config/locales/is.yml +4 -1
  38. data/config/locales/it.yml +4 -1
  39. data/config/locales/ja.yml +4 -1
  40. data/config/locales/ka.yml +4 -1
  41. data/config/locales/kk.yml +4 -1
  42. data/config/locales/ko.yml +4 -1
  43. data/config/locales/lt.yml +4 -1
  44. data/config/locales/lv.yml +4 -1
  45. data/config/locales/ms.yml +4 -1
  46. data/config/locales/mt.yml +4 -1
  47. data/config/locales/nl.yml +4 -1
  48. data/config/locales/no.yml +4 -1
  49. data/config/locales/pa-pk.yml +4 -1
  50. data/config/locales/pa.yml +4 -1
  51. data/config/locales/pl.yml +4 -1
  52. data/config/locales/ps.yml +4 -1
  53. data/config/locales/pt.yml +4 -1
  54. data/config/locales/ro.yml +4 -1
  55. data/config/locales/ru.yml +4 -1
  56. data/config/locales/si.yml +4 -1
  57. data/config/locales/sk.yml +4 -1
  58. data/config/locales/sl.yml +4 -1
  59. data/config/locales/so.yml +4 -1
  60. data/config/locales/sq.yml +4 -1
  61. data/config/locales/sr.yml +4 -1
  62. data/config/locales/sv.yml +4 -1
  63. data/config/locales/sw.yml +4 -1
  64. data/config/locales/ta.yml +4 -1
  65. data/config/locales/th.yml +4 -1
  66. data/config/locales/tk.yml +4 -1
  67. data/config/locales/tr.yml +4 -1
  68. data/config/locales/uk.yml +4 -1
  69. data/config/locales/ur.yml +4 -1
  70. data/config/locales/uz.yml +4 -1
  71. data/config/locales/vi.yml +4 -1
  72. data/config/locales/zh-hk.yml +4 -1
  73. data/config/locales/zh-tw.yml +4 -1
  74. data/config/locales/zh.yml +4 -1
  75. data/lib/govuk_publishing_components/version.rb +1 -1
  76. data/node_modules/axe-core/axe.d.ts +75 -24
  77. data/node_modules/axe-core/axe.js +4765 -4555
  78. data/node_modules/axe-core/axe.min.js +2 -2
  79. data/node_modules/axe-core/package.json +2 -2
  80. data/node_modules/axe-core/sri-history.json +4 -0
  81. metadata +2 -2
@@ -45,23 +45,65 @@ declare namespace axe {
45
45
  | 'embedded'
46
46
  | 'interactive';
47
47
 
48
+ // Array of length 2 or greater
49
+ type MultiArray<T> = [T, T, ...T[]];
50
+
51
+ // Selectors within a frame
48
52
  type BaseSelector = string;
49
- type CrossTreeSelector = BaseSelector | BaseSelector[];
50
- type CrossFrameSelector = CrossTreeSelector[];
51
53
 
52
- type ContextObject = {
53
- include?: Node | BaseSelector | Array<Node | BaseSelector | BaseSelector[]>;
54
- exclude?: Node | BaseSelector | Array<Node | BaseSelector | BaseSelector[]>;
55
- };
54
+ type ShadowDomSelector = MultiArray<BaseSelector>;
55
+ type CrossTreeSelector = BaseSelector | ShadowDomSelector;
56
+ type LabelledShadowDomSelector = { fromShadowDom: ShadowDomSelector };
56
57
 
57
- type SerialContextObject = {
58
- include?: BaseSelector | Array<BaseSelector | BaseSelector[]>;
59
- exclude?: BaseSelector | Array<BaseSelector | BaseSelector[]>;
60
- };
58
+ // Cross-frame selectors
59
+ type FramesSelector = Array<CrossTreeSelector | LabelledShadowDomSelector>;
60
+ type UnlabelledFrameSelector = CrossTreeSelector[];
61
+ type LabelledFramesSelector = { fromFrames: MultiArray<FramesSelector[0]> };
62
+ /**
63
+ * @deprecated Use UnlabelledFrameSelector instead
64
+ */
65
+ type CrossFrameSelector = UnlabelledFrameSelector;
66
+
67
+ // Context options
68
+ type Selector =
69
+ | Node
70
+ | BaseSelector
71
+ | LabelledShadowDomSelector
72
+ | LabelledFramesSelector;
73
+ type SelectorList = Array<Selector | FramesSelector> | NodeList;
74
+ type ContextObject =
75
+ | {
76
+ include: Selector | SelectorList;
77
+ exclude?: Selector | SelectorList;
78
+ }
79
+ | {
80
+ exclude: Selector | SelectorList;
81
+ };
82
+ type ElementContext = Selector | SelectorList | ContextObject;
61
83
 
62
- type RunCallback = (error: Error, results: AxeResults) => void;
84
+ type SerialSelector =
85
+ | BaseSelector
86
+ | LabelledShadowDomSelector
87
+ | LabelledFramesSelector;
88
+ type SerialFrameSelector = SerialSelector | FramesSelector;
89
+ type SerialSelectorList = Array<SerialFrameSelector>;
63
90
 
64
- type ElementContext = Node | NodeList | string | ContextObject;
91
+ type SerialContextObject =
92
+ | {
93
+ include: SerialSelector | SerialSelectorList;
94
+ exclude?: SerialSelector | SerialSelectorList;
95
+ }
96
+ | {
97
+ exclude: SerialSelector | SerialSelectorList;
98
+ include?: SerialSelector | SerialSelectorList;
99
+ };
100
+
101
+ interface FrameContextObject {
102
+ include: UnlabelledFrameSelector[];
103
+ exclude: UnlabelledFrameSelector[];
104
+ }
105
+
106
+ type RunCallback<T = AxeResults> = (error: Error, results: T) => void;
65
107
 
66
108
  interface TestEngine {
67
109
  name: string;
@@ -255,9 +297,9 @@ declare namespace axe {
255
297
  interface SerialDqElement {
256
298
  source: string;
257
299
  nodeIndexes: number[];
258
- selector: CrossFrameSelector;
300
+ selector: UnlabelledFrameSelector;
259
301
  xpath: string[];
260
- ancestry: CrossFrameSelector;
302
+ ancestry: UnlabelledFrameSelector;
261
303
  }
262
304
  interface PartialRuleResult {
263
305
  id: string;
@@ -274,7 +316,7 @@ declare namespace axe {
274
316
  type PartialResults = Array<PartialResult | null>;
275
317
  interface FrameContext {
276
318
  frameSelector: CrossTreeSelector;
277
- frameContext: SerialContextObject;
319
+ frameContext: FrameContextObject;
278
320
  }
279
321
  interface Utils {
280
322
  getFrameContexts: (
@@ -282,6 +324,7 @@ declare namespace axe {
282
324
  options?: RunOptions
283
325
  ) => FrameContext[];
284
326
  shadowSelect: (selector: CrossTreeSelector) => Element | null;
327
+ shadowSelectAll: (selector: CrossTreeSelector) => Element[];
285
328
  }
286
329
  interface EnvironmentData {
287
330
  testEngine: TestEngine;
@@ -313,19 +356,27 @@ declare namespace axe {
313
356
  * @param {RunCallback} callback Optional The function to invoke when analysis is complete.
314
357
  * @returns {Promise<AxeResults>|void} If the callback was not defined, axe will return a Promise.
315
358
  */
316
- function run(context?: ElementContext): Promise<AxeResults>;
317
- function run(options: RunOptions): Promise<AxeResults>;
318
- function run(callback: (error: Error, results: AxeResults) => void): void;
319
- function run(context: ElementContext, callback: RunCallback): void;
320
- function run(options: RunOptions, callback: RunCallback): void;
321
- function run(
359
+ function run<T = AxeResults>(context?: ElementContext): Promise<T>;
360
+ function run<T = AxeResults>(options: RunOptions): Promise<T>;
361
+ function run<T = AxeResults>(
362
+ callback: (error: Error, results: T) => void
363
+ ): void;
364
+ function run<T = AxeResults>(
365
+ context: ElementContext,
366
+ callback: RunCallback<T>
367
+ ): void;
368
+ function run<T = AxeResults>(
369
+ options: RunOptions,
370
+ callback: RunCallback<T>
371
+ ): void;
372
+ function run<T = AxeResults>(
322
373
  context: ElementContext,
323
374
  options: RunOptions
324
- ): Promise<AxeResults>;
325
- function run(
375
+ ): Promise<T>;
376
+ function run<T = AxeResults>(
326
377
  context: ElementContext,
327
378
  options: RunOptions,
328
- callback: RunCallback
379
+ callback: RunCallback<T>
329
380
  ): void;
330
381
 
331
382
  /**