@govuk-one-login/frontend-ui 4.1.3 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var path = require('path');
4
- var fs = require('fs');
3
+ var path = require('node:path');
4
+ var node_fs = require('node:fs');
5
5
 
6
6
  var cookieBanner$1 = {
7
7
  body1: "Rydym yn defnyddio rhai cwcis hanfodol i wneud i'r gwasanaeth hwn weithio.",
@@ -232,9 +232,9 @@ const getTranslationObject = (locale, filepath) => {
232
232
  path.resolve(filepath !== null && filepath !== void 0 ? filepath : "", locale, "translation.json"),
233
233
  ];
234
234
  for (const filePath of possiblePaths) {
235
- if (fs.existsSync(filePath)) {
235
+ if (node_fs.existsSync(filePath)) {
236
236
  try {
237
- const fileContent = fs.readFileSync(filePath, "utf8");
237
+ const fileContent = node_fs.readFileSync(filePath, "utf8");
238
238
  return JSON.parse(fileContent);
239
239
  }
240
240
  catch (error) {
@@ -245,15 +245,13 @@ const getTranslationObject = (locale, filepath) => {
245
245
  console.warn(`No translation file found for locale: ${locale}`);
246
246
  return {}; // Return an empty object as a fallback
247
247
  };
248
- const frontendUiTranslationEn = translationEn;
249
- const frontendUiTranslationCy = translationCy;
250
248
 
251
249
  exports.addLanguageParam = addLanguageParam;
252
250
  exports.contactUsUrl = contactUsUrl;
253
251
  exports.frontendUiMiddleware = frontendUiMiddleware;
254
252
  exports.frontendUiMiddlewareIdentityBypass = frontendUiMiddlewareIdentityBypass;
255
- exports.frontendUiTranslationCy = frontendUiTranslationCy;
256
- exports.frontendUiTranslationEn = frontendUiTranslationEn;
253
+ exports.frontendUiTranslationCy = translationCy;
254
+ exports.frontendUiTranslationEn = translationEn;
257
255
  exports.getTranslationObject = getTranslationObject;
258
256
  exports.setBaseTranslations = setBaseTranslations;
259
257
  exports.setFrontendUiTranslations = setFrontendUiTranslations;
@@ -34,133 +34,6 @@ export declare function addLanguageParam(language: string, url?: URL): string;
34
34
  export declare function contactUsUrl(baseUrl: string, urlToAppend: string): string | null;
35
35
  export declare const setBaseTranslations: (instanceI18n: typeof i18next, filePath?: string) => void;
36
36
  export declare const getTranslationObject: (locale: string, filepath?: string) => Record<string, unknown>;
37
- export declare const frontendUiTranslationEn: {
38
- cookieBanner: {
39
- body1: string;
40
- body2: string;
41
- ariaLabel: string;
42
- headingText: string;
43
- acceptAdditionalCookies: string;
44
- rejectAdditionalCookies: string;
45
- viewCookies: string;
46
- cookieBannerAccept: {
47
- body1: string;
48
- body2: string;
49
- };
50
- cookieBannerReject: {
51
- body1: string;
52
- body2: string;
53
- };
54
- changeCookiePreferencesLink: string;
55
- hideCookieMessage: string;
56
- viewCookiesLink: string;
57
- };
58
- footer: {
59
- footerNavItems: ({
60
- href: string;
61
- text: string;
62
- attributes?: undefined;
63
- } | {
64
- href: string;
65
- text: string;
66
- attributes: {
67
- rel: string;
68
- target: string;
69
- };
70
- })[];
71
- copyright: {
72
- text: string;
73
- };
74
- contentLicence: {
75
- html: string;
76
- };
77
- };
78
- header: {
79
- signOut: string;
80
- ariaLabel: string;
81
- signOutAriaLabel: string;
82
- };
83
- languageSelect: {
84
- ariaLabel: string;
85
- };
86
- phaseBanner: {
87
- tag: string;
88
- text: string;
89
- link: string;
90
- };
91
- skipLink: {
92
- title: string;
93
- };
94
- progressButton: {
95
- text: string;
96
- waitingText: string;
97
- longWaitingText: string;
98
- noJavascriptMessage: string;
99
- };
100
- };
101
- export declare const frontendUiTranslationCy: {
102
- cookieBanner: {
103
- body1: string;
104
- body2: string;
105
- ariaLabel: string;
106
- headingText: string;
107
- acceptAdditionalCookies: string;
108
- rejectAdditionalCookies: string;
109
- viewCookies: string;
110
- cookieBannerAccept: {
111
- body1: string;
112
- body2: string;
113
- };
114
- cookieBannerReject: {
115
- body1: string;
116
- body2: string;
117
- };
118
- changeCookiePreferencesLink: string;
119
- hideCookieMessage: string;
120
- viewCookiesLink: string;
121
- };
122
- footer: {
123
- footerNavItems: ({
124
- href: string;
125
- text: string;
126
- attributes?: undefined;
127
- } | {
128
- href: string;
129
- text: string;
130
- attributes: {
131
- rel: string;
132
- target: string;
133
- };
134
- })[];
135
- copyright: {
136
- text: string;
137
- };
138
- contentLicence: {
139
- html: string;
140
- };
141
- };
142
- header: {
143
- signOut: string;
144
- ariaLabel: string;
145
- signOutAriaLabel: string;
146
- };
147
- languageSelect: {
148
- ariaLabel: string;
149
- };
150
- phaseBanner: {
151
- tag: string;
152
- text: string;
153
- link: string;
154
- };
155
- skipLink: {
156
- title: string;
157
- };
158
- progressButton: {
159
- text: string;
160
- waitingText: string;
161
- longWaitingText: string;
162
- noJavascriptMessage: string;
163
- };
164
- };
165
- export {};
37
+ export { default as frontendUiTranslationEn } from "../locales/en/translation.json";
38
+ export { default as frontendUiTranslationCy } from "../locales/cy/translation.json";
166
39
  //# sourceMappingURL=index.d.ts.map
@@ -34,133 +34,6 @@ export declare function addLanguageParam(language: string, url?: URL): string;
34
34
  export declare function contactUsUrl(baseUrl: string, urlToAppend: string): string | null;
35
35
  export declare const setBaseTranslations: (instanceI18n: typeof i18next, filePath?: string) => void;
36
36
  export declare const getTranslationObject: (locale: string, filepath?: string) => Record<string, unknown>;
37
- export declare const frontendUiTranslationEn: {
38
- cookieBanner: {
39
- body1: string;
40
- body2: string;
41
- ariaLabel: string;
42
- headingText: string;
43
- acceptAdditionalCookies: string;
44
- rejectAdditionalCookies: string;
45
- viewCookies: string;
46
- cookieBannerAccept: {
47
- body1: string;
48
- body2: string;
49
- };
50
- cookieBannerReject: {
51
- body1: string;
52
- body2: string;
53
- };
54
- changeCookiePreferencesLink: string;
55
- hideCookieMessage: string;
56
- viewCookiesLink: string;
57
- };
58
- footer: {
59
- footerNavItems: ({
60
- href: string;
61
- text: string;
62
- attributes?: undefined;
63
- } | {
64
- href: string;
65
- text: string;
66
- attributes: {
67
- rel: string;
68
- target: string;
69
- };
70
- })[];
71
- copyright: {
72
- text: string;
73
- };
74
- contentLicence: {
75
- html: string;
76
- };
77
- };
78
- header: {
79
- signOut: string;
80
- ariaLabel: string;
81
- signOutAriaLabel: string;
82
- };
83
- languageSelect: {
84
- ariaLabel: string;
85
- };
86
- phaseBanner: {
87
- tag: string;
88
- text: string;
89
- link: string;
90
- };
91
- skipLink: {
92
- title: string;
93
- };
94
- progressButton: {
95
- text: string;
96
- waitingText: string;
97
- longWaitingText: string;
98
- noJavascriptMessage: string;
99
- };
100
- };
101
- export declare const frontendUiTranslationCy: {
102
- cookieBanner: {
103
- body1: string;
104
- body2: string;
105
- ariaLabel: string;
106
- headingText: string;
107
- acceptAdditionalCookies: string;
108
- rejectAdditionalCookies: string;
109
- viewCookies: string;
110
- cookieBannerAccept: {
111
- body1: string;
112
- body2: string;
113
- };
114
- cookieBannerReject: {
115
- body1: string;
116
- body2: string;
117
- };
118
- changeCookiePreferencesLink: string;
119
- hideCookieMessage: string;
120
- viewCookiesLink: string;
121
- };
122
- footer: {
123
- footerNavItems: ({
124
- href: string;
125
- text: string;
126
- attributes?: undefined;
127
- } | {
128
- href: string;
129
- text: string;
130
- attributes: {
131
- rel: string;
132
- target: string;
133
- };
134
- })[];
135
- copyright: {
136
- text: string;
137
- };
138
- contentLicence: {
139
- html: string;
140
- };
141
- };
142
- header: {
143
- signOut: string;
144
- ariaLabel: string;
145
- signOutAriaLabel: string;
146
- };
147
- languageSelect: {
148
- ariaLabel: string;
149
- };
150
- phaseBanner: {
151
- tag: string;
152
- text: string;
153
- link: string;
154
- };
155
- skipLink: {
156
- title: string;
157
- };
158
- progressButton: {
159
- text: string;
160
- waitingText: string;
161
- longWaitingText: string;
162
- noJavascriptMessage: string;
163
- };
164
- };
165
- export {};
37
+ export { default as frontendUiTranslationEn } from "../locales/en/translation.json";
38
+ export { default as frontendUiTranslationCy } from "../locales/cy/translation.json";
166
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mapp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B,oBAAoB,CAClC,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,YAAY,GACjB,IAAI,CAAC;AAaR,eAAO,MAAM,yBAAyB,GAAI,cAAc,OAAO,OAAO,SAerE,CAAC;AAGF,eAAO,MAAM,kCAAkC,GAC7C,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,YAAY,SAUnB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,UAU3D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAkBhE;AAED,eAAO,MAAM,mBAAmB,GAC9B,cAAc,OAAO,OAAO,EAC5B,WAAW,MAAM,SASlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAuBxB,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -364,7 +364,11 @@ function handleProgressButtonClick(element, waitingText, longWaitingText, errorP
364
364
  }
365
365
  element.setAttribute('data-prevent-double-click', 'true');
366
366
  if (element instanceof HTMLButtonElement || element instanceof HTMLInputElement) {
367
- element.disabled = true;
367
+ // When the button is disabled immediately it prevents the initial form submission.
368
+ // TODO: We should revisit this. It would be better to trigger the button actions from the form submission rather than the button click when a form is present.
369
+ setTimeout(() => {
370
+ element.disabled = true;
371
+ }, 0);
368
372
  }
369
373
  else if (element.tagName.toLowerCase() === 'a') {
370
374
  element.setAttribute('aria-disabled', 'true');
@@ -34,133 +34,6 @@ export declare function addLanguageParam(language: string, url?: URL): string;
34
34
  export declare function contactUsUrl(baseUrl: string, urlToAppend: string): string | null;
35
35
  export declare const setBaseTranslations: (instanceI18n: typeof i18next, filePath?: string) => void;
36
36
  export declare const getTranslationObject: (locale: string, filepath?: string) => Record<string, unknown>;
37
- export declare const frontendUiTranslationEn: {
38
- cookieBanner: {
39
- body1: string;
40
- body2: string;
41
- ariaLabel: string;
42
- headingText: string;
43
- acceptAdditionalCookies: string;
44
- rejectAdditionalCookies: string;
45
- viewCookies: string;
46
- cookieBannerAccept: {
47
- body1: string;
48
- body2: string;
49
- };
50
- cookieBannerReject: {
51
- body1: string;
52
- body2: string;
53
- };
54
- changeCookiePreferencesLink: string;
55
- hideCookieMessage: string;
56
- viewCookiesLink: string;
57
- };
58
- footer: {
59
- footerNavItems: ({
60
- href: string;
61
- text: string;
62
- attributes?: undefined;
63
- } | {
64
- href: string;
65
- text: string;
66
- attributes: {
67
- rel: string;
68
- target: string;
69
- };
70
- })[];
71
- copyright: {
72
- text: string;
73
- };
74
- contentLicence: {
75
- html: string;
76
- };
77
- };
78
- header: {
79
- signOut: string;
80
- ariaLabel: string;
81
- signOutAriaLabel: string;
82
- };
83
- languageSelect: {
84
- ariaLabel: string;
85
- };
86
- phaseBanner: {
87
- tag: string;
88
- text: string;
89
- link: string;
90
- };
91
- skipLink: {
92
- title: string;
93
- };
94
- progressButton: {
95
- text: string;
96
- waitingText: string;
97
- longWaitingText: string;
98
- noJavascriptMessage: string;
99
- };
100
- };
101
- export declare const frontendUiTranslationCy: {
102
- cookieBanner: {
103
- body1: string;
104
- body2: string;
105
- ariaLabel: string;
106
- headingText: string;
107
- acceptAdditionalCookies: string;
108
- rejectAdditionalCookies: string;
109
- viewCookies: string;
110
- cookieBannerAccept: {
111
- body1: string;
112
- body2: string;
113
- };
114
- cookieBannerReject: {
115
- body1: string;
116
- body2: string;
117
- };
118
- changeCookiePreferencesLink: string;
119
- hideCookieMessage: string;
120
- viewCookiesLink: string;
121
- };
122
- footer: {
123
- footerNavItems: ({
124
- href: string;
125
- text: string;
126
- attributes?: undefined;
127
- } | {
128
- href: string;
129
- text: string;
130
- attributes: {
131
- rel: string;
132
- target: string;
133
- };
134
- })[];
135
- copyright: {
136
- text: string;
137
- };
138
- contentLicence: {
139
- html: string;
140
- };
141
- };
142
- header: {
143
- signOut: string;
144
- ariaLabel: string;
145
- signOutAriaLabel: string;
146
- };
147
- languageSelect: {
148
- ariaLabel: string;
149
- };
150
- phaseBanner: {
151
- tag: string;
152
- text: string;
153
- link: string;
154
- };
155
- skipLink: {
156
- title: string;
157
- };
158
- progressButton: {
159
- text: string;
160
- waitingText: string;
161
- longWaitingText: string;
162
- noJavascriptMessage: string;
163
- };
164
- };
165
- export {};
37
+ export { default as frontendUiTranslationEn } from "../locales/en/translation.json";
38
+ export { default as frontendUiTranslationCy } from "../locales/cy/translation.json";
166
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQ1D,UAAU,QAAQ;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QACL,IAAI,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KAClC,CAAC;CACH;AAED,UAAU,cAAe,SAAQ,OAAO;IACtC,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,UAAU,eAAgB,SAAQ,QAAQ;IACxC,MAAM,EAAE;QACN,YAAY,EAAE,OAAO,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,UAAU,aAAa;IACrB,MAAM,EAAE;QACN,YAAY,EAAE,OAAO,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAGD,wBAAgB,oBAAoB,CAClC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C;AACpF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -1,5 +1,5 @@
1
- import path from 'path';
2
- import { existsSync, readFileSync } from 'fs';
1
+ import path from 'node:path';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
3
 
4
4
  var cookieBanner$1 = {
5
5
  body1: "Rydym yn defnyddio rhai cwcis hanfodol i wneud i'r gwasanaeth hwn weithio.",
@@ -243,7 +243,5 @@ const getTranslationObject = (locale, filepath) => {
243
243
  console.warn(`No translation file found for locale: ${locale}`);
244
244
  return {}; // Return an empty object as a fallback
245
245
  };
246
- const frontendUiTranslationEn = translationEn;
247
- const frontendUiTranslationCy = translationCy;
248
246
 
249
- export { addLanguageParam, contactUsUrl, frontendUiMiddleware, frontendUiMiddlewareIdentityBypass, frontendUiTranslationCy, frontendUiTranslationEn, getTranslationObject, setBaseTranslations, setFrontendUiTranslations };
247
+ export { addLanguageParam, contactUsUrl, frontendUiMiddleware, frontendUiMiddlewareIdentityBypass, translationCy as frontendUiTranslationCy, translationEn as frontendUiTranslationEn, getTranslationObject, setBaseTranslations, setFrontendUiTranslations };
@@ -362,7 +362,11 @@ function handleProgressButtonClick(element, waitingText, longWaitingText, errorP
362
362
  }
363
363
  element.setAttribute('data-prevent-double-click', 'true');
364
364
  if (element instanceof HTMLButtonElement || element instanceof HTMLInputElement) {
365
- element.disabled = true;
365
+ // When the button is disabled immediately it prevents the initial form submission.
366
+ // TODO: We should revisit this. It would be better to trigger the button actions from the form submission rather than the button click when a form is present.
367
+ setTimeout(() => {
368
+ element.disabled = true;
369
+ }, 0);
366
370
  }
367
371
  else if (element.tagName.toLowerCase() === 'a') {
368
372
  element.setAttribute('aria-disabled', 'true');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govuk-one-login/frontend-ui",
3
- "version": "4.1.3",
3
+ "version": "4.1.5",
4
4
  "description": "",
5
5
  "main": "build/cjs/backend/index.cjs",
6
6
  "module": "build/esm/backend/index.js",
@@ -38,7 +38,6 @@
38
38
  },
39
39
  "homepage": "https://github.com/govuk-one-login/govuk-one-login-frontend#readme",
40
40
  "dependencies": {
41
- "js-yaml": "^4.1.0",
42
41
  "pino": "^10.1.0"
43
42
  },
44
43
  "peerDependencies": {