@arraypress/waveform-sounds 2.0.0 → 2.1.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/README.md +24 -2
- package/dist/waveform-sounds-no-autoinit.esm.js +495 -90
- package/dist/waveform-sounds-render.esm.js +55 -5
- package/dist/waveform-sounds.css +88 -17
- package/dist/waveform-sounds.esm.js +498 -92
- package/dist/waveform-sounds.js +494 -92
- package/dist/waveform-sounds.min.css +1 -1
- package/dist/waveform-sounds.min.js +3 -3
- package/package.json +1 -1
- package/src/css/waveform-sounds.css +88 -17
- package/src/js/core/WaveformSounds.ts +350 -87
- package/src/js/core/element.ts +208 -0
- package/src/js/core/engine.ts +9 -3
- package/src/js/core/options.ts +0 -5
- package/src/js/data/bpm.ts +14 -4
- package/src/js/data/navigation.ts +16 -3
- package/src/js/data/sounds.ts +44 -14
- package/src/js/data/url-state.ts +33 -10
- package/src/js/dom/colors.ts +28 -1
- package/src/js/dom/draw.ts +0 -1
- package/src/js/dom/menus.ts +0 -2
- package/src/js/dom/rows.ts +0 -3
- package/src/js/entry.ts +13 -3
- package/src/js/index.ts +7 -3
- package/src/js/render/html.ts +0 -2
- package/src/js/render/icons.ts +0 -1
- package/src/js/render/markup.ts +41 -13
- package/src/js/render/options.ts +26 -4
- package/src/js/render/strings.ts +4 -3
- package/src/js/render-entry.ts +1 -1
- package/src/js/shared/utils.ts +4 -4
- package/src/js/types.ts +30 -3
- package/types/core/WaveformSounds.d.ts +40 -10
- package/types/core/WaveformSounds.d.ts.map +1 -1
- package/types/core/element.d.ts +84 -0
- package/types/core/element.d.ts.map +1 -0
- package/types/core/engine.d.ts +8 -3
- package/types/core/engine.d.ts.map +1 -1
- package/types/core/options.d.ts +0 -5
- package/types/core/options.d.ts.map +1 -1
- package/types/data/bpm.d.ts +17 -4
- package/types/data/bpm.d.ts.map +1 -1
- package/types/data/navigation.d.ts +11 -2
- package/types/data/navigation.d.ts.map +1 -1
- package/types/data/sounds.d.ts +13 -12
- package/types/data/sounds.d.ts.map +1 -1
- package/types/data/url-state.d.ts +32 -6
- package/types/data/url-state.d.ts.map +1 -1
- package/types/dom/colors.d.ts +13 -0
- package/types/dom/colors.d.ts.map +1 -1
- package/types/dom/draw.d.ts +0 -1
- package/types/dom/draw.d.ts.map +1 -1
- package/types/dom/menus.d.ts +0 -2
- package/types/dom/menus.d.ts.map +1 -1
- package/types/dom/rows.d.ts +0 -3
- package/types/dom/rows.d.ts.map +1 -1
- package/types/entry.d.ts +10 -4
- package/types/entry.d.ts.map +1 -1
- package/types/index.d.ts +2 -2
- package/types/index.d.ts.map +1 -1
- package/types/render/html.d.ts +0 -2
- package/types/render/html.d.ts.map +1 -1
- package/types/render/icons.d.ts.map +1 -1
- package/types/render/markup.d.ts +17 -8
- package/types/render/markup.d.ts.map +1 -1
- package/types/render/options.d.ts +17 -4
- package/types/render/options.d.ts.map +1 -1
- package/types/render/strings.d.ts +0 -3
- package/types/render/strings.d.ts.map +1 -1
- package/types/render-entry.d.ts +1 -1
- package/types/render-entry.d.ts.map +1 -1
- package/types/shared/utils.d.ts +3 -3
- package/types/shared/utils.d.ts.map +1 -1
- package/types/types.d.ts +29 -3
- package/types/types.d.ts.map +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `<waveform-sounds>` custom element, modelled on the core's
|
|
3
|
+
* `<waveform-player>`.
|
|
4
|
+
*
|
|
5
|
+
* A light-DOM wrapper: the element itself is the list's container, so the
|
|
6
|
+
* stylesheet applies as it does to `[data-waveform-sounds]`, server-rendered
|
|
7
|
+
* markup inside it (`renderSounds()` output) is ADOPTED exactly as it is
|
|
8
|
+
* there, and `waveformsounds:*` events bubble from the tag. Configured by
|
|
9
|
+
* attributes — every `data-*` option the list reads, with or without the
|
|
10
|
+
* `data-` prefix (`manifest`, `page-size`, `player`, …), the unprefixed form
|
|
11
|
+
* winning.
|
|
12
|
+
*
|
|
13
|
+
* The default entry registers it (behind the same opt-out as the scan);
|
|
14
|
+
* `/no-autoinit` exports {@link defineWaveformSoundsElement}, and
|
|
15
|
+
* `WaveformSounds.defineElement()` reaches it from a `<script>` page.
|
|
16
|
+
*
|
|
17
|
+
* @module element
|
|
18
|
+
*/
|
|
19
|
+
import { WaveformSounds } from './WaveformSounds.js';
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'waveform-sounds': WaveformSoundsElement;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Every `data-*` key `readDataOptions` reads, as its `dataset` name. The
|
|
27
|
+
* element accepts each as `data-<kebab>` and as plain `<kebab>`.
|
|
28
|
+
* `test/runtime/element.test.js` fails if this list and `readDataOptions`
|
|
29
|
+
* drift apart.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ELEMENT_OPTION_KEYS: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Read the element's options: each key from its plain attribute, else its
|
|
34
|
+
* `data-` one, through the same `readDataOptions` the `data-*` contract uses
|
|
35
|
+
* (so a bare boolean attribute — `<waveform-sounds auto-advance>` — is true,
|
|
36
|
+
* as `data-auto-advance` is).
|
|
37
|
+
*
|
|
38
|
+
* @param el
|
|
39
|
+
* @returns Sparse options.
|
|
40
|
+
*/
|
|
41
|
+
export declare function readElementOptions(el: Element): Record<string, any>;
|
|
42
|
+
declare const Base: typeof HTMLElement;
|
|
43
|
+
/**
|
|
44
|
+
* `<waveform-sounds manifest="/previews/sounds.json" page-size="20">`.
|
|
45
|
+
*
|
|
46
|
+
* - `connectedCallback` builds the list in the element (adopting
|
|
47
|
+
* server-rendered markup inside it); `disconnectedCallback` destroys it —
|
|
48
|
+
* putting adopted markup back as the server sent it — unless the element
|
|
49
|
+
* is put back before the current task ends (a move keeps the list, and
|
|
50
|
+
* its playback).
|
|
51
|
+
* - Changing an option attribute (either form) rebuilds the list once per
|
|
52
|
+
* task, from the sounds it holds (or from the new `manifest`).
|
|
53
|
+
* - {@link WaveformSoundsElement.sounds} is the `WaveformSounds` instance.
|
|
54
|
+
*/
|
|
55
|
+
export declare class WaveformSoundsElement extends Base {
|
|
56
|
+
/** The list inside this element, or `null` while disconnected. */
|
|
57
|
+
sounds: WaveformSounds | null;
|
|
58
|
+
/** Every option attribute, plain and `data-` prefixed. */
|
|
59
|
+
static get observedAttributes(): string[];
|
|
60
|
+
/** Build the list (or keep it, after a move). */
|
|
61
|
+
connectedCallback(): void;
|
|
62
|
+
/** Destroy the list, unless the element comes straight back (a move). */
|
|
63
|
+
disconnectedCallback(): void;
|
|
64
|
+
/**
|
|
65
|
+
* An option attribute changed: rebuild once the task's changes are in.
|
|
66
|
+
*
|
|
67
|
+
* @param name
|
|
68
|
+
* @param previous
|
|
69
|
+
* @param value
|
|
70
|
+
*/
|
|
71
|
+
attributeChangedCallback(name: string, previous: string | null, value: string | null): void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Register the `<waveform-sounds>` element (or the same element under
|
|
75
|
+
* another name). The default entry does this on import; `/no-autoinit`
|
|
76
|
+
* leaves it to you (`WaveformSounds.defineElement()` from a `<script>` page).
|
|
77
|
+
* A name that is already defined is left alone.
|
|
78
|
+
*
|
|
79
|
+
* @param name - Tag name; must contain a hyphen.
|
|
80
|
+
* @returns The registered constructor, or `undefined` outside a browser.
|
|
81
|
+
*/
|
|
82
|
+
export declare function defineWaveformSoundsElement(name?: string): CustomElementConstructor | undefined;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/js/core/element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAKnD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,qBAAqB,CAAC;KAC5C;CACJ;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,UAI/B,CAAC;AASF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAQnE;AAKD,QAAA,MAAM,IAAI,EAAoE,OAAO,WAAW,CAAC;AAEjG;;;;;;;;;;;GAWG;AACH,qBAAa,qBAAsB,SAAQ,IAAI;IAC3C,kEAAkE;IAC1D,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAItC,0DAA0D;IAC1D,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iDAAiD;IACjD,iBAAiB,IAAI,IAAI,CAOxB;IAED,yEAAyE;IACzE,oBAAoB,IAAI,IAAI,CAM3B;IAED;;;;;;OAMG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAe1F;CAkDJ;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,GAAE,MAA0B,GAAG,wBAAwB,GAAG,SAAS,CASlH"}
|
package/types/core/engine.d.ts
CHANGED
|
@@ -33,7 +33,6 @@ export declare function engineOptions(user: Record<string, any> | null | undefin
|
|
|
33
33
|
*
|
|
34
34
|
* @param sound
|
|
35
35
|
* @param layout
|
|
36
|
-
* @returns
|
|
37
36
|
*/
|
|
38
37
|
export declare function enginePeaks(sound: {
|
|
39
38
|
peaks: number[] | null;
|
|
@@ -45,6 +44,7 @@ export interface EngineTrack {
|
|
|
45
44
|
autoplay: boolean;
|
|
46
45
|
duration?: number;
|
|
47
46
|
downloadUrl?: string;
|
|
47
|
+
preload?: string;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* The `loadTrack()` options for a sound: its peaks (see {@link enginePeaks}),
|
|
@@ -53,15 +53,20 @@ export interface EngineTrack {
|
|
|
53
53
|
* which with `preload: 'none'` is only once it plays — and its download
|
|
54
54
|
* link, so a `showDownload` engine offers what the row offers.
|
|
55
55
|
*
|
|
56
|
+
* `preload` is given every time because the core keeps the last one: the
|
|
57
|
+
* strip CUES its first sound with `'none'` (it shows the title, length and
|
|
58
|
+
* peaks from the data, and fetches nothing until it plays), and the next
|
|
59
|
+
* sound played must get the engine's own preload back.
|
|
60
|
+
*
|
|
56
61
|
* @param sound
|
|
57
62
|
* @param layout
|
|
58
63
|
* @param autoplay - Start once loaded (false: cue only).
|
|
59
|
-
* @
|
|
64
|
+
* @param preload - The media element's `preload` for this sound.
|
|
60
65
|
*/
|
|
61
66
|
export declare function engineTrack(sound: {
|
|
62
67
|
peaks: number[] | null;
|
|
63
68
|
waveform: string | null;
|
|
64
69
|
duration: number | null;
|
|
65
70
|
download: string | null;
|
|
66
|
-
}, layout: 'inline' | 'strip', autoplay: boolean): EngineTrack;
|
|
71
|
+
}, layout: 'inline' | 'strip', autoplay: boolean, preload?: string): EngineTrack;
|
|
67
72
|
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/js/core/engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqB/K;AAED
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/js/core/engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH;;;;;;;;;;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|
|
28
28
|
* is an empty list (e.g. `data-sorts=""` = no sort menu).
|
|
29
29
|
*
|
|
30
30
|
* @param value
|
|
31
|
-
* @returns
|
|
32
31
|
*/
|
|
33
32
|
export declare function parseList(value: string | undefined): string[] | undefined;
|
|
34
33
|
/**
|
|
35
34
|
* A number attribute; an empty string is "not set".
|
|
36
35
|
*
|
|
37
36
|
* @param value
|
|
38
|
-
* @returns
|
|
39
37
|
*/
|
|
40
38
|
export declare function parseNumber(value: string | undefined): number | undefined;
|
|
41
39
|
/**
|
|
@@ -43,7 +41,6 @@ export declare function parseNumber(value: string | undefined): number | undefin
|
|
|
43
41
|
* the parameter prefix.
|
|
44
42
|
*
|
|
45
43
|
* @param value
|
|
46
|
-
* @returns
|
|
47
44
|
*/
|
|
48
45
|
export declare function parseUrlState(value: string | undefined): boolean | string | undefined;
|
|
49
46
|
/**
|
|
@@ -53,7 +50,6 @@ export declare function parseUrlState(value: string | undefined): boolean | stri
|
|
|
53
50
|
*
|
|
54
51
|
* @param value
|
|
55
52
|
* @param name - The attribute name, for the warning.
|
|
56
|
-
* @returns
|
|
57
53
|
*/
|
|
58
54
|
export declare function parseJson(value: string | undefined, name: string): Record<string, any> | undefined;
|
|
59
55
|
/**
|
|
@@ -70,7 +66,6 @@ export declare function readDataOptions(el: HTMLElement): Record<string, any>;
|
|
|
70
66
|
* overwrite (an unset prop must not erase a default).
|
|
71
67
|
*
|
|
72
68
|
* @param sources
|
|
73
|
-
* @returns
|
|
74
69
|
*/
|
|
75
70
|
export declare function mergeOptions(...sources: (Record<string, any> | null | undefined)[]): Record<string, any>;
|
|
76
71
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/core/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAC,qBAAqB,E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BpE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAOxG"}
|
package/types/data/bpm.d.ts
CHANGED
|
@@ -9,12 +9,28 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module bpm
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* The range the slider spans: the pack's BPMs widened to whole numbers
|
|
14
|
+
* (the handles step by 1, so a pack whose fastest loop is 128.5 BPM needs
|
|
15
|
+
* an end at 129, or the top handle could never reach it). A pack of whole
|
|
16
|
+
* BPMs is unchanged.
|
|
17
|
+
*
|
|
18
|
+
* @param range - The pack's BPM range (`facets().bpm`).
|
|
19
|
+
* @returns The slider's ends, or null when the pack has no BPMs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function bpmExtent(range: {
|
|
22
|
+
min: number;
|
|
23
|
+
max: number;
|
|
24
|
+
} | null | undefined): {
|
|
25
|
+
min: number;
|
|
26
|
+
max: number;
|
|
27
|
+
} | null;
|
|
12
28
|
/**
|
|
13
29
|
* The filter for a pair of handle positions.
|
|
14
30
|
*
|
|
15
31
|
* @param lo - The lower handle.
|
|
16
32
|
* @param hi - The upper handle.
|
|
17
|
-
* @param extent - The
|
|
33
|
+
* @param extent - The slider's range ({@link bpmExtent}).
|
|
18
34
|
* @returns `''` for an open end.
|
|
19
35
|
*/
|
|
20
36
|
export declare function bpmFilterFromRange(lo: number, hi: number, extent: {
|
|
@@ -31,7 +47,6 @@ export declare function bpmFilterFromRange(lo: number, hi: number, extent: {
|
|
|
31
47
|
*
|
|
32
48
|
* @param filter
|
|
33
49
|
* @param extent
|
|
34
|
-
* @returns
|
|
35
50
|
*/
|
|
36
51
|
export declare function bpmRangeFromFilter(filter: {
|
|
37
52
|
bpmMin?: string | number;
|
|
@@ -48,7 +63,6 @@ export declare function bpmRangeFromFilter(filter: {
|
|
|
48
63
|
*
|
|
49
64
|
* @param value
|
|
50
65
|
* @param extent
|
|
51
|
-
* @returns
|
|
52
66
|
*/
|
|
53
67
|
export declare function bpmFraction(value: number, extent: {
|
|
54
68
|
min: number;
|
|
@@ -58,7 +72,6 @@ export declare function bpmFraction(value: number, extent: {
|
|
|
58
72
|
* Is a BPM limit set on either side?
|
|
59
73
|
*
|
|
60
74
|
* @param filter
|
|
61
|
-
* @returns
|
|
62
75
|
*/
|
|
63
76
|
export declare function hasBpmFilter(filter: {
|
|
64
77
|
bpmMin?: string | number;
|
package/types/data/bpm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bpm.d.ts","sourceRoot":"","sources":["../../src/js/data/bpm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAM/H;AAED
|
|
1
|
+
{"version":3,"file":"bpm.d.ts","sourceRoot":"","sources":["../../src/js/data/bpm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,GAAG,SAAS,GAAG;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAEjH;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAM/H;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAC,MAAM,CAAC,EAAE,MAAM,GAAC,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;CAAC,EAAE,MAAM,EAAE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,CAQzJ;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG,MAAM,CAGrF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAC,MAAM,CAAC,EAAE,MAAM,GAAC,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;CAAC,GAAG,OAAO,CAE9F"}
|
|
@@ -28,6 +28,17 @@ export declare function rowTarget(key: string, at: number, count: number): numbe
|
|
|
28
28
|
* @returns The new position, or null for any other key.
|
|
29
29
|
*/
|
|
30
30
|
export declare function seekTarget(progress: number, key: string): number | null;
|
|
31
|
+
/** Where End seeks on a slider: just short of the end, so it can't end
|
|
32
|
+
* the sound (and with it auto-advance) by accident. */
|
|
33
|
+
export declare const SEEK_END = 0.999;
|
|
34
|
+
/**
|
|
35
|
+
* The position Home / End seek to on a row's seek slider (the ARIA slider
|
|
36
|
+
* pattern: they go to the minimum / maximum, not to the first / last row).
|
|
37
|
+
*
|
|
38
|
+
* @param key - `KeyboardEvent.key`.
|
|
39
|
+
* @returns 0 for Home, {@link SEEK_END} for End, else null.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sliderEdgeTarget(key: string): number | null;
|
|
31
42
|
/**
|
|
32
43
|
* Which of the matching sounds the current page shows, and how many more
|
|
33
44
|
* "Show more" would reveal.
|
|
@@ -35,7 +46,6 @@ export declare function seekTarget(progress: number, key: string): number | null
|
|
|
35
46
|
* @template T
|
|
36
47
|
* @param shown - The sounds that match, in display order.
|
|
37
48
|
* @param limit - How many to show (Infinity for all).
|
|
38
|
-
* @returns
|
|
39
49
|
*/
|
|
40
50
|
export declare function pageWindow<T>(shown: T[], limit: number): {
|
|
41
51
|
visible: Set<T>;
|
|
@@ -47,7 +57,6 @@ export declare function pageWindow<T>(shown: T[], limit: number): {
|
|
|
47
57
|
*
|
|
48
58
|
* @param limit - The current limit.
|
|
49
59
|
* @param pos - The position that must be visible.
|
|
50
|
-
* @returns
|
|
51
60
|
*/
|
|
52
61
|
export declare function limitToReveal(limit: number, pos: number): number;
|
|
53
62
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/js/data/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,oDAAoD;AACpD,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,CAS1F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGvE;AAED
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/js/data/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,oDAAoD;AACpD,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,CAS1F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGvE;AAED;wDACwD;AACxD,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAE9B;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG;IAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAG7F;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
package/types/data/sounds.d.ts
CHANGED
|
@@ -20,9 +20,11 @@ export declare function encodePeaks(peaks: number[]): string;
|
|
|
20
20
|
/**
|
|
21
21
|
* Decode peaks from any accepted form into numbers 0..1.
|
|
22
22
|
*
|
|
23
|
-
* Accepts the hex string from {@link encodePeaks},
|
|
24
|
-
*
|
|
25
|
-
* 0..
|
|
23
|
+
* Accepts the hex string from {@link encodePeaks}, the player's compact
|
|
24
|
+
* `wp1:` string (`"wp1:"` + base64url of one byte per peak, what the 2.0
|
|
25
|
+
* core and waveform-gen write), an array of 0..1 numbers, or an array of
|
|
26
|
+
* integers on a larger scale (e.g. 0..100 or 0..255) together with that
|
|
27
|
+
* `scale`. Server markup still writes hex.
|
|
26
28
|
*
|
|
27
29
|
* @param value
|
|
28
30
|
* @param scale - The maximum of an integer array.
|
|
@@ -50,10 +52,17 @@ export declare function normalizeKey(key: string | null | undefined): string;
|
|
|
50
52
|
* @returns e.g. "0:08", "0.4s", or '' when unknown.
|
|
51
53
|
*/
|
|
52
54
|
export declare function formatDuration(seconds: number | null | undefined): string;
|
|
55
|
+
/**
|
|
56
|
+
* A playback position as a clock: whole seconds, rounded down like a
|
|
57
|
+
* player's ("0:12", "1:05:09" past an hour).
|
|
58
|
+
*
|
|
59
|
+
* @param seconds
|
|
60
|
+
* @returns e.g. "0:12"; "0:00" for anything unusable.
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatClock(seconds: number): string;
|
|
53
63
|
/**
|
|
54
64
|
* Parse a duration given as seconds (8.02) or as "m:ss" / "h:mm:ss".
|
|
55
65
|
* @param value
|
|
56
|
-
* @returns
|
|
57
66
|
*/
|
|
58
67
|
export declare function parseDuration(value: number | string | null | undefined): number | null;
|
|
59
68
|
/**
|
|
@@ -61,7 +70,6 @@ export declare function parseDuration(value: number | string | null | undefined)
|
|
|
61
70
|
* leading pack prefixes kept (they are often the label's code).
|
|
62
71
|
* "NW_Bass_Loop_04_128_Fmin.wav" → "NW Bass Loop 04 128 Fmin".
|
|
63
72
|
* @param url
|
|
64
|
-
* @returns
|
|
65
73
|
*/
|
|
66
74
|
export declare function titleFromUrl(url: string): string;
|
|
67
75
|
/**
|
|
@@ -85,7 +93,6 @@ export declare const LOOP_FILTERS: string[];
|
|
|
85
93
|
* as an attribute or a CSV-ish manifest writes it. Unset is a one-shot.
|
|
86
94
|
*
|
|
87
95
|
* @param value
|
|
88
|
-
* @returns
|
|
89
96
|
*/
|
|
90
97
|
export declare function isLoop(value: unknown): boolean;
|
|
91
98
|
/**
|
|
@@ -94,7 +101,6 @@ export declare function isLoop(value: unknown): boolean;
|
|
|
94
101
|
* Sounds without a url are dropped.
|
|
95
102
|
*
|
|
96
103
|
* @param manifest
|
|
97
|
-
* @returns
|
|
98
104
|
*/
|
|
99
105
|
export declare function parseManifest(manifest: SoundsManifest | SoundInput[]): Sound[];
|
|
100
106
|
/**
|
|
@@ -102,7 +108,6 @@ export declare function parseManifest(manifest: SoundsManifest | SoundInput[]):
|
|
|
102
108
|
* (a repeated id would make two rows answer to one play() call).
|
|
103
109
|
* @param list
|
|
104
110
|
* @param peakScale
|
|
105
|
-
* @returns
|
|
106
111
|
*/
|
|
107
112
|
export declare function normalizeSounds(list: SoundInput[], peakScale?: number): Sound[];
|
|
108
113
|
/**
|
|
@@ -112,7 +117,6 @@ export declare function normalizeSounds(list: SoundInput[], peakScale?: number):
|
|
|
112
117
|
* offer is not rendered.
|
|
113
118
|
*
|
|
114
119
|
* @param sounds
|
|
115
|
-
* @returns
|
|
116
120
|
*/
|
|
117
121
|
export declare function facets(sounds: Sound[]): {
|
|
118
122
|
types: {
|
|
@@ -140,7 +144,6 @@ export declare function facets(sounds: Sound[]): {
|
|
|
140
144
|
*
|
|
141
145
|
* @param sound
|
|
142
146
|
* @param filter
|
|
143
|
-
* @returns
|
|
144
147
|
*/
|
|
145
148
|
export declare function matches(sound: Sound, filter?: Partial<SoundsFilter>): boolean;
|
|
146
149
|
/** The sort orders the toolbar offers. */
|
|
@@ -152,7 +155,6 @@ export declare const SORTS: SoundsSort[];
|
|
|
152
155
|
*
|
|
153
156
|
* @param sorts - The configured orders.
|
|
154
157
|
* @param f - The sounds' facets.
|
|
155
|
-
* @returns
|
|
156
158
|
*/
|
|
157
159
|
export declare function availableSorts(sorts: string[], f: ReturnType<typeof facets>): string[];
|
|
158
160
|
/**
|
|
@@ -161,7 +163,6 @@ export declare function availableSorts(sorts: string[], f: ReturnType<typeof fac
|
|
|
161
163
|
*
|
|
162
164
|
* @param sounds
|
|
163
165
|
* @param by
|
|
164
|
-
* @returns
|
|
165
166
|
*/
|
|
166
167
|
export declare function sortSounds(sounds: Sound[], by?: SoundsSort): Sound[];
|
|
167
168
|
//# sourceMappingURL=sounds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sounds.d.ts","sourceRoot":"","sources":["../../src/js/data/sounds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAE7F;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAQnD;
|
|
1
|
+
{"version":3,"file":"sounds.d.ts","sourceRoot":"","sources":["../../src/js/data/sounds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAE7F;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAQnD;AAwBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM,EAAE,GAAG,IAAI,CAa3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CASnE;AAcD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAWzE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAInD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAStF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,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AE,CAAC,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,GAAG,MAAM,EAAE,CAEtF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,GAAE,UAAsB,GAAG,KAAK,EAAE,CAW/E"}
|
|
@@ -15,7 +15,6 @@ import type { SoundsFilter } from '../types.js';
|
|
|
15
15
|
* page don't share a filter.
|
|
16
16
|
*
|
|
17
17
|
* @param urlState
|
|
18
|
-
* @returns
|
|
19
18
|
*/
|
|
20
19
|
export declare function urlKeys(urlState: boolean | string | null | undefined): {
|
|
21
20
|
q: string;
|
|
@@ -26,7 +25,9 @@ export declare function urlKeys(urlState: boolean | string | null | undefined):
|
|
|
26
25
|
sort: string;
|
|
27
26
|
} | null;
|
|
28
27
|
/**
|
|
29
|
-
* A BPM range parameter: "120-130", "120-"
|
|
28
|
+
* A BPM range parameter: "120-130", "120-", "-130", or with decimals
|
|
29
|
+
* ("128.5-130", what `setFilter({bpmMin: 128.5})` writes). Reversed ends
|
|
30
|
+
* are put in order.
|
|
30
31
|
*
|
|
31
32
|
* @param value
|
|
32
33
|
* @returns null if malformed.
|
|
@@ -35,24 +36,45 @@ export declare function parseBpmRange(value: string | null | undefined): {
|
|
|
35
36
|
bpmMin: string;
|
|
36
37
|
bpmMax: string;
|
|
37
38
|
} | null;
|
|
39
|
+
/**
|
|
40
|
+
* Keep only the limits that fall inside the pack's BPM range: a link made
|
|
41
|
+
* for another pack (`?bpm=200-` on one topping out at 174) must not empty
|
|
42
|
+
* the list, and a limit beyond an end is no limit at all.
|
|
43
|
+
*
|
|
44
|
+
* @param range - From {@link parseBpmRange}.
|
|
45
|
+
* @param extent - The slider's range; null when the pack has no BPMs
|
|
46
|
+
* (then any BPM filter would hide everything, so none is kept).
|
|
47
|
+
* @returns The usable limits, or null when none is left.
|
|
48
|
+
*/
|
|
49
|
+
export declare function bpmRangeWithin(range: {
|
|
50
|
+
bpmMin: string;
|
|
51
|
+
bpmMax: string;
|
|
52
|
+
}, extent: {
|
|
53
|
+
min: number;
|
|
54
|
+
max: number;
|
|
55
|
+
} | null): {
|
|
56
|
+
bpmMin: string;
|
|
57
|
+
bpmMax: string;
|
|
58
|
+
} | null;
|
|
38
59
|
/**
|
|
39
60
|
* The inverse of {@link parseBpmRange}; '' when neither end is set.
|
|
40
61
|
*
|
|
41
62
|
* @param min
|
|
42
63
|
* @param max
|
|
43
|
-
* @returns
|
|
44
64
|
*/
|
|
45
65
|
export declare function formatBpmRange(min: string | number | null | undefined, max: string | number | null | undefined): string;
|
|
46
66
|
/**
|
|
47
67
|
* Read the filter and sort from a query string. Values the list can't use
|
|
48
|
-
* (a type it doesn't have, a key no sound is in, a
|
|
49
|
-
* that isn't a mix of loops and one-shots,
|
|
68
|
+
* (a type it doesn't have, a key no sound is in, a BPM limit outside its
|
|
69
|
+
* range, a loops filter on a list that isn't a mix of loops and one-shots,
|
|
70
|
+
* a sort it doesn't offer)
|
|
50
71
|
* are ignored, never applied: a stale link shows the whole list, not an
|
|
51
72
|
* empty one.
|
|
52
73
|
*
|
|
53
74
|
* @param search - `location.search`.
|
|
54
75
|
* @param keys
|
|
55
|
-
* @param available - From `facets()
|
|
76
|
+
* @param available - From `facets()`, with `bpm` as the slider's range
|
|
77
|
+
* (`bpmExtent()`).
|
|
56
78
|
* @param sorts - The sort orders offered.
|
|
57
79
|
* @returns A filter patch, and the sort (or null).
|
|
58
80
|
*/
|
|
@@ -63,6 +85,10 @@ export declare function readUrlState(search: string, keys: ReturnType<typeof url
|
|
|
63
85
|
keys: string[];
|
|
64
86
|
loops?: number;
|
|
65
87
|
oneShots?: number;
|
|
88
|
+
bpm?: {
|
|
89
|
+
min: number;
|
|
90
|
+
max: number;
|
|
91
|
+
} | null;
|
|
66
92
|
}, sorts: string[]): {
|
|
67
93
|
filter: Partial<SoundsFilter>;
|
|
68
94
|
sort: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-state.d.ts","sourceRoot":"","sources":["../../src/js/data/url-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAC,YAAY,EAAmB,MAAM,aAAa,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"url-state.d.ts","sourceRoot":"","sources":["../../src/js/data/url-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAC,YAAY,EAAmB,MAAM,aAAa,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAI7J;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAKvG;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,EAAE,MAAM,EAAE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,GAAG;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAK1J;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGvH;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAAE,SAAS,EAAE;IAAC,KAAK,EAAE;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,CAAA;CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG;IAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,GAAC,IAAI,CAAA;CAAC,CAmBpR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAW7I"}
|
package/types/dom/colors.d.ts
CHANGED
|
@@ -23,6 +23,19 @@ export declare function parseAlpha(color: string | null | undefined): number;
|
|
|
23
23
|
* @returns A computed colour, or `#fff` when nothing is painted.
|
|
24
24
|
*/
|
|
25
25
|
export declare function pageSurface(el: Element, minAlpha?: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* Is the page in forced colours (Windows High Contrast)? Then the canvas
|
|
28
|
+
* must draw in system colours too.
|
|
29
|
+
*/
|
|
30
|
+
export declare function forcedColors(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Every element above `el`, nearest first, crossing shadow-root boundaries
|
|
33
|
+
* (the elements whose class, style or theme attribute can change what the
|
|
34
|
+
* list inherits).
|
|
35
|
+
*
|
|
36
|
+
* @param el
|
|
37
|
+
*/
|
|
38
|
+
export declare function ancestorsOf(el: Element): Element[];
|
|
26
39
|
/**
|
|
27
40
|
* Resolve any CSS colour (a `var()`, `color-mix()`, `currentColor`) to a
|
|
28
41
|
* concrete value, as it would compute inside `container`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/js/dom/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAQnE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAa,GAAG,MAAM,CAMxE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/js/dom/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAQnE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAa,GAAG,MAAM,CAMxE;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAMtC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,EAAE,CAIlD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAUzE"}
|
package/types/dom/draw.d.ts
CHANGED
|
@@ -38,7 +38,6 @@ export declare function resample(peaks: number[], count: number): any[];
|
|
|
38
38
|
* @param width - Canvas width (CSS px).
|
|
39
39
|
* @param height - Canvas height (CSS px).
|
|
40
40
|
* @param o
|
|
41
|
-
* @returns
|
|
42
41
|
*/
|
|
43
42
|
export declare function barRects(peaks: number[], width: number, height: number, o: {
|
|
44
43
|
style: 'mirror' | 'bars';
|
package/types/dom/draw.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/js/dom/draw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB;;;;SAQlD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,SAatD;AAED
|
|
1
|
+
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/js/dom/draw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB;;;;SAQlD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,SAatD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE;IAAC,KAAK,EAAE,QAAQ,GAAC,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,EAAE,CActL;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE;IAAC,KAAK,EAAE,QAAQ,GAAC,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,QA6BvM"}
|
package/types/dom/menus.d.ts
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @param label
|
|
22
22
|
* @param query
|
|
23
|
-
* @returns
|
|
24
23
|
*/
|
|
25
24
|
export declare function optionMatches(label: string, query: string): boolean;
|
|
26
25
|
/**
|
|
@@ -29,7 +28,6 @@ export declare function optionMatches(label: string, query: string): boolean;
|
|
|
29
28
|
* @param current - -1 when nothing is active.
|
|
30
29
|
* @param delta
|
|
31
30
|
* @param length
|
|
32
|
-
* @returns
|
|
33
31
|
*/
|
|
34
32
|
export declare function stepIndex(current: number, delta: number, length: number): number;
|
|
35
33
|
/**
|
package/types/dom/menus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/js/dom/menus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH
|
|
1
|
+
{"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/js/dom/menus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhF;AA8BD;;GAEG;AACH,qBAAa,KAAK;IAGd,4DAA4D;IACpD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,4CAA4C;IACpC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAErC;;;;;OAKG;IACH,YAAY,SAAS,EAAE,WAAW,EAAE,EAAC,MAAM,EAAE,MAAM,EAAC,EAAE;QAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAC,EAQzH;IA0CD;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,WAAW,QAWrB;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,EAAE,OAAO,QAQzB;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAYnC;CAqEJ"}
|
package/types/dom/rows.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import type { Sound } from '../types.js';
|
|
|
12
12
|
* can't leave a hole that would misalign rows and sounds.
|
|
13
13
|
*
|
|
14
14
|
* @param list - The `[data-ws-list]` element.
|
|
15
|
-
* @returns
|
|
16
15
|
*/
|
|
17
16
|
export declare function readRows(list: HTMLElement): Sound[];
|
|
18
17
|
/**
|
|
@@ -20,7 +19,6 @@ export declare function readRows(list: HTMLElement): Sound[];
|
|
|
20
19
|
* they're displayed in).
|
|
21
20
|
*
|
|
22
21
|
* @param list
|
|
23
|
-
* @returns
|
|
24
22
|
*/
|
|
25
23
|
export declare function indexRows(list: HTMLElement): HTMLElement[];
|
|
26
24
|
/**
|
|
@@ -28,7 +26,6 @@ export declare function indexRows(list: HTMLElement): HTMLElement[];
|
|
|
28
26
|
* display order.
|
|
29
27
|
*
|
|
30
28
|
* @param list
|
|
31
|
-
* @returns
|
|
32
29
|
*/
|
|
33
30
|
export declare function visibleRows(list: HTMLElement): HTMLElement[];
|
|
34
31
|
/**
|
package/types/dom/rows.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/js/dom/rows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAKvC
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/js/dom/rows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAKvC;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,KAAK,EAAE,CAenD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE,CAI1D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE,CAE5D;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,QAI/D"}
|
package/types/entry.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @arraypress/waveform-sounds — public surface, without the import-time
|
|
3
|
-
* auto-init scan
|
|
3
|
+
* side effects: the auto-init scan and registering `<waveform-sounds>`
|
|
4
|
+
* (`index.js` adds those). Anything new belongs here.
|
|
4
5
|
*
|
|
5
6
|
* @module entry
|
|
6
7
|
*/
|
|
7
8
|
import { WaveformSounds, DEFAULT_OPTIONS } from './core/WaveformSounds.js';
|
|
9
|
+
import { WaveformSoundsElement, defineWaveformSoundsElement } from './core/element.js';
|
|
8
10
|
import { encodePeaks, decodePeaks, normalizeKey, normalizeSounds, parseManifest, facets, matches, sortSounds, formatDuration } from './data/sounds.js';
|
|
9
|
-
import { renderSounds, renderSoundsElement, DEFAULT_STRINGS } from './render/markup.js';
|
|
11
|
+
import { renderSounds, renderSoundsElement, DEFAULT_STRINGS, RENDER_OPTION_KEYS, pickRenderOptions } from './render/markup.js';
|
|
10
12
|
import type { WaveformSoundsEventMap } from './types.js';
|
|
11
13
|
declare global {
|
|
12
14
|
interface Window {
|
|
@@ -15,8 +17,12 @@ declare global {
|
|
|
15
17
|
}
|
|
16
18
|
interface HTMLElementEventMap extends WaveformSoundsEventMap {
|
|
17
19
|
}
|
|
20
|
+
interface DocumentEventMap extends WaveformSoundsEventMap {
|
|
21
|
+
}
|
|
22
|
+
interface WindowEventMap extends WaveformSoundsEventMap {
|
|
23
|
+
}
|
|
18
24
|
}
|
|
19
25
|
export default WaveformSounds;
|
|
20
|
-
export { WaveformSounds, DEFAULT_OPTIONS, DEFAULT_STRINGS, encodePeaks, decodePeaks, normalizeKey, normalizeSounds, parseManifest, facets, matches, sortSounds, formatDuration, renderSounds, renderSoundsElement, };
|
|
21
|
-
export type { SoundInput, Sound, SoundsManifest, SoundsFilter, SoundsLoopFilter, SoundsSort, SoundsLayout, SoundsFilterControl, SoundsColumn, WaveformSoundsStrings, WaveformSoundsOptions, WaveformSoundsEventMap, } from './types.js';
|
|
26
|
+
export { WaveformSounds, DEFAULT_OPTIONS, DEFAULT_STRINGS, encodePeaks, decodePeaks, normalizeKey, normalizeSounds, parseManifest, facets, matches, sortSounds, formatDuration, renderSounds, renderSoundsElement, RENDER_OPTION_KEYS, pickRenderOptions, WaveformSoundsElement, defineWaveformSoundsElement, };
|
|
27
|
+
export type { SoundInput, Sound, SoundsManifest, SoundsFilter, SoundsLoopFilter, SoundsSort, SoundsLayout, SoundsFilterControl, SoundsColumn, WaveformSoundsStrings, WaveformSoundsOptions, WaveformSoundsEventMap, WaveformSoundsInstanceEventMap, } from './types.js';
|
|
22
28
|
//# sourceMappingURL=entry.d.ts.map
|
package/types/entry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/js/entry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/js/entry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EACH,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EACtH,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAC7H,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,YAAY,CAAC;AAEvD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,qEAAqE;QACrE,cAAc,EAAE,OAAO,cAAc,CAAC;KACzC;IACD,UAAU,mBAAoB,SAAQ,sBAAsB;KAAG;IAC/D,UAAU,gBAAiB,SAAQ,sBAAsB;KAAG;IAC5D,UAAU,cAAe,SAAQ,sBAAsB;KAAG;CAC7D;eAac,cAAc;AAC7B,OAAO,EACH,cAAc,EAAE,eAAe,EAAE,eAAe,EAChD,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EACnH,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EACxE,qBAAqB,EAAE,2BAA2B,GACrD,CAAC;AAGF,YAAY,EACR,UAAU,EACV,KAAK,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GACjC,MAAM,YAAY,CAAC"}
|
package/types/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @arraypress/waveform-sounds
|
|
3
3
|
* A searchable, filterable list of sounds for WaveformPlayer.
|
|
4
4
|
*
|
|
5
|
-
* Importing this entry
|
|
6
|
-
* once the DOM is ready. Opt out page-wide with
|
|
5
|
+
* Importing this entry registers `<waveform-sounds>` and initialises every
|
|
6
|
+
* `[data-waveform-sounds]` element once the DOM is ready. Opt out page-wide with
|
|
7
7
|
* `<html data-waveform-autoinit="false">` (the family's switch), or import
|
|
8
8
|
* `@arraypress/waveform-sounds/no-autoinit`.
|
|
9
9
|
*
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/js/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/js/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,cAA6C,MAAM,YAAY,CAAC;AAEvE,cAAc,YAAY,CAAC;eACZ,cAAc"}
|