@zauru-sdk/components 6.16.1 → 6.18.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.18.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.17.0...@zauru-sdk/components@6.18.0) (2026-10-30)
7
+
8
+
9
+ ### Features
10
+
11
+ * preservar estado local al reautenticar webapps ([e1f76e6](https://github.com/intuitiva/zauru-typescript-sdk/commit/e1f76e6fe06a76c9dc183b0d1af91439f4cadea7))
12
+
13
+
14
+
15
+
16
+
17
+ # [6.17.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.16.1...@zauru-sdk/components@6.17.0) (2026-10-29)
18
+
19
+
20
+ ### Features
21
+
22
+ * reportar ErrorBoundaryAlert a CloudWatch ([de3c326](https://github.com/intuitiva/zauru-typescript-sdk/commit/de3c32674da2ebbbff53dc307e11ca213043d1c5))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [6.16.1](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.16.0...@zauru-sdk/components@6.16.1) (2026-10-29)
7
29
 
8
30
 
@@ -1,5 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ //<reference> https://tailwindtemplates.io/templates?category=alert
3
+ import { useEffect } from "react";
4
+ import { sendClientError } from "../../observability/sendClientError.js";
2
5
  export const ErrorBoundaryAlert = (props) => {
3
6
  const { title, description } = props;
7
+ useEffect(() => {
8
+ const message = [title, description].filter(Boolean).join(" — ");
9
+ if (!message)
10
+ return;
11
+ sendClientError({
12
+ message,
13
+ source: "errorBoundary",
14
+ });
15
+ }, [title, description]);
4
16
  return (_jsx("div", { className: "rounded-full top-20 mx-auto p-3", children: _jsx("div", { className: "p-4 text-red-900 bg-red-100 border border-red-200 rounded-md", children: _jsxs("div", { className: "flex justify-between flex-wrap", children: [_jsxs("div", { className: "w-0 flex-1 flex", children: [_jsx("div", { className: "mr-3 pt-1", children: _jsx("svg", { width: "26", height: "26", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: _jsx("path", { d: "M13.6086 3.247l8.1916 15.8c.0999.2.1998.5.1998.8 0 1-.7992 1.8-1.7982 1.8H3.7188c-.2997 0-.4995-.1-.7992-.2-.7992-.5-1.1988-1.5-.6993-2.4 5.3067-10.1184 8.0706-15.385 8.2915-15.8.3314-.6222.8681-.8886 1.4817-.897.6135-.008 1.273.2807 1.6151.897zM12 18.95c.718 0 1.3-.582 1.3-1.3 0-.718-.582-1.3-1.3-1.3-.718 0-1.3.582-1.3 1.3 0 .718.582 1.3 1.3 1.3zm-.8895-10.203v5.4c0 .5.4.9.9.9s.9-.4.9-.9v-5.3c0-.5-.4-.9-.9-.9s-.9.4-.9.8z" }) }) }), _jsxs("div", { children: [_jsx("h4", { className: "text-md leading-6 font-medium", children: title?.toString() }), _jsx("p", { className: "text-sm", children: description?.toString() })] })] }), _jsx("div", { children: _jsx("button", { type: "button", className: "rounded-md focus:outline-none focus:ring-2 focus:ring-red-500", children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: _jsx("path", { d: "M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z" }) }) }) })] }) }) }));
5
17
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useFetcher } from "@remix-run/react";
3
3
  import { useEffect, useState } from "react";
4
- import { isOauthUserinfoUnauthorizedError } from "@zauru-sdk/common";
4
+ import { hasZauruOauthReauthCookie, isOauthUserinfoUnauthorizedError, } from "@zauru-sdk/common";
5
5
  import { useValidateNotifications } from "@zauru-sdk/hooks";
6
6
  import { cleanLocalStorage, profileFetchSuccess, useAppDispatch, } from "@zauru-sdk/redux";
7
7
  import { ErrorLayout } from "../Layouts/errorLayout/index.js";
@@ -41,9 +41,7 @@ export function ZauruLoginPage({ cleanLocalStorageArgs, color, }) {
41
41
  setIsClient(true);
42
42
  }, []);
43
43
  useEffect(() => {
44
- const alreadyReauthed = document.cookie
45
- .split(";")
46
- .some((part) => part.trim() === "zauru_oauth_reauth=1");
44
+ const alreadyReauthed = hasZauruOauthReauthCookie(document.cookie);
47
45
  if (fetcher.data?.error &&
48
46
  !alreadyReauthed &&
49
47
  isOauthUserinfoUnauthorizedError(String(fetcher.data?.description ?? ""))) {
@@ -51,7 +49,12 @@ export function ZauruLoginPage({ cleanLocalStorageArgs, color, }) {
51
49
  }
52
50
  }, [fetcher.data]);
53
51
  useEffect(() => {
54
- cleanLocalStorage(cleanLocalStorageArgs);
52
+ // A reauthentication refreshes the same user's expired server session.
53
+ // Keep every local draft/queue intact; normal logins still clean storage
54
+ // and honor the app-specific whitelist.
55
+ if (!hasZauruOauthReauthCookie(document.cookie)) {
56
+ cleanLocalStorage(cleanLocalStorageArgs);
57
+ }
55
58
  fetcher.submit({ action: "login" }, { method: "post" });
56
59
  }, []);
57
60
  if (!isClient) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/components",
3
- "version": "6.16.1",
3
+ "version": "6.18.0",
4
4
  "description": "Componentes reutilizables en las WebApps de Zauru.",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -44,12 +44,12 @@
44
44
  "@reduxjs/toolkit": "^2.2.1",
45
45
  "@remix-run/node": "^2.8.1",
46
46
  "@remix-run/react": "^2.8.1",
47
- "@zauru-sdk/common": "^6.12.0",
48
- "@zauru-sdk/hooks": "^6.4.1",
47
+ "@zauru-sdk/common": "^6.14.0",
48
+ "@zauru-sdk/hooks": "^6.4.2",
49
49
  "@zauru-sdk/icons": "^6.2.0",
50
50
  "@zauru-sdk/redux": "^6.8.2",
51
- "@zauru-sdk/types": "^6.28.0",
52
- "@zauru-sdk/utils": "^6.27.0",
51
+ "@zauru-sdk/types": "^6.29.0",
52
+ "@zauru-sdk/utils": "^6.30.0",
53
53
  "browser-image-compression": "^2.0.2",
54
54
  "framer-motion": "^12.0.0",
55
55
  "jsonwebtoken": "^9.0.2",
@@ -62,5 +62,5 @@
62
62
  "styled-components": "^5.3.5",
63
63
  "zod": "^3.23.8"
64
64
  },
65
- "gitHead": "1ec6d2513e0a162c76f1fd45173085c0532a0d59"
65
+ "gitHead": "8e5cb991b0da7d1a5d70cd6275d7bfdc52ee1102"
66
66
  }
@@ -1,10 +1,21 @@
1
1
  //<reference> https://tailwindtemplates.io/templates?category=alert
2
- import React from "react";
2
+ import React, { useEffect } from "react";
3
+ import { sendClientError } from "../../observability/sendClientError.js";
3
4
 
4
5
  type Props = { title: string; description: string };
5
6
 
6
7
  export const ErrorBoundaryAlert = (props: Props) => {
7
8
  const { title, description } = props;
9
+
10
+ useEffect(() => {
11
+ const message = [title, description].filter(Boolean).join(" — ");
12
+ if (!message) return;
13
+ sendClientError({
14
+ message,
15
+ source: "errorBoundary",
16
+ });
17
+ }, [title, description]);
18
+
8
19
  return (
9
20
  <div className="rounded-full top-20 mx-auto p-3">
10
21
  <div className="p-4 text-red-900 bg-red-100 border border-red-200 rounded-md">
@@ -1,6 +1,9 @@
1
1
  import { useFetcher } from "@remix-run/react";
2
2
  import { useEffect, useState } from "react";
3
- import { isOauthUserinfoUnauthorizedError } from "@zauru-sdk/common";
3
+ import {
4
+ hasZauruOauthReauthCookie,
5
+ isOauthUserinfoUnauthorizedError,
6
+ } from "@zauru-sdk/common";
4
7
  import { useValidateNotifications } from "@zauru-sdk/hooks";
5
8
  import {
6
9
  cleanLocalStorage,
@@ -71,9 +74,7 @@ export function ZauruLoginPage({
71
74
  }, []);
72
75
 
73
76
  useEffect(() => {
74
- const alreadyReauthed = document.cookie
75
- .split(";")
76
- .some((part) => part.trim() === "zauru_oauth_reauth=1");
77
+ const alreadyReauthed = hasZauruOauthReauthCookie(document.cookie);
77
78
  if (
78
79
  fetcher.data?.error &&
79
80
  !alreadyReauthed &&
@@ -86,7 +87,12 @@ export function ZauruLoginPage({
86
87
  }, [fetcher.data]);
87
88
 
88
89
  useEffect(() => {
89
- cleanLocalStorage(cleanLocalStorageArgs);
90
+ // A reauthentication refreshes the same user's expired server session.
91
+ // Keep every local draft/queue intact; normal logins still clean storage
92
+ // and honor the app-specific whitelist.
93
+ if (!hasZauruOauthReauthCookie(document.cookie)) {
94
+ cleanLocalStorage(cleanLocalStorageArgs);
95
+ }
90
96
  fetcher.submit({ action: "login" }, { method: "post" });
91
97
  }, []);
92
98