@fluxo-dev/shell 26.2.1 → 26.2.3
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/index.esm.js
CHANGED
|
@@ -15359,8 +15359,37 @@ const usePageTracker = sessionHub => {
|
|
|
15359
15359
|
}, []); // Empty deps - crea l'observer UNA SOLA VOLTA
|
|
15360
15360
|
};
|
|
15361
15361
|
|
|
15362
|
+
/**
|
|
15363
|
+
* Hook per bloccare il pulsante "indietro" del browser
|
|
15364
|
+
* quando la sessione corrente è in focus mode
|
|
15365
|
+
*/
|
|
15366
|
+
const useFocusModeBackButton = isInFocusMode => {
|
|
15367
|
+
const handlePopState = useCallback$1(event => {
|
|
15368
|
+
if (isInFocusMode) {
|
|
15369
|
+
// Previeni la navigazione indietro
|
|
15370
|
+
event.preventDefault();
|
|
15371
|
+
// Ripristina lo stato corrente nella history
|
|
15372
|
+
window.history.pushState(null, '', window.location.href);
|
|
15373
|
+
}
|
|
15374
|
+
}, [isInFocusMode]);
|
|
15375
|
+
useEffect(() => {
|
|
15376
|
+
if (!isInFocusMode) {
|
|
15377
|
+
return;
|
|
15378
|
+
}
|
|
15379
|
+
// Aggiungi un entry nella history quando entriamo in focus mode
|
|
15380
|
+
// Questo ci permette di intercettare il back button
|
|
15381
|
+
window.history.pushState(null, '', window.location.href);
|
|
15382
|
+
// Aggiungi il listener per l'evento popstate
|
|
15383
|
+
window.addEventListener('popstate', handlePopState);
|
|
15384
|
+
// Cleanup: rimuovi il listener quando usciamo dal focus mode
|
|
15385
|
+
return () => {
|
|
15386
|
+
window.removeEventListener('popstate', handlePopState);
|
|
15387
|
+
};
|
|
15388
|
+
}, [isInFocusMode, handlePopState]);
|
|
15389
|
+
};
|
|
15390
|
+
|
|
15362
15391
|
function AppContent(props) {
|
|
15363
|
-
var _a;
|
|
15392
|
+
var _a, _b;
|
|
15364
15393
|
const sessionContext = useContext(ShellSessionContext);
|
|
15365
15394
|
const currentSessionId = sessionContext.getCurrentSessionId();
|
|
15366
15395
|
const isMobile = useMediaQuery('(max-width: 992px)');
|
|
@@ -15411,6 +15440,11 @@ function AppContent(props) {
|
|
|
15411
15440
|
} = useSessionManager(props.withMultipleSessions, sessionContext);
|
|
15412
15441
|
// Nuovo stato per gestire l'apertura della modal di conferma per la chiusura di tutte le sessioni
|
|
15413
15442
|
const [confirmCloseAllModalOpen, setConfirmCloseAllModalOpen] = useState(false);
|
|
15443
|
+
// Determina se la sessione corrente è in focus mode
|
|
15444
|
+
const currentSession = sessionContext.sessions().find(s => s.id === currentSessionId);
|
|
15445
|
+
const isCurrentSessionInFocusMode = (_a = currentSession === null || currentSession === void 0 ? void 0 : currentSession.focusMode) !== null && _a !== void 0 ? _a : false;
|
|
15446
|
+
// Hook per bloccare il pulsante indietro del browser in focus mode
|
|
15447
|
+
useFocusModeBackButton(props.withMultipleSessions && isCurrentSessionInFocusMode);
|
|
15414
15448
|
// Funzione per controllare se gli indicatori devono essere disabilitati
|
|
15415
15449
|
const getIndicatorStates = useCallback$1(() => {
|
|
15416
15450
|
const sessions = sessionContext.sessions();
|
|
@@ -15722,7 +15756,7 @@ function AppContent(props) {
|
|
|
15722
15756
|
value: true,
|
|
15723
15757
|
children: jsx(Outlet, {})
|
|
15724
15758
|
}), jsx(CloseSessionConfirmationModal, {
|
|
15725
|
-
sessionTitle: sessionToClose ? ((
|
|
15759
|
+
sessionTitle: sessionToClose ? ((_b = sessionContext.getSession(sessionToClose)) === null || _b === void 0 ? void 0 : _b.title) || '' : '',
|
|
15726
15760
|
sessionId: sessionToClose || '',
|
|
15727
15761
|
opened: confirmCloseModalOpen,
|
|
15728
15762
|
onConfirm: confirmCloseTab,
|
|
@@ -78647,9 +78681,20 @@ function LockedResource({
|
|
|
78647
78681
|
}, [onResourceLocked, onResourceUnlocked]);
|
|
78648
78682
|
// Funzione per eseguire il lock check
|
|
78649
78683
|
const performLockCheck = React__default.useCallback((showLoader = true) => {
|
|
78650
|
-
|
|
78684
|
+
// Verifica se SessionHub è disponibile
|
|
78685
|
+
if (!FluxoClientSys.Instance.sessionHub) {
|
|
78686
|
+
setIsLoading(false);
|
|
78687
|
+
setError('Sistema di lock non disponibile');
|
|
78688
|
+
setHasCheckedOnce(true);
|
|
78651
78689
|
return;
|
|
78652
78690
|
}
|
|
78691
|
+
// Se non è connesso, aspetta la connessione invece di uscire
|
|
78692
|
+
if (!FluxoClientSys.Instance.sessionHub.isConnected) {
|
|
78693
|
+
if (showLoader) {
|
|
78694
|
+
setIsLoading(true);
|
|
78695
|
+
}
|
|
78696
|
+
return; // Il check verrà riprovato quando si connette
|
|
78697
|
+
}
|
|
78653
78698
|
// Mostra il loader solo se richiesto (primo check)
|
|
78654
78699
|
if (showLoader) {
|
|
78655
78700
|
setIsLoading(true);
|
|
@@ -78693,19 +78738,18 @@ function LockedResource({
|
|
|
78693
78738
|
useEffect(() => {
|
|
78694
78739
|
performLockCheck(true); // Mostra il loader al primo check
|
|
78695
78740
|
}, [performLockCheck]);
|
|
78696
|
-
// Monitora lo stato di connessione e ri-esegui il check quando si
|
|
78741
|
+
// Monitora lo stato di connessione e ri-esegui il check quando si connette
|
|
78697
78742
|
useEffect(() => {
|
|
78698
|
-
|
|
78699
|
-
if (!hasCheckedOnce) return;
|
|
78743
|
+
if (!FluxoClientSys.Instance.sessionHub) return;
|
|
78700
78744
|
const currentConnectionState = FluxoClientSys.Instance.sessionHub.isConnected;
|
|
78701
78745
|
setIsConnected(currentConnectionState);
|
|
78702
78746
|
// Polling per monitorare lo stato di connessione
|
|
78703
78747
|
const interval = setInterval(() => {
|
|
78704
78748
|
const newConnectionState = FluxoClientSys.Instance.sessionHub.isConnected;
|
|
78705
|
-
//
|
|
78749
|
+
// Se passa da disconnesso a connesso (inclusa la prima connessione)
|
|
78706
78750
|
if (newConnectionState && !isConnected) {
|
|
78707
|
-
|
|
78708
|
-
performLockCheck(
|
|
78751
|
+
// Se non ha ancora fatto check, mostra il loader, altrimenti no
|
|
78752
|
+
performLockCheck(!hasCheckedOnce);
|
|
78709
78753
|
}
|
|
78710
78754
|
setIsConnected(newConnectionState);
|
|
78711
78755
|
}, 2000);
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluxo-dev/shell",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^18.3.1",
|
|
6
6
|
"@mantine/core": "^7.12.2",
|
|
7
7
|
"react-router-dom": "^6.11.2",
|
|
8
8
|
"react-redux": "^8.0.5",
|
|
9
9
|
"@reduxjs/toolkit": "^1.9.1",
|
|
10
|
-
"@fluxo-dev/api-client-base": "^26.2.
|
|
11
|
-
"@fluxo-dev/shell-bi": "^26.2.
|
|
12
|
-
"@fluxo-dev/shell-hub": "^26.2.
|
|
13
|
-
"@fluxo-dev/shell-korebi": "^26.2.
|
|
14
|
-
"@fluxo-dev/shell-mfe": "^26.2.
|
|
15
|
-
"@fluxo-dev/shell-printing": "^26.2.
|
|
16
|
-
"@fluxo-dev/shell-reporting": "^26.2.
|
|
17
|
-
"@fluxo-dev/shell-workflow": "^26.2.
|
|
18
|
-
"@fluxo-dev/shell-ravify": "^26.2.
|
|
19
|
-
"@fluxo-dev/state": "^26.2.
|
|
20
|
-
"@fluxo-dev/ui-components": "^26.2.
|
|
10
|
+
"@fluxo-dev/api-client-base": "^26.2.3",
|
|
11
|
+
"@fluxo-dev/shell-bi": "^26.2.3",
|
|
12
|
+
"@fluxo-dev/shell-hub": "^26.2.3",
|
|
13
|
+
"@fluxo-dev/shell-korebi": "^26.2.3",
|
|
14
|
+
"@fluxo-dev/shell-mfe": "^26.2.3",
|
|
15
|
+
"@fluxo-dev/shell-printing": "^26.2.3",
|
|
16
|
+
"@fluxo-dev/shell-reporting": "^26.2.3",
|
|
17
|
+
"@fluxo-dev/shell-workflow": "^26.2.3",
|
|
18
|
+
"@fluxo-dev/shell-ravify": "^26.2.3",
|
|
19
|
+
"@fluxo-dev/state": "^26.2.3",
|
|
20
|
+
"@fluxo-dev/ui-components": "^26.2.3",
|
|
21
21
|
"@scalar/api-reference-react": "0.9.1",
|
|
22
22
|
"@devexpress/analytics-core": "23.1.3",
|
|
23
23
|
"devexpress-dashboard": "23.1.3",
|