@coolon/angular-ui-powerups 16.1.0-alpha.326 → 16.1.0-alpha.327
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/interaction/services/interaction.service.mjs +19 -12
- package/esm2022/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.mjs +5 -3
- package/esm2022/lib/place/place-router.mjs +50 -27
- package/fesm2022/coolon-angular-ui-powerups.mjs +71 -39
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/services/interaction.service.d.ts +12 -0
- package/lib/place/place-router.d.ts +19 -1
- package/package.json +1 -1
|
@@ -86,5 +86,17 @@ export declare namespace InteractionService {
|
|
|
86
86
|
notifyActive(context: InteractionContext): Promise<any>;
|
|
87
87
|
private isNavigationInProgress;
|
|
88
88
|
notifyFinished(context: InteractionContext): Promise<any>;
|
|
89
|
+
/**
|
|
90
|
+
* Brings the url's interaction ids up to date. During a navigation the router runs the sync once
|
|
91
|
+
* that navigation lands; skipping it instead left the url with the old ids, so Back left the place
|
|
92
|
+
* rather than closing a dialog opened then, or kept the id of one closed then.
|
|
93
|
+
*
|
|
94
|
+
* :: Important ::
|
|
95
|
+
* Only an idle router's sync is waited for. This is traversed by both the place router (during
|
|
96
|
+
* canDeactivate guards) and user land code (both when routing is idle and while it is active in
|
|
97
|
+
* PlaceComponent.canDeactivate()). A sync asked for during a navigation won't start until that
|
|
98
|
+
* navigation finishes, and the navigation won't finish until this promise settles: deadlock.
|
|
99
|
+
*/
|
|
100
|
+
private syncIdsWithRouter;
|
|
89
101
|
}
|
|
90
102
|
}
|
|
@@ -59,7 +59,13 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
59
59
|
onRouterEnd(event: NavigationEnd): void;
|
|
60
60
|
navigate(visit: Visit): any;
|
|
61
61
|
navigate(placeComponent: Constructable<PlaceComponent>, params?: Record<string, unknown>): any;
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Runs a navigation, or queues it behind the one in flight. The returned promise settles once the
|
|
64
|
+
* navigation has landed (or been refused): a caller may treat it as the route being current, as
|
|
65
|
+
* the place outlet does. A {@link PlaceRouter.NavigationTarget} given as a function is resolved
|
|
66
|
+
* when the navigation runs, so a queued one is built from the visit it runs after.
|
|
67
|
+
*/
|
|
68
|
+
doNavigation(target: PlaceRouter.NavigationTarget, runNavigationCommands: PlaceRouter.NavigationCommands): Promise<void>;
|
|
63
69
|
/**
|
|
64
70
|
* Handles a navigation triggered while another is already in flight: queue it (coalescing to the
|
|
65
71
|
* latest) and run it once the in-flight session finishes.
|
|
@@ -75,6 +81,14 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
75
81
|
* preserves user-intent ordering.
|
|
76
82
|
*/
|
|
77
83
|
private handleOverlappingNavigation;
|
|
84
|
+
/**
|
|
85
|
+
* Coalesces to the latest target, but a superseded caller is NOT settled here: it waits for the
|
|
86
|
+
* navigation that replaced it. Settling it at once told the caller its navigation had landed while
|
|
87
|
+
* the route was unchanged. The place outlet then wrote that route back to its place; a selection
|
|
88
|
+
* that couldn't hold it selected again and navigated again, superseding the next one, and that
|
|
89
|
+
* cycle ran on microtasks alone, so the session in flight never finished (mars-v2's groups pages
|
|
90
|
+
* hung after a create).
|
|
91
|
+
*/
|
|
78
92
|
private queueNavigation;
|
|
79
93
|
private flushPendingNavigation;
|
|
80
94
|
navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras): Promise<boolean>;
|
|
@@ -107,6 +121,10 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
107
121
|
static ɵprov: i0.ɵɵInjectableDeclaration<PlaceRouter>;
|
|
108
122
|
}
|
|
109
123
|
export declare namespace PlaceRouter {
|
|
124
|
+
/** A navigation's visit, or a function that builds it when the navigation runs. */
|
|
125
|
+
type NavigationTarget = Visit | (() => Visit);
|
|
126
|
+
/** Starts the Angular navigation for the visit {@link PlaceRouter.doNavigation} resolved. */
|
|
127
|
+
type NavigationCommands = (router: Router, visit: Visit) => unknown;
|
|
110
128
|
interface Redirections {
|
|
111
129
|
/**
|
|
112
130
|
* NOTE: for now this only supports top level places. Support for child places will require a more fundamental
|