|
|
|
@ -57,9 +57,9 @@ export function index(_, i) {
|
|
|
|
|
* subsequent destruction. Used in each blocks
|
|
|
|
|
* @param {import('#client').EachItem[]} items
|
|
|
|
|
* @param {null | Node} controlled_anchor
|
|
|
|
|
* @param {() => void} [callback]
|
|
|
|
|
* @param {Map<any, import("#client").EachItem>} items_map
|
|
|
|
|
*/
|
|
|
|
|
function pause_effects(items, controlled_anchor, callback) {
|
|
|
|
|
function pause_effects(items, controlled_anchor, items_map) {
|
|
|
|
|
/** @type {import('#client').TransitionManager[]} */
|
|
|
|
|
var transitions = [];
|
|
|
|
|
var length = items.length;
|
|
|
|
@ -81,10 +81,11 @@ function pause_effects(items, controlled_anchor, callback) {
|
|
|
|
|
|
|
|
|
|
run_out_transitions(transitions, () => {
|
|
|
|
|
for (var i = 0; i < length; i++) {
|
|
|
|
|
destroy_effect(items[i].e, !is_controlled);
|
|
|
|
|
var item = items[i];
|
|
|
|
|
items_map.delete(item.k);
|
|
|
|
|
link(item.prev, item.next);
|
|
|
|
|
destroy_effect(item.e, !is_controlled);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (callback !== undefined) callback();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -413,14 +414,7 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pause_effects(to_destroy, controlled_anchor, () => {
|
|
|
|
|
for (var i = 0; i < destroy_length; i += 1) {
|
|
|
|
|
var item = to_destroy[i];
|
|
|
|
|
items.delete(item.k);
|
|
|
|
|
item.o.remove();
|
|
|
|
|
link(item.prev, item.next);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
pause_effects(to_destroy, controlled_anchor, items);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_animated) {
|
|
|
|
|