@arraypress/waveform-sounds 0.3.1 → 2.0.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/LICENSE +1 -1
- package/README.md +19 -1
- package/dist/waveform-sounds-no-autoinit.esm.js +121 -97
- package/dist/waveform-sounds-render.esm.js +24 -10
- package/dist/waveform-sounds.css +62 -76
- package/dist/waveform-sounds.esm.js +122 -98
- package/dist/waveform-sounds.js +123 -98
- package/dist/waveform-sounds.min.css +1 -1
- package/dist/waveform-sounds.min.js +1 -1
- package/package.json +36 -33
- package/src/css/waveform-sounds.css +62 -76
- package/src/js/core/{WaveformSounds.js → WaveformSounds.ts} +301 -191
- package/src/js/core/engine.ts +101 -0
- package/src/js/core/{options.js → options.ts} +33 -28
- package/src/js/data/{bpm.js → bpm.ts} +17 -17
- package/src/js/data/{navigation.js → navigation.ts} +17 -17
- package/src/js/data/{sounds.js → sounds.ts} +62 -61
- package/src/js/data/{url-state.js → url-state.ts} +27 -26
- package/src/js/dom/{colors.js → colors.ts} +12 -12
- package/src/js/dom/{draw.js → draw.ts} +17 -17
- package/src/js/dom/{menus.js → menus.ts} +72 -55
- package/src/js/dom/{rows.js → rows.ts} +18 -17
- package/src/js/{entry.js → entry.ts} +25 -0
- package/src/js/render/{html.js → html.ts} +18 -12
- package/src/js/render/{icons.js → icons.ts} +4 -4
- package/src/js/render/{markup.js → markup.ts} +82 -60
- package/src/js/render/{options.js → options.ts} +26 -20
- package/src/js/render/{strings.js → strings.ts} +17 -16
- package/src/js/{render-entry.js → render-entry.ts} +1 -0
- package/src/js/shared/{utils.js → utils.ts} +22 -22
- package/{index.d.ts → src/js/types.ts} +12 -87
- package/types/core/WaveformSounds.d.ts +145 -0
- package/types/core/WaveformSounds.d.ts.map +1 -0
- package/types/core/engine.d.ts +67 -0
- package/types/core/engine.d.ts.map +1 -0
- package/types/core/options.d.ts +76 -0
- package/types/core/options.d.ts.map +1 -0
- package/types/data/bpm.d.ts +67 -0
- package/types/data/bpm.d.ts.map +1 -0
- package/types/data/navigation.d.ts +53 -0
- package/types/data/navigation.d.ts.map +1 -0
- package/types/data/sounds.d.ts +167 -0
- package/types/data/sounds.d.ts.map +1 -0
- package/types/data/url-state.d.ts +83 -0
- package/types/data/url-state.d.ts.map +1 -0
- package/types/dom/colors.d.ts +35 -0
- package/types/dom/colors.d.ts.map +1 -0
- package/types/dom/draw.d.ts +73 -0
- package/types/dom/draw.d.ts.map +1 -0
- package/types/dom/menus.d.ts +77 -0
- package/types/dom/menus.d.ts.map +1 -0
- package/types/dom/rows.d.ts +42 -0
- package/types/dom/rows.d.ts.map +1 -0
- package/types/entry.d.ts +22 -0
- package/types/entry.d.ts.map +1 -0
- package/types/index.d.ts +16 -0
- package/types/index.d.ts.map +1 -0
- package/types/render/html.d.ts +39 -0
- package/types/render/html.d.ts.map +1 -0
- package/types/render/icons.d.ts +17 -0
- package/types/render/icons.d.ts.map +1 -0
- package/types/render/markup.d.ts +132 -0
- package/types/render/markup.d.ts.map +1 -0
- package/types/render/options.d.ts +56 -0
- package/types/render/options.d.ts.map +1 -0
- package/types/render/strings.d.ts +46 -0
- package/types/render/strings.d.ts.map +1 -0
- package/types/render-entry.d.ts +8 -0
- package/types/render-entry.d.ts.map +1 -0
- package/types/shared/utils.d.ts +57 -0
- package/types/shared/utils.d.ts.map +1 -0
- package/types/types.d.ts +254 -0
- package/types/types.d.ts.map +1 -0
- package/types/vendor/arraypress-text.d.ts +250 -0
- package/dist/waveform-sounds-no-autoinit.cjs +0 -2159
- package/dist/waveform-sounds-render.cjs +0 -614
- package/dist/waveform-sounds.cjs +0 -2181
- package/no-autoinit.d.ts +0 -2
- package/render.d.ts +0 -5
- package/src/js/core/engine.js +0 -57
- /package/src/js/{index.js → index.ts} +0 -0
|
@@ -43,6 +43,14 @@
|
|
|
43
43
|
color: inherit;
|
|
44
44
|
font: inherit;
|
|
45
45
|
}
|
|
46
|
+
/* The inverse above is relative colour: Chrome 122, Firefox 128, Safari 18,
|
|
47
|
+
* all newer than the 2.0 floor. Where it's invalid, until the runtime
|
|
48
|
+
* measures --ws-surface (a server-rendered first paint, or no script), the
|
|
49
|
+
* ink would be the text colour on a text-colour fill: use the system
|
|
50
|
+
* background instead, as the dropdowns do. */
|
|
51
|
+
@supports not (color: rgb(from red calc(255 - r) calc(255 - g) calc(255 - b))) {
|
|
52
|
+
.waveform-sounds { --ws-on-accent: var(--ws-surface, Canvas); }
|
|
53
|
+
}
|
|
46
54
|
.waveform-sounds *, .waveform-sounds *::before, .waveform-sounds *::after { box-sizing: border-box; }
|
|
47
55
|
.waveform-sounds [hidden] { display: none !important; }
|
|
48
56
|
|
|
@@ -51,12 +59,26 @@
|
|
|
51
59
|
width: 1px; height: 1px;
|
|
52
60
|
margin: -1px; padding: 0;
|
|
53
61
|
overflow: hidden;
|
|
54
|
-
clip:
|
|
62
|
+
clip-path: inset(50%);
|
|
55
63
|
white-space: nowrap;
|
|
56
64
|
border: 0;
|
|
57
65
|
}
|
|
58
66
|
.ws-icon { width: 1em; height: 1em; fill: currentColor; flex: none; }
|
|
59
67
|
|
|
68
|
+
/* ── Controls: shared ────────────────────────────────────────────────── */
|
|
69
|
+
/* The pill-shaped controls share one frame... */
|
|
70
|
+
.ws-search, .ws-menu-btn, .ws-seg, .ws-loop, .ws-chip, .ws-clear, .ws-more {
|
|
71
|
+
border: 1px solid var(--ws-border);
|
|
72
|
+
border-radius: var(--ws-control-radius);
|
|
73
|
+
}
|
|
74
|
+
/* ...and every button starts from the text around it. */
|
|
75
|
+
.ws-menu-btn, .ws-bpm-clear, .ws-seg-btn, .ws-loop, .ws-chip, .ws-clear, .ws-more {
|
|
76
|
+
background: none;
|
|
77
|
+
color: inherit;
|
|
78
|
+
font: inherit;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
|
|
60
82
|
/* ── Toolbar ─────────────────────────────────────────────────────────── */
|
|
61
83
|
.ws-toolbar {
|
|
62
84
|
display: flex;
|
|
@@ -73,8 +95,6 @@
|
|
|
73
95
|
min-width: 0;
|
|
74
96
|
height: 2.75rem;
|
|
75
97
|
padding: 0 1rem;
|
|
76
|
-
border: 1px solid var(--ws-border);
|
|
77
|
-
border-radius: var(--ws-control-radius);
|
|
78
98
|
background: var(--ws-field);
|
|
79
99
|
color: inherit;
|
|
80
100
|
cursor: text;
|
|
@@ -90,11 +110,12 @@
|
|
|
90
110
|
font: inherit;
|
|
91
111
|
outline: none;
|
|
92
112
|
}
|
|
93
|
-
.ws-search .ws-icon { color: var(--ws-muted); }
|
|
94
|
-
.
|
|
113
|
+
.ws-search .ws-icon, .ws-search-input::placeholder { color: var(--ws-muted); }
|
|
114
|
+
/* WebKit/Blink's clear button, redrawn in the text colour. The mask stays
|
|
115
|
+
* prefixed: unprefixed `mask` is Chrome/Edge 120+. */
|
|
95
116
|
.ws-search-input::-webkit-search-cancel-button,
|
|
96
117
|
.ws-menu-search::-webkit-search-cancel-button {
|
|
97
|
-
|
|
118
|
+
appearance: none;
|
|
98
119
|
width: 0.9em;
|
|
99
120
|
height: 0.9em;
|
|
100
121
|
background: currentColor;
|
|
@@ -103,7 +124,9 @@
|
|
|
103
124
|
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.4 5 5 6.4 10.6 12 5 17.6 6.4 19l5.6-5.6 5.6 5.6 1.4-1.4-5.6-5.6L19 6.4 17.6 5 12 10.6z'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
104
125
|
}
|
|
105
126
|
|
|
127
|
+
/* The row of menus, the loops filter and the Loop toggle. */
|
|
106
128
|
.ws-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
|
|
129
|
+
|
|
107
130
|
/* ── Dropdowns (type / key / sort) ──────────────────────────────────── */
|
|
108
131
|
.ws-menu { position: relative; }
|
|
109
132
|
.ws-menu-btn {
|
|
@@ -113,18 +136,13 @@
|
|
|
113
136
|
height: 2.75rem;
|
|
114
137
|
max-width: 16rem;
|
|
115
138
|
padding: 0 0.85rem 0 1rem;
|
|
116
|
-
border: 1px solid var(--ws-border);
|
|
117
|
-
border-radius: var(--ws-control-radius);
|
|
118
139
|
background: var(--ws-field);
|
|
119
|
-
color: inherit;
|
|
120
|
-
font: inherit;
|
|
121
140
|
font-size: 0.9em;
|
|
122
|
-
cursor: pointer;
|
|
123
141
|
}
|
|
124
142
|
.ws-menu-btn:hover { background: var(--ws-hover); }
|
|
125
143
|
.ws-menu-btn[aria-expanded='true'] { border-color: var(--ws-accent); }
|
|
126
144
|
.ws-menu-prefix { color: var(--ws-muted); }
|
|
127
|
-
.ws-menu-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
145
|
+
.ws-menu-value, .ws-menu-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
128
146
|
.ws-menu-chevron { font-size: 1.1em; color: var(--ws-muted); transition: transform 0.15s; }
|
|
129
147
|
.ws-menu-btn[aria-expanded='true'] .ws-menu-chevron { transform: rotate(180deg); }
|
|
130
148
|
.ws-menu-pop {
|
|
@@ -172,7 +190,7 @@
|
|
|
172
190
|
.ws-menu-check { visibility: hidden; flex: none; }
|
|
173
191
|
.ws-menu-option[aria-selected='true'] { font-weight: 600; }
|
|
174
192
|
.ws-menu-option[aria-selected='true'] .ws-menu-check { visibility: visible; }
|
|
175
|
-
.ws-menu-text { flex: 1; min-width: 0;
|
|
193
|
+
.ws-menu-text { flex: 1; min-width: 0; }
|
|
176
194
|
.ws-menu-count { font-family: var(--ws-mono); font-size: 0.85em; color: var(--ws-muted); }
|
|
177
195
|
.ws-menu-none { margin: 0; padding: 0.6rem; color: var(--ws-muted); font-size: 0.9em; }
|
|
178
196
|
|
|
@@ -180,15 +198,7 @@
|
|
|
180
198
|
.ws-bpm-pop { width: 17rem; padding: 0.85rem 1rem 0.7rem; }
|
|
181
199
|
.ws-bpm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
|
|
182
200
|
.ws-bpm-readout { font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
183
|
-
.ws-bpm-clear {
|
|
184
|
-
padding: 0;
|
|
185
|
-
border: 0;
|
|
186
|
-
background: none;
|
|
187
|
-
color: var(--ws-muted);
|
|
188
|
-
font: inherit;
|
|
189
|
-
font-size: 0.85em;
|
|
190
|
-
cursor: pointer;
|
|
191
|
-
}
|
|
201
|
+
.ws-bpm-clear { padding: 0; border: 0; color: var(--ws-muted); font-size: 0.85em; }
|
|
192
202
|
.ws-bpm-clear:hover { color: inherit; text-decoration: underline; }
|
|
193
203
|
|
|
194
204
|
/* Two native range inputs stacked on one track. The track and the filled
|
|
@@ -229,12 +239,13 @@
|
|
|
229
239
|
margin: 0;
|
|
230
240
|
background: none;
|
|
231
241
|
pointer-events: none;
|
|
232
|
-
-webkit-appearance: none;
|
|
233
242
|
appearance: none;
|
|
234
243
|
}
|
|
235
244
|
/* When the handles meet, the lower one goes on top (it's the one that can
|
|
236
245
|
* still move: left). */
|
|
237
246
|
.ws-range.is-min-top [data-ws-bpm-min] { z-index: 2; }
|
|
247
|
+
/* The track and thumb pseudo-elements are per engine, each in its own
|
|
248
|
+
* rule: a browser drops a whole selector list over one it doesn't know. */
|
|
238
249
|
.ws-range-input::-webkit-slider-runnable-track { height: 100%; background: none; }
|
|
239
250
|
.ws-range-input::-moz-range-track { background: none; }
|
|
240
251
|
.ws-range-input::-webkit-slider-thumb {
|
|
@@ -247,7 +258,6 @@
|
|
|
247
258
|
box-shadow: 0 0 0 1px var(--ws-border);
|
|
248
259
|
cursor: grab;
|
|
249
260
|
pointer-events: auto;
|
|
250
|
-
-webkit-appearance: none;
|
|
251
261
|
appearance: none;
|
|
252
262
|
}
|
|
253
263
|
.ws-range-input::-moz-range-thumb {
|
|
@@ -274,50 +284,35 @@
|
|
|
274
284
|
font-size: 0.75em;
|
|
275
285
|
font-variant-numeric: tabular-nums;
|
|
276
286
|
}
|
|
277
|
-
.ws-loop {
|
|
278
|
-
display: inline-flex;
|
|
279
|
-
align-items: center;
|
|
280
|
-
gap: 0.45rem;
|
|
281
|
-
height: 2.75rem;
|
|
282
|
-
padding: 0 1rem;
|
|
283
|
-
border: 1px solid var(--ws-border);
|
|
284
|
-
border-radius: var(--ws-control-radius);
|
|
285
|
-
background: none;
|
|
286
|
-
color: inherit;
|
|
287
|
-
font: inherit;
|
|
288
|
-
font-size: 0.9em;
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
}
|
|
291
|
-
.ws-loop[aria-pressed='true'] { border-color: var(--ws-accent); background: var(--ws-accent); }
|
|
292
|
-
.ws-loop[aria-pressed='true'] > * { color: var(--ws-on-accent); }
|
|
293
287
|
|
|
294
|
-
/* Loops or one-shots: a segmented control, one button pressed
|
|
288
|
+
/* ── Loops or one-shots: a segmented control, one button pressed ─────── */
|
|
295
289
|
.ws-seg {
|
|
296
290
|
display: inline-flex;
|
|
297
291
|
height: 2.75rem;
|
|
298
292
|
padding: 0.25rem;
|
|
299
293
|
gap: 0.15rem;
|
|
300
|
-
border: 1px solid var(--ws-border);
|
|
301
|
-
border-radius: var(--ws-control-radius);
|
|
302
294
|
}
|
|
303
295
|
.ws-seg-btn {
|
|
304
296
|
padding: 0 0.85rem;
|
|
305
297
|
border: 0;
|
|
306
298
|
border-radius: var(--ws-control-radius);
|
|
307
|
-
background: none;
|
|
308
|
-
color: inherit;
|
|
309
|
-
font: inherit;
|
|
310
299
|
font-size: 0.88em;
|
|
311
300
|
white-space: nowrap;
|
|
312
|
-
cursor: pointer;
|
|
313
301
|
transition: background 0.15s;
|
|
314
302
|
}
|
|
315
303
|
.ws-seg-btn:hover { background: var(--ws-hover); }
|
|
316
|
-
/* On the accent the CHILD takes the inverted ink: the button itself never
|
|
317
|
-
* sets a colour (see the pause icon note at the top). */
|
|
318
|
-
.ws-seg-btn[aria-pressed='true'] { background: var(--ws-accent); }
|
|
319
|
-
.ws-seg-btn[aria-pressed='true'] > * { color: var(--ws-on-accent); }
|
|
320
304
|
|
|
305
|
+
/* ── The Loop toggle ─────────────────────────────────────────────────── */
|
|
306
|
+
.ws-loop {
|
|
307
|
+
display: inline-flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: 0.45rem;
|
|
310
|
+
height: 2.75rem;
|
|
311
|
+
padding: 0 1rem;
|
|
312
|
+
font-size: 0.9em;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* ── Type chips and the count ────────────────────────────────────────── */
|
|
321
316
|
.ws-meta { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
|
|
322
317
|
.ws-types { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1 1 auto; min-width: 0; }
|
|
323
318
|
.ws-chip {
|
|
@@ -326,23 +321,25 @@
|
|
|
326
321
|
gap: 0.4rem;
|
|
327
322
|
height: 2.25rem;
|
|
328
323
|
padding: 0 0.9rem;
|
|
329
|
-
border: 1px solid var(--ws-border);
|
|
330
|
-
border-radius: var(--ws-control-radius);
|
|
331
|
-
background: none;
|
|
332
|
-
color: inherit;
|
|
333
|
-
font: inherit;
|
|
334
324
|
font-size: 0.88em;
|
|
335
|
-
cursor: pointer;
|
|
336
325
|
transition: border-color 0.15s, background 0.15s;
|
|
337
326
|
}
|
|
338
327
|
.ws-chip:hover { background: var(--ws-hover); }
|
|
328
|
+
.ws-chip-count { font-family: var(--ws-mono); font-size: 0.85em; opacity: 0.7; }
|
|
329
|
+
.ws-count { margin: 0 0 0 auto; color: var(--ws-muted); font-size: 0.88em; font-variant-numeric: tabular-nums; }
|
|
330
|
+
|
|
331
|
+
/* ── The pressed controls: the accent fill, inverted ink ─────────────── */
|
|
332
|
+
/* After the hovers, so a pressed control keeps its fill under the pointer.
|
|
333
|
+
* The CHILDREN take the ink, never the button (THE ONE RULE, at the top). */
|
|
334
|
+
.ws-loop[aria-pressed='true'],
|
|
339
335
|
.ws-chip[aria-pressed='true'] { border-color: var(--ws-accent); background: var(--ws-accent); }
|
|
336
|
+
.ws-seg-btn[aria-pressed='true'] { background: var(--ws-accent); }
|
|
337
|
+
.ws-loop[aria-pressed='true'] > *,
|
|
338
|
+
.ws-seg-btn[aria-pressed='true'] > *,
|
|
340
339
|
.ws-chip[aria-pressed='true'] > * { color: var(--ws-on-accent); }
|
|
341
|
-
.ws-chip-count { font-family: var(--ws-mono); font-size: 0.85em; opacity: 0.7; }
|
|
342
340
|
/* Full ink on the accent: a dimmed count on a saturated fill fails contrast
|
|
343
341
|
* (70% measured 4.04:1 on #ff4f24). */
|
|
344
342
|
.ws-chip[aria-pressed='true'] .ws-chip-count { opacity: 1; }
|
|
345
|
-
.ws-count { margin: 0 0 0 auto; color: var(--ws-muted); font-size: 0.88em; font-variant-numeric: tabular-nums; }
|
|
346
343
|
|
|
347
344
|
/* ── Rows ────────────────────────────────────────────────────────────── */
|
|
348
345
|
.ws-list {
|
|
@@ -365,14 +362,17 @@
|
|
|
365
362
|
.ws-row.is-current { background: var(--ws-current); }
|
|
366
363
|
.ws-row.is-error .ws-title { text-decoration: line-through; opacity: 0.6; }
|
|
367
364
|
|
|
368
|
-
|
|
365
|
+
/* The play button and the download link: round icon buttons. */
|
|
366
|
+
.ws-play, .ws-download {
|
|
369
367
|
flex: none;
|
|
370
368
|
display: grid;
|
|
371
369
|
place-items: center;
|
|
372
370
|
width: 2.25rem;
|
|
373
371
|
height: 2.25rem;
|
|
374
|
-
border: 0;
|
|
375
372
|
border-radius: 999px;
|
|
373
|
+
}
|
|
374
|
+
.ws-play {
|
|
375
|
+
border: 0;
|
|
376
376
|
background: var(--ws-field);
|
|
377
377
|
color: inherit;
|
|
378
378
|
font-size: 0.95rem;
|
|
@@ -419,12 +419,6 @@
|
|
|
419
419
|
}
|
|
420
420
|
.ws-canvas { display: block; width: 100%; height: 100%; }
|
|
421
421
|
.ws-download {
|
|
422
|
-
flex: none;
|
|
423
|
-
display: grid;
|
|
424
|
-
place-items: center;
|
|
425
|
-
width: 2.25rem;
|
|
426
|
-
height: 2.25rem;
|
|
427
|
-
border-radius: 999px;
|
|
428
422
|
color: var(--ws-muted);
|
|
429
423
|
font-size: 1.05rem;
|
|
430
424
|
text-decoration: none;
|
|
@@ -462,14 +456,6 @@
|
|
|
462
456
|
|
|
463
457
|
/* ── Footer bits ─────────────────────────────────────────────────────── */
|
|
464
458
|
.ws-empty { margin: 1.5rem 0; color: var(--ws-muted); }
|
|
465
|
-
.ws-clear, .ws-more {
|
|
466
|
-
border: 1px solid var(--ws-border);
|
|
467
|
-
border-radius: var(--ws-control-radius);
|
|
468
|
-
background: none;
|
|
469
|
-
color: inherit;
|
|
470
|
-
font: inherit;
|
|
471
|
-
cursor: pointer;
|
|
472
|
-
}
|
|
473
459
|
.ws-clear { margin-left: 0.5rem; padding: 0.35rem 0.85rem; font-size: 0.88em; }
|
|
474
460
|
.ws-more { display: block; margin: 1.25rem auto 0; padding: 0.7rem 1.4rem; font-size: 0.92em; }
|
|
475
461
|
.ws-more:hover, .ws-clear:hover { background: var(--ws-hover); }
|
|
@@ -501,5 +487,5 @@
|
|
|
501
487
|
}
|
|
502
488
|
|
|
503
489
|
@media (prefers-reduced-motion: reduce) {
|
|
504
|
-
.ws-row, .ws-chip, .ws-play { transition: none; }
|
|
490
|
+
.ws-row, .ws-chip, .ws-play, .ws-seg-btn, .ws-download, .ws-menu-chevron { transition: none; }
|
|
505
491
|
}
|