@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
|
@@ -5,7 +5,7 @@ import { injectMediaQuery } from '@cngx/common/layout';
|
|
|
5
5
|
import { CNGX_STATEFUL, createTransitionTracker } from '@cngx/core/utils';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Library defaults
|
|
8
|
+
* Library defaults - English, browser-native.
|
|
9
9
|
* @category common/audio
|
|
10
10
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
11
11
|
* @since 0.1.0
|
|
@@ -45,7 +45,7 @@ function injectAudioConfig() {
|
|
|
45
45
|
/**
|
|
46
46
|
* Fold a `with*` feature list into a single partial config.
|
|
47
47
|
*
|
|
48
|
-
* @internal
|
|
48
|
+
* @internal - shared by {@link provideCngxAudio} and `provideCngxAudioAt`;
|
|
49
49
|
* not exported from `public-api.ts`.
|
|
50
50
|
*/
|
|
51
51
|
function foldAudioFeatures(features) {
|
|
@@ -56,7 +56,7 @@ function foldAudioFeatures(features) {
|
|
|
56
56
|
return config;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Register global audio defaults. Mirrors `provideFeedback`
|
|
59
|
+
* Register global audio defaults. Mirrors `provideFeedback` - a single small
|
|
60
60
|
* config object folded through `with*` features.
|
|
61
61
|
*
|
|
62
62
|
* ```ts
|
|
@@ -73,7 +73,7 @@ function foldAudioFeatures(features) {
|
|
|
73
73
|
* Register this at **application bootstrap**. The shared engine is
|
|
74
74
|
* `providedIn: 'root'` and reads its configuration once, when it is first built,
|
|
75
75
|
* so config registered in a lazy route's `providers` never reaches it. To
|
|
76
|
-
* configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders`
|
|
76
|
+
* configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders` - it
|
|
77
77
|
* layers over this one and re-provides the engine so the scope actually applies.
|
|
78
78
|
*
|
|
79
79
|
* @category common/audio
|
|
@@ -148,14 +148,14 @@ const GESTURE_EVENTS = ['pointerdown', 'keydown', 'touchstart'];
|
|
|
148
148
|
* `AudioContext`, honouring the browser autoplay policy without a permission
|
|
149
149
|
* prompt.
|
|
150
150
|
*
|
|
151
|
-
* Pure factory
|
|
151
|
+
* Pure factory - takes its `target` and `destroyRef` as arguments rather than
|
|
152
152
|
* calling `inject()`, so it composes inside the engine's injection context yet
|
|
153
153
|
* stays testable with a fake target. No DI token: the gate has no independent
|
|
154
154
|
* swap consumer (severity ladder `concern: over-abstraction`), so it ships
|
|
155
155
|
* token-less and the engine owns it.
|
|
156
156
|
*
|
|
157
157
|
* @param deps.target The event target to listen on (typically the `Document`).
|
|
158
|
-
* @param deps.destroyRef Cleanup owner
|
|
158
|
+
* @param deps.destroyRef Cleanup owner - removes any surviving listeners on destroy.
|
|
159
159
|
* @category common/audio
|
|
160
160
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/autoplay-gate/autoplay-gate.ts
|
|
161
161
|
* @since 0.1.0
|
|
@@ -193,13 +193,13 @@ const DEFAULT_WINDOW_MS = 100;
|
|
|
193
193
|
/**
|
|
194
194
|
* Per-name time-window debouncer: suppresses repeated fires of the same earcon
|
|
195
195
|
* within `windowMs`. A separate composed factory rather than logic buried in
|
|
196
|
-
* the engine (Pillar 3). Plain factory, no DI token
|
|
196
|
+
* the engine (Pillar 3). Plain factory, no DI token - `withDebounceMs` covers
|
|
197
197
|
* configuration and there is no independent swap consumer.
|
|
198
198
|
*
|
|
199
199
|
* `windowMs` accepts a getter so a caller whose window is a reactive input can
|
|
200
200
|
* hold ONE debouncer instance for its lifetime and still track changes: the
|
|
201
201
|
* window is resolved per `shouldFire` call, not captured at construction. That
|
|
202
|
-
* keeps the (stateful) debouncer out of the signal graph
|
|
202
|
+
* keeps the (stateful) debouncer out of the signal graph - minting one inside a
|
|
203
203
|
* `computed` would return a fresh object per evaluation and break the equality
|
|
204
204
|
* rule. `CngxAudioPitch` is the getter consumer; the engine passes a number.
|
|
205
205
|
*
|
|
@@ -239,7 +239,7 @@ function createDebouncer(options) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* The six built-in earcons, synthesised entirely from `OscillatorNode`
|
|
242
|
+
* The six built-in earcons, synthesised entirely from `OscillatorNode` - zero
|
|
243
243
|
* audio assets. Plain `as const` (mirrors `CNGX_SELECT_GLYPHS`): tree-shakeable,
|
|
244
244
|
* compile-time exhaustive keys, and NOT exported from `public-api.ts`. The
|
|
245
245
|
* consumer override surface is `withEarcons({...})` and the engine's runtime
|
|
@@ -257,7 +257,7 @@ const CNGX_AUDIO_DEFAULT_EARCONS = {
|
|
|
257
257
|
{ freq: 880, duration: 120 },
|
|
258
258
|
],
|
|
259
259
|
},
|
|
260
|
-
/** Falling sawtooth pair for a failure
|
|
260
|
+
/** Falling sawtooth pair for a failure - deliberately harsher. */
|
|
261
261
|
error: {
|
|
262
262
|
sequence: [
|
|
263
263
|
{ freq: 400, duration: 100, type: 'sawtooth', gain: 0.15 },
|
|
@@ -288,9 +288,9 @@ const CNGX_AUDIO_DEFAULT_EARCONS = {
|
|
|
288
288
|
},
|
|
289
289
|
};
|
|
290
290
|
|
|
291
|
-
/** Attack ramp, seconds
|
|
291
|
+
/** Attack ramp, seconds - lifts gain from 0 so the oscillator start is click-free. */
|
|
292
292
|
const ATTACK_SEC = 0.005;
|
|
293
|
-
/** Release ramp, seconds
|
|
293
|
+
/** Release ramp, seconds - drops gain to 0 before stop so the end is click-free. */
|
|
294
294
|
const RELEASE_SEC = 0.03;
|
|
295
295
|
/** A tone shorter than attack+release cannot host both ramps; clamp up to this floor. */
|
|
296
296
|
const MIN_DURATION_SEC = ATTACK_SEC + RELEASE_SEC;
|
|
@@ -304,7 +304,7 @@ const MIN_DURATION_SEC = ATTACK_SEC + RELEASE_SEC;
|
|
|
304
304
|
*/
|
|
305
305
|
const DEFAULT_TONE_GAIN = 0.2;
|
|
306
306
|
/**
|
|
307
|
-
* Pure `OscillatorNode` synthesis
|
|
307
|
+
* Pure `OscillatorNode` synthesis - no audio assets. Each tone is an
|
|
308
308
|
* oscillator through a per-note gain envelope (5 ms attack, 30 ms release)
|
|
309
309
|
* into the engine's master-volume node. The envelope is not decoration: a
|
|
310
310
|
* bare `start()`/`stop()` on a full-amplitude oscillator produces an audible
|
|
@@ -359,7 +359,7 @@ const createToneGenerator = (deps) => {
|
|
|
359
359
|
/**
|
|
360
360
|
* Swappable tone-generator factory. Defaults to {@link createToneGenerator}
|
|
361
361
|
* (oscillator synthesis). Override to swap in sample-based playback without
|
|
362
|
-
* forking the engine
|
|
362
|
+
* forking the engine - the documented second consumer of this boundary token.
|
|
363
363
|
*
|
|
364
364
|
* @relatedTo createToneGenerator, CNGX_AUDIO_ENGINE_FACTORY
|
|
365
365
|
* @category common/audio
|
|
@@ -454,7 +454,7 @@ const createAudioEngine = (options) => {
|
|
|
454
454
|
function blocked() {
|
|
455
455
|
return muted() || (config.respectReducedMotion && reducedMotion()) || !gate.armed();
|
|
456
456
|
}
|
|
457
|
-
// Volume is communicated to the master node reactively
|
|
457
|
+
// Volume is communicated to the master node reactively - the single writer is
|
|
458
458
|
// setVolume(), but binding through an effect keeps the node in sync from any
|
|
459
459
|
// future volume source too.
|
|
460
460
|
effect(() => {
|
|
@@ -542,7 +542,7 @@ const createAudioEngine = (options) => {
|
|
|
542
542
|
};
|
|
543
543
|
/**
|
|
544
544
|
* Swappable engine factory. Defaults to {@link createAudioEngine}. Override to
|
|
545
|
-
* wrap the engine with telemetry/audit logging
|
|
545
|
+
* wrap the engine with telemetry/audit logging - the documented second consumer
|
|
546
546
|
* of this boundary token.
|
|
547
547
|
*
|
|
548
548
|
* Register the override at **application bootstrap**. The shared engine instance
|
|
@@ -564,9 +564,9 @@ const CNGX_AUDIO_ENGINE_FACTORY = new InjectionToken('CngxAudioEngineFactory', {
|
|
|
564
564
|
/**
|
|
565
565
|
* The shared engine instance. Lazily built from `CNGX_AUDIO_ENGINE_FACTORY` and
|
|
566
566
|
* memoised per injector so every directive shares one `AudioContext`, mute
|
|
567
|
-
* state, and volume. `@internal`
|
|
567
|
+
* state, and volume. `@internal` - the public entry point is {@link injectCngxAudio};
|
|
568
568
|
* consumers override the swappable factory, not this instance anchor. To scope
|
|
569
|
-
* audio to a subtree, use {@link provideCngxAudioAt}
|
|
569
|
+
* audio to a subtree, use {@link provideCngxAudioAt} - it re-provides this token
|
|
570
570
|
* for you alongside the scoped config.
|
|
571
571
|
*
|
|
572
572
|
* @internal
|
|
@@ -597,7 +597,7 @@ function injectCngxAudio() {
|
|
|
597
597
|
return inject(CNGX_AUDIO_ENGINE);
|
|
598
598
|
}
|
|
599
599
|
/**
|
|
600
|
-
* Component-scope audio config
|
|
600
|
+
* Component-scope audio config - place in a component's `viewProviders` so a
|
|
601
601
|
* subtree runs its own muted / volume / earcon set, independent of the app-wide
|
|
602
602
|
* `provideCngxAudio(...)`.
|
|
603
603
|
*
|
|
@@ -616,19 +616,19 @@ function injectCngxAudio() {
|
|
|
616
616
|
* registered on a lazy route never reaches it.
|
|
617
617
|
*
|
|
618
618
|
* Features **layer over** the ancestor config (root, or an enclosing scope)
|
|
619
|
-
* rather than replacing it
|
|
619
|
+
* rather than replacing it - the `provideMenuConfigAt` pattern. Scalar fields
|
|
620
620
|
* (`muted`, `volume`, `debounceMs`, `respectReducedMotion`) override; `earcons`
|
|
621
621
|
* merge, so a subtree adds or overrides individual earcons without dropping the
|
|
622
622
|
* app-wide registry.
|
|
623
623
|
*
|
|
624
624
|
* The default shared engine is a single, process-global `AudioContext`; this
|
|
625
625
|
* deliberately re-provides {@link CNGX_AUDIO_ENGINE} so the subtree gets an
|
|
626
|
-
* **isolated engine** reading the scoped {@link CNGX_AUDIO_CONFIG}
|
|
626
|
+
* **isolated engine** reading the scoped {@link CNGX_AUDIO_CONFIG} - a
|
|
627
627
|
* config-only override would be inert against the already-built root engine.
|
|
628
628
|
* That engine owns a **second `AudioContext`**, created lazily on its first play
|
|
629
629
|
* and closed with the component's `DestroyRef`. Browsers cap the number of live
|
|
630
630
|
* `AudioContext`s, so reach for this only when a subtree genuinely needs an
|
|
631
|
-
* independent audio scope
|
|
631
|
+
* independent audio scope - per-element `[audioVolume]` / `[audioDisabled]`
|
|
632
632
|
* cover the common case without a second context.
|
|
633
633
|
*
|
|
634
634
|
* @category common/audio
|
|
@@ -659,7 +659,7 @@ function provideCngxAudioAt(...features) {
|
|
|
659
659
|
* parsed bindings are identical (the signal-hygiene Equality Rule). Same size,
|
|
660
660
|
* same value per key.
|
|
661
661
|
*
|
|
662
|
-
* @internal
|
|
662
|
+
* @internal - not exported from `public-api.ts`.
|
|
663
663
|
*/
|
|
664
664
|
function sameStringMap(a, b) {
|
|
665
665
|
if (a.size !== b.size) {
|
|
@@ -699,7 +699,7 @@ const DOM_EVENT_SET$1 = new Set(CNGX_AUDIO_DOM_EVENTS);
|
|
|
699
699
|
const LIFECYCLE_SET = new Set(LIFECYCLE_KEYS);
|
|
700
700
|
/**
|
|
701
701
|
* Parse the `event:earcon` grammar (`'click:tap, focus:notification'`) into a
|
|
702
|
-
* DOM-event map. Pure
|
|
702
|
+
* DOM-event map. Pure - no DOM, no `inject()`. Keys are categorised so the
|
|
703
703
|
* directive can dev-warn on unknown earcon keys and, separately, on lifecycle
|
|
704
704
|
* keys that should have used `[cngxAudioStatus]`.
|
|
705
705
|
*/
|
|
@@ -736,7 +736,7 @@ function parseEventBindings(spec) {
|
|
|
736
736
|
|
|
737
737
|
/**
|
|
738
738
|
* Event-mode audio binder. Maps DOM events on the host to earcons via the
|
|
739
|
-
* `event:earcon` grammar
|
|
739
|
+
* `event:earcon` grammar - a pure DOM-event-to-sound directive with no state
|
|
740
740
|
* coupling (that is `[cngxAudioStatus]`'s job).
|
|
741
741
|
*
|
|
742
742
|
* ```html
|
|
@@ -824,7 +824,7 @@ class CngxAudio {
|
|
|
824
824
|
if (this.bound.has(type)) {
|
|
825
825
|
continue;
|
|
826
826
|
}
|
|
827
|
-
// Captures the type only
|
|
827
|
+
// Captures the type only - the earcon is read fresh at fire time, so
|
|
828
828
|
// renaming it in the grammar needs no rebind.
|
|
829
829
|
const listener = () => this.handleEvent(type);
|
|
830
830
|
// Not passive: none of the bindable types are scroll-blocking, so the
|
|
@@ -891,7 +891,7 @@ const CNGX_AUDIO_STATUS_DOM_EVENTS = [
|
|
|
891
891
|
const DOM_EVENT_SET = new Set(CNGX_AUDIO_STATUS_DOM_EVENTS);
|
|
892
892
|
/**
|
|
893
893
|
* Parse the `status:earcon` grammar (`'pending:tap, succeeded:success'`) into a
|
|
894
|
-
* status map. Pure
|
|
894
|
+
* status map. Pure - no DOM, no `inject()`. Keys are categorised so the
|
|
895
895
|
* directive can dev-error on DOM-event keys that should have used `[cngxAudio]`
|
|
896
896
|
* and dev-warn on unknown keys. `succeeded`/`failed` normalise to
|
|
897
897
|
* `success`/`error` so a lookup by the tracker's raw `AsyncStatus` hits.
|
|
@@ -930,7 +930,7 @@ function parseStatusBindings(spec) {
|
|
|
930
930
|
|
|
931
931
|
/**
|
|
932
932
|
* Status-mode audio bridge. Maps `CngxAsyncState` lifecycle transitions to
|
|
933
|
-
* earcons via the `status:earcon` grammar
|
|
933
|
+
* earcons via the `status:earcon` grammar - the audition counterpart of
|
|
934
934
|
* `CngxToastOn`. Fires only on a real status transition, never on the initial
|
|
935
935
|
* `idle`, and at most once per transition.
|
|
936
936
|
*
|
|
@@ -945,7 +945,7 @@ function parseStatusBindings(spec) {
|
|
|
945
945
|
*
|
|
946
946
|
* The state source resolves the same way the feedback bridges do: an explicit
|
|
947
947
|
* `[state]` input wins, otherwise it falls back to an ancestor's
|
|
948
|
-
* `CNGX_STATEFUL`. The grammar keys are lifecycle statuses only
|
|
948
|
+
* `CNGX_STATEFUL`. The grammar keys are lifecycle statuses only - DOM-event
|
|
949
949
|
* keys (`click`, `focus`, …) belong to `[cngxAudio]` and are rejected with a
|
|
950
950
|
* dev-error. `succeeded`/`failed` are accepted as aliases for `success`/`error`.
|
|
951
951
|
*
|
|
@@ -963,7 +963,7 @@ class CngxAudioStatus {
|
|
|
963
963
|
/** The `status:earcon` grammar, e.g. `'pending:tap, succeeded:success'`. */
|
|
964
964
|
spec = input('', { ...(ngDevMode ? { debugName: "spec" } : /* istanbul ignore next */ {}), alias: 'cngxAudioStatus' });
|
|
965
965
|
/**
|
|
966
|
-
* The async state to watch. Optional
|
|
966
|
+
* The async state to watch. Optional - when omitted, the bridge falls back to
|
|
967
967
|
* an ancestor `CNGX_STATEFUL`. A bare `[state]` attribute (empty string) is
|
|
968
968
|
* treated as "no input bound" so the fallback kicks in.
|
|
969
969
|
*/
|
|
@@ -972,7 +972,7 @@ class CngxAudioStatus {
|
|
|
972
972
|
audioVolume = input(undefined, ...(ngDevMode ? [{ debugName: "audioVolume" }] : /* istanbul ignore next */ []));
|
|
973
973
|
/** Suppress this element's audio without unbinding. */
|
|
974
974
|
audioDisabled = input(false, { ...(ngDevMode ? { debugName: "audioDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
975
|
-
/** Effective state
|
|
975
|
+
/** Effective state - explicit input wins over ancestor `CNGX_STATEFUL`. */
|
|
976
976
|
effectiveState = computed(() => this.state() ?? this.statefulFallback?.state, ...(ngDevMode ? [{ debugName: "effectiveState" }] : /* istanbul ignore next */ []));
|
|
977
977
|
bindings = computed(() => parseStatusBindings(this.spec()).bindings, { ...(ngDevMode ? { debugName: "bindings" } : /* istanbul ignore next */ {}), equal: sameStringMap });
|
|
978
978
|
constructor() {
|
|
@@ -1021,7 +1021,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1021
1021
|
|
|
1022
1022
|
/**
|
|
1023
1023
|
* Zone-mode audio binder. Plays earcons as the pointer or keyboard focus enters
|
|
1024
|
-
* and leaves the host
|
|
1024
|
+
* and leaves the host - a spatial complement to `[cngxAudio]`. The record input
|
|
1025
1025
|
* makes the four zone transitions explicit rather than encoding them in the
|
|
1026
1026
|
* `event:earcon` string grammar, because the listener set (pointer/focus zone)
|
|
1027
1027
|
* and the shape (record vs string) are semantically distinct from event-mode.
|
|
@@ -1055,7 +1055,7 @@ class CngxAudioZone {
|
|
|
1055
1055
|
/**
|
|
1056
1056
|
* `focusin`/`focusout` bubble, so a zone wrapping focusable children would
|
|
1057
1057
|
* otherwise fire on every internal tab move. Only a crossing of the zone
|
|
1058
|
-
* boundary counts
|
|
1058
|
+
* boundary counts - the focus counterpart of pointerenter/pointerleave.
|
|
1059
1059
|
*/
|
|
1060
1060
|
handleFocusCross(kind, event) {
|
|
1061
1061
|
if (this.host.nativeElement.contains(event.relatedTarget)) {
|
|
@@ -1089,13 +1089,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1089
1089
|
}]
|
|
1090
1090
|
}], propDecorators: { zone: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxAudioZone", required: false }] }], audioVolume: [{ type: i0.Input, args: [{ isSignal: true, alias: "audioVolume", required: false }] }], audioDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "audioDisabled", required: false }] }] } });
|
|
1091
1091
|
|
|
1092
|
-
/** Throttle key
|
|
1092
|
+
/** Throttle key - the pitch directive plays a single ad-hoc voice. */
|
|
1093
1093
|
const PITCH_VOICE = 'pitch';
|
|
1094
1094
|
/**
|
|
1095
1095
|
* Pitch-mode audio binder. Sonifies a continuous numeric value: each change of
|
|
1096
1096
|
* `[cngxAudioPitch]` clamps against a fixed domain, linear-scales into an output
|
|
1097
1097
|
* frequency range, and plays a short tone. Useful for sliders, gauges, and live
|
|
1098
|
-
* metrics
|
|
1098
|
+
* metrics - the ear tracks a value without looking.
|
|
1099
1099
|
*
|
|
1100
1100
|
* ```html
|
|
1101
1101
|
* <input type="range" min="0" max="100"
|
|
@@ -1105,7 +1105,7 @@ const PITCH_VOICE = 'pitch';
|
|
|
1105
1105
|
* ```
|
|
1106
1106
|
*
|
|
1107
1107
|
* The inputs are discrete rather than an options record so `[cngxAudioPitch]`
|
|
1108
|
-
* stays a native reactive input
|
|
1108
|
+
* stays a native reactive input - passing `[cngxAudioPitch]="volume()"` binds a
|
|
1109
1109
|
* signal value directly, never a `Signal` smuggled inside a config object. The
|
|
1110
1110
|
* domain is caller-supplied and fixed; it is never accumulated from observed
|
|
1111
1111
|
* values, so the directive holds no hidden state. Value-to-frequency is a pure
|
|
@@ -1192,7 +1192,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1192
1192
|
* Web Audio adapter: zero asset weight (earcons synthesised from
|
|
1193
1193
|
* `OscillatorNode`), a single shared `AudioContext` behind the engine, and
|
|
1194
1194
|
* the `provideCngxAudio(...)` aggregator. Mirrors the shape of the sibling
|
|
1195
|
-
* feedback primitives (`CngxRipple`, `CngxPressable`, `CngxSpeak`)
|
|
1195
|
+
* feedback primitives (`CngxRipple`, `CngxPressable`, `CngxSpeak`) - the
|
|
1196
1196
|
* fourth sense, audition, as composable atoms.
|
|
1197
1197
|
*/
|
|
1198
1198
|
// Handle + component-scope provider
|