@nocios/crudify-ui 1.0.51 → 1.0.52

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.
package/dist/index.js CHANGED
@@ -101,44 +101,6 @@ var useTranslationsFromUrl = (url, providedTranslations) => {
101
101
  // src/components/CrudifyLogin/context/I18nProvider.tsx
102
102
  var import_jsx_runtime = require("react/jsx-runtime");
103
103
  var I18nContext = (0, import_react2.createContext)(null);
104
- var defaultTranslations = {
105
- "login.logoAlt": "Logo",
106
- "login.usernameOrEmailLabel": "Username or Email",
107
- "login.usernameOrEmailPlaceholder": "Enter your username or email",
108
- "login.passwordLabel": "Password",
109
- "login.passwordPlaceholder": "Enter your password",
110
- "login.forgotPasswordLink": "Forgot your password?",
111
- "login.loginButton": "Login",
112
- "login.noAccountPrompt": "Don't have an account?",
113
- "login.signUpLink": "Sign up",
114
- "login.usernameRequired": "Username or email is required",
115
- "login.passwordRequired": "Password is required",
116
- "forgotPassword.title": "Reset Password",
117
- "forgotPassword.description": "Enter your email and we'll send you a code to reset your password.",
118
- "forgotPassword.emailLabel": "Email",
119
- "forgotPassword.emailPlaceholder": "Enter your email",
120
- "forgotPassword.emailRequired": "Email is required",
121
- "forgotPassword.invalidEmail": "Enter a valid email",
122
- "forgotPassword.sendButton": "Send Code",
123
- "resetPassword.title": "New Password",
124
- "resetPassword.description": "Enter your new password.",
125
- "resetPassword.newPasswordLabel": "New Password",
126
- "resetPassword.newPasswordPlaceholder": "Enter your new password",
127
- "resetPassword.confirmPasswordLabel": "Confirm Password",
128
- "resetPassword.confirmPasswordPlaceholder": "Confirm your new password",
129
- "resetPassword.passwordRequired": "Password is required",
130
- "resetPassword.confirmPasswordRequired": "Confirm your password",
131
- "resetPassword.passwordsNotMatch": "Passwords don't match",
132
- "resetPassword.resetButton": "Reset Password",
133
- "checkCode.title": "Verify Code",
134
- "checkCode.description": "Enter the 6-digit code we sent to your email.",
135
- "checkCode.codeLabel": "Verification Code",
136
- "checkCode.codePlaceholder": "Enter the 6-digit code",
137
- "checkCode.codeRequired": "Code is required",
138
- "checkCode.invalidCode": "Code must be 6 digits",
139
- "checkCode.verifyButton": "Verify Code",
140
- "error.unknown": "An unknown error occurred"
141
- };
142
104
  var getNestedValue = (obj, path) => {
143
105
  if (obj && obj[path]) {
144
106
  return obj[path];
@@ -156,8 +118,7 @@ var I18nProvider = ({
156
118
  const { translations: loadedTranslations, loading } = useTranslationsFromUrl(translationsUrl, translations);
157
119
  const t = (0, import_react2.useMemo)(() => {
158
120
  return (key, variables) => {
159
- const mergedTranslations = { ...defaultTranslations, ...loadedTranslations };
160
- let value = getNestedValue(mergedTranslations, key) || key;
121
+ let value = getNestedValue(loadedTranslations, key) || key;
161
122
  if (variables && typeof value === "string") {
162
123
  Object.entries(variables).forEach(([varKey, varValue]) => {
163
124
  value = value.replace(new RegExp(`{{${varKey}}}`, "g"), varValue);
package/dist/index.mjs CHANGED
@@ -57,44 +57,6 @@ var useTranslationsFromUrl = (url, providedTranslations) => {
57
57
  // src/components/CrudifyLogin/context/I18nProvider.tsx
58
58
  import { jsx } from "react/jsx-runtime";
59
59
  var I18nContext = createContext(null);
60
- var defaultTranslations = {
61
- "login.logoAlt": "Logo",
62
- "login.usernameOrEmailLabel": "Username or Email",
63
- "login.usernameOrEmailPlaceholder": "Enter your username or email",
64
- "login.passwordLabel": "Password",
65
- "login.passwordPlaceholder": "Enter your password",
66
- "login.forgotPasswordLink": "Forgot your password?",
67
- "login.loginButton": "Login",
68
- "login.noAccountPrompt": "Don't have an account?",
69
- "login.signUpLink": "Sign up",
70
- "login.usernameRequired": "Username or email is required",
71
- "login.passwordRequired": "Password is required",
72
- "forgotPassword.title": "Reset Password",
73
- "forgotPassword.description": "Enter your email and we'll send you a code to reset your password.",
74
- "forgotPassword.emailLabel": "Email",
75
- "forgotPassword.emailPlaceholder": "Enter your email",
76
- "forgotPassword.emailRequired": "Email is required",
77
- "forgotPassword.invalidEmail": "Enter a valid email",
78
- "forgotPassword.sendButton": "Send Code",
79
- "resetPassword.title": "New Password",
80
- "resetPassword.description": "Enter your new password.",
81
- "resetPassword.newPasswordLabel": "New Password",
82
- "resetPassword.newPasswordPlaceholder": "Enter your new password",
83
- "resetPassword.confirmPasswordLabel": "Confirm Password",
84
- "resetPassword.confirmPasswordPlaceholder": "Confirm your new password",
85
- "resetPassword.passwordRequired": "Password is required",
86
- "resetPassword.confirmPasswordRequired": "Confirm your password",
87
- "resetPassword.passwordsNotMatch": "Passwords don't match",
88
- "resetPassword.resetButton": "Reset Password",
89
- "checkCode.title": "Verify Code",
90
- "checkCode.description": "Enter the 6-digit code we sent to your email.",
91
- "checkCode.codeLabel": "Verification Code",
92
- "checkCode.codePlaceholder": "Enter the 6-digit code",
93
- "checkCode.codeRequired": "Code is required",
94
- "checkCode.invalidCode": "Code must be 6 digits",
95
- "checkCode.verifyButton": "Verify Code",
96
- "error.unknown": "An unknown error occurred"
97
- };
98
60
  var getNestedValue = (obj, path) => {
99
61
  if (obj && obj[path]) {
100
62
  return obj[path];
@@ -112,8 +74,7 @@ var I18nProvider = ({
112
74
  const { translations: loadedTranslations, loading } = useTranslationsFromUrl(translationsUrl, translations);
113
75
  const t = useMemo(() => {
114
76
  return (key, variables) => {
115
- const mergedTranslations = { ...defaultTranslations, ...loadedTranslations };
116
- let value = getNestedValue(mergedTranslations, key) || key;
77
+ let value = getNestedValue(loadedTranslations, key) || key;
117
78
  if (variables && typeof value === "string") {
118
79
  Object.entries(variables).forEach(([varKey, varValue]) => {
119
80
  value = value.replace(new RegExp(`{{${varKey}}}`, "g"), varValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-ui",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "Biblioteca de componentes UI para Crudify",
5
5
  "author": "Nocios",
6
6
  "license": "MIT",