@gopherium/react-auth 0.11.1 → 0.13.0
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 +1 @@
|
|
|
1
|
-
{ "": { "lang": "es-ES", "plural-forms": "nplurals=2; plural=(n != 1);" }, "Actions": ["Acciones"], "Active": ["Activo"], "Back to login": ["Volver al inicio de sesión"], "Disable": ["Desactivar"], "Disable %s": ["Desactivar a %s"], "Disabled": ["Desactivado"], "Done": ["Hecho"], "Enable": ["Activar"], "Enable %s": ["Activar a %s"], "
|
|
1
|
+
{ "": { "lang": "es-ES", "plural-forms": "nplurals=2; plural=(n != 1);" }, "Actions": ["Acciones"], "Active": ["Activo"], "Back to login": ["Volver al inicio de sesión"], "Disable": ["Desactivar"], "Disable %s": ["Desactivar a %s"], "Disabled": ["Desactivado"], "Done": ["Hecho"], "Enable": ["Activar"], "Enable %s": ["Activar a %s"], "Go to login": ["Ir al inicio de sesión"], "If that address has an account, a reset link is on its way.": ["Si esa dirección tiene una cuenta, le llegará un enlace para restablecerla."], "Invalid email or password.": ["Correo o contraseña no válidos."], "Loading users…": ["Cargando usuarios…"], "Loading…": ["Cargando…"], "Log in": ["Iniciar sesión"], "Log out": ["Cerrar sesión"], "Login failed, please try again.": ["No se pudo iniciar sesión, inténtalo de nuevo."], "Logout failed, please try again.": ["No se pudo cerrar sesión, inténtalo de nuevo."], "Lost your password?": ["¿Has olvidado tu contraseña?"], "No mail server is configured. Deliver the activation link by hand.": ["No hay servidor de correo configurado. Entrega el enlace de activación a mano."], "Password": ["Contraseña"], "Send invitation": ["Enviar invitación"], "Send reset link": ["Enviar enlace de restablecimiento"], "Set password": ["Guardar contraseña"], "Something went wrong.": ["Algo ha ido mal."], "The invitation could not be sent.": ["No se pudo enviar la invitación."], "The password could not be set, please try again.": ["No se pudo guardar la contraseña, inténtalo de nuevo."], "The request failed, please try again.": ["No se pudo completar la petición, inténtalo de nuevo."], "This link is no longer valid. Ask for a new one.": ["Este enlace ya no es válido. Pide uno nuevo."], "This link is no longer valid. Ask the person who invited you for a new one.": ["Este enlace ya no es válido. Pide uno nuevo a quien te invitó."], "Too many attempts. Please wait a minute and try again.": ["Demasiados intentos. Espera un minuto e inténtalo de nuevo."], "Try again": ["Inténtalo de nuevo"], "Update failed.": ["No se pudo actualizar."], "Users could not be loaded.": ["No se pudieron cargar los usuarios."], "Your password is set. Sign in with it.": ["Tu contraseña está guardada. Inicia sesión con ella."], "admin section\u0004Users": ["Usuarios"], "button\u0004New user": ["Nuevo usuario"], "column\u0004Email": ["Correo"], "column\u0004Name": ["Nombre"], "column\u0004Status": ["Estado"], "field label\u0004Activation link": ["Enlace de activación"], "field label\u0004Email": ["Correo"], "field label\u0004Name": ["Nombre"], "invalid invitation details": ["datos de invitación no válidos"], "invalid password details": ["datos de contraseña no válidos"], "invalid user details": ["datos de usuario no válidos"], "page heading\u0004New user": ["Nuevo usuario"], "page heading\u0004Users": ["Usuarios"], "the account could not be updated": ["no se ha podido actualizar la cuenta"] }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"":{"lang":"es-ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Actions":["Acciones"],"Active":["Activo"],"Back to login":["Volver al inicio de sesión"],"Disable":["Desactivar"],"Disable %s":["Desactivar a %s"],"Disabled":["Desactivado"],"Done":["Hecho"],"Enable":["Activar"],"Enable %s":["Activar a %s"],"
|
|
1
|
+
{"":{"lang":"es-ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Actions":["Acciones"],"Active":["Activo"],"Back to login":["Volver al inicio de sesión"],"Disable":["Desactivar"],"Disable %s":["Desactivar a %s"],"Disabled":["Desactivado"],"Done":["Hecho"],"Enable":["Activar"],"Enable %s":["Activar a %s"],"Go to login":["Ir al inicio de sesión"],"If that address has an account, a reset link is on its way.":["Si esa dirección tiene una cuenta, le llegará un enlace para restablecerla."],"Invalid email or password.":["Correo o contraseña no válidos."],"Loading users…":["Cargando usuarios…"],"Loading…":["Cargando…"],"Log in":["Iniciar sesión"],"Log out":["Cerrar sesión"],"Login failed, please try again.":["No se pudo iniciar sesión, inténtalo de nuevo."],"Logout failed, please try again.":["No se pudo cerrar sesión, inténtalo de nuevo."],"Lost your password?":["¿Has olvidado tu contraseña?"],"No mail server is configured. Deliver the activation link by hand.":["No hay servidor de correo configurado. Entrega el enlace de activación a mano."],"Password":["Contraseña"],"Send invitation":["Enviar invitación"],"Send reset link":["Enviar enlace de restablecimiento"],"Set password":["Guardar contraseña"],"Something went wrong.":["Algo ha ido mal."],"The invitation could not be sent.":["No se pudo enviar la invitación."],"The password could not be set, please try again.":["No se pudo guardar la contraseña, inténtalo de nuevo."],"The request failed, please try again.":["No se pudo completar la petición, inténtalo de nuevo."],"This link is no longer valid. Ask for a new one.":["Este enlace ya no es válido. Pide uno nuevo."],"This link is no longer valid. Ask the person who invited you for a new one.":["Este enlace ya no es válido. Pide uno nuevo a quien te invitó."],"Too many attempts. Please wait a minute and try again.":["Demasiados intentos. Espera un minuto e inténtalo de nuevo."],"Try again":["Inténtalo de nuevo"],"Update failed.":["No se pudo actualizar."],"Users could not be loaded.":["No se pudieron cargar los usuarios."],"Your password is set. Sign in with it.":["Tu contraseña está guardada. Inicia sesión con ella."],"admin section\u0004Users":["Usuarios"],"button\u0004New user":["Nuevo usuario"],"column\u0004Email":["Correo"],"column\u0004Name":["Nombre"],"column\u0004Status":["Estado"],"field label\u0004Activation link":["Enlace de activación"],"field label\u0004Email":["Correo"],"field label\u0004Name":["Nombre"],"invalid invitation details":["datos de invitación no válidos"],"invalid password details":["datos de contraseña no válidos"],"invalid user details":["datos de usuario no válidos"],"page heading\u0004New user":["Nuevo usuario"],"page heading\u0004Users":["Usuarios"],"the account could not be updated":["no se ha podido actualizar la cuenta"]}
|
package/dist/wpds/LoginScreen.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { useMutation } from '@tanstack/react-query';
|
|
4
4
|
import { __, _x } from '@wordpress/i18n';
|
|
5
|
-
import { Button, Card, InputControl, Stack, Text } from '@wordpress/ui';
|
|
5
|
+
import { Button, Card, InputControl, Link, Stack, Text } from '@wordpress/ui';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { InvalidCredentialsError, RateLimitedError, login } from '../api.js';
|
|
8
8
|
import { DOMAIN } from '../domain.js';
|
|
@@ -33,8 +33,8 @@ export function LoginScreen({ brand, onLogin, onForgotPassword, }) {
|
|
|
33
33
|
mutationFn: () => login(email.trim(), password),
|
|
34
34
|
onSuccess: (user) => onLogin(user),
|
|
35
35
|
});
|
|
36
|
-
return (_jsx("div", { className: "gopherium-login", children: _jsx(Card.Root, { className: "gopherium-login__card", children: _jsx(Card.Content, { children: _jsx("form", { onSubmit: (event) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
return (_jsx("div", { className: "gopherium-login", children: _jsxs("div", { className: "gopherium-login__column", children: [_jsx(Card.Root, { className: "gopherium-login__card", children: _jsx(Card.Content, { children: _jsx("form", { onSubmit: (event) => {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
attempt.mutate();
|
|
39
|
+
}, children: _jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(Text, { variant: "heading-lg", render: _jsx("h1", {}), children: brand }), _jsx(InputControl, { label: _x('Email', 'field label', DOMAIN), type: "email", autoComplete: "username", value: email, onChange: (event) => setEmail(event.target.value) }), _jsx(InputControl, { label: __('Password', DOMAIN), type: "password", autoComplete: "current-password", value: password, onChange: (event) => setPassword(event.target.value) }), _jsx(Button, { type: "submit", disabled: email.trim() === '' || password === '' || attempt.isPending, loading: attempt.isPending, children: __('Log in', DOMAIN) }), attempt.isError ? (_jsx(Text, { role: "alert", children: loginErrorMessage(attempt.error) })) : null] }) }) }) }), onForgotPassword ? (_jsx("p", { className: "gopherium-login__nav", children: _jsx(Link, { tone: "neutral", render: _jsx("button", { type: "button" }), onClick: onForgotPassword, children: __('Lost your password?', DOMAIN) }) })) : null] }) }));
|
|
40
40
|
}
|
package/dist/wpds/style.css
CHANGED
|
@@ -9,11 +9,42 @@
|
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.gopherium-login__column {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
width: 100%;
|
|
16
|
+
max-width: 360px;
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
.gopherium-login__card {
|
|
13
20
|
width: 100%;
|
|
14
21
|
max-width: 360px;
|
|
15
22
|
}
|
|
16
23
|
|
|
24
|
+
.gopherium-login__nav {
|
|
25
|
+
margin: 24px 0 0;
|
|
26
|
+
padding: 0 24px;
|
|
27
|
+
font-size: var(--wpds-typography-font-size-md);
|
|
28
|
+
line-height: var(--wpds-typography-line-height-sm);
|
|
29
|
+
text-align: start;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.gopherium-login__nav button {
|
|
33
|
+
padding: 0;
|
|
34
|
+
border: 0;
|
|
35
|
+
background: none;
|
|
36
|
+
font: inherit;
|
|
37
|
+
line-height: normal;
|
|
38
|
+
text-align: inherit;
|
|
39
|
+
text-decoration-line: underline;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.gopherium-login__nav button:hover,
|
|
44
|
+
.gopherium-login__nav button:focus-visible {
|
|
45
|
+
text-decoration-color: currentColor;
|
|
46
|
+
}
|
|
47
|
+
|
|
17
48
|
.gopherium-users {
|
|
18
49
|
width: 100%;
|
|
19
50
|
border-collapse: collapse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gopherium/react-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Session authentication for React apps backed by gouncer's authkit.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@tanstack/react-query": "^5.101.2",
|
|
51
51
|
"@testing-library/jest-dom": "^6.9.1 || ^7.0.0",
|
|
52
52
|
"@testing-library/react": "^16.3.2",
|
|
53
|
-
"@wordpress/i18n": ">=6.
|
|
54
|
-
"@wordpress/theme": ">=2.
|
|
55
|
-
"@wordpress/ui": ">=0.
|
|
53
|
+
"@wordpress/i18n": ">=6.30.0 <7.0.0",
|
|
54
|
+
"@wordpress/theme": ">=2.3.0 <3.0.0",
|
|
55
|
+
"@wordpress/ui": ">=0.24.0 <0.25.0",
|
|
56
56
|
"msw": "^2.15.0",
|
|
57
57
|
"react": "^19.2.7",
|
|
58
58
|
"vitest": "^4.1.10 || ^5.0.0"
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"@types/react": "^19.2.17",
|
|
87
87
|
"@vitejs/plugin-react": "^6.0.3",
|
|
88
88
|
"@vitest/coverage-v8": "^5.0.3",
|
|
89
|
-
"@wordpress/i18n": "6.
|
|
90
|
-
"@wordpress/theme": "2.
|
|
91
|
-
"@wordpress/ui": "0.
|
|
89
|
+
"@wordpress/i18n": "6.30.0",
|
|
90
|
+
"@wordpress/theme": "2.3.0",
|
|
91
|
+
"@wordpress/ui": "0.24.0",
|
|
92
92
|
"eslint": "^9.39.1",
|
|
93
93
|
"eslint-plugin-jsdoc": "^63.0.13",
|
|
94
94
|
"eslint-plugin-sonarjs": "^4.2.0",
|