@cngx/common 0.1.0-rc.5 → 0.1.0-rc.7
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/chart/README.md +85 -0
- package/command/README.md +157 -0
- package/data/README.md +23 -0
- package/fesm2022/cngx-common-a11y.mjs +247 -85
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +37 -37
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +13 -9
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +3404 -1392
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +144 -0
- package/fesm2022/cngx-common-command.mjs.map +1 -0
- package/fesm2022/cngx-common-data.mjs +304 -213
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +369 -100
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +144 -30
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +1089 -459
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +113 -61
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +430 -54
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +107 -49
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1170 -752
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +1086 -0
- package/fesm2022/cngx-common-timeline.mjs.map +1 -0
- package/fesm2022/cngx-common.mjs +2 -2
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/package.json +11 -1
- package/stepper/README.md +1 -1
- package/theming/components/cngx-accordion.css +20 -6
- package/theming/components/cngx-badge.css +22 -0
- package/theming/components/cngx-bottom-sheet.css +14 -2
- package/theming/components/cngx-breadcrumb.css +9 -1
- package/theming/components/cngx-button-toggle.css +44 -2
- package/theming/components/cngx-data-grid.css +69 -4
- package/theming/components/cngx-dialog.css +12 -0
- package/theming/components/cngx-divider.css +12 -0
- package/theming/components/cngx-listbox.css +27 -0
- package/theming/components/cngx-menu.css +36 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +1 -1
- package/theming/components/cngx-tooltip.css +11 -0
- package/types/cngx-common-a11y.d.ts +63 -17
- package/types/cngx-common-audio.d.ts +32 -32
- package/types/cngx-common-card.d.ts +10 -3
- package/types/cngx-common-chart.d.ts +1281 -141
- package/types/cngx-common-command.d.ts +167 -0
- package/types/cngx-common-data.d.ts +264 -98
- package/types/cngx-common-dialog.d.ts +214 -25
- package/types/cngx-common-display.d.ts +83 -13
- package/types/cngx-common-interactive.d.ts +708 -174
- package/types/cngx-common-layout.d.ts +48 -1
- package/types/cngx-common-popover.d.ts +120 -3
- package/types/cngx-common-stepper.d.ts +55 -5
- package/types/cngx-common-tabs.d.ts +386 -25
- package/types/cngx-common-timeline.d.ts +1059 -0
- package/types/cngx-common.d.ts +1 -1
|
@@ -205,6 +205,11 @@
|
|
|
205
205
|
cursor: pointer;
|
|
206
206
|
user-select: none;
|
|
207
207
|
color: inherit;
|
|
208
|
+
|
|
209
|
+
/* Touch-target floor - each option is a tap target; floor its hit box to
|
|
210
|
+
the pointer-derived minimum on the block axis. Inert at 0px on a fine
|
|
211
|
+
pointer, so [data-density] still drives the natural row height. */
|
|
212
|
+
min-block-size: var(--cngx-target-min, 0px);
|
|
208
213
|
}
|
|
209
214
|
|
|
210
215
|
.cngx-option--highlighted {
|
|
@@ -224,3 +229,25 @@
|
|
|
224
229
|
display: none;
|
|
225
230
|
}
|
|
226
231
|
}
|
|
232
|
+
|
|
233
|
+
/* forced-colors (WHCM): both the selected option and the keyboard-highlighted
|
|
234
|
+
* option (aria-activedescendant cursor) are background tints with no border, and
|
|
235
|
+
* both flatten to Canvas - the committed selection and the cursor vanish.
|
|
236
|
+
* Re-signal the committed selection with the Highlight pair, and draw the
|
|
237
|
+
* transient cursor as an inset CanvasText outline so the two stay distinct and
|
|
238
|
+
* combinable. Unlayered + direct selectors (outside @layer) to beat the layered
|
|
239
|
+
* component rule. */
|
|
240
|
+
@media (forced-colors: active) {
|
|
241
|
+
.cngx-option--selected {
|
|
242
|
+
/* The option is a <div cngxOption> (not a form control), so no
|
|
243
|
+
* forced-color-adjust is needed. The base rule is a plain class in
|
|
244
|
+
* @layer cngx.components with no @scope, so this unlayered block wins
|
|
245
|
+
* without !important (unlayered beats layered). */
|
|
246
|
+
background: Highlight;
|
|
247
|
+
color: HighlightText;
|
|
248
|
+
}
|
|
249
|
+
.cngx-option--highlighted {
|
|
250
|
+
outline: 2px solid CanvasText;
|
|
251
|
+
outline-offset: -2px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -300,6 +300,20 @@
|
|
|
300
300
|
cursor: pointer;
|
|
301
301
|
user-select: none;
|
|
302
302
|
color: inherit;
|
|
303
|
+
/* Touch-target floor - menu rows are primary tap targets; lift each
|
|
304
|
+
to the pointer-derived hit-area minimum on the block axis. Inert
|
|
305
|
+
at 0px on a fine pointer. */
|
|
306
|
+
min-block-size: var(--cngx-target-min, 0px);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* Adjacent-target spacing floor (WCAG 2.5.8) - stacked menu rows keep at
|
|
310
|
+
least the pointer-derived gap between neighbours so densely packed items
|
|
311
|
+
stay distinguishable as separate tap targets. An adjacent-sibling margin
|
|
312
|
+
avoids changing the container's block-flow layout model; inert at 0px on a
|
|
313
|
+
fine pointer, and a vertical margin is a no-op on a horizontal menubar. */
|
|
314
|
+
:is([cngxMenuItem], [cngxMenuItemCheckbox], [cngxMenuItemRadio], [cngxMenuItemSubmenu])
|
|
315
|
+
+ :is([cngxMenuItem], [cngxMenuItemCheckbox], [cngxMenuItemRadio], [cngxMenuItemSubmenu]) {
|
|
316
|
+
margin-block-start: var(--cngx-target-gap, 0px);
|
|
303
317
|
}
|
|
304
318
|
|
|
305
319
|
.cngx-menu-item--highlighted {
|
|
@@ -376,3 +390,25 @@
|
|
|
376
390
|
list-style: none;
|
|
377
391
|
}
|
|
378
392
|
}
|
|
393
|
+
|
|
394
|
+
/* forced-colors (WHCM): the highlighted item (keyboard cursor) is a background
|
|
395
|
+
* tint and the separator is a 1px background-color hairline - both flatten to
|
|
396
|
+
* Canvas, erasing the cursor and the dividers. Re-signal the active item with
|
|
397
|
+
* the Highlight pair and re-draw the separator with CanvasText ink. The checked
|
|
398
|
+
* item self-heals (its ::before glyph + bolder weight survive). Unlayered +
|
|
399
|
+
* direct selectors (outside @layer) to beat the layered component rule. */
|
|
400
|
+
@media (forced-colors: active) {
|
|
401
|
+
.cngx-menu-item--highlighted {
|
|
402
|
+
/* Menu items are typically <button>s; the UA forces a form-control
|
|
403
|
+
* background to ButtonFace, so opt out with forced-color-adjust, then set
|
|
404
|
+
* the Highlight pair. The base rule is a plain class in @layer
|
|
405
|
+
* cngx.components with no @scope, so this unlayered block wins without
|
|
406
|
+
* !important (unlayered beats layered; the opt-out beats the UA forcing). */
|
|
407
|
+
forced-color-adjust: none;
|
|
408
|
+
background: Highlight;
|
|
409
|
+
color: HighlightText;
|
|
410
|
+
}
|
|
411
|
+
[cngxMenuSeparator] {
|
|
412
|
+
background: CanvasText;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
@@ -269,3 +269,14 @@
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
+
|
|
273
|
+
/* forced-colors (WHCM): the tooltip is a background-filled pill with border:none,
|
|
274
|
+
* so the forced palette turns its surface to Canvas and it merges into the page
|
|
275
|
+
* beneath with no visible edge. Re-draw a system-colour border so the call-out
|
|
276
|
+
* stays bounded. Unlayered + direct selector (outside @scope) to beat the
|
|
277
|
+
* layered component rule and sidestep the @scope/layer cascade trap. */
|
|
278
|
+
@media (forced-colors: active) {
|
|
279
|
+
.cngx-tooltip {
|
|
280
|
+
border: 1px solid ButtonBorder;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -104,22 +104,26 @@ declare class CngxLiveRegion {
|
|
|
104
104
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxLiveRegion, "[cngxLiveRegion]", ["cngxLiveRegion"], { "politeness": { "alias": "politeness"; "required": false; "isSignal": true; }; "atomic": { "alias": "atomic"; "required": false; "isSignal": true; }; "relevant": { "alias": "relevant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
type Politeness = 'polite' | 'assertive';
|
|
107
108
|
/**
|
|
108
109
|
* Imperative, reusable polite/assertive live-region announcer.
|
|
109
110
|
*
|
|
110
111
|
* The imperative counterpart to {@link CngxLiveRegion}: where the directive
|
|
111
112
|
* decorates an element you render (the content IS the announcement), this
|
|
112
|
-
* service owns
|
|
113
|
-
* `document.body`
|
|
113
|
+
* service owns two visually-hidden `aria-live` regions appended to
|
|
114
|
+
* `document.body` - one persistent polite node and one persistent assertive
|
|
115
|
+
* node - and exposes an `announce(message, politeness)` call for template-less
|
|
114
116
|
* directives and event handlers (e.g. `CngxCopyValue` copy success,
|
|
115
117
|
* `CngxOtpInput` completion).
|
|
116
118
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
119
|
+
* Each region is created lazily on the first announcement of its politeness and
|
|
120
|
+
* reused thereafter. Because polite and assertive live in separate fixed-
|
|
121
|
+
* politeness nodes, an assertive announcement never clobbers a concurrent
|
|
122
|
+
* polite one. Per region, the text is cleared and re-set one frame later so an
|
|
123
|
+
* identical consecutive message is still re-read by the screen reader.
|
|
120
124
|
*
|
|
121
125
|
* SSR-safe: all DOM access is guarded by `isPlatformBrowser`; on the server
|
|
122
|
-
* `announce()` is a no-op and no
|
|
126
|
+
* `announce()` is a no-op and no region is created.
|
|
123
127
|
*
|
|
124
128
|
* ```typescript
|
|
125
129
|
* const announcer = inject(CngxLiveAnnouncer);
|
|
@@ -137,16 +141,18 @@ declare class CngxLiveRegion {
|
|
|
137
141
|
declare class CngxLiveAnnouncer implements OnDestroy {
|
|
138
142
|
private readonly doc;
|
|
139
143
|
private readonly isBrowser;
|
|
140
|
-
private
|
|
141
|
-
private
|
|
144
|
+
private politeRegion;
|
|
145
|
+
private assertiveRegion;
|
|
146
|
+
private readonly pending;
|
|
142
147
|
/**
|
|
143
|
-
* Announces `message` through the
|
|
148
|
+
* Announces `message` through the fixed-politeness live region.
|
|
144
149
|
*
|
|
145
150
|
* @param message Text read by the screen reader.
|
|
146
151
|
* @param politeness `'polite'` (default) queues after the current
|
|
147
|
-
* utterance; `'assertive'` interrupts immediately.
|
|
152
|
+
* utterance; `'assertive'` interrupts immediately. Each politeness owns its
|
|
153
|
+
* own region, so the two never overwrite each other.
|
|
148
154
|
*/
|
|
149
|
-
announce(message: string, politeness?:
|
|
155
|
+
announce(message: string, politeness?: Politeness): void;
|
|
150
156
|
ngOnDestroy(): void;
|
|
151
157
|
private ensureRegion;
|
|
152
158
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxLiveAnnouncer, never>;
|
|
@@ -501,6 +507,8 @@ declare class CngxRovingTabindex {
|
|
|
501
507
|
/** Host element for `data-cngx-recycle-index` queries in virtual mode. */
|
|
502
508
|
private readonly hostEl;
|
|
503
509
|
private readonly pendingFocusState;
|
|
510
|
+
/** Document writing direction - flips the horizontal-arrow index deltas under `rtl` (APG). */
|
|
511
|
+
private readonly direction;
|
|
504
512
|
/**
|
|
505
513
|
* Set true just before a navigation key (arrow / Home / End) moves focus to a
|
|
506
514
|
* new item, cleared by {@link consumeNavigationKey}. Transient handshake, not
|
|
@@ -537,6 +545,12 @@ declare class CngxRovingTabindex {
|
|
|
537
545
|
* based on whether `virtualCount` is set.
|
|
538
546
|
*/
|
|
539
547
|
protected handleKeyDown(event: KeyboardEvent): void;
|
|
548
|
+
/**
|
|
549
|
+
* Keeps `activeIndex` in sync with real focus (APG): when an item gains
|
|
550
|
+
* focus by any means - pointer click, script focus, assistive tech - the
|
|
551
|
+
* tab stop follows it instead of staying on the last arrow-key target.
|
|
552
|
+
*/
|
|
553
|
+
protected handleFocusIn(event: FocusEvent): void;
|
|
540
554
|
/**
|
|
541
555
|
* Attempts to focus a virtual item by querying `data-cngx-recycle-index`.
|
|
542
556
|
* If the element is not in the DOM, sets `pendingFocus` for external resolution.
|
|
@@ -638,9 +652,13 @@ interface CngxAdItemHandle {
|
|
|
638
652
|
*
|
|
639
653
|
* ### Virtualization
|
|
640
654
|
*
|
|
641
|
-
* When `virtualCount` is set, navigation
|
|
642
|
-
*
|
|
643
|
-
*
|
|
655
|
+
* When `virtualCount` is set, navigation addresses the absolute index space
|
|
656
|
+
* `[0, virtualCount)` even when only a window is rendered. Bind `windowStart`
|
|
657
|
+
* to the recycler's window start so item lookups (id resolution, disabled
|
|
658
|
+
* checks, typeahead labels) map absolute indices onto the rendered subset.
|
|
659
|
+
* Targets outside the window surface as `pendingHighlight`; the consumer
|
|
660
|
+
* scrolls them into view (`connectRecyclerToActiveDescendant`) and the
|
|
661
|
+
* directive clears the pending state once the target renders.
|
|
644
662
|
*
|
|
645
663
|
* ### Material/CDK equivalent
|
|
646
664
|
*
|
|
@@ -683,12 +701,21 @@ declare class CngxActiveDescendant {
|
|
|
683
701
|
* range surface as `pendingHighlight` for scroll-and-retry protocols.
|
|
684
702
|
*/
|
|
685
703
|
readonly virtualCount: _angular_core.InputSignal<number | undefined>;
|
|
704
|
+
/**
|
|
705
|
+
* Absolute index of the first rendered item in virtual mode - the recycler
|
|
706
|
+
* window start. All rendered-item lookups are offset by it so absolute
|
|
707
|
+
* indices resolve the right item once the window has scrolled past 0.
|
|
708
|
+
* Ignored when `virtualCount` is unset.
|
|
709
|
+
*/
|
|
710
|
+
readonly windowStart: _angular_core.InputSignal<number>;
|
|
686
711
|
/** Emitted when `activateCurrent()` is called with an active item. */
|
|
687
712
|
readonly activated: _angular_core.OutputEmitterRef<unknown>;
|
|
688
713
|
/** Emitted whenever the highlighted item changes. */
|
|
689
714
|
readonly highlighted: _angular_core.OutputEmitterRef<ActiveDescendantItem | null>;
|
|
690
715
|
private readonly hostEl;
|
|
691
716
|
private readonly registered;
|
|
717
|
+
/** Document writing direction - flips the horizontal-arrow steps under `rtl` (APG). */
|
|
718
|
+
private readonly direction;
|
|
692
719
|
/** Guards host attribute writes until after first render. */
|
|
693
720
|
private readonly initialized;
|
|
694
721
|
/** -1 means "no active item". Range is [0, resolvedItems().length). */
|
|
@@ -708,6 +735,13 @@ declare class CngxActiveDescendant {
|
|
|
708
735
|
* or the item is out of rendered range (virtual mode).
|
|
709
736
|
*/
|
|
710
737
|
readonly activeItem: _angular_core.Signal<ActiveDescendantItem | null>;
|
|
738
|
+
/**
|
|
739
|
+
* `activeItem` pinned to the item id for the `highlighted` emission: a
|
|
740
|
+
* re-render that produces a fresh object for the same item must not
|
|
741
|
+
* re-emit. `activeItem` itself stays identity-equal so `activeValue`
|
|
742
|
+
* tracks value changes on an unchanged id.
|
|
743
|
+
*/
|
|
744
|
+
private readonly highlightedItem;
|
|
711
745
|
readonly activeId: _angular_core.Signal<string | null>;
|
|
712
746
|
readonly activeValue: _angular_core.Signal<unknown>;
|
|
713
747
|
private readonly typeaheadBuffer;
|
|
@@ -723,8 +757,10 @@ declare class CngxActiveDescendant {
|
|
|
723
757
|
*/
|
|
724
758
|
highlightByIndex(index: number): void;
|
|
725
759
|
/**
|
|
726
|
-
* Highlight the first item whose value matches (via `Object.is`).
|
|
727
|
-
* no match. Disabled items are rejected when `skipDisabled()` is
|
|
760
|
+
* Highlight the first rendered item whose value matches (via `Object.is`).
|
|
761
|
+
* No-op if no match. Disabled items are rejected when `skipDisabled()` is
|
|
762
|
+
* true. In virtual mode only the rendered window is searched; the resolved
|
|
763
|
+
* index is absolute.
|
|
728
764
|
*/
|
|
729
765
|
highlightByValue(value: unknown): void;
|
|
730
766
|
/** Clear the highlight. */
|
|
@@ -748,13 +784,23 @@ declare class CngxActiveDescendant {
|
|
|
748
784
|
typeaheadChar(ch: string): void;
|
|
749
785
|
private handleTypeahead;
|
|
750
786
|
private findFrom;
|
|
787
|
+
/**
|
|
788
|
+
* First/last navigable absolute index. Spans the full virtual range - End
|
|
789
|
+
* targets `totalCount - 1` even when that item is not rendered (it surfaces
|
|
790
|
+
* as `pendingHighlight`); unrendered items count as enabled because their
|
|
791
|
+
* disabled state is unknowable.
|
|
792
|
+
*/
|
|
751
793
|
private findBoundary;
|
|
752
794
|
private totalCount;
|
|
795
|
+
/** Rendered-window offset: `windowStart` in virtual mode, `0` otherwise. */
|
|
796
|
+
private windowOffset;
|
|
797
|
+
/** Item at an absolute index, `null` when outside the rendered window. */
|
|
798
|
+
private itemAt;
|
|
753
799
|
private isDisabledAt;
|
|
754
800
|
private isRendered;
|
|
755
801
|
private scrollActiveIntoView;
|
|
756
802
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxActiveDescendant, never>;
|
|
757
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxActiveDescendant, "[cngxActiveDescendant]", ["cngxActiveDescendant"], { "items": { "alias": "items"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "typeaheadDebounce": { "alias": "typeaheadDebounce"; "required": false; "isSignal": true; }; "autoHighlightFirst": { "alias": "autoHighlightFirst"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "virtualCount": { "alias": "virtualCount"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "highlighted": "highlighted"; }, ["registered"], never, true, never>;
|
|
803
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxActiveDescendant, "[cngxActiveDescendant]", ["cngxActiveDescendant"], { "items": { "alias": "items"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "typeaheadDebounce": { "alias": "typeaheadDebounce"; "required": false; "isSignal": true; }; "autoHighlightFirst": { "alias": "autoHighlightFirst"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "virtualCount": { "alias": "virtualCount"; "required": false; "isSignal": true; }; "windowStart": { "alias": "windowStart"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "highlighted": "highlighted"; }, ["registered"], never, true, never>;
|
|
758
804
|
}
|
|
759
805
|
|
|
760
806
|
/**
|
|
@@ -53,20 +53,20 @@ interface CngxToneGenerator {
|
|
|
53
53
|
* @since 0.1.0
|
|
54
54
|
*/
|
|
55
55
|
interface ToneGeneratorDeps {
|
|
56
|
-
/** Lazy getter for the shared context
|
|
56
|
+
/** Lazy getter for the shared context - called per tone so the engine controls resume. */
|
|
57
57
|
readonly context: () => BaseAudioContext;
|
|
58
58
|
/** Node to connect each tone into (typically the engine's master-volume gain). */
|
|
59
59
|
readonly destination: () => AudioNode;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Signature of the tone-generator factory
|
|
62
|
+
* Signature of the tone-generator factory - the shape an override must match.
|
|
63
63
|
* @category common/audio
|
|
64
64
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
65
65
|
* @since 0.1.0
|
|
66
66
|
*/
|
|
67
67
|
type CngxAudioToneGeneratorFactory = (deps: ToneGeneratorDeps) => CngxToneGenerator;
|
|
68
68
|
/**
|
|
69
|
-
* Pure `OscillatorNode` synthesis
|
|
69
|
+
* Pure `OscillatorNode` synthesis - no audio assets. Each tone is an
|
|
70
70
|
* oscillator through a per-note gain envelope (5 ms attack, 30 ms release)
|
|
71
71
|
* into the engine's master-volume node. The envelope is not decoration: a
|
|
72
72
|
* bare `start()`/`stop()` on a full-amplitude oscillator produces an audible
|
|
@@ -82,7 +82,7 @@ declare const createToneGenerator: CngxAudioToneGeneratorFactory;
|
|
|
82
82
|
/**
|
|
83
83
|
* Swappable tone-generator factory. Defaults to {@link createToneGenerator}
|
|
84
84
|
* (oscillator synthesis). Override to swap in sample-based playback without
|
|
85
|
-
* forking the engine
|
|
85
|
+
* forking the engine - the documented second consumer of this boundary token.
|
|
86
86
|
*
|
|
87
87
|
* @relatedTo createToneGenerator, CNGX_AUDIO_ENGINE_FACTORY
|
|
88
88
|
* @category common/audio
|
|
@@ -92,7 +92,7 @@ declare const createToneGenerator: CngxAudioToneGeneratorFactory;
|
|
|
92
92
|
declare const CNGX_AUDIO_TONE_GENERATOR_FACTORY: InjectionToken<CngxAudioToneGeneratorFactory>;
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
* A named earcon
|
|
95
|
+
* A named earcon - an ordered sequence of tone steps.
|
|
96
96
|
* @category common/audio
|
|
97
97
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/earcons/default-earcons.ts
|
|
98
98
|
* @since 0.1.0
|
|
@@ -124,7 +124,7 @@ interface CngxAudioConfig {
|
|
|
124
124
|
readonly earcons: Readonly<Record<string, EarconConfig>>;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* Library defaults
|
|
127
|
+
* Library defaults - English, browser-native.
|
|
128
128
|
* @category common/audio
|
|
129
129
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
130
130
|
* @since 0.1.0
|
|
@@ -161,7 +161,7 @@ interface CngxAudioFeature {
|
|
|
161
161
|
readonly _apply: (config: Partial<CngxAudioConfig>) => Partial<CngxAudioConfig>;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
* Register global audio defaults. Mirrors `provideFeedback`
|
|
164
|
+
* Register global audio defaults. Mirrors `provideFeedback` - a single small
|
|
165
165
|
* config object folded through `with*` features.
|
|
166
166
|
*
|
|
167
167
|
* ```ts
|
|
@@ -178,7 +178,7 @@ interface CngxAudioFeature {
|
|
|
178
178
|
* Register this at **application bootstrap**. The shared engine is
|
|
179
179
|
* `providedIn: 'root'` and reads its configuration once, when it is first built,
|
|
180
180
|
* so config registered in a lazy route's `providers` never reaches it. To
|
|
181
|
-
* configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders`
|
|
181
|
+
* configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders` - it
|
|
182
182
|
* layers over this one and re-provides the engine so the scope actually applies.
|
|
183
183
|
*
|
|
184
184
|
* @category common/audio
|
|
@@ -232,7 +232,7 @@ declare function withDebounceMs(ms: number): CngxAudioFeature;
|
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* Lifecycle state of the shared `AudioContext`, surfaced for debug panels and
|
|
235
|
-
* headless e2e. Mute is a separate `muted` signal
|
|
235
|
+
* headless e2e. Mute is a separate `muted` signal - this tracks the context,
|
|
236
236
|
* not the play gate.
|
|
237
237
|
* @category common/audio
|
|
238
238
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
@@ -264,7 +264,7 @@ interface CngxAudioEngine {
|
|
|
264
264
|
/**
|
|
265
265
|
* Play a registered earcon by name. Gated + debounced centrally here.
|
|
266
266
|
* `scale` (a `[0, 1]` multiplier over the per-tone default) scales just this
|
|
267
|
-
* play
|
|
267
|
+
* play - used by the directives' per-element `audioVolume` without touching
|
|
268
268
|
* the shared master volume.
|
|
269
269
|
*/
|
|
270
270
|
play(name: string, scale?: number): void;
|
|
@@ -294,7 +294,7 @@ interface CngxAudioEngine {
|
|
|
294
294
|
readonly lastPlayed: Signal<string | null>;
|
|
295
295
|
}
|
|
296
296
|
/**
|
|
297
|
-
* Signature of the engine factory
|
|
297
|
+
* Signature of the engine factory - the shape a telemetry/audit override matches.
|
|
298
298
|
* @category common/audio
|
|
299
299
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
300
300
|
* @since 0.1.0
|
|
@@ -321,7 +321,7 @@ type CngxAudioEngineFactory = (options?: AudioEngineOptions) => CngxAudioEngine;
|
|
|
321
321
|
declare const createAudioEngine: CngxAudioEngineFactory;
|
|
322
322
|
/**
|
|
323
323
|
* Swappable engine factory. Defaults to {@link createAudioEngine}. Override to
|
|
324
|
-
* wrap the engine with telemetry/audit logging
|
|
324
|
+
* wrap the engine with telemetry/audit logging - the documented second consumer
|
|
325
325
|
* of this boundary token.
|
|
326
326
|
*
|
|
327
327
|
* Register the override at **application bootstrap**. The shared engine instance
|
|
@@ -341,7 +341,7 @@ declare const createAudioEngine: CngxAudioEngineFactory;
|
|
|
341
341
|
declare const CNGX_AUDIO_ENGINE_FACTORY: InjectionToken<CngxAudioEngineFactory>;
|
|
342
342
|
|
|
343
343
|
/**
|
|
344
|
-
* The public audio handle
|
|
344
|
+
* The public audio handle - what {@link injectCngxAudio} returns.
|
|
345
345
|
*
|
|
346
346
|
* An alias for {@link CngxAudioEngine} rather than a second interface: the two
|
|
347
347
|
* contracts were member-for-member identical, so a separate declaration was
|
|
@@ -374,7 +374,7 @@ type CngxAudioHandle = CngxAudioEngine;
|
|
|
374
374
|
*/
|
|
375
375
|
declare function injectCngxAudio(): CngxAudioHandle;
|
|
376
376
|
/**
|
|
377
|
-
* Component-scope audio config
|
|
377
|
+
* Component-scope audio config - place in a component's `viewProviders` so a
|
|
378
378
|
* subtree runs its own muted / volume / earcon set, independent of the app-wide
|
|
379
379
|
* `provideCngxAudio(...)`.
|
|
380
380
|
*
|
|
@@ -393,19 +393,19 @@ declare function injectCngxAudio(): CngxAudioHandle;
|
|
|
393
393
|
* registered on a lazy route never reaches it.
|
|
394
394
|
*
|
|
395
395
|
* Features **layer over** the ancestor config (root, or an enclosing scope)
|
|
396
|
-
* rather than replacing it
|
|
396
|
+
* rather than replacing it - the `provideMenuConfigAt` pattern. Scalar fields
|
|
397
397
|
* (`muted`, `volume`, `debounceMs`, `respectReducedMotion`) override; `earcons`
|
|
398
398
|
* merge, so a subtree adds or overrides individual earcons without dropping the
|
|
399
399
|
* app-wide registry.
|
|
400
400
|
*
|
|
401
401
|
* The default shared engine is a single, process-global `AudioContext`; this
|
|
402
402
|
* deliberately re-provides {@link CNGX_AUDIO_ENGINE} so the subtree gets an
|
|
403
|
-
* **isolated engine** reading the scoped {@link CNGX_AUDIO_CONFIG}
|
|
403
|
+
* **isolated engine** reading the scoped {@link CNGX_AUDIO_CONFIG} - a
|
|
404
404
|
* config-only override would be inert against the already-built root engine.
|
|
405
405
|
* That engine owns a **second `AudioContext`**, created lazily on its first play
|
|
406
406
|
* and closed with the component's `DestroyRef`. Browsers cap the number of live
|
|
407
407
|
* `AudioContext`s, so reach for this only when a subtree genuinely needs an
|
|
408
|
-
* independent audio scope
|
|
408
|
+
* independent audio scope - per-element `[audioVolume]` / `[audioDisabled]`
|
|
409
409
|
* cover the common case without a second context.
|
|
410
410
|
*
|
|
411
411
|
* @category common/audio
|
|
@@ -416,7 +416,7 @@ declare function injectCngxAudio(): CngxAudioHandle;
|
|
|
416
416
|
declare function provideCngxAudioAt(...features: CngxAudioFeature[]): Provider[];
|
|
417
417
|
|
|
418
418
|
/**
|
|
419
|
-
* A minimal `EventTarget` surface
|
|
419
|
+
* A minimal `EventTarget` surface - only what the gate installs. Accepting
|
|
420
420
|
* this narrow shape (rather than a concrete `Document`) keeps the factory
|
|
421
421
|
* inject-free and trivially fakeable in a spec.
|
|
422
422
|
* @category common/audio
|
|
@@ -433,7 +433,7 @@ type GestureEventTarget = Pick<EventTarget, 'addEventListener' | 'removeEventLis
|
|
|
433
433
|
interface CngxAutoplayGate {
|
|
434
434
|
/**
|
|
435
435
|
* `true` once a user gesture (or an explicit {@link arm}) has satisfied the
|
|
436
|
-
* browser autoplay policy. Derived from a single gesture event
|
|
436
|
+
* browser autoplay policy. Derived from a single gesture event - never
|
|
437
437
|
* synced from multiple handlers.
|
|
438
438
|
*/
|
|
439
439
|
readonly armed: Signal<boolean>;
|
|
@@ -447,14 +447,14 @@ interface CngxAutoplayGate {
|
|
|
447
447
|
* `AudioContext`, honouring the browser autoplay policy without a permission
|
|
448
448
|
* prompt.
|
|
449
449
|
*
|
|
450
|
-
* Pure factory
|
|
450
|
+
* Pure factory - takes its `target` and `destroyRef` as arguments rather than
|
|
451
451
|
* calling `inject()`, so it composes inside the engine's injection context yet
|
|
452
452
|
* stays testable with a fake target. No DI token: the gate has no independent
|
|
453
453
|
* swap consumer (severity ladder `concern: over-abstraction`), so it ships
|
|
454
454
|
* token-less and the engine owns it.
|
|
455
455
|
*
|
|
456
456
|
* @param deps.target The event target to listen on (typically the `Document`).
|
|
457
|
-
* @param deps.destroyRef Cleanup owner
|
|
457
|
+
* @param deps.destroyRef Cleanup owner - removes any surviving listeners on destroy.
|
|
458
458
|
* @category common/audio
|
|
459
459
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/autoplay-gate/autoplay-gate.ts
|
|
460
460
|
* @since 0.1.0
|
|
@@ -483,13 +483,13 @@ interface CngxDebouncer {
|
|
|
483
483
|
/**
|
|
484
484
|
* Per-name time-window debouncer: suppresses repeated fires of the same earcon
|
|
485
485
|
* within `windowMs`. A separate composed factory rather than logic buried in
|
|
486
|
-
* the engine (Pillar 3). Plain factory, no DI token
|
|
486
|
+
* the engine (Pillar 3). Plain factory, no DI token - `withDebounceMs` covers
|
|
487
487
|
* configuration and there is no independent swap consumer.
|
|
488
488
|
*
|
|
489
489
|
* `windowMs` accepts a getter so a caller whose window is a reactive input can
|
|
490
490
|
* hold ONE debouncer instance for its lifetime and still track changes: the
|
|
491
491
|
* window is resolved per `shouldFire` call, not captured at construction. That
|
|
492
|
-
* keeps the (stateful) debouncer out of the signal graph
|
|
492
|
+
* keeps the (stateful) debouncer out of the signal graph - minting one inside a
|
|
493
493
|
* `computed` would return a fresh object per evaluation and break the equality
|
|
494
494
|
* rule. `CngxAudioPitch` is the getter consumer; the engine passes a number.
|
|
495
495
|
*
|
|
@@ -509,7 +509,7 @@ declare function createDebouncer(options?: {
|
|
|
509
509
|
|
|
510
510
|
/**
|
|
511
511
|
* Event-mode audio binder. Maps DOM events on the host to earcons via the
|
|
512
|
-
* `event:earcon` grammar
|
|
512
|
+
* `event:earcon` grammar - a pure DOM-event-to-sound directive with no state
|
|
513
513
|
* coupling (that is `[cngxAudioStatus]`'s job).
|
|
514
514
|
*
|
|
515
515
|
* ```html
|
|
@@ -574,7 +574,7 @@ declare class CngxAudio {
|
|
|
574
574
|
|
|
575
575
|
/**
|
|
576
576
|
* Status-mode audio bridge. Maps `CngxAsyncState` lifecycle transitions to
|
|
577
|
-
* earcons via the `status:earcon` grammar
|
|
577
|
+
* earcons via the `status:earcon` grammar - the audition counterpart of
|
|
578
578
|
* `CngxToastOn`. Fires only on a real status transition, never on the initial
|
|
579
579
|
* `idle`, and at most once per transition.
|
|
580
580
|
*
|
|
@@ -589,7 +589,7 @@ declare class CngxAudio {
|
|
|
589
589
|
*
|
|
590
590
|
* The state source resolves the same way the feedback bridges do: an explicit
|
|
591
591
|
* `[state]` input wins, otherwise it falls back to an ancestor's
|
|
592
|
-
* `CNGX_STATEFUL`. The grammar keys are lifecycle statuses only
|
|
592
|
+
* `CNGX_STATEFUL`. The grammar keys are lifecycle statuses only - DOM-event
|
|
593
593
|
* keys (`click`, `focus`, …) belong to `[cngxAudio]` and are rejected with a
|
|
594
594
|
* dev-error. `succeeded`/`failed` are accepted as aliases for `success`/`error`.
|
|
595
595
|
*
|
|
@@ -607,7 +607,7 @@ declare class CngxAudioStatus {
|
|
|
607
607
|
/** The `status:earcon` grammar, e.g. `'pending:tap, succeeded:success'`. */
|
|
608
608
|
readonly spec: _angular_core.InputSignal<string>;
|
|
609
609
|
/**
|
|
610
|
-
* The async state to watch. Optional
|
|
610
|
+
* The async state to watch. Optional - when omitted, the bridge falls back to
|
|
611
611
|
* an ancestor `CNGX_STATEFUL`. A bare `[state]` attribute (empty string) is
|
|
612
612
|
* treated as "no input bound" so the fallback kicks in.
|
|
613
613
|
*/
|
|
@@ -616,7 +616,7 @@ declare class CngxAudioStatus {
|
|
|
616
616
|
readonly audioVolume: _angular_core.InputSignal<number | undefined>;
|
|
617
617
|
/** Suppress this element's audio without unbinding. */
|
|
618
618
|
readonly audioDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
619
|
-
/** Effective state
|
|
619
|
+
/** Effective state - explicit input wins over ancestor `CNGX_STATEFUL`. */
|
|
620
620
|
private readonly effectiveState;
|
|
621
621
|
private readonly bindings;
|
|
622
622
|
constructor();
|
|
@@ -637,7 +637,7 @@ interface CngxAudioZoneBinding {
|
|
|
637
637
|
}
|
|
638
638
|
/**
|
|
639
639
|
* Zone-mode audio binder. Plays earcons as the pointer or keyboard focus enters
|
|
640
|
-
* and leaves the host
|
|
640
|
+
* and leaves the host - a spatial complement to `[cngxAudio]`. The record input
|
|
641
641
|
* makes the four zone transitions explicit rather than encoding them in the
|
|
642
642
|
* `event:earcon` string grammar, because the listener set (pointer/focus zone)
|
|
643
643
|
* and the shape (record vs string) are semantically distinct from event-mode.
|
|
@@ -671,7 +671,7 @@ declare class CngxAudioZone {
|
|
|
671
671
|
/**
|
|
672
672
|
* `focusin`/`focusout` bubble, so a zone wrapping focusable children would
|
|
673
673
|
* otherwise fire on every internal tab move. Only a crossing of the zone
|
|
674
|
-
* boundary counts
|
|
674
|
+
* boundary counts - the focus counterpart of pointerenter/pointerleave.
|
|
675
675
|
*/
|
|
676
676
|
protected handleFocusCross(kind: 'focus' | 'blur', event: FocusEvent): void;
|
|
677
677
|
protected handleZone(kind: keyof CngxAudioZoneBinding): void;
|
|
@@ -683,7 +683,7 @@ declare class CngxAudioZone {
|
|
|
683
683
|
* Pitch-mode audio binder. Sonifies a continuous numeric value: each change of
|
|
684
684
|
* `[cngxAudioPitch]` clamps against a fixed domain, linear-scales into an output
|
|
685
685
|
* frequency range, and plays a short tone. Useful for sliders, gauges, and live
|
|
686
|
-
* metrics
|
|
686
|
+
* metrics - the ear tracks a value without looking.
|
|
687
687
|
*
|
|
688
688
|
* ```html
|
|
689
689
|
* <input type="range" min="0" max="100"
|
|
@@ -693,7 +693,7 @@ declare class CngxAudioZone {
|
|
|
693
693
|
* ```
|
|
694
694
|
*
|
|
695
695
|
* The inputs are discrete rather than an options record so `[cngxAudioPitch]`
|
|
696
|
-
* stays a native reactive input
|
|
696
|
+
* stays a native reactive input - passing `[cngxAudioPitch]="volume()"` binds a
|
|
697
697
|
* signal value directly, never a `Signal` smuggled inside a config object. The
|
|
698
698
|
* domain is caller-supplied and fixed; it is never accumulated from observed
|
|
699
699
|
* values, so the directive holds no hidden state. Value-to-frequency is a pure
|
|
@@ -4,7 +4,7 @@ import * as i1 from '@cngx/common/a11y';
|
|
|
4
4
|
import { CngxAsyncState } from '@cngx/core/utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Reason why a card grid is empty
|
|
7
|
+
* Reason why a card grid is empty - drives empty-state template selection.
|
|
8
8
|
*
|
|
9
9
|
* @category common/card
|
|
10
10
|
*/
|
|
@@ -85,8 +85,15 @@ declare class CngxCard {
|
|
|
85
85
|
protected readonly disabledReasonId: string;
|
|
86
86
|
/** @internal */
|
|
87
87
|
protected readonly liveRegionId: string;
|
|
88
|
-
/**
|
|
89
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @internal `aria-describedby` reference, gated on the disabled state it
|
|
90
|
+
* describes. The reason span stays in the DOM, but its id is emitted only
|
|
91
|
+
* while the card is disabled *with* a reason - accname 1.2 §2A traverses a
|
|
92
|
+
* directly-referenced hidden node, so referencing it unconditionally would
|
|
93
|
+
* announce the reason for a state the card is not in (a `disabledReason`
|
|
94
|
+
* set while `disabled` is false would read as "locked").
|
|
95
|
+
*/
|
|
96
|
+
protected readonly describedByIds: _angular_core.Signal<string | null>;
|
|
90
97
|
/** @internal SR live announcement for state changes. */
|
|
91
98
|
protected readonly liveAnnouncement: _angular_core.Signal<"Loading" | "Selected" | "Deselected" | "">;
|
|
92
99
|
/** Emits when an interactive card is clicked or activated via keyboard. */
|