@cngx/common 0.1.0-rc.8 → 0.1.0-rc.9
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/command/README.md +29 -0
- package/data/README.md +5 -2
- package/fesm2022/cngx-common-a11y.mjs +403 -84
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +16 -13
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +4 -3
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +55 -36
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +60 -6
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +185 -37
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +86 -48
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +27 -23
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +324 -122
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +129 -26
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +947 -33
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +300 -166
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +251 -80
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +16 -10
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/layout/README.md +16 -0
- package/package.json +20 -7
- package/popover/README.md +40 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +5 -4
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +10 -6
- package/types/cngx-common-a11y.d.ts +167 -14
- package/types/cngx-common-chart.d.ts +8 -7
- package/types/cngx-common-command.d.ts +19 -2
- package/types/cngx-common-data.d.ts +164 -26
- package/types/cngx-common-dialog.d.ts +3 -7
- package/types/cngx-common-interactive.d.ts +52 -17
- package/types/cngx-common-layout.d.ts +37 -5
- package/types/cngx-common-popover.d.ts +353 -13
- package/types/cngx-common-stepper.d.ts +168 -129
- package/types/cngx-common-tabs.d.ts +149 -30
- package/types/cngx-common-timeline.d.ts +27 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-layout.mjs","sources":["../../../projects/common/layout/drawer/backdrop.directive.ts","../../../projects/common/layout/drawer/drawer.directive.ts","../../../projects/common/layout/drawer/drawer-panel.directive.ts","../../../projects/common/layout/drawer/drawer-content.directive.ts","../../../projects/common/layout/observers/intersection-observer.directive.ts","../../../projects/common/layout/observers/media-query.directive.ts","../../../projects/common/layout/observers/inject-media-query.ts","../../../projects/common/layout/router/warn-router-absent.ts","../../../projects/common/layout/router/inject-query-param-sync.ts","../../../projects/common/layout/observers/resize-signal.ts","../../../projects/common/layout/observers/resize-observer.directive.ts","../../../projects/common/layout/observers/container-size.ts","../../../projects/common/layout/observers/container.directive.ts","../../../projects/common/layout/scroll/scroll-lock-core.ts","../../../projects/common/layout/scroll/scroll-lock.directive.ts","../../../projects/common/layout/scroll/scroll-edges-core.ts","../../../projects/common/layout/scroll/scroll-edges.directive.ts","../../../projects/common/layout/text/skeleton.directive.ts","../../../projects/common/layout/scroll/infinite-scroll.directive.ts","../../../projects/common/layout/scroll/sticky-header.directive.ts","../../../projects/common/layout/scroll/scroll-spy.directive.ts","../../../projects/common/layout/text/truncate.directive.ts","../../../projects/common/layout/text/highlight.directive.ts","../../../projects/common/layout/i18n/layout-language-section.ts","../../../projects/common/layout/i18n/layout-i18n.ts","../../../projects/common/layout/text/expandable-text.ts","../../../projects/common/layout/public-api.ts","../../../projects/common/layout/cngx-common-layout.ts"],"sourcesContent":["import {\n afterNextRender,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Manages backdrop overlay behavior: visibility, click-to-close, and\n * `inert` toggling on sibling elements.\n *\n * When visible, all sibling elements of the host receive the `inert`\n * attribute, preventing focus and interaction behind the backdrop.\n * This is critical for a11y in modal/drawer overlays. A sibling drawer\n * panel (`.cngx-drawer-panel`) is excluded - it is the surface the\n * backdrop guards, not content behind it. Siblings that already carry\n * `inert` are left alone, so a consumer-set `inert` survives the\n * show/hide cycle. The sibling set is re-queried on every show, so\n * siblings rendered after init are covered too.\n *\n * The directive is purely behavioral - it toggles the\n * `.cngx-backdrop--visible` class and `aria-hidden` attribute. Visual\n * styling is opt-in: either consume the shipped default stylesheet or\n * provide your own.\n *\n * ### Drawer backdrop with shipped defaults (recommended)\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <div [cngxBackdrop]=\"drawer.opened()\" (backdropClick)=\"drawer.close()\"\n * class=\"cngx-backdrop\"></div>\n * <nav [cngxDrawerPanel]=\"drawer\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n * ```css\n * @import '@cngx/common/theming/components/cngx-backdrop.css';\n * ```\n *\n * Token surface (Three-Tier-Override):\n * - `--cngx-backdrop-bg` (scrim color, default `oklch(0 0 0 / 0.5)`)\n * - `--cngx-backdrop-transition-duration` (default `200ms`)\n *\n * ### Custom styling (no opt-in class)\n * If the shipped defaults don't fit, omit the `.cngx-backdrop` class and\n * style your own host class - the directive still toggles\n * `.cngx-backdrop--visible` on the host element.\n *\n * ```html\n * <div [cngxBackdrop]=\"visible()\" class=\"my-backdrop\"></div>\n * ```\n * ```css\n * .my-backdrop {\n * position: fixed;\n * inset: 0;\n * background: rgba(0, 0, 0, 0.3);\n * opacity: 0;\n * pointer-events: none;\n * transition: opacity 0.25s ease;\n * }\n * .my-backdrop.cngx-backdrop--visible {\n * opacity: 1;\n * pointer-events: auto;\n * }\n * ```\n *\n * @category common/layout\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/backdrop.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerPanel, CngxScrollLock\n * <example-url>http://localhost:4200/#/common/layout/backdrop/overlay-with-inert</example-url>\n */\n@Directive({\n selector: '[cngxBackdrop]',\n exportAs: 'cngxBackdrop',\n standalone: true,\n host: {\n '[class.cngx-backdrop--visible]': 'visible()',\n 'aria-hidden': 'true',\n '(click)': 'handleHostClick()',\n },\n})\nexport class CngxBackdrop {\n /** Whether the backdrop is visible and siblings are inert. */\n readonly visible = input<boolean>(false, { alias: 'cngxBackdrop' });\n /** Whether clicking the backdrop emits `backdropClick`. */\n readonly closeOnClick = input<boolean>(true);\n /** Emitted when the backdrop is clicked (and `closeOnClick` is true). */\n readonly backdropClick = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly domReady = signal(false);\n\n constructor() {\n afterNextRender(() => this.domReady.set(true));\n\n effect((onCleanup) => {\n if (!this.domReady() || !this.visible()) {\n return;\n }\n // Re-queried on every show: siblings rendered after init (@if/@defer)\n // must be inerted too. The drawer panel keeps working - it is the\n // surface the backdrop guards, not content behind it.\n const el = this.el.nativeElement as HTMLElement;\n const parent = el.parentElement;\n // skip siblings that are already inert - removing it on cleanup\n // would clobber a consumer-set attribute that predated the show\n const targets = parent\n ? Array.from(parent.children).filter(\n (child): child is HTMLElement =>\n child !== el &&\n child instanceof HTMLElement &&\n !child.classList.contains('cngx-drawer-panel') &&\n !child.hasAttribute('inert'),\n )\n : [];\n targets.forEach((target) => target.setAttribute('inert', ''));\n onCleanup(() => targets.forEach((target) => target.removeAttribute('inert')));\n });\n }\n\n /** @internal */\n protected handleHostClick(): void {\n if (this.visible() && this.closeOnClick()) {\n this.backdropClick.emit();\n }\n }\n}\n","import { computed, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n/**\n * Position from which the drawer panel slides in.\n *\n * @category common/layout\n */\nexport type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * State owner for a drawer / sidebar system.\n *\n * Holds the open/close state and handles the Escape key. Supports both\n * **controlled** (`[cngxDrawerOpened]=\"signal()\"`) and **uncontrolled**\n * (internal state via `open()` / `close()` / `toggle()`) modes.\n *\n * Child directives (`CngxDrawerPanel`, `CngxDrawerContent`) receive a\n * reference to this directive via an explicit input - no ancestor injection.\n *\n * ### Uncontrolled\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <button (click)=\"drawer.toggle()\">Menu</button>\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n *\n * ### Controlled\n * ```html\n * <div cngxDrawer [cngxDrawerOpened]=\"sidebarOpen()\"\n * (openedChange)=\"sidebarOpen.set($event)\">\n * …\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawerPanel, CngxDrawerContent, CngxBackdrop, CngxScrollLock\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawer]',\n exportAs: 'cngxDrawer',\n standalone: true,\n host: {\n '[class.cngx-drawer--opened]': 'opened()',\n '(keydown.escape)': 'close()',\n },\n})\nexport class CngxDrawer {\n /** @internal Host element ref - used by `CngxDrawerPanel` for click-outside containment. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Controlled opened state. When bound, takes precedence over internal state. */\n readonly openedInput = input<boolean | undefined>(undefined, { alias: 'cngxDrawerOpened' });\n\n private readonly openedState = signal(false);\n\n /** Resolved opened state - controlled input wins over internal state. */\n readonly opened = computed(() => this.openedInput() ?? this.openedState());\n\n /** Emitted when the opened state changes. Wire to a signal for two-way binding. */\n readonly openedChange = output<boolean>();\n /** Emitted when the drawer closes. Convenience shorthand for close-only listeners. */\n readonly closed = output<void>();\n\n /** Opens the drawer. No-op when already open. */\n open(): void {\n if (this.opened()) {\n return;\n }\n this.openedState.set(true);\n this.openedChange.emit(true);\n }\n\n /** Closes the drawer. */\n close(): void {\n if (!this.opened()) {\n return;\n }\n this.openedState.set(false);\n this.openedChange.emit(false);\n this.closed.emit();\n }\n\n /** Toggles the drawer between open and closed. */\n toggle(): void {\n if (this.opened()) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap } from 'rxjs';\nimport { createTransitionTracker } from '@cngx/core/utils';\nimport { CngxFocusTrap } from '@cngx/common/a11y';\nimport type { CngxDrawer, DrawerPosition } from './drawer.directive';\n\n/**\n * How the drawer panel interacts with the content area.\n *\n * @category common/layout\n */\nexport type DrawerMode = 'over' | 'push' | 'side';\n\n/**\n * The sliding panel of a drawer. Reads its open state from an explicit\n * `[cngxDrawerPanel]` reference - no ancestor injection.\n *\n * Composes `CngxFocusTrap` as a `hostDirective` - the consumer controls\n * the `[enabled]` and `[autoFocus]` inputs from the template.\n *\n * Optionally closes the drawer when the user clicks outside the panel\n * (`closeOnClickOutside`, default `true`). The click that opened the\n * drawer never counts as an outside click. While closed (except in\n * `side` mode) the panel is `aria-hidden` AND `inert`, so its focusable\n * children are unreachable for keyboard and AT alike. On close, focus\n * returns to the element that was focused when the drawer opened -\n * unless the user moved focus to another focusable element themselves\n * (a click on a focusable outside target keeps its focus).\n *\n * The `role` input defaults to `complementary`. On a `<nav>` host pass\n * `[role]=\"null\"` so the implicit navigation landmark survives:\n *\n * ```html\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\" mode=\"over\" [role]=\"null\"\n * [enabled]=\"drawer.opened()\" [autoFocus]=\"true\">\n * <a href=\"/home\">Home</a>\n * </nav>\n * ```\n *\n * @category common/layout\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-panel.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerContent, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerPanel]',\n exportAs: 'cngxDrawerPanel',\n standalone: true,\n hostDirectives: [{ directive: CngxFocusTrap, inputs: ['enabled', 'autoFocus'] }],\n host: {\n '[class.cngx-drawer-panel]': 'true',\n '[class.cngx-drawer-panel--open]': 'isOpen()',\n '[class.cngx-drawer-panel--left]': \"position() === 'left'\",\n '[class.cngx-drawer-panel--right]': \"position() === 'right'\",\n '[class.cngx-drawer-panel--top]': \"position() === 'top'\",\n '[class.cngx-drawer-panel--bottom]': \"position() === 'bottom'\",\n '[class.cngx-drawer-panel--over]': \"mode() === 'over'\",\n '[class.cngx-drawer-panel--push]': \"mode() === 'push'\",\n '[class.cngx-drawer-panel--side]': \"mode() === 'side'\",\n '[attr.aria-hidden]': \"mode() !== 'side' && !isOpen() ? true : null\",\n '[attr.inert]': \"mode() !== 'side' && !isOpen() ? '' : null\",\n '[attr.role]': 'role()',\n },\n})\nexport class CngxDrawerPanel {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerPanel' });\n\n /** Direction the panel slides from. */\n readonly position = input<DrawerPosition>('left');\n\n /**\n * How the panel interacts with the content area:\n * - `'over'` (default) - overlays content (absolute positioned)\n * - `'push'` - pushes content aside (content gets margin)\n * - `'side'` - always visible, no toggle behavior\n */\n readonly mode = input<DrawerMode>('over');\n\n /** Whether clicking outside the panel closes the drawer. */\n readonly closeOnClickOutside = input<boolean>(true);\n\n /**\n * Landmark role rendered on the panel. Defaults to `complementary`;\n * pass `navigation` for nav drawers or `null` to keep the element's\n * implicit role (e.g. on a `<nav>` host).\n */\n readonly role = input<string | null>('complementary');\n\n /** Whether the drawer is currently open (derived from the drawer ref). In `side` mode, always `true`. */\n readonly isOpen = computed(() => this.mode() === 'side' || this.drawerRef().opened());\n\n private suppressOutsideClick = false;\n private restoreTarget: HTMLElement | null = null;\n\n constructor() {\n const doc = inject(DOCUMENT);\n const el = inject(ElementRef<HTMLElement>);\n\n // Focus restoration: closing puts `inert` on the panel, which would\n // silently drop focus to <body>. Capture the focused element at the\n // open transition and hand focus back at the close transition when\n // focus is still inside the panel (Escape) or already fell to <body>\n // (outside click on a non-focusable area). A focusable outside target\n // the user clicked keeps its focus.\n const openTransition = createTransitionTracker(() => this.isOpen());\n effect(() => {\n const open = openTransition.current();\n const wasOpen = openTransition.previous();\n if (open === wasOpen) {\n return;\n }\n untracked(() => {\n if (open) {\n const active = doc.activeElement;\n this.restoreTarget = active instanceof HTMLElement ? active : null;\n return;\n }\n const active = doc.activeElement;\n const focusLost =\n active === null ||\n active === doc.body ||\n (el.nativeElement as HTMLElement).contains(active);\n if (focusLost && this.restoreTarget?.isConnected) {\n this.restoreTarget.focus();\n }\n this.restoreTarget = null;\n });\n });\n\n // A click on a toggle OUTSIDE the container opens the drawer and then\n // bubbles on to the document listener below within the same dispatch -\n // without suppression it would close its own drawer instantly. The\n // openedChange emit is synchronous inside that dispatch; the flag is\n // lifted on the next macrotask, after the bubble phase has finished\n // (a microtask checkpoint can run between listeners of a native event).\n toObservable(this.drawerRef)\n .pipe(\n switchMap((drawer) => outputToObservable(drawer.openedChange)),\n takeUntilDestroyed(),\n )\n .subscribe((opened) => {\n if (opened) {\n this.suppressOutsideClick = true;\n setTimeout(() => (this.suppressOutsideClick = false));\n }\n });\n\n // Hit-test against the container, not the panel - toggle buttons and backdrops\n // sit inside the container and must not count as outside clicks.\n fromEvent<MouseEvent>(doc, 'click')\n .pipe(takeUntilDestroyed())\n .subscribe((e) => {\n if (\n !this.suppressOutsideClick &&\n this.mode() !== 'side' &&\n this.isOpen() &&\n this.closeOnClickOutside() &&\n !(this.drawerRef().elementRef.nativeElement as HTMLElement).contains(e.target as Node)\n ) {\n this.drawerRef().close();\n }\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport type { CngxDrawer } from './drawer.directive';\n\n/**\n * Marks the main content area adjacent to a drawer panel.\n *\n * Adds a CSS class when the drawer is open so the consumer can offset\n * the content via CSS transitions or transforms.\n *\n * ```html\n * <main [cngxDrawerContent]=\"drawer\">\n * Page content\n * </main>\n * ```\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerPanel\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerContent]',\n exportAs: 'cngxDrawerContent',\n standalone: true,\n host: {\n '[class.cngx-drawer-content]': 'true',\n '[class.cngx-drawer-content--shifted]': 'isOpen()',\n },\n})\nexport class CngxDrawerContent {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerContent' });\n\n /** Whether the drawer is currently open (derived from the drawer ref). */\n readonly isOpen = computed(() => this.drawerRef().opened());\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Observes whether the host element is visible in the viewport or a scroll container.\n *\n * Wraps the browser's `IntersectionObserver` API and exposes its state as\n * Angular signals. The observer is automatically recreated when `root`,\n * `rootMargin`, or `threshold` inputs change, and disconnected on destroy.\n *\n * Use cases: lazy loading images, infinite scroll sentinels, scroll-triggered\n * animations, \"back to top\" buttons, analytics viewport tracking.\n *\n * ### Lazy load sentinel\n * ```html\n * <div cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * (entered)=\"loadNextPage()\">\n * @if (io.isIntersecting()) { Loading... }\n * </div>\n * ```\n *\n * ### Scroll-triggered animation\n * ```html\n * <section cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * [threshold]=\"0.5\"\n * [class.visible]=\"io.isIntersecting()\">\n * Content fades in at 50% visibility\n * </section>\n * ```\n *\n * ### Custom scroll container\n * ```html\n * <div cngxIntersectionObserver [root]=\"'.scroll-container'\" [rootMargin]=\"'100px'\">\n * Observed within a scrollable parent\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/intersection-observer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxResizeObserver, CngxMediaQuery, CngxInfiniteScroll, CngxScrollSpy\n * <example-url>http://localhost:4200/#/common/layout/intersection-observer/scroll-sentinel</example-url>\n */\n@Directive({\n selector: '[cngxIntersectionObserver]',\n exportAs: 'cngxIntersectionObserver',\n standalone: true,\n})\nexport class CngxIntersectionObserver {\n /** CSS selector for the scroll container root. `null` (default) uses the viewport. */\n readonly root = input<string | null>(null);\n /** Margin around the root, using CSS margin syntax (e.g. `'100px 0px'`). */\n readonly rootMargin = input<string>('0px');\n /** Visibility ratio(s) at which the callback fires. `0` = any pixel visible, `1` = fully visible. */\n readonly threshold = input<number | number[]>(0);\n\n private readonly entryState = signal<IntersectionObserverEntry | null>(null);\n\n /** `true` when any part of the element is visible within the root. */\n readonly isIntersecting = computed(() => this.entryState()?.isIntersecting ?? false);\n /** The fraction of the element currently visible (0–1). */\n readonly intersectionRatio = computed(() => this.entryState()?.intersectionRatio ?? 0);\n\n /** Emitted on every intersection change with the raw `IntersectionObserverEntry`. */\n readonly intersectionChange = output<IntersectionObserverEntry>();\n /** Emitted once when the element enters the observed area. */\n readonly entered = output<void>();\n /** Emitted once when the element leaves the observed area. */\n readonly left = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (isDevMode() && root && !resolvedRoot) {\n console.warn(\n `[cngxIntersectionObserver] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n const wasIntersecting = this.entryState()?.isIntersecting ?? false;\n this.entryState.set(entry);\n this.intersectionChange.emit(entry);\n if (entry.isIntersecting && !wasIntersecting) {\n this.entered.emit();\n }\n if (!entry.isIntersecting && wasIntersecting) {\n this.left.emit();\n }\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, effect, inject, input, signal } from '@angular/core';\nimport { observeMediaQuery } from '@cngx/core/utils';\n\n/**\n * Reactive media query directive that exposes a `matches` signal.\n *\n * Wraps `window.matchMedia()` with automatic cleanup. Usable for\n * responsive layouts, drawer mode switching, conditional rendering,\n * or any behavior that depends on viewport/preference queries.\n *\n * ### Responsive drawer mode\n * ```html\n * <div cngxMediaQuery=\"(min-width: 1024px)\" #mq=\"cngxMediaQuery\">\n * <nav [cngxDrawerPanel]=\"drawer\"\n * [mode]=\"mq.matches() ? 'side' : 'over'\">\n * …\n * </nav>\n * </div>\n * ```\n *\n * ### Conditional content\n * ```html\n * <div cngxMediaQuery=\"(prefers-color-scheme: dark)\" #dark=\"cngxMediaQuery\">\n * @if (dark.matches()) { <span>Dark mode active</span> }\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/media-query.directive.ts\n * @since 0.1.0\n * @relatedTo CngxResizeObserver, CngxIntersectionObserver\n * <example-url>http://localhost:4200/#/common/layout/media-query/viewport-breakpoints</example-url>\n */\n@Directive({\n selector: '[cngxMediaQuery]',\n exportAs: 'cngxMediaQuery',\n standalone: true,\n})\nexport class CngxMediaQuery {\n /** The CSS media query string to evaluate. */\n readonly query = input.required<string>({ alias: 'cngxMediaQuery' });\n\n private readonly matchesState = signal(false);\n private readonly win = inject(DOCUMENT).defaultView;\n\n /** Whether the media query currently matches. */\n readonly matches = this.matchesState.asReadonly();\n\n constructor() {\n effect((onCleanup) => {\n onCleanup(\n observeMediaQuery(this.win, this.query(), (matches) => this.matchesState.set(matches)),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, inject, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Inject-form of {@link CngxMediaQuery}: returns a reactive\n * `Signal<boolean>` that reflects whether the host window currently matches\n * a CSS media query, without needing a host element.\n *\n * Use it where the directive form has nowhere to attach - inside a route\n * guard, a store, a `computed()`, or any injection context that reacts to a\n * viewport or preference query. For host-bound templates, prefer the\n * `[cngxMediaQuery]` directive; for pure styling, prefer CSS `@media` /\n * `@container`.\n *\n * Wraps `window.matchMedia()`: seeds the signal from `MediaQueryList.matches`,\n * updates on the `change` event, and removes the listener via `DestroyRef`\n * when the injection scope is destroyed. In SSR / non-DOM environments (no\n * `defaultView` or no `matchMedia`) it returns a static `false` signal and\n * wires no listener, so it never throws off the browser.\n *\n * Returns a `Signal<boolean>` - never an `Observable`; the reactive boundary\n * stays inside cngx.\n *\n * ```typescript\n * @Component({ … })\n * export class Dashboard {\n * private readonly compact = injectMediaQuery('(max-width: 640px)');\n * protected readonly layout = computed(() => (this.compact() ? 'stacked' : 'grid'));\n * }\n * ```\n *\n * @param query A CSS media query string, e.g. `(max-width: 640px)`.\n * @returns A reactive `Signal<boolean>` tracking the query's match state.\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/inject-media-query.ts\n * @since 0.1.0\n * @relatedTo CngxMediaQuery, CngxResizeObserver\n * <example-url>http://localhost:4200/#/common/layout/media-query/inject-breakpoint-signal</example-url>\n */\nexport function injectMediaQuery(query: string): Signal<boolean> {\n return createMediaQuerySignal(query, inject(DestroyRef), inject(DOCUMENT).defaultView);\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * Dev-warning the query-param sync kernel emits when `@angular/router` is\n * not provided. Mirrors {@link warnTabsRouterAbsent} in `@cngx/common/tabs`\n * so the message stays identical across the two sync surfaces; only the\n * `enables` clause differs (and this copy is dev-gated). A deliberate small\n * copy rather than a shared import - sharing would force the helper onto a\n * `public-api.ts`, and `warn*` matches no approved public-API prefix.\n *\n * @internal\n */\nexport function warnRouterAbsent(directive: string, enables: string): void {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n `${directive}: no Router available - directive is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n","import { effect, inject, untracked, type Signal, type WritableSignal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { coerceSignal } from '@cngx/core/utils';\n\nimport { warnRouterAbsent } from './warn-router-absent';\n\n/**\n * Options for {@link injectQueryParamSync}.\n *\n * `param` accepts a live `Signal<string>` so a bound `[param]` rename stays\n * reactive; a plain string is wrapped internally. `serialize`/`deserialize`\n * default to a boolean codec (`true` -> `'open'`, absence -> `false`); pass an\n * identity codec (`v => v ?? null` / `raw => raw`) to sync string ids.\n */\nexport interface QueryParamSyncOptions<T = boolean> {\n /** Query-param key. A `Signal<string>` keeps a bound rename live. */\n readonly param: string | Signal<string>;\n /** `T` -> URL string, or `null` to remove the key. Default: boolean codec. */\n readonly serialize?: (value: T) => string | null;\n /** URL string (or `null` when absent) -> `T`. Default: boolean codec. */\n readonly deserialize?: (raw: string | null) => T;\n /** Invoked with the rejection reason when `router.navigate` rejects. */\n readonly onSyncError?: (err: unknown) => void;\n}\n\n/**\n * Bidirectional sync between a caller-owned `WritableSignal<T>` and a named\n * query param. URL wins on initial load (deep-link intent); after hydrate the\n * signal is the source and reflects outward. Re-hydrates on browser\n * back/forward. Dev-warns once and no-ops when `@angular/router` is absent.\n *\n * Loop-safety (the core of this helper): the reflect effect writes the URL in\n * `untracked()` and skips `navigate` when the serialized `state()` equals the\n * last value it wrote - a local closure seeded from the initial URL read, not\n * the live URL param (the live param races the navigate-settle window). The\n * hydrate path updates that same closure whenever it accepts a URL value, so\n * back/forward re-hydration never triggers a reflex navigate. A `param` rename\n * is migrated in one navigate (`{ [old]: null, [new]: serialize(state()) }`)\n * by a dedicated effect whose only tracked source is the normalized param\n * signal; its first run seeds bookkeeping and never navigates.\n *\n * The `state.set` inside the hydrate effect is a deliberate signal-write-in-\n * effect: the URL is an external system and `state` is a caller-owned signal\n * the consumer must stay able to toggle, so hydrate cannot be a `computed`. It\n * is edge-guarded by serialized equality and wrapped in `untracked()`.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/router/inject-query-param-sync.ts\n * @since 0.1.0\n * @relatedTo CngxStepperRouterSync\n * <example-url>http://localhost:4200/#/common/layout/router/persisted-toggle</example-url>\n */\nexport function injectQueryParamSync<T = boolean>(\n state: WritableSignal<T>,\n opts: QueryParamSyncOptions<T>,\n): void {\n const router = inject(Router, { optional: true });\n\n if (!router) {\n warnRouterAbsent('injectQueryParamSync', 'query-param URL sync');\n return;\n }\n\n const route = inject(ActivatedRoute);\n\n const paramSignal: Signal<string> = coerceSignal(opts.param);\n const serialize: (value: T) => string | null =\n opts.serialize ?? ((value) => (value ? 'open' : null));\n const deserialize: (raw: string | null) => T = opts.deserialize ?? ((raw) => (raw != null) as T);\n\n // Closure bookkeeping, seeded from the initial URL read. `lastWritten` is\n // the serialized value the reflect path last pushed to the URL; the hydrate\n // path also updates it so an accepted URL value is not reflected back.\n const initialParam = paramSignal();\n let lastWritten: string | null = route.snapshot.queryParamMap.get(initialParam) ?? null;\n let previousParam = initialParam;\n\n // URL wins on initial load.\n if (lastWritten != null) {\n const hydrated = deserialize(lastWritten);\n if (!Object.is(hydrated, state())) {\n state.set(hydrated);\n }\n }\n\n // Reflect: signal change -> URL. Tracks `state()` only; param read untracked.\n effect(() => {\n const raw = serialize(state());\n untracked(() => {\n if (raw === lastWritten) {\n return;\n }\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [paramSignal()]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n\n // Re-hydrate: URL change (back/forward) -> signal. Tracks the query-param\n // emission only; param and state reads are untracked. The first run mirrors\n // the initial snapshot already handled synchronously above, so it is skipped\n // - processing it would race the reflect effect's still-pending initial\n // navigate and reset `state` to a stale value. Later runs skip our own\n // reflect echo via the `lastWritten` guard.\n const queryMap = toSignal(route.queryParamMap, {\n initialValue: route.snapshot.queryParamMap,\n });\n let hydrateInitialized = false;\n effect(() => {\n const map = queryMap();\n untracked(() => {\n if (!hydrateInitialized) {\n hydrateInitialized = true;\n return;\n }\n const raw = map.get(paramSignal()) ?? null;\n if (raw === lastWritten) {\n return;\n }\n const next = deserialize(raw);\n if (!Object.is(next, state())) {\n state.set(next);\n }\n lastWritten = raw;\n });\n });\n\n // Rename migration: param change -> one merged navigate that removes the old\n // key and writes the current value under the new one. Tracks the param\n // signal only; the first run seeds `previousParam` and never navigates.\n effect(() => {\n const param = paramSignal();\n untracked(() => {\n if (param === previousParam) {\n return;\n }\n const oldParam = previousParam;\n previousParam = param;\n const raw = serialize(state());\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [oldParam]: null, [param]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n}\n","import { type DestroyRef, signal, type Signal } from '@angular/core';\n\n/**\n * Structural window surface the resize helpers read: `window`, `globalThis`,\n * or a test double. `ResizeObserver` is optional so SSR and jsdom hosts pass\n * the type and hit the runtime guard instead.\n *\n * @category common/layout/observers\n * @since 0.3.0\n */\nexport interface ResizeObserverHost {\n ResizeObserver?: typeof ResizeObserver;\n}\n\n/**\n * Subscribes `apply` to size changes of `element` on `host`.\n *\n * Re-applies on every observation and returns the teardown that disconnects\n * the observer. On a host without `ResizeObserver` (SSR, jsdom) nothing is\n * wired, `apply` never fires, and the returned teardown is a no-op. Unlike the\n * media-query twin there is no synchronous seed: the first size is whatever the\n * observer reports after the next layout.\n *\n * Reach for this low-level form when the observed element or the box model is\n * reactive and the subscription must follow it (re-wire per `effect` run via\n * `onCleanup`); for a static target, {@link createResizeSignal} owns the\n * teardown via `DestroyRef`.\n *\n * @param host The window-like object to read `ResizeObserver` from.\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param apply Receives the first entry of every observation batch.\n * @returns Teardown that disconnects the observer.\n * @category common/layout/observers\n * @relatedTo createResizeSignal, observeMediaQuery\n * @since 0.1.0\n */\nexport function observeResize(\n host: ResizeObserverHost | null | undefined,\n element: Element,\n box: ResizeObserverBoxOptions,\n apply: (entry: ResizeObserverEntry) => void,\n): () => void {\n if (!host || typeof host.ResizeObserver !== 'function') {\n return () => undefined;\n }\n const observer = new host.ResizeObserver((entries) => apply(entries[0]));\n observer.observe(element, { box });\n return () => observer.disconnect();\n}\n\n/**\n * Creates a `Signal<ResizeObserverEntry | null>` that carries the most recent\n * observation of `element`, `null` until the first one arrives.\n *\n * Disconnects when `destroyRef` is destroyed. On a host without\n * `ResizeObserver` (SSR, jsdom) the signal stays `null` and no observer is\n * created, so it never throws off the browser.\n *\n * This is the shared kernel behind `CngxResizeObserver` and\n * `createContainerSize`; consumers that hand-roll a `ResizeObserver` should\n * route through it instead.\n *\n * ```typescript\n * const entry = createResizeSignal(\n * host,\n * 'border-box',\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const width = computed(() => entry()?.borderBoxSize[0]?.inlineSize ?? 0);\n * ```\n *\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param host The window-like object to read `ResizeObserver` from.\n * @returns A readonly signal carrying the latest entry.\n * @category common/layout/observers\n * @relatedTo observeResize, createMediaQuerySignal\n * @since 0.1.0\n */\nexport function createResizeSignal(\n element: Element,\n box: ResizeObserverBoxOptions,\n destroyRef: DestroyRef,\n host: ResizeObserverHost | null | undefined,\n): Signal<ResizeObserverEntry | null> {\n const entry = signal<ResizeObserverEntry | null>(null);\n const unsubscribe = observeResize(host, element, box, (value) => entry.set(value));\n destroyRef.onDestroy(unsubscribe);\n return entry.asReadonly();\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from './resize-signal';\n\n/**\n * Observes size changes of the host element via the `ResizeObserver` API.\n *\n * Exposes `width()`, `height()`, `contentRect()`, and `isReady()` as Angular\n * signals that update on every resize. The observer is automatically\n * disconnected on destroy and recreated when the `box` input changes.\n *\n * Use cases: responsive component logic in TypeScript (not just CSS),\n * container queries without CSS support, dynamic canvas/chart sizing,\n * resize-aware layouts.\n *\n * ### Display current size\n * ```html\n * <div cngxResizeObserver #ro=\"cngxResizeObserver\" style=\"resize: horizontal; overflow: auto;\">\n * {{ ro.width() | number:'1.0-0' }} × {{ ro.height() | number:'1.0-0' }} px\n * </div>\n * ```\n *\n * ### Responsive logic in TypeScript\n * ```typescript\n * readonly ro = viewChild(CngxResizeObserver);\n * readonly columns = computed(() => (this.ro()?.width() ?? 0) > 600 ? 3 : 1);\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/resize-observer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxMediaQuery\n * <example-url>http://localhost:4200/#/common/layout/resize-observer/live-size</example-url>\n */\n@Directive({\n selector: '[cngxResizeObserver]',\n exportAs: 'cngxResizeObserver',\n standalone: true,\n})\nexport class CngxResizeObserver {\n /** Which box model to observe. `'content-box'` (default), `'border-box'`, or `'device-pixel-content-box'`. */\n readonly box = input<ResizeObserverBoxOptions>('content-box');\n\n private readonly entryState = signal<ResizeObserverEntry | null>(null);\n\n /** The full `DOMRectReadOnly` of the content box. `null` before first observation. */\n readonly contentRect = computed(() => this.entryState()?.contentRect ?? null);\n /** Current width in pixels. `0` before first observation. */\n readonly width = computed(() => this.entryState()?.contentRect.width ?? 0);\n /** Current height in pixels. `0` before first observation. */\n readonly height = computed(() => this.entryState()?.contentRect.height ?? 0);\n /** `true` after the first resize observation has been received. */\n readonly isReady = computed(() => this.entryState() !== null);\n\n /** Emitted on every resize with the raw `ResizeObserverEntry`. */\n readonly resize = output<ResizeObserverEntry>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n\n // One subscription per `box` value: `onCleanup` disconnects the previous\n // observer before `observeResize` wires the next, which is also the\n // teardown on destroy. The kernel no-ops when the host ships no\n // `ResizeObserver` (SSR, jsdom), so no host guard is needed here.\n effect((onCleanup) => {\n onCleanup(\n observeResize(win, this.el.nativeElement as HTMLElement, this.box(), (entry) => {\n this.entryState.set(entry);\n this.resize.emit(entry);\n }),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n type DestroyRef,\n DestroyRef as DestroyRefToken,\n ElementRef,\n inject,\n InjectionToken,\n type Signal,\n} from '@angular/core';\n\nimport { createResizeSignal, type ResizeObserverHost } from './resize-signal';\n\n/**\n * Reactive read of a query container: its size, and the custom properties its\n * `@container` rules resolved to.\n *\n * @category common/layout/observers\n * @since 0.1.0\n */\nexport interface CngxContainerSize {\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize: Signal<number>;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize: Signal<number>;\n /** `true` once the first observation has arrived. */\n readonly isReady: Signal<boolean>;\n /**\n * The resolved value of a custom property, re-read on every resize of the\n * container.\n *\n * **The `@container` rule must style a descendant, never the container\n * itself.** A container query resolves against an *ancestor* query container\n * of the element it styles, so a rule whose subject is the container element\n * matches nothing and the property never changes. Pass that descendant as\n * `on`; it defaults to the container host, which is only correct for\n * properties no container query writes.\n *\n * A component that is container and reader at once has no descendant to\n * carry the value. Pass `pseudo` instead: the query container for a\n * pseudo-element is selected from its originating element's *inclusive*\n * ancestors, so `.host::after` resolves against `.host` while a rule on\n * `.host` itself still matches nothing. No sentinel node enters the\n * template.\n *\n * ```css\n * .cngx-thing::after { --cngx-thing-narrow: 0; }\n * @container cngx-thing (max-inline-size: 30rem) {\n * .cngx-thing::after { --cngx-thing-narrow: 1; }\n * }\n * ```\n *\n * Returns the empty string before the first observation and in environments\n * without layout (SSR, jsdom).\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string>;\n}\n\n/**\n * The nearest query container declared by {@link CngxContainer}.\n *\n * Deliberately has no root factory: absence is meaningful. A component that\n * needs a container and finds none must say so (a dev-mode warning), not\n * silently observe itself.\n *\n * @category common/layout/observers\n * @since 0.1.0\n */\nexport const CNGX_CONTAINER_SIZE = new InjectionToken<CngxContainerSize>('CNGX_CONTAINER_SIZE');\n\n/**\n * Creates a {@link CngxContainerSize} over `element`.\n *\n * Observes the border box, so the reported size matches what an\n * `inline-size` container query measures. The `property()` reads are plain\n * `computed()`s over the same resize signal - the browser has already\n * re-evaluated every container query by the time a `ResizeObserver` callback\n * runs, so the read returns the current value without a second scheduling hop.\n *\n * @param element The container host.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param win The window-like object providing `ResizeObserver` and `getComputedStyle`.\n * @category common/layout/observers\n * @relatedTo injectContainerSize, CngxContainer\n * @since 0.1.0\n */\nexport function createContainerSize(\n element: Element,\n destroyRef: DestroyRef,\n win: (ResizeObserverHost & Pick<Window, 'getComputedStyle'>) | null | undefined,\n): CngxContainerSize {\n const entry = createResizeSignal(element, 'border-box', destroyRef, win);\n\n const inlineSize = computed(() => entry()?.borderBoxSize?.[0]?.inlineSize ?? 0);\n const blockSize = computed(() => entry()?.borderBoxSize?.[0]?.blockSize ?? 0);\n const isReady = computed(() => entry() !== null);\n\n // Weak on the element: the container outlives descendants that get\n // destroyed, so a strong Map would pin every dead node it ever read.\n const cache = new WeakMap<Element, Map<string, Signal<string>>>();\n\n const property = (\n name: string,\n on?: Element,\n pseudo?: '::before' | '::after',\n ): Signal<string> => {\n const target = on ?? element;\n let byName = cache.get(target);\n if (!byName) {\n byName = new Map();\n cache.set(target, byName);\n }\n const key = `${pseudo ?? ''}|${name}`;\n const cached = byName.get(key);\n if (cached) {\n return cached;\n }\n // A DOM read inside a computed() is deliberate here, not an oversight: the\n // only tracked dependency is the resize entry, and a ResizeObserver\n // callback runs after layout, when every container query has already been\n // re-evaluated. The read is therefore idempotent for a given entry and\n // never forces a recalc of its own. An effect writing into a signal would\n // add a scheduling hop for nothing.\n const value = computed(() => {\n if (entry() === null || !win?.getComputedStyle) {\n return '';\n }\n return win\n .getComputedStyle(target, pseudo ?? null)\n .getPropertyValue(name)\n .trim();\n });\n byName.set(key, value);\n return value;\n };\n\n return { inlineSize, blockSize, isReady, property };\n}\n\n/**\n * Reads the nearest query container declared by a `[cngxContainer]` ancestor,\n * or observes `target` (default: the host element) when there is none.\n *\n * Use it where a component must branch structurally on the width it was given\n * - a different template, a focus move, an `aria-modal` flip. Purely visual\n * adaptation needs no TypeScript at all: write a `@container` rule.\n *\n * ```typescript\n * private readonly container = inject(CNGX_CONTAINER_SIZE, { optional: true });\n * private readonly wide = this.container?.property('--cngx-thing-wide', this.host) ?? signal('').asReadonly();\n * readonly mode = computed(() => (this.wide() === '1' ? 'side' : 'over'));\n * ```\n *\n * A component that declares the container in its own stylesheet and reads it\n * itself passes its host explicitly and reads the property off `::after` -\n * there is no descendant to carry the value:\n *\n * ```typescript\n * private readonly host = inject(ElementRef).nativeElement as Element;\n * private readonly container = injectContainerSize(this.host);\n * private readonly narrow = this.container.property('--cngx-thing-narrow', this.host, '::after');\n * ```\n *\n * @param target Element to observe when no ancestor container exists.\n * @category common/layout/observers\n * @relatedTo CngxContainer, injectMediaQuery\n * @since 0.1.0\n */\nexport function injectContainerSize(target?: ElementRef<Element> | Element): CngxContainerSize {\n const ancestor = inject(CNGX_CONTAINER_SIZE, { optional: true, skipSelf: true });\n if (ancestor && !target) {\n return ancestor;\n }\n const resolved: Element =\n target instanceof ElementRef\n ? target.nativeElement\n : (target ?? (inject(ElementRef).nativeElement as Element));\n return createContainerSize(resolved, inject(DestroyRefToken), inject(DOCUMENT).defaultView);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, type Signal } from '@angular/core';\n\nimport { CNGX_CONTAINER_SIZE, type CngxContainerSize, createContainerSize } from './container-size';\n\n/**\n * Observes a query container and publishes its size to descendants through\n * {@link CNGX_CONTAINER_SIZE}.\n *\n * The directive declares nothing visual. **Both `container-type` and\n * `container-name` belong in the stylesheet**, next to the `@container` rules\n * that use them: the name is API (an unnamed query matches the nearest\n * container of any name, so a consumer wrapping the component in their own\n * container would silently re-target it), and containment is a layout\n * decision a skin must be able to opt out of with a plain CSS rule rather\n * than `!important` against a host style.\n *\n * ```css\n * cngx-thing-layout {\n * container-type: inline-size;\n * container-name: cngx-thing-layout;\n * }\n *\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 0; }\n *\n * @container cngx-thing-layout (min-inline-size: 64rem) {\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 1; }\n * }\n * ```\n *\n * ```html\n * <div cngxContainer>\n * <app-panel />\n * </div>\n * ```\n *\n * A descendant reads the resolved value with `injectContainerSize()`, so the\n * breakpoint exists exactly once - in CSS. Note that `container-type:\n * inline-size` applies size containment: an element that must shrink-wrap its\n * content (an inline chip, a `width: max-content` bar) must not be a\n * container.\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/container.directive.ts\n * @since 0.1.0\n * @relatedTo injectContainerSize, CngxResizeObserver, CngxMediaQuery\n * <example-url>http://localhost:4200/#/common/layout/container/css-decides-js-reads</example-url>\n */\n@Directive({\n selector: '[cngxContainer]',\n exportAs: 'cngxContainer',\n standalone: true,\n providers: [{ provide: CNGX_CONTAINER_SIZE, useExisting: CngxContainer }],\n})\nexport class CngxContainer implements CngxContainerSize {\n private readonly size = createContainerSize(\n inject(ElementRef).nativeElement as Element,\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize = this.size.inlineSize;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize = this.size.blockSize;\n /** `true` once the first observation has arrived. */\n readonly isReady = this.size.isReady;\n\n /**\n * The resolved value of a custom property on `on` (default: this host),\n * re-read on every resize. The `@container` rule must style a descendant,\n * or a pseudo-element of the container itself - see\n * {@link CngxContainerSize.property}.\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string> {\n return this.size.property(name, on, pseudo);\n }\n}\n","/**\n * Ref-count per document root. Module-private on purpose: this file is the\n * single owner of the lock state. A second copy of this map (the pre-extraction\n * state: one in `CngxScrollLock`, one in `CngxDialog`) shares the dataset keys\n * below without sharing the count, so interleaved acquire/release across the\n * two owners corrupts each other's saved overflow values.\n *\n * @internal\n */\nconst lockCounts = new WeakMap<HTMLElement, number>();\n\n/**\n * Acquire a ref-counted scroll lock on a document root and get back the\n * matching release function.\n *\n * The first active lock saves the current `overflow` / `scrollbar-gutter`\n * inline styles and sets `overflow: hidden` + `scrollbar-gutter: stable`\n * (no layout shift when the scrollbar disappears). Releasing the last active\n * lock restores the saved values. The returned release function is\n * idempotent - calling it twice cannot over-decrement the count.\n *\n * Shared engine behind `CngxScrollLock` and `CngxDialog`'s modal scroll lock;\n * consumers composing their own overlay primitives can use it directly.\n *\n * ```typescript\n * const release = createScrollLock(document.documentElement);\n * // ... overlay open ...\n * release();\n * ```\n *\n * @param html - The document root (`document.documentElement`) to lock.\n * @returns Release function for this acquisition. Idempotent.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts\n * @since 0.1.0\n * @relatedTo CngxScrollLock, CngxDialog\n */\nexport function createScrollLock(html: HTMLElement): () => void {\n const count = lockCounts.get(html) ?? 0;\n if (count === 0) {\n html.dataset['cngxPrevOverflow'] = html.style.overflow;\n html.dataset['cngxPrevScrollbarGutter'] = html.style.scrollbarGutter;\n html.style.overflow = 'hidden';\n html.style.scrollbarGutter = 'stable';\n }\n lockCounts.set(html, count + 1);\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n const current = lockCounts.get(html) ?? 0;\n if (current <= 1) {\n html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';\n html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';\n delete html.dataset['cngxPrevOverflow'];\n delete html.dataset['cngxPrevScrollbarGutter'];\n lockCounts.set(html, 0);\n } else {\n lockCounts.set(html, current - 1);\n }\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\nimport { createScrollLock } from './scroll-lock-core';\n\n/**\n * Prevents scrolling on the document body when enabled.\n *\n * Sets `overflow: hidden` and `scrollbar-gutter: stable` on `<html>` to\n * prevent layout shift when the scrollbar disappears. Restores original\n * values when all lock instances are released.\n *\n * Multiple instances are ref-counted - the original styles are only\n * restored when the last lock is released.\n *\n * ### With a drawer\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\" [cngxScrollLock]=\"drawer.opened()\">\n * …\n * </div>\n * ```\n *\n * ### With a modal\n * ```html\n * <div [cngxScrollLock]=\"isModalOpen()\">…</div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxBackdrop\n * <example-url>http://localhost:4200/#/common/layout/scroll-lock/toggle</example-url>\n */\n@Directive({\n selector: '[cngxScrollLock]',\n exportAs: 'cngxScrollLock',\n standalone: true,\n})\nexport class CngxScrollLock {\n /** Whether scroll lock is active. */\n readonly enabled = input<boolean>(false, { alias: 'cngxScrollLock' });\n\n constructor() {\n const html = inject(DOCUMENT).documentElement;\n let release: (() => void) | null = null;\n\n effect(() => {\n if (this.enabled() && !release) {\n release = createScrollLock(html);\n } else if (!this.enabled() && release) {\n release();\n release = null;\n }\n });\n\n inject(DestroyRef).onDestroy(() => {\n release?.();\n });\n }\n}\n","import { computed, type DestroyRef, signal, type Signal } from '@angular/core';\n\nimport { observeResize, type ResizeObserverHost } from '../observers/resize-signal';\n\n/**\n * Structural window surface `createScrollEdges` reads: `window`, `globalThis`,\n * or a test double. Every member is optional so SSR and jsdom hosts pass the\n * type and fall back at runtime: no `ResizeObserver` means no resize\n * tracking, no `MutationObserver` means the child set is captured once, no\n * `requestAnimationFrame` means every trigger reads synchronously.\n *\n * @category common/layout\n * @since 0.1.0\n */\nexport interface ScrollEdgesHost extends ResizeObserverHost {\n MutationObserver?: typeof MutationObserver;\n requestAnimationFrame?: (callback: FrameRequestCallback) => number;\n cancelAnimationFrame?: (handle: number) => void;\n}\n\n/**\n * Per-edge scroll state of one scrollport. Each signal is `true` while content\n * is hidden toward that edge, i.e. while the user can still scroll toward it.\n *\n * @category common/layout\n * @since 0.1.0\n */\nexport interface CngxScrollEdgesState {\n /** Content is hidden above (toward the block-start edge). */\n readonly canScrollBlockStart: Signal<boolean>;\n /** Content is hidden below (toward the block-end edge). */\n readonly canScrollBlockEnd: Signal<boolean>;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL). */\n readonly canScrollInlineStart: Signal<boolean>;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL). */\n readonly canScrollInlineEnd: Signal<boolean>;\n}\n\ninterface ScrollEdgesSnapshot {\n readonly blockStart: boolean;\n readonly blockEnd: boolean;\n readonly inlineStart: boolean;\n readonly inlineEnd: boolean;\n}\n\n/** Distances up to this many px count as \"at the edge\" (sub-pixel and zoom rounding). */\nconst EDGE_TOLERANCE = 1;\n\nconst NO_EDGES: ScrollEdgesSnapshot = {\n blockStart: false,\n blockEnd: false,\n inlineStart: false,\n inlineEnd: false,\n};\n\nfunction sameEdges(a: ScrollEdgesSnapshot, b: ScrollEdgesSnapshot): boolean {\n return (\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd &&\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd\n );\n}\n\n/**\n * One read of the six scroll metrics. RTL `scrollLeft` runs over `[-max, 0]`\n * in every evergreen engine and LTR over `[0, max]`, so its magnitude is the\n * distance from the inline-start edge in both directions - no direction lookup\n * and no `getComputedStyle` in the scroll path.\n */\nfunction readEdges(element: HTMLElement): ScrollEdgesSnapshot {\n const inlineOffset = Math.abs(element.scrollLeft);\n return {\n blockStart: element.scrollTop > EDGE_TOLERANCE,\n blockEnd: element.scrollHeight - element.clientHeight - element.scrollTop > EDGE_TOLERANCE,\n inlineStart: inlineOffset > EDGE_TOLERANCE,\n inlineEnd: element.scrollWidth - element.clientWidth - inlineOffset > EDGE_TOLERANCE,\n };\n}\n\n/**\n * Tracks which edges of a scrollport still hide content, as four boolean\n * signals.\n *\n * Triggers are a passive `scroll` listener, one `observeResize` per observed\n * element (the scrollport itself plus every direct element child) and a\n * `childList`-only `MutationObserver` that keeps that child set current. All\n * of them only schedule work: the metrics are read once per animation frame\n * however many triggers fired, and the result lands in one snapshot signal\n * with a structural `equal`, so the four projections only notify when an edge\n * actually flips. A distance of 1px or less counts as \"at the edge\".\n *\n * Only direct children are resize-observed. A long item list should sit inside\n * one content element rather than be N direct children (one observer each);\n * growth deep inside a fixed-size child is picked up on the next scroll.\n *\n * A `null` host (SSR) wires nothing and all four signals stay `false`.\n *\n * ```typescript\n * const edges = createScrollEdges(\n * inject(ElementRef).nativeElement,\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const showTopShadow = edges.canScrollBlockStart;\n * ```\n *\n * @param element The scrollport to read.\n * @param destroyRef Scope whose destruction removes the listener, disconnects\n * every observer and cancels a pending frame.\n * @param host The window-like object to read the observer and frame APIs from.\n * @returns The four per-edge signals.\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges-core.ts\n * @since 0.1.0\n * @relatedTo CngxScrollEdges, observeResize\n */\nexport function createScrollEdges(\n element: HTMLElement,\n destroyRef: DestroyRef,\n host: ScrollEdgesHost | null | undefined,\n): CngxScrollEdgesState {\n const edges = signal<ScrollEdgesSnapshot>(NO_EDGES, { equal: sameEdges });\n const state: CngxScrollEdgesState = {\n canScrollBlockStart: computed(() => edges().blockStart),\n canScrollBlockEnd: computed(() => edges().blockEnd),\n canScrollInlineStart: computed(() => edges().inlineStart),\n canScrollInlineEnd: computed(() => edges().inlineEnd),\n };\n\n if (!host) {\n return state;\n }\n\n let destroyed = false;\n let framePending = false;\n let frameHandle = 0;\n\n const read = (): void => {\n framePending = false;\n if (destroyed) {\n return;\n }\n edges.set(readEdges(element));\n };\n\n const schedule = (): void => {\n if (destroyed || framePending) {\n return;\n }\n if (typeof host.requestAnimationFrame !== 'function') {\n read();\n return;\n }\n framePending = true;\n frameHandle = host.requestAnimationFrame(read);\n };\n\n const resizeTeardowns = new Map<Element, () => void>();\n const observe = (target: Element): void => {\n if (resizeTeardowns.has(target)) {\n return;\n }\n resizeTeardowns.set(\n target,\n observeResize(host, target, 'border-box', () => schedule()),\n );\n };\n const syncChildren = (): void => {\n const children = new Set<Element>(Array.from(element.children));\n for (const [target, teardown] of resizeTeardowns) {\n if (target !== element && !children.has(target)) {\n teardown();\n resizeTeardowns.delete(target);\n }\n }\n children.forEach(observe);\n };\n\n element.addEventListener('scroll', schedule, { passive: true });\n observe(element);\n syncChildren();\n\n let mutationObserver: MutationObserver | null = null;\n if (typeof host.MutationObserver === 'function') {\n mutationObserver = new host.MutationObserver(() => {\n syncChildren();\n schedule();\n });\n mutationObserver.observe(element, { childList: true });\n }\n\n schedule();\n\n destroyRef.onDestroy(() => {\n destroyed = true;\n element.removeEventListener('scroll', schedule);\n mutationObserver?.disconnect();\n resizeTeardowns.forEach((teardown) => teardown());\n resizeTeardowns.clear();\n if (framePending && typeof host.cancelAnimationFrame === 'function') {\n host.cancelAnimationFrame(frameHandle);\n }\n framePending = false;\n });\n\n return state;\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, PLATFORM_ID } from '@angular/core';\n\nimport { createScrollEdges } from './scroll-edges-core';\n\n/**\n * Reports which edges of a scrollport still hide content and reflects them as\n * host attributes, so an edge shadow or fade appears only while there really\n * is something to scroll to in that direction.\n *\n * Put it on the element that scrolls (`overflow: auto` / `scroll`). The four\n * signals and the four logical host attributes are derived from one read of\n * the scroll metrics per animation frame; the attributes are present (empty\n * value) while true and absent otherwise:\n *\n * - `data-scroll-block-start` / `canScrollBlockStart()` - content hidden above\n * - `data-scroll-block-end` / `canScrollBlockEnd()` - content hidden below\n * - `data-scroll-inline-start` / `canScrollInlineStart()` - hidden toward inline start\n * - `data-scroll-inline-end` / `canScrollInlineEnd()` - hidden toward inline end\n *\n * Inline start / end follow the writing direction: in `dir=\"rtl\"` the start\n * edge is on the right. The direction is derived from the scroll offset\n * itself, so a `dir=\"rtl\"` subtree inside an LTR page reports correctly.\n *\n * The directive paints nothing. The four attributes (present only while true)\n * are its public, stable contract; every visual belongs to the consumer CSS,\n * keyed on them. Three common cues:\n *\n * Shadow (Material 2 elevate-on-scroll):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { box-shadow: 0 2px 4px -2px rgb(0 0 0 / 0.3); }\n * ```\n *\n * Hairline that appears (iOS scroll-edge appearance; transparent border at rest):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { border-block-end-color: var(--cngx-color-border); }\n * ```\n *\n * Tonal surface change (Material 3 top app bar):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { background: var(--app-bar-scrolled-surface); }\n * ```\n *\n * Forced colors strips `box-shadow`, so a shadow-only cue disappears there;\n * prefer a border or pair the shadow with one under `forced-colors: active`.\n *\n * ```html\n * <div class=\"sheet\" cngxScrollEdges #edges=\"cngxScrollEdges\">...</div>\n * ```\n *\n * The edge state is purely visual and is not announced: the hidden content\n * stays in the DOM and in the reading order, and the scrollport remains\n * reachable by keyboard scrolling. Make the scrollport focusable (and named)\n * when it holds no focusable content of its own.\n *\n * Upgrade path: the attributes map 1:1 onto CSS\n * `@container scroll-state(scrollable: block-start)` and its siblings, so the\n * CSS can swap to native scroll-state queries once they are Baseline.\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStickyHeader, CngxScrollSpy, createScrollEdges\n * <example-url>http://localhost:4200/#/common/layout/scroll-edges/edge-shadows</example-url>\n */\n@Directive({\n selector: '[cngxScrollEdges]',\n exportAs: 'cngxScrollEdges',\n standalone: true,\n host: {\n '[attr.data-scroll-block-start]': \"canScrollBlockStart() ? '' : null\",\n '[attr.data-scroll-block-end]': \"canScrollBlockEnd() ? '' : null\",\n '[attr.data-scroll-inline-start]': \"canScrollInlineStart() ? '' : null\",\n '[attr.data-scroll-inline-end]': \"canScrollInlineEnd() ? '' : null\",\n },\n})\nexport class CngxScrollEdges {\n private readonly edges = createScrollEdges(\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n inject(DestroyRef),\n isPlatformBrowser(inject(PLATFORM_ID)) ? inject(DOCUMENT).defaultView : null,\n );\n\n /** Content is hidden toward the block-start edge (above). */\n readonly canScrollBlockStart = this.edges.canScrollBlockStart;\n /** Content is hidden toward the block-end edge (below). */\n readonly canScrollBlockEnd = this.edges.canScrollBlockEnd;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL). */\n readonly canScrollInlineStart = this.edges.canScrollInlineStart;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL). */\n readonly canScrollInlineEnd = this.edges.canScrollInlineEnd;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, DestroyRef, Directive, inject, input, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Headless skeleton loading placeholder.\n *\n * Toggles between loading and content states via CSS classes and ARIA attributes.\n * No template -- the consumer renders the skeleton UI.\n *\n * Exposes an `indices()` signal for `@for` rendering of repeated skeleton elements.\n * Respects `prefers-reduced-motion` (disables shimmer animation class).\n *\n * ### Basic loading placeholder\n * ```html\n * <div [cngxSkeleton]=\"isLoading()\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-line\" aria-hidden=\"true\"></div>\n * }\n * } @else {\n * <p>{{ content() }}</p>\n * }\n * </div>\n * ```\n *\n * ### Card list with repeat count\n * ```html\n * <div [cngxSkeleton]=\"loading()\" [count]=\"3\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-card\" aria-hidden=\"true\">\n * <div class=\"skeleton-avatar\"></div>\n * <div class=\"skeleton-line\"></div>\n * </div>\n * }\n * } @else {\n * @for (card of cards(); track card.id) {\n * <app-card [data]=\"card\" />\n * }\n * }\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/skeleton.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableText, CngxHighlight\n * <example-url>http://localhost:4200/#/common/layout/skeleton/basic-skeleton</example-url>\n * <example-url>http://localhost:4200/#/common/layout/skeleton/skeleton-container</example-url>\n */\n@Directive({\n selector: '[cngxSkeleton]',\n standalone: true,\n exportAs: 'cngxSkeleton',\n host: {\n class: 'cngx-skeleton',\n '[class.cngx-skeleton--loading]': 'loading()',\n '[class.cngx-skeleton--shimmer]': 'showShimmer()',\n '[attr.aria-busy]': 'loading() || null',\n },\n})\nexport class CngxSkeleton {\n /** Controls the loading state. */\n readonly skeleton = input<boolean>(false, { alias: 'cngxSkeleton' });\n\n /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */\n readonly shimmer = input<boolean>(true);\n\n /** Repeat count - exposed via the `indices()` signal for `@for` rendering. */\n readonly count = input<number>(1);\n\n private readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n this.prefersReducedMotion = createMediaQuerySignal(\n '(prefers-reduced-motion: reduce)',\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n }\n\n /** Whether the skeleton is in loading state. Mirrors the `cngxSkeleton` input. */\n readonly loading = computed(() => this.skeleton());\n\n /** Array of indices for `@for` rendering of repeated skeleton elements. */\n readonly indices = computed(() => Array.from({ length: this.count() }, (_, i) => i));\n\n /** @internal - shimmer class condition. */\n protected readonly showShimmer = computed(\n () => this.loading() && this.shimmer() && !this.prefersReducedMotion(),\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { createTransitionTracker } from '@cngx/core/utils';\n\n/**\n * Infinite scroll trigger using `IntersectionObserver`.\n *\n * Place on a sentinel element at the bottom of a list. Fires `loadMore`\n * when the sentinel enters the viewport. Includes a debounce guard and\n * a `loading` input to prevent re-triggers during fetch.\n *\n * The observer is automatically recreated when `root`, `rootMargin`, or\n * `threshold` inputs change, and disconnected on destroy or when `enabled`\n * is set to `false`. When `loading` settles back to `false` the sentinel is\n * re-observed, so a fetched page that did not push the sentinel out of view\n * still re-fires `loadMore` instead of stalling the list.\n *\n * ### Basic infinite list\n * ```html\n * <div class=\"item-list\">\n * @for (item of items(); track item.id) {\n * <app-item [data]=\"item\" />\n * }\n * <div cngxInfiniteScroll [loading]=\"isFetching()\" (loadMore)=\"fetchNext()\">\n * @if (scroll.isLoading()) { <mat-spinner diameter=\"24\" /> }\n * </div>\n * </div>\n * ```\n *\n * ### Disable when all loaded\n * ```html\n * <div cngxInfiniteScroll\n * [enabled]=\"hasNextPage()\"\n * [loading]=\"isFetching()\"\n * (loadMore)=\"fetchNext()\">\n * @if (!hasNextPage()) { <p>All items loaded</p> }\n * </div>\n * ```\n *\n * ### Custom scroll container with pre-fetch margin\n * ```html\n * <div cngxInfiniteScroll\n * [root]=\"'.scroll-container'\"\n * [rootMargin]=\"'0px 0px 400px 0px'\"\n * [loading]=\"loading()\"\n * (loadMore)=\"loadMore()\">\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/infinite-scroll.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxScrollSpy, CngxStickyHeader\n * <example-url>http://localhost:4200/#/common/layout/infinite-scroll/scrollable-list</example-url>\n */\n@Directive({\n selector: '[cngxInfiniteScroll]',\n standalone: true,\n exportAs: 'cngxInfiniteScroll',\n host: {\n class: 'cngx-infinite-scroll',\n '[class.cngx-infinite-scroll--loading]': 'isLoading()',\n '[attr.aria-busy]': 'isLoading() || null',\n },\n})\nexport class CngxInfiniteScroll {\n /** IntersectionObserver threshold (0–1). */\n readonly threshold = input<number>(0);\n\n /** Pre-fetch margin. `'0px 0px 200px 0px'` triggers 200px before the sentinel is visible. */\n readonly rootMargin = input<string>('0px 0px 200px 0px');\n\n /** CSS selector for a custom scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n\n /** When `false`, the observer disconnects entirely. Use to stop loading when all items are fetched. */\n readonly enabled = input<boolean>(true);\n\n /** Set to `true` while fetching. Prevents re-trigger until the fetch completes. */\n readonly loading = input<boolean>(false);\n\n /** Minimum ms between consecutive `loadMore` emissions. */\n readonly debounceMs = input<number>(200);\n\n /** Emitted when the sentinel is visible, not loading, and debounce has elapsed. */\n readonly loadMore = output<void>();\n\n /** Readonly mirror of the `loading` input. */\n readonly isLoading: Signal<boolean> = computed(() => this.loading());\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n private lastEmitTime = 0;\n private observer: IntersectionObserver | null = null;\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const enabled = this.enabled();\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const debounceMs = this.debounceMs();\n\n if (!enabled) {\n return;\n }\n\n const isLoading = () => this.loading();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (isDevMode() && root && !resolvedRoot) {\n console.warn(\n `[cngxInfiniteScroll] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n if (!entry.isIntersecting) {\n return;\n }\n if (isLoading()) {\n return;\n }\n\n const now = Date.now();\n if (now - this.lastEmitTime < debounceMs) {\n return;\n }\n\n this.lastEmitTime = now;\n this.loadMore.emit();\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n this.observer = observer;\n\n onCleanup(() => {\n observer.disconnect();\n this.observer = null;\n });\n });\n\n const loadingTransition = createTransitionTracker(() => this.loading());\n effect(() => {\n const loading = loadingTransition.current();\n const wasLoading = loadingTransition.previous();\n if (!wasLoading || loading) {\n return;\n }\n // IO reports intersection CHANGES only: when a fetched page does not\n // push the sentinel out of view there is no new entry after loading\n // settles, and the list stalls. Re-observing forces a fresh entry;\n // the debounce window is reset so that entry may emit immediately.\n untracked(() => {\n const sentinel = this.el.nativeElement as HTMLElement;\n this.lastEmitTime = 0;\n this.observer?.unobserve(sentinel);\n this.observer?.observe(sentinel);\n });\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Communicates when a sticky-positioned element becomes stuck.\n *\n * Applies `position: sticky; top: 0` on the host automatically.\n * The directive adds a sentinel element before the host and uses\n * `IntersectionObserver` to detect when the sentinel scrolls out,\n * meaning the header is now stuck. Toggles a CSS class for shadow,\n * elevation, or background changes.\n *\n * The sentinel is observed against the **nearest scroll-container ancestor**\n * (the first ancestor whose computed `overflow-y` is not `visible`), not the\n * page - that is the scrollport `position: sticky` resolves against, so\n * `isSticky()` reports the state the host actually has. A scrollport whose\n * height is content-driven never scrolls in the block axis, so a header inside\n * it never pins; in dev mode the directive warns once when it resolves against\n * such a scrollport. The observer is recreated when `threshold` changes,\n * matching the sibling observer directives.\n *\n * ### Sticky header with shadow\n * ```html\n * <header cngxStickyHeader #sh=\"cngxStickyHeader\"\n * style=\"position: sticky; top: 0;\">\n * Page header\n * </header>\n * ```\n *\n * ```css\n * .cngx-sticky--active { box-shadow: 0 2px 4px rgba(0,0,0,.1); }\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/sticky-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxScrollSpy, CngxIntersectionObserver\n * <example-url>http://localhost:4200/#/common/layout/sticky-header/sticky-header-with-shadow</example-url>\n */\n@Directive({\n selector: '[cngxStickyHeader]',\n exportAs: 'cngxStickyHeader',\n standalone: true,\n host: {\n style: 'position: sticky; top: 0; z-index: var(--cngx-sticky-z-index, 1)',\n '[class.cngx-sticky--active]': 'isSticky()',\n },\n})\nexport class CngxStickyHeader {\n /** Intersection threshold - `0` triggers as soon as the sentinel leaves. */\n readonly threshold = input<number>(0);\n\n /** Emitted when the sticky state changes. */\n readonly stickyChange = output<boolean>();\n\n private readonly isStickyState = signal(false);\n /** Whether the header is currently in its stuck position. */\n readonly isSticky = this.isStickyState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /** Sentinel + scrollport resolved once after render; the observer effect keys on it. */\n private readonly observeSetup = signal<{\n sentinel: HTMLElement;\n scrollport: HTMLElement | null;\n } | null>(null);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // IntersectionObserver sentinel pattern - host is stuck once the 1px sentinel leaves\n // the scrollport the host actually sticks to.\n afterNextRender(() => {\n const host = this.el.nativeElement as HTMLElement;\n // Root the sentinel at the scrollport `position: sticky` resolves against, not the\n // viewport. Observing against the viewport reports a different thing entirely: a\n // header inside a never-scrolling scrollport would read `isSticky() === true` while\n // it visibly scrolls away with its content.\n const scrollport = this.resolveScrollParent(host);\n\n // A scrollport whose content fits never scrolls in the block axis, so a header\n // inside it can never pin - `isSticky()` stays false while the whole scrollport\n // moves. Flag the misconfiguration once, in dev only; a one-shot read here is\n // exactly what `afterNextRender` is for (no reactive-graph node, unlike a\n // dep-less effect). The 1px tolerance absorbs sub-pixel layout and browser-zoom\n // rounding: \"cannot meaningfully scroll\" instead of exact equality.\n if (\n isDevMode() &&\n scrollport &&\n scrollport.scrollHeight - scrollport.clientHeight <= 1\n ) {\n console.warn(\n '[cngxStickyHeader] resolves against a scroll container that cannot scroll ' +\n 'in the block axis (client height equals scroll height), so this header ' +\n 'will never pin. Give the scrollport a bounded block-size, or drop ' +\n 'cngxStickyHeader.',\n { host, scrollport },\n );\n }\n\n const sentinel = this.doc.createElement('div');\n sentinel.style.height = '1px';\n sentinel.style.width = '1px';\n sentinel.style.marginBottom = '-1px';\n sentinel.style.visibility = 'hidden';\n sentinel.style.pointerEvents = 'none';\n sentinel.setAttribute('aria-hidden', 'true');\n host.parentElement?.insertBefore(sentinel, host);\n\n this.observeSetup.set({ sentinel, scrollport });\n destroyRef.onDestroy(() => sentinel.remove());\n });\n\n // Observer creation lives in an effect so a later threshold change\n // recreates it - the one-shot afterNextRender above only resolves DOM.\n effect((onCleanup) => {\n const setup = this.observeSetup();\n const threshold = this.threshold();\n if (!setup) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const isSticky = !entries[entries.length - 1].isIntersecting;\n if (isSticky !== this.isStickyState()) {\n this.isStickyState.set(isSticky);\n this.stickyChange.emit(isSticky);\n }\n },\n { threshold, root: setup.scrollport },\n );\n\n observer.observe(setup.sentinel);\n\n onCleanup(() => observer.disconnect());\n });\n }\n\n /**\n * The nearest ancestor that is a scroll container in the block axis - the scrollport\n * `position: sticky` resolves against. Walks up from the host's parent to the first\n * ancestor whose computed `overflow-y` is not `visible`; `null` means no such\n * ancestor, i.e. the header sticks to the viewport. A used `overflow-x` other than\n * `visible` coerces the computed `overflow-y` to `auto`, so this also catches a\n * horizontal scroll container (e.g. a data grid that scrolls sideways).\n */\n private resolveScrollParent(host: HTMLElement): HTMLElement | null {\n const view = this.doc.defaultView;\n for (let node = host.parentElement; node; node = node.parentElement) {\n const overflowY = view?.getComputedStyle(node).overflowY;\n if (overflowY && overflowY !== 'visible') {\n return node;\n }\n }\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n Directive,\n effect,\n inject,\n input,\n isDevMode,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Tracks which section is currently most visible in the viewport.\n *\n * Observes a list of elements by their IDs using `IntersectionObserver`\n * and reports the one with the highest intersection ratio as the active section.\n * Ideal for scroll-based navigation highlighting and reading progress.\n *\n * Section IDs are resolved when the inputs change - sections rendered later\n * (`@if`/`@defer`) are not picked up automatically; re-bind `[cngxScrollSpy]`\n * once they exist. In dev mode the directive warns about IDs it cannot find.\n *\n * ### Navigation highlighting\n * ```html\n * <nav [cngxScrollSpy]=\"['intro', 'features', 'pricing']\"\n * #spy=\"cngxScrollSpy\">\n * <a [class.active]=\"spy.activeId() === 'intro'\" href=\"#intro\">Intro</a>\n * <a [class.active]=\"spy.activeId() === 'features'\" href=\"#features\">Features</a>\n * <a [class.active]=\"spy.activeId() === 'pricing'\" href=\"#pricing\">Pricing</a>\n * </nav>\n *\n * <section id=\"intro\">…</section>\n * <section id=\"features\">…</section>\n * <section id=\"pricing\">…</section>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-spy.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxStickyHeader, CngxInfiniteScroll\n * <example-url>http://localhost:4200/#/common/layout/scroll-spy/scroll-based-navigation</example-url>\n */\n@Directive({\n selector: '[cngxScrollSpy]',\n exportAs: 'cngxScrollSpy',\n standalone: true,\n})\nexport class CngxScrollSpy {\n /** IDs of the sections to observe. */\n readonly sections = input.required<string[]>({ alias: 'cngxScrollSpy' });\n /** Minimum visibility ratio to consider a section as a candidate. */\n readonly threshold = input<number>(0.3);\n /** CSS selector for the scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n /** Root margin for the observer. */\n readonly rootMargin = input<string>('0px');\n\n /** Emitted when the active section changes. */\n readonly activeIdChange = output<string | null>();\n\n private readonly activeIdState = signal<string | null>(null);\n /** ID of the section with the highest intersection ratio. */\n readonly activeId = this.activeIdState.asReadonly();\n\n private readonly doc = inject(DOCUMENT);\n /** Last observed intersection ratio keyed by section ID. */\n private readonly ratios = new Map<string, number>();\n private readonly initialized = signal(false);\n private activeCleanup: (() => void) | undefined;\n\n constructor() {\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // Recreate the observer whenever inputs change (deferred until DOM is ready).\n effect((onCleanup) => {\n this.sections();\n this.threshold();\n this.root();\n this.rootMargin();\n\n if (!this.initialized()) {\n return;\n }\n\n this.activeCleanup?.();\n this.activeCleanup = this.setupObserver();\n\n onCleanup(() => {\n this.activeCleanup?.();\n this.activeCleanup = undefined;\n });\n });\n }\n\n /** Builds an `IntersectionObserver` for the current section IDs. Returns a disconnect callback. */\n private setupObserver(): (() => void) | undefined {\n const ids = this.sections();\n const thresholdValue = this.threshold();\n const rootSelector = this.root();\n const rootMarginValue = this.rootMargin();\n\n this.ratios.clear();\n\n const elements = ids\n .map((id) => this.doc.getElementById(id))\n .filter((el): el is HTMLElement => el !== null);\n\n if (isDevMode() && elements.length < ids.length) {\n const missing = ids.filter((id) => !this.doc.getElementById(id));\n console.warn(\n `[cngxScrollSpy] section id(s) not found: ${missing.join(', ')}. ` +\n 'Late-rendered sections are not observed - re-bind [cngxScrollSpy] once they exist.',\n );\n }\n\n if (elements.length === 0) {\n return undefined;\n }\n\n const resolvedRoot = rootSelector ? this.doc.querySelector(rootSelector) : null;\n if (isDevMode() && rootSelector && !resolvedRoot) {\n console.warn(\n `[cngxScrollSpy] root selector \"${rootSelector}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => this.ratios.set(entry.target.id, entry.intersectionRatio));\n\n const best = Array.from(this.ratios).reduce<{ id: string | null; ratio: number }>(\n (acc, [id, ratio]) =>\n ratio >= thresholdValue && ratio > acc.ratio ? { id, ratio } : acc,\n { id: null, ratio: 0 },\n );\n\n if (best.id !== this.activeIdState()) {\n this.activeIdState.set(best.id);\n this.activeIdChange.emit(best.id);\n }\n },\n {\n root: resolvedRoot,\n rootMargin: rootMarginValue,\n threshold: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],\n },\n );\n\n elements.forEach((el) => observer.observe(el));\n\n return () => observer.disconnect();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from '../observers/resize-signal';\n\n/**\n * Manages text truncation with expand/collapse state detection.\n *\n * Applies `-webkit-line-clamp` when collapsed and detects whether the text\n * is actually clamped (content overflows). Exposes `isClamped` so the consumer\n * can conditionally show a \"Show more\" toggle only when needed.\n *\n * The `expanded` state supports two-way binding (controlled + uncontrolled).\n *\n * ### Basic truncation with toggle\n * ```html\n * <p [cngxTruncate]=\"3\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n * Long text content that may or may not overflow…\n * </p>\n * @if (trunc.isClamped() || trunc.expanded()) {\n * <button (click)=\"expanded.set(!expanded())\"\n * [attr.aria-expanded]=\"expanded()\">\n * {{ expanded() ? 'Show less' : 'Show more' }}\n * </button> * }\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/truncate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText, CngxExpandableToggle, CngxHighlight\n * <example-url>http://localhost:4200/#/common/layout/truncate/short-text-no-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/layout/truncate/truncated-text-with-toggle</example-url>\n */\n@Directive({\n selector: '[cngxTruncate]',\n exportAs: 'cngxTruncate',\n standalone: true,\n host: {\n '[style.-webkit-line-clamp]': 'clampValue()',\n '[style.display]': 'displayValue()',\n '[style.-webkit-box-orient]': 'orientValue()',\n '[style.overflow]': 'overflowValue()',\n },\n})\nexport class CngxTruncate {\n /** Maximum number of visible lines when collapsed. */\n readonly lines = input<number>(3, { alias: 'cngxTruncate' });\n /** Whether the text is expanded (full content visible). Supports two-way binding. */\n readonly expanded = model<boolean>(false);\n\n private readonly isClampedState = signal(false);\n /** Whether the text content actually exceeds the line limit and is being clamped. */\n readonly isClamped = this.isClampedState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private stopResize: (() => void) | null = null;\n private rafHandle: number | null = null;\n\n // null strips the host binding - preferred over an empty string for -webkit-line-clamp.\n /** @internal */\n protected readonly clampValue = computed(() => (this.expanded() ? null : String(this.lines())));\n /** @internal */\n protected readonly displayValue = computed(() => (this.expanded() ? null : '-webkit-box'));\n /** @internal */\n protected readonly orientValue = computed(() => (this.expanded() ? null : 'vertical'));\n /** @internal */\n protected readonly overflowValue = computed(() => (this.expanded() ? null : 'hidden'));\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // SSR guard: no window, no measuring - the style bindings above still render.\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return;\n }\n\n afterNextRender(() => {\n this.checkClamped();\n this.stopResize = observeResize(\n win,\n this.el.nativeElement as HTMLElement,\n 'content-box',\n () => this.checkClamped(),\n );\n });\n\n // Re-check after expanded/lines change; RAF ensures styles are applied first.\n effect(() => {\n this.expanded(); // track\n this.lines(); // track\n this.cancelRaf();\n this.rafHandle = requestAnimationFrame(() => this.checkClamped());\n });\n\n destroyRef.onDestroy(() => {\n this.stopResize?.();\n this.cancelRaf();\n });\n }\n\n private cancelRaf(): void {\n if (this.rafHandle !== null) {\n cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n }\n\n /**\n * Compares `scrollHeight` vs `clientHeight` to detect overflow.\n * Only meaningful when collapsed - when expanded, the last known\n * clamped state is preserved (can't measure hypothetical clamp height\n * while showing full content).\n */\n private checkClamped(): void {\n const el = this.el.nativeElement as HTMLElement;\n if (this.expanded()) {\n return;\n }\n this.isClampedState.set(el.scrollHeight > el.clientHeight);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Search-text highlighting via `<mark>` elements.\n *\n * Walks `TEXT_NODE` children of the host element, splits at match boundaries,\n * and wraps matched portions in `<mark>` elements. No `innerHTML` - safe by\n * construction. The `<mark>` element has correct native SR semantics (announced\n * as \"highlighted\" in most screen readers).\n *\n * The original text nodes are kept by reference and re-inserted when the\n * term changes or the directive is destroyed - Angular bindings targeting\n * them (interpolations, structural directives) stay live.\n *\n * ### Search result highlighting\n * ```html\n * <p [cngxHighlight]=\"searchTerm()\">\n * Angular Signals represent a fundamental shift in reactivity.\n * </p>\n * ```\n *\n * ### Case-sensitive matching\n * ```html\n * <p [cngxHighlight]=\"term()\" [highlightCaseSensitive]=\"true\">\n * CamelCase matters here.\n * </p>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/highlight.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableText\n * <example-url>http://localhost:4200/#/common/layout/highlight/live-search-highlighting</example-url>\n * <example-url>http://localhost:4200/#/common/layout/highlight/multiple-paragraphs</example-url>\n */\n@Directive({\n selector: '[cngxHighlight]',\n exportAs: 'cngxHighlight',\n standalone: true,\n})\nexport class CngxHighlight {\n /** The search term to highlight. Empty string clears all highlights. */\n readonly term = input<string>('', { alias: 'cngxHighlight' });\n /** Whether matching is case-sensitive. */\n readonly caseSensitive = input<boolean>(false, { alias: 'highlightCaseSensitive' });\n\n private readonly matchCountState = signal(0);\n /** Number of matches found in the current highlight pass. */\n readonly matchCount = this.matchCountState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /**\n * The text nodes replaced by the current highlight pass, by reference,\n * with the nodes standing in for them. Undone before every re-highlight\n * and on destroy - re-inserting the original references keeps LView\n * bindings (interpolations) attached to live DOM.\n */\n private replacements: { original: Text; inserted: Node[] }[] = [];\n private readonly initialized = signal(false);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.restoreNodes());\n\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // The highlight pass writes matchCountState - untracked, so the write\n // cannot re-trigger this effect.\n effect(() => {\n const term = this.term();\n const caseSensitive = this.caseSensitive();\n if (this.initialized()) {\n untracked(() => this.applyHighlight(term, caseSensitive));\n }\n });\n }\n\n /**\n * Performs the highlight pass: restores original DOM, then wraps matches\n * in `<mark>` elements. Updates `matchCountState` with the result count.\n */\n private applyHighlight(term: string, caseSensitive: boolean): void {\n const host = this.el.nativeElement as HTMLElement;\n\n this.restoreNodes();\n\n if (!term) {\n this.matchCountState.set(0);\n return;\n }\n\n let count = 0;\n const walker = this.doc.createTreeWalker(host, NodeFilter.SHOW_TEXT);\n const textNodes: Text[] = [];\n\n // Collect nodes before modifying the DOM during the walk.\n let node: Text | null;\n while ((node = walker.nextNode() as Text | null)) {\n textNodes.push(node);\n }\n\n for (const textNode of textNodes) {\n const text = textNode.textContent ?? '';\n const flags = caseSensitive ? 'g' : 'gi';\n const regex = new RegExp(this.escapeRegex(term), flags);\n const matches = [...text.matchAll(regex)];\n\n if (matches.length === 0) {\n continue;\n }\n\n count += matches.length;\n const fragment = this.doc.createDocumentFragment();\n let lastIndex = 0;\n\n for (const match of matches) {\n const matchStart = match.index;\n const matchEnd = matchStart + match[0].length;\n\n if (matchStart > lastIndex) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex, matchStart)));\n }\n\n const mark = this.doc.createElement('mark');\n mark.textContent = text.slice(matchStart, matchEnd);\n fragment.appendChild(mark);\n\n lastIndex = matchEnd;\n }\n\n if (lastIndex < text.length) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex)));\n }\n\n // Capture before replaceChild - inserting a fragment empties it.\n const inserted = Array.from(fragment.childNodes);\n textNode.parentNode!.replaceChild(fragment, textNode);\n this.replacements.push({ original: textNode, inserted });\n }\n\n this.matchCountState.set(count);\n }\n\n /** Puts the original text nodes back and removes the highlight nodes. */\n private restoreNodes(): void {\n for (const { original, inserted } of this.replacements) {\n const parent = inserted[0]?.parentNode;\n if (!parent) {\n continue;\n }\n parent.insertBefore(original, inserted[0]);\n for (const node of inserted) {\n if (node.parentNode === parent) {\n parent.removeChild(node);\n }\n }\n }\n this.replacements = [];\n }\n\n /** Escapes special regex characters in the search term. */\n private escapeRegex(str: string): string {\n return str.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n }\n}\n","// Pulls the augmented module into the program; ng-packagr rejects `declare module` (TS2664) otherwise.\nimport type {} from '@cngx/core/i18n';\n\n/**\n * The layout section of a {@link CngxLanguagePack}: the copy of the\n * `@cngx/common/layout` atoms. It feeds `CNGX_LAYOUT_I18N`.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport interface CngxLayoutLanguageSection {\n /** Label of the `CngxExpandableText` expand control. */\n readonly expandableTextMore: string;\n /** Label of the `CngxExpandableText` collapse control. */\n readonly expandableTextLess: string;\n}\n\n/**\n * The English layout section: the single source of the layout atoms'\n * English copy. `CNGX_LAYOUT_I18N` defaults to it.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport const CNGX_LAYOUT_LANGUAGE_EN: CngxLayoutLanguageSection = {\n expandableTextMore: 'Show more',\n expandableTextLess: 'Show less',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly layout: CngxLayoutLanguageSection;\n }\n}\n","import { inject, InjectionToken, type Provider, type Signal } from '@angular/core';\nimport { createLanguageSection } from '@cngx/core/i18n';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport { CNGX_LAYOUT_LANGUAGE_EN, type CngxLayoutLanguageSection } from './layout-language-section';\n\n/**\n * Layout i18n surface. Library defaults are English; consumers override via\n * {@link provideLayoutI18n}. Reactive from birth: the token carries a\n * `Signal`, and {@link withLayoutI18nLabels} accepts a `Signal` of a partial\n * bundle.\n *\n * Both keys are the fallback of the `CngxExpandableText` `moreLabel` /\n * `lessLabel` inputs, resolved in a `computed()`: a bound input wins, and an\n * unbound one follows a language switch. The same shape as the layout\n * section of a language pack, declared once as\n * {@link CngxLayoutLanguageSection}.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport type CngxLayoutI18n = CngxLayoutLanguageSection;\n\n/** @internal The English section with the active pack's layout section on top. */\nconst layoutBundleFromPack = createLanguageSection('layout', CNGX_LAYOUT_LANGUAGE_EN);\n\n/**\n * DI token for the layout i18n bundle. `providedIn: 'root'`: the layout\n * section of the active language pack over the English defaults; the value\n * is a `Signal`, shared by every reader under one injector.\n *\n * @category common/layout/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/i18n/layout-i18n.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText\n */\nexport const CNGX_LAYOUT_I18N = new InjectionToken<Signal<CngxLayoutI18n>>('CngxLayoutI18n', {\n providedIn: 'root',\n factory: layoutBundleFromPack,\n});\n\n/**\n * Branded feature-fn for {@link provideLayoutI18n}.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport type CngxLayoutI18nFeature = ((bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>) & {\n readonly _target: 'i18n';\n};\n\n/** @internal */\nfunction defineLayoutI18nFeature(\n fn: (bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>,\n): CngxLayoutI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override layout labels via a partial bundle - unset keys keep the\n * language pack's copy, or the English default. Pass a `Signal` of a partial\n * bundle to switch languages at runtime.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function withLayoutI18nLabels(\n overrides: Partial<CngxLayoutI18n> | Signal<Partial<CngxLayoutI18n>>,\n): CngxLayoutI18nFeature {\n return defineLayoutI18nFeature((bundle) => createOverrideMerge(bundle, overrides));\n}\n\n/**\n * Provider for the layout i18n bundle. Returns a plain `Provider`, so it\n * also scopes a subtree through `viewProviders`. The features apply on top\n * of the active language pack.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideLayoutI18n(\n * withLayoutI18nLabels({ expandableTextMore: 'Mehr anzeigen', expandableTextLess: 'Weniger anzeigen' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function provideLayoutI18n(...features: readonly CngxLayoutI18nFeature[]): Provider {\n return {\n provide: CNGX_LAYOUT_I18N,\n useFactory: () =>\n features.reduce<Signal<CngxLayoutI18n>>(\n (bundle, feat) => feat(bundle),\n layoutBundleFromPack(),\n ),\n };\n}\n\n/**\n * Inject the resolved layout i18n bundle signal. Read it inside a\n * `computed()` or template so a runtime override flip re-derives.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function injectLayoutI18n(): Signal<CngxLayoutI18n> {\n return inject(CNGX_LAYOUT_I18N);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n inject,\n input,\n model,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport { CngxTruncate } from './truncate.directive';\n\n/**\n * Template context for the custom toggle template.\n *\n * @category common/layout\n */\nexport interface CngxExpandableToggleContext {\n /** Whether the text is currently expanded. */\n $implicit: boolean;\n /** Whether the text is currently expanded. */\n expanded: boolean;\n /** Call to toggle the expanded state. */\n toggle: () => void;\n}\n\n/**\n * Marks a custom toggle template inside `cngx-expandable-text`.\n *\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\" class=\"icon-btn\">\n * <mat-icon>{{ expanded ? 'expand_less' : 'expand_more' }}</mat-icon>\n * </button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText, CngxTruncate\n */\n@Directive({\n selector: 'ng-template[cngxExpandableToggle]',\n standalone: true,\n})\nexport class CngxExpandableToggle {\n readonly templateRef = inject<TemplateRef<CngxExpandableToggleContext>>(TemplateRef);\n}\n\n/**\n * Molecule wrapping `CngxTruncate` with a built-in expand/collapse toggle.\n *\n * Projects content into a truncated container and conditionally renders\n * a \"Show more\" / \"Show less\" button when the content is actually clamped.\n * Handles `aria-expanded` automatically.\n *\n * Supports custom toggle templates via `ng-template[cngxExpandableToggle]` -\n * use for icon buttons or any custom UI instead of plain text labels.\n *\n * ### Basic usage\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text that may or may not overflow the container…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom labels\n * ```html\n * <cngx-expandable-text [lines]=\"2\" moreLabel=\"Mehr\" lessLabel=\"Weniger\">\n * Langer Text…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom toggle template\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\">{{ expanded ? 'Collapse' : 'Expand' }}</button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableToggle, CngxHighlight\n * @slot cngxExpandableToggle Replaces the show-more control; gets the current expanded state.\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/auto-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/custom-labels</example-url>\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/custom-toggle-template</example-url>\n */\n@Component({\n selector: 'cngx-expandable-text',\n exportAs: 'cngxExpandableText',\n standalone: true,\n imports: [CngxTruncate, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n style: 'display:block',\n },\n template: `\n <div [cngxTruncate]=\"lines()\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n <ng-content />\n </div>\n @if (trunc.isClamped() || expanded()) {\n @if (customToggle(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"toggleContext()\"\n />\n } @else {\n <button\n type=\"button\"\n class=\"cngx-expandable-text__toggle\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? resolvedLessLabel() : resolvedMoreLabel() }}\n </button>\n }\n }\n `,\n})\nexport class CngxExpandableText {\n private readonly i18n = injectLayoutI18n();\n\n /** Maximum visible lines when collapsed. */\n readonly lines = input<number>(3);\n /** Whether the text is expanded. Supports two-way `[(expanded)]` binding. */\n readonly expanded = model<boolean>(false);\n /**\n * Label for the \"show more\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextMore`.\n */\n readonly moreLabel = input<string | undefined>(undefined);\n /**\n * Label for the \"show less\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextLess`.\n */\n readonly lessLabel = input<string | undefined>(undefined);\n protected readonly resolvedMoreLabel = computed(\n () => this.moreLabel() ?? this.i18n().expandableTextMore,\n );\n protected readonly resolvedLessLabel = computed(\n () => this.lessLabel() ?? this.i18n().expandableTextLess,\n );\n\n /** Optional custom toggle template projected by the consumer. */\n protected readonly customToggle = contentChild(CngxExpandableToggle);\n\n /** Stable toggle closure - a fresh closure per context would defeat the equal fn below. */\n private readonly toggleFn = (): void => this.expanded.set(!this.expanded());\n\n /**\n * Template context for the custom toggle. Structural `equal` fn so\n * `ngTemplateOutletContext` does not rebind the embedded view on every\n * CD cycle (same rule as the CngxTag slot contexts).\n */\n protected readonly toggleContext = computed<CngxExpandableToggleContext>(\n () => ({\n $implicit: this.expanded(),\n expanded: this.expanded(),\n toggle: this.toggleFn,\n }),\n { equal: (a, b) => a.expanded === b.expanded },\n );\n}\n","/**\n * @module @cngx/common/layout\n */\nexport { CngxBackdrop } from './drawer/backdrop.directive';\nexport { CngxDrawer, type DrawerPosition } from './drawer/drawer.directive';\nexport { CngxDrawerPanel, type DrawerMode } from './drawer/drawer-panel.directive';\nexport { CngxDrawerContent } from './drawer/drawer-content.directive';\nexport { CngxIntersectionObserver } from './observers/intersection-observer.directive';\nexport { CngxMediaQuery } from './observers/media-query.directive';\nexport { injectMediaQuery } from './observers/inject-media-query';\nexport { injectQueryParamSync, type QueryParamSyncOptions } from './router/inject-query-param-sync';\nexport { CngxResizeObserver } from './observers/resize-observer.directive';\nexport {\n createResizeSignal,\n observeResize,\n type ResizeObserverHost,\n} from './observers/resize-signal';\nexport { CngxContainer } from './observers/container.directive';\nexport {\n CNGX_CONTAINER_SIZE,\n type CngxContainerSize,\n createContainerSize,\n injectContainerSize,\n} from './observers/container-size';\nexport { CngxScrollLock } from './scroll/scroll-lock.directive';\nexport { createScrollLock } from './scroll/scroll-lock-core';\nexport { CngxScrollEdges } from './scroll/scroll-edges.directive';\nexport {\n createScrollEdges,\n type CngxScrollEdgesState,\n type ScrollEdgesHost,\n} from './scroll/scroll-edges-core';\nexport { CngxSkeleton } from './text/skeleton.directive';\nexport { CngxInfiniteScroll } from './scroll/infinite-scroll.directive';\nexport { CngxStickyHeader } from './scroll/sticky-header.directive';\nexport { CngxScrollSpy } from './scroll/scroll-spy.directive';\nexport { CngxTruncate } from './text/truncate.directive';\nexport { CngxHighlight } from './text/highlight.directive';\nexport {\n CngxExpandableText,\n CngxExpandableToggle,\n type CngxExpandableToggleContext,\n} from './text/expandable-text';\nexport {\n CNGX_LAYOUT_I18N,\n injectLayoutI18n,\n provideLayoutI18n,\n withLayoutI18nLabels,\n type CngxLayoutI18n,\n type CngxLayoutI18nFeature,\n} from './i18n/layout-i18n';\nexport {\n CNGX_LAYOUT_LANGUAGE_EN,\n type CngxLayoutLanguageSection,\n} from './i18n/layout-language-section';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DestroyRefToken"],"mappings":";;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEG;MAWU,YAAY,CAAA;;IAEd,OAAO,GAAG,KAAK,CAAU,KAAK,+EAAI,KAAK,EAAE,cAAc,EAAA,CAAG;;AAE1D,IAAA,YAAY,GAAG,KAAK,CAAU,IAAI,mFAAC;;IAEnC,aAAa,GAAG,MAAM,EAAQ;AAEtB,IAAA,EAAE,GAAG,MAAM,EAAC,UAAuB,EAAC;AACpC,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;AAEzC,IAAA,WAAA,GAAA;AACE,QAAA,eAAe,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAE9C,QAAA,MAAM,CAAC,CAAC,SAAS,KAAI;AACnB,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE;gBACvC;YACF;;;;AAIA,YAAA,MAAM,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
|
|
1
|
+
{"version":3,"file":"cngx-common-layout.mjs","sources":["../../../projects/common/layout/drawer/backdrop.directive.ts","../../../projects/common/layout/drawer/drawer.directive.ts","../../../projects/common/layout/drawer/drawer-panel.directive.ts","../../../projects/common/layout/drawer/drawer-content.directive.ts","../../../projects/common/layout/observers/intersection-observer.directive.ts","../../../projects/common/layout/observers/media-query.directive.ts","../../../projects/common/layout/observers/inject-media-query.ts","../../../projects/common/layout/router/warn-router-absent.ts","../../../projects/common/layout/router/inject-query-param-sync.ts","../../../projects/common/layout/observers/resize-signal.ts","../../../projects/common/layout/observers/resize-observer.directive.ts","../../../projects/common/layout/observers/container-size.ts","../../../projects/common/layout/observers/container.directive.ts","../../../projects/common/layout/scroll/scroll-lock-core.ts","../../../projects/common/layout/scroll/scroll-lock.directive.ts","../../../projects/common/layout/scroll/scroll-edges-core.ts","../../../projects/common/layout/scroll/scroll-edges.directive.ts","../../../projects/common/layout/text/skeleton.directive.ts","../../../projects/common/layout/scroll/infinite-scroll.directive.ts","../../../projects/common/layout/scroll/sticky-header.directive.ts","../../../projects/common/layout/scroll/scroll-spy.directive.ts","../../../projects/common/layout/text/truncate.directive.ts","../../../projects/common/layout/text/highlight.directive.ts","../../../projects/common/layout/i18n/layout-language-section.ts","../../../projects/common/layout/i18n/layout-i18n.ts","../../../projects/common/layout/text/expandable-text.ts","../../../projects/common/layout/public-api.ts","../../../projects/common/layout/cngx-common-layout.ts"],"sourcesContent":["import {\n afterNextRender,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Manages backdrop overlay behavior: visibility, click-to-close, and\n * `inert` toggling on sibling elements.\n *\n * When visible, all sibling elements of the host receive the `inert`\n * attribute, preventing focus and interaction behind the backdrop.\n * This is critical for a11y in modal/drawer overlays. A sibling drawer\n * panel (`.cngx-drawer-panel`) is excluded - it is the surface the\n * backdrop guards, not content behind it. Siblings that already carry\n * `inert` are left alone, so a consumer-set `inert` survives the\n * show/hide cycle. The sibling set is re-queried on every show, so\n * siblings rendered after init are covered too.\n *\n * The directive is purely behavioral - it toggles the\n * `.cngx-backdrop--visible` class and `aria-hidden` attribute. Visual\n * styling is opt-in: either consume the shipped default stylesheet or\n * provide your own.\n *\n * ### Drawer backdrop with shipped defaults (recommended)\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <div [cngxBackdrop]=\"drawer.opened()\" (backdropClick)=\"drawer.close()\"\n * class=\"cngx-backdrop\"></div>\n * <nav [cngxDrawerPanel]=\"drawer\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n * ```css\n * @import '@cngx/common/theming/components/cngx-backdrop.css';\n * ```\n *\n * Token surface (Three-Tier-Override):\n * - `--cngx-backdrop-bg` (scrim color, default `oklch(0 0 0 / 0.5)`)\n * - `--cngx-backdrop-transition-duration` (default `200ms`)\n *\n * ### Custom styling (no opt-in class)\n * If the shipped defaults don't fit, omit the `.cngx-backdrop` class and\n * style your own host class - the directive still toggles\n * `.cngx-backdrop--visible` on the host element.\n *\n * ```html\n * <div [cngxBackdrop]=\"visible()\" class=\"my-backdrop\"></div>\n * ```\n * ```css\n * .my-backdrop {\n * position: fixed;\n * inset: 0;\n * background: rgba(0, 0, 0, 0.3);\n * opacity: 0;\n * pointer-events: none;\n * transition: opacity 0.25s ease;\n * }\n * .my-backdrop.cngx-backdrop--visible {\n * opacity: 1;\n * pointer-events: auto;\n * }\n * ```\n *\n * @category common/layout\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/backdrop.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerPanel, CngxScrollLock\n * <example-url>http://localhost:4200/#/common/layout/backdrop/overlay-with-inert</example-url>\n */\n@Directive({\n selector: '[cngxBackdrop]',\n exportAs: 'cngxBackdrop',\n standalone: true,\n host: {\n '[class.cngx-backdrop--visible]': 'visible()',\n 'aria-hidden': 'true',\n '(click)': 'handleHostClick()',\n },\n})\nexport class CngxBackdrop {\n /** Whether the backdrop is visible and siblings are inert. */\n readonly visible = input<boolean>(false, { alias: 'cngxBackdrop' });\n /** Whether clicking the backdrop emits `backdropClick`. */\n readonly closeOnClick = input<boolean>(true);\n /** Emitted when the backdrop is clicked (and `closeOnClick` is true). */\n readonly backdropClick = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly domReady = signal(false);\n\n constructor() {\n afterNextRender(() => this.domReady.set(true));\n\n effect((onCleanup) => {\n if (!this.domReady() || !this.visible()) {\n return;\n }\n // Re-queried on every show: siblings rendered after init (@if/@defer)\n // must be inerted too. The drawer panel keeps working - it is the\n // surface the backdrop guards, not content behind it.\n const el = this.el.nativeElement as HTMLElement;\n const parent = el.parentElement;\n // skip siblings that are already inert - removing it on cleanup\n // would clobber a consumer-set attribute that predated the show\n const targets = parent\n ? Array.from(parent.children).filter(\n (child): child is HTMLElement =>\n child !== el &&\n child instanceof HTMLElement &&\n !child.classList.contains('cngx-drawer-panel') &&\n !child.hasAttribute('inert'),\n )\n : [];\n targets.forEach((target) => target.setAttribute('inert', ''));\n onCleanup(() => targets.forEach((target) => target.removeAttribute('inert')));\n });\n }\n\n /** @internal */\n protected handleHostClick(): void {\n if (this.visible() && this.closeOnClick()) {\n this.backdropClick.emit();\n }\n }\n}\n","import { computed, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n/**\n * Position from which the drawer panel slides in.\n *\n * @category common/layout\n */\nexport type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * State owner for a drawer / sidebar system.\n *\n * Holds the open/close state and handles the Escape key. Supports both\n * **controlled** (`[cngxDrawerOpened]=\"signal()\"`) and **uncontrolled**\n * (internal state via `open()` / `close()` / `toggle()`) modes.\n *\n * Child directives (`CngxDrawerPanel`, `CngxDrawerContent`) receive a\n * reference to this directive via an explicit input - no ancestor injection.\n *\n * ### Uncontrolled\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <button (click)=\"drawer.toggle()\">Menu</button>\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n *\n * ### Controlled\n * ```html\n * <div cngxDrawer [cngxDrawerOpened]=\"sidebarOpen()\"\n * (openedChange)=\"sidebarOpen.set($event)\">\n * …\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawerPanel, CngxDrawerContent, CngxBackdrop, CngxScrollLock\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawer]',\n exportAs: 'cngxDrawer',\n standalone: true,\n host: {\n '[class.cngx-drawer--opened]': 'opened()',\n '(keydown.escape)': 'close()',\n },\n})\nexport class CngxDrawer {\n /** @internal Host element ref - used by `CngxDrawerPanel` for click-outside containment. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Controlled opened state. When bound, takes precedence over internal state. */\n readonly openedInput = input<boolean | undefined>(undefined, { alias: 'cngxDrawerOpened' });\n\n private readonly openedState = signal(false);\n\n /** Resolved opened state - controlled input wins over internal state. */\n readonly opened = computed(() => this.openedInput() ?? this.openedState());\n\n /** Emitted when the opened state changes. Wire to a signal for two-way binding. */\n readonly openedChange = output<boolean>();\n /** Emitted when the drawer closes. Convenience shorthand for close-only listeners. */\n readonly closed = output<void>();\n\n /** Opens the drawer. No-op when already open. */\n open(): void {\n if (this.opened()) {\n return;\n }\n this.openedState.set(true);\n this.openedChange.emit(true);\n }\n\n /** Closes the drawer. */\n close(): void {\n if (!this.opened()) {\n return;\n }\n this.openedState.set(false);\n this.openedChange.emit(false);\n this.closed.emit();\n }\n\n /** Toggles the drawer between open and closed. */\n toggle(): void {\n if (this.opened()) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap } from 'rxjs';\nimport { createTransitionTracker } from '@cngx/core/utils';\nimport { CngxFocusTrap } from '@cngx/common/a11y';\nimport type { CngxDrawer, DrawerPosition } from './drawer.directive';\n\n/**\n * How the drawer panel interacts with the content area.\n *\n * @category common/layout\n */\nexport type DrawerMode = 'over' | 'push' | 'side';\n\n/**\n * The sliding panel of a drawer. Reads its open state from an explicit\n * `[cngxDrawerPanel]` reference - no ancestor injection.\n *\n * Composes `CngxFocusTrap` as a `hostDirective` - the consumer controls\n * the `[enabled]` and `[autoFocus]` inputs from the template.\n *\n * Optionally closes the drawer when the user clicks outside the panel\n * (`closeOnClickOutside`, default `true`). The click that opened the\n * drawer never counts as an outside click. While closed (except in\n * `side` mode) the panel is `aria-hidden` AND `inert`, so its focusable\n * children are unreachable for keyboard and AT alike. On close, focus\n * returns to the element that was focused when the drawer opened -\n * unless the user moved focus to another focusable element themselves\n * (a click on a focusable outside target keeps its focus).\n *\n * The `role` input defaults to `complementary`. On a `<nav>` host pass\n * `[role]=\"null\"` so the implicit navigation landmark survives:\n *\n * ```html\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\" mode=\"over\" [role]=\"null\"\n * [enabled]=\"drawer.opened()\" [autoFocus]=\"true\">\n * <a href=\"/home\">Home</a>\n * </nav>\n * ```\n *\n * @category common/layout\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-panel.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerContent, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerPanel]',\n exportAs: 'cngxDrawerPanel',\n standalone: true,\n hostDirectives: [{ directive: CngxFocusTrap, inputs: ['enabled', 'autoFocus'] }],\n host: {\n '[class.cngx-drawer-panel]': 'true',\n '[class.cngx-drawer-panel--open]': 'isOpen()',\n '[class.cngx-drawer-panel--left]': \"position() === 'left'\",\n '[class.cngx-drawer-panel--right]': \"position() === 'right'\",\n '[class.cngx-drawer-panel--top]': \"position() === 'top'\",\n '[class.cngx-drawer-panel--bottom]': \"position() === 'bottom'\",\n '[class.cngx-drawer-panel--over]': \"mode() === 'over'\",\n '[class.cngx-drawer-panel--push]': \"mode() === 'push'\",\n '[class.cngx-drawer-panel--side]': \"mode() === 'side'\",\n '[attr.aria-hidden]': \"mode() !== 'side' && !isOpen() ? true : null\",\n '[attr.inert]': \"mode() !== 'side' && !isOpen() ? '' : null\",\n '[attr.role]': 'role()',\n },\n})\nexport class CngxDrawerPanel {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerPanel' });\n\n /** Direction the panel slides from. */\n readonly position = input<DrawerPosition>('left');\n\n /**\n * How the panel interacts with the content area:\n * - `'over'` (default) - overlays content (absolute positioned)\n * - `'push'` - pushes content aside (content gets margin)\n * - `'side'` - always visible, no toggle behavior\n */\n readonly mode = input<DrawerMode>('over');\n\n /** Whether clicking outside the panel closes the drawer. */\n readonly closeOnClickOutside = input<boolean>(true);\n\n /**\n * Landmark role rendered on the panel. Defaults to `complementary`;\n * pass `navigation` for nav drawers or `null` to keep the element's\n * implicit role (e.g. on a `<nav>` host).\n */\n readonly role = input<string | null>('complementary');\n\n /** Whether the drawer is currently open (derived from the drawer ref). In `side` mode, always `true`. */\n readonly isOpen = computed(() => this.mode() === 'side' || this.drawerRef().opened());\n\n private suppressOutsideClick = false;\n private restoreTarget: HTMLElement | null = null;\n\n constructor() {\n const doc = inject(DOCUMENT);\n const el = inject(ElementRef<HTMLElement>);\n\n // Focus restoration: closing puts `inert` on the panel, which would\n // silently drop focus to <body>. Capture the focused element at the\n // open transition and hand focus back at the close transition when\n // focus is still inside the panel (Escape) or already fell to <body>\n // (outside click on a non-focusable area). A focusable outside target\n // the user clicked keeps its focus.\n const openTransition = createTransitionTracker(() => this.isOpen());\n effect(() => {\n const open = openTransition.current();\n const wasOpen = openTransition.previous();\n if (open === wasOpen) {\n return;\n }\n untracked(() => {\n if (open) {\n const active = doc.activeElement;\n this.restoreTarget = active instanceof HTMLElement ? active : null;\n return;\n }\n const active = doc.activeElement;\n const focusLost =\n active === null ||\n active === doc.body ||\n (el.nativeElement as HTMLElement).contains(active);\n if (focusLost && this.restoreTarget?.isConnected) {\n this.restoreTarget.focus();\n }\n this.restoreTarget = null;\n });\n });\n\n // A click on a toggle OUTSIDE the container opens the drawer and then\n // bubbles on to the document listener below within the same dispatch -\n // without suppression it would close its own drawer instantly. The\n // openedChange emit is synchronous inside that dispatch; the flag is\n // lifted on the next macrotask, after the bubble phase has finished\n // (a microtask checkpoint can run between listeners of a native event).\n toObservable(this.drawerRef)\n .pipe(\n switchMap((drawer) => outputToObservable(drawer.openedChange)),\n takeUntilDestroyed(),\n )\n .subscribe((opened) => {\n if (opened) {\n this.suppressOutsideClick = true;\n setTimeout(() => (this.suppressOutsideClick = false));\n }\n });\n\n // Hit-test against the container, not the panel - toggle buttons and backdrops\n // sit inside the container and must not count as outside clicks.\n fromEvent<MouseEvent>(doc, 'click')\n .pipe(takeUntilDestroyed())\n .subscribe((e) => {\n if (\n !this.suppressOutsideClick &&\n this.mode() !== 'side' &&\n this.isOpen() &&\n this.closeOnClickOutside() &&\n !(this.drawerRef().elementRef.nativeElement as HTMLElement).contains(e.target as Node)\n ) {\n this.drawerRef().close();\n }\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport type { CngxDrawer } from './drawer.directive';\n\n/**\n * Marks the main content area adjacent to a drawer panel.\n *\n * Adds a CSS class when the drawer is open so the consumer can offset\n * the content via CSS transitions or transforms.\n *\n * ```html\n * <main [cngxDrawerContent]=\"drawer\">\n * Page content\n * </main>\n * ```\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerPanel\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerContent]',\n exportAs: 'cngxDrawerContent',\n standalone: true,\n host: {\n '[class.cngx-drawer-content]': 'true',\n '[class.cngx-drawer-content--shifted]': 'isOpen()',\n },\n})\nexport class CngxDrawerContent {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerContent' });\n\n /** Whether the drawer is currently open (derived from the drawer ref). */\n readonly isOpen = computed(() => this.drawerRef().opened());\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Observes whether the host element is visible in the viewport or a scroll container.\n *\n * Wraps the browser's `IntersectionObserver` API and exposes its state as\n * Angular signals. The observer is automatically recreated when `root`,\n * `rootMargin`, or `threshold` inputs change, and disconnected on destroy.\n *\n * Use cases: lazy loading images, infinite scroll sentinels, scroll-triggered\n * animations, \"back to top\" buttons, analytics viewport tracking.\n *\n * ### Lazy load sentinel\n * ```html\n * <div cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * (entered)=\"loadNextPage()\">\n * @if (io.isIntersecting()) { Loading... }\n * </div>\n * ```\n *\n * ### Scroll-triggered animation\n * ```html\n * <section cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * [threshold]=\"0.5\"\n * [class.visible]=\"io.isIntersecting()\">\n * Content fades in at 50% visibility\n * </section>\n * ```\n *\n * ### Custom scroll container\n * ```html\n * <div cngxIntersectionObserver [root]=\"'.scroll-container'\" [rootMargin]=\"'100px'\">\n * Observed within a scrollable parent\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/intersection-observer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxResizeObserver, CngxMediaQuery, CngxInfiniteScroll, CngxScrollSpy\n * <example-url>http://localhost:4200/#/common/layout/intersection-observer/scroll-sentinel</example-url>\n */\n@Directive({\n selector: '[cngxIntersectionObserver]',\n exportAs: 'cngxIntersectionObserver',\n standalone: true,\n})\nexport class CngxIntersectionObserver {\n /** CSS selector for the scroll container root. `null` (default) uses the viewport. */\n readonly root = input<string | null>(null);\n /** Margin around the root, using CSS margin syntax (e.g. `'100px 0px'`). */\n readonly rootMargin = input<string>('0px');\n /** Visibility ratio(s) at which the callback fires. `0` = any pixel visible, `1` = fully visible. */\n readonly threshold = input<number | number[]>(0);\n\n private readonly entryState = signal<IntersectionObserverEntry | null>(null);\n\n /** `true` when any part of the element is visible within the root. */\n readonly isIntersecting = computed(() => this.entryState()?.isIntersecting ?? false);\n /** The fraction of the element currently visible (0–1). */\n readonly intersectionRatio = computed(() => this.entryState()?.intersectionRatio ?? 0);\n\n /** Emitted on every intersection change with the raw `IntersectionObserverEntry`. */\n readonly intersectionChange = output<IntersectionObserverEntry>();\n /** Emitted once when the element enters the observed area. */\n readonly entered = output<void>();\n /** Emitted once when the element leaves the observed area. */\n readonly left = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (typeof ngDevMode !== 'undefined' && ngDevMode && root && !resolvedRoot) {\n cngxDevWarn(\n 'CNGX1032',\n `[cngxIntersectionObserver] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n const wasIntersecting = this.entryState()?.isIntersecting ?? false;\n this.entryState.set(entry);\n this.intersectionChange.emit(entry);\n if (entry.isIntersecting && !wasIntersecting) {\n this.entered.emit();\n }\n if (!entry.isIntersecting && wasIntersecting) {\n this.left.emit();\n }\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, effect, inject, input, signal } from '@angular/core';\nimport { observeMediaQuery } from '@cngx/core/utils';\n\n/**\n * Reactive media query directive that exposes a `matches` signal.\n *\n * Wraps `window.matchMedia()` with automatic cleanup. Usable for\n * responsive layouts, drawer mode switching, conditional rendering,\n * or any behavior that depends on viewport/preference queries.\n *\n * ### Responsive drawer mode\n * ```html\n * <div cngxMediaQuery=\"(min-width: 1024px)\" #mq=\"cngxMediaQuery\">\n * <nav [cngxDrawerPanel]=\"drawer\"\n * [mode]=\"mq.matches() ? 'side' : 'over'\">\n * …\n * </nav>\n * </div>\n * ```\n *\n * ### Conditional content\n * ```html\n * <div cngxMediaQuery=\"(prefers-color-scheme: dark)\" #dark=\"cngxMediaQuery\">\n * @if (dark.matches()) { <span>Dark mode active</span> }\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/media-query.directive.ts\n * @since 0.1.0\n * @relatedTo CngxResizeObserver, CngxIntersectionObserver\n * <example-url>http://localhost:4200/#/common/layout/media-query/viewport-breakpoints</example-url>\n */\n@Directive({\n selector: '[cngxMediaQuery]',\n exportAs: 'cngxMediaQuery',\n standalone: true,\n})\nexport class CngxMediaQuery {\n /** The CSS media query string to evaluate. */\n readonly query = input.required<string>({ alias: 'cngxMediaQuery' });\n\n private readonly matchesState = signal(false);\n private readonly win = inject(DOCUMENT).defaultView;\n\n /** Whether the media query currently matches. */\n readonly matches = this.matchesState.asReadonly();\n\n constructor() {\n effect((onCleanup) => {\n onCleanup(\n observeMediaQuery(this.win, this.query(), (matches) => this.matchesState.set(matches)),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, inject, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Inject-form of {@link CngxMediaQuery}: returns a reactive\n * `Signal<boolean>` that reflects whether the host window currently matches\n * a CSS media query, without needing a host element.\n *\n * Use it where the directive form has nowhere to attach - inside a route\n * guard, a store, a `computed()`, or any injection context that reacts to a\n * viewport or preference query. For host-bound templates, prefer the\n * `[cngxMediaQuery]` directive; for pure styling, prefer CSS `@media` /\n * `@container`.\n *\n * Wraps `window.matchMedia()`: seeds the signal from `MediaQueryList.matches`,\n * updates on the `change` event, and removes the listener via `DestroyRef`\n * when the injection scope is destroyed. In SSR / non-DOM environments (no\n * `defaultView` or no `matchMedia`) it returns a static `false` signal and\n * wires no listener, so it never throws off the browser.\n *\n * Returns a `Signal<boolean>` - never an `Observable`; the reactive boundary\n * stays inside cngx.\n *\n * ```typescript\n * @Component({ … })\n * export class Dashboard {\n * private readonly compact = injectMediaQuery('(max-width: 640px)');\n * protected readonly layout = computed(() => (this.compact() ? 'stacked' : 'grid'));\n * }\n * ```\n *\n * @param query A CSS media query string, e.g. `(max-width: 640px)`.\n * @returns A reactive `Signal<boolean>` tracking the query's match state.\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/inject-media-query.ts\n * @since 0.1.0\n * @relatedTo CngxMediaQuery, CngxResizeObserver\n * <example-url>http://localhost:4200/#/common/layout/media-query/inject-breakpoint-signal</example-url>\n */\nexport function injectMediaQuery(query: string): Signal<boolean> {\n return createMediaQuerySignal(query, inject(DestroyRef), inject(DOCUMENT).defaultView);\n}\n","import { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Dev-warning the query-param sync kernel emits when `@angular/router` is\n * not provided. Mirrors {@link warnTabsRouterAbsent} in `@cngx/common/tabs`\n * so the message stays identical across the two sync surfaces; only the\n * `enables` clause differs. A deliberate small copy rather than a shared\n * import - sharing would force the helper onto a `public-api.ts`, and\n * `warn*` matches no approved public-API prefix.\n *\n * @internal\n */\nexport function warnRouterAbsent(enables: string): void {\n if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {\n return;\n }\n cngxDevWarn(\n 'CNGX1031',\n `injectQueryParamSync(): no Router / ActivatedRoute available - the URL sync is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n","import { effect, inject, untracked, type Signal, type WritableSignal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { coerceSignal } from '@cngx/core/utils';\n\nimport { warnRouterAbsent } from './warn-router-absent';\n\n/**\n * Options for {@link injectQueryParamSync}.\n *\n * `param` accepts a live `Signal<string>` so a bound `[param]` rename stays\n * reactive; a plain string is wrapped internally. `serialize`/`deserialize`\n * default to a boolean codec (`true` -> `'open'`, absence -> `false`); pass an\n * identity codec (`v => v ?? null` / `raw => raw`) to sync string ids.\n */\nexport interface QueryParamSyncOptions<T = boolean> {\n /** Query-param key. A `Signal<string>` keeps a bound rename live. */\n readonly param: string | Signal<string>;\n /** `T` -> URL string, or `null` to remove the key. Default: boolean codec. */\n readonly serialize?: (value: T) => string | null;\n /** URL string (or `null` when absent) -> `T`. Default: boolean codec. */\n readonly deserialize?: (raw: string | null) => T;\n /** Invoked with the rejection reason when `router.navigate` rejects. */\n readonly onSyncError?: (err: unknown) => void;\n}\n\n/**\n * Bidirectional sync between a caller-owned `WritableSignal<T>` and a named\n * query param. URL wins on initial load (deep-link intent); after hydrate the\n * signal is the source and reflects outward. Re-hydrates on browser\n * back/forward. Dev-warns once and no-ops when `@angular/router` is absent.\n *\n * Loop-safety (the core of this helper): the reflect effect writes the URL in\n * `untracked()` and skips `navigate` when the serialized `state()` equals the\n * last value it wrote - a local closure seeded from the initial URL read, not\n * the live URL param (the live param races the navigate-settle window). The\n * hydrate path updates that same closure whenever it accepts a URL value, so\n * back/forward re-hydration never triggers a reflex navigate. A `param` rename\n * is migrated in one navigate (`{ [old]: null, [new]: serialize(state()) }`)\n * by a dedicated effect whose only tracked source is the normalized param\n * signal; its first run seeds bookkeeping and never navigates.\n *\n * The `state.set` inside the hydrate effect is a deliberate signal-write-in-\n * effect: the URL is an external system and `state` is a caller-owned signal\n * the consumer must stay able to toggle, so hydrate cannot be a `computed`. It\n * is edge-guarded by serialized equality and wrapped in `untracked()`.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/router/inject-query-param-sync.ts\n * @since 0.1.0\n * @relatedTo CngxStepperRouterSync\n * <example-url>http://localhost:4200/#/common/layout/router/persisted-toggle</example-url>\n */\nexport function injectQueryParamSync<T = boolean>(\n state: WritableSignal<T>,\n opts: QueryParamSyncOptions<T>,\n): void {\n const router = inject(Router, { optional: true });\n // Router is providedIn: 'root' and resolves without provideRouter(...);\n // ActivatedRoute does not, so it is the \"router is set up\" signal.\n const route = inject(ActivatedRoute, { optional: true });\n\n if (!router || !route) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n warnRouterAbsent('query-param URL sync');\n }\n return;\n }\n\n const paramSignal: Signal<string> = coerceSignal(opts.param);\n const serialize: (value: T) => string | null =\n opts.serialize ?? ((value) => (value ? 'open' : null));\n const deserialize: (raw: string | null) => T = opts.deserialize ?? ((raw) => (raw != null) as T);\n\n // Closure bookkeeping, seeded from the initial URL read. `lastWritten` is\n // the serialized value the reflect path last pushed to the URL; the hydrate\n // path also updates it so an accepted URL value is not reflected back.\n const initialParam = paramSignal();\n let lastWritten: string | null = route.snapshot.queryParamMap.get(initialParam) ?? null;\n let previousParam = initialParam;\n\n // URL wins on initial load.\n if (lastWritten != null) {\n const hydrated = deserialize(lastWritten);\n if (!Object.is(hydrated, state())) {\n state.set(hydrated);\n }\n }\n\n // Reflect: signal change -> URL. Tracks `state()` only; param read untracked.\n effect(() => {\n const raw = serialize(state());\n untracked(() => {\n if (raw === lastWritten) {\n return;\n }\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [paramSignal()]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n\n // Re-hydrate: URL change (back/forward) -> signal. Tracks the query-param\n // emission only; param and state reads are untracked. The first run mirrors\n // the initial snapshot already handled synchronously above, so it is skipped\n // - processing it would race the reflect effect's still-pending initial\n // navigate and reset `state` to a stale value. Later runs skip our own\n // reflect echo via the `lastWritten` guard.\n const queryMap = toSignal(route.queryParamMap, {\n initialValue: route.snapshot.queryParamMap,\n });\n let hydrateInitialized = false;\n effect(() => {\n const map = queryMap();\n untracked(() => {\n if (!hydrateInitialized) {\n hydrateInitialized = true;\n return;\n }\n const raw = map.get(paramSignal()) ?? null;\n if (raw === lastWritten) {\n return;\n }\n const next = deserialize(raw);\n if (!Object.is(next, state())) {\n state.set(next);\n }\n lastWritten = raw;\n });\n });\n\n // Rename migration: param change -> one merged navigate that removes the old\n // key and writes the current value under the new one. Tracks the param\n // signal only; the first run seeds `previousParam` and never navigates.\n effect(() => {\n const param = paramSignal();\n untracked(() => {\n if (param === previousParam) {\n return;\n }\n const oldParam = previousParam;\n previousParam = param;\n const raw = serialize(state());\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [oldParam]: null, [param]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n}\n","import { type DestroyRef, signal, type Signal } from '@angular/core';\n\n/**\n * Structural window surface the resize helpers read: `window`, `globalThis`,\n * or a test double. `ResizeObserver` is optional so SSR and jsdom hosts pass\n * the type and hit the runtime guard instead.\n *\n * @category common/layout/observers\n * @since 0.3.0\n */\nexport interface ResizeObserverHost {\n ResizeObserver?: typeof ResizeObserver;\n}\n\n/**\n * Subscribes `apply` to size changes of `element` on `host`.\n *\n * Re-applies on every observation and returns the teardown that disconnects\n * the observer. On a host without `ResizeObserver` (SSR, jsdom) nothing is\n * wired, `apply` never fires, and the returned teardown is a no-op. Unlike the\n * media-query twin there is no synchronous seed: the first size is whatever the\n * observer reports after the next layout.\n *\n * Reach for this low-level form when the observed element or the box model is\n * reactive and the subscription must follow it (re-wire per `effect` run via\n * `onCleanup`); for a static target, {@link createResizeSignal} owns the\n * teardown via `DestroyRef`.\n *\n * @param host The window-like object to read `ResizeObserver` from.\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param apply Receives the first entry of every observation batch.\n * @returns Teardown that disconnects the observer.\n * @category common/layout/observers\n * @relatedTo createResizeSignal, observeMediaQuery\n * @since 0.1.0\n */\nexport function observeResize(\n host: ResizeObserverHost | null | undefined,\n element: Element,\n box: ResizeObserverBoxOptions,\n apply: (entry: ResizeObserverEntry) => void,\n): () => void {\n if (!host || typeof host.ResizeObserver !== 'function') {\n return () => undefined;\n }\n const observer = new host.ResizeObserver((entries) => apply(entries[0]));\n observer.observe(element, { box });\n return () => observer.disconnect();\n}\n\n/**\n * Creates a `Signal<ResizeObserverEntry | null>` that carries the most recent\n * observation of `element`, `null` until the first one arrives.\n *\n * Disconnects when `destroyRef` is destroyed. On a host without\n * `ResizeObserver` (SSR, jsdom) the signal stays `null` and no observer is\n * created, so it never throws off the browser.\n *\n * This is the shared kernel behind `CngxResizeObserver` and\n * `createContainerSize`; consumers that hand-roll a `ResizeObserver` should\n * route through it instead.\n *\n * ```typescript\n * const entry = createResizeSignal(\n * host,\n * 'border-box',\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const width = computed(() => entry()?.borderBoxSize[0]?.inlineSize ?? 0);\n * ```\n *\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param host The window-like object to read `ResizeObserver` from.\n * @returns A readonly signal carrying the latest entry.\n * @category common/layout/observers\n * @relatedTo observeResize, createMediaQuerySignal\n * @since 0.1.0\n */\nexport function createResizeSignal(\n element: Element,\n box: ResizeObserverBoxOptions,\n destroyRef: DestroyRef,\n host: ResizeObserverHost | null | undefined,\n): Signal<ResizeObserverEntry | null> {\n const entry = signal<ResizeObserverEntry | null>(null);\n const unsubscribe = observeResize(host, element, box, (value) => entry.set(value));\n destroyRef.onDestroy(unsubscribe);\n return entry.asReadonly();\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from './resize-signal';\n\n/**\n * Observes size changes of the host element via the `ResizeObserver` API.\n *\n * Exposes `width()`, `height()`, `contentRect()`, and `isReady()` as Angular\n * signals that update on every resize. The observer is automatically\n * disconnected on destroy and recreated when the `box` input changes.\n *\n * Use cases: responsive component logic in TypeScript (not just CSS),\n * container queries without CSS support, dynamic canvas/chart sizing,\n * resize-aware layouts.\n *\n * ### Display current size\n * ```html\n * <div cngxResizeObserver #ro=\"cngxResizeObserver\" style=\"resize: horizontal; overflow: auto;\">\n * {{ ro.width() | number:'1.0-0' }} × {{ ro.height() | number:'1.0-0' }} px\n * </div>\n * ```\n *\n * ### Responsive logic in TypeScript\n * ```typescript\n * readonly ro = viewChild(CngxResizeObserver);\n * readonly columns = computed(() => (this.ro()?.width() ?? 0) > 600 ? 3 : 1);\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/resize-observer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxMediaQuery\n * <example-url>http://localhost:4200/#/common/layout/resize-observer/live-size</example-url>\n */\n@Directive({\n selector: '[cngxResizeObserver]',\n exportAs: 'cngxResizeObserver',\n standalone: true,\n})\nexport class CngxResizeObserver {\n /** Which box model to observe. `'content-box'` (default), `'border-box'`, or `'device-pixel-content-box'`. */\n readonly box = input<ResizeObserverBoxOptions>('content-box');\n\n private readonly entryState = signal<ResizeObserverEntry | null>(null);\n\n /** The full `DOMRectReadOnly` of the content box. `null` before first observation. */\n readonly contentRect = computed(() => this.entryState()?.contentRect ?? null);\n /** Current width in pixels. `0` before first observation. */\n readonly width = computed(() => this.entryState()?.contentRect.width ?? 0);\n /** Current height in pixels. `0` before first observation. */\n readonly height = computed(() => this.entryState()?.contentRect.height ?? 0);\n /** `true` after the first resize observation has been received. */\n readonly isReady = computed(() => this.entryState() !== null);\n\n /** Emitted on every resize with the raw `ResizeObserverEntry`. */\n readonly resize = output<ResizeObserverEntry>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n\n // One subscription per `box` value: `onCleanup` disconnects the previous\n // observer before `observeResize` wires the next, which is also the\n // teardown on destroy. The kernel no-ops when the host ships no\n // `ResizeObserver` (SSR, jsdom), so no host guard is needed here.\n effect((onCleanup) => {\n onCleanup(\n observeResize(win, this.el.nativeElement as HTMLElement, this.box(), (entry) => {\n this.entryState.set(entry);\n this.resize.emit(entry);\n }),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n type DestroyRef,\n DestroyRef as DestroyRefToken,\n ElementRef,\n inject,\n InjectionToken,\n type Signal,\n} from '@angular/core';\n\nimport { createResizeSignal, type ResizeObserverHost } from './resize-signal';\n\n/**\n * Reactive read of a query container: its size, and the custom properties its\n * `@container` rules resolved to.\n *\n * @category common/layout/observers\n * @since 0.1.0\n */\nexport interface CngxContainerSize {\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize: Signal<number>;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize: Signal<number>;\n /** `true` once the first observation has arrived. */\n readonly isReady: Signal<boolean>;\n /**\n * The resolved value of a custom property, re-read on every resize of the\n * container.\n *\n * **The `@container` rule must style a descendant, never the container\n * itself.** A container query resolves against an *ancestor* query container\n * of the element it styles, so a rule whose subject is the container element\n * matches nothing and the property never changes. Pass that descendant as\n * `on`; it defaults to the container host, which is only correct for\n * properties no container query writes.\n *\n * A component that is container and reader at once has no descendant to\n * carry the value. Pass `pseudo` instead: the query container for a\n * pseudo-element is selected from its originating element's *inclusive*\n * ancestors, so `.host::after` resolves against `.host` while a rule on\n * `.host` itself still matches nothing. No sentinel node enters the\n * template.\n *\n * ```css\n * .cngx-thing::after { --cngx-thing-narrow: 0; }\n * @container cngx-thing (max-inline-size: 30rem) {\n * .cngx-thing::after { --cngx-thing-narrow: 1; }\n * }\n * ```\n *\n * Returns the empty string before the first observation and in environments\n * without layout (SSR, jsdom).\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string>;\n}\n\n/**\n * The nearest query container declared by {@link CngxContainer}.\n *\n * Deliberately has no root factory: absence is meaningful. A component that\n * needs a container and finds none must say so (a dev-mode warning), not\n * silently observe itself.\n *\n * @category common/layout/observers\n * @since 0.1.0\n */\nexport const CNGX_CONTAINER_SIZE = new InjectionToken<CngxContainerSize>('CNGX_CONTAINER_SIZE');\n\n/**\n * Creates a {@link CngxContainerSize} over `element`.\n *\n * Observes the border box, so the reported size matches what an\n * `inline-size` container query measures. The `property()` reads are plain\n * `computed()`s over the same resize signal - the browser has already\n * re-evaluated every container query by the time a `ResizeObserver` callback\n * runs, so the read returns the current value without a second scheduling hop.\n *\n * @param element The container host.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param win The window-like object providing `ResizeObserver` and `getComputedStyle`.\n * @category common/layout/observers\n * @relatedTo injectContainerSize, CngxContainer\n * @since 0.1.0\n */\nexport function createContainerSize(\n element: Element,\n destroyRef: DestroyRef,\n win: (ResizeObserverHost & Pick<Window, 'getComputedStyle'>) | null | undefined,\n): CngxContainerSize {\n const entry = createResizeSignal(element, 'border-box', destroyRef, win);\n\n const inlineSize = computed(() => entry()?.borderBoxSize?.[0]?.inlineSize ?? 0);\n const blockSize = computed(() => entry()?.borderBoxSize?.[0]?.blockSize ?? 0);\n const isReady = computed(() => entry() !== null);\n\n // Weak on the element: the container outlives descendants that get\n // destroyed, so a strong Map would pin every dead node it ever read.\n const cache = new WeakMap<Element, Map<string, Signal<string>>>();\n\n const property = (\n name: string,\n on?: Element,\n pseudo?: '::before' | '::after',\n ): Signal<string> => {\n const target = on ?? element;\n let byName = cache.get(target);\n if (!byName) {\n byName = new Map();\n cache.set(target, byName);\n }\n const key = `${pseudo ?? ''}|${name}`;\n const cached = byName.get(key);\n if (cached) {\n return cached;\n }\n // A DOM read inside a computed() is deliberate here, not an oversight: the\n // only tracked dependency is the resize entry, and a ResizeObserver\n // callback runs after layout, when every container query has already been\n // re-evaluated. The read is therefore idempotent for a given entry and\n // never forces a recalc of its own. An effect writing into a signal would\n // add a scheduling hop for nothing.\n const value = computed(() => {\n if (entry() === null || !win?.getComputedStyle) {\n return '';\n }\n return win\n .getComputedStyle(target, pseudo ?? null)\n .getPropertyValue(name)\n .trim();\n });\n byName.set(key, value);\n return value;\n };\n\n return { inlineSize, blockSize, isReady, property };\n}\n\n/**\n * Reads the nearest query container declared by a `[cngxContainer]` ancestor,\n * or observes `target` (default: the host element) when there is none.\n *\n * Use it where a component must branch structurally on the width it was given\n * - a different template, a focus move, an `aria-modal` flip. Purely visual\n * adaptation needs no TypeScript at all: write a `@container` rule.\n *\n * ```typescript\n * private readonly container = inject(CNGX_CONTAINER_SIZE, { optional: true });\n * private readonly wide = this.container?.property('--cngx-thing-wide', this.host) ?? signal('').asReadonly();\n * readonly mode = computed(() => (this.wide() === '1' ? 'side' : 'over'));\n * ```\n *\n * A component that declares the container in its own stylesheet and reads it\n * itself passes its host explicitly and reads the property off `::after` -\n * there is no descendant to carry the value:\n *\n * ```typescript\n * private readonly host = inject(ElementRef).nativeElement as Element;\n * private readonly container = injectContainerSize(this.host);\n * private readonly narrow = this.container.property('--cngx-thing-narrow', this.host, '::after');\n * ```\n *\n * @param target Element to observe when no ancestor container exists.\n * @category common/layout/observers\n * @relatedTo CngxContainer, injectMediaQuery\n * @since 0.1.0\n */\nexport function injectContainerSize(target?: ElementRef<Element> | Element): CngxContainerSize {\n const ancestor = inject(CNGX_CONTAINER_SIZE, { optional: true, skipSelf: true });\n if (ancestor && !target) {\n return ancestor;\n }\n const resolved: Element =\n target instanceof ElementRef\n ? target.nativeElement\n : (target ?? (inject(ElementRef).nativeElement as Element));\n return createContainerSize(resolved, inject(DestroyRefToken), inject(DOCUMENT).defaultView);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, type Signal } from '@angular/core';\n\nimport { CNGX_CONTAINER_SIZE, type CngxContainerSize, createContainerSize } from './container-size';\n\n/**\n * Observes a query container and publishes its size to descendants through\n * {@link CNGX_CONTAINER_SIZE}.\n *\n * The directive declares nothing visual. **Both `container-type` and\n * `container-name` belong in the stylesheet**, next to the `@container` rules\n * that use them: the name is API (an unnamed query matches the nearest\n * container of any name, so a consumer wrapping the component in their own\n * container would silently re-target it), and containment is a layout\n * decision a skin must be able to opt out of with a plain CSS rule rather\n * than `!important` against a host style.\n *\n * ```css\n * cngx-thing-layout {\n * container-type: inline-size;\n * container-name: cngx-thing-layout;\n * }\n *\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 0; }\n *\n * @container cngx-thing-layout (min-inline-size: 64rem) {\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 1; }\n * }\n * ```\n *\n * ```html\n * <div cngxContainer>\n * <app-panel />\n * </div>\n * ```\n *\n * A descendant reads the resolved value with `injectContainerSize()`, so the\n * breakpoint exists exactly once - in CSS. Note that `container-type:\n * inline-size` applies size containment: an element that must shrink-wrap its\n * content (an inline chip, a `width: max-content` bar) must not be a\n * container.\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/container.directive.ts\n * @since 0.1.0\n * @relatedTo injectContainerSize, CngxResizeObserver, CngxMediaQuery\n * <example-url>http://localhost:4200/#/common/layout/container/css-decides-js-reads</example-url>\n */\n@Directive({\n selector: '[cngxContainer]',\n exportAs: 'cngxContainer',\n standalone: true,\n providers: [{ provide: CNGX_CONTAINER_SIZE, useExisting: CngxContainer }],\n})\nexport class CngxContainer implements CngxContainerSize {\n private readonly size = createContainerSize(\n inject(ElementRef).nativeElement as Element,\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize = this.size.inlineSize;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize = this.size.blockSize;\n /** `true` once the first observation has arrived. */\n readonly isReady = this.size.isReady;\n\n /**\n * The resolved value of a custom property on `on` (default: this host),\n * re-read on every resize. The `@container` rule must style a descendant,\n * or a pseudo-element of the container itself - see\n * {@link CngxContainerSize.property}.\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string> {\n return this.size.property(name, on, pseudo);\n }\n}\n","/**\n * Ref-count per document root. Module-private on purpose: this file is the\n * single owner of the lock state. A second copy of this map (the pre-extraction\n * state: one in `CngxScrollLock`, one in `CngxDialog`) shares the dataset keys\n * below without sharing the count, so interleaved acquire/release across the\n * two owners corrupts each other's saved overflow values.\n *\n * @internal\n */\nconst lockCounts = new WeakMap<HTMLElement, number>();\n\n/**\n * Acquire a ref-counted scroll lock on a document root and get back the\n * matching release function.\n *\n * The first active lock saves the current `overflow` / `scrollbar-gutter`\n * inline styles and sets `overflow: hidden` + `scrollbar-gutter: stable`\n * (no layout shift when the scrollbar disappears). Releasing the last active\n * lock restores the saved values. The returned release function is\n * idempotent - calling it twice cannot over-decrement the count.\n *\n * Shared engine behind `CngxScrollLock` and `CngxDialog`'s modal scroll lock;\n * consumers composing their own overlay primitives can use it directly.\n *\n * ```typescript\n * const release = createScrollLock(document.documentElement);\n * // ... overlay open ...\n * release();\n * ```\n *\n * @param html - The document root (`document.documentElement`) to lock.\n * @returns Release function for this acquisition. Idempotent.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts\n * @since 0.1.0\n * @relatedTo CngxScrollLock, CngxDialog\n */\nexport function createScrollLock(html: HTMLElement): () => void {\n const count = lockCounts.get(html) ?? 0;\n if (count === 0) {\n html.dataset['cngxPrevOverflow'] = html.style.overflow;\n html.dataset['cngxPrevScrollbarGutter'] = html.style.scrollbarGutter;\n html.style.overflow = 'hidden';\n html.style.scrollbarGutter = 'stable';\n }\n lockCounts.set(html, count + 1);\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n const current = lockCounts.get(html) ?? 0;\n if (current <= 1) {\n html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';\n html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';\n delete html.dataset['cngxPrevOverflow'];\n delete html.dataset['cngxPrevScrollbarGutter'];\n lockCounts.set(html, 0);\n } else {\n lockCounts.set(html, current - 1);\n }\n };\n}\n\n// The body properties the pin writes. Only these are saved and restored, so a\n// style another owner sets on body while the pin is held survives the release.\nconst PINNED_BODY_PROPERTIES = ['position', 'top', 'inset-inline', 'overflow'] as const;\n\ninterface SavedProperty {\n readonly value: string;\n readonly priority: string;\n}\n\ninterface PinState {\n count: number;\n readonly saved: ReadonlyMap<string, SavedProperty>;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly releaseHtml: () => void;\n}\n\n/**\n * Pin state per document root, separate from `lockCounts`: a pin also holds\n * one `createScrollLock` acquisition, so the html overflow stays shared with\n * every other owner.\n *\n * @internal\n */\nconst pins = new WeakMap<HTMLElement, PinState>();\n\n/**\n * Acquire a ref-counted scroll lock that pins the page body in place, for\n * overlays that must hold on iOS Safari.\n *\n * `overflow: hidden` on the root does not stop iOS Safari from scrolling a\n * page that was already scrolled, and the visual viewport drifts with it, so\n * a bottom-fixed overlay ends above the visible bottom. The first pin saves\n * the body's inline `position`, `top`, `inset-inline` and `overflow` and the\n * scroll position, fixes the body at `top: -scrollY`, and acquires\n * {@link createScrollLock} on the root. The last\n * release restores the body, releases the root lock and scrolls back to the\n * saved position. The returned release function is idempotent.\n *\n * `CngxDialog` and `CngxScrollLock` keep {@link createScrollLock}; reach for\n * this one when the overlay is pinned to the viewport bottom on touch devices.\n *\n * ```typescript\n * const release = createPinnedScrollLock(document.documentElement);\n * // ... sheet open ...\n * release();\n * ```\n *\n * @param html - The document root (`document.documentElement`) to lock.\n * @returns Release function for this acquisition. Idempotent.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts\n * @since 0.1.0\n * @relatedTo createScrollLock, CngxPopoverSheet\n */\nexport function createPinnedScrollLock(html: HTMLElement): () => void {\n const body = html.ownerDocument.body;\n const view = html.ownerDocument.defaultView;\n const existing = pins.get(html);\n if (existing) {\n existing.count += 1;\n } else {\n const scrollX = view?.scrollX ?? 0;\n const scrollY = view?.scrollY ?? 0;\n pins.set(html, {\n count: 1,\n saved: new Map(\n PINNED_BODY_PROPERTIES.map((name) => [\n name,\n {\n value: body.style.getPropertyValue(name),\n priority: body.style.getPropertyPriority(name),\n },\n ]),\n ),\n scrollX,\n scrollY,\n releaseHtml: createScrollLock(html),\n });\n body.style.position = 'fixed';\n body.style.top = `${-scrollY}px`;\n body.style.insetInline = '0';\n body.style.overflow = 'hidden';\n }\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n const state = pins.get(html);\n if (!state) {\n return;\n }\n state.count -= 1;\n if (state.count > 0) {\n return;\n }\n pins.delete(html);\n for (const [name, { value, priority }] of state.saved) {\n if (value) {\n body.style.setProperty(name, value, priority);\n } else {\n body.style.removeProperty(name);\n }\n }\n state.releaseHtml();\n view?.scrollTo({ left: state.scrollX, top: state.scrollY, behavior: 'instant' });\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\nimport { createScrollLock } from './scroll-lock-core';\n\n/**\n * Prevents scrolling on the document body when enabled.\n *\n * Sets `overflow: hidden` and `scrollbar-gutter: stable` on `<html>` to\n * prevent layout shift when the scrollbar disappears. Restores original\n * values when all lock instances are released.\n *\n * Multiple instances are ref-counted - the original styles are only\n * restored when the last lock is released.\n *\n * ### With a drawer\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\" [cngxScrollLock]=\"drawer.opened()\">\n * …\n * </div>\n * ```\n *\n * ### With a modal\n * ```html\n * <div [cngxScrollLock]=\"isModalOpen()\">…</div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxBackdrop\n * <example-url>http://localhost:4200/#/common/layout/scroll-lock/toggle</example-url>\n */\n@Directive({\n selector: '[cngxScrollLock]',\n exportAs: 'cngxScrollLock',\n standalone: true,\n})\nexport class CngxScrollLock {\n /** Whether scroll lock is active. */\n readonly enabled = input<boolean>(false, { alias: 'cngxScrollLock' });\n\n constructor() {\n const html = inject(DOCUMENT).documentElement;\n let release: (() => void) | null = null;\n\n effect(() => {\n if (this.enabled() && !release) {\n release = createScrollLock(html);\n } else if (!this.enabled() && release) {\n release();\n release = null;\n }\n });\n\n inject(DestroyRef).onDestroy(() => {\n release?.();\n });\n }\n}\n","import { computed, type DestroyRef, signal, type Signal } from '@angular/core';\n\nimport { observeResize, type ResizeObserverHost } from '../observers/resize-signal';\n\n/**\n * Structural window surface `createScrollEdges` reads: `window`, `globalThis`,\n * or a test double. Every member is optional so SSR and jsdom hosts pass the\n * type and fall back at runtime: no `ResizeObserver` means no resize\n * tracking, no `MutationObserver` means the child set is captured once, no\n * `requestAnimationFrame` means every trigger reads synchronously.\n *\n * @category common/layout\n * @since 0.1.0\n */\nexport interface ScrollEdgesHost extends ResizeObserverHost {\n MutationObserver?: typeof MutationObserver;\n requestAnimationFrame?: (callback: FrameRequestCallback) => number;\n cancelAnimationFrame?: (handle: number) => void;\n}\n\n/**\n * Per-edge scroll state of one scrollport. Each signal is `true` while content\n * is hidden toward that edge, i.e. while the user can still scroll toward it.\n *\n * @category common/layout\n * @since 0.1.0\n */\nexport interface CngxScrollEdgesState {\n /** Content is hidden above (toward the block-start edge). */\n readonly canScrollBlockStart: Signal<boolean>;\n /** Content is hidden below (toward the block-end edge). */\n readonly canScrollBlockEnd: Signal<boolean>;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL). */\n readonly canScrollInlineStart: Signal<boolean>;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL). */\n readonly canScrollInlineEnd: Signal<boolean>;\n}\n\ninterface ScrollEdgesSnapshot {\n readonly blockStart: boolean;\n readonly blockEnd: boolean;\n readonly inlineStart: boolean;\n readonly inlineEnd: boolean;\n}\n\n/** Distances up to this many px count as \"at the edge\" (sub-pixel and zoom rounding). */\nconst EDGE_TOLERANCE = 1;\n\nconst NO_EDGES: ScrollEdgesSnapshot = {\n blockStart: false,\n blockEnd: false,\n inlineStart: false,\n inlineEnd: false,\n};\n\nfunction sameEdges(a: ScrollEdgesSnapshot, b: ScrollEdgesSnapshot): boolean {\n return (\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd &&\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd\n );\n}\n\n/**\n * One read of the six scroll metrics. RTL `scrollLeft` runs over `[-max, 0]`\n * in every evergreen engine and LTR over `[0, max]`, so its magnitude is the\n * distance from the inline-start edge in both directions - no direction lookup\n * and no `getComputedStyle` in the scroll path.\n */\nfunction readEdges(element: HTMLElement): ScrollEdgesSnapshot {\n const inlineOffset = Math.abs(element.scrollLeft);\n return {\n blockStart: element.scrollTop > EDGE_TOLERANCE,\n blockEnd: element.scrollHeight - element.clientHeight - element.scrollTop > EDGE_TOLERANCE,\n inlineStart: inlineOffset > EDGE_TOLERANCE,\n inlineEnd: element.scrollWidth - element.clientWidth - inlineOffset > EDGE_TOLERANCE,\n };\n}\n\n/**\n * Tracks which edges of a scrollport still hide content, as four boolean\n * signals.\n *\n * Triggers are a passive `scroll` listener, one `observeResize` per observed\n * element (the scrollport itself plus every direct element child) and a\n * `childList`-only `MutationObserver` that keeps that child set current. All\n * of them only schedule work: the metrics are read once per animation frame\n * however many triggers fired, and the result lands in one snapshot signal\n * with a structural `equal`, so the four projections only notify when an edge\n * actually flips. A distance of 1px or less counts as \"at the edge\".\n *\n * Only direct children are resize-observed. A long item list should sit inside\n * one content element rather than be N direct children (one observer each);\n * growth deep inside a fixed-size child is picked up on the next scroll.\n *\n * A `null` host (SSR) wires nothing and all four signals stay `false`.\n *\n * ```typescript\n * const edges = createScrollEdges(\n * inject(ElementRef).nativeElement,\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const showTopShadow = edges.canScrollBlockStart;\n * ```\n *\n * @param element The scrollport to read.\n * @param destroyRef Scope whose destruction removes the listener, disconnects\n * every observer and cancels a pending frame.\n * @param host The window-like object to read the observer and frame APIs from.\n * @returns The four per-edge signals.\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges-core.ts\n * @since 0.1.0\n * @relatedTo CngxScrollEdges, observeResize\n */\nexport function createScrollEdges(\n element: HTMLElement,\n destroyRef: DestroyRef,\n host: ScrollEdgesHost | null | undefined,\n): CngxScrollEdgesState {\n const edges = signal<ScrollEdgesSnapshot>(NO_EDGES, { equal: sameEdges });\n const state: CngxScrollEdgesState = {\n canScrollBlockStart: computed(() => edges().blockStart),\n canScrollBlockEnd: computed(() => edges().blockEnd),\n canScrollInlineStart: computed(() => edges().inlineStart),\n canScrollInlineEnd: computed(() => edges().inlineEnd),\n };\n\n if (!host) {\n return state;\n }\n\n let destroyed = false;\n let framePending = false;\n let frameHandle = 0;\n\n const read = (): void => {\n framePending = false;\n if (destroyed) {\n return;\n }\n edges.set(readEdges(element));\n };\n\n const schedule = (): void => {\n if (destroyed || framePending) {\n return;\n }\n if (typeof host.requestAnimationFrame !== 'function') {\n read();\n return;\n }\n framePending = true;\n frameHandle = host.requestAnimationFrame(read);\n };\n\n const resizeTeardowns = new Map<Element, () => void>();\n const observe = (target: Element): void => {\n if (resizeTeardowns.has(target)) {\n return;\n }\n resizeTeardowns.set(\n target,\n observeResize(host, target, 'border-box', () => schedule()),\n );\n };\n const syncChildren = (): void => {\n const children = new Set<Element>(Array.from(element.children));\n for (const [target, teardown] of resizeTeardowns) {\n if (target !== element && !children.has(target)) {\n teardown();\n resizeTeardowns.delete(target);\n }\n }\n children.forEach(observe);\n };\n\n element.addEventListener('scroll', schedule, { passive: true });\n observe(element);\n syncChildren();\n\n let mutationObserver: MutationObserver | null = null;\n if (typeof host.MutationObserver === 'function') {\n mutationObserver = new host.MutationObserver(() => {\n syncChildren();\n schedule();\n });\n mutationObserver.observe(element, { childList: true });\n }\n\n schedule();\n\n destroyRef.onDestroy(() => {\n destroyed = true;\n element.removeEventListener('scroll', schedule);\n mutationObserver?.disconnect();\n resizeTeardowns.forEach((teardown) => teardown());\n resizeTeardowns.clear();\n if (framePending && typeof host.cancelAnimationFrame === 'function') {\n host.cancelAnimationFrame(frameHandle);\n }\n framePending = false;\n });\n\n return state;\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, PLATFORM_ID } from '@angular/core';\n\nimport { createScrollEdges } from './scroll-edges-core';\n\n/**\n * Reports which edges of a scrollport still hide content and reflects them as\n * host attributes, so an edge shadow or fade appears only while there really\n * is something to scroll to in that direction.\n *\n * Put it on the element that scrolls (`overflow: auto` / `scroll`). The four\n * signals and the four logical host attributes are derived from one read of\n * the scroll metrics per animation frame; the attributes are present (empty\n * value) while true and absent otherwise:\n *\n * - `data-scroll-block-start` / `canScrollBlockStart()` - content hidden above\n * - `data-scroll-block-end` / `canScrollBlockEnd()` - content hidden below\n * - `data-scroll-inline-start` / `canScrollInlineStart()` - hidden toward inline start\n * - `data-scroll-inline-end` / `canScrollInlineEnd()` - hidden toward inline end\n *\n * Inline start / end follow the writing direction: in `dir=\"rtl\"` the start\n * edge is on the right. The direction is derived from the scroll offset\n * itself, so a `dir=\"rtl\"` subtree inside an LTR page reports correctly.\n *\n * The directive paints nothing. The four attributes (present only while true)\n * are its public, stable contract; every visual belongs to the consumer CSS,\n * keyed on them. Three common cues:\n *\n * Shadow (Material 2 elevate-on-scroll):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { box-shadow: 0 2px 4px -2px rgb(0 0 0 / 0.3); }\n * ```\n *\n * Hairline that appears (iOS scroll-edge appearance; transparent border at rest):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { border-block-end-color: var(--cngx-color-border); }\n * ```\n *\n * Tonal surface change (Material 3 top app bar):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { background: var(--app-bar-scrolled-surface); }\n * ```\n *\n * Forced colors strips `box-shadow`, so a shadow-only cue disappears there;\n * prefer a border or pair the shadow with one under `forced-colors: active`.\n *\n * ```html\n * <div class=\"sheet\" cngxScrollEdges #edges=\"cngxScrollEdges\">...</div>\n * ```\n *\n * The edge state is purely visual and is not announced: the hidden content\n * stays in the DOM and in the reading order, and the scrollport remains\n * reachable by keyboard scrolling. Make the scrollport focusable (and named)\n * when it holds no focusable content of its own.\n *\n * Upgrade path: the attributes map 1:1 onto CSS\n * `@container scroll-state(scrollable: block-start)` and its siblings, so the\n * CSS can swap to native scroll-state queries once they are Baseline.\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStickyHeader, CngxScrollSpy, createScrollEdges\n * <example-url>http://localhost:4200/#/common/layout/scroll-edges/edge-shadows</example-url>\n */\n@Directive({\n selector: '[cngxScrollEdges]',\n exportAs: 'cngxScrollEdges',\n standalone: true,\n host: {\n '[attr.data-scroll-block-start]': \"canScrollBlockStart() ? '' : null\",\n '[attr.data-scroll-block-end]': \"canScrollBlockEnd() ? '' : null\",\n '[attr.data-scroll-inline-start]': \"canScrollInlineStart() ? '' : null\",\n '[attr.data-scroll-inline-end]': \"canScrollInlineEnd() ? '' : null\",\n },\n})\nexport class CngxScrollEdges {\n private readonly edges = createScrollEdges(\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n inject(DestroyRef),\n isPlatformBrowser(inject(PLATFORM_ID)) ? inject(DOCUMENT).defaultView : null,\n );\n\n /** Content is hidden toward the block-start edge (above). */\n readonly canScrollBlockStart = this.edges.canScrollBlockStart;\n /** Content is hidden toward the block-end edge (below). */\n readonly canScrollBlockEnd = this.edges.canScrollBlockEnd;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL). */\n readonly canScrollInlineStart = this.edges.canScrollInlineStart;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL). */\n readonly canScrollInlineEnd = this.edges.canScrollInlineEnd;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, DestroyRef, Directive, inject, input, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Headless skeleton loading placeholder.\n *\n * Toggles between loading and content states via CSS classes and ARIA attributes.\n * No template -- the consumer renders the skeleton UI.\n *\n * Exposes an `indices()` signal for `@for` rendering of repeated skeleton elements.\n * Respects `prefers-reduced-motion` (disables shimmer animation class).\n *\n * ### Basic loading placeholder\n * ```html\n * <div [cngxSkeleton]=\"isLoading()\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-line\" aria-hidden=\"true\"></div>\n * }\n * } @else {\n * <p>{{ content() }}</p>\n * }\n * </div>\n * ```\n *\n * ### Card list with repeat count\n * ```html\n * <div [cngxSkeleton]=\"loading()\" [count]=\"3\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-card\" aria-hidden=\"true\">\n * <div class=\"skeleton-avatar\"></div>\n * <div class=\"skeleton-line\"></div>\n * </div>\n * }\n * } @else {\n * @for (card of cards(); track card.id) {\n * <app-card [data]=\"card\" />\n * }\n * }\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/skeleton.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableText, CngxHighlight\n * <example-url>http://localhost:4200/#/common/layout/skeleton/basic-skeleton</example-url>\n * <example-url>http://localhost:4200/#/common/layout/skeleton/skeleton-container</example-url>\n */\n@Directive({\n selector: '[cngxSkeleton]',\n standalone: true,\n exportAs: 'cngxSkeleton',\n host: {\n class: 'cngx-skeleton',\n '[class.cngx-skeleton--loading]': 'loading()',\n '[class.cngx-skeleton--shimmer]': 'showShimmer()',\n '[attr.aria-busy]': 'loading() || null',\n },\n})\nexport class CngxSkeleton {\n /** Controls the loading state. */\n readonly skeleton = input<boolean>(false, { alias: 'cngxSkeleton' });\n\n /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */\n readonly shimmer = input<boolean>(true);\n\n /** Repeat count - exposed via the `indices()` signal for `@for` rendering. */\n readonly count = input<number>(1);\n\n private readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n this.prefersReducedMotion = createMediaQuerySignal(\n '(prefers-reduced-motion: reduce)',\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n }\n\n /** Whether the skeleton is in loading state. Mirrors the `cngxSkeleton` input. */\n readonly loading = computed(() => this.skeleton());\n\n /** Array of indices for `@for` rendering of repeated skeleton elements. */\n readonly indices = computed(() => Array.from({ length: this.count() }, (_, i) => i));\n\n /** @internal - shimmer class condition. */\n protected readonly showShimmer = computed(\n () => this.loading() && this.shimmer() && !this.prefersReducedMotion(),\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { createTransitionTracker } from '@cngx/core/utils';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Infinite scroll trigger using `IntersectionObserver`.\n *\n * Place on a sentinel element at the bottom of a list. Fires `loadMore`\n * when the sentinel enters the viewport. Includes a debounce guard and\n * a `loading` input to prevent re-triggers during fetch.\n *\n * The observer is automatically recreated when `root`, `rootMargin`, or\n * `threshold` inputs change, and disconnected on destroy or when `enabled`\n * is set to `false`. When `loading` settles back to `false` the sentinel is\n * re-observed, so a fetched page that did not push the sentinel out of view\n * still re-fires `loadMore` instead of stalling the list.\n *\n * ### Basic infinite list\n * ```html\n * <div class=\"item-list\">\n * @for (item of items(); track item.id) {\n * <app-item [data]=\"item\" />\n * }\n * <div cngxInfiniteScroll [loading]=\"isFetching()\" (loadMore)=\"fetchNext()\">\n * @if (scroll.isLoading()) { <mat-spinner diameter=\"24\" /> }\n * </div>\n * </div>\n * ```\n *\n * ### Disable when all loaded\n * ```html\n * <div cngxInfiniteScroll\n * [enabled]=\"hasNextPage()\"\n * [loading]=\"isFetching()\"\n * (loadMore)=\"fetchNext()\">\n * @if (!hasNextPage()) { <p>All items loaded</p> }\n * </div>\n * ```\n *\n * ### Custom scroll container with pre-fetch margin\n * ```html\n * <div cngxInfiniteScroll\n * [root]=\"'.scroll-container'\"\n * [rootMargin]=\"'0px 0px 400px 0px'\"\n * [loading]=\"loading()\"\n * (loadMore)=\"loadMore()\">\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/infinite-scroll.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxScrollSpy, CngxStickyHeader\n * <example-url>http://localhost:4200/#/common/layout/infinite-scroll/scrollable-list</example-url>\n */\n@Directive({\n selector: '[cngxInfiniteScroll]',\n standalone: true,\n exportAs: 'cngxInfiniteScroll',\n host: {\n class: 'cngx-infinite-scroll',\n '[class.cngx-infinite-scroll--loading]': 'isLoading()',\n '[attr.aria-busy]': 'isLoading() || null',\n },\n})\nexport class CngxInfiniteScroll {\n /** IntersectionObserver threshold (0–1). */\n readonly threshold = input<number>(0);\n\n /** Pre-fetch margin. `'0px 0px 200px 0px'` triggers 200px before the sentinel is visible. */\n readonly rootMargin = input<string>('0px 0px 200px 0px');\n\n /** CSS selector for a custom scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n\n /** When `false`, the observer disconnects entirely. Use to stop loading when all items are fetched. */\n readonly enabled = input<boolean>(true);\n\n /** Set to `true` while fetching. Prevents re-trigger until the fetch completes. */\n readonly loading = input<boolean>(false);\n\n /** Minimum ms between consecutive `loadMore` emissions. */\n readonly debounceMs = input<number>(200);\n\n /** Emitted when the sentinel is visible, not loading, and debounce has elapsed. */\n readonly loadMore = output<void>();\n\n /** Readonly mirror of the `loading` input. */\n readonly isLoading: Signal<boolean> = computed(() => this.loading());\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n private lastEmitTime = 0;\n private observer: IntersectionObserver | null = null;\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const enabled = this.enabled();\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const debounceMs = this.debounceMs();\n\n if (!enabled) {\n return;\n }\n\n const isLoading = () => this.loading();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (typeof ngDevMode !== 'undefined' && ngDevMode && root && !resolvedRoot) {\n cngxDevWarn(\n 'CNGX1032',\n `[cngxInfiniteScroll] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n if (!entry.isIntersecting) {\n return;\n }\n if (isLoading()) {\n return;\n }\n\n const now = Date.now();\n if (now - this.lastEmitTime < debounceMs) {\n return;\n }\n\n this.lastEmitTime = now;\n this.loadMore.emit();\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n this.observer = observer;\n\n onCleanup(() => {\n observer.disconnect();\n this.observer = null;\n });\n });\n\n const loadingTransition = createTransitionTracker(() => this.loading());\n effect(() => {\n const loading = loadingTransition.current();\n const wasLoading = loadingTransition.previous();\n if (!wasLoading || loading) {\n return;\n }\n // IO reports intersection CHANGES only: when a fetched page does not\n // push the sentinel out of view there is no new entry after loading\n // settles, and the list stalls. Re-observing forces a fresh entry;\n // the debounce window is reset so that entry may emit immediately.\n untracked(() => {\n const sentinel = this.el.nativeElement as HTMLElement;\n this.lastEmitTime = 0;\n this.observer?.unobserve(sentinel);\n this.observer?.observe(sentinel);\n });\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Communicates when a sticky-positioned element becomes stuck.\n *\n * Applies `position: sticky; top: 0` on the host automatically.\n * The directive adds a sentinel element before the host and uses\n * `IntersectionObserver` to detect when the sentinel scrolls out,\n * meaning the header is now stuck. Toggles a CSS class for shadow,\n * elevation, or background changes.\n *\n * The sentinel is observed against the **nearest scroll-container ancestor**\n * (the first ancestor whose computed `overflow-y` is not `visible`), not the\n * page - that is the scrollport `position: sticky` resolves against, so\n * `isSticky()` reports the state the host actually has. A scrollport whose\n * height is content-driven never scrolls in the block axis, so a header inside\n * it never pins; in dev mode the directive warns once when it resolves against\n * such a scrollport. The observer is recreated when `threshold` changes,\n * matching the sibling observer directives.\n *\n * ### Sticky header with shadow\n * ```html\n * <header cngxStickyHeader #sh=\"cngxStickyHeader\"\n * style=\"position: sticky; top: 0;\">\n * Page header\n * </header>\n * ```\n *\n * ```css\n * .cngx-sticky--active { box-shadow: 0 2px 4px rgba(0,0,0,.1); }\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/sticky-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxScrollSpy, CngxIntersectionObserver\n * <example-url>http://localhost:4200/#/common/layout/sticky-header/sticky-header-with-shadow</example-url>\n */\n@Directive({\n selector: '[cngxStickyHeader]',\n exportAs: 'cngxStickyHeader',\n standalone: true,\n host: {\n style: 'position: sticky; top: 0; z-index: var(--cngx-sticky-z-index, 1)',\n '[class.cngx-sticky--active]': 'isSticky()',\n },\n})\nexport class CngxStickyHeader {\n /** Intersection threshold - `0` triggers as soon as the sentinel leaves. */\n readonly threshold = input<number>(0);\n\n /** Emitted when the sticky state changes. */\n readonly stickyChange = output<boolean>();\n\n private readonly isStickyState = signal(false);\n /** Whether the header is currently in its stuck position. */\n readonly isSticky = this.isStickyState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /** Sentinel + scrollport resolved once after render; the observer effect keys on it. */\n private readonly observeSetup = signal<{\n sentinel: HTMLElement;\n scrollport: HTMLElement | null;\n } | null>(null);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // IntersectionObserver sentinel pattern - host is stuck once the 1px sentinel leaves\n // the scrollport the host actually sticks to.\n afterNextRender(() => {\n const host = this.el.nativeElement as HTMLElement;\n // Root the sentinel at the scrollport `position: sticky` resolves against, not the\n // viewport. Observing against the viewport reports a different thing entirely: a\n // header inside a never-scrolling scrollport would read `isSticky() === true` while\n // it visibly scrolls away with its content.\n const scrollport = this.resolveScrollParent(host);\n\n // A scrollport whose content fits never scrolls in the block axis, so a header\n // inside it can never pin - `isSticky()` stays false while the whole scrollport\n // moves. Flag the misconfiguration once, in dev only; a one-shot read here is\n // exactly what `afterNextRender` is for (no reactive-graph node, unlike a\n // dep-less effect). The 1px tolerance absorbs sub-pixel layout and browser-zoom\n // rounding: \"cannot meaningfully scroll\" instead of exact equality.\n if (\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n scrollport &&\n scrollport.scrollHeight - scrollport.clientHeight <= 1\n ) {\n cngxDevWarn(\n 'CNGX1034',\n '[cngxStickyHeader] resolves against a scroll container that cannot scroll ' +\n 'in the block axis (client height equals scroll height), so this header ' +\n 'will never pin. Give the scrollport a bounded block-size, or drop ' +\n 'cngxStickyHeader.',\n { host, scrollport },\n );\n }\n\n const sentinel = this.doc.createElement('div');\n sentinel.style.height = '1px';\n sentinel.style.width = '1px';\n sentinel.style.marginBottom = '-1px';\n sentinel.style.visibility = 'hidden';\n sentinel.style.pointerEvents = 'none';\n sentinel.setAttribute('aria-hidden', 'true');\n host.parentElement?.insertBefore(sentinel, host);\n\n this.observeSetup.set({ sentinel, scrollport });\n destroyRef.onDestroy(() => sentinel.remove());\n });\n\n // Observer creation lives in an effect so a later threshold change\n // recreates it - the one-shot afterNextRender above only resolves DOM.\n effect((onCleanup) => {\n const setup = this.observeSetup();\n const threshold = this.threshold();\n if (!setup) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const isSticky = !entries[entries.length - 1].isIntersecting;\n if (isSticky !== this.isStickyState()) {\n this.isStickyState.set(isSticky);\n this.stickyChange.emit(isSticky);\n }\n },\n { threshold, root: setup.scrollport },\n );\n\n observer.observe(setup.sentinel);\n\n onCleanup(() => observer.disconnect());\n });\n }\n\n /**\n * The nearest ancestor that is a scroll container in the block axis - the scrollport\n * `position: sticky` resolves against. Walks up from the host's parent to the first\n * ancestor whose computed `overflow-y` is `auto`, `scroll` or `hidden`; `null` means\n * no such ancestor, i.e. the header sticks to the viewport. `clip` clips without\n * creating a scroll container, so it is skipped. A used `overflow-x` of `auto`,\n * `scroll` or `hidden` coerces the computed `overflow-y` to `auto`, so this also\n * catches a horizontal scroll container (e.g. a data grid that scrolls sideways).\n */\n private resolveScrollParent(host: HTMLElement): HTMLElement | null {\n const view = this.doc.defaultView;\n for (let node = host.parentElement; node; node = node.parentElement) {\n const overflowY = view?.getComputedStyle(node).overflowY;\n if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'hidden') {\n return node;\n }\n }\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { afterNextRender, Directive, effect, inject, input, output, signal } from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Tracks which section is currently most visible in the viewport.\n *\n * Observes a list of elements by their IDs using `IntersectionObserver`\n * and reports the one with the highest intersection ratio as the active section.\n * Ideal for scroll-based navigation highlighting and reading progress.\n *\n * Section IDs are resolved when the inputs change - sections rendered later\n * (`@if`/`@defer`) are not picked up automatically; re-bind `[cngxScrollSpy]`\n * once they exist. In dev mode the directive warns about IDs it cannot find.\n *\n * ### Navigation highlighting\n * ```html\n * <nav [cngxScrollSpy]=\"['intro', 'features', 'pricing']\"\n * #spy=\"cngxScrollSpy\">\n * <a [class.active]=\"spy.activeId() === 'intro'\" href=\"#intro\">Intro</a>\n * <a [class.active]=\"spy.activeId() === 'features'\" href=\"#features\">Features</a>\n * <a [class.active]=\"spy.activeId() === 'pricing'\" href=\"#pricing\">Pricing</a>\n * </nav>\n *\n * <section id=\"intro\">…</section>\n * <section id=\"features\">…</section>\n * <section id=\"pricing\">…</section>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-spy.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxStickyHeader, CngxInfiniteScroll\n * <example-url>http://localhost:4200/#/common/layout/scroll-spy/scroll-based-navigation</example-url>\n */\n@Directive({\n selector: '[cngxScrollSpy]',\n exportAs: 'cngxScrollSpy',\n standalone: true,\n})\nexport class CngxScrollSpy {\n /** IDs of the sections to observe. */\n readonly sections = input.required<string[]>({ alias: 'cngxScrollSpy' });\n /** Minimum visibility ratio to consider a section as a candidate. */\n readonly threshold = input<number>(0.3);\n /** CSS selector for the scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n /** Root margin for the observer. */\n readonly rootMargin = input<string>('0px');\n\n /** Emitted when the active section changes. */\n readonly activeIdChange = output<string | null>();\n\n private readonly activeIdState = signal<string | null>(null);\n /** ID of the section with the highest intersection ratio. */\n readonly activeId = this.activeIdState.asReadonly();\n\n private readonly doc = inject(DOCUMENT);\n /** Last observed intersection ratio keyed by section ID. */\n private readonly ratios = new Map<string, number>();\n private readonly initialized = signal(false);\n private activeCleanup: (() => void) | undefined;\n\n constructor() {\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // Recreate the observer whenever inputs change (deferred until DOM is ready).\n effect((onCleanup) => {\n this.sections();\n this.threshold();\n this.root();\n this.rootMargin();\n\n if (!this.initialized()) {\n return;\n }\n\n this.activeCleanup?.();\n this.activeCleanup = this.setupObserver();\n\n onCleanup(() => {\n this.activeCleanup?.();\n this.activeCleanup = undefined;\n });\n });\n }\n\n /** Builds an `IntersectionObserver` for the current section IDs. Returns a disconnect callback. */\n private setupObserver(): (() => void) | undefined {\n const ids = this.sections();\n const thresholdValue = this.threshold();\n const rootSelector = this.root();\n const rootMarginValue = this.rootMargin();\n\n this.ratios.clear();\n\n const elements = ids\n .map((id) => this.doc.getElementById(id))\n .filter((el): el is HTMLElement => el !== null);\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode && elements.length < ids.length) {\n const missing = ids.filter((id) => !this.doc.getElementById(id));\n cngxDevWarn(\n 'CNGX1033',\n `[cngxScrollSpy] section id(s) not found: ${missing.join(', ')}. ` +\n 'Late-rendered sections are not observed - re-bind [cngxScrollSpy] once they exist.',\n );\n }\n\n if (elements.length === 0) {\n return undefined;\n }\n\n const resolvedRoot = rootSelector ? this.doc.querySelector(rootSelector) : null;\n if (typeof ngDevMode !== 'undefined' && ngDevMode && rootSelector && !resolvedRoot) {\n cngxDevWarn(\n 'CNGX1032',\n `[cngxScrollSpy] root selector \"${rootSelector}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => this.ratios.set(entry.target.id, entry.intersectionRatio));\n\n const best = Array.from(this.ratios).reduce<{ id: string | null; ratio: number }>(\n (acc, [id, ratio]) =>\n ratio >= thresholdValue && ratio > acc.ratio ? { id, ratio } : acc,\n { id: null, ratio: 0 },\n );\n\n if (best.id !== this.activeIdState()) {\n this.activeIdState.set(best.id);\n this.activeIdChange.emit(best.id);\n }\n },\n {\n root: resolvedRoot,\n rootMargin: rootMarginValue,\n threshold: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],\n },\n );\n\n elements.forEach((el) => observer.observe(el));\n\n return () => observer.disconnect();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from '../observers/resize-signal';\n\n/**\n * Manages text truncation with expand/collapse state detection.\n *\n * Applies `-webkit-line-clamp` when collapsed and detects whether the text\n * is actually clamped (content overflows). Exposes `isClamped` so the consumer\n * can conditionally show a \"Show more\" toggle only when needed.\n *\n * The `expanded` state supports two-way binding (controlled + uncontrolled).\n *\n * ### Basic truncation with toggle\n * ```html\n * <p [cngxTruncate]=\"3\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n * Long text content that may or may not overflow…\n * </p>\n * @if (trunc.isClamped() || trunc.expanded()) {\n * <button (click)=\"expanded.set(!expanded())\"\n * [attr.aria-expanded]=\"expanded()\">\n * {{ expanded() ? 'Show less' : 'Show more' }}\n * </button> * }\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/truncate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText, CngxExpandableToggle, CngxHighlight\n * <example-url>http://localhost:4200/#/common/layout/truncate/short-text-no-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/layout/truncate/truncated-text-with-toggle</example-url>\n */\n@Directive({\n selector: '[cngxTruncate]',\n exportAs: 'cngxTruncate',\n standalone: true,\n host: {\n '[style.-webkit-line-clamp]': 'clampValue()',\n '[style.display]': 'displayValue()',\n '[style.-webkit-box-orient]': 'orientValue()',\n '[style.overflow]': 'overflowValue()',\n },\n})\nexport class CngxTruncate {\n /** Maximum number of visible lines when collapsed. */\n readonly lines = input<number>(3, { alias: 'cngxTruncate' });\n /** Whether the text is expanded (full content visible). Supports two-way binding. */\n readonly expanded = model<boolean>(false);\n\n private readonly isClampedState = signal(false);\n /** Whether the text content actually exceeds the line limit and is being clamped. */\n readonly isClamped = this.isClampedState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private stopResize: (() => void) | null = null;\n private rafHandle: number | null = null;\n\n // null strips the host binding - preferred over an empty string for -webkit-line-clamp.\n /** @internal */\n protected readonly clampValue = computed(() => (this.expanded() ? null : String(this.lines())));\n /** @internal */\n protected readonly displayValue = computed(() => (this.expanded() ? null : '-webkit-box'));\n /** @internal */\n protected readonly orientValue = computed(() => (this.expanded() ? null : 'vertical'));\n /** @internal */\n protected readonly overflowValue = computed(() => (this.expanded() ? null : 'hidden'));\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // SSR guard: no window, no measuring - the style bindings above still render.\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return;\n }\n\n afterNextRender(() => {\n this.checkClamped();\n this.stopResize = observeResize(\n win,\n this.el.nativeElement as HTMLElement,\n 'content-box',\n () => this.checkClamped(),\n );\n });\n\n // Re-check after expanded/lines change; RAF ensures styles are applied first.\n effect(() => {\n this.expanded(); // track\n this.lines(); // track\n this.cancelRaf();\n this.rafHandle = requestAnimationFrame(() => this.checkClamped());\n });\n\n destroyRef.onDestroy(() => {\n this.stopResize?.();\n this.cancelRaf();\n });\n }\n\n private cancelRaf(): void {\n if (this.rafHandle !== null) {\n cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n }\n\n /**\n * Compares `scrollHeight` vs `clientHeight` to detect overflow.\n * Only meaningful when collapsed - when expanded, the last known\n * clamped state is preserved (can't measure hypothetical clamp height\n * while showing full content).\n */\n private checkClamped(): void {\n const el = this.el.nativeElement as HTMLElement;\n if (this.expanded()) {\n return;\n }\n this.isClampedState.set(el.scrollHeight > el.clientHeight);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Search-text highlighting via `<mark>` elements.\n *\n * Walks `TEXT_NODE` children of the host element, splits at match boundaries,\n * and wraps matched portions in `<mark>` elements. No `innerHTML` - safe by\n * construction. The `<mark>` element has correct native SR semantics (announced\n * as \"highlighted\" in most screen readers).\n *\n * The original text nodes are kept by reference and re-inserted when the\n * term changes or the directive is destroyed - Angular bindings targeting\n * them (interpolations, structural directives) stay live.\n *\n * ### Search result highlighting\n * ```html\n * <p [cngxHighlight]=\"searchTerm()\">\n * Angular Signals represent a fundamental shift in reactivity.\n * </p>\n * ```\n *\n * ### Case-sensitive matching\n * ```html\n * <p [cngxHighlight]=\"term()\" [highlightCaseSensitive]=\"true\">\n * CamelCase matters here.\n * </p>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/highlight.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableText\n * <example-url>http://localhost:4200/#/common/layout/highlight/live-search-highlighting</example-url>\n * <example-url>http://localhost:4200/#/common/layout/highlight/multiple-paragraphs</example-url>\n */\n@Directive({\n selector: '[cngxHighlight]',\n exportAs: 'cngxHighlight',\n standalone: true,\n})\nexport class CngxHighlight {\n /** The search term to highlight. Empty string clears all highlights. */\n readonly term = input<string>('', { alias: 'cngxHighlight' });\n /** Whether matching is case-sensitive. */\n readonly caseSensitive = input<boolean>(false, { alias: 'highlightCaseSensitive' });\n\n private readonly matchCountState = signal(0);\n /** Number of matches found in the current highlight pass. */\n readonly matchCount = this.matchCountState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /**\n * The text nodes replaced by the current highlight pass, by reference,\n * with the nodes standing in for them. Undone before every re-highlight\n * and on destroy - re-inserting the original references keeps LView\n * bindings (interpolations) attached to live DOM.\n */\n private replacements: { original: Text; inserted: Node[] }[] = [];\n private readonly initialized = signal(false);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.restoreNodes());\n\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // The highlight pass writes matchCountState - untracked, so the write\n // cannot re-trigger this effect.\n effect(() => {\n const term = this.term();\n const caseSensitive = this.caseSensitive();\n if (this.initialized()) {\n untracked(() => this.applyHighlight(term, caseSensitive));\n }\n });\n }\n\n /**\n * Performs the highlight pass: restores original DOM, then wraps matches\n * in `<mark>` elements. Updates `matchCountState` with the result count.\n */\n private applyHighlight(term: string, caseSensitive: boolean): void {\n const host = this.el.nativeElement as HTMLElement;\n\n this.restoreNodes();\n\n if (!term) {\n this.matchCountState.set(0);\n return;\n }\n\n let count = 0;\n const walker = this.doc.createTreeWalker(host, NodeFilter.SHOW_TEXT);\n const textNodes: Text[] = [];\n\n // Collect nodes before modifying the DOM during the walk.\n let node: Text | null;\n while ((node = walker.nextNode() as Text | null)) {\n textNodes.push(node);\n }\n\n for (const textNode of textNodes) {\n const text = textNode.textContent ?? '';\n const flags = caseSensitive ? 'g' : 'gi';\n const regex = new RegExp(this.escapeRegex(term), flags);\n const matches = [...text.matchAll(regex)];\n\n if (matches.length === 0) {\n continue;\n }\n\n count += matches.length;\n const fragment = this.doc.createDocumentFragment();\n let lastIndex = 0;\n\n for (const match of matches) {\n const matchStart = match.index;\n const matchEnd = matchStart + match[0].length;\n\n if (matchStart > lastIndex) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex, matchStart)));\n }\n\n const mark = this.doc.createElement('mark');\n mark.textContent = text.slice(matchStart, matchEnd);\n fragment.appendChild(mark);\n\n lastIndex = matchEnd;\n }\n\n if (lastIndex < text.length) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex)));\n }\n\n // Capture before replaceChild - inserting a fragment empties it.\n const inserted = Array.from(fragment.childNodes);\n textNode.parentNode!.replaceChild(fragment, textNode);\n this.replacements.push({ original: textNode, inserted });\n }\n\n this.matchCountState.set(count);\n }\n\n /** Puts the original text nodes back and removes the highlight nodes. */\n private restoreNodes(): void {\n for (const { original, inserted } of this.replacements) {\n const parent = inserted[0]?.parentNode;\n if (!parent) {\n continue;\n }\n parent.insertBefore(original, inserted[0]);\n for (const node of inserted) {\n if (node.parentNode === parent) {\n parent.removeChild(node);\n }\n }\n }\n this.replacements = [];\n }\n\n /** Escapes special regex characters in the search term. */\n private escapeRegex(str: string): string {\n return str.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n }\n}\n","// Pulls the augmented module into the program; ng-packagr rejects `declare module` (TS2664) otherwise.\nimport type {} from '@cngx/core/i18n';\n\n/**\n * The layout section of a {@link CngxLanguagePack}: the copy of the\n * `@cngx/common/layout` atoms. It feeds `CNGX_LAYOUT_I18N`.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport interface CngxLayoutLanguageSection {\n /** Label of the `CngxExpandableText` expand control. */\n readonly expandableTextMore: string;\n /** Label of the `CngxExpandableText` collapse control. */\n readonly expandableTextLess: string;\n}\n\n/**\n * The English layout section: the single source of the layout atoms'\n * English copy. `CNGX_LAYOUT_I18N` defaults to it.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport const CNGX_LAYOUT_LANGUAGE_EN: CngxLayoutLanguageSection = {\n expandableTextMore: 'Show more',\n expandableTextLess: 'Show less',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly layout: CngxLayoutLanguageSection;\n }\n}\n","import { inject, InjectionToken, type Provider, type Signal } from '@angular/core';\nimport { createLanguageSection } from '@cngx/core/i18n';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport { CNGX_LAYOUT_LANGUAGE_EN, type CngxLayoutLanguageSection } from './layout-language-section';\n\n/**\n * Layout i18n surface. Library defaults are English; consumers override via\n * {@link provideLayoutI18n}. Reactive from birth: the token carries a\n * `Signal`, and {@link withLayoutI18nLabels} accepts a `Signal` of a partial\n * bundle.\n *\n * Both keys are the fallback of the `CngxExpandableText` `moreLabel` /\n * `lessLabel` inputs, resolved in a `computed()`: a bound input wins, and an\n * unbound one follows a language switch. The same shape as the layout\n * section of a language pack, declared once as\n * {@link CngxLayoutLanguageSection}.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport type CngxLayoutI18n = CngxLayoutLanguageSection;\n\n/** @internal The English section with the active pack's layout section on top. */\nconst layoutBundleFromPack = createLanguageSection('layout', CNGX_LAYOUT_LANGUAGE_EN);\n\n/**\n * DI token for the layout i18n bundle. `providedIn: 'root'`: the layout\n * section of the active language pack over the English defaults; the value\n * is a `Signal`, shared by every reader under one injector.\n *\n * @category common/layout/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/i18n/layout-i18n.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText\n */\nexport const CNGX_LAYOUT_I18N = new InjectionToken<Signal<CngxLayoutI18n>>('CngxLayoutI18n', {\n providedIn: 'root',\n factory: layoutBundleFromPack,\n});\n\n/**\n * Branded feature-fn for {@link provideLayoutI18n}.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport type CngxLayoutI18nFeature = ((bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>) & {\n readonly _target: 'i18n';\n};\n\n/** @internal */\nfunction defineLayoutI18nFeature(\n fn: (bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>,\n): CngxLayoutI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override layout labels via a partial bundle - unset keys keep the\n * language pack's copy, or the English default. Pass a `Signal` of a partial\n * bundle to switch languages at runtime.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function withLayoutI18nLabels(\n overrides: Partial<CngxLayoutI18n> | Signal<Partial<CngxLayoutI18n>>,\n): CngxLayoutI18nFeature {\n return defineLayoutI18nFeature((bundle) => createOverrideMerge(bundle, overrides));\n}\n\n/**\n * Provider for the layout i18n bundle. Returns a plain `Provider`, so it\n * also scopes a subtree through `viewProviders`. The features apply on top\n * of the active language pack.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideLayoutI18n(\n * withLayoutI18nLabels({ expandableTextMore: 'Mehr anzeigen', expandableTextLess: 'Weniger anzeigen' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function provideLayoutI18n(...features: readonly CngxLayoutI18nFeature[]): Provider {\n return {\n provide: CNGX_LAYOUT_I18N,\n useFactory: () =>\n features.reduce<Signal<CngxLayoutI18n>>(\n (bundle, feat) => feat(bundle),\n layoutBundleFromPack(),\n ),\n };\n}\n\n/**\n * Inject the resolved layout i18n bundle signal. Read it inside a\n * `computed()` or template so a runtime override flip re-derives.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function injectLayoutI18n(): Signal<CngxLayoutI18n> {\n return inject(CNGX_LAYOUT_I18N);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n inject,\n input,\n model,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport { CngxTruncate } from './truncate.directive';\n\n/**\n * Template context for the custom toggle template.\n *\n * @category common/layout\n */\nexport interface CngxExpandableToggleContext {\n /** Whether the text is currently expanded. */\n $implicit: boolean;\n /** Whether the text is currently expanded. */\n expanded: boolean;\n /** Call to toggle the expanded state. */\n toggle: () => void;\n}\n\n/**\n * Marks a custom toggle template inside `cngx-expandable-text`.\n *\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\" class=\"icon-btn\">\n * <mat-icon>{{ expanded ? 'expand_less' : 'expand_more' }}</mat-icon>\n * </button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText, CngxTruncate\n */\n@Directive({\n selector: 'ng-template[cngxExpandableToggle]',\n standalone: true,\n})\nexport class CngxExpandableToggle {\n readonly templateRef = inject<TemplateRef<CngxExpandableToggleContext>>(TemplateRef);\n}\n\n/**\n * Molecule wrapping `CngxTruncate` with a built-in expand/collapse toggle.\n *\n * Projects content into a truncated container and conditionally renders\n * a \"Show more\" / \"Show less\" button when the content is actually clamped.\n * Handles `aria-expanded` automatically.\n *\n * Supports custom toggle templates via `ng-template[cngxExpandableToggle]` -\n * use for icon buttons or any custom UI instead of plain text labels.\n *\n * ### Basic usage\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text that may or may not overflow the container…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom labels\n * ```html\n * <cngx-expandable-text [lines]=\"2\" moreLabel=\"Mehr\" lessLabel=\"Weniger\">\n * Langer Text…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom toggle template\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\">{{ expanded ? 'Collapse' : 'Expand' }}</button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableToggle, CngxHighlight\n * @slot cngxExpandableToggle Replaces the show-more control; gets the current expanded state.\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/auto-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/custom-labels</example-url>\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/custom-toggle-template</example-url>\n */\n@Component({\n selector: 'cngx-expandable-text',\n exportAs: 'cngxExpandableText',\n standalone: true,\n imports: [CngxTruncate, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n style: 'display:block',\n },\n template: `\n <div [cngxTruncate]=\"lines()\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n <ng-content />\n </div>\n @if (trunc.isClamped() || expanded()) {\n @if (customToggle(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"toggleContext()\"\n />\n } @else {\n <button\n type=\"button\"\n class=\"cngx-expandable-text__toggle\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? resolvedLessLabel() : resolvedMoreLabel() }}\n </button>\n }\n }\n `,\n})\nexport class CngxExpandableText {\n private readonly i18n = injectLayoutI18n();\n\n /** Maximum visible lines when collapsed. */\n readonly lines = input<number>(3);\n /** Whether the text is expanded. Supports two-way `[(expanded)]` binding. */\n readonly expanded = model<boolean>(false);\n /**\n * Label for the \"show more\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextMore`.\n */\n readonly moreLabel = input<string | undefined>(undefined);\n /**\n * Label for the \"show less\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextLess`.\n */\n readonly lessLabel = input<string | undefined>(undefined);\n protected readonly resolvedMoreLabel = computed(\n () => this.moreLabel() ?? this.i18n().expandableTextMore,\n );\n protected readonly resolvedLessLabel = computed(\n () => this.lessLabel() ?? this.i18n().expandableTextLess,\n );\n\n /** Optional custom toggle template projected by the consumer. */\n protected readonly customToggle = contentChild(CngxExpandableToggle);\n\n /** Stable toggle closure - a fresh closure per context would defeat the equal fn below. */\n private readonly toggleFn = (): void => this.expanded.set(!this.expanded());\n\n /**\n * Template context for the custom toggle. Structural `equal` fn so\n * `ngTemplateOutletContext` does not rebind the embedded view on every\n * CD cycle (same rule as the CngxTag slot contexts).\n */\n protected readonly toggleContext = computed<CngxExpandableToggleContext>(\n () => ({\n $implicit: this.expanded(),\n expanded: this.expanded(),\n toggle: this.toggleFn,\n }),\n { equal: (a, b) => a.expanded === b.expanded },\n );\n}\n","/**\n * @module @cngx/common/layout\n */\nexport { CngxBackdrop } from './drawer/backdrop.directive';\nexport { CngxDrawer, type DrawerPosition } from './drawer/drawer.directive';\nexport { CngxDrawerPanel, type DrawerMode } from './drawer/drawer-panel.directive';\nexport { CngxDrawerContent } from './drawer/drawer-content.directive';\nexport { CngxIntersectionObserver } from './observers/intersection-observer.directive';\nexport { CngxMediaQuery } from './observers/media-query.directive';\nexport { injectMediaQuery } from './observers/inject-media-query';\nexport { injectQueryParamSync, type QueryParamSyncOptions } from './router/inject-query-param-sync';\nexport { CngxResizeObserver } from './observers/resize-observer.directive';\nexport {\n createResizeSignal,\n observeResize,\n type ResizeObserverHost,\n} from './observers/resize-signal';\nexport { CngxContainer } from './observers/container.directive';\nexport {\n CNGX_CONTAINER_SIZE,\n type CngxContainerSize,\n createContainerSize,\n injectContainerSize,\n} from './observers/container-size';\nexport { CngxScrollLock } from './scroll/scroll-lock.directive';\nexport { createPinnedScrollLock, createScrollLock } from './scroll/scroll-lock-core';\nexport { CngxScrollEdges } from './scroll/scroll-edges.directive';\nexport {\n createScrollEdges,\n type CngxScrollEdgesState,\n type ScrollEdgesHost,\n} from './scroll/scroll-edges-core';\nexport { CngxSkeleton } from './text/skeleton.directive';\nexport { CngxInfiniteScroll } from './scroll/infinite-scroll.directive';\nexport { CngxStickyHeader } from './scroll/sticky-header.directive';\nexport { CngxScrollSpy } from './scroll/scroll-spy.directive';\nexport { CngxTruncate } from './text/truncate.directive';\nexport { CngxHighlight } from './text/highlight.directive';\nexport {\n CngxExpandableText,\n CngxExpandableToggle,\n type CngxExpandableToggleContext,\n} from './text/expandable-text';\nexport {\n CNGX_LAYOUT_I18N,\n injectLayoutI18n,\n provideLayoutI18n,\n withLayoutI18nLabels,\n type CngxLayoutI18n,\n type CngxLayoutI18nFeature,\n} from './i18n/layout-i18n';\nexport {\n CNGX_LAYOUT_LANGUAGE_EN,\n type CngxLayoutLanguageSection,\n} from './i18n/layout-language-section';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DestroyRefToken"],"mappings":";;;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEG;MAWU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