|
|
|
@ -90,22 +90,9 @@ function get_hydrate_nodes(node, insert_text = false) {
|
|
|
|
|
export function hydrate_block_anchor(node) {
|
|
|
|
|
if (!hydrating) return;
|
|
|
|
|
|
|
|
|
|
if (node.nodeType === 8) {
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
let nodes = node.$$fragment;
|
|
|
|
|
if (nodes === undefined) {
|
|
|
|
|
nodes = get_hydrate_nodes(node);
|
|
|
|
|
} else {
|
|
|
|
|
schedule_task(() => {
|
|
|
|
|
// @ts-expect-error clean up memory
|
|
|
|
|
node.$$fragment = undefined;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
set_hydrate_nodes(nodes);
|
|
|
|
|
} else {
|
|
|
|
|
const first_child = /** @type {Element | null} */ (node.firstChild);
|
|
|
|
|
set_hydrate_nodes(first_child === null ? [] : [first_child]);
|
|
|
|
|
}
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
var nodes = node.$$fragment ?? get_hydrate_nodes(node);
|
|
|
|
|
set_hydrate_nodes(nodes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -124,6 +111,10 @@ export function capture_fragment_from_node(node) {
|
|
|
|
|
const target = /** @type {Node} */ (last_child.nextSibling);
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
target.$$fragment = nodes;
|
|
|
|
|
schedule_task(() => {
|
|
|
|
|
// @ts-expect-error clean up memory
|
|
|
|
|
target.$$fragment = undefined;
|
|
|
|
|
});
|
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
return node;
|
|
|
|
|