@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.
Files changed (75) hide show
  1. package/README.md +24 -2
  2. package/dist/waveform-sounds-no-autoinit.esm.js +495 -90
  3. package/dist/waveform-sounds-render.esm.js +55 -5
  4. package/dist/waveform-sounds.css +88 -17
  5. package/dist/waveform-sounds.esm.js +498 -92
  6. package/dist/waveform-sounds.js +494 -92
  7. package/dist/waveform-sounds.min.css +1 -1
  8. package/dist/waveform-sounds.min.js +3 -3
  9. package/package.json +1 -1
  10. package/src/css/waveform-sounds.css +88 -17
  11. package/src/js/core/WaveformSounds.ts +350 -87
  12. package/src/js/core/element.ts +208 -0
  13. package/src/js/core/engine.ts +9 -3
  14. package/src/js/core/options.ts +0 -5
  15. package/src/js/data/bpm.ts +14 -4
  16. package/src/js/data/navigation.ts +16 -3
  17. package/src/js/data/sounds.ts +44 -14
  18. package/src/js/data/url-state.ts +33 -10
  19. package/src/js/dom/colors.ts +28 -1
  20. package/src/js/dom/draw.ts +0 -1
  21. package/src/js/dom/menus.ts +0 -2
  22. package/src/js/dom/rows.ts +0 -3
  23. package/src/js/entry.ts +13 -3
  24. package/src/js/index.ts +7 -3
  25. package/src/js/render/html.ts +0 -2
  26. package/src/js/render/icons.ts +0 -1
  27. package/src/js/render/markup.ts +41 -13
  28. package/src/js/render/options.ts +26 -4
  29. package/src/js/render/strings.ts +4 -3
  30. package/src/js/render-entry.ts +1 -1
  31. package/src/js/shared/utils.ts +4 -4
  32. package/src/js/types.ts +30 -3
  33. package/types/core/WaveformSounds.d.ts +40 -10
  34. package/types/core/WaveformSounds.d.ts.map +1 -1
  35. package/types/core/element.d.ts +84 -0
  36. package/types/core/element.d.ts.map +1 -0
  37. package/types/core/engine.d.ts +8 -3
  38. package/types/core/engine.d.ts.map +1 -1
  39. package/types/core/options.d.ts +0 -5
  40. package/types/core/options.d.ts.map +1 -1
  41. package/types/data/bpm.d.ts +17 -4
  42. package/types/data/bpm.d.ts.map +1 -1
  43. package/types/data/navigation.d.ts +11 -2
  44. package/types/data/navigation.d.ts.map +1 -1
  45. package/types/data/sounds.d.ts +13 -12
  46. package/types/data/sounds.d.ts.map +1 -1
  47. package/types/data/url-state.d.ts +32 -6
  48. package/types/data/url-state.d.ts.map +1 -1
  49. package/types/dom/colors.d.ts +13 -0
  50. package/types/dom/colors.d.ts.map +1 -1
  51. package/types/dom/draw.d.ts +0 -1
  52. package/types/dom/draw.d.ts.map +1 -1
  53. package/types/dom/menus.d.ts +0 -2
  54. package/types/dom/menus.d.ts.map +1 -1
  55. package/types/dom/rows.d.ts +0 -3
  56. package/types/dom/rows.d.ts.map +1 -1
  57. package/types/entry.d.ts +10 -4
  58. package/types/entry.d.ts.map +1 -1
  59. package/types/index.d.ts +2 -2
  60. package/types/index.d.ts.map +1 -1
  61. package/types/render/html.d.ts +0 -2
  62. package/types/render/html.d.ts.map +1 -1
  63. package/types/render/icons.d.ts.map +1 -1
  64. package/types/render/markup.d.ts +17 -8
  65. package/types/render/markup.d.ts.map +1 -1
  66. package/types/render/options.d.ts +17 -4
  67. package/types/render/options.d.ts.map +1 -1
  68. package/types/render/strings.d.ts +0 -3
  69. package/types/render/strings.d.ts.map +1 -1
  70. package/types/render-entry.d.ts +1 -1
  71. package/types/render-entry.d.ts.map +1 -1
  72. package/types/shared/utils.d.ts +3 -3
  73. package/types/shared/utils.d.ts.map +1 -1
  74. package/types/types.d.ts +29 -3
  75. package/types/types.d.ts.map +1 -1
@@ -23,7 +23,6 @@ import {fold} from '@arraypress/text';
23
23
  *
24
24
  * @param label
25
25
  * @param query
26
- * @returns
27
26
  */
28
27
  export function optionMatches(label: string, query: string): boolean {
29
28
  const q = fold(String(query ?? '')).trim();
@@ -36,7 +35,6 @@ export function optionMatches(label: string, query: string): boolean {
36
35
  * @param current - -1 when nothing is active.
37
36
  * @param delta
38
37
  * @param length
39
- * @returns
40
38
  */
41
39
  export function stepIndex(current: number, delta: number, length: number): number {
42
40
  return Math.max(0, Math.min(length - 1, current + delta));
@@ -18,7 +18,6 @@ const ROW = ':scope > [data-ws-index]';
18
18
  * can't leave a hole that would misalign rows and sounds.
19
19
  *
20
20
  * @param list - The `[data-ws-list]` element.
21
- * @returns
22
21
  */
23
22
  export function readRows(list: HTMLElement): Sound[] {
24
23
  const rows = [...list.querySelectorAll<HTMLElement>(ROW)]
@@ -42,7 +41,6 @@ export function readRows(list: HTMLElement): Sound[] {
42
41
  * they're displayed in).
43
42
  *
44
43
  * @param list
45
- * @returns
46
44
  */
47
45
  export function indexRows(list: HTMLElement): HTMLElement[] {
48
46
  const rows: HTMLElement[] = [];
@@ -55,7 +53,6 @@ export function indexRows(list: HTMLElement): HTMLElement[] {
55
53
  * display order.
56
54
  *
57
55
  * @param list
58
- * @returns
59
56
  */
60
57
  export function visibleRows(list: HTMLElement): HTMLElement[] {
61
58
  return [...list.querySelectorAll<HTMLElement>(ROW)].filter((r) => !r.hidden);
package/src/js/entry.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  /**
2
2
  * @arraypress/waveform-sounds — public surface, without the import-time
3
- * auto-init scan (`index.js` adds that). Anything new belongs here.
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 {
9
11
  encodePeaks, decodePeaks, normalizeKey, normalizeSounds, parseManifest, facets, matches, sortSounds, formatDuration,
10
12
  } from './data/sounds.js';
11
- import {renderSounds, renderSoundsElement, DEFAULT_STRINGS} from './render/markup.js';
13
+ import {renderSounds, renderSoundsElement, DEFAULT_STRINGS, RENDER_OPTION_KEYS, pickRenderOptions} from './render/markup.js';
12
14
  import type {WaveformSoundsEventMap} from './types.js';
13
15
 
14
16
  declare global {
@@ -17,11 +19,17 @@ declare global {
17
19
  WaveformSounds: typeof WaveformSounds;
18
20
  }
19
21
  interface HTMLElementEventMap extends WaveformSoundsEventMap {}
22
+ interface DocumentEventMap extends WaveformSoundsEventMap {}
23
+ interface WindowEventMap extends WaveformSoundsEventMap {}
20
24
  }
21
25
 
22
26
  WaveformSounds.utils = {encodePeaks, decodePeaks, normalizeKey, normalizeSounds, parseManifest, facets, matches, sortSounds, formatDuration, renderSounds};
23
27
  WaveformSounds.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
24
28
  WaveformSounds.DEFAULT_STRINGS = DEFAULT_STRINGS;
29
+ // The element definer as a static too, so a CDN page that opted out of
30
+ // auto-init (no ES module import to reach the named export) can register
31
+ // the tag itself: `WaveformSounds.defineElement()`. Like the core's.
32
+ WaveformSounds.defineElement = defineWaveformSoundsElement;
25
33
 
26
34
  // CDN / <script> usage: a global, like the rest of the family.
27
35
  if (typeof window !== 'undefined') window.WaveformSounds = WaveformSounds;
@@ -30,7 +38,8 @@ export default WaveformSounds;
30
38
  export {
31
39
  WaveformSounds, DEFAULT_OPTIONS, DEFAULT_STRINGS,
32
40
  encodePeaks, decodePeaks, normalizeKey, normalizeSounds, parseManifest, facets, matches, sortSounds, formatDuration,
33
- renderSounds, renderSoundsElement,
41
+ renderSounds, renderSoundsElement, RENDER_OPTION_KEYS, pickRenderOptions,
42
+ WaveformSoundsElement, defineWaveformSoundsElement,
34
43
  };
35
44
 
36
45
  // The public types (sounds, options, filter, events), for `import type { ... }`.
@@ -47,4 +56,5 @@ export type {
47
56
  WaveformSoundsStrings,
48
57
  WaveformSoundsOptions,
49
58
  WaveformSoundsEventMap,
59
+ WaveformSoundsInstanceEventMap,
50
60
  } from './types.js';
package/src/js/index.ts CHANGED
@@ -2,20 +2,24 @@
2
2
  * @arraypress/waveform-sounds
3
3
  * A searchable, filterable list of sounds for WaveformPlayer.
4
4
  *
5
- * Importing this entry initialises every `[data-waveform-sounds]` element
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
  *
10
10
  * @author ArrayPress
11
11
  * @license MIT
12
12
  */
13
- import WaveformSounds from './entry.js';
13
+ import WaveformSounds, {defineWaveformSoundsElement} from './entry.js';
14
14
 
15
15
  export * from './entry.js';
16
16
  export default WaveformSounds;
17
17
 
18
18
  if (typeof document !== 'undefined' && document.documentElement?.dataset?.waveformAutoinit !== 'false') {
19
+ // The tag first: an element that upgrades now builds its own list, and
20
+ // the scan then skips it as already claimed. Behind the same opt-out (an
21
+ // opted-out page can call WaveformSounds.defineElement()).
22
+ defineWaveformSoundsElement();
19
23
  if (document.readyState === 'loading') {
20
24
  document.addEventListener('DOMContentLoaded', () => WaveformSounds.init(), {once: true});
21
25
  } else {
@@ -25,7 +25,6 @@ const VOID = new Set(['input', 'br', 'img']);
25
25
  * Escape text for use as a child.
26
26
  *
27
27
  * @param value
28
- * @returns
29
28
  */
30
29
  export function text(value: unknown): string {
31
30
  return escapeHtml(value ?? '');
@@ -52,7 +51,6 @@ export function attrs(map: HtmlAttrs = {}): string {
52
51
  * @param tag
53
52
  * @param attributes
54
53
  * @param children - HTML strings; falsy ones and nested arrays are flattened away.
55
- * @returns
56
54
  */
57
55
  export function h(tag: string, attributes: HtmlAttrs = {}, ...children: HtmlChild[]): string {
58
56
  const open = `<${tag}${attrs(attributes)}>`;
@@ -11,7 +11,6 @@
11
11
  *
12
12
  * @param path - The SVG path data.
13
13
  * @param extraClass - Classes beyond `ws-icon`.
14
- * @returns
15
14
  */
16
15
  function icon(path: string, extraClass: string = ''): string {
17
16
  const cls = extraClass ? `ws-icon ${extraClass}` : 'ws-icon';
@@ -19,12 +19,13 @@ import {escapeHtml} from '@arraypress/text';
19
19
  import {availableSorts, encodePeaks, facets, formatDuration, normalizeSounds} from '../data/sounds.js';
20
20
  import {h, text} from './html.js';
21
21
  import {ICONS} from './icons.js';
22
- import {RENDER_DEFAULTS, resolveRenderOptions} from './options.js';
22
+ import {defined, pickRenderOptions, RENDER_DEFAULTS, RENDER_OPTION_KEYS, resolveRenderOptions} from './options.js';
23
23
  import {bpmLabel, countText, DEFAULT_STRINGS, fill, SORT_LABEL_KEYS} from './strings.js';
24
24
  import {hashString} from '../shared/utils.js';
25
+ import {bpmExtent} from '../data/bpm.js';
25
26
  import type {Sound, SoundInput, SoundsSort, WaveformSoundsOptions, WaveformSoundsStrings} from '../types.js';
26
27
 
27
- export {escapeHtml, RENDER_DEFAULTS, resolveRenderOptions, DEFAULT_STRINGS, countText, fill, availableSorts};
28
+ export {escapeHtml, RENDER_DEFAULTS, RENDER_OPTION_KEYS, pickRenderOptions, resolveRenderOptions, DEFAULT_STRINGS, countText, fill, availableSorts};
28
29
 
29
30
  /**
30
31
  * A stable id prefix for a list's dropdowns, from its sounds: the same on
@@ -49,7 +50,6 @@ export function idBase(sounds: {url: string}[]): string {
49
50
  *
50
51
  * @param f - The sounds' facets.
51
52
  * @param o - Resolved options.
52
- * @returns
53
53
  */
54
54
  export function toolbarPlan(f: ReturnType<typeof facets>, o: ReturnType<typeof resolveRenderOptions>): {types: 'chips'|'menu'|null, key: boolean, bpm: boolean, loops: boolean, sorts: string[], search: boolean, loop: boolean, count: boolean} {
55
55
  const typed = o.filters.includes('type') && f.types.length > 1;
@@ -73,7 +73,6 @@ export function toolbarPlan(f: ReturnType<typeof facets>, o: ReturnType<typeof r
73
73
  *
74
74
  * @param loop - The `loop` option.
75
75
  * @param f - The sounds' facets.
76
- * @returns
77
76
  */
78
77
  export function loopsByDefault(loop: boolean | null | undefined, f: {loops: number}): boolean {
79
78
  return loop == null ? f.loops > 0 : !!loop;
@@ -126,7 +125,6 @@ function renderSearch(s: WaveformSoundsStrings): string {
126
125
  * @param m.searchFrom - Options above which a search field is added.
127
126
  * @param [m.placeholder] - The search field's placeholder (no field without one).
128
127
  * @param m.noMatches - Shown when the search matches nothing.
129
- * @returns
130
128
  */
131
129
  export function renderMenu(name: string, m: MenuSpec): string {
132
130
  const listId = `${m.id}-${name}-list`;
@@ -170,8 +168,8 @@ export function renderMenu(name: string, m: MenuSpec): string {
170
168
  * @param m
171
169
  * @param m.id - Id prefix for this list.
172
170
  * @param m.s
173
- * @param m.range - The pack's BPM range.
174
- * @returns
171
+ * @param m.range - The slider's range: the pack's, widened to whole BPMs
172
+ * ({@link bpmExtent}; a pack of whole BPMs renders as it always did).
175
173
  */
176
174
  function renderBpmMenu({id, s, range}: {id: string, s: WaveformSoundsStrings, range: {min: number, max: number}}): string {
177
175
  const popId = `${id}-bpm-pop`;
@@ -226,7 +224,6 @@ function renderChip(value: string, label: string, count: number, pressed: boolea
226
224
  *
227
225
  * @param plan
228
226
  * @param ctx - `{o, s, f, total, id}` from {@link renderSounds}.
229
- * @returns
230
227
  */
231
228
  function renderToolbar(plan: ReturnType<typeof toolbarPlan>, {o, s, f, total, id}: RenderContext): string {
232
229
  const menu = (name: string, m: Omit<MenuSpec, 'id' | 'searchFrom' | 'noMatches'>) => renderMenu(name, {id, searchFrom: o.menuSearch, noMatches: s.noMatches, ...m});
@@ -239,7 +236,7 @@ function renderToolbar(plan: ReturnType<typeof toolbarPlan>, {o, s, f, total, id
239
236
  label: s.key, value: '', placeholder: s.findKey,
240
237
  options: [{value: '', label: s.anyKey}, ...f.keys.map((k) => ({value: k, label: k}))],
241
238
  }),
242
- plan.bpm && renderBpmMenu({id, s, range: f.bpm!}),
239
+ plan.bpm && renderBpmMenu({id, s, range: bpmExtent(f.bpm)!}),
243
240
  plan.loops && renderLoopFilter(s),
244
241
  plan.sorts.length > 0 && menu('sort', {
245
242
  label: s.sort, prefix: s.sortBy, value: plan.sorts[0],
@@ -282,7 +279,6 @@ const CELLS: Record<string, (sound: Sound) => string> = {
282
279
  * @param index
283
280
  * @param o
284
281
  * @param hidden - Past the first page.
285
- * @returns
286
282
  */
287
283
  export function renderRow(sound: Sound, index: number, o: ReturnType<typeof resolveRenderOptions>, hidden: boolean = false): string {
288
284
  const s = o.strings;
@@ -359,17 +355,49 @@ export function renderSounds(sounds: SoundInput[], options: WaveformSoundsOption
359
355
  + renderFooter(ctx);
360
356
  }
361
357
 
358
+ /**
359
+ * The `data-*` attributes that carry the render options set in `options` to
360
+ * the runtime (`data-page-size="20"`, `data-filters=""`, `data-strings='{…}'`),
361
+ * in the form `readDataOptions` reads — so the browser keeps what the server
362
+ * drew instead of falling back to the defaults (re-paging 20 rows to 50).
363
+ * Only options that are set are written; `player` is always written by
364
+ * {@link renderSoundsElement}. Since 2.1.0.
365
+ *
366
+ * @param options
367
+ * @returns Attributes, in {@link RENDER_OPTION_KEYS} order.
368
+ */
369
+ export function renderOptionAttributes(options: WaveformSoundsOptions = {}): Record<string, string> {
370
+ const set = pickRenderOptions(options) as Record<string, unknown>;
371
+ const o = resolveRenderOptions(options) as Record<string, unknown>;
372
+ const out: Record<string, string> = {};
373
+ for (const key of RENDER_OPTION_KEYS) {
374
+ if (key === 'player' || !(key in set)) continue;
375
+ const name = `data-${key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`;
376
+ if (key === 'strings') {
377
+ const strings = defined(set.strings as Record<string, unknown>);
378
+ if (Object.keys(strings).length) out[name] = JSON.stringify(strings);
379
+ } else if (key === 'loop' || key === 'idPrefix') {
380
+ out[name] = String(set[key]);
381
+ } else {
382
+ const value = o[key];
383
+ out[name] = Array.isArray(value) ? value.join(',') : String(value);
384
+ }
385
+ }
386
+ return out;
387
+ }
388
+
362
389
  /**
363
390
  * The full element, for callers who want one string: the wrapper div with
364
- * its `data-waveform-sounds` marker, its `data-player` and the inner markup.
391
+ * its `data-waveform-sounds` marker, its `data-player`, a `data-*` attribute
392
+ * for every other render option set (see {@link renderOptionAttributes}) and
393
+ * the inner markup. The inner markup is exactly {@link renderSounds}'.
365
394
  *
366
395
  * @param sounds
367
396
  * @param options
368
397
  * @param className - Extra classes for the wrapper.
369
- * @returns
370
398
  */
371
399
  export function renderSoundsElement(sounds: SoundInput[], options: WaveformSoundsOptions = {}, className: string = ''): string {
372
400
  const o = resolveRenderOptions(options);
373
401
  const cls = ['waveform-sounds', `waveform-sounds--${o.player}`, className].filter(Boolean).join(' ');
374
- return h('div', {class: cls, 'data-waveform-sounds': true, 'data-player': o.player}, renderSounds(sounds, options));
402
+ return h('div', {class: cls, 'data-waveform-sounds': true, 'data-player': o.player, ...renderOptionAttributes(options)}, renderSounds(sounds, options));
375
403
  }
@@ -35,12 +35,37 @@ export const RENDER_DEFAULTS: Required<Pick<WaveformSoundsOptions,
35
35
  * whatever else the caller passed. */
36
36
  export type RenderOptions = typeof RENDER_DEFAULTS & {strings: WaveformSoundsStrings, idPrefix?: string, loop?: boolean | null};
37
37
 
38
+ /**
39
+ * Every option that shapes the server markup: the render defaults, plus
40
+ * `idPrefix` (the dropdowns' ids), `loop` (whether the Loop toggle starts
41
+ * pressed) and `strings`. A wrapper that renders on the server passes
42
+ * exactly these to `renderSounds` — and the same values to the runtime, or
43
+ * the browser re-lays out what the server drew. Since 2.1.0.
44
+ */
45
+ export const RENDER_OPTION_KEYS = [...Object.keys(RENDER_DEFAULTS), 'idPrefix', 'loop', 'strings'] as (keyof WaveformSoundsOptions)[];
46
+
47
+ /**
48
+ * The render options set in `options` (those in {@link RENDER_OPTION_KEYS}
49
+ * that aren't null or undefined), for handing a component's options to
50
+ * `renderSounds` on the server. Since 2.1.0.
51
+ *
52
+ * @param options - Any `WaveformSoundsOptions` (or a component's props).
53
+ * @returns Just the render options that are set.
54
+ */
55
+ export function pickRenderOptions(options: WaveformSoundsOptions | null | undefined): WaveformSoundsOptions {
56
+ const out: Record<string, unknown> = {};
57
+ for (const key of RENDER_OPTION_KEYS) {
58
+ const value = (options as Record<string, unknown> | null | undefined)?.[key];
59
+ if (value != null) out[key] = value;
60
+ }
61
+ return out as WaveformSoundsOptions;
62
+ }
63
+
38
64
  /**
39
65
  * The object without its `undefined` entries (so spreading it can't erase
40
66
  * a default).
41
67
  *
42
68
  * @param obj
43
- * @returns
44
69
  */
45
70
  export function defined(obj: Record<string, any> | null | undefined): Record<string, any> {
46
71
  const out: Record<string, any> = {};
@@ -55,7 +80,6 @@ export function defined(obj: Record<string, any> | null | undefined): Record<str
55
80
  * @param values
56
81
  * @param allowed
57
82
  * @param fallback
58
- * @returns
59
83
  */
60
84
  export function allowedList<T extends string>(values: unknown, allowed: T[], fallback: T[]): T[] {
61
85
  return Array.isArray(values) ? values.filter((v) => allowed.includes(v)) : fallback;
@@ -66,7 +90,6 @@ export function allowedList<T extends string>(values: unknown, allowed: T[], fal
66
90
  *
67
91
  * @param value
68
92
  * @param fallback
69
- * @returns
70
93
  */
71
94
  export function wholeNumber(value: unknown, fallback: number): number {
72
95
  const n = Number(value);
@@ -78,7 +101,6 @@ export function wholeNumber(value: unknown, fallback: number): number {
78
101
  * columns are dropped, counts are whole numbers, `strings` is complete.
79
102
  *
80
103
  * @param options
81
- * @returns
82
104
  */
83
105
  export function resolveRenderOptions(options: WaveformSoundsOptions = {}): RenderOptions {
84
106
  const o = {...RENDER_DEFAULTS, ...defined(options)};
@@ -41,6 +41,7 @@ export const DEFAULT_STRINGS: WaveformSoundsStrings = {
41
41
  play: 'Play {title}',
42
42
  pause: 'Pause {title}',
43
43
  seek: 'Seek {title}',
44
+ seekValue: '{time} of {duration}',
44
45
  download: 'Download {title}',
45
46
  count: '{count} sounds',
46
47
  countOne: '1 sound',
@@ -49,6 +50,9 @@ export const DEFAULT_STRINGS: WaveformSoundsStrings = {
49
50
  empty: 'No sounds match.',
50
51
  clear: 'Clear filters',
51
52
  nowPlaying: 'Playing {title}',
53
+ playError: 'Could not play {title}',
54
+ loadError: 'Could not load the sounds.',
55
+ noSounds: 'No sounds.',
52
56
  };
53
57
 
54
58
  /** The label each sort order shows in the Sort menu. */
@@ -65,7 +69,6 @@ export const SORT_LABEL_KEYS: Record<SoundsSort, keyof WaveformSoundsStrings> =
65
69
  *
66
70
  * @param template
67
71
  * @param vars
68
- * @returns
69
72
  */
70
73
  export function fill(template: string, vars: Record<string, string|number> = {}): string {
71
74
  return String(template).replace(/\{(\w+)\}/g, (match, name) => (name in vars ? String(vars[name]) : match));
@@ -78,7 +81,6 @@ export function fill(template: string, vars: Record<string, string|number> = {})
78
81
  * @param filter
79
82
  * @param extent - The pack's BPM range.
80
83
  * @param strings
81
- * @returns
82
84
  */
83
85
  export function bpmLabel(filter: {bpmMin?: string|number, bpmMax?: string|number}, extent: {min: number, max: number}, strings: typeof DEFAULT_STRINGS = DEFAULT_STRINGS): string {
84
86
  if (!hasBpmFilter(filter)) return strings.anyBpm;
@@ -92,7 +94,6 @@ export function bpmLabel(filter: {bpmMin?: string|number, bpmMax?: string|number
92
94
  * @param shown - Sounds matching the filter.
93
95
  * @param total - All sounds.
94
96
  * @param strings
95
- * @returns
96
97
  */
97
98
  export function countText(shown: number, total: number, strings: typeof DEFAULT_STRINGS = DEFAULT_STRINGS): string {
98
99
  if (shown !== total) return fill(strings.countFiltered, {count: shown, total});
@@ -2,6 +2,6 @@
2
2
  * `@arraypress/waveform-sounds/render` — the DOM-free half, for server
3
3
  * rendering. Importing it never touches `window` or `document`.
4
4
  */
5
- export {renderSounds, renderSoundsElement, DEFAULT_STRINGS, escapeHtml} from './render/markup.js';
5
+ export {renderSounds, renderSoundsElement, DEFAULT_STRINGS, escapeHtml, RENDER_OPTION_KEYS, pickRenderOptions} from './render/markup.js';
6
6
  export {normalizeSounds, parseManifest, encodePeaks, decodePeaks, normalizeKey, facets, formatDuration} from './data/sounds.js';
7
7
  export type {SoundInput, Sound, SoundsManifest, WaveformSoundsOptions, WaveformSoundsStrings} from './types.js';
@@ -14,7 +14,6 @@ export const LOG = '[WaveformSounds]';
14
14
  * @param value
15
15
  * @param min
16
16
  * @param max
17
- * @returns
18
17
  */
19
18
  export function clamp(value: number, min: number = 0, max: number = 1): number {
20
19
  return Math.min(Math.max(value, min), max);
@@ -37,14 +36,15 @@ export function pointerFraction(clientX: number, rect: {left: number, width: num
37
36
  * must not fire there.
38
37
  *
39
38
  * @param el
40
- * @returns
41
39
  */
42
40
  export function isTyping(el: Element | null | undefined): boolean {
43
41
  return !!el && ((el as HTMLElement).isContentEditable || /^(INPUT|SELECT|TEXTAREA)$/.test(el.tagName));
44
42
  }
45
43
 
46
44
  /**
47
- * Dispatch a bubbling `waveformsounds:<name>` CustomEvent from an element.
45
+ * Dispatch a bubbling, composed `waveformsounds:<name>` CustomEvent from an
46
+ * element (composed: it leaves a shadow root, like the core's lifecycle
47
+ * events).
48
48
  * Every event the list emits goes through here, so they share one shape:
49
49
  * the detail plus the instance that sent it.
50
50
  *
@@ -54,7 +54,7 @@ export function isTyping(el: Element | null | undefined): boolean {
54
54
  * @returns The event dispatched.
55
55
  */
56
56
  export function emit(target: EventTarget, name: string, detail: Record<string, any>): CustomEvent {
57
- const event = new CustomEvent(`waveformsounds:${name}`, {bubbles: true, detail});
57
+ const event = new CustomEvent(`waveformsounds:${name}`, {bubbles: true, composed: true, detail});
58
58
  target.dispatchEvent(event);
59
59
  return event;
60
60
  }
package/src/js/types.ts CHANGED
@@ -43,8 +43,9 @@ export interface SoundInput {
43
43
  /** A loop (`true`) rather than a one-shot (the default). Loops get a
44
44
  * loop icon beside their name, the "Loops / One-shots" filter appears
45
45
  * once a list has both, and with any sound marked the Loop toggle
46
- * repeats only loops. */
47
- loop?: boolean;
46
+ * repeats only loops. As data writes it, `'true'` / `'1'` / `1` also
47
+ * mean a loop; anything else is a one-shot. */
48
+ loop?: boolean | 'true' | 'false' | '1' | '0' | 1 | 0;
48
49
  /** Stable id for `play('id')`. Defaults to `sound-<n>`, 1-based
49
50
  * (`sound-1` is the first sound). */
50
51
  id?: string;
@@ -129,6 +130,9 @@ export interface WaveformSoundsStrings {
129
130
  play: string;
130
131
  pause: string;
131
132
  seek: string;
133
+ /** The playing row's seek slider, read out: `{time}`, `{duration}`
134
+ * ("0:12 of 0:30"). Since 2.1.0. */
135
+ seekValue: string;
132
136
  download: string;
133
137
  count: string;
134
138
  countOne: string;
@@ -137,6 +141,13 @@ export interface WaveformSoundsStrings {
137
141
  empty: string;
138
142
  clear: string;
139
143
  nowPlaying: string;
144
+ /** Announced when a sound fails to load or play. Since 2.1.0. */
145
+ playError: string;
146
+ /** Shown in place of the list when it can't be built (the manifest
147
+ * fails to load or isn't a manifest). Since 2.1.0. */
148
+ loadError: string;
149
+ /** The empty state of a list with no sounds at all. Since 2.1.0. */
150
+ noSounds: string;
140
151
  }
141
152
 
142
153
  export interface WaveformSoundsOptions {
@@ -226,7 +237,10 @@ export interface WaveformSoundsOptions {
226
237
  onError?: ((error: unknown, instance: WaveformSounds) => void) | null;
227
238
  }
228
239
 
229
- /** `detail` of the `waveformsounds:*` DOM events (all bubble). */
240
+ /** `detail` of the `waveformsounds:*` DOM events. All bubble and are
241
+ * composed (they leave a shadow root); merged into `HTMLElementEventMap`,
242
+ * `DocumentEventMap` and `WindowEventMap`, so `addEventListener` on an
243
+ * element, `document` or `window` is typed. */
230
244
  export interface WaveformSoundsEventMap {
231
245
  'waveformsounds:ready': CustomEvent<{sounds: number; instance: WaveformSounds}>;
232
246
  'waveformsounds:play': CustomEvent<{sound: Sound; index: number; instance: WaveformSounds}>;
@@ -235,3 +249,16 @@ export interface WaveformSoundsEventMap {
235
249
  'waveformsounds:filter': CustomEvent<{visible: number; total: number; filter: SoundsFilter; sort: SoundsSort; instance: WaveformSounds}>;
236
250
  'waveformsounds:error': CustomEvent<{error: unknown; sound?: Sound; index?: number; instance: WaveformSounds}>;
237
251
  }
252
+
253
+ /** The plain events a {@link WaveformSounds} dispatches on itself — it is an
254
+ * `EventTarget`, so `list.addEventListener('play', …)` works and is typed.
255
+ * Each mirrors a `waveformsounds:*` container event (whose `detail`
256
+ * carries the data); the matching `on*` callback still runs. Since 2.1.0. */
257
+ export interface WaveformSoundsInstanceEventMap {
258
+ ready: Event;
259
+ play: Event;
260
+ pause: Event;
261
+ end: Event;
262
+ filter: Event;
263
+ error: Event;
264
+ }
@@ -25,13 +25,31 @@
25
25
  *
26
26
  * @module core
27
27
  */
28
- import { facets, matches, normalizeSounds, parseManifest, sortSounds } from '../data/sounds.js';
28
+ import { facets, formatDuration, matches, normalizeSounds, parseManifest, sortSounds } from '../data/sounds.js';
29
29
  import { DEFAULT_OPTIONS } from './options.js';
30
30
  import { renderSounds } from '../render/markup.js';
31
- import type { decodePeaks, encodePeaks, formatDuration, normalizeKey } from '../data/sounds.js';
32
- import type { Sound, SoundsFilter, SoundsSort, WaveformSoundsOptions, WaveformSoundsStrings } from '../types.js';
31
+ import type { decodePeaks, encodePeaks, normalizeKey } from '../data/sounds.js';
32
+ import type { WaveformPlayer } from '@arraypress/waveform-player';
33
+ import type { Sound, SoundsFilter, SoundsSort, WaveformSoundsInstanceEventMap, WaveformSoundsOptions, WaveformSoundsStrings } from '../types.js';
33
34
  export { DEFAULT_OPTIONS };
34
- export declare class WaveformSounds {
35
+ /**
36
+ * Typed listeners for the events a list dispatches on itself (see
37
+ * {@link WaveformSoundsInstanceEventMap}). Types only: merged into the class
38
+ * below, it emits nothing.
39
+ */
40
+ export interface WaveformSounds {
41
+ addEventListener<K extends keyof WaveformSoundsInstanceEventMap>(type: K, listener: (this: WaveformSounds, ev: WaveformSoundsInstanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
42
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
43
+ removeEventListener<K extends keyof WaveformSoundsInstanceEventMap>(type: K, listener: (this: WaveformSounds, ev: WaveformSoundsInstanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
44
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
45
+ }
46
+ /**
47
+ * An `EventTarget`, like the core's player: each moment is dispatched on the
48
+ * instance as a plain event (`ready`, `play`, `pause`, `end`, `filter`,
49
+ * `error`), and on the container as a bubbling, composed
50
+ * `waveformsounds:<name>` CustomEvent carrying the details.
51
+ */
52
+ export declare class WaveformSounds extends EventTarget {
35
53
  /** Every live instance, by its element. */
36
54
  static instances: Map<Element, WaveformSounds>;
37
55
  /** The pure helpers, for `<script>` users (attached in `entry.ts`). */
@@ -47,6 +65,11 @@ export declare class WaveformSounds {
47
65
  formatDuration: typeof formatDuration;
48
66
  renderSounds: typeof renderSounds;
49
67
  };
68
+ /** Register the `<waveform-sounds>` element (default tag name
69
+ * `waveform-sounds`). The default entry does this on import; this
70
+ * reaches it from a `<script>` page that opted out of auto-init.
71
+ * Attached in `entry.ts`. Since 2.1.0. */
72
+ static defineElement: (name?: string) => CustomElementConstructor | undefined;
50
73
  /** Every option with its default (attached in `entry.ts`). */
51
74
  static DEFAULT_OPTIONS: WaveformSoundsOptions;
52
75
  /** The English UI strings (attached in `entry.ts`). */
@@ -65,8 +88,9 @@ export declare class WaveformSounds {
65
88
  readonly filter: SoundsFilter;
66
89
  readonly sortBy: SoundsSort;
67
90
  readonly playing: boolean;
68
- /** The engine `WaveformPlayer`, created on first play. */
69
- readonly engine: unknown;
91
+ /** The engine `WaveformPlayer`: built when the list is ready if the
92
+ * player is on the page (else on first play), null before and after. */
93
+ readonly engine: WaveformPlayer | null;
70
94
  /**
71
95
  * @param {HTMLElement|string} container - The element (or a selector).
72
96
  * @param {WaveformSoundsOptions} [options]
@@ -121,10 +145,17 @@ export declare class WaveformSounds {
121
145
  * Tear down: listeners, observers, timers and the engine. Markup this
122
146
  * instance rendered is restored to what the container held before.
123
147
  * ADOPTED (server-rendered) markup is left as it is now — rows may be
124
- * re-sorted, hidden or marked current — so to start again, re-render it
125
- * rather than constructing a new instance over it.
148
+ * re-sorted, hidden or marked current — unless `restore` is set: then it
149
+ * is put back exactly as the server sent it, ready for a new instance
150
+ * (what a framework re-mounting the same markup wants).
151
+ *
152
+ * @param options
153
+ * @param options.restore - Put adopted server markup back as it was.
154
+ * Default false. Since 2.1.0.
126
155
  */
127
- destroy(): void;
156
+ destroy(options?: {
157
+ restore?: boolean;
158
+ }): void;
128
159
  /**
129
160
  * Initialise every `[data-waveform-sounds]` under `root` that isn't yet.
130
161
  *
@@ -135,7 +166,6 @@ export declare class WaveformSounds {
135
166
  /**
136
167
  * The instance on an element (or selector), if any.
137
168
  * @param el
138
- * @returns
139
169
  */
140
170
  static getInstance(el: Element | string): WaveformSounds | null;
141
171
  /** Destroy instances whose element has left the document (after a
@@ -1 +1 @@
1
- {"version":3,"file":"WaveformSounds.d.ts","sourceRoot":"","sources":["../../src/js/core/WaveformSounds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAiB,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AAKrH,OAAO,EAAC,eAAe,EAAgC,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAiB,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAOjE,OAAO,KAAK,EAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAG9F,OAAO,KAAK,EAAC,KAAK,EAAc,YAAY,EAAoB,UAAU,EAAE,qBAAqB,EAAE,qBAAqB,EAAC,MAAM,aAAa,CAAC;AAwC7I,OAAO,EAAC,eAAe,EAAC,CAAC;AAYzB,qBAAa,cAAc;IACvB,2CAA2C;IAC3C,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAa;IAC3D,uEAAuE;IACvE,OAAe,KAAK,EAAE;QAClB,WAAW,EAAE,OAAO,WAAW,CAAC;QAChC,WAAW,EAAE,OAAO,WAAW,CAAC;QAChC,YAAY,EAAE,OAAO,YAAY,CAAC;QAClC,eAAe,EAAE,OAAO,eAAe,CAAC;QACxC,aAAa,EAAE,OAAO,aAAa,CAAC;QACpC,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,OAAO,EAAE,OA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