@nocios/crudify-ui 1.0.74 → 1.0.75

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
@@ -256,6 +256,11 @@ function loginStateReducer(state, action) {
256
256
  oldScreen: state.currentScreen,
257
257
  newScreen: newState.currentScreen,
258
258
  oldParams: state.searchParams,
259
+ newParams: newState.searchParams,
260
+ urlBefore: window.location.search
261
+ });
262
+ console.log("\u{1F310} LoginStateReducer - Browser URL management needed?", {
263
+ newScreen: newState.currentScreen,
259
264
  newParams: newState.searchParams
260
265
  });
261
266
  return newState;
@@ -1115,6 +1120,8 @@ var ForgotPasswordForm = ({ onScreenChange, onError }) => {
1115
1120
  }
1116
1121
  };
1117
1122
  const handleBack = () => {
1123
+ console.log("\u{1F4E7} ForgotPasswordForm - handleBack called");
1124
+ console.log("\u{1F4E7} ForgotPasswordForm - Navigating back to login");
1118
1125
  onScreenChange?.("login");
1119
1126
  };
1120
1127
  const handleGoToCheckCode = () => {
@@ -1563,7 +1570,8 @@ var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1563
1570
  }
1564
1571
  };
1565
1572
  const handleBack = () => {
1566
- console.log("\u{1F522} CheckCodeForm - handleBack called");
1573
+ console.log("\u{1F522} CheckCodeForm - handleBack called, current searchParams:", searchParams);
1574
+ console.log("\u{1F522} CheckCodeForm - Navigating back to forgotPassword");
1567
1575
  onScreenChange?.("forgotPassword");
1568
1576
  };
1569
1577
  const handleCodeChange = (event) => {
@@ -1709,11 +1717,18 @@ var CrudifyLoginInternal = ({
1709
1717
  currentScreen: state.currentScreen,
1710
1718
  newScreen: screen2,
1711
1719
  params,
1712
- stateSearchParams: state.searchParams
1720
+ stateSearchParams: state.searchParams,
1721
+ urlBeforeChange: window.location.search
1713
1722
  });
1714
- setScreen(screen2, params);
1715
- onScreenChange?.(screen2, params);
1716
- console.log("\u2705 CrudifyLoginInternal - screen change completed");
1723
+ let finalParams = params;
1724
+ if (screen2 === "login") {
1725
+ console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to login, should clear email param from URL");
1726
+ } else if (screen2 === "forgotPassword") {
1727
+ console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to forgotPassword, checking if email should be preserved");
1728
+ }
1729
+ setScreen(screen2, finalParams);
1730
+ onScreenChange?.(screen2, finalParams);
1731
+ console.log("\u2705 CrudifyLoginInternal - screen change completed, URL after:", window.location.search);
1717
1732
  };
1718
1733
  const renderCurrentForm = () => {
1719
1734
  console.log("\u{1F3A8} CrudifyLoginInternal - renderCurrentForm called:", {
package/dist/index.mjs CHANGED
@@ -205,6 +205,11 @@ function loginStateReducer(state, action) {
205
205
  oldScreen: state.currentScreen,
206
206
  newScreen: newState.currentScreen,
207
207
  oldParams: state.searchParams,
208
+ newParams: newState.searchParams,
209
+ urlBefore: window.location.search
210
+ });
211
+ console.log("\u{1F310} LoginStateReducer - Browser URL management needed?", {
212
+ newScreen: newState.currentScreen,
208
213
  newParams: newState.searchParams
209
214
  });
210
215
  return newState;
@@ -1064,6 +1069,8 @@ var ForgotPasswordForm = ({ onScreenChange, onError }) => {
1064
1069
  }
1065
1070
  };
1066
1071
  const handleBack = () => {
1072
+ console.log("\u{1F4E7} ForgotPasswordForm - handleBack called");
1073
+ console.log("\u{1F4E7} ForgotPasswordForm - Navigating back to login");
1067
1074
  onScreenChange?.("login");
1068
1075
  };
1069
1076
  const handleGoToCheckCode = () => {
@@ -1512,7 +1519,8 @@ var CheckCodeForm = ({ onScreenChange, onError, searchParams }) => {
1512
1519
  }
1513
1520
  };
1514
1521
  const handleBack = () => {
1515
- console.log("\u{1F522} CheckCodeForm - handleBack called");
1522
+ console.log("\u{1F522} CheckCodeForm - handleBack called, current searchParams:", searchParams);
1523
+ console.log("\u{1F522} CheckCodeForm - Navigating back to forgotPassword");
1516
1524
  onScreenChange?.("forgotPassword");
1517
1525
  };
1518
1526
  const handleCodeChange = (event) => {
@@ -1658,11 +1666,18 @@ var CrudifyLoginInternal = ({
1658
1666
  currentScreen: state.currentScreen,
1659
1667
  newScreen: screen2,
1660
1668
  params,
1661
- stateSearchParams: state.searchParams
1669
+ stateSearchParams: state.searchParams,
1670
+ urlBeforeChange: window.location.search
1662
1671
  });
1663
- setScreen(screen2, params);
1664
- onScreenChange?.(screen2, params);
1665
- console.log("\u2705 CrudifyLoginInternal - screen change completed");
1672
+ let finalParams = params;
1673
+ if (screen2 === "login") {
1674
+ console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to login, should clear email param from URL");
1675
+ } else if (screen2 === "forgotPassword") {
1676
+ console.log("\u{1F9F9} CrudifyLoginInternal - Navigating to forgotPassword, checking if email should be preserved");
1677
+ }
1678
+ setScreen(screen2, finalParams);
1679
+ onScreenChange?.(screen2, finalParams);
1680
+ console.log("\u2705 CrudifyLoginInternal - screen change completed, URL after:", window.location.search);
1666
1681
  };
1667
1682
  const renderCurrentForm = () => {
1668
1683
  console.log("\u{1F3A8} CrudifyLoginInternal - renderCurrentForm called:", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-ui",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "Biblioteca de componentes UI para Crudify",
5
5
  "author": "Nocios",
6
6
  "license": "MIT",