analytica-frontend-lib 1.1.23 → 1.1.25
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/Auth/useUrlAuthentication/index.d.mts +6 -0
- package/dist/Auth/useUrlAuthentication/index.d.ts +6 -0
- package/dist/Auth/useUrlAuthentication/index.js +41 -8
- package/dist/Auth/useUrlAuthentication/index.js.map +1 -1
- package/dist/Auth/useUrlAuthentication/index.mjs +42 -9
- package/dist/Auth/useUrlAuthentication/index.mjs.map +1 -1
- package/dist/CheckBox/index.d.mts +1 -1
- package/dist/CheckBox/index.d.ts +1 -1
- package/dist/Quiz/index.js +1 -1
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +1 -1
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Radio/index.d.mts +2 -2
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Search/index.d.mts +1 -1
- package/dist/Search/index.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/Radio/index.d.mts
CHANGED
|
@@ -81,7 +81,7 @@ declare const Radio: react.ForwardRefExoticComponent<{
|
|
|
81
81
|
value?: string;
|
|
82
82
|
/** Default checked state for uncontrolled radios */
|
|
83
83
|
defaultChecked?: boolean;
|
|
84
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
84
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "type" | "size"> & react.RefAttributes<HTMLInputElement>>;
|
|
85
85
|
/**
|
|
86
86
|
* RadioGroup store interface
|
|
87
87
|
*/
|
|
@@ -198,6 +198,6 @@ declare const RadioGroupItem: react.ForwardRefExoticComponent<{
|
|
|
198
198
|
state?: RadioState;
|
|
199
199
|
/** Additional CSS classes */
|
|
200
200
|
className?: string;
|
|
201
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
201
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
|
|
202
202
|
|
|
203
203
|
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RadioProps, Radio as default, useRadioGroupStore };
|
package/dist/Radio/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare const Radio: react.ForwardRefExoticComponent<{
|
|
|
81
81
|
value?: string;
|
|
82
82
|
/** Default checked state for uncontrolled radios */
|
|
83
83
|
defaultChecked?: boolean;
|
|
84
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
84
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "type" | "size"> & react.RefAttributes<HTMLInputElement>>;
|
|
85
85
|
/**
|
|
86
86
|
* RadioGroup store interface
|
|
87
87
|
*/
|
|
@@ -198,6 +198,6 @@ declare const RadioGroupItem: react.ForwardRefExoticComponent<{
|
|
|
198
198
|
state?: RadioState;
|
|
199
199
|
/** Additional CSS classes */
|
|
200
200
|
className?: string;
|
|
201
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
201
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
|
|
202
202
|
|
|
203
203
|
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RadioProps, Radio as default, useRadioGroupStore };
|
package/dist/Search/index.d.mts
CHANGED
|
@@ -22,6 +22,6 @@ declare const Search: react.ForwardRefExoticComponent<{
|
|
|
22
22
|
containerClassName?: string;
|
|
23
23
|
/** Callback when clear button is clicked */
|
|
24
24
|
onClear?: () => void;
|
|
25
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
25
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "onSelect" | "size"> & react.RefAttributes<HTMLInputElement>>;
|
|
26
26
|
|
|
27
27
|
export { Search as default };
|
package/dist/Search/index.d.ts
CHANGED
|
@@ -22,6 +22,6 @@ declare const Search: react.ForwardRefExoticComponent<{
|
|
|
22
22
|
containerClassName?: string;
|
|
23
23
|
/** Callback when clear button is clicked */
|
|
24
24
|
onClear?: () => void;
|
|
25
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
25
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "onSelect" | "size"> & react.RefAttributes<HTMLInputElement>>;
|
|
26
26
|
|
|
27
27
|
export { Search as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -134,6 +134,6 @@ declare const CheckboxListItem: react.ForwardRefExoticComponent<{
|
|
|
134
134
|
state?: CheckboxListState;
|
|
135
135
|
/** Additional CSS classes */
|
|
136
136
|
className?: string;
|
|
137
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
137
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
|
|
138
138
|
|
|
139
139
|
export { CheckboxList, CheckboxListItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,6 @@ declare const CheckboxListItem: react.ForwardRefExoticComponent<{
|
|
|
134
134
|
state?: CheckboxListState;
|
|
135
135
|
/** Additional CSS classes */
|
|
136
136
|
className?: string;
|
|
137
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
137
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "name" | "type" | "size" | "value" | "checked"> & react.RefAttributes<HTMLInputElement>>;
|
|
138
138
|
|
|
139
139
|
export { CheckboxList, CheckboxListItem };
|
package/dist/index.js
CHANGED
|
@@ -7948,28 +7948,58 @@ var handleUserData = (responseData, setUser) => {
|
|
|
7948
7948
|
};
|
|
7949
7949
|
function useUrlAuthentication(options) {
|
|
7950
7950
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
7951
|
+
const processedRef = (0, import_react26.useRef)(false);
|
|
7951
7952
|
(0, import_react26.useEffect)(() => {
|
|
7952
7953
|
const handleAuthentication = async () => {
|
|
7954
|
+
if (processedRef.current) {
|
|
7955
|
+
return;
|
|
7956
|
+
}
|
|
7953
7957
|
const authParams = getAuthParams(location, options.extractParams);
|
|
7954
7958
|
if (!hasValidAuthParams(authParams)) {
|
|
7955
7959
|
return;
|
|
7956
7960
|
}
|
|
7961
|
+
processedRef.current = true;
|
|
7957
7962
|
try {
|
|
7958
7963
|
options.setTokens({
|
|
7959
7964
|
token: authParams.token,
|
|
7960
7965
|
refreshToken: authParams.refreshToken
|
|
7961
7966
|
});
|
|
7962
|
-
const
|
|
7963
|
-
|
|
7964
|
-
|
|
7967
|
+
const maxRetries = options.maxRetries || 3;
|
|
7968
|
+
const retryDelay = options.retryDelay || 1e3;
|
|
7969
|
+
let retries = 0;
|
|
7970
|
+
let sessionData = null;
|
|
7971
|
+
while (retries < maxRetries && !sessionData) {
|
|
7972
|
+
try {
|
|
7973
|
+
const response = await options.api.get(options.endpoint, {
|
|
7974
|
+
headers: {
|
|
7975
|
+
Authorization: `Bearer ${authParams.token}`
|
|
7976
|
+
}
|
|
7977
|
+
});
|
|
7978
|
+
sessionData = response.data.data;
|
|
7979
|
+
break;
|
|
7980
|
+
} catch (error) {
|
|
7981
|
+
retries++;
|
|
7982
|
+
console.warn(
|
|
7983
|
+
`Tentativa ${retries}/${maxRetries} falhou para ${options.endpoint}:`,
|
|
7984
|
+
error
|
|
7985
|
+
);
|
|
7986
|
+
if (retries < maxRetries) {
|
|
7987
|
+
await new Promise(
|
|
7988
|
+
(resolve) => setTimeout(resolve, retryDelay * retries)
|
|
7989
|
+
);
|
|
7990
|
+
} else {
|
|
7991
|
+
throw error;
|
|
7992
|
+
}
|
|
7965
7993
|
}
|
|
7966
|
-
}
|
|
7967
|
-
options.setSessionInfo(
|
|
7968
|
-
handleProfileSelection(
|
|
7969
|
-
handleUserData(
|
|
7994
|
+
}
|
|
7995
|
+
options.setSessionInfo(sessionData);
|
|
7996
|
+
handleProfileSelection(sessionData, options.setSelectedProfile);
|
|
7997
|
+
handleUserData(sessionData, options.setUser);
|
|
7970
7998
|
options.clearParamsFromURL?.();
|
|
7971
7999
|
} catch (error) {
|
|
7972
8000
|
console.error("Erro ao obter informa\xE7\xF5es da sess\xE3o:", error);
|
|
8001
|
+
processedRef.current = false;
|
|
8002
|
+
options.onError?.(error);
|
|
7973
8003
|
}
|
|
7974
8004
|
};
|
|
7975
8005
|
handleAuthentication();
|
|
@@ -7982,7 +8012,10 @@ function useUrlAuthentication(options) {
|
|
|
7982
8012
|
options.api,
|
|
7983
8013
|
options.endpoint,
|
|
7984
8014
|
options.extractParams,
|
|
7985
|
-
options.clearParamsFromURL
|
|
8015
|
+
options.clearParamsFromURL,
|
|
8016
|
+
options.maxRetries,
|
|
8017
|
+
options.retryDelay,
|
|
8018
|
+
options.onError
|
|
7986
8019
|
]);
|
|
7987
8020
|
}
|
|
7988
8021
|
|
|
@@ -9518,7 +9551,7 @@ var QuizFooter = (0, import_react28.forwardRef)(
|
|
|
9518
9551
|
const [modalResultOpen, setModalResultOpen] = (0, import_react28.useState)(false);
|
|
9519
9552
|
const [modalNavigateOpen, setModalNavigateOpen] = (0, import_react28.useState)(false);
|
|
9520
9553
|
const [modalResolutionOpen, setModalResolutionOpen] = (0, import_react28.useState)(false);
|
|
9521
|
-
const [filterType, setFilterType] = (0, import_react28.useState)(
|
|
9554
|
+
const [filterType, setFilterType] = (0, import_react28.useState)("all");
|
|
9522
9555
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
9523
9556
|
const allQuestions = getTotalQuestions();
|
|
9524
9557
|
const handleFinishQuiz = async () => {
|