createPaginatorAnnouncer
projects/ui/paginator/paginator-announcer.ts
Description#
Builds the paginator live-region message as a single derived signal - no
class logic baked into the shell, so the skin still ejects cleanly. The
message is a linkedSignal over [pageIndex, totalPages, isBusy] from
CNGX_PAGINATOR_HOST: it speaks "Page N of M" on every effective-page
change (navigation OR a total-shrink clamp, so the clamp is never silent),
"Loading" while busy, and "Updated" on the first settle after busy. Phrasing
comes from injectPaginatorConfig.
The previous source value (held by linkedSignal) is what distinguishes a
settle from a steady state, so there is no signal write in an effect and no
imperative previous tracking. Identical consecutive messages dedupe through
the signal's value equality, so the live region never re-announces a no-op.
Must run in an injection context (call as a field initialiser on the shell).
Signature#
createPaginatorAnnouncer()Returns#
CngxPaginatorAnnouncer