@waveform-playlist/core 13.0.0-next.3 → 13.0.0-next.5
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/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -81,9 +81,14 @@ type SpectrogramDisplayConfig = Pick<SpectrogramConfig, 'frequencyScale' | 'minF
|
|
|
81
81
|
* mode: it is always drawn as a piano roll.
|
|
82
82
|
*/
|
|
83
83
|
type RenderMode = 'waveform' | 'spectrogram' | 'both';
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Per-track overrides for spectrogram rendering, each set only when the user
|
|
86
|
+
* chose it: a render mode from the track menu, a config and colour map from
|
|
87
|
+
* the settings. A field left out falls back to the track's own value.
|
|
88
|
+
*/
|
|
85
89
|
interface TrackSpectrogramOverrides {
|
|
86
|
-
renderMode
|
|
90
|
+
/** Absent until a mode is chosen; the track's own `renderMode` applies meanwhile. */
|
|
91
|
+
renderMode?: RenderMode;
|
|
87
92
|
config?: SpectrogramConfig;
|
|
88
93
|
colorMap?: ColorMapValue;
|
|
89
94
|
}
|
|
@@ -1257,7 +1262,9 @@ declare function keyBelongsToFocusedControl(event: KeyboardEvent): boolean;
|
|
|
1257
1262
|
* Pure function, no framework dependency.
|
|
1258
1263
|
*
|
|
1259
1264
|
* Shortcuts do not fire for a key the focused control uses itself; see
|
|
1260
|
-
* `keyBelongsToFocusedControl`.
|
|
1265
|
+
* `keyBelongsToFocusedControl`. Nor for an Escape whose default something
|
|
1266
|
+
* other than a shortcut already prevented (a drag cancelled it): an Escape that
|
|
1267
|
+
* cancelled a drag does nothing else.
|
|
1261
1268
|
*/
|
|
1262
1269
|
declare function handleKeyboardEvent(event: KeyboardEvent, shortcuts: KeyboardShortcut[], enabled: boolean): void;
|
|
1263
1270
|
|
package/dist/index.d.ts
CHANGED
|
@@ -81,9 +81,14 @@ type SpectrogramDisplayConfig = Pick<SpectrogramConfig, 'frequencyScale' | 'minF
|
|
|
81
81
|
* mode: it is always drawn as a piano roll.
|
|
82
82
|
*/
|
|
83
83
|
type RenderMode = 'waveform' | 'spectrogram' | 'both';
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Per-track overrides for spectrogram rendering, each set only when the user
|
|
86
|
+
* chose it: a render mode from the track menu, a config and colour map from
|
|
87
|
+
* the settings. A field left out falls back to the track's own value.
|
|
88
|
+
*/
|
|
85
89
|
interface TrackSpectrogramOverrides {
|
|
86
|
-
renderMode
|
|
90
|
+
/** Absent until a mode is chosen; the track's own `renderMode` applies meanwhile. */
|
|
91
|
+
renderMode?: RenderMode;
|
|
87
92
|
config?: SpectrogramConfig;
|
|
88
93
|
colorMap?: ColorMapValue;
|
|
89
94
|
}
|
|
@@ -1257,7 +1262,9 @@ declare function keyBelongsToFocusedControl(event: KeyboardEvent): boolean;
|
|
|
1257
1262
|
* Pure function, no framework dependency.
|
|
1258
1263
|
*
|
|
1259
1264
|
* Shortcuts do not fire for a key the focused control uses itself; see
|
|
1260
|
-
* `keyBelongsToFocusedControl`.
|
|
1265
|
+
* `keyBelongsToFocusedControl`. Nor for an Escape whose default something
|
|
1266
|
+
* other than a shortcut already prevented (a drag cancelled it): an Escape that
|
|
1267
|
+
* cancelled a drag does nothing else.
|
|
1261
1268
|
*/
|
|
1262
1269
|
declare function handleKeyboardEvent(event: KeyboardEvent, shortcuts: KeyboardShortcut[], enabled: boolean): void;
|
|
1263
1270
|
|
package/dist/index.js
CHANGED
|
@@ -1120,14 +1120,17 @@ function keyBelongsToFocusedControl(event) {
|
|
|
1120
1120
|
if (ownsAllKeys(focused)) return true;
|
|
1121
1121
|
return activates(focused, event.key);
|
|
1122
1122
|
}
|
|
1123
|
+
var preventedByShortcut = /* @__PURE__ */ new WeakSet();
|
|
1123
1124
|
function handleKeyboardEvent(event, shortcuts, enabled) {
|
|
1124
1125
|
if (!enabled) return;
|
|
1125
1126
|
if (event.repeat) return;
|
|
1127
|
+
if (event.key === "Escape" && event.defaultPrevented && !preventedByShortcut.has(event)) return;
|
|
1126
1128
|
if (keyBelongsToFocusedControl(event)) return;
|
|
1127
1129
|
const matchingShortcut = shortcuts.find((shortcut) => matchesKeyBinding(event, shortcut));
|
|
1128
1130
|
if (matchingShortcut) {
|
|
1129
1131
|
if (matchingShortcut.preventDefault !== false) {
|
|
1130
1132
|
event.preventDefault();
|
|
1133
|
+
preventedByShortcut.add(event);
|
|
1131
1134
|
}
|
|
1132
1135
|
matchingShortcut.action();
|
|
1133
1136
|
}
|