@pagamio/frontend-commons-lib 0.8.204 → 0.8.206

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.
@@ -110,6 +110,10 @@ export function PagamioLoginPage({ logo, text = loginPageDefaultText, appLabel,
110
110
  window.location.href = createAccountRoute;
111
111
  }
112
112
  };
113
- return (_jsx(AuthPageLayout, { appLabel: appLabel, title: text.welcomeTitle, subtitle: text.welcomeSubtitle, errorMessage: error ?? authError?.message, logo: logo, className: className, horizontal: false, children: _jsxs("div", { className: "mt-8", children: [_jsx(FormEngine, { fields: loginFields, onSubmit: handleSubmit, layout: "vertical", className: "mb-0 px-0", submitButtonClass: "w-full", submitButtonText: isLoading ? text.loadingButtonLabel : text.loginButtonLabel, onCancel: () => { }, showCancelButton: false, showSubmittingText: false, formRef: formRef }), _jsxs("div", { className: "flex items-center justify-center gap-x-4 mt-4", children: [onForgotPassword && (_jsx("button", { type: "button", onClick: onForgotPassword, className: "text-sm text-primary-500 hover:underline dark:text-primary-500", children: text.forgotPasswordLabel })), hasCreateAccount && (_jsxs(_Fragment, { children: [onForgotPassword && _jsx("span", { className: "text-gray-500", children: "|" }), _jsx("button", { type: "button", onClick: handleCreateAccount, className: "text-sm text-primary-500 hover:underline dark:text-primary-500", children: text.createAccountLabel })] }))] })] }) }));
113
+ return (_jsx(AuthPageLayout, { appLabel: appLabel, title: text.welcomeTitle, subtitle: text.welcomeSubtitle, errorMessage: error ?? authError?.message, logo: logo, className: className, horizontal: false, children: _jsxs("div", { className: "mt-8", children: [_jsx(FormEngine, { fields: loginFields, onSubmit: handleSubmit, layout: "vertical", className: "mb-0 px-0", submitButtonClass: "w-full", submitButtonText: isLoading ? text.loadingButtonLabel : text.loginButtonLabel, onCancel: () => { }, showCancelButton: false, showSubmittingText: false, formRef: formRef, initialValues: {
114
+ username: '',
115
+ password: '',
116
+ rememberMe: false,
117
+ } }), _jsxs("div", { className: "flex items-center justify-center gap-x-4 mt-4", children: [onForgotPassword && (_jsx("button", { type: "button", onClick: onForgotPassword, className: "text-sm text-primary-500 hover:underline dark:text-primary-500", children: text.forgotPasswordLabel })), hasCreateAccount && (_jsxs(_Fragment, { children: [onForgotPassword && _jsx("span", { className: "text-gray-500", children: "|" }), _jsx("button", { type: "button", onClick: handleCreateAccount, className: "text-sm text-primary-500 hover:underline dark:text-primary-500", children: text.createAccountLabel })] }))] })] }) }));
114
118
  }
115
119
  export default PagamioLoginPage;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @fileoverview Complete authentication service implementation
3
+ * Handles auth operations with configurable endpoints and token management
4
+ */
1
5
  import type { ApiClient } from '../../api';
2
6
  import type { AuthResponse, CustomAuthConfig } from '../types';
3
7
  import { TokenManager } from '../utils';
@@ -85,7 +89,7 @@ export declare class AuthService<T extends CustomAuthConfig> {
85
89
  /**
86
90
  * Keeps a reference to the interval to clear it on unmount.
87
91
  */
88
- intervalRef: import("react").MutableRefObject<NodeJS.Timeout | null>;
92
+ intervalRef: ReturnType<typeof setInterval> | null;
89
93
  private readonly tokenManager;
90
94
  private readonly apiClient;
91
95
  private readonly endpoints;
@@ -1,8 +1,3 @@
1
- /**
2
- * @fileoverview Complete authentication service implementation
3
- * Handles auth operations with configurable endpoints and token management
4
- */
5
- import { useRef } from 'react';
6
1
  import { transformStrapiResponse, } from '../authenticators/processors/StrapiAuthenticatorProcessor';
7
2
  import { ResponseTransformerFactory, TokenManager } from '../utils';
8
3
  /**
@@ -15,7 +10,7 @@ export class AuthService {
15
10
  /**
16
11
  * Keeps a reference to the interval to clear it on unmount.
17
12
  */
18
- intervalRef = useRef(null);
13
+ intervalRef = null;
19
14
  tokenManager;
20
15
  apiClient;
21
16
  endpoints;
@@ -390,7 +385,7 @@ export class AuthService {
390
385
  const nextCheckInterval = timeUntilRefresh > 5 * 60 * 1000
391
386
  ? 60 * 1000 // check every minute
392
387
  : Math.max(1000, Math.min(timeUntilRefresh / 10, 30 * 1000)); // check between 1-30 seconds
393
- this.intervalRef.current = setTimeout(scheduleNextCheck, nextCheckInterval);
388
+ this.intervalRef = setTimeout(scheduleNextCheck, nextCheckInterval);
394
389
  };
395
390
  scheduleNextCheck();
396
391
  }
@@ -398,8 +393,8 @@ export class AuthService {
398
393
  * Stops automatic token refresh
399
394
  */
400
395
  stopAutoRefresh() {
401
- if (this.intervalRef.current) {
402
- clearInterval(this.intervalRef.current);
396
+ if (this.intervalRef) {
397
+ clearInterval(this.intervalRef);
403
398
  }
404
399
  }
405
400
  /**
@@ -6,7 +6,7 @@ import { useAppSidebarContext } from '../../context';
6
6
  import { useLibTranslations, useTranslation } from '../../translations';
7
7
  const AppSidebarMenu = () => {
8
8
  const { pages } = useAppSidebarContext();
9
- return (_jsx(Sidebar.Items, { children: _jsx(Sidebar.ItemGroup, { children: pages.map((item) => (_jsx(AppSidebarItem, { ...item }, item.label))) }) }));
9
+ return (_jsx(Sidebar.Items, { children: pages.map((item) => (_jsx(Sidebar.ItemGroup, { children: _jsx(AppSidebarItem, { ...item }) }, item.label))) }));
10
10
  };
11
11
  const AppSidebarItem = ({ href, target, icon, label, items, badge, forceDropdown }) => {
12
12
  const { pathname, linkComponent: Link } = useAppSidebarContext();
@@ -180,7 +180,7 @@ const DashboardWrapper = ({ data, showVisualHeader = true, showEventsTabbedLayou
180
180
  currencyDisplaySymbol: metricData.currencyDisplaySymbol,
181
181
  ...metricData,
182
182
  };
183
- return (_jsx(Grid.Col, { span: matchesSmall ? 12 : span, offset: offset, children: _jsx(VisualComponent, { ...props }) }, `visual-${visual.id}`));
183
+ return (_jsx(Grid.Col, { span: matchesSmall ? 12 : span, offset: offset, children: _jsx(VisualComponent, { ...props }) }, `visual-${sectionTitle}-${visual.id}`));
184
184
  }, [config.themeColor, isXs, isSm]);
185
185
  const tabs = [
186
186
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagamio/frontend-commons-lib",
3
3
  "description": "Pagamio library for Frontend reusable components like the form engine and table container",
4
- "version": "0.8.204",
4
+ "version": "0.8.206",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false