@nocios/crudify-ui 1.0.78 → 1.0.80

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
@@ -238,11 +238,6 @@ var initialState = {
238
238
  config: {}
239
239
  };
240
240
  function loginStateReducer(state, action) {
241
- console.log("\u{1F504} LoginStateReducer - Action dispatched:", {
242
- type: action.type,
243
- currentScreen: state.currentScreen,
244
- payload: action.payload
245
- });
246
241
  switch (action.type) {
247
242
  case "SET_SCREEN":
248
243
  const newState = {
@@ -252,25 +247,11 @@ function loginStateReducer(state, action) {
252
247
  // Clear form errors when changing screens
253
248
  errors: { global: [] }
254
249
  };
255
- console.log("\u{1F504} LoginStateReducer - SET_SCREEN result:", {
256
- oldScreen: state.currentScreen,
257
- newScreen: newState.currentScreen,
258
- oldParams: state.searchParams,
259
- newParams: newState.searchParams,
260
- urlBefore: window.location.search
261
- });
262
- console.log("\u{1F310} LoginStateReducer - Updating browser URL:", {
263
- newScreen: newState.currentScreen,
264
- newParams: newState.searchParams,
265
- shouldClearUrl: Object.keys(newState.searchParams).length === 0
266
- });
267
250
  const newUrl = new URLSearchParams(newState.searchParams);
268
251
  const newPath = newUrl.toString() ? `?${newUrl.toString()}` : window.location.pathname;
269
252
  try {
270
253
  window.history.replaceState({}, "", newPath);
271
- console.log("\u{1F310} LoginStateReducer - Browser URL updated to:", window.location.search);
272
254
  } catch (error) {
273
- console.warn("\u{1F310} LoginStateReducer - Failed to update browser URL:", error);
274
255
  }
275
256
  return newState;
276
257
  case "SET_SEARCH_PARAMS":
@@ -362,11 +343,6 @@ var LoginStateProvider = ({
362
343
  config: providedConfig,
363
344
  autoReadFromCookies = true
364
345
  }) => {
365
- console.log("\u{1F3D7}\uFE0F LoginStateProvider - Component initialized with:", {
366
- initialScreen,
367
- providedConfig,
368
- autoReadFromCookies
369
- });
370
346
  const [state, dispatch] = (0, import_react4.useReducer)(loginStateReducer, {
371
347
  ...initialState,
372
348
  currentScreen: initialScreen
@@ -427,11 +403,6 @@ var LoginStateProvider = ({
427
403
  }
428
404
  }, [initialScreen]);
429
405
  const setScreen = (screen2, params) => {
430
- console.log("\u{1F504} LoginStateProvider - setScreen called:", {
431
- currentScreen: state.currentScreen,
432
- targetScreen: screen2,
433
- params
434
- });
435
406
  dispatch({ type: "SET_SCREEN", payload: { screen: screen2, params } });
436
407
  };
437
408
  const updateFormData = (data) => {
@@ -1129,19 +1100,10 @@ var ForgotPasswordForm = ({ onScreenChange, onError }) => {
1129
1100
  }
1130
1101
  };
1131
1102
  const handleBack = () => {
1132
- console.log("\u{1F4E7} ForgotPasswordForm - handleBack called");
1133
- console.log("\u{1F4E7} ForgotPasswordForm - Navigating back to login");
1134
1103
  onScreenChange?.("login");
1135
1104
  };
1136
1105
  const handleGoToCheckCode = () => {
1137
- console.log("\u{1F4E7} ForgotPasswordForm - handleGoToCheckCode called:", {
1138
- emailSent,
1139
- codeAlreadyExists,
1140
- email,
1141
- onScreenChange: !!onScreenChange
1142
- });
1143
1106
  if (emailSent || codeAlreadyExists) {
1144
- console.log("\u{1F4E7} ForgotPasswordForm - Navigating to checkCode with email:", email);
1145
1107
  onScreenChange?.("checkCode", { email });
1146
1108
  return;
1147
1109
  }
@@ -1153,7 +1115,6 @@ var ForgotPasswordForm = ({ onScreenChange, onError }) => {
1153
1115
  setHelperTextEmail(t("forgotPassword.invalidEmail"));
1154
1116
  return;
1155
1117
  }
1156
- console.log("\u{1F4E7} ForgotPasswordForm - Navigating to checkCode with validated email:", email);
1157
1118
  onScreenChange?.("checkCode", { email });
1158
1119
  };
1159
1120
  if (emailSent || codeAlreadyExists) {
@@ -1489,11 +1450,6 @@ var import_react8 = require("react");
1489
1450
  var import_material4 = require("@mui/material");
1490
1451
  var import_jsx_runtime7 = require("react/jsx-runtime");
1491
1452
  var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1492
- console.log("\u{1F522} CheckCodeForm - Component initialized with props:", {
1493
- onScreenChange: !!onScreenChange,
1494
- onError: !!onError,
1495
- searchParams
1496
- });
1497
1453
  const { crudify: crudify3 } = useCrudify();
1498
1454
  const [code, setCode] = (0, import_react8.useState)("");
1499
1455
  const [loading, setLoading] = (0, import_react8.useState)(false);
@@ -1525,17 +1481,10 @@ var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1525
1481
  return parsedError.message || t("error.unknown");
1526
1482
  };
1527
1483
  (0, import_react8.useEffect)(() => {
1528
- console.log("\u{1F522} CheckCodeForm - useEffect triggered:", {
1529
- searchParams,
1530
- onScreenChange: !!onScreenChange
1531
- });
1532
1484
  const emailParam = getParam("email");
1533
- console.log("\u{1F522} CheckCodeForm - emailParam extracted:", emailParam);
1534
1485
  if (emailParam) {
1535
- console.log("\u{1F522} CheckCodeForm - Setting email:", emailParam);
1536
1486
  setEmail(emailParam);
1537
1487
  } else {
1538
- console.log("\u{1F522} CheckCodeForm - No email found, redirecting to forgotPassword");
1539
1488
  onScreenChange?.("forgotPassword");
1540
1489
  }
1541
1490
  }, [searchParams, onScreenChange]);
@@ -1579,8 +1528,6 @@ var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1579
1528
  }
1580
1529
  };
1581
1530
  const handleBack = () => {
1582
- console.log("\u{1F522} CheckCodeForm - handleBack called, current searchParams:", searchParams);
1583
- console.log("\u{1F522} CheckCodeForm - Navigating back to forgotPassword");
1584
1531
  onScreenChange?.("forgotPassword");
1585
1532
  };
1586
1533
  const handleCodeChange = (event) => {
@@ -1722,35 +1669,16 @@ var CrudifyLoginInternal = ({
1722
1669
  const { t } = useTranslation();
1723
1670
  const { state, setScreen } = useLoginState();
1724
1671
  const handleScreenChange = (screen2, params) => {
1725
- console.log("\u{1F504} CrudifyLoginInternal - handleScreenChange called:", {
1726
- currentScreen: state.currentScreen,
1727
- newScreen: screen2,
1728
- params,
1729
- stateSearchParams: state.searchParams,
1730
- urlBeforeChange: window.location.search
1731
- });
1732
1672
  let finalParams = params;
1733
1673
  if (screen2 === "login") {
1734
- console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to login, clearing all URL params");
1735
1674
  finalParams = {};
1736
- } else if (screen2 === "forgotPassword") {
1737
- if (!params) {
1738
- console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to forgotPassword without params, clearing URL");
1739
- finalParams = {};
1740
- } else {
1741
- console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to forgotPassword with specific params");
1742
- }
1675
+ } else if (screen2 === "forgotPassword" && !params) {
1676
+ finalParams = {};
1743
1677
  }
1744
1678
  setScreen(screen2, finalParams);
1745
1679
  onScreenChange?.(screen2, finalParams);
1746
- console.log("\u2705 CrudifyLoginInternal - screen change completed, URL after:", window.location.search);
1747
1680
  };
1748
1681
  const renderCurrentForm = () => {
1749
- console.log("\u{1F3A8} CrudifyLoginInternal - renderCurrentForm called:", {
1750
- currentScreen: state.currentScreen,
1751
- searchParams: state.searchParams,
1752
- config: state.config
1753
- });
1754
1682
  const commonProps = {
1755
1683
  onScreenChange: handleScreenChange,
1756
1684
  onExternalNavigate,
@@ -1759,26 +1687,21 @@ var CrudifyLoginInternal = ({
1759
1687
  };
1760
1688
  switch (state.currentScreen) {
1761
1689
  case "forgotPassword":
1762
- console.log("\u{1F4E7} Rendering ForgotPasswordForm");
1763
1690
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ForgotPasswordForm_default, { ...commonProps });
1764
1691
  case "checkCode":
1765
- console.log("\u{1F522} Rendering CheckCodeForm with params:", state.searchParams);
1766
1692
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckCodeForm_default, { ...commonProps, searchParams: state.searchParams });
1767
1693
  case "resetPassword":
1768
- console.log("\u{1F510} Rendering ResetPasswordForm with params:", state.searchParams);
1769
1694
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1770
1695
  ResetPasswordForm_default,
1771
1696
  {
1772
1697
  ...commonProps,
1773
1698
  searchParams: state.searchParams,
1774
1699
  onResetSuccess: () => {
1775
- console.log("\u2705 ResetPasswordForm - onResetSuccess called");
1776
1700
  handleScreenChange("login");
1777
1701
  }
1778
1702
  }
1779
1703
  );
1780
1704
  default:
1781
- console.log("\u{1F3E0} Rendering LoginForm (default)");
1782
1705
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoginForm_default, { ...commonProps, onLoginSuccess });
1783
1706
  }
1784
1707
  };
package/dist/index.mjs CHANGED
@@ -187,11 +187,6 @@ var initialState = {
187
187
  config: {}
188
188
  };
189
189
  function loginStateReducer(state, action) {
190
- console.log("\u{1F504} LoginStateReducer - Action dispatched:", {
191
- type: action.type,
192
- currentScreen: state.currentScreen,
193
- payload: action.payload
194
- });
195
190
  switch (action.type) {
196
191
  case "SET_SCREEN":
197
192
  const newState = {
@@ -201,25 +196,11 @@ function loginStateReducer(state, action) {
201
196
  // Clear form errors when changing screens
202
197
  errors: { global: [] }
203
198
  };
204
- console.log("\u{1F504} LoginStateReducer - SET_SCREEN result:", {
205
- oldScreen: state.currentScreen,
206
- newScreen: newState.currentScreen,
207
- oldParams: state.searchParams,
208
- newParams: newState.searchParams,
209
- urlBefore: window.location.search
210
- });
211
- console.log("\u{1F310} LoginStateReducer - Updating browser URL:", {
212
- newScreen: newState.currentScreen,
213
- newParams: newState.searchParams,
214
- shouldClearUrl: Object.keys(newState.searchParams).length === 0
215
- });
216
199
  const newUrl = new URLSearchParams(newState.searchParams);
217
200
  const newPath = newUrl.toString() ? `?${newUrl.toString()}` : window.location.pathname;
218
201
  try {
219
202
  window.history.replaceState({}, "", newPath);
220
- console.log("\u{1F310} LoginStateReducer - Browser URL updated to:", window.location.search);
221
203
  } catch (error) {
222
- console.warn("\u{1F310} LoginStateReducer - Failed to update browser URL:", error);
223
204
  }
224
205
  return newState;
225
206
  case "SET_SEARCH_PARAMS":
@@ -311,11 +292,6 @@ var LoginStateProvider = ({
311
292
  config: providedConfig,
312
293
  autoReadFromCookies = true
313
294
  }) => {
314
- console.log("\u{1F3D7}\uFE0F LoginStateProvider - Component initialized with:", {
315
- initialScreen,
316
- providedConfig,
317
- autoReadFromCookies
318
- });
319
295
  const [state, dispatch] = useReducer(loginStateReducer, {
320
296
  ...initialState,
321
297
  currentScreen: initialScreen
@@ -376,11 +352,6 @@ var LoginStateProvider = ({
376
352
  }
377
353
  }, [initialScreen]);
378
354
  const setScreen = (screen2, params) => {
379
- console.log("\u{1F504} LoginStateProvider - setScreen called:", {
380
- currentScreen: state.currentScreen,
381
- targetScreen: screen2,
382
- params
383
- });
384
355
  dispatch({ type: "SET_SCREEN", payload: { screen: screen2, params } });
385
356
  };
386
357
  const updateFormData = (data) => {
@@ -1078,19 +1049,10 @@ var ForgotPasswordForm = ({ onScreenChange, onError }) => {
1078
1049
  }
1079
1050
  };
1080
1051
  const handleBack = () => {
1081
- console.log("\u{1F4E7} ForgotPasswordForm - handleBack called");
1082
- console.log("\u{1F4E7} ForgotPasswordForm - Navigating back to login");
1083
1052
  onScreenChange?.("login");
1084
1053
  };
1085
1054
  const handleGoToCheckCode = () => {
1086
- console.log("\u{1F4E7} ForgotPasswordForm - handleGoToCheckCode called:", {
1087
- emailSent,
1088
- codeAlreadyExists,
1089
- email,
1090
- onScreenChange: !!onScreenChange
1091
- });
1092
1055
  if (emailSent || codeAlreadyExists) {
1093
- console.log("\u{1F4E7} ForgotPasswordForm - Navigating to checkCode with email:", email);
1094
1056
  onScreenChange?.("checkCode", { email });
1095
1057
  return;
1096
1058
  }
@@ -1102,7 +1064,6 @@ var ForgotPasswordForm = ({ onScreenChange, onError }) => {
1102
1064
  setHelperTextEmail(t("forgotPassword.invalidEmail"));
1103
1065
  return;
1104
1066
  }
1105
- console.log("\u{1F4E7} ForgotPasswordForm - Navigating to checkCode with validated email:", email);
1106
1067
  onScreenChange?.("checkCode", { email });
1107
1068
  };
1108
1069
  if (emailSent || codeAlreadyExists) {
@@ -1438,11 +1399,6 @@ import { useState as useState5, useEffect as useEffect6 } from "react";
1438
1399
  import { Typography as Typography4, TextField as TextField4, Button as Button4, Box as Box4, CircularProgress as CircularProgress4, Alert as Alert4, Link as Link4 } from "@mui/material";
1439
1400
  import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
1440
1401
  var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1441
- console.log("\u{1F522} CheckCodeForm - Component initialized with props:", {
1442
- onScreenChange: !!onScreenChange,
1443
- onError: !!onError,
1444
- searchParams
1445
- });
1446
1402
  const { crudify: crudify3 } = useCrudify();
1447
1403
  const [code, setCode] = useState5("");
1448
1404
  const [loading, setLoading] = useState5(false);
@@ -1474,17 +1430,10 @@ var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1474
1430
  return parsedError.message || t("error.unknown");
1475
1431
  };
1476
1432
  useEffect6(() => {
1477
- console.log("\u{1F522} CheckCodeForm - useEffect triggered:", {
1478
- searchParams,
1479
- onScreenChange: !!onScreenChange
1480
- });
1481
1433
  const emailParam = getParam("email");
1482
- console.log("\u{1F522} CheckCodeForm - emailParam extracted:", emailParam);
1483
1434
  if (emailParam) {
1484
- console.log("\u{1F522} CheckCodeForm - Setting email:", emailParam);
1485
1435
  setEmail(emailParam);
1486
1436
  } else {
1487
- console.log("\u{1F522} CheckCodeForm - No email found, redirecting to forgotPassword");
1488
1437
  onScreenChange?.("forgotPassword");
1489
1438
  }
1490
1439
  }, [searchParams, onScreenChange]);
@@ -1528,8 +1477,6 @@ var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1528
1477
  }
1529
1478
  };
1530
1479
  const handleBack = () => {
1531
- console.log("\u{1F522} CheckCodeForm - handleBack called, current searchParams:", searchParams);
1532
- console.log("\u{1F522} CheckCodeForm - Navigating back to forgotPassword");
1533
1480
  onScreenChange?.("forgotPassword");
1534
1481
  };
1535
1482
  const handleCodeChange = (event) => {
@@ -1671,35 +1618,16 @@ var CrudifyLoginInternal = ({
1671
1618
  const { t } = useTranslation();
1672
1619
  const { state, setScreen } = useLoginState();
1673
1620
  const handleScreenChange = (screen2, params) => {
1674
- console.log("\u{1F504} CrudifyLoginInternal - handleScreenChange called:", {
1675
- currentScreen: state.currentScreen,
1676
- newScreen: screen2,
1677
- params,
1678
- stateSearchParams: state.searchParams,
1679
- urlBeforeChange: window.location.search
1680
- });
1681
1621
  let finalParams = params;
1682
1622
  if (screen2 === "login") {
1683
- console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to login, clearing all URL params");
1684
1623
  finalParams = {};
1685
- } else if (screen2 === "forgotPassword") {
1686
- if (!params) {
1687
- console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to forgotPassword without params, clearing URL");
1688
- finalParams = {};
1689
- } else {
1690
- console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to forgotPassword with specific params");
1691
- }
1624
+ } else if (screen2 === "forgotPassword" && !params) {
1625
+ finalParams = {};
1692
1626
  }
1693
1627
  setScreen(screen2, finalParams);
1694
1628
  onScreenChange?.(screen2, finalParams);
1695
- console.log("\u2705 CrudifyLoginInternal - screen change completed, URL after:", window.location.search);
1696
1629
  };
1697
1630
  const renderCurrentForm = () => {
1698
- console.log("\u{1F3A8} CrudifyLoginInternal - renderCurrentForm called:", {
1699
- currentScreen: state.currentScreen,
1700
- searchParams: state.searchParams,
1701
- config: state.config
1702
- });
1703
1631
  const commonProps = {
1704
1632
  onScreenChange: handleScreenChange,
1705
1633
  onExternalNavigate,
@@ -1708,26 +1636,21 @@ var CrudifyLoginInternal = ({
1708
1636
  };
1709
1637
  switch (state.currentScreen) {
1710
1638
  case "forgotPassword":
1711
- console.log("\u{1F4E7} Rendering ForgotPasswordForm");
1712
1639
  return /* @__PURE__ */ jsx9(ForgotPasswordForm_default, { ...commonProps });
1713
1640
  case "checkCode":
1714
- console.log("\u{1F522} Rendering CheckCodeForm with params:", state.searchParams);
1715
1641
  return /* @__PURE__ */ jsx9(CheckCodeForm_default, { ...commonProps, searchParams: state.searchParams });
1716
1642
  case "resetPassword":
1717
- console.log("\u{1F510} Rendering ResetPasswordForm with params:", state.searchParams);
1718
1643
  return /* @__PURE__ */ jsx9(
1719
1644
  ResetPasswordForm_default,
1720
1645
  {
1721
1646
  ...commonProps,
1722
1647
  searchParams: state.searchParams,
1723
1648
  onResetSuccess: () => {
1724
- console.log("\u2705 ResetPasswordForm - onResetSuccess called");
1725
1649
  handleScreenChange("login");
1726
1650
  }
1727
1651
  }
1728
1652
  );
1729
1653
  default:
1730
- console.log("\u{1F3E0} Rendering LoginForm (default)");
1731
1654
  return /* @__PURE__ */ jsx9(LoginForm_default, { ...commonProps, onLoginSuccess });
1732
1655
  }
1733
1656
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-ui",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "description": "Biblioteca de componentes UI para Crudify",
5
5
  "author": "Nocios",
6
6
  "license": "MIT",