ngx-kit 7.3.3 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
- package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
- package/fesm2022/ngx-kit-date-picker.mjs +27 -22
- package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs +6 -5
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-media-control-mse-media-engine-CtP97cb9.mjs +326 -0
- package/fesm2022/ngx-kit-media-control-mse-media-engine-CtP97cb9.mjs.map +1 -0
- package/fesm2022/ngx-kit-media-control.mjs +1847 -0
- package/fesm2022/ngx-kit-media-control.mjs.map +1 -0
- package/media-control/README.md +349 -0
- package/package.json +5 -1
- package/types/ngx-kit-date-picker.d.ts +1 -1
- package/types/ngx-kit-dialog.d.ts +1 -2
- package/types/ngx-kit-media-control.d.ts +671 -0
|
@@ -147,8 +147,9 @@ class NgxDialogConfig {
|
|
|
147
147
|
const DIALOG_DATA = new InjectionToken('NGX_DIALOG_DATA');
|
|
148
148
|
const DIALOG_REF = new InjectionToken('NGX_DIALOG_REF');
|
|
149
149
|
/** The resolved config for the dialog currently being rendered. */
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const NGX_DIALOG_CONFIG = new InjectionToken('NGX_DIALOG_CONFIG', {
|
|
151
|
+
factory: () => new NgxDialogConfig(),
|
|
152
|
+
});
|
|
152
153
|
/** The arbitrary content component passed to `open()`, projected via `*ngComponentOutlet`. */
|
|
153
154
|
const DIALOG_CONTENT = new InjectionToken('NGX_DIALOG_CONTENT');
|
|
154
155
|
|
|
@@ -234,7 +235,7 @@ class NgxDialogHeader {
|
|
|
234
235
|
if (this.showCloseButton()) {
|
|
235
236
|
const closeBtn = this.document.createElement('button');
|
|
236
237
|
closeBtn.type = 'button';
|
|
237
|
-
closeBtn.className = 'ngx-dialog-action-btn';
|
|
238
|
+
closeBtn.className = 'ngx-dialog-action-btn close-btn';
|
|
238
239
|
closeBtn.setAttribute('aria-label', 'Close');
|
|
239
240
|
closeBtn.setAttribute('title', 'Close');
|
|
240
241
|
closeBtn.innerHTML = CLOSE_ICON_SVG;
|
|
@@ -420,7 +421,7 @@ function provideNgxDialog(config) {
|
|
|
420
421
|
return makeEnvironmentProviders([
|
|
421
422
|
{
|
|
422
423
|
provide: NGX_DIALOG_CONFIG,
|
|
423
|
-
useValue: { ...
|
|
424
|
+
useValue: { ...new NgxDialogConfig(), ...(config || {}) },
|
|
424
425
|
},
|
|
425
426
|
NgxDialogService,
|
|
426
427
|
provideEnvironmentInitializer(() => {
|
|
@@ -504,5 +505,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
|
|
|
504
505
|
* Generated bundle index. Do not edit.
|
|
505
506
|
*/
|
|
506
507
|
|
|
507
|
-
export { DIALOG_CONTENT, DIALOG_DATA, DIALOG_REF, Dialog, NGX_DIALOG_CONFIG,
|
|
508
|
+
export { DIALOG_CONTENT, DIALOG_DATA, DIALOG_REF, Dialog, NGX_DIALOG_CONFIG, NgxDialogBody, NgxDialogComponent, NgxDialogConfig, NgxDialogFooter, NgxDialogHeader, NgxDialogModule, NgxDialogService, provideNgxDialog };
|
|
508
509
|
//# sourceMappingURL=ngx-kit-dialog.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-kit-dialog.mjs","sources":["../../../projects/libs/dialog/configs/dialog-ref.ts","../../../projects/libs/dialog/configs/dialog-config.ts","../../../projects/libs/dialog/tokens/dialog.tokens.ts","../../../projects/libs/dialog/directives/footer.directive.ts","../../../projects/libs/dialog/directives/header.directive.ts","../../../projects/libs/dialog/components/ngx-dialog.component.ts","../../../projects/libs/dialog/components/ngx-dialog.component.html","../../../projects/libs/dialog/services/ngx-dialog.service.ts","../../../projects/libs/dialog/dialog.facade.ts","../../../projects/libs/dialog/ngx-dialog.provider.ts","../../../projects/libs/dialog/directives/body.directive.ts","../../../projects/libs/dialog/ngx-dialog.module.ts","../../../projects/libs/dialog/ngx-kit-dialog.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { OverlayRef } from 'ngx-kit/core';\n\nlet uniqueId = 0;\nfunction nextDialogId(): string {\n uniqueId += 1;\n return `ngx-dialog-${Date.now().toString(36)}-${uniqueId}`;\n}\n\nexport class NgxDialogRef<R = any> {\n readonly id = nextDialogId();\n\n /** true from the moment `close()` is called, even before teardown finishes. */\n readonly closing = signal(false);\n /** true once the dialog has been fully removed from the DOM. */\n readonly closed = signal(false);\n\n private readonly _afterClosed = new Subject<R | undefined>();\n /** Emits the result exactly once, after the dialog has been fully torn down. */\n readonly afterClosed: Observable<R | undefined> = this._afterClosed.asObservable();\n\n /** @internal set by the layout directives; read by NgxDialogBody to size itself. */\n readonly headerEl = signal<HTMLElement | null>(null);\n /** @internal */\n readonly footerEl = signal<HTMLElement | null>(null);\n /** @internal */\n readonly bodyEl = signal<HTMLElement | null>(null);\n /** @internal the dialog panel's own host element. */\n readonly panelEl = signal<HTMLElement | null>(null);\n\n /** Optional synchronous guard - return `false` to prevent Escape/outside-click from closing. */\n beforeClose?: () => boolean;\n\n private overlayRef?: OverlayRef<unknown>;\n private result: R | undefined;\n\n /** @internal used by NgxDialogService right after creating the overlay. */\n _attachOverlayRef(ref: OverlayRef<unknown>): void {\n this.overlayRef = ref;\n }\n\n /** @internal used by the header/footer/body directives and the panel component. */\n _setHeaderElement(el: HTMLElement | null): void {\n this.headerEl.set(el);\n }\n /** @internal */\n _setFooterElement(el: HTMLElement | null): void {\n this.footerEl.set(el);\n }\n /** @internal */\n _setBodyElement(el: HTMLElement | null): void {\n this.bodyEl.set(el);\n }\n /** @internal */\n _setPanelElement(el: HTMLElement | null): void {\n this.panelEl.set(el);\n }\n\n /** Closes the dialog and emits `result` on `afterClosed` once torn down. Idempotent. */\n close(result?: R): void {\n if (this.closing() || this.closed()) {\n return;\n }\n this.closing.set(true);\n this.result = result;\n this.overlayRef?.close();\n }\n\n /** @internal called by NgxDialogService's `onClosed` callback once the overlay is fully torn down. */\n _finalizeClose(): void {\n if (this.closed()) {\n return;\n }\n this.closed.set(true);\n this._afterClosed.next(this.result);\n this._afterClosed.complete();\n }\n}\n","import { Injector } from '@angular/core';\nimport { NgxDialogFooterAlign } from '../directives/footer.directive';\n\nexport type NgxDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport interface NgxDialogHeaderConfig {\n enable?: boolean;\n title?: string;\n showCloseButton?: boolean;\n showMaximizeButton?: boolean;\n}\n\nexport interface NgxDialogFooterConfig {\n enable?: boolean;\n /** Text for the auto-generated close button. Default: 'Close'. */\n closeText?: string;\n align?: NgxDialogFooterAlign;\n}\n\n/**\n * BREAKING CHANGE from the previous version of this config:\n * - `allowCloseOnOutsideClick` -> `closeOnOutsideClick` (naming now matches\n * `ngx-kit/overlay`'s options, which this service is built directly on).\n * - `header`/`footer` are now actually wired up (previously declared but\n * unused) - set `enable: true` to get an automatic header/footer without\n * having to place the `ngxDialogHeader`/`ngxDialogFooter` directives\n * yourself inside the content component.\n */\nexport class NgxDialogConfig<DataType = any> {\n /** Data made available to the content component (and to `ngx-dialog-panel`\n * itself) via the `DIALOG_DATA` injection token. */\n data?: DataType = {} as DataType;\n\n /** Named size preset - sets sensible min/max width bounds. Combine with\n * `width`/`maxWidth`/... for full manual control. */\n size?: NgxDialogSize;\n width?: string;\n minWidth?: string;\n maxWidth?: string;\n height?: string;\n minHeight?: string;\n maxHeight?: string;\n\n /** Extra class(es) on the dialog panel (the `ngx-dialog-panel` host). */\n panelClass?: string | string[] = 'ngx-kit';\n /** Extra class(es) on the backdrop element behind the panel. */\n backdropClass?: string | string[] = 'ngx-dialog-backdrop';\n\n header?: NgxDialogHeaderConfig = {\n enable: false,\n showCloseButton: true,\n showMaximizeButton: true,\n };\n footer?: NgxDialogFooterConfig = { enable: false, align: 'end' };\n\n /** Close when clicking outside the panel. Default: false (modal by default). */\n closeOnOutsideClick?: boolean = false;\n /** Close on Escape. Default: true. */\n closeOnEscape?: boolean = true;\n /** Shorthand for `closeOnOutsideClick: false, closeOnEscape: false` - the\n * dialog can then only be closed programmatically (e.g. via its own\n * buttons calling `dialogRef.close()`). */\n disableClose?: boolean = false;\n /** Synchronous guard consulted before Escape/outside-click would close the\n * dialog - return `false` to block it (e.g. unsaved changes). Does not\n * affect a programmatic `dialogRef.close()` call. */\n beforeClose?: () => boolean;\n\n /** Prevent the page behind the dialog from scrolling while it's open. Default: true. */\n lockBodyScroll?: boolean = true;\n /** Move focus into the dialog on open. Default: true. */\n autoFocus?: boolean = true;\n /** Restore focus to the previously focused element on close. Default: true. */\n restoreFocus?: boolean = true;\n /** Render via the native Popover API when supported. Default: true. */\n usePopover?: boolean = true;\n\n role?: 'dialog' | 'alertdialog' = 'dialog';\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n\n /** Entry animation for the panel. Default: 'zoom'. */\n animation?: 'zoom' | 'fade' | 'slide-up' | 'none' = 'zoom';\n\n /** Parent injector for the content component (and `ngx-dialog-panel`\n * itself). Defaults to the root injector. */\n injector?: Injector;\n\n constructor(init?: Partial<NgxDialogConfig<DataType>>) {\n Object.assign(this, init);\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\nimport { NgxDialogConfig } from '../configs/dialog-config';\nimport { NgxDialogRef } from '../configs/dialog-ref';\n\nexport const DIALOG_DATA = new InjectionToken<any>('NGX_DIALOG_DATA');\nexport const DIALOG_REF = new InjectionToken<NgxDialogRef<any>>('NGX_DIALOG_REF');\n/** The resolved config for the dialog currently being rendered. */\n\nexport const NGX_DIALOG_DEFAULT_CONFIG = new NgxDialogConfig();\nexport const NGX_DIALOG_CONFIG = new InjectionToken<NgxDialogConfig<any>>('NGX_NGX_DIALOG_CONFIG');\n/** The arbitrary content component passed to `open()`, projected via `*ngComponentOutlet`. */\nexport const DIALOG_CONTENT = new InjectionToken<Type<any>>('NGX_DIALOG_CONTENT');\n","import { Directive, ElementRef, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../tokens/dialog.tokens';\n\nexport type NgxDialogFooterAlign = 'start' | 'end' | 'center' | 'space-between' | 'space-around';\n\n@Directive({\n selector: 'ngx-dialog-footer,[ngxDialogFooter]',\n standalone: true,\n host: {\n class: 'dialog-footer',\n '[class.align-start]': 'align() === \"start\"',\n '[class.align-end]': 'align() === \"end\"',\n '[class.align-space-between]': 'align() === \"space-between\"',\n '[class.align-center]': 'align() === \"center\"',\n '[class.align-space-around]': 'align() === \"space-around\"',\n },\n exportAs: 'ngxDialogFooter',\n})\nexport class NgxDialogFooter implements OnInit, OnDestroy {\n readonly align = input<NgxDialogFooterAlign>('end');\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly dialogRef = inject(DIALOG_REF);\n\n ngOnInit(): void {\n this.dialogRef._setFooterElement(this.el.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.dialogRef._setFooterElement(null);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, OnInit } from '@angular/core';\nimport { DIALOG_REF, NGX_DIALOG_CONFIG } from '../tokens/dialog.tokens';\nimport { NgxDraggable } from 'ngx-kit/drag-resize';\nimport { DIALOG_OVERLAY_CLASSNAME } from 'ngx-kit/core';\n\nconst CLOSE_ICON_SVG = `<svg width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 320 512\" aria-hidden=\"true\">\n <path d=\"M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z\"/>\n </svg>`;\nconst MAXIMIZE_ICON_SVG = `<svg name=\"maximize\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.4852 16.5149C6.9104 15.9401 7.00595 13.4982 7.00595 13.4982M7.4852 16.5149C8.06001 17.0897 10.5019 16.994 10.5019 16.994M7.4852 16.5149L11 13M16.5149 7.48512C15.9401 6.91031 13.4982 7.00596 13.4982 7.00596M16.5149 7.48512C17.0897 8.05993 16.994 10.5018 16.994 10.5018M16.5149 7.48512L13 11\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z\" stroke-width=\"1.5\"/>\n</svg>`;\nconst RESTORE_ICON_SVG = `<svg name=\"restore\" stroke=\"currentColor\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z\" stroke-width=\"1.5\"/>\n<path d=\"M12.9833 11.0167C12.4085 10.4419 12.5041 8 12.5041 8M12.9833 11.0167C13.5581 11.5915 16 11.4958 16 11.4958M12.9833 11.0167L17 7M11.0131 12.9868C10.4383 12.412 7.99641 12.5077 7.99641 12.5077M11.0131 12.9868C11.5879 13.5616 11.4922 16.0035 11.4922 16.0035M11.0131 12.9868L7 16.9999\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\n@Directive({\n selector: 'ngx-dialog-header,[ngxDialogHeader]',\n standalone: true,\n hostDirectives: [NgxDraggable],\n host: { class: 'dialog-header' },\n exportAs: 'ngxDialogHeader',\n})\nexport class NgxDialogHeader implements OnInit {\n private config = inject(NGX_DIALOG_CONFIG);\n readonly showCloseButton = input(this.config.header?.showCloseButton ?? true);\n readonly showMaximizeButton = input(this.config.header?.showMaximizeButton ?? true);\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef<HTMLElement>);\n private readonly document = inject(DOCUMENT);\n private readonly dialogRef = inject(DIALOG_REF);\n\n private readonly drag = inject(NgxDraggable);\n\n private isMaximized = false;\n\n ngOnInit(): void {\n this.drag.dragRootElement.set('.ngx-ui-overlay');\n this.drag.dragHandle.set('.dialog-header-title');\n // Wrap the existing (Angular-rendered) header content in a title span by\n // MOVING the actual DOM nodes, not by re-serializing/re-parsing\n // `innerHTML`. The original implementation did\n // `el.innerHTML = '<span>' + el.innerHTML + '</span>'`, which silently\n // destroys any event listeners or component state living inside the\n // header content (anything beyond static text) because the browser\n // throws away and re-parses the whole subtree.\n const titleWrapper = this.document.createElement('span');\n titleWrapper.className = 'dialog-header-title';\n while (this.el.nativeElement.firstChild) {\n titleWrapper.appendChild(this.el.nativeElement.firstChild);\n }\n this.el.nativeElement.appendChild(titleWrapper);\n if (this.showMaximizeButton()) {\n const fullScreenBtn = this.document.createElement('button');\n fullScreenBtn.type = 'button';\n fullScreenBtn.className = 'ngx-dialog-action-btn';\n fullScreenBtn.setAttribute('aria-label', 'Maximaize');\n fullScreenBtn.setAttribute('title', 'Maximaize');\n fullScreenBtn.innerHTML = MAXIMIZE_ICON_SVG;\n fullScreenBtn.addEventListener('click', (ev: Event) => this.fullScreen(ev));\n this.el.nativeElement.appendChild(fullScreenBtn);\n }\n if (this.showCloseButton()) {\n const closeBtn = this.document.createElement('button');\n closeBtn.type = 'button';\n closeBtn.className = 'ngx-dialog-action-btn';\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('title', 'Close');\n closeBtn.innerHTML = CLOSE_ICON_SVG;\n closeBtn.addEventListener('click', () => this.dialogRef.close());\n this.el.nativeElement.appendChild(closeBtn);\n }\n\n this.dialogRef._setHeaderElement(this.el.nativeElement);\n }\n\n private fullScreen(ev: Event) {\n const overlay = this.el.nativeElement.closest(`.${DIALOG_OVERLAY_CLASSNAME}`);\n this.isMaximized = !this.isMaximized;\n this.drag.disabled.set(this.isMaximized);\n if (overlay) {\n overlay.classList.toggle('ngx-dialog-fullscreen');\n const btn = ev.currentTarget as HTMLButtonElement;\n btn.innerHTML = this.isMaximized ? RESTORE_ICON_SVG : MAXIMIZE_ICON_SVG;\n btn.setAttribute('aria-label', this.isMaximized ? 'Restore' : 'Maximaize');\n btn.setAttribute('title', this.isMaximized ? 'Restore' : 'Maximaize');\n }\n }\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, computed, inject } from '@angular/core';\nimport { NGX_DIALOG_CONFIG, DIALOG_CONTENT, DIALOG_REF } from '../tokens/dialog.tokens';\nimport { NgxDialogFooter } from '../directives/footer.directive';\nimport { NgxDialogHeader } from '../directives/header.directive';\n\n/**\n * The dialog \"panel\" shell. It no longer owns the backdrop, centering,\n * focus trap, Escape handling or outside-click handling - all of that now\n * lives in `OverlayService`, which this component is rendered inside of.\n * This is intentionally a thin, fully signal-driven shell: no\n * `AfterViewInit`, no manual `ChangeDetectorRef.detectChanges()`, no\n * imperative style writes. Angular schedules change detection automatically\n * whenever a signal read from the template changes, including in zoneless\n * apps.\n */\n@Component({\n selector: 'ngx-dialog-panel',\n standalone: true,\n imports: [NgComponentOutlet, NgxDialogHeader, NgxDialogFooter],\n templateUrl: './ngx-dialog.component.html',\n styleUrl: './ngx-dialog.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ngx-dialog-panel',\n '[class]': 'sizeClass()',\n },\n})\nexport class NgxDialogComponent {\n protected readonly dialogRef = inject(DIALOG_REF);\n protected readonly config = inject(NGX_DIALOG_CONFIG);\n protected readonly content = inject(DIALOG_CONTENT);\n\n protected readonly sizeClass = computed(() =>\n this.config.size ? `ngx-dialog-size-${this.config.size}` : '',\n );\n\n constructor() {\n this.dialogRef._setPanelElement(inject(ElementRef<HTMLElement>).nativeElement);\n }\n}\n","@if (config.header?.enable) {\n <div\n ngxDialogHeader\n [showCloseButton]=\"config.header?.showCloseButton ?? true\"\n [showMaximizeButton]=\"config.header?.showMaximizeButton ?? true\">\n {{ config.header?.title }}\n </div>\n}\n\n<ng-container *ngComponentOutlet=\"content\" />\n\n@if (config.footer?.enable) {\n <div ngxDialogFooter [align]=\"config.footer?.align ?? 'end'\">\n <button type=\"button\" class=\"ngx-dialog-default-close-btn\" (click)=\"dialogRef.close()\">\n {{ config.footer?.closeText ?? 'Close' }}\n </button>\n </div>\n}\n","import { Injectable, Injector, Type, computed, inject, signal } from '@angular/core';\nimport { OverlayService, OverlayOptions } from 'ngx-kit/core';\nimport { NgxDialogRef } from '../configs/dialog-ref';\nimport { NgxDialogConfig } from '../configs/dialog-config';\nimport {\n NGX_DIALOG_CONFIG,\n DIALOG_CONTENT,\n DIALOG_DATA,\n DIALOG_REF,\n} from '../tokens/dialog.tokens';\nimport { NgxDialogComponent } from '../components/ngx-dialog.component';\n\n@Injectable({ providedIn: 'root' })\nexport class NgxDialogService {\n private readonly overlay = inject(OverlayService);\n private readonly injector = inject(Injector);\n\n private readonly _openRefs = signal<NgxDialogRef<any>[]>([]);\n /** Every currently open dialog, oldest first. */\n readonly openDialogs = this._openRefs.asReadonly();\n /** How many dialogs are currently open. */\n readonly openCount = computed(() => this._openRefs().length);\n readonly defaultConfig = inject(NGX_DIALOG_CONFIG);\n /**\n * Opens `content` inside a dialog panel and returns a ref you can use to\n * close it and read the result back (`afterClosed`).\n */\n open<R = any, DataType = any>(\n content: Type<any>,\n config?: Partial<NgxDialogConfig<DataType>>,\n ): NgxDialogRef<R> {\n const resolvedConfig = { ...this.defaultConfig, ...config };\n const dialogRef = new NgxDialogRef<R>();\n dialogRef.beforeClose = resolvedConfig.beforeClose;\n\n const componentInjector = Injector.create({\n providers: [\n { provide: DIALOG_DATA, useValue: resolvedConfig.data },\n { provide: DIALOG_REF, useValue: dialogRef },\n { provide: NGX_DIALOG_CONFIG, useValue: resolvedConfig },\n { provide: DIALOG_CONTENT, useValue: content },\n ],\n parent: resolvedConfig.injector ?? this.injector,\n });\n\n const disableClose = resolvedConfig.disableClose ?? false;\n\n const overlayRef = this.overlay.open<NgxDialogComponent>({\n component: NgxDialogComponent,\n injector: componentInjector,\n placement: 'center',\n alignment: 'center',\n margin: 0,\n role: resolvedConfig.role ?? 'dialog',\n ariaModal: true,\n ariaLabel: resolvedConfig.ariaLabel,\n ariaLabelledby: resolvedConfig.ariaLabelledby,\n ariaDescribedby: resolvedConfig.ariaDescribedby,\n usePopover: resolvedConfig.usePopover ?? true,\n closeOnEscape: disableClose ? false : (resolvedConfig.closeOnEscape ?? true),\n closeOnOutsideClick: disableClose ? false : (resolvedConfig.closeOnOutsideClick ?? false),\n canClose: () => dialogRef.beforeClose?.() ?? true,\n restoreFocus: resolvedConfig.restoreFocus ?? true,\n autoFocus: resolvedConfig.autoFocus ?? true,\n lockBodyScroll: resolvedConfig.lockBodyScroll ?? true,\n backdropClass: resolvedConfig.backdropClass,\n panelClass: resolvedConfig.panelClass,\n configure: (_instance, ref) => this.applySizing(ref.nativeElement, resolvedConfig),\n onClosed: () => {\n this._openRefs.update((refs) => refs.filter((r) => r !== dialogRef));\n dialogRef._finalizeClose();\n },\n } satisfies OverlayOptions<NgxDialogComponent>);\n\n dialogRef._attachOverlayRef(overlayRef);\n this._openRefs.update((refs) => [...refs, dialogRef]);\n return dialogRef;\n }\n\n /** Closes every currently open dialog (ignores `disableClose`/guards - use sparingly, e.g. on logout). */\n closeAll(): void {\n [...this._openRefs()].forEach((ref) => ref.close());\n }\n\n private applySizing(el: HTMLElement | null, config: NgxDialogConfig): void {\n if (!el) return;\n if (config.width) el.style.width = config.width;\n if (config.minWidth) el.style.minWidth = config.minWidth;\n if (config.maxWidth) el.style.maxWidth = config.maxWidth;\n if (config.height) el.style.height = config.height;\n if (config.minHeight) el.style.minHeight = config.minHeight;\n if (config.maxHeight) el.style.maxHeight = config.maxHeight;\n }\n}\n","import { Type } from '@angular/core';\nimport { NgxDialogConfig } from './configs/dialog-config';\nimport { NgxDialogRef } from './configs/dialog-ref';\nimport { NgxDialogService } from './services/ngx-dialog.service';\n\nconst NOT_INITIALIZED_MESSAGE =\n '[ngx-kit/dialog] Dialog.* was called before provideNgxDialog() ran. ' +\n 'Add provideNgxDialog() to your app providers, or inject NgxDialogService directly instead of using the static Dialog API.';\n\n/**\n * Static convenience API over `NgxDialogService`, so you can call\n * `Dialog.open(...)` from anywhere without injecting the service manually.\n *\n * SSR note: the instance backing this static class is process-wide, not\n * per-request, so it is deliberately left unset on the server (see\n * `provideNgxDialog()`). Inject `NgxDialogService` directly in SSR code paths.\n */\nexport class Dialog {\n private static serviceInstance: NgxDialogService | null = null;\n\n /** @internal set by `provideNgxDialog()`'s environment initializer. */\n static _setService(svc: NgxDialogService): void {\n this.serviceInstance = svc;\n }\n\n private static get service(): NgxDialogService {\n if (!this.serviceInstance) {\n throw new Error(NOT_INITIALIZED_MESSAGE);\n }\n return this.serviceInstance;\n }\n\n static open<R = any, DataType = any>(\n component: Type<any>,\n config?: Partial<NgxDialogConfig<DataType>>,\n ): NgxDialogRef<R> {\n return this.service.open<R, DataType>(component, config);\n }\n\n static closeAll(): void {\n this.service.closeAll();\n }\n}\n","import {\n EnvironmentProviders,\n PLATFORM_ID,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\nimport { NgxDialogService } from './services/ngx-dialog.service';\nimport { Dialog } from './dialog.facade';\nimport { NgxDialogConfig } from './configs/dialog-config';\nimport { NGX_DIALOG_CONFIG, NGX_DIALOG_DEFAULT_CONFIG } from './tokens/dialog.tokens';\n\nexport function provideNgxDialog(config?: NgxDialogConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: NGX_DIALOG_CONFIG,\n useValue: { ...NGX_DIALOG_DEFAULT_CONFIG, ...(config || {}) },\n },\n NgxDialogService,\n provideEnvironmentInitializer(() => {\n if (isPlatformServer(inject(PLATFORM_ID))) {\n return;\n }\n\n Dialog._setService(inject(NgxDialogService));\n }),\n ]);\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n HostListener,\n Renderer2,\n effect,\n inject,\n} from '@angular/core';\nimport { DIALOG_REF } from '../tokens/dialog.tokens';\n\n/**\n * Why this can't be pure CSS flexbox: the header/body/footer elements are\n * *grandchildren* of the dialog panel (panel -> `*ngComponentOutlet`'s host\n * element -> header/body/footer), not direct children, because the content\n * component that hosts them is arbitrary and we don't control its own host\n * styling. `display:flex;flex-direction:column` on the panel therefore can't\n * size the body against the header/footer through that extra layer, so we\n * measure and set an explicit `max-height` instead, driven by a\n * `ResizeObserver` on the panel (not a `window:resize` listener, so it also\n * reacts to the dialog itself changing size, e.g. via `config.size`).\n */\n@Directive({\n selector: 'ngx-dialog-body,[ngxDialogBody]',\n standalone: true,\n host: { class: 'dialog-body' },\n exportAs: 'ngxDialogBody',\n})\nexport class NgxDialogBody {\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly renderer = inject(Renderer2);\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.dialogRef._setBodyElement(this.el.nativeElement);\n this.destroyRef.onDestroy(() => this.dialogRef._setBodyElement(null));\n effect((onCleanup) => {\n const panel = this.dialogRef.panelEl();\n if (!panel || typeof ResizeObserver === 'undefined') {\n return;\n }\n const recompute = (): void => this.recomputeHeight(panel);\n\n const observer = new ResizeObserver(recompute);\n observer.observe(panel);\n recompute();\n onCleanup(() => observer.disconnect());\n });\n }\n\n private recomputeHeight(panel: HTMLElement): void {\n const headerHeight = this.dialogRef.headerEl()?.offsetHeight ?? 0;\n const footerHeight = this.dialogRef.footerEl()?.offsetHeight ?? 0;\n const panelHeight = Math.min(panel.clientHeight, window.innerHeight);\n const available = panelHeight - headerHeight - footerHeight;\n console.log('available', available);\n if (available > 0) {\n this.renderer.setStyle(this.el.nativeElement, 'max-height', `${available}px`);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { NgxDialogBody } from './directives/body.directive';\nimport { NgxDialogFooter } from './directives/footer.directive';\nimport { NgxDialogHeader } from './directives/header.directive';\nimport { NgxDialogComponent } from './components/ngx-dialog.component';\n\n@NgModule({\n declarations: [],\n imports: [NgxDialogComponent, NgxDialogHeader, NgxDialogFooter, NgxDialogBody],\n exports: [NgxDialogComponent, NgxDialogHeader, NgxDialogFooter, NgxDialogBody],\n})\nexport class NgxDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAIA,IAAI,QAAQ,GAAG,CAAC;AAChB,SAAS,YAAY,GAAA;IACnB,QAAQ,IAAI,CAAC;AACb,IAAA,OAAO,CAAA,WAAA,EAAc,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA,CAAA,EAAI,QAAQ,EAAE;AAC5D;MAEa,YAAY,CAAA;IACd,EAAE,GAAG,YAAY,EAAE;;IAGnB,OAAO,GAAG,MAAM,CAAC,KAAK;gFAAC;;IAEvB,MAAM,GAAG,MAAM,CAAC,KAAK;+EAAC;AAEd,IAAA,YAAY,GAAG,IAAI,OAAO,EAAiB;;AAEnD,IAAA,WAAW,GAA8B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;;IAGzE,QAAQ,G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projects/libs/dialog/configs/dialog-ref.ts","../../../projects/libs/dialog/configs/dialog-config.ts","../../../projects/libs/dialog/tokens/dialog.tokens.ts","../../../projects/libs/dialog/directives/footer.directive.ts","../../../projects/libs/dialog/directives/header.directive.ts","../../../projects/libs/dialog/components/ngx-dialog.component.ts","../../../projects/libs/dialog/components/ngx-dialog.component.html","../../../projects/libs/dialog/services/ngx-dialog.service.ts","../../../projects/libs/dialog/dialog.facade.ts","../../../projects/libs/dialog/ngx-dialog.provider.ts","../../../projects/libs/dialog/directives/body.directive.ts","../../../projects/libs/dialog/ngx-dialog.module.ts","../../../projects/libs/dialog/ngx-kit-dialog.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { OverlayRef } from 'ngx-kit/core';\n\nlet uniqueId = 0;\nfunction nextDialogId(): string {\n uniqueId += 1;\n return `ngx-dialog-${Date.now().toString(36)}-${uniqueId}`;\n}\n\nexport class NgxDialogRef<R = any> {\n readonly id = nextDialogId();\n\n /** true from the moment `close()` is called, even before teardown finishes. */\n readonly closing = signal(false);\n /** true once the dialog has been fully removed from the DOM. */\n readonly closed = signal(false);\n\n private readonly _afterClosed = new Subject<R | undefined>();\n /** Emits the result exactly once, after the dialog has been fully torn down. */\n readonly afterClosed: Observable<R | undefined> = this._afterClosed.asObservable();\n\n /** @internal set by the layout directives; read by NgxDialogBody to size itself. */\n readonly headerEl = signal<HTMLElement | null>(null);\n /** @internal */\n readonly footerEl = signal<HTMLElement | null>(null);\n /** @internal */\n readonly bodyEl = signal<HTMLElement | null>(null);\n /** @internal the dialog panel's own host element. */\n readonly panelEl = signal<HTMLElement | null>(null);\n\n /** Optional synchronous guard - return `false` to prevent Escape/outside-click from closing. */\n beforeClose?: () => boolean;\n\n private overlayRef?: OverlayRef<unknown>;\n private result: R | undefined;\n\n /** @internal used by NgxDialogService right after creating the overlay. */\n _attachOverlayRef(ref: OverlayRef<unknown>): void {\n this.overlayRef = ref;\n }\n\n /** @internal used by the header/footer/body directives and the panel component. */\n _setHeaderElement(el: HTMLElement | null): void {\n this.headerEl.set(el);\n }\n /** @internal */\n _setFooterElement(el: HTMLElement | null): void {\n this.footerEl.set(el);\n }\n /** @internal */\n _setBodyElement(el: HTMLElement | null): void {\n this.bodyEl.set(el);\n }\n /** @internal */\n _setPanelElement(el: HTMLElement | null): void {\n this.panelEl.set(el);\n }\n\n /** Closes the dialog and emits `result` on `afterClosed` once torn down. Idempotent. */\n close(result?: R): void {\n if (this.closing() || this.closed()) {\n return;\n }\n this.closing.set(true);\n this.result = result;\n this.overlayRef?.close();\n }\n\n /** @internal called by NgxDialogService's `onClosed` callback once the overlay is fully torn down. */\n _finalizeClose(): void {\n if (this.closed()) {\n return;\n }\n this.closed.set(true);\n this._afterClosed.next(this.result);\n this._afterClosed.complete();\n }\n}\n","import { Injector } from '@angular/core';\nimport { NgxDialogFooterAlign } from '../directives/footer.directive';\n\nexport type NgxDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\nexport interface NgxDialogHeaderConfig {\n enable?: boolean;\n title?: string;\n showCloseButton?: boolean;\n showMaximizeButton?: boolean;\n}\n\nexport interface NgxDialogFooterConfig {\n enable?: boolean;\n /** Text for the auto-generated close button. Default: 'Close'. */\n closeText?: string;\n align?: NgxDialogFooterAlign;\n}\n\n/**\n * BREAKING CHANGE from the previous version of this config:\n * - `allowCloseOnOutsideClick` -> `closeOnOutsideClick` (naming now matches\n * `ngx-kit/overlay`'s options, which this service is built directly on).\n * - `header`/`footer` are now actually wired up (previously declared but\n * unused) - set `enable: true` to get an automatic header/footer without\n * having to place the `ngxDialogHeader`/`ngxDialogFooter` directives\n * yourself inside the content component.\n */\nexport class NgxDialogConfig<DataType = any> {\n /** Data made available to the content component (and to `ngx-dialog-panel`\n * itself) via the `DIALOG_DATA` injection token. */\n data?: DataType = {} as DataType;\n\n /** Named size preset - sets sensible min/max width bounds. Combine with\n * `width`/`maxWidth`/... for full manual control. */\n size?: NgxDialogSize;\n width?: string;\n minWidth?: string;\n maxWidth?: string;\n height?: string;\n minHeight?: string;\n maxHeight?: string;\n\n /** Extra class(es) on the dialog panel (the `ngx-dialog-panel` host). */\n panelClass?: string | string[] = 'ngx-kit';\n /** Extra class(es) on the backdrop element behind the panel. */\n backdropClass?: string | string[] = 'ngx-dialog-backdrop';\n\n header?: NgxDialogHeaderConfig = {\n enable: false,\n showCloseButton: true,\n showMaximizeButton: true,\n };\n footer?: NgxDialogFooterConfig = { enable: false, align: 'end' };\n\n /** Close when clicking outside the panel. Default: false (modal by default). */\n closeOnOutsideClick?: boolean = false;\n /** Close on Escape. Default: true. */\n closeOnEscape?: boolean = true;\n /** Shorthand for `closeOnOutsideClick: false, closeOnEscape: false` - the\n * dialog can then only be closed programmatically (e.g. via its own\n * buttons calling `dialogRef.close()`). */\n disableClose?: boolean = false;\n /** Synchronous guard consulted before Escape/outside-click would close the\n * dialog - return `false` to block it (e.g. unsaved changes). Does not\n * affect a programmatic `dialogRef.close()` call. */\n beforeClose?: () => boolean;\n\n /** Prevent the page behind the dialog from scrolling while it's open. Default: true. */\n lockBodyScroll?: boolean = true;\n /** Move focus into the dialog on open. Default: true. */\n autoFocus?: boolean = true;\n /** Restore focus to the previously focused element on close. Default: true. */\n restoreFocus?: boolean = true;\n /** Render via the native Popover API when supported. Default: true. */\n usePopover?: boolean = true;\n\n role?: 'dialog' | 'alertdialog' = 'dialog';\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n\n /** Entry animation for the panel. Default: 'zoom'. */\n animation?: 'zoom' | 'fade' | 'slide-up' | 'none' = 'zoom';\n\n /** Parent injector for the content component (and `ngx-dialog-panel`\n * itself). Defaults to the root injector. */\n injector?: Injector;\n\n constructor(init?: Partial<NgxDialogConfig<DataType>>) {\n Object.assign(this, init);\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\nimport { NgxDialogConfig } from '../configs/dialog-config';\nimport { NgxDialogRef } from '../configs/dialog-ref';\n\nexport const DIALOG_DATA = new InjectionToken<any>('NGX_DIALOG_DATA');\nexport const DIALOG_REF = new InjectionToken<NgxDialogRef<any>>('NGX_DIALOG_REF');\n/** The resolved config for the dialog currently being rendered. */\n\nexport const NGX_DIALOG_CONFIG = new InjectionToken<NgxDialogConfig<any>>('NGX_DIALOG_CONFIG', {\n factory: () => new NgxDialogConfig(),\n});\n/** The arbitrary content component passed to `open()`, projected via `*ngComponentOutlet`. */\nexport const DIALOG_CONTENT = new InjectionToken<Type<any>>('NGX_DIALOG_CONTENT');\n","import { Directive, ElementRef, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { DIALOG_REF } from '../tokens/dialog.tokens';\n\nexport type NgxDialogFooterAlign = 'start' | 'end' | 'center' | 'space-between' | 'space-around';\n\n@Directive({\n selector: 'ngx-dialog-footer,[ngxDialogFooter]',\n standalone: true,\n host: {\n class: 'dialog-footer',\n '[class.align-start]': 'align() === \"start\"',\n '[class.align-end]': 'align() === \"end\"',\n '[class.align-space-between]': 'align() === \"space-between\"',\n '[class.align-center]': 'align() === \"center\"',\n '[class.align-space-around]': 'align() === \"space-around\"',\n },\n exportAs: 'ngxDialogFooter',\n})\nexport class NgxDialogFooter implements OnInit, OnDestroy {\n readonly align = input<NgxDialogFooterAlign>('end');\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly dialogRef = inject(DIALOG_REF);\n\n ngOnInit(): void {\n this.dialogRef._setFooterElement(this.el.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.dialogRef._setFooterElement(null);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, OnInit } from '@angular/core';\nimport { DIALOG_REF, NGX_DIALOG_CONFIG } from '../tokens/dialog.tokens';\nimport { NgxDraggable } from 'ngx-kit/drag-resize';\nimport { DIALOG_OVERLAY_CLASSNAME } from 'ngx-kit/core';\n\nconst CLOSE_ICON_SVG = `<svg width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 320 512\" aria-hidden=\"true\">\n <path d=\"M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z\"/>\n </svg>`;\nconst MAXIMIZE_ICON_SVG = `<svg name=\"maximize\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.4852 16.5149C6.9104 15.9401 7.00595 13.4982 7.00595 13.4982M7.4852 16.5149C8.06001 17.0897 10.5019 16.994 10.5019 16.994M7.4852 16.5149L11 13M16.5149 7.48512C15.9401 6.91031 13.4982 7.00596 13.4982 7.00596M16.5149 7.48512C17.0897 8.05993 16.994 10.5018 16.994 10.5018M16.5149 7.48512L13 11\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z\" stroke-width=\"1.5\"/>\n</svg>`;\nconst RESTORE_ICON_SVG = `<svg name=\"restore\" stroke=\"currentColor\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z\" stroke-width=\"1.5\"/>\n<path d=\"M12.9833 11.0167C12.4085 10.4419 12.5041 8 12.5041 8M12.9833 11.0167C13.5581 11.5915 16 11.4958 16 11.4958M12.9833 11.0167L17 7M11.0131 12.9868C10.4383 12.412 7.99641 12.5077 7.99641 12.5077M11.0131 12.9868C11.5879 13.5616 11.4922 16.0035 11.4922 16.0035M11.0131 12.9868L7 16.9999\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\n@Directive({\n selector: 'ngx-dialog-header,[ngxDialogHeader]',\n standalone: true,\n hostDirectives: [NgxDraggable],\n host: { class: 'dialog-header' },\n exportAs: 'ngxDialogHeader',\n})\nexport class NgxDialogHeader implements OnInit {\n private config = inject(NGX_DIALOG_CONFIG);\n readonly showCloseButton = input(this.config.header?.showCloseButton ?? true);\n readonly showMaximizeButton = input(this.config.header?.showMaximizeButton ?? true);\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef<HTMLElement>);\n private readonly document = inject(DOCUMENT);\n private readonly dialogRef = inject(DIALOG_REF);\n\n private readonly drag = inject(NgxDraggable);\n\n private isMaximized = false;\n\n ngOnInit(): void {\n this.drag.dragRootElement.set('.ngx-ui-overlay');\n this.drag.dragHandle.set('.dialog-header-title');\n // Wrap the existing (Angular-rendered) header content in a title span by\n // MOVING the actual DOM nodes, not by re-serializing/re-parsing\n // `innerHTML`. The original implementation did\n // `el.innerHTML = '<span>' + el.innerHTML + '</span>'`, which silently\n // destroys any event listeners or component state living inside the\n // header content (anything beyond static text) because the browser\n // throws away and re-parses the whole subtree.\n const titleWrapper = this.document.createElement('span');\n titleWrapper.className = 'dialog-header-title';\n while (this.el.nativeElement.firstChild) {\n titleWrapper.appendChild(this.el.nativeElement.firstChild);\n }\n this.el.nativeElement.appendChild(titleWrapper);\n if (this.showMaximizeButton()) {\n const fullScreenBtn = this.document.createElement('button');\n fullScreenBtn.type = 'button';\n fullScreenBtn.className = 'ngx-dialog-action-btn';\n fullScreenBtn.setAttribute('aria-label', 'Maximaize');\n fullScreenBtn.setAttribute('title', 'Maximaize');\n fullScreenBtn.innerHTML = MAXIMIZE_ICON_SVG;\n fullScreenBtn.addEventListener('click', (ev: Event) => this.fullScreen(ev));\n this.el.nativeElement.appendChild(fullScreenBtn);\n }\n if (this.showCloseButton()) {\n const closeBtn = this.document.createElement('button');\n closeBtn.type = 'button';\n closeBtn.className = 'ngx-dialog-action-btn close-btn';\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('title', 'Close');\n closeBtn.innerHTML = CLOSE_ICON_SVG;\n closeBtn.addEventListener('click', () => this.dialogRef.close());\n this.el.nativeElement.appendChild(closeBtn);\n }\n\n this.dialogRef._setHeaderElement(this.el.nativeElement);\n }\n\n private fullScreen(ev: Event) {\n const overlay = this.el.nativeElement.closest(`.${DIALOG_OVERLAY_CLASSNAME}`);\n this.isMaximized = !this.isMaximized;\n this.drag.disabled.set(this.isMaximized);\n if (overlay) {\n overlay.classList.toggle('ngx-dialog-fullscreen');\n const btn = ev.currentTarget as HTMLButtonElement;\n btn.innerHTML = this.isMaximized ? RESTORE_ICON_SVG : MAXIMIZE_ICON_SVG;\n btn.setAttribute('aria-label', this.isMaximized ? 'Restore' : 'Maximaize');\n btn.setAttribute('title', this.isMaximized ? 'Restore' : 'Maximaize');\n }\n }\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, computed, inject } from '@angular/core';\nimport { NGX_DIALOG_CONFIG, DIALOG_CONTENT, DIALOG_REF } from '../tokens/dialog.tokens';\nimport { NgxDialogFooter } from '../directives/footer.directive';\nimport { NgxDialogHeader } from '../directives/header.directive';\n\n/**\n * The dialog \"panel\" shell. It no longer owns the backdrop, centering,\n * focus trap, Escape handling or outside-click handling - all of that now\n * lives in `OverlayService`, which this component is rendered inside of.\n * This is intentionally a thin, fully signal-driven shell: no\n * `AfterViewInit`, no manual `ChangeDetectorRef.detectChanges()`, no\n * imperative style writes. Angular schedules change detection automatically\n * whenever a signal read from the template changes, including in zoneless\n * apps.\n */\n@Component({\n selector: 'ngx-dialog-panel',\n standalone: true,\n imports: [NgComponentOutlet, NgxDialogHeader, NgxDialogFooter],\n templateUrl: './ngx-dialog.component.html',\n styleUrl: './ngx-dialog.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ngx-dialog-panel',\n '[class]': 'sizeClass()',\n },\n})\nexport class NgxDialogComponent {\n protected readonly dialogRef = inject(DIALOG_REF);\n protected readonly config = inject(NGX_DIALOG_CONFIG);\n protected readonly content = inject(DIALOG_CONTENT);\n\n protected readonly sizeClass = computed(() =>\n this.config.size ? `ngx-dialog-size-${this.config.size}` : '',\n );\n\n constructor() {\n this.dialogRef._setPanelElement(inject(ElementRef<HTMLElement>).nativeElement);\n }\n}\n","@if (config.header?.enable) {\n <div\n ngxDialogHeader\n [showCloseButton]=\"config.header?.showCloseButton ?? true\"\n [showMaximizeButton]=\"config.header?.showMaximizeButton ?? true\">\n {{ config.header?.title }}\n </div>\n}\n\n<ng-container *ngComponentOutlet=\"content\" />\n\n@if (config.footer?.enable) {\n <div ngxDialogFooter [align]=\"config.footer?.align ?? 'end'\">\n <button type=\"button\" class=\"ngx-dialog-default-close-btn\" (click)=\"dialogRef.close()\">\n {{ config.footer?.closeText ?? 'Close' }}\n </button>\n </div>\n}\n","import { Injectable, Injector, Type, computed, inject, signal } from '@angular/core';\nimport { OverlayService, OverlayOptions } from 'ngx-kit/core';\nimport { NgxDialogRef } from '../configs/dialog-ref';\nimport { NgxDialogConfig } from '../configs/dialog-config';\nimport {\n NGX_DIALOG_CONFIG,\n DIALOG_CONTENT,\n DIALOG_DATA,\n DIALOG_REF,\n} from '../tokens/dialog.tokens';\nimport { NgxDialogComponent } from '../components/ngx-dialog.component';\n\n@Injectable({ providedIn: 'root' })\nexport class NgxDialogService {\n private readonly overlay = inject(OverlayService);\n private readonly injector = inject(Injector);\n\n private readonly _openRefs = signal<NgxDialogRef<any>[]>([]);\n /** Every currently open dialog, oldest first. */\n readonly openDialogs = this._openRefs.asReadonly();\n /** How many dialogs are currently open. */\n readonly openCount = computed(() => this._openRefs().length);\n readonly defaultConfig = inject(NGX_DIALOG_CONFIG);\n /**\n * Opens `content` inside a dialog panel and returns a ref you can use to\n * close it and read the result back (`afterClosed`).\n */\n open<R = any, DataType = any>(\n content: Type<any>,\n config?: Partial<NgxDialogConfig<DataType>>,\n ): NgxDialogRef<R> {\n const resolvedConfig = { ...this.defaultConfig, ...config };\n const dialogRef = new NgxDialogRef<R>();\n dialogRef.beforeClose = resolvedConfig.beforeClose;\n\n const componentInjector = Injector.create({\n providers: [\n { provide: DIALOG_DATA, useValue: resolvedConfig.data },\n { provide: DIALOG_REF, useValue: dialogRef },\n { provide: NGX_DIALOG_CONFIG, useValue: resolvedConfig },\n { provide: DIALOG_CONTENT, useValue: content },\n ],\n parent: resolvedConfig.injector ?? this.injector,\n });\n\n const disableClose = resolvedConfig.disableClose ?? false;\n\n const overlayRef = this.overlay.open<NgxDialogComponent>({\n component: NgxDialogComponent,\n injector: componentInjector,\n placement: 'center',\n alignment: 'center',\n margin: 0,\n role: resolvedConfig.role ?? 'dialog',\n ariaModal: true,\n ariaLabel: resolvedConfig.ariaLabel,\n ariaLabelledby: resolvedConfig.ariaLabelledby,\n ariaDescribedby: resolvedConfig.ariaDescribedby,\n usePopover: resolvedConfig.usePopover ?? true,\n closeOnEscape: disableClose ? false : (resolvedConfig.closeOnEscape ?? true),\n closeOnOutsideClick: disableClose ? false : (resolvedConfig.closeOnOutsideClick ?? false),\n canClose: () => dialogRef.beforeClose?.() ?? true,\n restoreFocus: resolvedConfig.restoreFocus ?? true,\n autoFocus: resolvedConfig.autoFocus ?? true,\n lockBodyScroll: resolvedConfig.lockBodyScroll ?? true,\n backdropClass: resolvedConfig.backdropClass,\n panelClass: resolvedConfig.panelClass,\n configure: (_instance, ref) => this.applySizing(ref.nativeElement, resolvedConfig),\n onClosed: () => {\n this._openRefs.update((refs) => refs.filter((r) => r !== dialogRef));\n dialogRef._finalizeClose();\n },\n } satisfies OverlayOptions<NgxDialogComponent>);\n\n dialogRef._attachOverlayRef(overlayRef);\n this._openRefs.update((refs) => [...refs, dialogRef]);\n return dialogRef;\n }\n\n /** Closes every currently open dialog (ignores `disableClose`/guards - use sparingly, e.g. on logout). */\n closeAll(): void {\n [...this._openRefs()].forEach((ref) => ref.close());\n }\n\n private applySizing(el: HTMLElement | null, config: NgxDialogConfig): void {\n if (!el) return;\n if (config.width) el.style.width = config.width;\n if (config.minWidth) el.style.minWidth = config.minWidth;\n if (config.maxWidth) el.style.maxWidth = config.maxWidth;\n if (config.height) el.style.height = config.height;\n if (config.minHeight) el.style.minHeight = config.minHeight;\n if (config.maxHeight) el.style.maxHeight = config.maxHeight;\n }\n}\n","import { Type } from '@angular/core';\nimport { NgxDialogConfig } from './configs/dialog-config';\nimport { NgxDialogRef } from './configs/dialog-ref';\nimport { NgxDialogService } from './services/ngx-dialog.service';\n\nconst NOT_INITIALIZED_MESSAGE =\n '[ngx-kit/dialog] Dialog.* was called before provideNgxDialog() ran. ' +\n 'Add provideNgxDialog() to your app providers, or inject NgxDialogService directly instead of using the static Dialog API.';\n\n/**\n * Static convenience API over `NgxDialogService`, so you can call\n * `Dialog.open(...)` from anywhere without injecting the service manually.\n *\n * SSR note: the instance backing this static class is process-wide, not\n * per-request, so it is deliberately left unset on the server (see\n * `provideNgxDialog()`). Inject `NgxDialogService` directly in SSR code paths.\n */\nexport class Dialog {\n private static serviceInstance: NgxDialogService | null = null;\n\n /** @internal set by `provideNgxDialog()`'s environment initializer. */\n static _setService(svc: NgxDialogService): void {\n this.serviceInstance = svc;\n }\n\n private static get service(): NgxDialogService {\n if (!this.serviceInstance) {\n throw new Error(NOT_INITIALIZED_MESSAGE);\n }\n return this.serviceInstance;\n }\n\n static open<R = any, DataType = any>(\n component: Type<any>,\n config?: Partial<NgxDialogConfig<DataType>>,\n ): NgxDialogRef<R> {\n return this.service.open<R, DataType>(component, config);\n }\n\n static closeAll(): void {\n this.service.closeAll();\n }\n}\n","import {\n EnvironmentProviders,\n PLATFORM_ID,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\nimport { NgxDialogService } from './services/ngx-dialog.service';\nimport { Dialog } from './dialog.facade';\nimport { NgxDialogConfig } from './configs/dialog-config';\nimport { NGX_DIALOG_CONFIG } from './tokens/dialog.tokens';\n\nexport function provideNgxDialog(config?: NgxDialogConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: NGX_DIALOG_CONFIG,\n useValue: { ...new NgxDialogConfig(), ...(config || {}) },\n },\n NgxDialogService,\n provideEnvironmentInitializer(() => {\n if (isPlatformServer(inject(PLATFORM_ID))) {\n return;\n }\n\n Dialog._setService(inject(NgxDialogService));\n }),\n ]);\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n HostListener,\n Renderer2,\n effect,\n inject,\n} from '@angular/core';\nimport { DIALOG_REF } from '../tokens/dialog.tokens';\n\n/**\n * Why this can't be pure CSS flexbox: the header/body/footer elements are\n * *grandchildren* of the dialog panel (panel -> `*ngComponentOutlet`'s host\n * element -> header/body/footer), not direct children, because the content\n * component that hosts them is arbitrary and we don't control its own host\n * styling. `display:flex;flex-direction:column` on the panel therefore can't\n * size the body against the header/footer through that extra layer, so we\n * measure and set an explicit `max-height` instead, driven by a\n * `ResizeObserver` on the panel (not a `window:resize` listener, so it also\n * reacts to the dialog itself changing size, e.g. via `config.size`).\n */\n@Directive({\n selector: 'ngx-dialog-body,[ngxDialogBody]',\n standalone: true,\n host: { class: 'dialog-body' },\n exportAs: 'ngxDialogBody',\n})\nexport class NgxDialogBody {\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly renderer = inject(Renderer2);\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.dialogRef._setBodyElement(this.el.nativeElement);\n this.destroyRef.onDestroy(() => this.dialogRef._setBodyElement(null));\n effect((onCleanup) => {\n const panel = this.dialogRef.panelEl();\n if (!panel || typeof ResizeObserver === 'undefined') {\n return;\n }\n const recompute = (): void => this.recomputeHeight(panel);\n\n const observer = new ResizeObserver(recompute);\n observer.observe(panel);\n recompute();\n onCleanup(() => observer.disconnect());\n });\n }\n\n private recomputeHeight(panel: HTMLElement): void {\n const headerHeight = this.dialogRef.headerEl()?.offsetHeight ?? 0;\n const footerHeight = this.dialogRef.footerEl()?.offsetHeight ?? 0;\n const panelHeight = Math.min(panel.clientHeight, window.innerHeight);\n const available = panelHeight - headerHeight - footerHeight;\n console.log('available', available);\n if (available > 0) {\n this.renderer.setStyle(this.el.nativeElement, 'max-height', `${available}px`);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { NgxDialogBody } from './directives/body.directive';\nimport { NgxDialogFooter } from './directives/footer.directive';\nimport { NgxDialogHeader } from './directives/header.directive';\nimport { NgxDialogComponent } from './components/ngx-dialog.component';\n\n@NgModule({\n declarations: [],\n imports: [NgxDialogComponent, NgxDialogHeader, NgxDialogFooter, NgxDialogBody],\n exports: [NgxDialogComponent, NgxDialogHeader, NgxDialogFooter, NgxDialogBody],\n})\nexport class NgxDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAIA,IAAI,QAAQ,GAAG,CAAC;AAChB,SAAS,YAAY,GAAA;IACnB,QAAQ,IAAI,CAAC;AACb,IAAA,OAAO,CAAA,WAAA,EAAc,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA,CAAA,EAAI,QAAQ,EAAE;AAC5D;MAEa,YAAY,CAAA;IACd,EAAE,GAAG,YAAY,EAAE;;IAGn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AE,EAAE;oBAChB,OAAO,EAAE,CAAC,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,CAAC;oBAC9E,OAAO,EAAE,CAAC,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,CAAC;AAC/E,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { signal } from '@angular/core';
|
|
2
|
+
import { initialMediaState, hasMediaSource, NgxMediaError } from './ngx-kit-media-control.mjs';
|
|
3
|
+
|
|
4
|
+
function rangesEqual(a, b) {
|
|
5
|
+
if (a.length !== b.length)
|
|
6
|
+
return false;
|
|
7
|
+
for (let i = 0; i < a.length; i++) {
|
|
8
|
+
if (a[i].start !== b[i].start || a[i].end !== b[i].end)
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
function bufferedRanges(el) {
|
|
14
|
+
const ranges = [];
|
|
15
|
+
const b = el.buffered;
|
|
16
|
+
for (let i = 0; i < b.length; i++) {
|
|
17
|
+
ranges.push({ start: b.start(i), end: b.end(i) });
|
|
18
|
+
}
|
|
19
|
+
return ranges;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Wires the standard set of `HTMLMediaElement` events into `patch()` the
|
|
23
|
+
* same way for every engine that ultimately plays through a real media
|
|
24
|
+
* element (native, MSE, ...) — extracted so the MSE engine doesn't drift
|
|
25
|
+
* from the native engine's state-reporting behavior (buffering, seeking,
|
|
26
|
+
* volumechange, ratechange, etc. all need to reach the UI the same way
|
|
27
|
+
* regardless of which engine is currently active). Returns a cleanup
|
|
28
|
+
* function that removes every listener it added.
|
|
29
|
+
*/
|
|
30
|
+
function bindMediaElementEvents(el, patch, getState, runOutsideAngular = (fn) => fn()) {
|
|
31
|
+
const cleanupFns = [];
|
|
32
|
+
runOutsideAngular(() => {
|
|
33
|
+
const on = (type, handler) => {
|
|
34
|
+
el.addEventListener(type, handler);
|
|
35
|
+
cleanupFns.push(() => el.removeEventListener(type, handler));
|
|
36
|
+
};
|
|
37
|
+
on('waiting', () => patch({ playback: 'buffering' }));
|
|
38
|
+
on('playing', () => patch({ playback: 'playing' }));
|
|
39
|
+
on('pause', () => {
|
|
40
|
+
if (getState().playback !== 'ended')
|
|
41
|
+
patch({ playback: 'paused' });
|
|
42
|
+
});
|
|
43
|
+
on('ended', () => patch({ playback: 'ended' }));
|
|
44
|
+
on('seeked', () => patch({ playback: el.paused ? 'paused' : 'playing', currentTime: el.currentTime }));
|
|
45
|
+
on('timeupdate', () => patch({ currentTime: el.currentTime }));
|
|
46
|
+
on('durationchange', () => {
|
|
47
|
+
if (Number.isFinite(el.duration))
|
|
48
|
+
patch({ duration: el.duration });
|
|
49
|
+
});
|
|
50
|
+
on('progress', () => {
|
|
51
|
+
const ranges = bufferedRanges(el);
|
|
52
|
+
if (!rangesEqual(ranges, getState().buffered))
|
|
53
|
+
patch({ buffered: ranges });
|
|
54
|
+
});
|
|
55
|
+
on('volumechange', () => patch({ volume: el.volume, muted: el.muted }));
|
|
56
|
+
on('ratechange', () => patch({ playbackRate: el.playbackRate }));
|
|
57
|
+
});
|
|
58
|
+
return () => cleanupFns.forEach((fn) => fn());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Advanced backend for progressive/segmented delivery via MediaSource
|
|
63
|
+
* Extensions. This module is only ever reached through a dynamic `import()`
|
|
64
|
+
* so ordinary file playback never pulls it into the initial bundle.
|
|
65
|
+
*
|
|
66
|
+
* Scope note (unchanged, worth restating): this is a real, working
|
|
67
|
+
* single-SourceBuffer progressive-fetch engine — it is NOT a full
|
|
68
|
+
* adaptive-bitrate/DASH-HLS manifest player, and it does not demux/transmux
|
|
69
|
+
* arbitrary bytes into valid media segments. It assumes the response body
|
|
70
|
+
* is already a sequence of valid segments for the given mime/codecs (e.g. a
|
|
71
|
+
* server that already serves fragmented MP4/WebM appropriate for MSE).
|
|
72
|
+
* Feeding it arbitrary non-segmented bytes will fail at `appendBuffer()`,
|
|
73
|
+
* which surfaces as a `DECODER`-category `NgxMediaError`, not silently.
|
|
74
|
+
*
|
|
75
|
+
* `load()` resolves as soon as the element has enough data to start
|
|
76
|
+
* playback (`loadedmetadata`) rather than waiting for the entire response
|
|
77
|
+
* to be read — the background pump keeps appending segments after `load()`
|
|
78
|
+
* has already resolved, which is the point of "progressive" in the name.
|
|
79
|
+
*/
|
|
80
|
+
class MseMediaEngine {
|
|
81
|
+
requestHandler;
|
|
82
|
+
id = 'mse';
|
|
83
|
+
kind;
|
|
84
|
+
_state = signal(initialMediaState(), /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "_state" }] : /* istanbul ignore next */ []));
|
|
86
|
+
state = this._state.asReadonly();
|
|
87
|
+
el;
|
|
88
|
+
mediaSource = null;
|
|
89
|
+
sourceBuffer = null;
|
|
90
|
+
reader = null;
|
|
91
|
+
objectUrl = null;
|
|
92
|
+
loadController = null;
|
|
93
|
+
destroyed = false;
|
|
94
|
+
cleanupFns = [];
|
|
95
|
+
constructor(kind, requestHandler, existingElement) {
|
|
96
|
+
this.requestHandler = requestHandler;
|
|
97
|
+
if (!hasMediaSource()) {
|
|
98
|
+
throw NgxMediaError.unsupported('MediaSource Extensions are not supported in this browser.');
|
|
99
|
+
}
|
|
100
|
+
this.kind = kind;
|
|
101
|
+
this.el = existingElement ?? document.createElement(kind);
|
|
102
|
+
this.el.setAttribute('playsinline', 'true');
|
|
103
|
+
this.cleanupFns.push(bindMediaElementEvents(this.el, (p) => this.patch(p), () => this._state(), (fn) => fn()));
|
|
104
|
+
}
|
|
105
|
+
get mediaElement() {
|
|
106
|
+
return this.el;
|
|
107
|
+
}
|
|
108
|
+
async load(source, signal) {
|
|
109
|
+
if (this.destroyed)
|
|
110
|
+
throw new NgxMediaError('ABORTED', 'MSE engine has been destroyed.');
|
|
111
|
+
// A new source supersedes any previous stream. Without this, the old
|
|
112
|
+
// reader can continue fetching/appending while the new MediaSource is
|
|
113
|
+
// being opened, causing duplicate network traffic and leaked resources.
|
|
114
|
+
this.loadController?.abort();
|
|
115
|
+
this.loadController = null;
|
|
116
|
+
this.reader?.cancel().catch(() => { });
|
|
117
|
+
this.reader = null;
|
|
118
|
+
this.releaseObjectUrl();
|
|
119
|
+
const controller = new AbortController();
|
|
120
|
+
const forwardAbort = () => controller.abort();
|
|
121
|
+
if (signal?.aborted)
|
|
122
|
+
controller.abort();
|
|
123
|
+
else
|
|
124
|
+
signal?.addEventListener('abort', forwardAbort, { once: true });
|
|
125
|
+
this.loadController = controller;
|
|
126
|
+
const activeSignal = controller.signal;
|
|
127
|
+
this.patch({ playback: 'loading', currentTime: 0, duration: 0, buffered: [] });
|
|
128
|
+
const mediaSource = new MediaSource();
|
|
129
|
+
this.mediaSource = mediaSource;
|
|
130
|
+
this.objectUrl = URL.createObjectURL(mediaSource);
|
|
131
|
+
this.el.src = this.objectUrl;
|
|
132
|
+
const metadataOrError = deferred();
|
|
133
|
+
const onMetadata = () => metadataOrError.resolveIfPending();
|
|
134
|
+
this.el.addEventListener('loadedmetadata', onMetadata, { once: true });
|
|
135
|
+
const abortPromise = new Promise((_, reject) => {
|
|
136
|
+
if (activeSignal.aborted) {
|
|
137
|
+
reject(new NgxMediaError('ABORTED', 'MSE load aborted.'));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
activeSignal.addEventListener('abort', () => reject(new NgxMediaError('ABORTED', 'MSE load aborted.')), { once: true });
|
|
141
|
+
});
|
|
142
|
+
try {
|
|
143
|
+
await Promise.race([
|
|
144
|
+
new Promise((resolve, reject) => {
|
|
145
|
+
mediaSource.addEventListener('sourceopen', async () => {
|
|
146
|
+
try {
|
|
147
|
+
if (this.destroyed || activeSignal.aborted || this.mediaSource !== mediaSource) {
|
|
148
|
+
throw new NgxMediaError('ABORTED', 'MSE load superseded.');
|
|
149
|
+
}
|
|
150
|
+
const mime = source.type
|
|
151
|
+
? source.codecs
|
|
152
|
+
? `${source.type}; codecs="${source.codecs}"`
|
|
153
|
+
: source.type
|
|
154
|
+
: 'video/mp4';
|
|
155
|
+
if (!MediaSource.isTypeSupported(mime)) {
|
|
156
|
+
throw NgxMediaError.unsupported(`MSE: unsupported mime/codec combination "${mime}".`);
|
|
157
|
+
}
|
|
158
|
+
this.sourceBuffer = mediaSource.addSourceBuffer(mime);
|
|
159
|
+
this.streamInto(this.sourceBuffer, source, activeSignal)
|
|
160
|
+
.then(() => metadataOrError.resolveIfPending())
|
|
161
|
+
.catch((err) => {
|
|
162
|
+
if (!this.destroyed && this.mediaSource === mediaSource)
|
|
163
|
+
this.patch({ playback: 'error' });
|
|
164
|
+
metadataOrError.rejectIfPending(err);
|
|
165
|
+
});
|
|
166
|
+
resolve();
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
reject(err);
|
|
170
|
+
}
|
|
171
|
+
}, { once: true });
|
|
172
|
+
}),
|
|
173
|
+
abortPromise,
|
|
174
|
+
]);
|
|
175
|
+
await Promise.race([metadataOrError.promise, abortPromise]);
|
|
176
|
+
if (this.destroyed || this.mediaSource !== mediaSource) {
|
|
177
|
+
throw new NgxMediaError('ABORTED', 'MSE load was superseded.');
|
|
178
|
+
}
|
|
179
|
+
this.patch({ playback: 'ready' });
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
this.el.removeEventListener('loadedmetadata', onMetadata);
|
|
183
|
+
signal?.removeEventListener('abort', forwardAbort);
|
|
184
|
+
if (this.loadController === controller)
|
|
185
|
+
this.loadController = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async streamInto(buffer, source, signal) {
|
|
189
|
+
const response = await this.requestHandler.request(source, signal);
|
|
190
|
+
if (!response.ok) {
|
|
191
|
+
throw new NgxMediaError('NETWORK', `MSE: server responded ${response.status} for the media source.`);
|
|
192
|
+
}
|
|
193
|
+
if (!response.body) {
|
|
194
|
+
throw new NgxMediaError('NETWORK', 'Response has no readable body for MSE streaming.');
|
|
195
|
+
}
|
|
196
|
+
this.reader = response.body.getReader();
|
|
197
|
+
const pump = async () => {
|
|
198
|
+
if (this.destroyed)
|
|
199
|
+
return;
|
|
200
|
+
const { done, value } = await this.reader.read();
|
|
201
|
+
if (this.destroyed)
|
|
202
|
+
return;
|
|
203
|
+
if (done) {
|
|
204
|
+
if (this.mediaSource?.readyState === 'open')
|
|
205
|
+
this.mediaSource.endOfStream();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
await this.appendWhenReady(buffer, value);
|
|
209
|
+
return pump();
|
|
210
|
+
};
|
|
211
|
+
await pump();
|
|
212
|
+
}
|
|
213
|
+
appendWhenReady(buffer, chunk) {
|
|
214
|
+
return new Promise((resolve, reject) => {
|
|
215
|
+
if (this.destroyed) {
|
|
216
|
+
resolve();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const append = () => {
|
|
220
|
+
if (this.destroyed) {
|
|
221
|
+
resolve();
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
try {
|
|
225
|
+
buffer.appendBuffer(chunk);
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
reject(new NgxMediaError('DECODER', 'MSE: appendBuffer() rejected a chunk — the response body is not a sequence of valid media segments for this mime/codecs.', err));
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const onDone = () => {
|
|
232
|
+
buffer.removeEventListener('updateend', onDone);
|
|
233
|
+
resolve();
|
|
234
|
+
};
|
|
235
|
+
buffer.addEventListener('updateend', onDone, { once: true });
|
|
236
|
+
};
|
|
237
|
+
if (buffer.updating) {
|
|
238
|
+
buffer.addEventListener('updateend', append, { once: true });
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
append();
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
async play() {
|
|
246
|
+
if (this.destroyed)
|
|
247
|
+
throw new NgxMediaError('ABORTED', 'MSE engine has been destroyed.');
|
|
248
|
+
try {
|
|
249
|
+
await this.el.play();
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
if (err instanceof DOMException && err.name === 'NotAllowedError') {
|
|
253
|
+
throw NgxMediaError.autoplayBlocked(err);
|
|
254
|
+
}
|
|
255
|
+
throw err;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
pause() {
|
|
259
|
+
this.el.pause();
|
|
260
|
+
}
|
|
261
|
+
seek(time) {
|
|
262
|
+
this.el.currentTime = time;
|
|
263
|
+
}
|
|
264
|
+
setVolume(volume) {
|
|
265
|
+
this.el.volume = volume;
|
|
266
|
+
}
|
|
267
|
+
setMuted(muted) {
|
|
268
|
+
this.el.muted = muted;
|
|
269
|
+
}
|
|
270
|
+
setPlaybackRate(rate) {
|
|
271
|
+
this.el.playbackRate = rate;
|
|
272
|
+
}
|
|
273
|
+
destroy() {
|
|
274
|
+
if (this.destroyed)
|
|
275
|
+
return;
|
|
276
|
+
this.destroyed = true;
|
|
277
|
+
this.loadController?.abort();
|
|
278
|
+
this.loadController = null;
|
|
279
|
+
this.reader?.cancel().catch(() => { });
|
|
280
|
+
this.reader = null;
|
|
281
|
+
this.cleanupFns.forEach((fn) => fn());
|
|
282
|
+
this.cleanupFns.length = 0;
|
|
283
|
+
this.el.pause();
|
|
284
|
+
this.releaseObjectUrl();
|
|
285
|
+
this.el.removeAttribute('src');
|
|
286
|
+
this.mediaSource = null;
|
|
287
|
+
this.sourceBuffer = null;
|
|
288
|
+
this.patch({ playback: 'destroyed' });
|
|
289
|
+
}
|
|
290
|
+
releaseObjectUrl() {
|
|
291
|
+
if (this.objectUrl) {
|
|
292
|
+
URL.revokeObjectURL(this.objectUrl);
|
|
293
|
+
this.objectUrl = null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
patch(partial) {
|
|
297
|
+
this._state.update((s) => ({ ...s, ...partial }));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function deferred() {
|
|
301
|
+
let settled = false;
|
|
302
|
+
let resolveFn;
|
|
303
|
+
let rejectFn;
|
|
304
|
+
const promise = new Promise((res, rej) => {
|
|
305
|
+
resolveFn = res;
|
|
306
|
+
rejectFn = rej;
|
|
307
|
+
});
|
|
308
|
+
return {
|
|
309
|
+
promise,
|
|
310
|
+
resolveIfPending: (v) => {
|
|
311
|
+
if (!settled) {
|
|
312
|
+
settled = true;
|
|
313
|
+
resolveFn(v);
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
rejectIfPending: (e) => {
|
|
317
|
+
if (!settled) {
|
|
318
|
+
settled = true;
|
|
319
|
+
rejectFn(e);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export { MseMediaEngine };
|
|
326
|
+
//# sourceMappingURL=ngx-kit-media-control-mse-media-engine-CtP97cb9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-kit-media-control-mse-media-engine-CtP97cb9.mjs","sources":["../../../projects/libs/media-control/engines/media-element-events.ts","../../../projects/libs/media-control/engines/mse-media-engine.ts"],"sourcesContent":["import { NgxMediaState, NgxTimeRange } from '../contracts/media-state';\n\nfunction rangesEqual(a: readonly NgxTimeRange[], b: readonly NgxTimeRange[]): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].start !== b[i].start || a[i].end !== b[i].end) return false;\n }\n return true;\n}\n\nfunction bufferedRanges(el: HTMLMediaElement): NgxTimeRange[] {\n const ranges: NgxTimeRange[] = [];\n const b = el.buffered;\n for (let i = 0; i < b.length; i++) {\n ranges.push({ start: b.start(i), end: b.end(i) });\n }\n return ranges;\n}\n\n/**\n * Wires the standard set of `HTMLMediaElement` events into `patch()` the\n * same way for every engine that ultimately plays through a real media\n * element (native, MSE, ...) — extracted so the MSE engine doesn't drift\n * from the native engine's state-reporting behavior (buffering, seeking,\n * volumechange, ratechange, etc. all need to reach the UI the same way\n * regardless of which engine is currently active). Returns a cleanup\n * function that removes every listener it added.\n */\nexport function bindMediaElementEvents(\n el: HTMLMediaElement,\n patch: (partial: Partial<NgxMediaState>) => void,\n getState: () => NgxMediaState,\n runOutsideAngular: <T>(fn: () => T) => T = (fn) => fn(),\n): () => void {\n const cleanupFns: Array<() => void> = [];\n runOutsideAngular(() => {\n const on = <K extends keyof HTMLMediaElementEventMap>(\n type: K,\n handler: (ev: HTMLMediaElementEventMap[K]) => void,\n ) => {\n el.addEventListener(type, handler as EventListener);\n cleanupFns.push(() => el.removeEventListener(type, handler as EventListener));\n };\n\n on('waiting', () => patch({ playback: 'buffering' }));\n on('playing', () => patch({ playback: 'playing' }));\n on('pause', () => {\n if (getState().playback !== 'ended') patch({ playback: 'paused' });\n });\n on('ended', () => patch({ playback: 'ended' }));\n on('seeked', () => patch({ playback: el.paused ? 'paused' : 'playing', currentTime: el.currentTime }));\n on('timeupdate', () => patch({ currentTime: el.currentTime }));\n on('durationchange', () => {\n if (Number.isFinite(el.duration)) patch({ duration: el.duration });\n });\n on('progress', () => {\n const ranges = bufferedRanges(el);\n if (!rangesEqual(ranges, getState().buffered)) patch({ buffered: ranges });\n });\n on('volumechange', () => patch({ volume: el.volume, muted: el.muted }));\n on('ratechange', () => patch({ playbackRate: el.playbackRate }));\n });\n\n return () => cleanupFns.forEach((fn) => fn());\n}\n","import { signal, Signal } from '@angular/core';\nimport { NgxMediaSource } from '../contracts/media-source';\nimport { initialMediaState, NgxMediaState } from '../contracts/media-state';\nimport { NgxMediaError } from '../contracts/media-error';\nimport { NgxMediaEngine, NgxMediaKind } from './media-engine.interface';\nimport { hasMediaSource } from '../utils/capabilities';\nimport { NgxMediaRequestHandler } from '../decoders/decoder.tokens';\nimport { bindMediaElementEvents } from './media-element-events';\n\n/**\n * Advanced backend for progressive/segmented delivery via MediaSource\n * Extensions. This module is only ever reached through a dynamic `import()`\n * so ordinary file playback never pulls it into the initial bundle.\n *\n * Scope note (unchanged, worth restating): this is a real, working\n * single-SourceBuffer progressive-fetch engine — it is NOT a full\n * adaptive-bitrate/DASH-HLS manifest player, and it does not demux/transmux\n * arbitrary bytes into valid media segments. It assumes the response body\n * is already a sequence of valid segments for the given mime/codecs (e.g. a\n * server that already serves fragmented MP4/WebM appropriate for MSE).\n * Feeding it arbitrary non-segmented bytes will fail at `appendBuffer()`,\n * which surfaces as a `DECODER`-category `NgxMediaError`, not silently.\n *\n * `load()` resolves as soon as the element has enough data to start\n * playback (`loadedmetadata`) rather than waiting for the entire response\n * to be read — the background pump keeps appending segments after `load()`\n * has already resolved, which is the point of \"progressive\" in the name.\n */\nexport class MseMediaEngine implements NgxMediaEngine {\n readonly id = 'mse';\n readonly kind: NgxMediaKind;\n\n private readonly _state = signal<NgxMediaState>(initialMediaState());\n readonly state: Signal<NgxMediaState> = this._state.asReadonly();\n\n private readonly el: HTMLMediaElement;\n private mediaSource: MediaSource | null = null;\n private sourceBuffer: SourceBuffer | null = null;\n private reader: ReadableStreamDefaultReader<Uint8Array> | null = null;\n private objectUrl: string | null = null;\n private loadController: AbortController | null = null;\n private destroyed = false;\n private readonly cleanupFns: Array<() => void> = [];\n\n constructor(\n kind: NgxMediaKind,\n private readonly requestHandler: NgxMediaRequestHandler,\n existingElement?: HTMLMediaElement,\n ) {\n if (!hasMediaSource()) {\n throw NgxMediaError.unsupported('MediaSource Extensions are not supported in this browser.');\n }\n this.kind = kind;\n this.el = existingElement ?? (document.createElement(kind) as HTMLMediaElement);\n this.el.setAttribute('playsinline', 'true');\n this.cleanupFns.push(bindMediaElementEvents(this.el, (p) => this.patch(p), () => this._state(), (fn) => fn()));\n }\n\n get mediaElement(): HTMLMediaElement {\n return this.el;\n }\n\n async load(source: NgxMediaSource, signal?: AbortSignal): Promise<void> {\n if (this.destroyed) throw new NgxMediaError('ABORTED', 'MSE engine has been destroyed.');\n\n // A new source supersedes any previous stream. Without this, the old\n // reader can continue fetching/appending while the new MediaSource is\n // being opened, causing duplicate network traffic and leaked resources.\n this.loadController?.abort();\n this.loadController = null;\n this.reader?.cancel().catch(() => {});\n this.reader = null;\n this.releaseObjectUrl();\n\n const controller = new AbortController();\n const forwardAbort = () => controller.abort();\n if (signal?.aborted) controller.abort();\n else signal?.addEventListener('abort', forwardAbort, { once: true });\n this.loadController = controller;\n const activeSignal = controller.signal;\n\n this.patch({ playback: 'loading', currentTime: 0, duration: 0, buffered: [] });\n const mediaSource = new MediaSource();\n this.mediaSource = mediaSource;\n this.objectUrl = URL.createObjectURL(mediaSource);\n this.el.src = this.objectUrl;\n\n const metadataOrError = deferred<void>();\n const onMetadata = () => metadataOrError.resolveIfPending();\n this.el.addEventListener('loadedmetadata', onMetadata, { once: true });\n\n const abortPromise = new Promise<never>((_, reject) => {\n if (activeSignal.aborted) {\n reject(new NgxMediaError('ABORTED', 'MSE load aborted.'));\n return;\n }\n activeSignal.addEventListener('abort', () => reject(new NgxMediaError('ABORTED', 'MSE load aborted.')), { once: true });\n });\n\n try {\n await Promise.race([\n new Promise<void>((resolve, reject) => {\n mediaSource.addEventListener(\n 'sourceopen',\n async () => {\n try {\n if (this.destroyed || activeSignal.aborted || this.mediaSource !== mediaSource) {\n throw new NgxMediaError('ABORTED', 'MSE load superseded.');\n }\n const mime = source.type\n ? source.codecs\n ? `${source.type}; codecs=\"${source.codecs}\"`\n : source.type\n : 'video/mp4';\n if (!MediaSource.isTypeSupported(mime)) {\n throw NgxMediaError.unsupported(`MSE: unsupported mime/codec combination \"${mime}\".`);\n }\n this.sourceBuffer = mediaSource.addSourceBuffer(mime);\n this.streamInto(this.sourceBuffer, source, activeSignal)\n .then(() => metadataOrError.resolveIfPending())\n .catch((err) => {\n if (!this.destroyed && this.mediaSource === mediaSource) this.patch({ playback: 'error' });\n metadataOrError.rejectIfPending(err);\n });\n resolve();\n } catch (err) {\n reject(err);\n }\n },\n { once: true },\n );\n }),\n abortPromise,\n ]);\n\n await Promise.race([metadataOrError.promise, abortPromise]);\n if (this.destroyed || this.mediaSource !== mediaSource) {\n throw new NgxMediaError('ABORTED', 'MSE load was superseded.');\n }\n this.patch({ playback: 'ready' });\n } finally {\n this.el.removeEventListener('loadedmetadata', onMetadata);\n signal?.removeEventListener('abort', forwardAbort);\n if (this.loadController === controller) this.loadController = null;\n }\n }\n\n private async streamInto(buffer: SourceBuffer, source: NgxMediaSource, signal?: AbortSignal): Promise<void> {\n const response = await this.requestHandler.request(source, signal);\n if (!response.ok) {\n throw new NgxMediaError('NETWORK', `MSE: server responded ${response.status} for the media source.`);\n }\n if (!response.body) {\n throw new NgxMediaError('NETWORK', 'Response has no readable body for MSE streaming.');\n }\n\n this.reader = response.body.getReader();\n const pump = async (): Promise<void> => {\n if (this.destroyed) return;\n const { done, value } = await this.reader!.read();\n if (this.destroyed) return;\n if (done) {\n if (this.mediaSource?.readyState === 'open') this.mediaSource.endOfStream();\n return;\n }\n await this.appendWhenReady(buffer, value);\n return pump();\n };\n await pump();\n }\n\n private appendWhenReady(buffer: SourceBuffer, chunk: Uint8Array): Promise<void> {\n return new Promise((resolve, reject) => {\n if (this.destroyed) {\n resolve();\n return;\n }\n const append = () => {\n if (this.destroyed) {\n resolve();\n return;\n }\n try {\n buffer.appendBuffer(chunk as BufferSource);\n } catch (err) {\n reject(new NgxMediaError('DECODER', 'MSE: appendBuffer() rejected a chunk — the response body is not a sequence of valid media segments for this mime/codecs.', err));\n return;\n }\n const onDone = () => {\n buffer.removeEventListener('updateend', onDone);\n resolve();\n };\n buffer.addEventListener('updateend', onDone, { once: true });\n };\n if (buffer.updating) {\n buffer.addEventListener('updateend', append, { once: true });\n } else {\n append();\n }\n });\n }\n\n async play(): Promise<void> {\n if (this.destroyed) throw new NgxMediaError('ABORTED', 'MSE engine has been destroyed.');\n try {\n await this.el.play();\n } catch (err) {\n if (err instanceof DOMException && err.name === 'NotAllowedError') {\n throw NgxMediaError.autoplayBlocked(err);\n }\n throw err;\n }\n }\n pause(): void {\n this.el.pause();\n }\n seek(time: number): void {\n this.el.currentTime = time;\n }\n setVolume(volume: number): void {\n this.el.volume = volume;\n }\n setMuted(muted: boolean): void {\n this.el.muted = muted;\n }\n setPlaybackRate(rate: number): void {\n this.el.playbackRate = rate;\n }\n\n destroy(): void {\n if (this.destroyed) return;\n this.destroyed = true;\n this.loadController?.abort();\n this.loadController = null;\n this.reader?.cancel().catch(() => {});\n this.reader = null;\n this.cleanupFns.forEach((fn) => fn());\n this.cleanupFns.length = 0;\n this.el.pause();\n this.releaseObjectUrl();\n this.el.removeAttribute('src');\n this.mediaSource = null;\n this.sourceBuffer = null;\n this.patch({ playback: 'destroyed' });\n }\n\n private releaseObjectUrl(): void {\n if (this.objectUrl) {\n URL.revokeObjectURL(this.objectUrl);\n this.objectUrl = null;\n }\n }\n\n private patch(partial: Partial<NgxMediaState>): void {\n this._state.update((s) => ({ ...s, ...partial }));\n }\n}\n\nfunction deferred<T>(): { promise: Promise<T>; resolveIfPending: (v: T) => void; rejectIfPending: (e: unknown) => void } {\n let settled = false;\n let resolveFn!: (v: T) => void;\n let rejectFn!: (e: unknown) => void;\n const promise = new Promise<T>((res, rej) => {\n resolveFn = res;\n rejectFn = rej;\n });\n return {\n promise,\n resolveIfPending: (v) => {\n if (!settled) {\n settled = true;\n resolveFn(v);\n }\n },\n rejectIfPending: (e) => {\n if (!settled) {\n settled = true;\n rejectFn(e);\n }\n },\n };\n}\n"],"names":[],"mappings":";;;AAEA,SAAS,WAAW,CAAC,CAA0B,EAAE,CAA0B,EAAA;AACzE,IAAA,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;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