@coolon/angular-ui-powerups 16.1.0-alpha.231 → 16.1.0-alpha.233
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/esm2022/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.mjs +38 -3
- package/esm2022/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.mjs +7 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +43 -5
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +15 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NavigationCancel, NavigationEnd, NavigationStart } from '@angular/router';
|
|
2
|
+
import type { UrlSnapshot } from '../../../url-snapshot';
|
|
2
3
|
import type { NavigationContext } from '../navigation-context';
|
|
3
4
|
import { NavigationSession } from '../navigation-session';
|
|
4
5
|
/**
|
|
@@ -6,17 +7,30 @@ import { NavigationSession } from '../navigation-session';
|
|
|
6
7
|
* the resolves when the process and completed. This case is special as the process involves a regular routing cycle
|
|
7
8
|
* followed by a call to location.back(). The later triggers a url change with no other routing events. So this
|
|
8
9
|
* class tracks when the first routing cycle finishes and then waits for the subsequent lone url change event.
|
|
10
|
+
*
|
|
11
|
+
* location.back() is preferred because it pops the history entry that opening the interaction pushed, so the
|
|
12
|
+
* browser back button closes the interaction in a single click. But a programmatic back() can be silently dropped
|
|
13
|
+
* — producing no popstate — by some browser/extension combinations (observed: Chrome 149 with 1Password active on
|
|
14
|
+
* a form field). When that happens this session would otherwise never receive its popstate, never finish, and stay
|
|
15
|
+
* in progress forever — stranding the modal backdrop and blocking every subsequent navigation. So we arm a watchdog:
|
|
16
|
+
* if no popstate arrives, we self-heal with an imperative replaceUrl navigation to the interaction-free url. That
|
|
17
|
+
* leaves the url clean and unblocks the router; the only cost in the broken browser is that back doesn't pop the
|
|
18
|
+
* pushed entry, so it takes one extra click — unavoidable, since we can't pop history when back() is dropped.
|
|
9
19
|
*/
|
|
10
20
|
export declare class RemoveLastInteractionFromUrlNavigationSession extends NavigationSession {
|
|
21
|
+
private readonly interactionFreeUrl;
|
|
11
22
|
readonly isPopState = true;
|
|
12
23
|
debugPropertyKeys: string[];
|
|
13
24
|
private finished;
|
|
14
25
|
private gotPopState;
|
|
15
|
-
|
|
26
|
+
private selfHealing;
|
|
27
|
+
constructor(context: NavigationContext, startingUrl: string, interactionFreeUrl: UrlSnapshot);
|
|
16
28
|
get isInteractionSync(): boolean;
|
|
29
|
+
notifyActive(): void;
|
|
17
30
|
onPopState(event: NavigationStart): void;
|
|
18
31
|
onRouterStarted(event: NavigationStart): void;
|
|
19
32
|
onRouterCancelled(event: NavigationCancel): void;
|
|
33
|
+
private selfHealIfBackWasDropped;
|
|
20
34
|
private finishUp;
|
|
21
35
|
onRouterEnd(event: NavigationEnd): void;
|
|
22
36
|
handleCanDeactivateCancelledEventScenario(locationTriggerUrl: string): void;
|