@ng-atomic/common 19.26.0 → 19.27.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.
|
@@ -25,7 +25,7 @@ class NavigationHistoryService {
|
|
|
25
25
|
let replaceUrl = false;
|
|
26
26
|
this.router.events.subscribe(event => {
|
|
27
27
|
if (event instanceof NavigationStart) {
|
|
28
|
-
if (this.router.
|
|
28
|
+
if (this.router.currentNavigation()?.extras?.replaceUrl) {
|
|
29
29
|
replaceUrl = true;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-services-navigation-history.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/services/navigation-history/navigation-history.service.ts","../../../../../packages/@ng-atomic/common/src/lib/services/navigation-history/ng-atomic-common-services-navigation-history.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Injectable, PLATFORM_ID, computed, inject, signal } from '@angular/core';\nimport { NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { fromEvent } from 'rxjs';\n\n@Injectable({providedIn: 'root'})\nexport class NavigationHistoryService {\n private readonly platformId = inject(PLATFORM_ID);\n private readonly router = inject(Router);\n protected readonly history = signal<string[]>([]);\n readonly hasPrevHistory = computed(() => this.history().length > 1);\n readonly isInitial = computed(() => !this.hasPrevHistory());\n\n pop() {\n this.history.update(history => (history.pop(), [...history]));\n }\n\n push(url: string) {\n this.history.update(history => ([...history, url]));\n }\n\n replace(url: string) {\n this.history.update(history => (history.pop(), [...history, url]));\n }\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n fromEvent(window, 'popstate').subscribe(() => this.pop());\n let replaceUrl = false;\n this.router.events.subscribe(event => {\n if (event instanceof NavigationStart) {\n if (this.router.
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-services-navigation-history.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/services/navigation-history/navigation-history.service.ts","../../../../../packages/@ng-atomic/common/src/lib/services/navigation-history/ng-atomic-common-services-navigation-history.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Injectable, PLATFORM_ID, computed, inject, signal } from '@angular/core';\nimport { NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { fromEvent } from 'rxjs';\n\n@Injectable({providedIn: 'root'})\nexport class NavigationHistoryService {\n private readonly platformId = inject(PLATFORM_ID);\n private readonly router = inject(Router);\n protected readonly history = signal<string[]>([]);\n readonly hasPrevHistory = computed(() => this.history().length > 1);\n readonly isInitial = computed(() => !this.hasPrevHistory());\n\n pop() {\n this.history.update(history => (history.pop(), [...history]));\n }\n\n push(url: string) {\n this.history.update(history => ([...history, url]));\n }\n\n replace(url: string) {\n this.history.update(history => (history.pop(), [...history, url]));\n }\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n fromEvent(window, 'popstate').subscribe(() => this.pop());\n let replaceUrl = false;\n this.router.events.subscribe(event => {\n if (event instanceof NavigationStart) {\n if (this.router.currentNavigation()?.extras?.replaceUrl) {\n replaceUrl = true;\n }\n } else if (event instanceof NavigationEnd) {\n if (replaceUrl) {\n this.replace(event.url);\n replaceUrl = false;\n } else {\n this.push(event.url);\n }\n }\n });\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAMa,wBAAwB,CAAA;IAOnC,GAAG,GAAA;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAC/D;AAEA,IAAA,IAAI,CAAC,GAAW,EAAA;AACd,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD;AAEA,IAAA,OAAO,CAAC,GAAW,EAAA;QACjB,IAAI,CAAC,OAAO,CAAC,MAAM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K,CAAC,GAAG,CAAC;oBACtB;gBACF;AACF,YAAA,CAAC,CAAC;QACJ;IACF;8GAtCW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FAClB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;ACLhC;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-atomic/common",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.27.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@nx-ddd/core": "19.
|
|
7
|
-
"@nx-ddd/common": "19.
|
|
6
|
+
"@nx-ddd/core": "19.27.0",
|
|
7
|
+
"@nx-ddd/common": "19.27.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"tslib": "^2.3.0"
|