@trismegisto/spine 3.2.0 → 3.3.1
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/README.md +19 -11
- package/fesm2022/trismegisto-spine-audit.mjs +16 -12
- package/fesm2022/trismegisto-spine-audit.mjs.map +1 -1
- package/fesm2022/{trismegisto-spine-auto-service-apps.usage-po9Ds_SU.mjs → trismegisto-spine-auto-service-apps.usage-C0F_MlCo.mjs} +3 -3
- package/fesm2022/{trismegisto-spine-auto-service-apps.usage-po9Ds_SU.mjs.map → trismegisto-spine-auto-service-apps.usage-C0F_MlCo.mjs.map} +1 -1
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-tfGcVR3i.mjs → trismegisto-spine-auto-service-auto-service-audit.component-D8HUpZtA.mjs} +4 -4
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-tfGcVR3i.mjs.map → trismegisto-spine-auto-service-auto-service-audit.component-D8HUpZtA.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-NawbfdLW.mjs +65 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-NawbfdLW.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-client.component-DzmlpLPu.mjs → trismegisto-spine-auto-service-auto-service-client.component-BAfeLyTB.mjs} +32 -19
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-BAfeLyTB.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-BYjIQ9ID.mjs +635 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-BYjIQ9ID.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-login-attempts.component-CRvxfSWD.mjs → trismegisto-spine-auto-service-auto-service-login-attempts.component-DoyhkSYc.mjs} +4 -4
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-login-attempts.component-CRvxfSWD.mjs.map → trismegisto-spine-auto-service-auto-service-login-attempts.component-DoyhkSYc.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-news-page.component-CBemH4hr.mjs +432 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-news-page.component-CBemH4hr.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-ratings-page.component-C_THGTkw.mjs +769 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-ratings-page.component-C_THGTkw.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-suggestions-page.component-DIeunpQ9.mjs +2123 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-suggestions-page.component-DIeunpQ9.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service.component-C4FBAefe.mjs → trismegisto-spine-auto-service-auto-service.component-QsIQ61w2.mjs} +36 -23
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-QsIQ61w2.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-client.usage-B16r3IHk.mjs → trismegisto-spine-auto-service-client.usage-CJxn9Ysz.mjs} +7 -4
- package/fesm2022/trismegisto-spine-auto-service-client.usage-CJxn9Ysz.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-groups.technical-9aPPulhy.mjs → trismegisto-spine-auto-service-groups.technical-_jQrg1Qh.mjs} +7 -5
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-_jQrg1Qh.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-groups.usage-CYh61LFL.mjs → trismegisto-spine-auto-service-groups.usage-OvWjNeeT.mjs} +7 -6
- package/fesm2022/{trismegisto-spine-auto-service-groups.usage-CYh61LFL.mjs.map → trismegisto-spine-auto-service-groups.usage-OvWjNeeT.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-home.component-rQ3dIGIE.mjs +315 -0
- package/fesm2022/trismegisto-spine-auto-service-home.component-rQ3dIGIE.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-home.technical-Ce7oYRdg.mjs +46 -0
- package/fesm2022/trismegisto-spine-auto-service-home.technical-Ce7oYRdg.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-home.usage-D9R_ZMuU.mjs +48 -0
- package/fesm2022/trismegisto-spine-auto-service-home.usage-D9R_ZMuU.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-news.technical-DV9UpobG.mjs +38 -0
- package/fesm2022/trismegisto-spine-auto-service-news.technical-DV9UpobG.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-news.usage-CeuZnG0V.mjs +48 -0
- package/fesm2022/trismegisto-spine-auto-service-news.usage-CeuZnG0V.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.technical-QIVj6HBU.mjs +52 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.technical-QIVj6HBU.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.usage-BkteY8lz.mjs +45 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.usage-BkteY8lz.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.technical-BtUK6sKD.mjs +69 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.technical-BtUK6sKD.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.usage-BwO9Hjsx.mjs +72 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.usage-BwO9Hjsx.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service.mjs +50 -20
- package/fesm2022/trismegisto-spine-auto-service.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-graphql.mjs +11 -2
- package/fesm2022/trismegisto-spine-graphql.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-layout.mjs +3171 -1291
- package/fesm2022/trismegisto-spine-layout.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-modal.mjs +7 -5
- package/fesm2022/trismegisto-spine-modal.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-notification.mjs +27 -24
- package/fesm2022/trismegisto-spine-notification.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-routing.mjs +12 -20
- package/fesm2022/trismegisto-spine-routing.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-shell.mjs +20 -45
- package/fesm2022/trismegisto-spine-shell.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-side-panel.mjs +7 -5
- package/fesm2022/trismegisto-spine-side-panel.mjs.map +1 -1
- package/fesm2022/trismegisto-spine.mjs +1972 -282
- package/fesm2022/trismegisto-spine.mjs.map +1 -1
- package/package.json +6 -6
- package/types/trismegisto-spine-audit.d.ts +2 -12
- package/types/trismegisto-spine-audit.d.ts.map +1 -1
- package/types/trismegisto-spine-auto-service.d.ts +22 -5
- package/types/trismegisto-spine-auto-service.d.ts.map +1 -1
- package/types/trismegisto-spine-layout.d.ts +1090 -286
- package/types/trismegisto-spine-layout.d.ts.map +1 -1
- package/types/trismegisto-spine-modal.d.ts +1 -0
- package/types/trismegisto-spine-modal.d.ts.map +1 -1
- package/types/trismegisto-spine-notification.d.ts +13 -12
- package/types/trismegisto-spine-notification.d.ts.map +1 -1
- package/types/trismegisto-spine-routing.d.ts +3 -12
- package/types/trismegisto-spine-routing.d.ts.map +1 -1
- package/types/trismegisto-spine-shell.d.ts +2 -15
- package/types/trismegisto-spine-shell.d.ts.map +1 -1
- package/types/trismegisto-spine-side-panel.d.ts +1 -0
- package/types/trismegisto-spine-side-panel.d.ts.map +1 -1
- package/types/trismegisto-spine.d.ts +739 -165
- package/types/trismegisto-spine.d.ts.map +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs +0 -65
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-DzmlpLPu.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-D6L0gTmd.mjs +0 -605
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-D6L0gTmd.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-C4FBAefe.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-client.usage-B16r3IHk.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-9aPPulhy.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.component-5_aji1hf.mjs +0 -239
- package/fesm2022/trismegisto-spine-auto-service-home.component-5_aji1hf.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.technical-BrVhcgDO.mjs +0 -35
- package/fesm2022/trismegisto-spine-auto-service-home.technical-BrVhcgDO.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.usage-D6cb4B3Z.mjs +0 -43
- package/fesm2022/trismegisto-spine-auto-service-home.usage-D6cb4B3Z.mjs.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ViewContainerRef, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { Injectable, inject, DestroyRef, ViewContainerRef, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { HermesLoadingState, HERMES_MESSAGES, ModalComponent as ModalComponent$1, ButtonComponent } from '@trismegisto/angular';
|
|
4
4
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
5
5
|
import { take } from 'rxjs/operators';
|
|
6
6
|
import * as i2 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
9
|
|
|
9
10
|
class ModalService {
|
|
10
11
|
constructor() {
|
|
@@ -78,9 +79,10 @@ class ModalComponent {
|
|
|
78
79
|
this.HermesLoadingState = HermesLoadingState;
|
|
79
80
|
this.toHermesSize = toHermesSize;
|
|
80
81
|
this.contentRef = null;
|
|
82
|
+
this.destroyRef = inject(DestroyRef);
|
|
81
83
|
}
|
|
82
84
|
ngOnInit() {
|
|
83
|
-
this.modalService.visible$.subscribe((visible) => {
|
|
85
|
+
this.modalService.visible$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((visible) => {
|
|
84
86
|
this.visible = visible;
|
|
85
87
|
this.config = this.modalService.config;
|
|
86
88
|
if (visible) {
|
|
@@ -92,7 +94,7 @@ class ModalComponent {
|
|
|
92
94
|
}
|
|
93
95
|
this.cdr.markForCheck();
|
|
94
96
|
});
|
|
95
|
-
this.modalService.state$.subscribe((state) => {
|
|
97
|
+
this.modalService.state$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((state) => {
|
|
96
98
|
this.state = state;
|
|
97
99
|
this.cdr.markForCheck();
|
|
98
100
|
});
|
|
@@ -123,11 +125,11 @@ class ModalComponent {
|
|
|
123
125
|
this.modalService.setState(state);
|
|
124
126
|
}
|
|
125
127
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ModalComponent, deps: [{ token: ModalService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
126
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: ModalComponent, isStandalone: true, selector: "spine-modal", viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<hm-modal\n [open]=\"visible\"\n [heading]=\"config?.title || ''\"\n [size]=\"toHermesSize(config?.size)\"\n [closable]=\"config?.closable ?? true\"\n (closed)=\"dismiss()\"\n>\n <ng-container #content />\n <div *ngIf=\"config?.text && !config?.component\">{{ config?.text }}</div>\n\n <ng-container footer *ngIf=\"config?.showActions !== false\">\n <hm-button emphasis=\"medium\" (clicked)=\"dismiss()\">{{ dialogText.cancel }}</hm-button>\n <hm-button\n intent=\"success\"\n [disabled]=\"!canConfirm\"\n [loadingState]=\"state\"\n (loadingStateChange)=\"onLoadingStateChange($event)\"\n (clicked)=\"confirm()\"\n >{{ dialogText.confirm }}</hm-button>\n </ng-container>\n</hm-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ModalComponent$1, selector: "hm-modal", inputs: ["open", "heading", "size", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "
|
|
128
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: ModalComponent, isStandalone: true, selector: "spine-modal", viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<hm-modal\n [open]=\"visible\"\n [heading]=\"config?.title || ''\"\n [size]=\"toHermesSize(config?.size)\"\n [closable]=\"config?.closable ?? true\"\n (closed)=\"dismiss()\"\n>\n <ng-container #content />\n <div *ngIf=\"config?.text && !config?.component\">{{ config?.text }}</div>\n\n <ng-container footer *ngIf=\"config?.showActions !== false\">\n <hm-button emphasis=\"medium\" (clicked)=\"dismiss()\">{{ dialogText.cancel }}</hm-button>\n <hm-button\n intent=\"success\"\n [disabled]=\"!canConfirm\"\n [loadingState]=\"state\"\n (loadingStateChange)=\"onLoadingStateChange($event)\"\n (clicked)=\"confirm()\"\n >{{ dialogText.confirm }}</hm-button>\n </ng-container>\n</hm-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ModalComponent$1, selector: "hm-modal", inputs: ["open", "heading", "size", "closeLabel", "closable", "beforeClose"], outputs: ["openChange", "closed"] }, { kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
127
129
|
}
|
|
128
130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ModalComponent, decorators: [{
|
|
129
131
|
type: Component,
|
|
130
|
-
args: [{ selector: 'spine-modal', imports: [CommonModule, ModalComponent$1, ButtonComponent], changeDetection: ChangeDetectionStrategy.
|
|
132
|
+
args: [{ selector: 'spine-modal', imports: [CommonModule, ModalComponent$1, ButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<hm-modal\n [open]=\"visible\"\n [heading]=\"config?.title || ''\"\n [size]=\"toHermesSize(config?.size)\"\n [closable]=\"config?.closable ?? true\"\n (closed)=\"dismiss()\"\n>\n <ng-container #content />\n <div *ngIf=\"config?.text && !config?.component\">{{ config?.text }}</div>\n\n <ng-container footer *ngIf=\"config?.showActions !== false\">\n <hm-button emphasis=\"medium\" (clicked)=\"dismiss()\">{{ dialogText.cancel }}</hm-button>\n <hm-button\n intent=\"success\"\n [disabled]=\"!canConfirm\"\n [loadingState]=\"state\"\n (loadingStateChange)=\"onLoadingStateChange($event)\"\n (clicked)=\"confirm()\"\n >{{ dialogText.confirm }}</hm-button>\n </ng-container>\n</hm-modal>\n" }]
|
|
131
133
|
}], ctorParameters: () => [{ type: ModalService }, { type: i0.ChangeDetectorRef }], propDecorators: { content: [{
|
|
132
134
|
type: ViewChild,
|
|
133
135
|
args: ['content', { read: ViewContainerRef }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-spine-modal.mjs","sources":["../../../projects/ui/modal/src/modal.service.ts","../../../projects/ui/modal/src/modal.component.ts","../../../projects/ui/modal/src/modal.component.html","../../../projects/ui/modal/src/trismegisto-spine-modal.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HermesLoadingState } from '@trismegisto/angular';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { ModalConfig } from './modal.types';\n\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n private _visible = new BehaviorSubject<boolean>(false);\n public readonly visible$: Observable<boolean> = this._visible.asObservable();\n\n private _state = new BehaviorSubject<HermesLoadingState>(HermesLoadingState.DEFAULT);\n public readonly state$: Observable<HermesLoadingState> = this._state.asObservable();\n\n private _config: ModalConfig | null = null;\n public get config(): ModalConfig | null {\n return this._config;\n }\n\n private _result$: Subject<any> | null = null;\n\n open<TResult = any, TData = any>(config: ModalConfig<TData>): Observable<TResult | null> {\n // Abrir outro antes de responder o anterior cancela o anterior: quem o abriu recebe `null` (como no\n // `close`) e o observable completa, em vez de ficar pendurado para sempre.\n this._result$?.next(null);\n this._result$?.complete();\n this._config = config;\n this._state.next(HermesLoadingState.DEFAULT);\n this._result$ = new Subject<TResult | null>();\n this._visible.next(true);\n return this._result$.asObservable().pipe(take(1));\n }\n\n confirm(result: any): void {\n this._result$?.next(result);\n this._result$?.complete();\n this.dismiss();\n }\n\n close(): void {\n this._result$?.next(null);\n this._result$?.complete();\n this.dismiss();\n }\n\n setState(state: HermesLoadingState): void {\n this._state.next(state);\n }\n\n private dismiss(): void {\n this._visible.next(false);\n this._config = null;\n this._result$ = null;\n this._state.next(HermesLoadingState.DEFAULT); // evita vazar LOADING pro próximo modal\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, ComponentRef, OnInit, ViewChild, ViewContainerRef, ChangeDetectionStrategy, inject } from '@angular/core';\nimport { ButtonComponent, HERMES_MESSAGES, HermesLoadingState, ModalComponent as HermesModalComponent, ModalSize } from '@trismegisto/angular';\nimport { ModalConfig, ModalContent } from './modal.types';\nimport { ModalService } from './modal.service';\n\n/** `ModalConfig.size` manteve os valores do spine antigo (sm/md/lg/xl) por compatibilidade\n * de API com quem já chama `modalService.open(...)`; o DS novo só tem 3 tamanhos. */\nfunction toHermesSize(size: ModalConfig['size']): ModalSize {\n switch (size) {\n case 'sm': return 'small';\n case 'lg':\n case 'xl': return 'large';\n default: return 'medium';\n }\n}\n\n@Component({\n selector: 'spine-modal',\n imports: [CommonModule, HermesModalComponent, ButtonComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: './modal.component.html',\n})\nexport class ModalComponent implements OnInit {\n /** Rótulos dos botões padrão, do catálogo do Hermes (pt-BR/en/es). */\n protected readonly dialogText = inject(HERMES_MESSAGES).dialog;\n\n @ViewChild('content', { read: ViewContainerRef }) private content!: ViewContainerRef;\n\n visible = false;\n config: ModalConfig | null = null;\n state: HermesLoadingState = HermesLoadingState.DEFAULT;\n\n protected readonly HermesLoadingState = HermesLoadingState;\n protected readonly toHermesSize = toHermesSize;\n\n private contentRef: ComponentRef<ModalContent> | null = null;\n\n constructor(private modalService: ModalService, private cdr: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.modalService.visible$.subscribe((visible) => {\n this.visible = visible;\n this.config = this.modalService.config;\n if (visible) {\n this.loadComponent();\n } else {\n this.content?.clear();\n this.contentRef = null;\n }\n this.cdr.markForCheck();\n });\n\n this.modalService.state$.subscribe((state) => {\n this.state = state;\n this.cdr.markForCheck();\n });\n }\n\n get canConfirm(): boolean {\n const instance = this.contentRef?.instance;\n return !instance?.isValid || instance.isValid();\n }\n\n private loadComponent(): void {\n this.content.clear();\n if (this.config?.component) {\n this.contentRef = this.content.createComponent(this.config.component);\n if (this.config.data !== undefined) {\n this.contentRef.setInput('data', this.config.data);\n }\n }\n }\n\n confirm(): void {\n if (!this.canConfirm) return;\n const result = this.contentRef?.instance?.getResult ? this.contentRef.instance.getResult() : true;\n this.modalService.confirm(result);\n }\n\n dismiss(): void {\n this.modalService.close();\n }\n\n onLoadingStateChange(state: HermesLoadingState): void {\n this.modalService.setState(state);\n }\n}\n","<hm-modal\n [open]=\"visible\"\n [heading]=\"config?.title || ''\"\n [size]=\"toHermesSize(config?.size)\"\n [closable]=\"config?.closable ?? true\"\n (closed)=\"dismiss()\"\n>\n <ng-container #content />\n <div *ngIf=\"config?.text && !config?.component\">{{ config?.text }}</div>\n\n <ng-container footer *ngIf=\"config?.showActions !== false\">\n <hm-button emphasis=\"medium\" (clicked)=\"dismiss()\">{{ dialogText.cancel }}</hm-button>\n <hm-button\n intent=\"success\"\n [disabled]=\"!canConfirm\"\n [loadingState]=\"state\"\n (loadingStateChange)=\"onLoadingStateChange($event)\"\n (clicked)=\"confirm()\"\n >{{ dialogText.confirm }}</hm-button>\n </ng-container>\n</hm-modal>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModalService","HermesModalComponent"],"mappings":";;;;;;;;MAOa,YAAY,CAAA;AADzB,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AACtC,QAAA,IAAA,CAAA,QAAQ,GAAwB,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;QAEpE,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAqB,kBAAkB,CAAC,OAAO,CAAC;AACpE,QAAA,IAAA,CAAA,MAAM,GAAmC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QAE3E,IAAA,CAAA,OAAO,GAAuB,IAAI;QAKlC,IAAA,CAAA,QAAQ,GAAwB,IAAI;AAoC7C,IAAA;AAxCC,IAAA,IAAW,MAAM,GAAA;QACf,OAAO,IAAI,CAAC,OAAO;IACrB;AAIA,IAAA,IAAI,CAA6B,MAA0B,EAAA;;;AAGzD,QAAA,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC;AACzB,QAAA,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE;AACzB,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM;Q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A,EAAA,CAAA,oBAAA,EAAA,eAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;4FAIlD,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;+BACE,aAAa,EAAA,OAAA,EACd,CAAC,YAAY,EAAEA,gBAAoB,EAAE,eAAe,CAAC,EAAA,eAAA,EAC7C,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,0tBAAA,EAAA;;sBAO7C,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,SAAS,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;;AE3BlD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"trismegisto-spine-modal.mjs","sources":["../../../projects/ui/modal/src/modal.service.ts","../../../projects/ui/modal/src/modal.component.ts","../../../projects/ui/modal/src/modal.component.html","../../../projects/ui/modal/src/trismegisto-spine-modal.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HermesLoadingState } from '@trismegisto/angular';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { ModalConfig } from './modal.types';\n\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n private _visible = new BehaviorSubject<boolean>(false);\n public readonly visible$: Observable<boolean> = this._visible.asObservable();\n\n private _state = new BehaviorSubject<HermesLoadingState>(HermesLoadingState.DEFAULT);\n public readonly state$: Observable<HermesLoadingState> = this._state.asObservable();\n\n private _config: ModalConfig | null = null;\n public get config(): ModalConfig | null {\n return this._config;\n }\n\n private _result$: Subject<any> | null = null;\n\n open<TResult = any, TData = any>(config: ModalConfig<TData>): Observable<TResult | null> {\n // Abrir outro antes de responder o anterior cancela o anterior: quem o abriu recebe `null` (como no\n // `close`) e o observable completa, em vez de ficar pendurado para sempre.\n this._result$?.next(null);\n this._result$?.complete();\n this._config = config;\n this._state.next(HermesLoadingState.DEFAULT);\n this._result$ = new Subject<TResult | null>();\n this._visible.next(true);\n return this._result$.asObservable().pipe(take(1));\n }\n\n confirm(result: any): void {\n this._result$?.next(result);\n this._result$?.complete();\n this.dismiss();\n }\n\n close(): void {\n this._result$?.next(null);\n this._result$?.complete();\n this.dismiss();\n }\n\n setState(state: HermesLoadingState): void {\n this._state.next(state);\n }\n\n private dismiss(): void {\n this._visible.next(false);\n this._config = null;\n this._result$ = null;\n this._state.next(HermesLoadingState.DEFAULT); // evita vazar LOADING pro próximo modal\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, ComponentRef, DestroyRef, OnInit, ViewChild, ViewContainerRef, ChangeDetectionStrategy, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ButtonComponent, HERMES_MESSAGES, HermesLoadingState, ModalComponent as HermesModalComponent, ModalSize } from '@trismegisto/angular';\nimport { ModalConfig, ModalContent } from './modal.types';\nimport { ModalService } from './modal.service';\n\n/** `ModalConfig.size` manteve os valores do spine antigo (sm/md/lg/xl) por compatibilidade\n * de API com quem já chama `modalService.open(...)`; o DS novo só tem 3 tamanhos. */\nfunction toHermesSize(size: ModalConfig['size']): ModalSize {\n switch (size) {\n case 'sm': return 'small';\n case 'lg':\n case 'xl': return 'large';\n default: return 'medium';\n }\n}\n\n@Component({\n selector: 'spine-modal',\n imports: [CommonModule, HermesModalComponent, ButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './modal.component.html',\n})\nexport class ModalComponent implements OnInit {\n /** Rótulos dos botões padrão, do catálogo do Hermes (pt-BR/en/es). */\n protected readonly dialogText = inject(HERMES_MESSAGES).dialog;\n\n @ViewChild('content', { read: ViewContainerRef }) private content!: ViewContainerRef;\n\n visible = false;\n config: ModalConfig | null = null;\n state: HermesLoadingState = HermesLoadingState.DEFAULT;\n\n protected readonly HermesLoadingState = HermesLoadingState;\n protected readonly toHermesSize = toHermesSize;\n\n private contentRef: ComponentRef<ModalContent> | null = null;\n private readonly destroyRef = inject(DestroyRef);\n\n constructor(private modalService: ModalService, private cdr: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.modalService.visible$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((visible) => {\n this.visible = visible;\n this.config = this.modalService.config;\n if (visible) {\n this.loadComponent();\n } else {\n this.content?.clear();\n this.contentRef = null;\n }\n this.cdr.markForCheck();\n });\n\n this.modalService.state$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((state) => {\n this.state = state;\n this.cdr.markForCheck();\n });\n }\n\n get canConfirm(): boolean {\n const instance = this.contentRef?.instance;\n return !instance?.isValid || instance.isValid();\n }\n\n private loadComponent(): void {\n this.content.clear();\n if (this.config?.component) {\n this.contentRef = this.content.createComponent(this.config.component);\n if (this.config.data !== undefined) {\n this.contentRef.setInput('data', this.config.data);\n }\n }\n }\n\n confirm(): void {\n if (!this.canConfirm) return;\n const result = this.contentRef?.instance?.getResult ? this.contentRef.instance.getResult() : true;\n this.modalService.confirm(result);\n }\n\n dismiss(): void {\n this.modalService.close();\n }\n\n onLoadingStateChange(state: HermesLoadingState): void {\n this.modalService.setState(state);\n }\n}\n","<hm-modal\n [open]=\"visible\"\n [heading]=\"config?.title || ''\"\n [size]=\"toHermesSize(config?.size)\"\n [closable]=\"config?.closable ?? true\"\n (closed)=\"dismiss()\"\n>\n <ng-container #content />\n <div *ngIf=\"config?.text && !config?.component\">{{ config?.text }}</div>\n\n <ng-container footer *ngIf=\"config?.showActions !== false\">\n <hm-button emphasis=\"medium\" (clicked)=\"dismiss()\">{{ dialogText.cancel }}</hm-button>\n <hm-button\n intent=\"success\"\n [disabled]=\"!canConfirm\"\n [loadingState]=\"state\"\n (loadingStateChange)=\"onLoadingStateChange($event)\"\n (clicked)=\"confirm()\"\n >{{ dialogText.confirm }}</hm-button>\n </ng-container>\n</hm-modal>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModalService","HermesModalComponent"],"mappings":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AAA,IAAA,EAAA,CAAA,SAAS,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;;AE5BlD;;AAEG;;"}
|
|
@@ -2,9 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, DestroyRef, Injectable, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject } from 'rxjs';
|
|
4
4
|
import { SPINE_MESSAGES } from '@trismegisto/spine';
|
|
5
|
-
import
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
|
-
import { AlertComponent } from '@trismegisto/angular';
|
|
5
|
+
import { HermesToastService, ToastStackComponent } from '@trismegisto/angular';
|
|
8
6
|
|
|
9
7
|
var AlertType;
|
|
10
8
|
(function (AlertType) {
|
|
@@ -24,9 +22,20 @@ function redactSecrets(text) {
|
|
|
24
22
|
.replace(BEARER_RE, '$1***');
|
|
25
23
|
}
|
|
26
24
|
|
|
25
|
+
/** `AlertType.DANGER` (nome antigo, preservado na API pública) é o `'error'` do toast; os outros coincidem. */
|
|
26
|
+
function toToastVariant(type) {
|
|
27
|
+
return type === AlertType.DANGER ? 'error' : type;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Avisos de resposta (envelope `{ status, message }` dos GraphQL, falha do logout...). Desde a 3.3.0 eles aparecem no
|
|
31
|
+
* mesmo `hm-toast-stack` do `HermesToastService`, junto com os avisos do app (`SpineNoticesService`): antes o
|
|
32
|
+
* `spine-notification` desenhava uma coluna própria de `hm-alert` no mesmo canto, por cima dos toasts.
|
|
33
|
+
* `notifications$` continua publicando a lista (com a expiração de cada um) para quem já lia.
|
|
34
|
+
*/
|
|
27
35
|
class NotificationService {
|
|
28
36
|
constructor() {
|
|
29
37
|
this.text = inject(SPINE_MESSAGES).notification;
|
|
38
|
+
this.toast = inject(HermesToastService, { optional: true });
|
|
30
39
|
this._notifications = new BehaviorSubject([]);
|
|
31
40
|
this.notifications$ = this._notifications.asObservable();
|
|
32
41
|
/** Relógio da expiração: só corre enquanto há notificação na tela (antes era um `setInterval` eterno,
|
|
@@ -57,6 +66,7 @@ class NotificationService {
|
|
|
57
66
|
const next = { ...notification, message, hermesAlertType, expirer };
|
|
58
67
|
this._notifications.next([...this._notifications.value, next]);
|
|
59
68
|
this.timer ??= setInterval(() => this.expireNotifications(), 1000);
|
|
69
|
+
this.toast?.push(toToastVariant(hermesAlertType), message, notification.timer > 0 ? { duration: notification.timer * 1000 } : undefined);
|
|
60
70
|
}
|
|
61
71
|
processErrorNotification() {
|
|
62
72
|
this.addNotification({
|
|
@@ -88,31 +98,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
88
98
|
args: [{ providedIn: 'root' }]
|
|
89
99
|
}], ctorParameters: () => [] });
|
|
90
100
|
|
|
91
|
-
/**
|
|
92
|
-
*
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Compatibilidade: os avisos do `NotificationService` saem no `hm-toast-stack` do `HermesToastService` (3.3.0).
|
|
103
|
+
* `<spine-notification>` só monta uma pilha de toasts; se já houver outra na tela (a do `spine-layout`), o serviço
|
|
104
|
+
* escolhe uma e nada aparece em dobro. Em tela nova, use `<hm-toast-stack />` direto.
|
|
105
|
+
*/
|
|
96
106
|
class NotificationComponent {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.cdr = cdr;
|
|
100
|
-
this.notifications = [];
|
|
101
|
-
this.toAlertVariant = toAlertVariant;
|
|
102
|
-
}
|
|
103
|
-
ngOnInit() {
|
|
104
|
-
this.notificationService.notifications$.subscribe((notifications) => {
|
|
105
|
-
this.notifications = notifications;
|
|
106
|
-
this.cdr.markForCheck();
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: NotificationComponent, deps: [{ token: NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: NotificationComponent, isStandalone: true, selector: "spine-notification", ngImport: i0, template: "<hm-alert *ngFor=\"let notification of notifications\" [variant]=\"toAlertVariant(notification.hermesAlertType)\" [closable]=\"notification.hermesAlertClosable ?? true\">\n <span class=\"alert-text\">{{ notification.message }}</span>\n</hm-alert>\n", styles: [":host{position:fixed;top:calc(var(--hm-header-height, 3rem) + 1rem);right:1rem;z-index:1030;display:flex;flex-direction:column;gap:.5rem;max-width:380px;pointer-events:none}:host ::ng-deep hm-alert{pointer-events:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: AlertComponent, selector: "hm-alert", inputs: ["variant", "appearance", "heading", "closable", "size", "showIcon", "link", "linkLabel", "linkTarget", "dismissKey", "duration"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
108
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: NotificationComponent, isStandalone: true, selector: "spine-notification", ngImport: i0, template: `<hm-toast-stack />`, isInline: true, dependencies: [{ kind: "component", type: ToastStackComponent, selector: "hm-toast-stack" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
111
109
|
}
|
|
112
110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
113
111
|
type: Component,
|
|
114
|
-
args: [{
|
|
115
|
-
|
|
112
|
+
args: [{
|
|
113
|
+
selector: 'spine-notification',
|
|
114
|
+
imports: [ToastStackComponent],
|
|
115
|
+
template: `<hm-toast-stack />`,
|
|
116
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
117
|
+
}]
|
|
118
|
+
}] });
|
|
116
119
|
|
|
117
120
|
/**
|
|
118
121
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-spine-notification.mjs","sources":["../../../projects/ui/notification/src/notification.types.ts","../../../projects/ui/notification/src/redact-secrets.ts","../../../projects/ui/notification/src/notification.service.ts","../../../projects/ui/notification/src/notification.component.ts","../../../projects/ui/notification/src/notification.component.html","../../../projects/ui/notification/src/trismegisto-spine-notification.ts"],"sourcesContent":["export enum AlertType {\n INFO = 'info',\n WARNING = 'warning',\n SUCCESS = 'success',\n DANGER = 'danger',\n}\n\nexport interface Notification {\n timer: number;\n expirer?: number;\n hermesAlertType: AlertType;\n message: string;\n hermesAlertAppLevel?: boolean;\n hermesAlertClosable?: boolean;\n}\n","const JWT_RE = /eyJ[A-Za-z0-9_-]{6,}\\.[A-Za-z0-9_-]{6,}\\.[A-Za-z0-9_-]{6,}/g;\nconst TOKEN_FLAG_RE = /(--token=|--password=|token=|password=)\\S+/gi;\nconst BEARER_RE = /(bearer\\s+)[A-Za-z0-9._-]+/gi;\n\nexport function redactSecrets(text: unknown): string {\n return String(text ?? '')\n .replace(JWT_RE, '***')\n .replace(TOKEN_FLAG_RE, '$1***')\n .replace(BEARER_RE, '$1***');\n}\n","import { DestroyRef, Injectable, inject } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { redactSecrets } from './redact-secrets';\nimport { AlertType, Notification } from './notification.types';\nimport { SPINE_MESSAGES } from '@trismegisto/spine';\n\nexport type NotificationInput = Omit<Notification, 'hermesAlertType' | 'expirer'> & {\n hermesAlertType: AlertType | number;\n};\n\n@Injectable({ providedIn: 'root' })\nexport class NotificationService {\n private readonly text = inject(SPINE_MESSAGES).notification;\n private _notifications = new BehaviorSubject<Notification[]>([]);\n public readonly notifications$: Observable<Notification[]> = this._notifications.asObservable();\n\n /** Relógio da expiração: só corre enquanto há notificação na tela (antes era um `setInterval` eterno,\n * nunca limpo — acordava a página a cada segundo e sobrevivia ao injetor). */\n private timer: ReturnType<typeof setInterval> | null = null;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.stopClock());\n }\n\n /**\n * O `status` do envelope `{ status, message, data }` dos GraphQL decide o tipo do toast — o mesmo\n * contrato em todo app: 2xx sucesso, 3xx atenção (concluiu com ressalva), 4xx/5xx erro, o resto\n * informação. Por faixa (antes era só 200/300/400/500 exatos — continuam dando o mesmo resultado).\n */\n resolveAlertType(status: number): AlertType {\n if (status >= 200 && status < 300) return AlertType.SUCCESS;\n if (status >= 300 && status < 400) return AlertType.WARNING;\n if (status >= 400 && status < 600) return AlertType.DANGER;\n return AlertType.INFO;\n }\n\n addNotification(notification: NotificationInput): void {\n const message = redactSecrets(notification.message);\n const hermesAlertType =\n typeof notification.hermesAlertType === 'number'\n ? this.resolveAlertType(notification.hermesAlertType)\n : notification.hermesAlertType;\n\n const expirer = Date.now() + notification.timer * 1000;\n const next: Notification = { ...notification, message, hermesAlertType, expirer };\n this._notifications.next([...this._notifications.value, next]);\n this.timer ??= setInterval(() => this.expireNotifications(), 1000);\n }\n\n processErrorNotification(): void {\n this.addNotification({\n timer: 5,\n hermesAlertType: AlertType.DANGER,\n message: this.text.genericError,\n hermesAlertClosable: false,\n });\n }\n\n private expireNotifications(): void {\n const now = Date.now();\n const remaining = this._notifications.value.filter((n) => (n.expirer ?? 0) >= now);\n if (remaining.length !== this._notifications.value.length) {\n this._notifications.next(remaining);\n }\n if (remaining.length === 0) this.stopClock();\n }\n\n private stopClock(): void {\n if (this.timer !== null) clearInterval(this.timer);\n this.timer = null;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { AlertComponent, AlertVariant } from '@trismegisto/angular';\nimport { AlertType, Notification } from './notification.types';\nimport { NotificationService } from './notification.service';\n\n/** `AlertType.DANGER` (nome do spine antigo, preservado na API pública) mapeia pra `'error'`\n * no `AlertVariant` do DS novo — os outros 3 valores já coincidem 1:1. */\nfunction toAlertVariant(type: AlertType): AlertVariant {\n return type === AlertType.DANGER ? 'error' : type;\n}\n\n@Component({\n selector: 'spine-notification',\n imports: [CommonModule, AlertComponent],\n templateUrl: './notification.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrl: './notification.component.scss',\n})\nexport class NotificationComponent implements OnInit {\n notifications: Notification[] = [];\n\n protected readonly toAlertVariant = toAlertVariant;\n\n constructor(public notificationService: NotificationService, private cdr: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.notificationService.notifications$.subscribe((notifications) => {\n this.notifications = notifications;\n this.cdr.markForCheck();\n });\n }\n}\n","<hm-alert *ngFor=\"let notification of notifications\" [variant]=\"toAlertVariant(notification.hermesAlertType)\" [closable]=\"notification.hermesAlertClosable ?? true\">\n <span class=\"alert-text\">{{ notification.message }}</span>\n</hm-alert>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NotificationService"],"mappings":";;;;;;;;IAAY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,SAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EALW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;;ACArB,MAAM,MAAM,GAAG,6DAA6D;AAC5E,MAAM,aAAa,GAAG,8CAA8C;AACpE,MAAM,SAAS,GAAG,8BAA8B;AAE1C,SAAU,aAAa,CAAC,IAAa,EAAA;AACzC,IAAA,OAAO,MAAM,CAAC,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AA,SAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECnBlC,2PAGA,EAAA,MAAA,EAAA,CAAA,8NAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDWY,YAAY,4JAAE,cAAc,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,YAAA,EAAA,SAAA,EAAA,UAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,YAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;4FAK3B,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;+BACE,oBAAoB,EAAA,OAAA,EACrB,CAAC,YAAY,EAAE,cAAc,CAAC,EAAA,eAAA,EAEtB,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,2PAAA,EAAA,MAAA,EAAA,CAAA,8NAAA,CAAA,EAAA;;;AEhBhD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"trismegisto-spine-notification.mjs","sources":["../../../projects/ui/notification/src/notification.types.ts","../../../projects/ui/notification/src/redact-secrets.ts","../../../projects/ui/notification/src/notification.service.ts","../../../projects/ui/notification/src/notification.component.ts","../../../projects/ui/notification/src/trismegisto-spine-notification.ts"],"sourcesContent":["export enum AlertType {\n INFO = 'info',\n WARNING = 'warning',\n SUCCESS = 'success',\n DANGER = 'danger',\n}\n\nexport interface Notification {\n timer: number;\n expirer?: number;\n hermesAlertType: AlertType;\n message: string;\n hermesAlertAppLevel?: boolean;\n hermesAlertClosable?: boolean;\n}\n","const JWT_RE = /eyJ[A-Za-z0-9_-]{6,}\\.[A-Za-z0-9_-]{6,}\\.[A-Za-z0-9_-]{6,}/g;\nconst TOKEN_FLAG_RE = /(--token=|--password=|token=|password=)\\S+/gi;\nconst BEARER_RE = /(bearer\\s+)[A-Za-z0-9._-]+/gi;\n\nexport function redactSecrets(text: unknown): string {\n return String(text ?? '')\n .replace(JWT_RE, '***')\n .replace(TOKEN_FLAG_RE, '$1***')\n .replace(BEARER_RE, '$1***');\n}\n","import { DestroyRef, Injectable, inject } from '@angular/core';\nimport type { AlertVariant } from '@trismegisto/primitives';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { redactSecrets } from './redact-secrets';\nimport { AlertType, Notification } from './notification.types';\nimport { SPINE_MESSAGES } from '@trismegisto/spine';\nimport { HermesToastService } from '@trismegisto/angular';\n\n/** `AlertType.DANGER` (nome antigo, preservado na API pública) é o `'error'` do toast; os outros coincidem. */\nfunction toToastVariant(type: AlertType): AlertVariant {\n return type === AlertType.DANGER ? 'error' : type;\n}\n\nexport type NotificationInput = Omit<Notification, 'hermesAlertType' | 'expirer'> & {\n hermesAlertType: AlertType | number;\n};\n\n/**\n * Avisos de resposta (envelope `{ status, message }` dos GraphQL, falha do logout...). Desde a 3.3.0 eles aparecem no\n * mesmo `hm-toast-stack` do `HermesToastService`, junto com os avisos do app (`SpineNoticesService`): antes o\n * `spine-notification` desenhava uma coluna própria de `hm-alert` no mesmo canto, por cima dos toasts.\n * `notifications$` continua publicando a lista (com a expiração de cada um) para quem já lia.\n */\n@Injectable({ providedIn: 'root' })\nexport class NotificationService {\n private readonly text = inject(SPINE_MESSAGES).notification;\n private readonly toast = inject(HermesToastService, { optional: true });\n private _notifications = new BehaviorSubject<Notification[]>([]);\n public readonly notifications$: Observable<Notification[]> = this._notifications.asObservable();\n\n /** Relógio da expiração: só corre enquanto há notificação na tela (antes era um `setInterval` eterno,\n * nunca limpo — acordava a página a cada segundo e sobrevivia ao injetor). */\n private timer: ReturnType<typeof setInterval> | null = null;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.stopClock());\n }\n\n /**\n * O `status` do envelope `{ status, message, data }` dos GraphQL decide o tipo do toast — o mesmo\n * contrato em todo app: 2xx sucesso, 3xx atenção (concluiu com ressalva), 4xx/5xx erro, o resto\n * informação. Por faixa (antes era só 200/300/400/500 exatos — continuam dando o mesmo resultado).\n */\n resolveAlertType(status: number): AlertType {\n if (status >= 200 && status < 300) return AlertType.SUCCESS;\n if (status >= 300 && status < 400) return AlertType.WARNING;\n if (status >= 400 && status < 600) return AlertType.DANGER;\n return AlertType.INFO;\n }\n\n addNotification(notification: NotificationInput): void {\n const message = redactSecrets(notification.message);\n const hermesAlertType =\n typeof notification.hermesAlertType === 'number'\n ? this.resolveAlertType(notification.hermesAlertType)\n : notification.hermesAlertType;\n\n const expirer = Date.now() + notification.timer * 1000;\n const next: Notification = { ...notification, message, hermesAlertType, expirer };\n this._notifications.next([...this._notifications.value, next]);\n this.timer ??= setInterval(() => this.expireNotifications(), 1000);\n this.toast?.push(toToastVariant(hermesAlertType), message, notification.timer > 0 ? { duration: notification.timer * 1000 } : undefined);\n }\n\n processErrorNotification(): void {\n this.addNotification({\n timer: 5,\n hermesAlertType: AlertType.DANGER,\n message: this.text.genericError,\n hermesAlertClosable: false,\n });\n }\n\n private expireNotifications(): void {\n const now = Date.now();\n const remaining = this._notifications.value.filter((n) => (n.expirer ?? 0) >= now);\n if (remaining.length !== this._notifications.value.length) {\n this._notifications.next(remaining);\n }\n if (remaining.length === 0) this.stopClock();\n }\n\n private stopClock(): void {\n if (this.timer !== null) clearInterval(this.timer);\n this.timer = null;\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ToastStackComponent } from '@trismegisto/angular';\n\n/**\n * Compatibilidade: os avisos do `NotificationService` saem no `hm-toast-stack` do `HermesToastService` (3.3.0).\n * `<spine-notification>` só monta uma pilha de toasts; se já houver outra na tela (a do `spine-layout`), o serviço\n * escolhe uma e nada aparece em dobro. Em tela nova, use `<hm-toast-stack />` direto.\n */\n@Component({\n selector: 'spine-notification',\n imports: [ToastStackComponent],\n template: `<hm-toast-stack />`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NotificationComponent {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;IAAY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,SAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EALW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;;ACArB,MAAM,MAAM,GAAG,6DAA6D;AAC5E,MAAM,aAAa,GAAG,8CAA8C;AACpE,MAAM,SAAS,GAAG,8BAA8B;AAE1C,SAAU,aAAa,CAAC,IAAa,EAAA;AACzC,IAAA,OAAO,MAAM,CAAC,IAAI,IAAI,EAAE;AACrB,SAAA,OAAO,CAAC,MAAM,EAAE,KAAK;AACrB,SAAA,OAAO,CAAC,aAAa,EAAE,OAAO;AAC9B,SAAA,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC;AAChC;;ACDA;AACA,SAAS,cAAc,CAAC,IAAe,EAAA;AACrC,IAAA,OAAO,IAAI,KAAK,SAAS,CAAC,MAAM,GAAG,OAAO,GAAG,IAAI;AACnD;AAMA;;;;;AAKG;MAEU,mBAAmB,CAAA;AAU9B,IAAA,WAAA,GAAA;AATiB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,YAAY;QAC1C,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/D,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,eAAe,CAAiB,EAAE,CAAC;AAChD,QAAA,IAAA,CA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A,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA,CAAA;;4FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpBlC;;;;AAIG;MAOU,qBAAqB,CAAA;+GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAHtB,CAAA,kBAAA,CAAoB,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EADpB,mBAAmB,EAAA,QAAA,EAAA,gBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAIlB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC9B,oBAAA,QAAQ,EAAE,CAAA,kBAAA,CAAoB;oBAC9B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;ACbD;;AAEG;;"}
|
|
@@ -234,15 +234,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
234
234
|
args: [{ providedIn: 'root' }]
|
|
235
235
|
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.ViewService }, { type: i2.AuthorizationService }] });
|
|
236
236
|
|
|
237
|
-
/** `id` (router_id) da entrada
|
|
237
|
+
/** `id` (router_id) da entrada. O formato antigo (`route_id`) saiu na 3.3.1. */
|
|
238
238
|
function componentRouterId(route) {
|
|
239
|
-
return route.id
|
|
239
|
+
return route.id;
|
|
240
240
|
}
|
|
241
|
-
/**
|
|
242
|
-
const componentRouteId = componentRouterId;
|
|
243
|
-
/** Carregador da entrada, aceitando o formato antigo (`component`). */
|
|
241
|
+
/** Carregador da entrada. O formato antigo (`component`) saiu na 3.3.1. */
|
|
244
242
|
function componentRouteLoader(route) {
|
|
245
|
-
return route.load
|
|
243
|
+
return route.load;
|
|
246
244
|
}
|
|
247
245
|
// multi: true -- vários providers (o app via provideShell + pacotes plugáveis via
|
|
248
246
|
// provideAutoService e afins) contribuem cada um com seu próprio array, combinados
|
|
@@ -274,11 +272,11 @@ class NoContentComponent {
|
|
|
274
272
|
void this.router.navigateByUrl('/');
|
|
275
273
|
}
|
|
276
274
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: NoContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
277
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: NoContentComponent, isStandalone: true, selector: "spine-no-content", ngImport: i0, template: `<hm-state-page kind="no-content" [description]="description()" (actionTriggered)="irParaInicio()" />`, isInline: true, styles: [":host{display:flex;flex-direction:column;flex:1;min-block-size:100%}\n"], dependencies: [{ kind: "component", type: StatePageComponent, selector: "hm-state-page", inputs: ["kind", "heading", "description", "action", "actionIcon"], outputs: ["actionTriggered"] }], changeDetection: i0.ChangeDetectionStrategy.
|
|
275
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: NoContentComponent, isStandalone: true, selector: "spine-no-content", ngImport: i0, template: `<hm-state-page kind="no-content" [description]="description()" (actionTriggered)="irParaInicio()" />`, isInline: true, styles: [":host{display:flex;flex-direction:column;flex:1;min-block-size:100%}\n"], dependencies: [{ kind: "component", type: StatePageComponent, selector: "hm-state-page", inputs: ["kind", "heading", "description", "action", "actionIcon"], outputs: ["actionTriggered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
278
276
|
}
|
|
279
277
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: NoContentComponent, decorators: [{
|
|
280
278
|
type: Component,
|
|
281
|
-
args: [{ selector: 'spine-no-content', template: `<hm-state-page kind="no-content" [description]="description()" (actionTriggered)="irParaInicio()" />`, imports: [StatePageComponent], changeDetection: ChangeDetectionStrategy.
|
|
279
|
+
args: [{ selector: 'spine-no-content', template: `<hm-state-page kind="no-content" [description]="description()" (actionTriggered)="irParaInicio()" />`, imports: [StatePageComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [":host{display:flex;flex-direction:column;flex:1;min-block-size:100%}\n"] }]
|
|
282
280
|
}] });
|
|
283
281
|
/**
|
|
284
282
|
* O import dinâmico falhou porque o arquivo da tela não existe mais no servidor — saiu um build novo
|
|
@@ -303,17 +301,13 @@ class OutdatedComponent {
|
|
|
303
301
|
window.location.reload();
|
|
304
302
|
}
|
|
305
303
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: OutdatedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
306
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: OutdatedComponent, isStandalone: true, selector: "spine-outdated", ngImport: i0, template: `<hm-state-page kind="outdated" (actionTriggered)="recarregar()" />`, isInline: true, styles: [":host{display:flex;flex-direction:column;flex:1;min-block-size:100%}\n"], dependencies: [{ kind: "component", type: StatePageComponent, selector: "hm-state-page", inputs: ["kind", "heading", "description", "action", "actionIcon"], outputs: ["actionTriggered"] }], changeDetection: i0.ChangeDetectionStrategy.
|
|
304
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.24", type: OutdatedComponent, isStandalone: true, selector: "spine-outdated", ngImport: i0, template: `<hm-state-page kind="outdated" (actionTriggered)="recarregar()" />`, isInline: true, styles: [":host{display:flex;flex-direction:column;flex:1;min-block-size:100%}\n"], dependencies: [{ kind: "component", type: StatePageComponent, selector: "hm-state-page", inputs: ["kind", "heading", "description", "action", "actionIcon"], outputs: ["actionTriggered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
307
305
|
}
|
|
308
306
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: OutdatedComponent, decorators: [{
|
|
309
307
|
type: Component,
|
|
310
|
-
args: [{ selector: 'spine-outdated', template: `<hm-state-page kind="outdated" (actionTriggered)="recarregar()" />`, imports: [StatePageComponent], changeDetection: ChangeDetectionStrategy.
|
|
308
|
+
args: [{ selector: 'spine-outdated', template: `<hm-state-page kind="outdated" (actionTriggered)="recarregar()" />`, imports: [StatePageComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [":host{display:flex;flex-direction:column;flex:1;min-block-size:100%}\n"] }]
|
|
311
309
|
}] });
|
|
312
310
|
class ComponentDistributorService {
|
|
313
|
-
/** @deprecated use `lastMissingRouterId` (sempre foi o router_id). */
|
|
314
|
-
get lastMissingRouteId() {
|
|
315
|
-
return this.lastMissingRouterId;
|
|
316
|
-
}
|
|
317
311
|
// COMPONENT_ROUTES é multi: true -- cada provider (provideShell, provideAutoService,
|
|
318
312
|
// etc.) contribui com seu próprio ComponentRoute[], injetado aqui como
|
|
319
313
|
// ComponentRoute[][] (um array por provider). Achata numa lista só.
|
|
@@ -384,15 +378,13 @@ async function resolveSpineRoute(currentRoutes, getLevel, getUrlAtLevel, distrib
|
|
|
384
378
|
return { chain, component };
|
|
385
379
|
}
|
|
386
380
|
|
|
387
|
-
// `router/`, `navigation/submenus/`, `navigation/multipages/` e `component-factory/`
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
// ambiente desta sessão (operação destrutiva de arquivo bloqueada) — apagar fisicamente quando
|
|
391
|
-
// alguém revisar/aprovar.
|
|
381
|
+
// `router/`, `navigation/submenus/`, `navigation/multipages/` e `component-factory/` (a rota aninhada de 6
|
|
382
|
+
// níveis do Angular, trocada pela resolução por painel do workspace: resolve-route.ts + layout/src/workspace/)
|
|
383
|
+
// eram órfãos sem export e saíram na 3.3.1.
|
|
392
384
|
|
|
393
385
|
/**
|
|
394
386
|
* Generated bundle index. Do not edit.
|
|
395
387
|
*/
|
|
396
388
|
|
|
397
|
-
export { CLIENT_ID_HEADER, COMPONENT_ROUTES, ComponentDistributorService, LoggerService, ROUTE_ID_HEADER, RouteIdInterceptor, ViewGuard,
|
|
389
|
+
export { CLIENT_ID_HEADER, COMPONENT_ROUTES, ComponentDistributorService, LoggerService, ROUTE_ID_HEADER, RouteIdInterceptor, ViewGuard, componentRouteLoader, componentRouterId, findFirstNavigable, findRouteThrough, isChunkLoadError, resolveEffectiveRouteChain, resolveRouteChain, resolveSpineRoute };
|
|
398
390
|
//# sourceMappingURL=trismegisto-spine-routing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-spine-routing.mjs","sources":["../../../projects/ui/routing/src/logger.service.ts","../../../projects/ui/routing/src/route-id.interceptor.ts","../../../projects/ui/routing/src/route-chain.ts","../../../projects/ui/routing/src/view.guard.ts","../../../projects/ui/routing/src/component-routes.token.ts","../../../projects/ui/routing/src/component-distributor.service.ts","../../../projects/ui/routing/src/resolve-route.ts","../../../projects/ui/routing/src/public-api.ts","../../../projects/ui/routing/src/trismegisto-spine-routing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { Route, routerIdOf } from '@trismegisto/spine';\n\n@Injectable({ providedIn: 'root' })\nexport class LoggerService {\n\n private _logger = new BehaviorSubject<Route[]>([]);\n\n get logger(): Route[] { return this._logger.value; }\n\n setLogger(logger: Route[]) { this._logger.next(logger); }\n\n /** A página atual (último nó da cadeia do painel focado). */\n get page(): Route | null {\n const entries = this.logger;\n return entries[entries.length - 1] ?? null;\n }\n\n /** `router_id` da página atual -- a identidade da TELA no spine (componente, documento, descrição). */\n get routerId(): string | null {\n return routerIdOf(this.page);\n }\n\n /**\n * A ROTA da página atual (`web.routes.route_id`, o `routed_id` do nó) -- o que vai em `x-route-id`\n * e vira `audit.events.route_id`/`route_name`. Só quando o último nó é uma página de verdade (tem\n * router): grupo puramente organizacional não é tela. Antes de 2026-10-05 ia o router_id aqui, e a\n * auditoria não achava o nome (o argos-auth-server ainda traduz router_id → rota, por compatibilidade).\n */\n get routeId(): string | null {\n const page = this.page;\n return page && routerIdOf(page) ? page.routed_id ?? null : null;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { SPINE_CONFIG } from '@trismegisto/spine';\nimport { LoggerService } from './logger.service';\n\n/** Must match `@orfeu/node`/`orfeu` (Python)'s `ROUTE_ID_HEADER` (`x-route-id`). */\nexport const ROUTE_ID_HEADER = 'X-Route-Id';\n/** Must match `@orfeu/node`/`orfeu` (Python)'s `CLIENT_ID_HEADER` (`x-client-id`): which app (client) the action came from. */\nexport const CLIENT_ID_HEADER = 'X-Client-Id';\n\n/**\n * Attaches the current screen's ROUTE id — `web.routes.route_id` of the page node (`routed_id`), NOT the\n * `router_id` the spine uses to identify the screen (see `LoggerService.routeId`) — and the app's `clientId`\n * from `SpineConfig` as headers on every outgoing HTTP\n * request, read from `LoggerService` (updated by `ViewGuard` on every\n * navigation — see view.guard.ts). This is a caller-supplied correlation tag\n * consumed by Orfeu's structured operation logs to correlate an\n * operation_id with the route that triggered it; it is never verified\n * server-side and never used for permission checks.\n *\n * Applied globally (registered once by `provideShell`, not per-service) so\n * every app gets the correlation for free — an extra header a third-party\n * API doesn't recognize is harmless, so there's no need to scope this to\n * only Orfeu-guarded backends.\n */\n@Injectable()\nexport class RouteIdInterceptor implements HttpInterceptor {\n private readonly clientId = inject(SPINE_CONFIG, { optional: true })?.clientId;\n\n constructor(private loggerService: LoggerService) {}\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n const setHeaders: Record<string, string> = {};\n if (!req.headers.has(ROUTE_ID_HEADER)) {\n const routeId = this.loggerService.routeId;\n if (routeId) setHeaders[ROUTE_ID_HEADER] = routeId;\n }\n if (this.clientId && !req.headers.has(CLIENT_ID_HEADER)) setHeaders[CLIENT_ID_HEADER] = this.clientId;\n\n return Object.keys(setHeaders).length ? next.handle(req.clone({ setHeaders })) : next.handle(req);\n }\n}\n","import { Route } from '@trismegisto/spine';\n\n/**\n * Lógica pura de resolução da árvore de rotas vinda do backend (`ViewService.currentView`) —\n * compartilhada entre `ViewGuard` (gate de navegação real) e `resolveSpineRoute` (resolução por\n * painel do workspace, sem depender do `Router`). Extraída daqui porque as duas precisavam do\n * mesmo algoritmo de busca e tinham cópias divergentes antes desta reescrita.\n */\n\n/** Acha uma rota cujo `route_redirect` bate com `urlAtLevel`, atravessando ancestrais\n * \"transparentes\" (sem `route_redirect` próprio — só agrupam os filhos). */\nexport function findRouteThrough(routes: Route[], urlAtLevel: string): Route | null {\n const direct = routes.find((r) => r.route_redirect === urlAtLevel);\n if (direct) return direct;\n\n for (const transparent of routes.filter((r) => !r.route_redirect)) {\n const found = findRouteThrough(transparent.routes ?? [], urlAtLevel);\n if (found) return found;\n }\n\n return null;\n}\n\n/** Primeira rota navegável (DFS), atravessando grupos transparentes — usada como fallback\n * quando a URL alvo não bate com nada na view atual. */\nexport function findFirstNavigable(routes: Route[]): string | null {\n for (const r of routes || []) {\n if (!r) continue;\n if (r.route_redirect) return r.route_redirect;\n if (r.routes?.length) {\n const found = findFirstNavigable(r.routes);\n if (found) return found;\n }\n }\n return null;\n}\n\n/**\n * Resolve a cadeia INTEIRA de rotas (header→navigation→menu→item→submenu→page, até onde a URL\n * for funda) pra uma URL qualquer, lendo só `currentRoutes`/`getLevel`/`getUrlAtLevel` — as\n * mesmas três primitivas que `ViewGuard` já usava, sem tocar no `Router`. `chain[0]` é o nível 1\n * (header), não existe nível 0 — mantém a mesma convenção 1-based do `ViewGuard` original.\n */\nexport function resolveRouteChain(\n currentRoutes: Route[],\n getLevel: (url: string) => number,\n getUrlAtLevel: (url: string, level: number) => string,\n url: string,\n): Route[] | null {\n if (!currentRoutes.length) return null;\n\n const levels = getLevel(url);\n const chain: Route[] = [];\n let pool = currentRoutes;\n\n for (let level = 1; level <= levels; level++) {\n const urlAtLevel = getUrlAtLevel(url, level);\n const found = findRouteThrough(pool, urlAtLevel);\n if (!found) return null;\n chain.push(found);\n pool = found.routes ?? [];\n }\n\n return chain;\n}\n\n/** Teto de redirecionamentos em cascata antes de desistir. */\nconst MAX_CASCADE_REDIRECTS = 8;\n\n/**\n * `resolveRouteChain`, mas descendo sozinho quando o nó final tem filhos e nenhum conteúdo\n * próprio — o mesmo comportamento que o `RouterComponent` antigo tinha (cada nível, ao pousar\n * numa rota com `routes.length > 0`, `router.navigate([routes[0].route_redirect])`), perdido na\n * reescrita porque não existe mais uma cadeia de guardas por nível. Sem isto, clicar num nó\n * puramente organizacional (ex.: \"Solicitações\", que só agrupa Configuração/Inventário/etc. e não\n * tem `route_id` de página nenhuma) cai em \"Nenhum conteúdo disponível\" — achado real, 2026-09-28.\n */\nexport function resolveEffectiveRouteChain(\n currentRoutes: Route[],\n getLevel: (url: string) => number,\n getUrlAtLevel: (url: string, level: number) => string,\n url: string,\n): Route[] | null {\n let target = url;\n\n for (let hop = 0; hop <= MAX_CASCADE_REDIRECTS; hop++) {\n const chain = resolveRouteChain(currentRoutes, getLevel, getUrlAtLevel, target);\n if (!chain) return null;\n\n // Primeiro descendente navegável, atravessando grupos transparentes (mesma regra do\n // `findRouteThrough`). Com só `routes[0].route_redirect`, um nó cujo primeiro filho é um grupo\n // sem endereço parava em si mesmo — e o `ViewGuard` redirecionava para a própria URL, em laço.\n const next = findFirstNavigable(chain.at(-1)?.routes ?? []);\n if (!next) return chain;\n\n target = next;\n }\n\n return null;\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, Route as NgRoute, Router, RouterStateSnapshot } from '@angular/router';\nimport { AuthorizationService, ViewService } from '@orfeu/angular/core';\nimport { spineRoutesOf } from '@trismegisto/spine';\nimport { findFirstNavigable, resolveEffectiveRouteChain, resolveRouteChain } from './route-chain';\n\n/**\n * Gate de navegação REAL (deep link, F5, `router.navigateByUrl` do painel focado — ver\n * `SpineWorkspaceNavService`). Não desenha mais nada nem alimenta breadcrumb/sidebar: isso agora\n * é responsabilidade de cada painel do workspace (`resolveSpineRoute`, chamado direto por quem\n * precisa da cadeia). O guard só confirma que a URL resolve contra a view atual — senão redireciona\n * pro fallback navegável ou pra `/no-permission` — e existe numa única rota coringa (ver\n * `private.routes.ts`), não mais em 6 níveis de rota aninhada.\n *\n * Duas saídas de acesso, nesta ordem:\n * - **`/blocked`** — autenticado, mas sem nenhum grupo vinculado a esta aplicação (o token sai\n * com `badges` vazio: o argos só dá crachá por grupo do project do client). Vale mesmo que o\n * app tenha rotas públicas: quem não é de nenhum grupo do app não entra nele;\n * - **`/no-permission`** — tem grupo, mas a view não trouxe rota nenhuma (os grupos não têm\n * permissão e o app não tem rota pública).\n */\n@Injectable({ providedIn: 'root' })\nexport class ViewGuard implements CanActivate {\n constructor(\n private router: Router,\n private viewService: ViewService,\n private auth: AuthorizationService,\n ) { }\n\n canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n return this.checkRoute(state.url);\n }\n\n canActivateChild(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n return this.checkRoute(state.url);\n }\n\n canLoad(route: NgRoute): boolean {\n return this.checkRoute('/' + (route.path || ''));\n }\n\n private checkRoute(url: string): boolean {\n // Árvore com irmãos de mesmo endereço já fundidos (header + navigation \"laboratorio\") — ver `mergeRouteTree`.\n const currentRoutes = spineRoutesOf(this.viewService.currentView);\n\n if (this.auth.authenticated && !this.auth.badges.length) {\n this.router.navigate(['/blocked']);\n return false;\n }\n\n if (!currentRoutes.length) {\n this.router.navigate(['/no-permission']);\n return false;\n }\n\n const chain = resolveRouteChain(\n currentRoutes,\n (u) => this.viewService.getLevel(u),\n (u, level) => this.viewService.getUrlAtLevel(u, level),\n url,\n );\n\n if (!chain) {\n const fallback = findFirstNavigable(currentRoutes);\n this.router.navigate([fallback ?? '/no-permission']);\n return false;\n }\n\n // Pousou num nó puramente organizacional (tem filhos, nenhum conteúdo próprio — ex.:\n // \"Solicitações\", que só agrupa Configuração/Inventário/etc.) — encaminha pro primeiro filho\n // navegável, recursivamente, mesmo comportamento em cascata que o `RouterComponent` antigo\n // tinha por nível (achado real, 2026-09-28: sem isto, cai em \"Nenhum conteúdo disponível\").\n if ((chain.at(-1)?.routes?.length ?? 0) > 0) {\n const effective = resolveEffectiveRouteChain(\n currentRoutes,\n (u) => this.viewService.getLevel(u),\n (u, level) => this.viewService.getUrlAtLevel(u, level),\n url,\n );\n const target = effective?.at(-1)?.route_redirect;\n this.router.navigate([target ?? '/no-permission']);\n return false;\n }\n\n return true;\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\n\n/**\n * Manual de uma tela, declarado no `document` da própria `ComponentRoute` (mesma chave, o router_id).\n * Os textos são Markdown buscado só quando alguém abre a documentação: nos apps, um `import()` do `.md`\n * com o loader `text`, de modo que o conteúdo vai no chunk lazy da tela e não no carregamento inicial.\n */\nexport interface RouteDocument {\n /** Nome da tela no índice da documentação; se faltar, usa-se o rótulo da rota na árvore do usuário. */\n title?: string;\n /** Seção do índice em que a tela aparece; se faltar, usa-se o módulo de topo que a contém. */\n group?: string;\n /** Texto para quem usa a tela no dia a dia (normalmente o `README.md` dela). */\n load: () => Promise<string>;\n /**\n * Especificação técnica, para desenvolvimento (normalmente o `ESPECIFICACAO.md`). Só aparece com\n * `SpineConfig.technicalDocs` ativo — por padrão, apenas em `isDevMode()`.\n */\n loadTechnical?: () => Promise<string>;\n}\n\n/**\n * Uma tela do app. A chave é o ROUTER (`web.router.router_id` do client -- a posição da tela na\n * navegação, o `router_id` do nó 'page' da view), nunca o `web.routes.route_id` (a rota é só\n * nome/ícone/path, reaproveitável em vários routers). Tela de template (ex.: auto-serviço) usa\n * `source_template_router_id` -- o router do TEMPLATE, igual em todos os clients vinculados.\n */\nexport interface ComponentRoute {\n /** `router_id` (web.router do client) da tela. */\n id?: string;\n /** Componente da tela, via `import()` dinâmico (code-splitting por tela). */\n load?: () => Promise<Type<any>>;\n /** Documentação da tela, exibida pelo botão de documentação da barra da página. */\n document?: RouteDocument;\n\n /** @deprecated use `id`. Mantido para os mapas antigos (o valor sempre foi o router_id); `id` vence\n * quando os dois vêm. */\n route_id?: string;\n /** @deprecated use `load`. */\n component?: () => Promise<Type<any>>;\n\n // Alternativa a `id`: source_template_router_id casa com QUALQUER client vinculado ao\n // template de origem daquele router (uso por pacotes plugáveis tipo @trismegisto/spine/auto-service,\n // que não conhecem o router_id materializado de cada client -- só o router_id do próprio\n // template, estável). Ver ComponentDistributorService.getComponent.\n source_template_router_id?: string;\n}\n\n/** `id` (router_id) da entrada, aceitando o formato antigo (`route_id`). */\nexport function componentRouterId(route: ComponentRoute): string | undefined {\n return route.id ?? route.route_id;\n}\n\n/** @deprecated use `componentRouterId` (o id da entrada é o router_id da tela). */\nexport const componentRouteId = componentRouterId;\n\n/** Carregador da entrada, aceitando o formato antigo (`component`). */\nexport function componentRouteLoader(route: ComponentRoute): (() => Promise<Type<any>>) | undefined {\n return route.load ?? route.component;\n}\n\n// multi: true -- vários providers (o app via provideShell + pacotes plugáveis via\n// provideAutoService e afins) contribuem cada um com seu próprio array, combinados\n// pelo ComponentDistributorService.\nexport const COMPONENT_ROUTES = new InjectionToken<ComponentRoute[]>('COMPONENT_ROUTES');\n","import { Component, Inject, Injectable, Optional, Type, ChangeDetectionStrategy, computed, inject, signal } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { StatePageComponent } from '@trismegisto/angular';\nimport { ComponentRoute, COMPONENT_ROUTES, componentRouterId, componentRouteLoader } from './component-routes.token';\nimport { SPINE_MESSAGES } from '@trismegisto/spine';\nimport { formatMessage } from '@trismegisto/primitives';\n\n/**\n * Componente devolvido por `getComponent` quando não há entrada registrada pro `router_id` (ou o\n * import dela falhou) — nasce via `createComponent`/`ngComponentOutlet` em `SpinePagePanelComponent`,\n * então roda **fora** do encapsulamento de estilo de quem o monta e precisa do próprio CSS (as\n * custom properties `--hm-*` herdam normalmente pela árvore, encapsulamento não bloqueia isso).\n *\n * Aqui a rota EXISTE na árvore (por isso chegou um `router_id`), só falta a tela publicada por trás — o\n * código dela vai na descrição pra quem opera saber o que registrar, e o botão devolve pra raiz do\n * app. A ilustração é a `IllustrationNotFoundComponent` (ver o componente pra origem/licenciamento do\n * desenho).\n */\n@Component({\n selector: 'spine-no-content',\n // Página pronta do hermes (`hm-state-page`, tipo \"no-content\"): título, ilustração e ação vêm de\n // lá; aqui só entra a descrição com o código da rota pra quem opera saber o que registrar.\n template: `<hm-state-page kind=\"no-content\" [description]=\"description()\" (actionTriggered)=\"irParaInicio()\" />`,\n // O painel do workspace é coluna flex: o host cresce pra ocupar a área toda e centralizar.\n styles: [`:host { display: flex; flex-direction: column; flex: 1; min-block-size: 100%; }`],\n imports: [StatePageComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nclass NoContentComponent {\n private readonly distributor = inject(ComponentDistributorService);\n private readonly text = inject(SPINE_MESSAGES).routing;\n private readonly router = inject(Router);\n\n protected readonly description = computed(() => {\n const routerId = this.distributor.lastMissingRouterId();\n return routerId ? formatMessage(this.text.notPublishedCode, { code: routerId }) : this.text.notPublished;\n });\n\n protected irParaInicio(): void {\n void this.router.navigateByUrl('/');\n }\n}\n\n/**\n * O import dinâmico falhou porque o arquivo da tela não existe mais no servidor — saiu um build novo\n * enquanto a aba estava aberta e os chunks antigos foram trocados. Mensagens dos navegadores:\n * Chrome/Edge \"Failed to fetch dynamically imported module\", Firefox \"error loading dynamically\n * imported module\", Safari \"Importing a module script failed\", webpack \"Loading chunk N failed\" /\n * `ChunkLoadError`.\n */\nexport function isChunkLoadError(err: unknown): boolean {\n const e = err as { name?: string; message?: string } | null;\n if (e?.name === 'ChunkLoadError') return true;\n return /dynamically imported module|importing a module script failed|loading (css )?chunk [\\w-]+ failed/i.test(e?.message ?? '');\n}\n\n/**\n * Componente devolvido por `getComponent` quando a tela não carrega porque a aplicação foi atualizada\n * (ver `isChunkLoadError`): em vez de \"tela não publicada\", a página pronta `outdated` do hermes, cujo\n * botão recarrega a página — a versão nova vem com os arquivos certos.\n */\n@Component({\n selector: 'spine-outdated',\n template: `<hm-state-page kind=\"outdated\" (actionTriggered)=\"recarregar()\" />`,\n styles: [`:host { display: flex; flex-direction: column; flex: 1; min-block-size: 100%; }`],\n imports: [StatePageComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nclass OutdatedComponent {\n protected recarregar(): void {\n window.location.reload();\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ComponentDistributorService {\n\n private components: ComponentRoute[];\n\n /**\n * `router_id` da última falha (sem entrada registrada ou import quebrado) — lido por\n * `NoContentComponent` pra montar a descrição (ver comentário dela). Sinal só, não por\n * instância: se dois painéis erram ao mesmo tempo, o texto de um pode piscar o código do\n * outro por um instante — aceitável, é só o que a mensagem de suporte mostra, nenhuma decisão\n * de roteamento depende disto.\n */\n readonly lastMissingRouterId = signal('');\n\n /** @deprecated use `lastMissingRouterId` (sempre foi o router_id). */\n get lastMissingRouteId() {\n return this.lastMissingRouterId;\n }\n\n // COMPONENT_ROUTES é multi: true -- cada provider (provideShell, provideAutoService,\n // etc.) contribui com seu próprio ComponentRoute[], injetado aqui como\n // ComponentRoute[][] (um array por provider). Achata numa lista só.\n constructor(@Optional() @Inject(COMPONENT_ROUTES) routes: ComponentRoute[][] | null) {\n this.components = (routes ?? []).flat();\n }\n\n /** Todas as entradas registradas (app + pacotes plugáveis) -- lidas pela documentação. */\n get entries(): readonly ComponentRoute[] {\n return this.components;\n }\n\n // A tela é identificada pelo ROUTER: primeiro o router_id do client (entrada `id` do app), depois\n // o source_template_router_id (router do template, igual em todos os clients vinculados -- é o\n // que pacotes plugáveis como o auto-serviço registram, já que o router_id da cópia muda por\n // client). Nessa ordem, uma customização feita direto no client sempre vence o componente\n // genérico do pacote.\n async getComponent(routerId: string, source_template_router_id?: string | null): Promise<Type<any>> {\n const target = routerId?.toLowerCase();\n let entry = target ? this.components.find(c => componentRouterId(c)?.toLowerCase() === target) : undefined;\n\n if (!entry && source_template_router_id) {\n const templateTarget = source_template_router_id.toLowerCase();\n entry = this.components.find(c => c.source_template_router_id?.toLowerCase() === templateTarget);\n }\n\n if (!entry) {\n this.lastMissingRouterId.set(routerId);\n return NoContentComponent;\n }\n try {\n const load = componentRouteLoader(entry);\n if (!load) throw new Error('[hermes-spine] entrada de COMPONENT_ROUTES sem `load`');\n return await load();\n } catch (err) {\n console.error(`Erro ao carregar componente para ${routerId}:`, err);\n if (isChunkLoadError(err)) return OutdatedComponent;\n this.lastMissingRouterId.set(routerId);\n return NoContentComponent;\n }\n }\n}\n","import { Type } from '@angular/core';\nimport { Route, routerIdOf } from '@trismegisto/spine';\nimport { resolveRouteChain } from './route-chain';\nimport { ComponentDistributorService } from './component-distributor.service';\n\n/**\n * Traduz uma URL na cadeia de rotas do backend (header→navigation→menu→item→submenu→page) e no\n * componente da folha — sem passar pelo `Router` do Angular. É o que torna o painel do workspace\n * possível — o `Router` tem uma URL só; um painel não-focado precisa resolver a dele de forma\n * independente. Anda-se na árvore `Route[]` que o backend manda (`ViewService.currentView`), a\n * mesma que `ViewGuard` lia.\n */\nexport interface ResolvedSpineRoute {\n /** A cadeia inteira, nível 1 (header) até onde a URL alcançar. `chain.at(-1)` é sempre o nível\n * 'page' — é dele que `component` vem. Níveis intermediários (`item`/`submenu`) com mais de um\n * irmão são o que vira aba de submenu/multipágina no painel. */\n readonly chain: Route[];\n readonly component: Type<unknown>;\n}\n\nexport async function resolveSpineRoute(\n currentRoutes: Route[],\n getLevel: (url: string) => number,\n getUrlAtLevel: (url: string, level: number) => string,\n distributor: ComponentDistributorService,\n url: string,\n): Promise<ResolvedSpineRoute | null> {\n const chain = resolveRouteChain(currentRoutes, getLevel, getUrlAtLevel, url);\n if (!chain || !chain.length) return null;\n\n const leaf = chain[chain.length - 1];\n const component = await distributor.getComponent(routerIdOf(leaf) ?? '', leaf.source_template_router_id);\n return { chain, component };\n}\n","export * from './logger.service';\nexport * from './route-id.interceptor';\nexport * from './view.guard';\nexport * from './component-routes.token';\nexport * from './component-distributor.service';\nexport * from './route-chain';\nexport * from './resolve-route';\n\n// `router/`, `navigation/submenus/`, `navigation/multipages/` e `component-factory/` ficaram\n// órfãos nesta reescrita (rota aninhada de 6 níveis do Angular → resolução por painel do\n// workspace, ver resolve-route.ts + layout/src/workspace/). Não apagados por restrição de\n// ambiente desta sessão (operação destrutiva de arquivo bloqueada) — apagar fisicamente quando\n// alguém revisar/aprovar.\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LoggerService"],"mappings":";;;;;;;;;;MAKa,aAAa,CAAA;AAD1B,IAAA,WAAA,GAAA;AAGU,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAU,EAAE,CAAC;AA2BnD,IAAA;IAzBC,IAAI,MAAM,GAAA,EAAc,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEnD,IAAA,SAAS,CAAC,MAAe,EAAA,EAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;;AAGxD,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM;QAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI;IAC5C;;AAGA,IAAA,IAAI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E,EAAE,IAAI,CAAC,yBAAyB,CAAC;AACxG,IAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;AAC7B;;ACzBA;AACA;AACA;AACA;AACA;;ACZA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"trismegisto-spine-routing.mjs","sources":["../../../projects/ui/routing/src/logger.service.ts","../../../projects/ui/routing/src/route-id.interceptor.ts","../../../projects/ui/routing/src/route-chain.ts","../../../projects/ui/routing/src/view.guard.ts","../../../projects/ui/routing/src/component-routes.token.ts","../../../projects/ui/routing/src/component-distributor.service.ts","../../../projects/ui/routing/src/resolve-route.ts","../../../projects/ui/routing/src/public-api.ts","../../../projects/ui/routing/src/trismegisto-spine-routing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { Route, routerIdOf } from '@trismegisto/spine';\n\n@Injectable({ providedIn: 'root' })\nexport class LoggerService {\n\n private _logger = new BehaviorSubject<Route[]>([]);\n\n get logger(): Route[] { return this._logger.value; }\n\n setLogger(logger: Route[]) { this._logger.next(logger); }\n\n /** A página atual (último nó da cadeia do painel focado). */\n get page(): Route | null {\n const entries = this.logger;\n return entries[entries.length - 1] ?? null;\n }\n\n /** `router_id` da página atual -- a identidade da TELA no spine (componente, documento, descrição). */\n get routerId(): string | null {\n return routerIdOf(this.page);\n }\n\n /**\n * A ROTA da página atual (`web.routes.route_id`, o `routed_id` do nó) -- o que vai em `x-route-id`\n * e vira `audit.events.route_id`/`route_name`. Só quando o último nó é uma página de verdade (tem\n * router): grupo puramente organizacional não é tela. Antes de 2026-10-05 ia o router_id aqui, e a\n * auditoria não achava o nome (o argos-auth-server ainda traduz router_id → rota, por compatibilidade).\n */\n get routeId(): string | null {\n const page = this.page;\n return page && routerIdOf(page) ? page.routed_id ?? null : null;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { SPINE_CONFIG } from '@trismegisto/spine';\nimport { LoggerService } from './logger.service';\n\n/** Must match `@orfeu/node`/`orfeu` (Python)'s `ROUTE_ID_HEADER` (`x-route-id`). */\nexport const ROUTE_ID_HEADER = 'X-Route-Id';\n/** Must match `@orfeu/node`/`orfeu` (Python)'s `CLIENT_ID_HEADER` (`x-client-id`): which app (client) the action came from. */\nexport const CLIENT_ID_HEADER = 'X-Client-Id';\n\n/**\n * Attaches the current screen's ROUTE id — `web.routes.route_id` of the page node (`routed_id`), NOT the\n * `router_id` the spine uses to identify the screen (see `LoggerService.routeId`) — and the app's `clientId`\n * from `SpineConfig` as headers on every outgoing HTTP\n * request, read from `LoggerService` (updated by `ViewGuard` on every\n * navigation — see view.guard.ts). This is a caller-supplied correlation tag\n * consumed by Orfeu's structured operation logs to correlate an\n * operation_id with the route that triggered it; it is never verified\n * server-side and never used for permission checks.\n *\n * Applied globally (registered once by `provideShell`, not per-service) so\n * every app gets the correlation for free — an extra header a third-party\n * API doesn't recognize is harmless, so there's no need to scope this to\n * only Orfeu-guarded backends.\n */\n@Injectable()\nexport class RouteIdInterceptor implements HttpInterceptor {\n private readonly clientId = inject(SPINE_CONFIG, { optional: true })?.clientId;\n\n constructor(private loggerService: LoggerService) {}\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n const setHeaders: Record<string, string> = {};\n if (!req.headers.has(ROUTE_ID_HEADER)) {\n const routeId = this.loggerService.routeId;\n if (routeId) setHeaders[ROUTE_ID_HEADER] = routeId;\n }\n if (this.clientId && !req.headers.has(CLIENT_ID_HEADER)) setHeaders[CLIENT_ID_HEADER] = this.clientId;\n\n return Object.keys(setHeaders).length ? next.handle(req.clone({ setHeaders })) : next.handle(req);\n }\n}\n","import { Route } from '@trismegisto/spine';\n\n/**\n * Lógica pura de resolução da árvore de rotas vinda do backend (`ViewService.currentView`) —\n * compartilhada entre `ViewGuard` (gate de navegação real) e `resolveSpineRoute` (resolução por\n * painel do workspace, sem depender do `Router`). Extraída daqui porque as duas precisavam do\n * mesmo algoritmo de busca e tinham cópias divergentes antes desta reescrita.\n */\n\n/** Acha uma rota cujo `route_redirect` bate com `urlAtLevel`, atravessando ancestrais\n * \"transparentes\" (sem `route_redirect` próprio — só agrupam os filhos). */\nexport function findRouteThrough(routes: Route[], urlAtLevel: string): Route | null {\n const direct = routes.find((r) => r.route_redirect === urlAtLevel);\n if (direct) return direct;\n\n for (const transparent of routes.filter((r) => !r.route_redirect)) {\n const found = findRouteThrough(transparent.routes ?? [], urlAtLevel);\n if (found) return found;\n }\n\n return null;\n}\n\n/** Primeira rota navegável (DFS), atravessando grupos transparentes — usada como fallback\n * quando a URL alvo não bate com nada na view atual. */\nexport function findFirstNavigable(routes: Route[]): string | null {\n for (const r of routes || []) {\n if (!r) continue;\n if (r.route_redirect) return r.route_redirect;\n if (r.routes?.length) {\n const found = findFirstNavigable(r.routes);\n if (found) return found;\n }\n }\n return null;\n}\n\n/**\n * Resolve a cadeia INTEIRA de rotas (header→navigation→menu→item→submenu→page, até onde a URL\n * for funda) pra uma URL qualquer, lendo só `currentRoutes`/`getLevel`/`getUrlAtLevel` — as\n * mesmas três primitivas que `ViewGuard` já usava, sem tocar no `Router`. `chain[0]` é o nível 1\n * (header), não existe nível 0 — mantém a mesma convenção 1-based do `ViewGuard` original.\n */\nexport function resolveRouteChain(\n currentRoutes: Route[],\n getLevel: (url: string) => number,\n getUrlAtLevel: (url: string, level: number) => string,\n url: string,\n): Route[] | null {\n if (!currentRoutes.length) return null;\n\n const levels = getLevel(url);\n const chain: Route[] = [];\n let pool = currentRoutes;\n\n for (let level = 1; level <= levels; level++) {\n const urlAtLevel = getUrlAtLevel(url, level);\n const found = findRouteThrough(pool, urlAtLevel);\n if (!found) return null;\n chain.push(found);\n pool = found.routes ?? [];\n }\n\n return chain;\n}\n\n/** Teto de redirecionamentos em cascata antes de desistir. */\nconst MAX_CASCADE_REDIRECTS = 8;\n\n/**\n * `resolveRouteChain`, mas descendo sozinho quando o nó final tem filhos e nenhum conteúdo\n * próprio — o mesmo comportamento que o `RouterComponent` antigo tinha (cada nível, ao pousar\n * numa rota com `routes.length > 0`, `router.navigate([routes[0].route_redirect])`), perdido na\n * reescrita porque não existe mais uma cadeia de guardas por nível. Sem isto, clicar num nó\n * puramente organizacional (ex.: \"Solicitações\", que só agrupa Configuração/Inventário/etc. e não\n * tem `route_id` de página nenhuma) cai em \"Nenhum conteúdo disponível\" — achado real, 2026-09-28.\n */\nexport function resolveEffectiveRouteChain(\n currentRoutes: Route[],\n getLevel: (url: string) => number,\n getUrlAtLevel: (url: string, level: number) => string,\n url: string,\n): Route[] | null {\n let target = url;\n\n for (let hop = 0; hop <= MAX_CASCADE_REDIRECTS; hop++) {\n const chain = resolveRouteChain(currentRoutes, getLevel, getUrlAtLevel, target);\n if (!chain) return null;\n\n // Primeiro descendente navegável, atravessando grupos transparentes (mesma regra do\n // `findRouteThrough`). Com só `routes[0].route_redirect`, um nó cujo primeiro filho é um grupo\n // sem endereço parava em si mesmo — e o `ViewGuard` redirecionava para a própria URL, em laço.\n const next = findFirstNavigable(chain.at(-1)?.routes ?? []);\n if (!next) return chain;\n\n target = next;\n }\n\n return null;\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivate, Route as NgRoute, Router, RouterStateSnapshot } from '@angular/router';\nimport { AuthorizationService, ViewService } from '@orfeu/angular/core';\nimport { spineRoutesOf } from '@trismegisto/spine';\nimport { findFirstNavigable, resolveEffectiveRouteChain, resolveRouteChain } from './route-chain';\n\n/**\n * Gate de navegação REAL (deep link, F5, `router.navigateByUrl` do painel focado — ver\n * `SpineWorkspaceNavService`). Não desenha mais nada nem alimenta breadcrumb/sidebar: isso agora\n * é responsabilidade de cada painel do workspace (`resolveSpineRoute`, chamado direto por quem\n * precisa da cadeia). O guard só confirma que a URL resolve contra a view atual — senão redireciona\n * pro fallback navegável ou pra `/no-permission` — e existe numa única rota coringa (ver\n * `private.routes.ts`), não mais em 6 níveis de rota aninhada.\n *\n * Duas saídas de acesso, nesta ordem:\n * - **`/blocked`** — autenticado, mas sem nenhum grupo vinculado a esta aplicação (o token sai\n * com `badges` vazio: o argos só dá crachá por grupo do project do client). Vale mesmo que o\n * app tenha rotas públicas: quem não é de nenhum grupo do app não entra nele;\n * - **`/no-permission`** — tem grupo, mas a view não trouxe rota nenhuma (os grupos não têm\n * permissão e o app não tem rota pública).\n */\n@Injectable({ providedIn: 'root' })\nexport class ViewGuard implements CanActivate {\n constructor(\n private router: Router,\n private viewService: ViewService,\n private auth: AuthorizationService,\n ) { }\n\n canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n return this.checkRoute(state.url);\n }\n\n canActivateChild(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n return this.checkRoute(state.url);\n }\n\n canLoad(route: NgRoute): boolean {\n return this.checkRoute('/' + (route.path || ''));\n }\n\n private checkRoute(url: string): boolean {\n // Árvore com irmãos de mesmo endereço já fundidos (header + navigation \"laboratorio\") — ver `mergeRouteTree`.\n const currentRoutes = spineRoutesOf(this.viewService.currentView);\n\n if (this.auth.authenticated && !this.auth.badges.length) {\n this.router.navigate(['/blocked']);\n return false;\n }\n\n if (!currentRoutes.length) {\n this.router.navigate(['/no-permission']);\n return false;\n }\n\n const chain = resolveRouteChain(\n currentRoutes,\n (u) => this.viewService.getLevel(u),\n (u, level) => this.viewService.getUrlAtLevel(u, level),\n url,\n );\n\n if (!chain) {\n const fallback = findFirstNavigable(currentRoutes);\n this.router.navigate([fallback ?? '/no-permission']);\n return false;\n }\n\n // Pousou num nó puramente organizacional (tem filhos, nenhum conteúdo próprio — ex.:\n // \"Solicitações\", que só agrupa Configuração/Inventário/etc.) — encaminha pro primeiro filho\n // navegável, recursivamente, mesmo comportamento em cascata que o `RouterComponent` antigo\n // tinha por nível (achado real, 2026-09-28: sem isto, cai em \"Nenhum conteúdo disponível\").\n if ((chain.at(-1)?.routes?.length ?? 0) > 0) {\n const effective = resolveEffectiveRouteChain(\n currentRoutes,\n (u) => this.viewService.getLevel(u),\n (u, level) => this.viewService.getUrlAtLevel(u, level),\n url,\n );\n const target = effective?.at(-1)?.route_redirect;\n this.router.navigate([target ?? '/no-permission']);\n return false;\n }\n\n return true;\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\n\n/**\n * Manual de uma tela, declarado no `document` da própria `ComponentRoute` (mesma chave, o router_id).\n * Os textos são Markdown buscado só quando alguém abre a documentação: nos apps, um `import()` do `.md`\n * com o loader `text`, de modo que o conteúdo vai no chunk lazy da tela e não no carregamento inicial.\n */\nexport interface RouteDocument {\n /** Nome da tela no índice da documentação; se faltar, usa-se o rótulo da rota na árvore do usuário. */\n title?: string;\n /** Seção do índice em que a tela aparece; se faltar, usa-se o módulo de topo que a contém. */\n group?: string;\n /** Texto para quem usa a tela no dia a dia (normalmente o `README.md` dela). */\n load: () => Promise<string>;\n /**\n * Especificação técnica, para desenvolvimento (normalmente o `ESPECIFICACAO.md`). Só aparece com\n * `SpineConfig.technicalDocs` ativo — por padrão, apenas em `isDevMode()`.\n */\n loadTechnical?: () => Promise<string>;\n}\n\n/**\n * Uma tela do app. A chave é o ROUTER (`web.router.router_id` do client -- a posição da tela na\n * navegação, o `router_id` do nó 'page' da view), nunca o `web.routes.route_id` (a rota é só\n * nome/ícone/path, reaproveitável em vários routers). Tela de template (ex.: auto-serviço) usa\n * `source_template_router_id` -- o router do TEMPLATE, igual em todos os clients vinculados.\n */\nexport interface ComponentRoute {\n /** `router_id` (web.router do client) da tela. */\n id?: string;\n /** Componente da tela, via `import()` dinâmico (code-splitting por tela). */\n load?: () => Promise<Type<any>>;\n /** Documentação da tela, exibida pelo botão de documentação da barra da página. */\n document?: RouteDocument;\n\n // Alternativa a `id`: source_template_router_id casa com QUALQUER client vinculado ao\n // template de origem daquele router (uso por pacotes plugáveis tipo @trismegisto/spine/auto-service,\n // que não conhecem o router_id materializado de cada client -- só o router_id do próprio\n // template, estável). Ver ComponentDistributorService.getComponent.\n source_template_router_id?: string;\n}\n\n/** `id` (router_id) da entrada. O formato antigo (`route_id`) saiu na 3.3.1. */\nexport function componentRouterId(route: ComponentRoute): string | undefined {\n return route.id;\n}\n\n/** Carregador da entrada. O formato antigo (`component`) saiu na 3.3.1. */\nexport function componentRouteLoader(route: ComponentRoute): (() => Promise<Type<any>>) | undefined {\n return route.load;\n}\n\n// multi: true -- vários providers (o app via provideShell + pacotes plugáveis via\n// provideAutoService e afins) contribuem cada um com seu próprio array, combinados\n// pelo ComponentDistributorService.\nexport const COMPONENT_ROUTES = new InjectionToken<ComponentRoute[]>('COMPONENT_ROUTES');\n","import { Component, Inject, Injectable, Optional, Type, ChangeDetectionStrategy, computed, inject, signal } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { StatePageComponent } from '@trismegisto/angular';\nimport { ComponentRoute, COMPONENT_ROUTES, componentRouterId, componentRouteLoader } from './component-routes.token';\nimport { SPINE_MESSAGES } from '@trismegisto/spine';\nimport { formatMessage } from '@trismegisto/primitives';\n\n/**\n * Componente devolvido por `getComponent` quando não há entrada registrada pro `router_id` (ou o\n * import dela falhou) — nasce via `createComponent`/`ngComponentOutlet` em `SpinePagePanelComponent`,\n * então roda **fora** do encapsulamento de estilo de quem o monta e precisa do próprio CSS (as\n * custom properties `--hm-*` herdam normalmente pela árvore, encapsulamento não bloqueia isso).\n *\n * Aqui a rota EXISTE na árvore (por isso chegou um `router_id`), só falta a tela publicada por trás — o\n * código dela vai na descrição pra quem opera saber o que registrar, e o botão devolve pra raiz do\n * app. A ilustração é a `IllustrationNotFoundComponent` (ver o componente pra origem/licenciamento do\n * desenho).\n */\n@Component({\n selector: 'spine-no-content',\n // Página pronta do hermes (`hm-state-page`, tipo \"no-content\"): título, ilustração e ação vêm de\n // lá; aqui só entra a descrição com o código da rota pra quem opera saber o que registrar.\n template: `<hm-state-page kind=\"no-content\" [description]=\"description()\" (actionTriggered)=\"irParaInicio()\" />`,\n // O painel do workspace é coluna flex: o host cresce pra ocupar a área toda e centralizar.\n styles: [`:host { display: flex; flex-direction: column; flex: 1; min-block-size: 100%; }`],\n imports: [StatePageComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nclass NoContentComponent {\n private readonly distributor = inject(ComponentDistributorService);\n private readonly text = inject(SPINE_MESSAGES).routing;\n private readonly router = inject(Router);\n\n protected readonly description = computed(() => {\n const routerId = this.distributor.lastMissingRouterId();\n return routerId ? formatMessage(this.text.notPublishedCode, { code: routerId }) : this.text.notPublished;\n });\n\n protected irParaInicio(): void {\n void this.router.navigateByUrl('/');\n }\n}\n\n/**\n * O import dinâmico falhou porque o arquivo da tela não existe mais no servidor — saiu um build novo\n * enquanto a aba estava aberta e os chunks antigos foram trocados. Mensagens dos navegadores:\n * Chrome/Edge \"Failed to fetch dynamically imported module\", Firefox \"error loading dynamically\n * imported module\", Safari \"Importing a module script failed\", webpack \"Loading chunk N failed\" /\n * `ChunkLoadError`.\n */\nexport function isChunkLoadError(err: unknown): boolean {\n const e = err as { name?: string; message?: string } | null;\n if (e?.name === 'ChunkLoadError') return true;\n return /dynamically imported module|importing a module script failed|loading (css )?chunk [\\w-]+ failed/i.test(e?.message ?? '');\n}\n\n/**\n * Componente devolvido por `getComponent` quando a tela não carrega porque a aplicação foi atualizada\n * (ver `isChunkLoadError`): em vez de \"tela não publicada\", a página pronta `outdated` do hermes, cujo\n * botão recarrega a página — a versão nova vem com os arquivos certos.\n */\n@Component({\n selector: 'spine-outdated',\n template: `<hm-state-page kind=\"outdated\" (actionTriggered)=\"recarregar()\" />`,\n styles: [`:host { display: flex; flex-direction: column; flex: 1; min-block-size: 100%; }`],\n imports: [StatePageComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nclass OutdatedComponent {\n protected recarregar(): void {\n window.location.reload();\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ComponentDistributorService {\n\n private components: ComponentRoute[];\n\n /**\n * `router_id` da última falha (sem entrada registrada ou import quebrado) — lido por\n * `NoContentComponent` pra montar a descrição (ver comentário dela). Sinal só, não por\n * instância: se dois painéis erram ao mesmo tempo, o texto de um pode piscar o código do\n * outro por um instante — aceitável, é só o que a mensagem de suporte mostra, nenhuma decisão\n * de roteamento depende disto.\n */\n readonly lastMissingRouterId = signal('');\n\n // COMPONENT_ROUTES é multi: true -- cada provider (provideShell, provideAutoService,\n // etc.) contribui com seu próprio ComponentRoute[], injetado aqui como\n // ComponentRoute[][] (um array por provider). Achata numa lista só.\n constructor(@Optional() @Inject(COMPONENT_ROUTES) routes: ComponentRoute[][] | null) {\n this.components = (routes ?? []).flat();\n }\n\n /** Todas as entradas registradas (app + pacotes plugáveis) -- lidas pela documentação. */\n get entries(): readonly ComponentRoute[] {\n return this.components;\n }\n\n // A tela é identificada pelo ROUTER: primeiro o router_id do client (entrada `id` do app), depois\n // o source_template_router_id (router do template, igual em todos os clients vinculados -- é o\n // que pacotes plugáveis como o auto-serviço registram, já que o router_id da cópia muda por\n // client). Nessa ordem, uma customização feita direto no client sempre vence o componente\n // genérico do pacote.\n async getComponent(routerId: string, source_template_router_id?: string | null): Promise<Type<any>> {\n const target = routerId?.toLowerCase();\n let entry = target ? this.components.find(c => componentRouterId(c)?.toLowerCase() === target) : undefined;\n\n if (!entry && source_template_router_id) {\n const templateTarget = source_template_router_id.toLowerCase();\n entry = this.components.find(c => c.source_template_router_id?.toLowerCase() === templateTarget);\n }\n\n if (!entry) {\n this.lastMissingRouterId.set(routerId);\n return NoContentComponent;\n }\n try {\n const load = componentRouteLoader(entry);\n if (!load) throw new Error('[hermes-spine] entrada de COMPONENT_ROUTES sem `load`');\n return await load();\n } catch (err) {\n console.error(`Erro ao carregar componente para ${routerId}:`, err);\n if (isChunkLoadError(err)) return OutdatedComponent;\n this.lastMissingRouterId.set(routerId);\n return NoContentComponent;\n }\n }\n}\n","import { Type } from '@angular/core';\nimport { Route, routerIdOf } from '@trismegisto/spine';\nimport { resolveRouteChain } from './route-chain';\nimport { ComponentDistributorService } from './component-distributor.service';\n\n/**\n * Traduz uma URL na cadeia de rotas do backend (header→navigation→menu→item→submenu→page) e no\n * componente da folha — sem passar pelo `Router` do Angular. É o que torna o painel do workspace\n * possível — o `Router` tem uma URL só; um painel não-focado precisa resolver a dele de forma\n * independente. Anda-se na árvore `Route[]` que o backend manda (`ViewService.currentView`), a\n * mesma que `ViewGuard` lia.\n */\nexport interface ResolvedSpineRoute {\n /** A cadeia inteira, nível 1 (header) até onde a URL alcançar. `chain.at(-1)` é sempre o nível\n * 'page' — é dele que `component` vem. Níveis intermediários (`item`/`submenu`) com mais de um\n * irmão são o que vira aba de submenu/multipágina no painel. */\n readonly chain: Route[];\n readonly component: Type<unknown>;\n}\n\nexport async function resolveSpineRoute(\n currentRoutes: Route[],\n getLevel: (url: string) => number,\n getUrlAtLevel: (url: string, level: number) => string,\n distributor: ComponentDistributorService,\n url: string,\n): Promise<ResolvedSpineRoute | null> {\n const chain = resolveRouteChain(currentRoutes, getLevel, getUrlAtLevel, url);\n if (!chain || !chain.length) return null;\n\n const leaf = chain[chain.length - 1];\n const component = await distributor.getComponent(routerIdOf(leaf) ?? '', leaf.source_template_router_id);\n return { chain, component };\n}\n","export * from './logger.service';\nexport * from './route-id.interceptor';\nexport * from './view.guard';\nexport * from './component-routes.token';\nexport * from './component-distributor.service';\nexport * from './route-chain';\nexport * from './resolve-route';\n\n// `router/`, `navigation/submenus/`, `navigation/multipages/` e `component-factory/` (a rota aninhada de 6\n// níveis do Angular, trocada pela resolução por painel do workspace: resolve-route.ts + layout/src/workspace/)\n// eram órfãos sem export e saíram na 3.3.1.\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LoggerService"],"mappings":";;;;;;;;;;MAKa,aAAa,CAAA;AAD1B,IAAA,WAAA,GAAA;AAGU,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAU,EAAE,CAAC;AA2BnD,IAAA;IAzBC,IAAI,MAAM,GAAA,EAAc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