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.
@@ -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>, "size" | "defaultChecked" | "type"> & react.RefAttributes<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>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<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 };
@@ -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>, "size" | "defaultChecked" | "type"> & react.RefAttributes<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>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<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 };
@@ -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>, "size" | "onSelect"> & react.RefAttributes<HTMLInputElement>>;
25
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "onSelect" | "size"> & react.RefAttributes<HTMLInputElement>>;
26
26
 
27
27
  export { Search as default };
@@ -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>, "size" | "onSelect"> & react.RefAttributes<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>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<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>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<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 response = await options.api.get(options.endpoint, {
7963
- headers: {
7964
- Authorization: `Bearer ${authParams.token}`
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(response.data.data);
7968
- handleProfileSelection(response.data.data, options.setSelectedProfile);
7969
- handleUserData(response.data.data, options.setUser);
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)(void 0);
9554
+ const [filterType, setFilterType] = (0, import_react28.useState)("all");
9522
9555
  const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
9523
9556
  const allQuestions = getTotalQuestions();
9524
9557
  const handleFinishQuiz = async () => {