@coolon/angular-ui-powerups 16.1.0-alpha.271 → 16.1.0-alpha.272
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/guards/place.guard.mjs +16 -2
- package/esm2022/lib/place/navigation/session/navigation-session.mjs +4 -4
- package/esm2022/lib/place/place-router.mjs +35 -26
- package/esm2022/lib/place/url-snapshot.mjs +27 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +77 -32
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/guards/place.guard.d.ts +10 -0
- package/lib/place/navigation/session/navigation-session.d.ts +3 -3
- package/lib/place/place-router.d.ts +16 -8
- package/package.json +2 -2
|
@@ -18,6 +18,16 @@ export declare class PlaceGuard {
|
|
|
18
18
|
constructor(router: Router, urlService: UrlService, placeRouter: PlaceRouter, placeHistory: PlaceHistory, interactionService: InteractionService, injector: Injector);
|
|
19
19
|
get authService(): PlaceAuthService;
|
|
20
20
|
canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether this guard pass should append a child segment to the url.
|
|
23
|
+
*
|
|
24
|
+
* For a route-id place the redirect must wait until the id is RESOLVED: an empty id followed by
|
|
25
|
+
* a child is unrepresentable in the url (it serialises as `//`, which Angular's parser silently
|
|
26
|
+
* truncates at). The check reads the SANITISED visit — the post-remember/default/sanitiser
|
|
27
|
+
* truth — so a sanitiser-supplied id redirects on the corrected-url pass, and an id supplied
|
|
28
|
+
* later (e.g. a selection model's auto-selection) redirects on that navigation's guard run.
|
|
29
|
+
*/
|
|
30
|
+
private shouldRedirectToChild;
|
|
21
31
|
/**
|
|
22
32
|
* Chooses the child to redirect to when {@link PlaceDefinition.redirectToFirstChild} is set. When
|
|
23
33
|
* `rememberLastChild` is enabled (the default) and we have a record of the last active child that is
|
|
@@ -24,9 +24,9 @@ export declare abstract class NavigationSession extends GarbageCollector {
|
|
|
24
24
|
get isInteractionSync(): boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Interruptible sessions are internal housekeeping navigations (e.g. interaction-id
|
|
27
|
-
* synchronisation)
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* synchronisation). Historically only these queued an overlapping navigation while real
|
|
28
|
+
* navigations dropped it; ALL overlapping navigations now queue (see
|
|
29
|
+
* PlaceRouter.handleOverlappingNavigation), so this flag is diagnostic only.
|
|
30
30
|
*/
|
|
31
31
|
get isInterruptible(): boolean;
|
|
32
32
|
get name(): string;
|
|
@@ -61,15 +61,18 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
61
61
|
navigate(placeComponent: Constructable<PlaceComponent>, params?: Record<string, unknown>): any;
|
|
62
62
|
doNavigation(visit: Visit, runNavigationCommands: (router: Router) => unknown): Promise<void>;
|
|
63
63
|
/**
|
|
64
|
-
* Handles a navigation triggered while another is already in flight
|
|
64
|
+
* Handles a navigation triggered while another is already in flight: queue it (coalescing to the
|
|
65
|
+
* latest) and run it once the in-flight session finishes.
|
|
65
66
|
*
|
|
66
|
-
*
|
|
67
|
-
* triggering action
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
67
|
+
* History: this used to throw `illegalState('Navigation already in progress')` (killed the
|
|
68
|
+
* triggering action), then dropped real-vs-real collisions as an interim policy pending
|
|
69
|
+
* production evidence. The evidence arrived: a `navigate()` issued from `onPlaceReady` or a
|
|
70
|
+
* route-parameter subscription can land while the activating navigation's session is still
|
|
71
|
+
* settling — dropping it leaves a place that never finishes navigating (e.g. a
|
|
72
|
+
* redirectToFirstChild-style child that never appears), and the caller can't tell because the
|
|
73
|
+
* dropped promise resolved normally. Popstate never enters doNavigation (it arrives via router
|
|
74
|
+
* events -> onPopState), so queueing programmatic navigations behind an in-flight session
|
|
75
|
+
* preserves user-intent ordering.
|
|
73
76
|
*/
|
|
74
77
|
private handleOverlappingNavigation;
|
|
75
78
|
private queueNavigation;
|
|
@@ -81,6 +84,11 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
81
84
|
private createNavigationSession;
|
|
82
85
|
protected transitionTo(next: NavigationSession): void;
|
|
83
86
|
private routingSessionFinished;
|
|
87
|
+
/**
|
|
88
|
+
* Runs `func` when the NEXT navigation session finishes — which may be a session that hasn't
|
|
89
|
+
* started yet (the interaction-id sync registers its completion job before starting the sync
|
|
90
|
+
* session, and jobs registered while a drain is running belong to the following session).
|
|
91
|
+
*/
|
|
84
92
|
private runAfterRoutingSessionFinishes;
|
|
85
93
|
/**
|
|
86
94
|
* Sync's the current interaction state with the URL. We need to push something in the URL in order
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coolon/angular-ui-powerups",
|
|
3
|
-
"version": "16.1.0-alpha.
|
|
3
|
+
"version": "16.1.0-alpha.272",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^16.2.9",
|
|
6
6
|
"@angular/common": "^16.2.9",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@angular/platform-browser-dynamic": "^16.2.9",
|
|
13
13
|
"@angular/material-moment-adapter": "^16.2.10",
|
|
14
14
|
"@angular/router": "^16.2.9",
|
|
15
|
-
"@coolon/pectin": "^5.0.0-alpha.
|
|
15
|
+
"@coolon/pectin": "^5.0.0-alpha.139",
|
|
16
16
|
"fast-typescript-memoize": "^1.1.1",
|
|
17
17
|
"lodash-es": "^4.17.21",
|
|
18
18
|
"marked": "4.0.10",
|