@cngx/common 0.1.0-rc.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/README.md +15 -2
- package/button/README.md +258 -0
- package/command/README.md +42 -2
- package/data/README.md +15 -12
- package/fesm2022/cngx-common-a11y.mjs +1076 -319
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +99 -77
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-button.mjs +1084 -0
- package/fesm2022/cngx-common-button.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +138 -78
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +799 -327
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +101 -25
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +861 -423
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +198 -160
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +693 -329
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7303 -2774
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2174 -442
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-menu-button.mjs +557 -0
- package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +2109 -557
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +548 -419
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +442 -331
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +44 -71
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +10 -10
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +30 -19
- package/layout/README.md +17 -1
- package/menu-button/README.md +234 -0
- package/package.json +31 -8
- package/popover/README.md +81 -4
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +96 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +5 -5
- package/theming/components/cngx-accordion.css +36 -7
- package/theming/components/cngx-async.css +185 -37
- package/theming/components/cngx-backdrop.css +3 -1
- package/theming/components/cngx-badge.css +20 -5
- package/theming/components/cngx-bottom-sheet.css +2 -0
- package/theming/components/cngx-breadcrumb.css +3 -1
- package/theming/components/cngx-button-group.css +325 -0
- package/theming/components/cngx-button-toggle.css +55 -23
- package/theming/components/cngx-button.css +975 -0
- package/theming/components/cngx-data-grid.css +2 -0
- package/theming/components/cngx-dialog.css +3 -1
- package/theming/components/cngx-divider.css +24 -9
- package/theming/components/cngx-drawer.css +153 -0
- package/theming/components/cngx-icon-glyph.css +76 -0
- package/theming/components/cngx-listbox.css +79 -25
- package/theming/components/cngx-menu.css +112 -52
- package/theming/components/cngx-nav.css +1220 -0
- package/theming/components/cngx-popover-sheet.css +434 -0
- package/theming/components/cngx-popover.css +37 -9
- package/theming/components/cngx-recycler-placeholder.css +2 -0
- package/theming/components/cngx-ripple.css +74 -16
- package/theming/components/cngx-sidebar.css +71 -0
- package/theming/components/cngx-slider.css +3 -1
- package/theming/components/cngx-tooltip.css +2 -0
- package/timeline/README.md +2 -2
- package/types/cngx-common-a11y.d.ts +488 -112
- package/types/cngx-common-audio.d.ts +60 -88
- package/types/cngx-common-button.d.ts +698 -0
- package/types/cngx-common-card.d.ts +104 -78
- package/types/cngx-common-chart.d.ts +677 -389
- package/types/cngx-common-command.d.ts +55 -41
- package/types/cngx-common-data.d.ts +506 -360
- package/types/cngx-common-dialog.d.ts +94 -127
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4383 -1721
- package/types/cngx-common-layout.d.ts +1399 -288
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +990 -268
- package/types/cngx-common-stepper.d.ts +374 -465
- package/types/cngx-common-tabs.d.ts +309 -403
- package/types/cngx-common-timeline.d.ts +50 -109
|
@@ -4,9 +4,8 @@ import { CngxAsyncState } from '@cngx/core/utils';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Per-tone synthesis options.
|
|
7
|
-
* @category common/audio
|
|
8
7
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
9
|
-
* @since 0.
|
|
8
|
+
* @since 0.3.0
|
|
10
9
|
*/
|
|
11
10
|
interface ToneOptions {
|
|
12
11
|
/** Oscillator waveform. Default `'sine'`. */
|
|
@@ -18,9 +17,8 @@ interface ToneOptions {
|
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* One step of an earcon sequence.
|
|
21
|
-
* @category common/audio
|
|
22
20
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
23
|
-
* @since 0.
|
|
21
|
+
* @since 0.3.0
|
|
24
22
|
*/
|
|
25
23
|
interface ToneStep {
|
|
26
24
|
/** Frequency in Hz. */
|
|
@@ -36,9 +34,8 @@ interface ToneStep {
|
|
|
36
34
|
}
|
|
37
35
|
/**
|
|
38
36
|
* Public handle returned by {@link createToneGenerator}.
|
|
39
|
-
* @category common/audio
|
|
40
37
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
41
|
-
* @since 0.
|
|
38
|
+
* @since 0.3.0
|
|
42
39
|
*/
|
|
43
40
|
interface CngxToneGenerator {
|
|
44
41
|
/** Play a single tone of `durationMs` at `freq`. */
|
|
@@ -48,9 +45,8 @@ interface CngxToneGenerator {
|
|
|
48
45
|
}
|
|
49
46
|
/**
|
|
50
47
|
* Dependencies handed to the tone-generator factory by the engine.
|
|
51
|
-
* @category common/audio
|
|
52
48
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
53
|
-
* @since 0.
|
|
49
|
+
* @since 0.3.0
|
|
54
50
|
*/
|
|
55
51
|
interface ToneGeneratorDeps {
|
|
56
52
|
/** Lazy getter for the shared context - called per tone so the engine controls resume. */
|
|
@@ -60,9 +56,8 @@ interface ToneGeneratorDeps {
|
|
|
60
56
|
}
|
|
61
57
|
/**
|
|
62
58
|
* Signature of the tone-generator factory - the shape an override must match.
|
|
63
|
-
* @category common/audio
|
|
64
59
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
65
|
-
* @since 0.
|
|
60
|
+
* @since 0.3.0
|
|
66
61
|
*/
|
|
67
62
|
type CngxAudioToneGeneratorFactory = (deps: ToneGeneratorDeps) => CngxToneGenerator;
|
|
68
63
|
/**
|
|
@@ -74,9 +69,8 @@ type CngxAudioToneGeneratorFactory = (deps: ToneGeneratorDeps) => CngxToneGenera
|
|
|
74
69
|
*
|
|
75
70
|
* `create*` pure factory (no `inject()`), so it composes inside the engine and
|
|
76
71
|
* runs against the shared `createAudioContextMock` in specs.
|
|
77
|
-
* @category common/audio
|
|
78
72
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
79
|
-
* @since 0.
|
|
73
|
+
* @since 0.3.0
|
|
80
74
|
*/
|
|
81
75
|
declare const createToneGenerator: CngxAudioToneGeneratorFactory;
|
|
82
76
|
/**
|
|
@@ -85,17 +79,15 @@ declare const createToneGenerator: CngxAudioToneGeneratorFactory;
|
|
|
85
79
|
* forking the engine - the documented second consumer of this boundary token.
|
|
86
80
|
*
|
|
87
81
|
* @relatedTo createToneGenerator, CNGX_AUDIO_ENGINE_FACTORY
|
|
88
|
-
* @category common/audio
|
|
89
82
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/tone-generator/tone-generator.ts
|
|
90
|
-
* @since 0.
|
|
83
|
+
* @since 0.3.0
|
|
91
84
|
*/
|
|
92
85
|
declare const CNGX_AUDIO_TONE_GENERATOR_FACTORY: InjectionToken<CngxAudioToneGeneratorFactory>;
|
|
93
86
|
|
|
94
87
|
/**
|
|
95
88
|
* A named earcon - an ordered sequence of tone steps.
|
|
96
|
-
* @category common/audio
|
|
97
89
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/earcons/default-earcons.ts
|
|
98
|
-
* @since 0.
|
|
90
|
+
* @since 0.3.0
|
|
99
91
|
*/
|
|
100
92
|
interface EarconConfig {
|
|
101
93
|
/** The tones that make up the earcon, played back-to-back. */
|
|
@@ -107,9 +99,8 @@ interface EarconConfig {
|
|
|
107
99
|
* with `with*` features (see the provider section below). Consumers never
|
|
108
100
|
* construct this object directly.
|
|
109
101
|
*
|
|
110
|
-
* @category common/audio
|
|
111
102
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
112
|
-
* @since 0.
|
|
103
|
+
* @since 0.3.0
|
|
113
104
|
*/
|
|
114
105
|
interface CngxAudioConfig {
|
|
115
106
|
/** Start muted. Default `false`. */
|
|
@@ -125,9 +116,8 @@ interface CngxAudioConfig {
|
|
|
125
116
|
}
|
|
126
117
|
/**
|
|
127
118
|
* Library defaults - English, browser-native.
|
|
128
|
-
* @category common/audio
|
|
129
119
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
130
|
-
* @since 0.
|
|
120
|
+
* @since 0.3.0
|
|
131
121
|
*/
|
|
132
122
|
declare const CNGX_AUDIO_DEFAULTS: CngxAudioConfig;
|
|
133
123
|
/**
|
|
@@ -135,26 +125,23 @@ declare const CNGX_AUDIO_DEFAULTS: CngxAudioConfig;
|
|
|
135
125
|
* `provideCngxAudio(...)`. Read the resolved, defaults-merged config with
|
|
136
126
|
* {@link injectAudioConfig}.
|
|
137
127
|
*
|
|
138
|
-
* @category common/audio
|
|
139
128
|
* @relatedTo provideCngxAudio, injectAudioConfig
|
|
140
129
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
141
|
-
* @since 0.
|
|
130
|
+
* @since 0.3.0
|
|
142
131
|
*/
|
|
143
132
|
declare const CNGX_AUDIO_CONFIG: InjectionToken<Partial<CngxAudioConfig>>;
|
|
144
133
|
/**
|
|
145
134
|
* Resolve the effective audio config: library defaults merged with whatever
|
|
146
135
|
* `provideCngxAudio(...)` contributed. Runs in an injection context.
|
|
147
136
|
*
|
|
148
|
-
* @category common/audio
|
|
149
137
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
150
|
-
* @since 0.
|
|
138
|
+
* @since 0.3.0
|
|
151
139
|
*/
|
|
152
140
|
declare function injectAudioConfig(): CngxAudioConfig;
|
|
153
141
|
/**
|
|
154
142
|
* A feature returned by a `with*` helper, folded into the config by {@link provideCngxAudio}.
|
|
155
|
-
* @category common/audio
|
|
156
143
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
157
|
-
* @since 0.
|
|
144
|
+
* @since 0.3.0
|
|
158
145
|
*/
|
|
159
146
|
interface CngxAudioFeature {
|
|
160
147
|
/** @internal */
|
|
@@ -181,52 +168,46 @@ interface CngxAudioFeature {
|
|
|
181
168
|
* configure a subtree, use `provideCngxAudioAt(...)` in `viewProviders` - it
|
|
182
169
|
* layers over this one and re-provides the engine so the scope actually applies.
|
|
183
170
|
*
|
|
184
|
-
* @category common/audio
|
|
185
171
|
* @relatedTo provideCngxAudioAt, injectAudioConfig
|
|
186
172
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
187
|
-
* @since 0.
|
|
173
|
+
* @since 0.3.0
|
|
188
174
|
*/
|
|
189
175
|
declare function provideCngxAudio(...features: CngxAudioFeature[]): EnvironmentProviders;
|
|
190
176
|
/**
|
|
191
177
|
* Register or override earcons globally. Merged over the six built-ins and over
|
|
192
178
|
* any earlier `withEarcons` in the same `provideCngxAudio` call.
|
|
193
179
|
*
|
|
194
|
-
* @category common/audio
|
|
195
180
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
196
|
-
* @since 0.
|
|
181
|
+
* @since 0.3.0
|
|
197
182
|
*/
|
|
198
183
|
declare function withEarcons(earcons: Record<string, EarconConfig>): CngxAudioFeature;
|
|
199
184
|
/**
|
|
200
185
|
* Set the master volume in `[0, 1]`.
|
|
201
186
|
*
|
|
202
|
-
* @category common/audio
|
|
203
187
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
204
|
-
* @since 0.
|
|
188
|
+
* @since 0.3.0
|
|
205
189
|
*/
|
|
206
190
|
declare function withVolume(volume: number): CngxAudioFeature;
|
|
207
191
|
/**
|
|
208
192
|
* Start muted (or explicitly unmuted with `withMuted(false)`).
|
|
209
193
|
*
|
|
210
|
-
* @category common/audio
|
|
211
194
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
212
|
-
* @since 0.
|
|
195
|
+
* @since 0.3.0
|
|
213
196
|
*/
|
|
214
197
|
declare function withMuted(muted?: boolean): CngxAudioFeature;
|
|
215
198
|
/**
|
|
216
199
|
* Toggle the `prefers-reduced-motion` mute gate. `true` by default in the
|
|
217
200
|
* library; pass `false` to keep audio playing under reduced-motion.
|
|
218
201
|
*
|
|
219
|
-
* @category common/audio
|
|
220
202
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
221
|
-
* @since 0.
|
|
203
|
+
* @since 0.3.0
|
|
222
204
|
*/
|
|
223
205
|
declare function withRespectReducedMotion(respect: boolean): CngxAudioFeature;
|
|
224
206
|
/**
|
|
225
207
|
* Set the same-name suppression window in milliseconds.
|
|
226
208
|
*
|
|
227
|
-
* @category common/audio
|
|
228
209
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/config/audio-config.ts
|
|
229
|
-
* @since 0.
|
|
210
|
+
* @since 0.3.0
|
|
230
211
|
*/
|
|
231
212
|
declare function withDebounceMs(ms: number): CngxAudioFeature;
|
|
232
213
|
|
|
@@ -234,16 +215,14 @@ declare function withDebounceMs(ms: number): CngxAudioFeature;
|
|
|
234
215
|
* Lifecycle state of the shared `AudioContext`, surfaced for debug panels and
|
|
235
216
|
* headless e2e. Mute is a separate `muted` signal - this tracks the context,
|
|
236
217
|
* not the play gate.
|
|
237
|
-
* @category common/audio
|
|
238
218
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
239
|
-
* @since 0.
|
|
219
|
+
* @since 0.3.0
|
|
240
220
|
*/
|
|
241
221
|
type AudioStatus = 'idle' | 'suspended' | 'running' | 'closed' | 'unsupported';
|
|
242
222
|
/**
|
|
243
223
|
* Advanced/testing seam for {@link createAudioEngine}.
|
|
244
|
-
* @category common/audio
|
|
245
224
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
246
|
-
* @since 0.
|
|
225
|
+
* @since 0.3.0
|
|
247
226
|
*/
|
|
248
227
|
interface AudioEngineOptions {
|
|
249
228
|
/**
|
|
@@ -256,9 +235,8 @@ interface AudioEngineOptions {
|
|
|
256
235
|
/**
|
|
257
236
|
* The audio engine surface. A single write path for `muted` / `volume`
|
|
258
237
|
* (no `mute()`/`unmute()` pair); every state change is a reactive `Signal`.
|
|
259
|
-
* @category common/audio
|
|
260
238
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
261
|
-
* @since 0.
|
|
239
|
+
* @since 0.3.0
|
|
262
240
|
*/
|
|
263
241
|
interface CngxAudioEngine {
|
|
264
242
|
/**
|
|
@@ -295,9 +273,8 @@ interface CngxAudioEngine {
|
|
|
295
273
|
}
|
|
296
274
|
/**
|
|
297
275
|
* Signature of the engine factory - the shape a telemetry/audit override matches.
|
|
298
|
-
* @category common/audio
|
|
299
276
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
300
|
-
* @since 0.
|
|
277
|
+
* @since 0.3.0
|
|
301
278
|
*/
|
|
302
279
|
type CngxAudioEngineFactory = (options?: AudioEngineOptions) => CngxAudioEngine;
|
|
303
280
|
/**
|
|
@@ -314,9 +291,8 @@ type CngxAudioEngineFactory = (options?: AudioEngineOptions) => CngxAudioEngine;
|
|
|
314
291
|
* tone-generator factory, and the reduced-motion query). The engine instance is
|
|
315
292
|
* resolved through {@link CNGX_AUDIO_ENGINE_FACTORY}; scope it to a subtree with
|
|
316
293
|
* `provideCngxAudioAt(...)` rather than calling this directly.
|
|
317
|
-
* @category common/audio
|
|
318
294
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
319
|
-
* @since 0.
|
|
295
|
+
* @since 0.3.0
|
|
320
296
|
*/
|
|
321
297
|
declare const createAudioEngine: CngxAudioEngineFactory;
|
|
322
298
|
/**
|
|
@@ -334,9 +310,8 @@ declare const createAudioEngine: CngxAudioEngineFactory;
|
|
|
334
310
|
* the library baseline. Both are exported from `@cngx/common/audio`.
|
|
335
311
|
*
|
|
336
312
|
* @relatedTo createAudioEngine, injectCngxAudio, injectAudioConfig
|
|
337
|
-
* @category common/audio
|
|
338
313
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/engine/audio-engine.ts
|
|
339
|
-
* @since 0.
|
|
314
|
+
* @since 0.3.0
|
|
340
315
|
*/
|
|
341
316
|
declare const CNGX_AUDIO_ENGINE_FACTORY: InjectionToken<CngxAudioEngineFactory>;
|
|
342
317
|
|
|
@@ -349,9 +324,8 @@ declare const CNGX_AUDIO_ENGINE_FACTORY: InjectionToken<CngxAudioEngineFactory>;
|
|
|
349
324
|
* call sites (`const audio: CngxAudioHandle = injectCngxAudio()`), and because
|
|
350
325
|
* the engine contract is the one an override implements.
|
|
351
326
|
*
|
|
352
|
-
* @category common/audio
|
|
353
327
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/inject-audio.ts
|
|
354
|
-
* @since 0.
|
|
328
|
+
* @since 0.3.0
|
|
355
329
|
*/
|
|
356
330
|
type CngxAudioHandle = CngxAudioEngine;
|
|
357
331
|
/**
|
|
@@ -368,9 +342,8 @@ type CngxAudioHandle = CngxAudioEngine;
|
|
|
368
342
|
* }
|
|
369
343
|
* ```
|
|
370
344
|
*
|
|
371
|
-
* @category common/audio
|
|
372
345
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/inject-audio.ts
|
|
373
|
-
* @since 0.
|
|
346
|
+
* @since 0.3.0
|
|
374
347
|
*/
|
|
375
348
|
declare function injectCngxAudio(): CngxAudioHandle;
|
|
376
349
|
/**
|
|
@@ -408,10 +381,9 @@ declare function injectCngxAudio(): CngxAudioHandle;
|
|
|
408
381
|
* independent audio scope - per-element `[audioVolume]` / `[audioDisabled]`
|
|
409
382
|
* cover the common case without a second context.
|
|
410
383
|
*
|
|
411
|
-
* @category common/audio
|
|
412
384
|
* @relatedTo provideCngxAudio, injectCngxAudio
|
|
413
385
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/inject-audio.ts
|
|
414
|
-
* @since 0.
|
|
386
|
+
* @since 0.3.0
|
|
415
387
|
*/
|
|
416
388
|
declare function provideCngxAudioAt(...features: CngxAudioFeature[]): Provider[];
|
|
417
389
|
|
|
@@ -419,16 +391,14 @@ declare function provideCngxAudioAt(...features: CngxAudioFeature[]): Provider[]
|
|
|
419
391
|
* A minimal `EventTarget` surface - only what the gate installs. Accepting
|
|
420
392
|
* this narrow shape (rather than a concrete `Document`) keeps the factory
|
|
421
393
|
* inject-free and trivially fakeable in a spec.
|
|
422
|
-
* @category common/audio
|
|
423
394
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/autoplay-gate/autoplay-gate.ts
|
|
424
|
-
* @since 0.
|
|
395
|
+
* @since 0.3.0
|
|
425
396
|
*/
|
|
426
397
|
type GestureEventTarget = Pick<EventTarget, 'addEventListener' | 'removeEventListener'>;
|
|
427
398
|
/**
|
|
428
399
|
* Public handle returned by {@link createAutoplayGate}.
|
|
429
|
-
* @category common/audio
|
|
430
400
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/autoplay-gate/autoplay-gate.ts
|
|
431
|
-
* @since 0.
|
|
401
|
+
* @since 0.3.0
|
|
432
402
|
*/
|
|
433
403
|
interface CngxAutoplayGate {
|
|
434
404
|
/**
|
|
@@ -455,9 +425,8 @@ interface CngxAutoplayGate {
|
|
|
455
425
|
*
|
|
456
426
|
* @param deps.target The event target to listen on (typically the `Document`).
|
|
457
427
|
* @param deps.destroyRef Cleanup owner - removes any surviving listeners on destroy.
|
|
458
|
-
* @category common/audio
|
|
459
428
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/autoplay-gate/autoplay-gate.ts
|
|
460
|
-
* @since 0.
|
|
429
|
+
* @since 0.3.0
|
|
461
430
|
*/
|
|
462
431
|
declare function createAutoplayGate(deps: {
|
|
463
432
|
readonly target: GestureEventTarget;
|
|
@@ -466,9 +435,8 @@ declare function createAutoplayGate(deps: {
|
|
|
466
435
|
|
|
467
436
|
/**
|
|
468
437
|
* Public handle returned by {@link createDebouncer}.
|
|
469
|
-
* @category common/audio
|
|
470
438
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/debouncer/debouncer.ts
|
|
471
|
-
* @since 0.
|
|
439
|
+
* @since 0.3.0
|
|
472
440
|
*/
|
|
473
441
|
interface CngxDebouncer {
|
|
474
442
|
/**
|
|
@@ -498,9 +466,8 @@ interface CngxDebouncer {
|
|
|
498
466
|
*
|
|
499
467
|
* @param options.windowMs Suppression window, or a getter for it. `<= 0` disables debouncing. Default `100`.
|
|
500
468
|
* @param options.now Clock source in ms. Default `Date.now`.
|
|
501
|
-
* @category common/audio
|
|
502
469
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/debouncer/debouncer.ts
|
|
503
|
-
* @since 0.
|
|
470
|
+
* @since 0.3.0
|
|
504
471
|
*/
|
|
505
472
|
declare function createDebouncer(options?: {
|
|
506
473
|
readonly windowMs?: number | (() => number);
|
|
@@ -534,17 +501,16 @@ declare function createDebouncer(options?: {
|
|
|
534
501
|
* cost alone. Either way the engine's `lastPlayed` and `status` are signals, so
|
|
535
502
|
* anything a template binds to them stays current.
|
|
536
503
|
*
|
|
537
|
-
* @category common/audio
|
|
538
|
-
* @docsKind primary
|
|
539
504
|
* @wcag AA
|
|
540
505
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/event-mode/audio.directive.ts
|
|
541
|
-
* @since 0.
|
|
506
|
+
* @since 0.3.0
|
|
542
507
|
* @relatedTo injectCngxAudio, provideCngxAudio, CngxAudioStatus
|
|
543
|
-
* <example-url
|
|
544
|
-
* <example-url
|
|
545
|
-
* <example-url
|
|
546
|
-
* <example-url
|
|
547
|
-
* <example-url
|
|
508
|
+
* <example-url>/#/common/audio/event-mode/basic</example-url>
|
|
509
|
+
* <example-url>/#/common/audio/event-mode/custom-earcons</example-url>
|
|
510
|
+
* <example-url>/#/common/audio/event-mode/earcon-palette</example-url>
|
|
511
|
+
* <example-url>/#/common/audio/event-mode/form-feedback</example-url>
|
|
512
|
+
* <example-url>/#/common/audio/event-mode/hover-and-focus</example-url>
|
|
513
|
+
* @axis level atom
|
|
548
514
|
*/
|
|
549
515
|
declare class CngxAudio {
|
|
550
516
|
private readonly audio;
|
|
@@ -593,13 +559,12 @@ declare class CngxAudio {
|
|
|
593
559
|
* keys (`click`, `focus`, …) belong to `[cngxAudio]` and are rejected with a
|
|
594
560
|
* dev-error. `succeeded`/`failed` are accepted as aliases for `success`/`error`.
|
|
595
561
|
*
|
|
596
|
-
* @category common/audio
|
|
597
|
-
* @docsKind primary
|
|
598
562
|
* @wcag AA
|
|
599
563
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/status-mode/audio-status.directive.ts
|
|
600
|
-
* @since 0.
|
|
564
|
+
* @since 0.3.0
|
|
601
565
|
* @relatedTo CngxAudio, injectCngxAudio, CngxAsyncClick
|
|
602
|
-
* <example-url
|
|
566
|
+
* <example-url>/#/common/audio/status-bridge/async-click</example-url>
|
|
567
|
+
* @axis level atom
|
|
603
568
|
*/
|
|
604
569
|
declare class CngxAudioStatus {
|
|
605
570
|
private readonly audio;
|
|
@@ -651,13 +616,12 @@ interface CngxAudioZoneBinding {
|
|
|
651
616
|
* `[audioDisabled]`, muted, reduced-motion-gated, autoplay-not-armed, or still
|
|
652
617
|
* within the debounce window. `[audioVolume]` scales just this element's plays.
|
|
653
618
|
*
|
|
654
|
-
* @category common/audio
|
|
655
|
-
* @docsKind primary
|
|
656
619
|
* @wcag AA
|
|
657
620
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/zone-mode/audio-zone.directive.ts
|
|
658
|
-
* @since 0.
|
|
621
|
+
* @since 0.3.0
|
|
659
622
|
* @relatedTo CngxAudio, injectCngxAudio
|
|
660
|
-
* <example-url
|
|
623
|
+
* <example-url>/#/common/audio/zone/enter-leave</example-url>
|
|
624
|
+
* @axis level atom
|
|
661
625
|
*/
|
|
662
626
|
declare class CngxAudioZone {
|
|
663
627
|
private readonly audio;
|
|
@@ -699,13 +663,12 @@ declare class CngxAudioZone {
|
|
|
699
663
|
* values, so the directive holds no hidden state. Value-to-frequency is a pure
|
|
700
664
|
* derivation; rapid sweeps are throttled through the shared `createDebouncer`.
|
|
701
665
|
*
|
|
702
|
-
* @category common/audio
|
|
703
|
-
* @docsKind primary
|
|
704
666
|
* @wcag AA
|
|
705
667
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/audio/pitch-mode/audio-pitch.directive.ts
|
|
706
|
-
* @since 0.
|
|
668
|
+
* @since 0.3.0
|
|
707
669
|
* @relatedTo CngxAudio, injectCngxAudio
|
|
708
|
-
* <example-url
|
|
670
|
+
* <example-url>/#/common/audio/pitch/slider</example-url>
|
|
671
|
+
* @axis level atom
|
|
709
672
|
*/
|
|
710
673
|
declare class CngxAudioPitch {
|
|
711
674
|
private readonly audio;
|
|
@@ -713,7 +676,12 @@ declare class CngxAudioPitch {
|
|
|
713
676
|
readonly value: _angular_core.InputSignal<number>;
|
|
714
677
|
/** Output frequency range `[lo, hi]` in Hz. Default `[220, 880]`. */
|
|
715
678
|
readonly pitchRange: _angular_core.InputSignal<[number, number]>;
|
|
716
|
-
/**
|
|
679
|
+
/**
|
|
680
|
+
* Fixed input domain `[lo, hi]` the value is clamped against; `lo > hi`
|
|
681
|
+
* inverts the mapping. An empty domain (`lo === hi`) or one with a `NaN` /
|
|
682
|
+
* infinite end plays the range low for every value and warns in dev mode
|
|
683
|
+
* ([`CNGX1069`](/error-codes/cngx1069.md)).
|
|
684
|
+
*/
|
|
717
685
|
readonly pitchDomain: _angular_core.InputSignal<[number, number]>;
|
|
718
686
|
/** Tone duration in ms. Default `120`. */
|
|
719
687
|
readonly pitchDurationMs: _angular_core.InputSignal<number>;
|
|
@@ -726,7 +694,11 @@ declare class CngxAudioPitch {
|
|
|
726
694
|
private readonly debouncer;
|
|
727
695
|
private readonly transition;
|
|
728
696
|
constructor();
|
|
729
|
-
/**
|
|
697
|
+
/**
|
|
698
|
+
* Clamp to the domain, then linear-scale into the frequency range. The
|
|
699
|
+
* interpolation runs against the declared pair, so an inverted domain maps
|
|
700
|
+
* `lo` to the range low and `hi` to the range high.
|
|
701
|
+
*/
|
|
730
702
|
private scale;
|
|
731
703
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAudioPitch, never>;
|
|
732
704
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxAudioPitch, "[cngxAudioPitch]", ["cngxAudioPitch"], { "value": { "alias": "cngxAudioPitch"; "required": true; "isSignal": true; }; "pitchRange": { "alias": "pitchRange"; "required": false; "isSignal": true; }; "pitchDomain": { "alias": "pitchDomain"; "required": true; "isSignal": true; }; "pitchDurationMs": { "alias": "pitchDurationMs"; "required": false; "isSignal": true; }; "pitchThrottleMs": { "alias": "pitchThrottleMs"; "required": false; "isSignal": true; }; "audioVolume": { "alias": "audioVolume"; "required": false; "isSignal": true; }; "audioDisabled": { "alias": "audioDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|