@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.
@@ -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
- doNavigation(visit: Visit, runNavigationCommands: (router: Router) => unknown): Promise<void>;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.326",
3
+ "version": "16.1.0-alpha.327",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",