@dawcore/components 0.0.36 → 0.0.37
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.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9790,11 +9790,16 @@ var DawEditorElement = class extends import_lit19.LitElement {
|
|
|
9790
9790
|
if (els.length < 2) return;
|
|
9791
9791
|
const byId = new Map(els.map((el) => [el.trackId, el]));
|
|
9792
9792
|
const desired = tracks.map((t) => byId.get(t.id)).filter((el) => el != null);
|
|
9793
|
-
if (desired.length
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9793
|
+
if (desired.length < 2) return;
|
|
9794
|
+
const desiredSet = new Set(desired);
|
|
9795
|
+
const slots = els.filter((el) => desiredSet.has(el));
|
|
9796
|
+
if (desired.every((el, i) => el === slots[i])) return;
|
|
9797
|
+
for (let i = 0; i < desired.length; i++) {
|
|
9798
|
+
if (slots[i] === desired[i]) continue;
|
|
9799
|
+
slots[i].before(desired[i]);
|
|
9800
|
+
const from = slots.indexOf(desired[i]);
|
|
9801
|
+
slots.splice(from, 1);
|
|
9802
|
+
slots.splice(i, 0, desired[i]);
|
|
9798
9803
|
}
|
|
9799
9804
|
}
|
|
9800
9805
|
_getOrderedTracks() {
|