@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.mjs
CHANGED
|
@@ -9738,11 +9738,16 @@ var DawEditorElement = class extends LitElement14 {
|
|
|
9738
9738
|
if (els.length < 2) return;
|
|
9739
9739
|
const byId = new Map(els.map((el) => [el.trackId, el]));
|
|
9740
9740
|
const desired = tracks.map((t) => byId.get(t.id)).filter((el) => el != null);
|
|
9741
|
-
if (desired.length
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9741
|
+
if (desired.length < 2) return;
|
|
9742
|
+
const desiredSet = new Set(desired);
|
|
9743
|
+
const slots = els.filter((el) => desiredSet.has(el));
|
|
9744
|
+
if (desired.every((el, i) => el === slots[i])) return;
|
|
9745
|
+
for (let i = 0; i < desired.length; i++) {
|
|
9746
|
+
if (slots[i] === desired[i]) continue;
|
|
9747
|
+
slots[i].before(desired[i]);
|
|
9748
|
+
const from = slots.indexOf(desired[i]);
|
|
9749
|
+
slots.splice(from, 1);
|
|
9750
|
+
slots.splice(i, 0, desired[i]);
|
|
9746
9751
|
}
|
|
9747
9752
|
}
|
|
9748
9753
|
_getOrderedTracks() {
|