@mmstack/router-core 19.1.0 → 19.2.0
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/LICENSE +21 -21
- package/README.md +79 -79
- package/fesm2022/mmstack-router-core.mjs.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025-present Miha J. Mulec
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Miha J. Mulec
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
# @mmstack/
|
|
2
|
-
|
|
3
|
-
Core utilities and Signal-based primitives for enhancing development with `@angular/router`. This library provides helpers for common routing tasks and reactive integration with router state.
|
|
4
|
-
|
|
5
|
-
Part of the `@mmstack` ecosystem, designed to complement [@mmstack/primitives](https://www.npmjs.com/package/@mmstack/primitives).
|
|
6
|
-
|
|
7
|
-
[](https://badge.fury.io/js/%40mmstack%2Frouter-core)
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @mmstack/router-core
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Signal Utilities
|
|
16
|
-
|
|
17
|
-
This library includes helpers to interact with router state reactively using Angular Signals.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
### queryParam
|
|
22
|
-
|
|
23
|
-
Creates a WritableSignal that synchronizes with a specific URL query parameter, enabling two-way binding between the signal's state and the URL.
|
|
24
|
-
|
|
25
|
-
- Reading the signal returns the parameter's current value (string) or null if absent.
|
|
26
|
-
- Setting the signal to a string updates the URL parameter.
|
|
27
|
-
- Setting the signal to null removes the parameter from the URL.
|
|
28
|
-
- Reacts to external navigation changes affecting the parameter.
|
|
29
|
-
- Supports static or dynamic (function/signal) keys.
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
@Component({
|
|
33
|
-
selector: 'app-search-page',
|
|
34
|
-
standalone: true,
|
|
35
|
-
imports: [FormsModule],
|
|
36
|
-
template: `
|
|
37
|
-
<label>
|
|
38
|
-
Search:
|
|
39
|
-
<input [(ngModel)]="searchTerm" placeholder="Enter search term..." />
|
|
40
|
-
</label>
|
|
41
|
-
<button (click)="searchTerm.set(null)" [disabled]="!searchTerm()">Clear</button>
|
|
42
|
-
<p>Current search: {{ searchTerm() ?? 'None' }}</p>
|
|
43
|
-
`,
|
|
44
|
-
})
|
|
45
|
-
export class SearchPageComponent {
|
|
46
|
-
// Two-way bind the 'q' query parameter (?q=...)
|
|
47
|
-
protected readonly searchTerm = queryParam('q');
|
|
48
|
-
|
|
49
|
-
constructor() {
|
|
50
|
-
effect(() => {
|
|
51
|
-
const currentTerm = this.searchTerm();
|
|
52
|
-
console.log('Search term changed:', currentTerm);
|
|
53
|
-
// Trigger API call, update results, etc. based on currentTerm
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### url
|
|
60
|
-
|
|
61
|
-
Creates a read-only Signal that tracks the current router URL string.
|
|
62
|
-
|
|
63
|
-
- Updates after each successful navigation.
|
|
64
|
-
- Reflects the URL after any redirects (urlAfterRedirects).
|
|
65
|
-
- Initializes with the router's current URL synchronously.
|
|
66
|
-
|
|
67
|
-
```typescript
|
|
68
|
-
import { Component, effect } from '@angular/core';
|
|
69
|
-
import { url } from '@mmstack/router-core';
|
|
70
|
-
|
|
71
|
-
@Component({
|
|
72
|
-
selector: 'app-header',
|
|
73
|
-
standalone: true,
|
|
74
|
-
template: `<nav>Current Path: {{ currentUrl() }}</nav>`,
|
|
75
|
-
})
|
|
76
|
-
export class HeaderComponent {
|
|
77
|
-
protected readonly currentUrl = url();
|
|
78
|
-
}
|
|
79
|
-
```
|
|
1
|
+
# @mmstack/router-core
|
|
2
|
+
|
|
3
|
+
Core utilities and Signal-based primitives for enhancing development with `@angular/router`. This library provides helpers for common routing tasks and reactive integration with router state.
|
|
4
|
+
|
|
5
|
+
Part of the `@mmstack` ecosystem, designed to complement [@mmstack/primitives](https://www.npmjs.com/package/@mmstack/primitives).
|
|
6
|
+
|
|
7
|
+
[](https://badge.fury.io/js/%40mmstack%2Frouter-core)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @mmstack/router-core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signal Utilities
|
|
16
|
+
|
|
17
|
+
This library includes helpers to interact with router state reactively using Angular Signals.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
### queryParam
|
|
22
|
+
|
|
23
|
+
Creates a WritableSignal that synchronizes with a specific URL query parameter, enabling two-way binding between the signal's state and the URL.
|
|
24
|
+
|
|
25
|
+
- Reading the signal returns the parameter's current value (string) or null if absent.
|
|
26
|
+
- Setting the signal to a string updates the URL parameter.
|
|
27
|
+
- Setting the signal to null removes the parameter from the URL.
|
|
28
|
+
- Reacts to external navigation changes affecting the parameter.
|
|
29
|
+
- Supports static or dynamic (function/signal) keys.
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
@Component({
|
|
33
|
+
selector: 'app-search-page',
|
|
34
|
+
standalone: true,
|
|
35
|
+
imports: [FormsModule],
|
|
36
|
+
template: `
|
|
37
|
+
<label>
|
|
38
|
+
Search:
|
|
39
|
+
<input [(ngModel)]="searchTerm" placeholder="Enter search term..." />
|
|
40
|
+
</label>
|
|
41
|
+
<button (click)="searchTerm.set(null)" [disabled]="!searchTerm()">Clear</button>
|
|
42
|
+
<p>Current search: {{ searchTerm() ?? 'None' }}</p>
|
|
43
|
+
`,
|
|
44
|
+
})
|
|
45
|
+
export class SearchPageComponent {
|
|
46
|
+
// Two-way bind the 'q' query parameter (?q=...)
|
|
47
|
+
protected readonly searchTerm = queryParam('q');
|
|
48
|
+
|
|
49
|
+
constructor() {
|
|
50
|
+
effect(() => {
|
|
51
|
+
const currentTerm = this.searchTerm();
|
|
52
|
+
console.log('Search term changed:', currentTerm);
|
|
53
|
+
// Trigger API call, update results, etc. based on currentTerm
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### url
|
|
60
|
+
|
|
61
|
+
Creates a read-only Signal that tracks the current router URL string.
|
|
62
|
+
|
|
63
|
+
- Updates after each successful navigation.
|
|
64
|
+
- Reflects the URL after any redirects (urlAfterRedirects).
|
|
65
|
+
- Initializes with the router's current URL synchronously.
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { Component, effect } from '@angular/core';
|
|
69
|
+
import { url } from '@mmstack/router-core';
|
|
70
|
+
|
|
71
|
+
@Component({
|
|
72
|
+
selector: 'app-header',
|
|
73
|
+
standalone: true,
|
|
74
|
+
template: `<nav>Current Path: {{ currentUrl() }}</nav>`,
|
|
75
|
+
})
|
|
76
|
+
export class HeaderComponent {
|
|
77
|
+
protected readonly currentUrl = url();
|
|
78
|
+
}
|
|
79
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mmstack-router-core.mjs","sources":["../../../../../packages/router/core/src/lib/preloading/flat-routes.ts","../../../../../packages/router/core/src/lib/preloading/link.directive.ts","../../../../../packages/router/core/src/lib/query-param.ts","../../../../../packages/router/core/src/lib/url.ts","../../../../../packages/router/core/src/mmstack-router-core.ts"],"sourcesContent":["import { Route } from '@angular/router';\n\nexport function flattenRoutes(routes: Route[]): Route[] {\n return routes;\n}\n","import {\r\n booleanAttribute,\r\n DestroyRef,\r\n Directive,\r\n ElementRef,\r\n inject,\r\n Injectable,\r\n input,\r\n isDevMode,\r\n untracked,\r\n} from '@angular/core';\r\nimport {\r\n NoPreloading,\r\n PreloadAllModules,\r\n PreloadingStrategy,\r\n Route,\r\n Router,\r\n RouterLink,\r\n RouterLinkWithHref,\r\n RouterPreloader,\r\n type ActivatedRoute,\r\n type Params,\r\n type UrlTree,\r\n} from '@angular/router';\r\nimport { EMPTY, Observable } from 'rxjs';\r\nimport { flattenRoutes } from './flat-routes';\r\n\r\nexport function hasSlowConnection() {\r\n if (\r\n globalThis.window &&\r\n 'navigator' in globalThis.window &&\r\n 'connection' in globalThis.window.navigator &&\r\n typeof globalThis.window.navigator.connection === 'object' &&\r\n !!globalThis.window.navigator.connection &&\r\n 'effectiveType' in globalThis.window.navigator.connection &&\r\n typeof globalThis.window.navigator.connection.effectiveType === 'string'\r\n )\r\n return globalThis.window.navigator.connection.effectiveType.endsWith('2g');\r\n\r\n return false;\r\n}\r\n\r\nconst HAS_SLOW_CONNECTION = hasSlowConnection();\r\n\r\nfunction noPreload(route: Route) {\r\n return route.data && route.data['preload'] === false;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PreloadLinkStrategy implements PreloadingStrategy {\r\n private readonly routeMap = flattenRoutes(inject(Router).config);\r\n preload(route: Route, _: () => Observable<any>): Observable<any> {\r\n if (HAS_SLOW_CONNECTION || noPreload(route)) return EMPTY;\r\n return EMPTY;\r\n }\r\n}\r\n\r\nfunction observerSupported() {\r\n return typeof IntersectionObserver !== 'undefined';\r\n}\r\n\r\nfunction injectPreloader(): RouterPreloader | null {\r\n const strategy = inject(PreloadingStrategy, {\r\n optional: true,\r\n });\r\n\r\n if (\r\n !strategy ||\r\n strategy instanceof NoPreloading ||\r\n strategy instanceof PreloadAllModules\r\n )\r\n return null;\r\n\r\n return inject(RouterPreloader, {\r\n optional: true,\r\n });\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class VisibleLinkHandler {\r\n private readonly map = new WeakMap<Element, () => void>();\r\n private readonly observer: IntersectionObserver | null = observerSupported()\r\n ? new IntersectionObserver((entries) => {\r\n entries.forEach((entry) => {\r\n if (!entry.isIntersecting) return;\r\n this.map.get(entry.target)?.();\r\n this.observer?.unobserve(entry.target);\r\n });\r\n })\r\n : null;\r\n\r\n register(el: Element, onVisible: () => void) {\r\n if (!this.observer)\r\n return () => {\r\n // noop\r\n };\r\n\r\n this.map.set(el, onVisible);\r\n this.observer.observe(el);\r\n\r\n return () => {\r\n this.map.delete(el);\r\n this.observer?.unobserve(el);\r\n };\r\n }\r\n}\r\n\r\n@Directive({\r\n selector: '[mmLink]',\r\n exportAs: 'mmLink',\r\n host: {\r\n '(mouseenter)': 'onHover()',\r\n },\r\n hostDirectives: [\r\n {\r\n directive: RouterLink,\r\n inputs: [\r\n 'routerLink: mmLink',\r\n 'target',\r\n 'queryParams',\r\n 'fragment',\r\n 'queryParamsHandling',\r\n 'state',\r\n 'relativeTo',\r\n 'skipLocationChange',\r\n 'replaceUrl',\r\n ],\r\n },\r\n ],\r\n})\r\nexport class LinkDirective {\r\n private readonly routerLink =\r\n inject(RouterLink, {\r\n self: true,\r\n optional: true,\r\n }) ?? inject(RouterLinkWithHref, { self: true, optional: true });\r\n\r\n private readonly preloader = injectPreloader();\r\n readonly target = input<string>();\r\n readonly queryParams = input<Params>();\r\n readonly fragment = input<string>();\r\n readonly queryParamsHandling = input<'merge' | 'preserve' | ''>();\r\n readonly state = input<Record<string, any>>();\r\n readonly info = input<unknown>();\r\n readonly relativeTo = input<ActivatedRoute>();\r\n readonly skipLocationChange = input(false, { transform: booleanAttribute });\r\n readonly replaceUrl = input(false, { transform: booleanAttribute });\r\n readonly mmLink = input.required<string | any[] | UrlTree>();\r\n readonly preloadOn = input<null | 'hover' | 'visible'>(null);\r\n\r\n protected onHover() {\r\n if (untracked(this.preloadOn) !== 'hover') return;\r\n if (!this.preloader) {\r\n if (isDevMode())\r\n console.error(\r\n 'Preloader not available, please configure a preloading strategy',\r\n );\r\n return;\r\n }\r\n\r\n this.preloader?.preload().subscribe();\r\n }\r\n\r\n protected onVisible() {\r\n if (untracked(this.preloadOn) !== 'visible') return;\r\n if (!this.preloader) {\r\n if (isDevMode())\r\n console.error(\r\n 'Preloader not available, please configure a preloading strategy',\r\n );\r\n return;\r\n }\r\n }\r\n\r\n constructor() {\r\n const el = inject<ElementRef<HTMLElement>>(ElementRef, {\r\n self: true,\r\n });\r\n const unsub = inject(VisibleLinkHandler).register(\r\n el.nativeElement,\r\n (() => {\r\n this.onVisible();\r\n }).bind(this),\r\n );\r\n\r\n inject(DestroyRef).onDestroy(() => unsub());\r\n }\r\n\r\n onClick(\r\n button: number,\r\n ctrlKey: boolean,\r\n shiftKey: boolean,\r\n altKey: boolean,\r\n metaKey: boolean,\r\n ) {\r\n return this.routerLink?.onClick(button, ctrlKey, shiftKey, altKey, metaKey);\r\n }\r\n}\r\n","import {\n computed,\n inject,\n isSignal,\n untracked,\n type WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { toWritable } from '@mmstack/primitives';\n\n/**\n * Creates a WritableSignal that synchronizes with a specific URL query parameter,\n * enabling two-way binding between the signal's state and the URL.\n *\n * Reading the signal provides the current value of the query parameter (or null if absent).\n * Setting the signal updates the URL query parameter using `Router.navigate`, triggering\n * navigation and causing the signal to update reactively if the navigation is successful.\n *\n * @param key The key of the query parameter to synchronize with.\n * Can be a static string (e.g., `'search'`) or a function/signal returning a string\n * for dynamic keys (e.g., `() => this.userId() + '_filter'` or `computed(() => this.category() + '_sort')`).\n * The signal will reactively update if the key returned by the function/signal changes.\n * @returns {WritableSignal<string | null>} A signal representing the query parameter's value.\n * - Reading returns the current value string, or `null` if the parameter is absent in the URL.\n * - Setting the signal to a string updates the query parameter in the URL (e.g., `signal.set('value')` results in `?key=value`).\n * - Setting the signal to `null` removes the query parameter from the URL (e.g., `signal.set(null)` results in `?otherParam=...`).\n * - Automatically reflects changes if the query parameters update due to external navigation.\n * @remarks\n * - Requires Angular's `ActivatedRoute` and `Router` to be available in the injection context.\n * - Uses `Router.navigate` with `queryParamsHandling: 'merge'` to preserve other existing query parameters during updates.\n * - Handles dynamic keys reactively. If the result of the `key` function/signal changes, the signal will start reflecting the value of the *new* query parameter key.\n * - During Server-Side Rendering (SSR), it reads the initial value from the route snapshot. Write operations (`set`) might have limited or no effect on the server depending on the platform configuration.\n *\n * @example\n * ```ts\n * import { Component, computed, effect, signal } from '@angular/core';\n * import { queryParam } from '@mmstack/router-core'; // Adjust import path as needed\n * // import { FormsModule } from '@angular/forms'; // If using ngModel\n *\n * @Component({\n * selector: 'app-product-list',\n * standalone: true,\n * // imports: [FormsModule], // If using ngModel\n * template: `\n * <div>\n * Sort By:\n * <select [value]=\"sortSignal() ?? ''\" (change)=\"sortSignal.set($any($event.target).value || null)\">\n * <option value=\"\">Default</option>\n * <option value=\"price_asc\">Price Asc</option>\n * <option value=\"price_desc\">Price Desc</option>\n * <option value=\"name\">Name</option>\n * </select>\n * <button (click)=\"sortSignal.set(null)\" [disabled]=\"!sortSignal()\">Clear Sort</button>\n * </div>\n * <div>\n * Page:\n * <input type=\"number\" min=\"1\" [value]=\"pageSignal() ?? '1'\" #p (input)=\"setPage(p.value)\"/>\n * </div>\n * * `\n * })\n * export class ProductListComponent {\n * // Two-way bind the 'sort' query parameter (?sort=...)\n * // Defaults to null if param is missing\n * sortSignal = queryParam('sort');\n *\n * // Example with a different type (needs serialization or separate logic)\n * // For simplicity, we treat page as string | null here\n * pageSignal = queryParam('page');\n *\n * constructor() {\n * effect(() => {\n * const currentSort = this.sortSignal();\n * const currentPage = this.pageSignal(); // Read as string | null\n * console.log('Sort/Page changed, reloading products for:', { sort: currentSort, page: currentPage });\n * // --- Fetch data based on currentSort and currentPage ---\n * });\n * }\n *\n * setPage(value: string): void {\n * const pageNum = parseInt(value, 10);\n * // Set to null if page is 1 (to remove param), otherwise set string value\n * this.pageSignal.set(isNaN(pageNum) || pageNum <= 1 ? null : pageNum.toString());\n * }\n * }\n * ```\n */\nexport function queryParam(\n key: string | (() => string),\n): WritableSignal<string | null> {\n const route = inject(ActivatedRoute);\n const router = inject(Router);\n\n const keySignal =\n typeof key === 'string'\n ? computed(() => key)\n : isSignal(key)\n ? key\n : computed(key);\n\n const queryParamMap = toSignal(route.queryParamMap, {\n initialValue: route.snapshot.queryParamMap,\n });\n\n const queryParams = toSignal(route.queryParams, {\n initialValue: route.snapshot.queryParams,\n });\n\n const queryParam = computed(() => queryParamMap().get(keySignal()));\n\n const set = (newValue: string | null) => {\n const next = {\n ...untracked(queryParams),\n };\n const key = untracked(keySignal);\n\n if (newValue === null) {\n delete next[key];\n } else {\n next[key] = newValue;\n }\n\n router.navigate([], {\n relativeTo: route,\n queryParams: next,\n queryParamsHandling: 'merge',\n });\n };\n\n return toWritable(queryParam, set);\n}\n","import { inject, type Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport {\n type Event,\n EventType,\n type NavigationEnd,\n Router,\n} from '@angular/router';\nimport { filter, map } from 'rxjs/operators';\n\n/**\n * Type guard to check if a Router Event is a NavigationEnd event.\n * @internal\n */\nfunction isNavigationEnd(e: Event): e is NavigationEnd {\n return 'type' in e && e.type === EventType.NavigationEnd;\n}\n\n/**\n * Creates a Signal that tracks the current router URL.\n *\n * The signal emits the URL string reflecting the router state *after* redirects\n * have completed for each successful navigation. It initializes with the router's\n * current URL state.\n *\n * @returns {Signal<string>} A Signal emitting the `urlAfterRedirects` upon successful navigation.\n *\n * @example\n * ```ts\n * import { Component, effect } from '@angular/core';\n * import { url } from '@mmstack/router-core'; // Adjust import path\n *\n * @Component({\n * selector: 'app-root',\n * template: `Current URL: {{ currentUrl() }}`\n * })\n * export class AppComponent {\n * currentUrl = url();\n *\n * constructor() {\n * effect(() => {\n * console.log('Navigation ended. New URL:', this.currentUrl());\n * // e.g., track page view with analytics\n * });\n * }\n * }\n * ```\n */\nexport function url(): Signal<string> {\n const router = inject(Router);\n\n return toSignal(\n router.events.pipe(\n filter(isNavigationEnd),\n map((e) => e.urlAfterRedirects),\n ),\n {\n initialValue: router.url,\n },\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEM,SAAU,aAAa,CAAC,MAAe,EAAA;AAC3C,IAAA,OAAO,MAAM;AACf;;SCuBgB,iBAAiB,GAAA;IAC/B,IACE,UAAU,CAAC,MAAM;QACjB,WAAW,IAAI,UAAU,CAAC,MAAM;AAChC,QAAA,YAAY,IAAI,UAAU,CAAC,MAAM,CAAC,SAAS;QAC3C,OAAO,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,KAAK,QAAQ;AAC1D,QAAA,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU;AACxC,QAAA,eAAe,IAAI,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU;QACzD,OAAO,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,KAAK,QAAQ;AAExE,QAAA,OAAO,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC;AAE5E,IAAA,OAAO,KAAK;AACd;AAEA,MAAM,mBAAmB,GAAG,iBAAiB,EAAE;AAE/C,SAAS,SAAS,CAAC,KAAY,EAAA;AAC7B,IAAA,OAAO,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,KAAK;AACtD;MAKa,mBAAmB,CAAA;IACb,QAAQ,GAAG,aAAa,CAAC,MAAM,C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CAChC,EACD;QACE,YAAY,EAAE,MAAM,CAAC,GAAG;AACzB,KAAA,CACF;AACH;;AC5DA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mmstack-router-core.mjs","sources":["../../../../../packages/router/core/src/lib/preloading/flat-routes.ts","../../../../../packages/router/core/src/lib/preloading/link.directive.ts","../../../../../packages/router/core/src/lib/query-param.ts","../../../../../packages/router/core/src/lib/url.ts","../../../../../packages/router/core/src/mmstack-router-core.ts"],"sourcesContent":["import { Route } from '@angular/router';\r\n\r\nexport function flattenRoutes(routes: Route[]): Route[] {\r\n return routes;\r\n}\r\n","import {\r\n booleanAttribute,\r\n DestroyRef,\r\n Directive,\r\n ElementRef,\r\n inject,\r\n Injectable,\r\n input,\r\n isDevMode,\r\n untracked,\r\n} from '@angular/core';\r\nimport {\r\n NoPreloading,\r\n PreloadAllModules,\r\n PreloadingStrategy,\r\n Route,\r\n Router,\r\n RouterLink,\r\n RouterLinkWithHref,\r\n RouterPreloader,\r\n type ActivatedRoute,\r\n type Params,\r\n type UrlTree,\r\n} from '@angular/router';\r\nimport { EMPTY, Observable } from 'rxjs';\r\nimport { flattenRoutes } from './flat-routes';\r\n\r\nexport function hasSlowConnection() {\r\n if (\r\n globalThis.window &&\r\n 'navigator' in globalThis.window &&\r\n 'connection' in globalThis.window.navigator &&\r\n typeof globalThis.window.navigator.connection === 'object' &&\r\n !!globalThis.window.navigator.connection &&\r\n 'effectiveType' in globalThis.window.navigator.connection &&\r\n typeof globalThis.window.navigator.connection.effectiveType === 'string'\r\n )\r\n return globalThis.window.navigator.connection.effectiveType.endsWith('2g');\r\n\r\n return false;\r\n}\r\n\r\nconst HAS_SLOW_CONNECTION = hasSlowConnection();\r\n\r\nfunction noPreload(route: Route) {\r\n return route.data && route.data['preload'] === false;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PreloadLinkStrategy implements PreloadingStrategy {\r\n private readonly routeMap = flattenRoutes(inject(Router).config);\r\n preload(route: Route, _: () => Observable<any>): Observable<any> {\r\n if (HAS_SLOW_CONNECTION || noPreload(route)) return EMPTY;\r\n return EMPTY;\r\n }\r\n}\r\n\r\nfunction observerSupported() {\r\n return typeof IntersectionObserver !== 'undefined';\r\n}\r\n\r\nfunction injectPreloader(): RouterPreloader | null {\r\n const strategy = inject(PreloadingStrategy, {\r\n optional: true,\r\n });\r\n\r\n if (\r\n !strategy ||\r\n strategy instanceof NoPreloading ||\r\n strategy instanceof PreloadAllModules\r\n )\r\n return null;\r\n\r\n return inject(RouterPreloader, {\r\n optional: true,\r\n });\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class VisibleLinkHandler {\r\n private readonly map = new WeakMap<Element, () => void>();\r\n private readonly observer: IntersectionObserver | null = observerSupported()\r\n ? new IntersectionObserver((entries) => {\r\n entries.forEach((entry) => {\r\n if (!entry.isIntersecting) return;\r\n this.map.get(entry.target)?.();\r\n this.observer?.unobserve(entry.target);\r\n });\r\n })\r\n : null;\r\n\r\n register(el: Element, onVisible: () => void) {\r\n if (!this.observer)\r\n return () => {\r\n // noop\r\n };\r\n\r\n this.map.set(el, onVisible);\r\n this.observer.observe(el);\r\n\r\n return () => {\r\n this.map.delete(el);\r\n this.observer?.unobserve(el);\r\n };\r\n }\r\n}\r\n\r\n@Directive({\r\n selector: '[mmLink]',\r\n exportAs: 'mmLink',\r\n host: {\r\n '(mouseenter)': 'onHover()',\r\n },\r\n hostDirectives: [\r\n {\r\n directive: RouterLink,\r\n inputs: [\r\n 'routerLink: mmLink',\r\n 'target',\r\n 'queryParams',\r\n 'fragment',\r\n 'queryParamsHandling',\r\n 'state',\r\n 'relativeTo',\r\n 'skipLocationChange',\r\n 'replaceUrl',\r\n ],\r\n },\r\n ],\r\n})\r\nexport class LinkDirective {\r\n private readonly routerLink =\r\n inject(RouterLink, {\r\n self: true,\r\n optional: true,\r\n }) ?? inject(RouterLinkWithHref, { self: true, optional: true });\r\n\r\n private readonly preloader = injectPreloader();\r\n readonly target = input<string>();\r\n readonly queryParams = input<Params>();\r\n readonly fragment = input<string>();\r\n readonly queryParamsHandling = input<'merge' | 'preserve' | ''>();\r\n readonly state = input<Record<string, any>>();\r\n readonly info = input<unknown>();\r\n readonly relativeTo = input<ActivatedRoute>();\r\n readonly skipLocationChange = input(false, { transform: booleanAttribute });\r\n readonly replaceUrl = input(false, { transform: booleanAttribute });\r\n readonly mmLink = input.required<string | any[] | UrlTree>();\r\n readonly preloadOn = input<null | 'hover' | 'visible'>(null);\r\n\r\n protected onHover() {\r\n if (untracked(this.preloadOn) !== 'hover') return;\r\n if (!this.preloader) {\r\n if (isDevMode())\r\n console.error(\r\n 'Preloader not available, please configure a preloading strategy',\r\n );\r\n return;\r\n }\r\n\r\n this.preloader?.preload().subscribe();\r\n }\r\n\r\n protected onVisible() {\r\n if (untracked(this.preloadOn) !== 'visible') return;\r\n if (!this.preloader) {\r\n if (isDevMode())\r\n console.error(\r\n 'Preloader not available, please configure a preloading strategy',\r\n );\r\n return;\r\n }\r\n }\r\n\r\n constructor() {\r\n const el = inject<ElementRef<HTMLElement>>(ElementRef, {\r\n self: true,\r\n });\r\n const unsub = inject(VisibleLinkHandler).register(\r\n el.nativeElement,\r\n (() => {\r\n this.onVisible();\r\n }).bind(this),\r\n );\r\n\r\n inject(DestroyRef).onDestroy(() => unsub());\r\n }\r\n\r\n onClick(\r\n button: number,\r\n ctrlKey: boolean,\r\n shiftKey: boolean,\r\n altKey: boolean,\r\n metaKey: boolean,\r\n ) {\r\n return this.routerLink?.onClick(button, ctrlKey, shiftKey, altKey, metaKey);\r\n }\r\n}\r\n","import {\r\n computed,\r\n inject,\r\n isSignal,\r\n untracked,\r\n type WritableSignal,\r\n} from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { toWritable } from '@mmstack/primitives';\r\n\r\n/**\r\n * Creates a WritableSignal that synchronizes with a specific URL query parameter,\r\n * enabling two-way binding between the signal's state and the URL.\r\n *\r\n * Reading the signal provides the current value of the query parameter (or null if absent).\r\n * Setting the signal updates the URL query parameter using `Router.navigate`, triggering\r\n * navigation and causing the signal to update reactively if the navigation is successful.\r\n *\r\n * @param key The key of the query parameter to synchronize with.\r\n * Can be a static string (e.g., `'search'`) or a function/signal returning a string\r\n * for dynamic keys (e.g., `() => this.userId() + '_filter'` or `computed(() => this.category() + '_sort')`).\r\n * The signal will reactively update if the key returned by the function/signal changes.\r\n * @returns {WritableSignal<string | null>} A signal representing the query parameter's value.\r\n * - Reading returns the current value string, or `null` if the parameter is absent in the URL.\r\n * - Setting the signal to a string updates the query parameter in the URL (e.g., `signal.set('value')` results in `?key=value`).\r\n * - Setting the signal to `null` removes the query parameter from the URL (e.g., `signal.set(null)` results in `?otherParam=...`).\r\n * - Automatically reflects changes if the query parameters update due to external navigation.\r\n * @remarks\r\n * - Requires Angular's `ActivatedRoute` and `Router` to be available in the injection context.\r\n * - Uses `Router.navigate` with `queryParamsHandling: 'merge'` to preserve other existing query parameters during updates.\r\n * - Handles dynamic keys reactively. If the result of the `key` function/signal changes, the signal will start reflecting the value of the *new* query parameter key.\r\n * - During Server-Side Rendering (SSR), it reads the initial value from the route snapshot. Write operations (`set`) might have limited or no effect on the server depending on the platform configuration.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Component, computed, effect, signal } from '@angular/core';\r\n * import { queryParam } from '@mmstack/router-core'; // Adjust import path as needed\r\n * // import { FormsModule } from '@angular/forms'; // If using ngModel\r\n *\r\n * @Component({\r\n * selector: 'app-product-list',\r\n * standalone: true,\r\n * // imports: [FormsModule], // If using ngModel\r\n * template: `\r\n * <div>\r\n * Sort By:\r\n * <select [value]=\"sortSignal() ?? ''\" (change)=\"sortSignal.set($any($event.target).value || null)\">\r\n * <option value=\"\">Default</option>\r\n * <option value=\"price_asc\">Price Asc</option>\r\n * <option value=\"price_desc\">Price Desc</option>\r\n * <option value=\"name\">Name</option>\r\n * </select>\r\n * <button (click)=\"sortSignal.set(null)\" [disabled]=\"!sortSignal()\">Clear Sort</button>\r\n * </div>\r\n * <div>\r\n * Page:\r\n * <input type=\"number\" min=\"1\" [value]=\"pageSignal() ?? '1'\" #p (input)=\"setPage(p.value)\"/>\r\n * </div>\r\n * * `\r\n * })\r\n * export class ProductListComponent {\r\n * // Two-way bind the 'sort' query parameter (?sort=...)\r\n * // Defaults to null if param is missing\r\n * sortSignal = queryParam('sort');\r\n *\r\n * // Example with a different type (needs serialization or separate logic)\r\n * // For simplicity, we treat page as string | null here\r\n * pageSignal = queryParam('page');\r\n *\r\n * constructor() {\r\n * effect(() => {\r\n * const currentSort = this.sortSignal();\r\n * const currentPage = this.pageSignal(); // Read as string | null\r\n * console.log('Sort/Page changed, reloading products for:', { sort: currentSort, page: currentPage });\r\n * // --- Fetch data based on currentSort and currentPage ---\r\n * });\r\n * }\r\n *\r\n * setPage(value: string): void {\r\n * const pageNum = parseInt(value, 10);\r\n * // Set to null if page is 1 (to remove param), otherwise set string value\r\n * this.pageSignal.set(isNaN(pageNum) || pageNum <= 1 ? null : pageNum.toString());\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport function queryParam(\r\n key: string | (() => string),\r\n): WritableSignal<string | null> {\r\n const route = inject(ActivatedRoute);\r\n const router = inject(Router);\r\n\r\n const keySignal =\r\n typeof key === 'string'\r\n ? computed(() => key)\r\n : isSignal(key)\r\n ? key\r\n : computed(key);\r\n\r\n const queryParamMap = toSignal(route.queryParamMap, {\r\n initialValue: route.snapshot.queryParamMap,\r\n });\r\n\r\n const queryParams = toSignal(route.queryParams, {\r\n initialValue: route.snapshot.queryParams,\r\n });\r\n\r\n const queryParam = computed(() => queryParamMap().get(keySignal()));\r\n\r\n const set = (newValue: string | null) => {\r\n const next = {\r\n ...untracked(queryParams),\r\n };\r\n const key = untracked(keySignal);\r\n\r\n if (newValue === null) {\r\n delete next[key];\r\n } else {\r\n next[key] = newValue;\r\n }\r\n\r\n router.navigate([], {\r\n relativeTo: route,\r\n queryParams: next,\r\n queryParamsHandling: 'merge',\r\n });\r\n };\r\n\r\n return toWritable(queryParam, set);\r\n}\r\n","import { inject, type Signal } from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport {\r\n type Event,\r\n EventType,\r\n type NavigationEnd,\r\n Router,\r\n} from '@angular/router';\r\nimport { filter, map } from 'rxjs/operators';\r\n\r\n/**\r\n * Type guard to check if a Router Event is a NavigationEnd event.\r\n * @internal\r\n */\r\nfunction isNavigationEnd(e: Event): e is NavigationEnd {\r\n return 'type' in e && e.type === EventType.NavigationEnd;\r\n}\r\n\r\n/**\r\n * Creates a Signal that tracks the current router URL.\r\n *\r\n * The signal emits the URL string reflecting the router state *after* redirects\r\n * have completed for each successful navigation. It initializes with the router's\r\n * current URL state.\r\n *\r\n * @returns {Signal<string>} A Signal emitting the `urlAfterRedirects` upon successful navigation.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Component, effect } from '@angular/core';\r\n * import { url } from '@mmstack/router-core'; // Adjust import path\r\n *\r\n * @Component({\r\n * selector: 'app-root',\r\n * template: `Current URL: {{ currentUrl() }}`\r\n * })\r\n * export class AppComponent {\r\n * currentUrl = url();\r\n *\r\n * constructor() {\r\n * effect(() => {\r\n * console.log('Navigation ended. New URL:', this.currentUrl());\r\n * // e.g., track page view with analytics\r\n * });\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport function url(): Signal<string> {\r\n const router = inject(Router);\r\n\r\n return toSignal(\r\n router.events.pipe(\r\n filter(isNavigationEnd),\r\n map((e) => e.urlAfterRedirects),\r\n ),\r\n {\r\n initialValue: router.url,\r\n },\r\n );\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEM,SAAU,aAAa,CAAC,MAAe,EAAA;AAC3C,IAAA,OAAO,MAAM;AACf;;SCuBgB,iBAAiB,GAAA;IAC/B,IACE,UAAU,CAAC,MAAM;QACjB,WAAW,IAAI,UAAU,CA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CAAC,GAAG,CAAC;;aACX;AACL,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ;;AAGtB,QAAA,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE;AAClB,YAAA,UAAU,EAAE,KAAK;AACjB,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,mBAAmB,EAAE,OAAO;AAC7B,SAAA,CAAC;AACJ,KAAC;AAED,IAAA,OAAO,UAAU,CAAC,UAAU,EAAE,GAAG,CAAC;AACpC;;ACxHA;;;AAGG;AACH,SAAS,eAAe,CAAC,CAAQ,EAAA;IAC/B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,aAAa;AAC1D;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;SACa,GAAG,GAAA;AACjB,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE7B,OAAO,QAAQ,CACb,MAAM,CAAC,MAAM,CAAC,IAAI,CAChB,MAAM,CAAC,eAAe,CAAC,EACvB,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAChC,EACD;QACE,YAAY,EAAE,MAAM,CAAC,GAAG;AACzB,KAAA,CACF;AACH;;AC5DA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmstack/router-core",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"angular",
|
|
6
6
|
"signals",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/mihajm/mmstack/blob/master/packages/router/core",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@mmstack/primitives": "^19.1
|
|
19
|
+
"@mmstack/primitives": "^19.2.1",
|
|
20
20
|
"tslib": "^2.3.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|