@nocios/crudify-ui 1.0.71 → 1.0.72

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.d.mts CHANGED
@@ -187,8 +187,8 @@ declare const ERROR_CODES: {
187
187
  readonly NETWORK_ERROR: "NETWORK_ERROR";
188
188
  readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
189
189
  };
190
- type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];
191
- type ErrorSeverity = 'info' | 'warning' | 'error' | 'critical';
190
+ type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
191
+ type ErrorSeverity = "info" | "warning" | "error" | "critical";
192
192
  declare const ERROR_SEVERITY_MAP: Record<ErrorCode, ErrorSeverity>;
193
193
  interface ParsedError {
194
194
  code: ErrorCode;
package/dist/index.d.ts CHANGED
@@ -187,8 +187,8 @@ declare const ERROR_CODES: {
187
187
  readonly NETWORK_ERROR: "NETWORK_ERROR";
188
188
  readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
189
189
  };
190
- type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];
191
- type ErrorSeverity = 'info' | 'warning' | 'error' | 'critical';
190
+ type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
191
+ type ErrorSeverity = "info" | "warning" | "error" | "critical";
192
192
  declare const ERROR_SEVERITY_MAP: Record<ErrorCode, ErrorSeverity>;
193
193
  interface ParsedError {
194
194
  code: ErrorCode;
package/dist/index.js CHANGED
@@ -686,11 +686,13 @@ function parseApiError(response) {
686
686
  details: { originalError: error }
687
687
  });
688
688
  }
689
- return errors.length > 0 ? errors : [{
690
- code: ERROR_CODES.INTERNAL_SERVER_ERROR,
691
- message: "Unknown error occurred",
692
- severity: "error"
693
- }];
689
+ return errors.length > 0 ? errors : [
690
+ {
691
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
692
+ message: "Unknown error occurred",
693
+ severity: "error"
694
+ }
695
+ ];
694
696
  }
695
697
  function parseTransactionError(response) {
696
698
  try {
@@ -718,12 +720,14 @@ function parseTransactionError(response) {
718
720
  }
719
721
  return parseApiError(response);
720
722
  } catch (error) {
721
- return [{
722
- code: ERROR_CODES.INTERNAL_SERVER_ERROR,
723
- message: "Failed to parse transaction error",
724
- severity: "error",
725
- details: { originalError: error }
726
- }];
723
+ return [
724
+ {
725
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
726
+ message: "Failed to parse transaction error",
727
+ severity: "error",
728
+ details: { originalError: error }
729
+ }
730
+ ];
727
731
  }
728
732
  }
729
733
  function isValidErrorCode(code) {
@@ -795,12 +799,14 @@ function handleCrudifyError(error) {
795
799
  }
796
800
  return parseApiError(error);
797
801
  }
798
- return [{
799
- code: ERROR_CODES.INTERNAL_SERVER_ERROR,
800
- message: "An unknown error occurred",
801
- severity: "error",
802
- details: { originalError: error }
803
- }];
802
+ return [
803
+ {
804
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
805
+ message: "An unknown error occurred",
806
+ severity: "error",
807
+ details: { originalError: error }
808
+ }
809
+ ];
804
810
  }
805
811
 
806
812
  // src/components/CrudifyLogin/Forms/LoginForm.tsx
@@ -1565,10 +1571,7 @@ var CheckCodeForm_default = CheckCodeForm;
1565
1571
  // src/components/CrudifyLogin/components/CrudifyInitializer.tsx
1566
1572
  var import_material5 = require("@mui/material");
1567
1573
  var import_jsx_runtime8 = require("react/jsx-runtime");
1568
- var CrudifyInitializer = ({
1569
- children,
1570
- fallback
1571
- }) => {
1574
+ var CrudifyInitializer = ({ children, fallback }) => {
1572
1575
  const { isLoading, error, isInitialized } = useCrudify();
1573
1576
  const { t } = useTranslation();
1574
1577
  if (isLoading) {
@@ -1593,7 +1596,8 @@ var CrudifyInitializer = ({
1593
1596
  if (error) {
1594
1597
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material5.Alert, { severity: "error", sx: { mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material5.Typography, { variant: "body2", children: [
1595
1598
  t("login.initializationError") !== "login.initializationError" ? t("login.initializationError") : "Initialization error",
1596
- ": ",
1599
+ ":",
1600
+ " ",
1597
1601
  error
1598
1602
  ] }) });
1599
1603
  }
@@ -1667,13 +1671,7 @@ var CrudifyLoginInternal = ({
1667
1671
  }
1668
1672
  );
1669
1673
  default:
1670
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1671
- LoginForm_default,
1672
- {
1673
- ...commonProps,
1674
- onLoginSuccess
1675
- }
1676
- );
1674
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoginForm_default, { ...commonProps, onLoginSuccess });
1677
1675
  }
1678
1676
  };
1679
1677
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CrudifyInitializer, { children: [
@@ -1719,23 +1717,7 @@ var CrudifyLogin = ({
1719
1717
  ...props
1720
1718
  }) => {
1721
1719
  const { config: finalConfig } = useCrudifyLogin(config);
1722
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1723
- I18nProvider,
1724
- {
1725
- translations,
1726
- translationsUrl,
1727
- language,
1728
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CrudifyProvider, { config: finalConfig, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1729
- LoginStateProvider,
1730
- {
1731
- config,
1732
- initialScreen,
1733
- autoReadFromCookies,
1734
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CrudifyLoginInternal, { config, ...props })
1735
- }
1736
- ) })
1737
- }
1738
- );
1720
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(I18nProvider, { translations, translationsUrl, language, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CrudifyProvider, { config: finalConfig, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoginStateProvider, { config, initialScreen, autoReadFromCookies, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CrudifyLoginInternal, { config, ...props }) }) }) });
1739
1721
  };
1740
1722
  var CrudifyLogin_default = CrudifyLogin;
1741
1723
 
package/dist/index.mjs CHANGED
@@ -635,11 +635,13 @@ function parseApiError(response) {
635
635
  details: { originalError: error }
636
636
  });
637
637
  }
638
- return errors.length > 0 ? errors : [{
639
- code: ERROR_CODES.INTERNAL_SERVER_ERROR,
640
- message: "Unknown error occurred",
641
- severity: "error"
642
- }];
638
+ return errors.length > 0 ? errors : [
639
+ {
640
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
641
+ message: "Unknown error occurred",
642
+ severity: "error"
643
+ }
644
+ ];
643
645
  }
644
646
  function parseTransactionError(response) {
645
647
  try {
@@ -667,12 +669,14 @@ function parseTransactionError(response) {
667
669
  }
668
670
  return parseApiError(response);
669
671
  } catch (error) {
670
- return [{
671
- code: ERROR_CODES.INTERNAL_SERVER_ERROR,
672
- message: "Failed to parse transaction error",
673
- severity: "error",
674
- details: { originalError: error }
675
- }];
672
+ return [
673
+ {
674
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
675
+ message: "Failed to parse transaction error",
676
+ severity: "error",
677
+ details: { originalError: error }
678
+ }
679
+ ];
676
680
  }
677
681
  }
678
682
  function isValidErrorCode(code) {
@@ -744,12 +748,14 @@ function handleCrudifyError(error) {
744
748
  }
745
749
  return parseApiError(error);
746
750
  }
747
- return [{
748
- code: ERROR_CODES.INTERNAL_SERVER_ERROR,
749
- message: "An unknown error occurred",
750
- severity: "error",
751
- details: { originalError: error }
752
- }];
751
+ return [
752
+ {
753
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
754
+ message: "An unknown error occurred",
755
+ severity: "error",
756
+ details: { originalError: error }
757
+ }
758
+ ];
753
759
  }
754
760
 
755
761
  // src/components/CrudifyLogin/Forms/LoginForm.tsx
@@ -1514,10 +1520,7 @@ var CheckCodeForm_default = CheckCodeForm;
1514
1520
  // src/components/CrudifyLogin/components/CrudifyInitializer.tsx
1515
1521
  import { Box as Box5, CircularProgress as CircularProgress5, Alert as Alert5, Typography as Typography5 } from "@mui/material";
1516
1522
  import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1517
- var CrudifyInitializer = ({
1518
- children,
1519
- fallback
1520
- }) => {
1523
+ var CrudifyInitializer = ({ children, fallback }) => {
1521
1524
  const { isLoading, error, isInitialized } = useCrudify();
1522
1525
  const { t } = useTranslation();
1523
1526
  if (isLoading) {
@@ -1542,7 +1545,8 @@ var CrudifyInitializer = ({
1542
1545
  if (error) {
1543
1546
  return /* @__PURE__ */ jsx8(Alert5, { severity: "error", sx: { mt: 2 }, children: /* @__PURE__ */ jsxs5(Typography5, { variant: "body2", children: [
1544
1547
  t("login.initializationError") !== "login.initializationError" ? t("login.initializationError") : "Initialization error",
1545
- ": ",
1548
+ ":",
1549
+ " ",
1546
1550
  error
1547
1551
  ] }) });
1548
1552
  }
@@ -1616,13 +1620,7 @@ var CrudifyLoginInternal = ({
1616
1620
  }
1617
1621
  );
1618
1622
  default:
1619
- return /* @__PURE__ */ jsx9(
1620
- LoginForm_default,
1621
- {
1622
- ...commonProps,
1623
- onLoginSuccess
1624
- }
1625
- );
1623
+ return /* @__PURE__ */ jsx9(LoginForm_default, { ...commonProps, onLoginSuccess });
1626
1624
  }
1627
1625
  };
1628
1626
  return /* @__PURE__ */ jsxs6(CrudifyInitializer, { children: [
@@ -1668,23 +1666,7 @@ var CrudifyLogin = ({
1668
1666
  ...props
1669
1667
  }) => {
1670
1668
  const { config: finalConfig } = useCrudifyLogin(config);
1671
- return /* @__PURE__ */ jsx9(
1672
- I18nProvider,
1673
- {
1674
- translations,
1675
- translationsUrl,
1676
- language,
1677
- children: /* @__PURE__ */ jsx9(CrudifyProvider, { config: finalConfig, children: /* @__PURE__ */ jsx9(
1678
- LoginStateProvider,
1679
- {
1680
- config,
1681
- initialScreen,
1682
- autoReadFromCookies,
1683
- children: /* @__PURE__ */ jsx9(CrudifyLoginInternal, { config, ...props })
1684
- }
1685
- ) })
1686
- }
1687
- );
1669
+ return /* @__PURE__ */ jsx9(I18nProvider, { translations, translationsUrl, language, children: /* @__PURE__ */ jsx9(CrudifyProvider, { config: finalConfig, children: /* @__PURE__ */ jsx9(LoginStateProvider, { config, initialScreen, autoReadFromCookies, children: /* @__PURE__ */ jsx9(CrudifyLoginInternal, { config, ...props }) }) }) });
1688
1670
  };
1689
1671
  var CrudifyLogin_default = CrudifyLogin;
1690
1672
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-ui",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "Biblioteca de componentes UI para Crudify",
5
5
  "author": "Nocios",
6
6
  "license": "MIT",