|
|
|
@ -1,6 +1,5 @@
|
|
|
|
import { x } from 'code-red';
|
|
|
|
import { x } from 'code-red';
|
|
|
|
export default class Wrapper {
|
|
|
|
export default class Wrapper {
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('../../Renderer.js').default} */
|
|
|
|
/** @type {import('../../Renderer.js').default} */
|
|
|
|
renderer;
|
|
|
|
renderer;
|
|
|
|
|
|
|
|
|
|
|
|
@ -55,8 +54,12 @@ export default class Wrapper {
|
|
|
|
? block.get_unique_name(`${this.var.name}_anchor`)
|
|
|
|
? block.get_unique_name(`${this.var.name}_anchor`)
|
|
|
|
: (this.next && this.next.var) || { type: 'Identifier', name: 'null' };
|
|
|
|
: (this.next && this.next.var) || { type: 'Identifier', name: 'null' };
|
|
|
|
if (needs_anchor) {
|
|
|
|
if (needs_anchor) {
|
|
|
|
block.add_element(anchor, x `@empty()`, parent_nodes && x `@empty()`,
|
|
|
|
block.add_element(
|
|
|
|
/** @type {import('estree').Identifier} */ (parent_node));
|
|
|
|
anchor,
|
|
|
|
|
|
|
|
x`@empty()`,
|
|
|
|
|
|
|
|
parent_nodes && x`@empty()`,
|
|
|
|
|
|
|
|
/** @type {import('estree').Identifier} */ (parent_node)
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return anchor;
|
|
|
|
return anchor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -66,10 +69,14 @@ export default class Wrapper {
|
|
|
|
* @returns {import("C:/repos/svelte/svelte/node_modules/.pnpm/@types+estree@1.0.0/node_modules/@types/estree/index").import('estree').Identifier}
|
|
|
|
* @returns {import("C:/repos/svelte/svelte/node_modules/.pnpm/@types+estree@1.0.0/node_modules/@types/estree/index").import('estree').Identifier}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
get_update_mount_node(anchor) {
|
|
|
|
get_update_mount_node(anchor) {
|
|
|
|
return /** @type {import('estree').Identifier} */ ((this.parent && this.parent.is_dom_node() ? this.parent.var : x `${anchor}.parentNode`));
|
|
|
|
return /** @type {import('estree').Identifier} */ (
|
|
|
|
|
|
|
|
this.parent && this.parent.is_dom_node() ? this.parent.var : x`${anchor}.parentNode`
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
is_dom_node() {
|
|
|
|
is_dom_node() {
|
|
|
|
return (this.node.type === 'Element' || this.node.type === 'Text' || this.node.type === 'MustacheTag');
|
|
|
|
return (
|
|
|
|
|
|
|
|
this.node.type === 'Element' || this.node.type === 'Text' || this.node.type === 'MustacheTag'
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -82,7 +89,3 @@ export default class Wrapper {
|
|
|
|
throw Error('Wrapper class is not renderable');
|
|
|
|
throw Error('Wrapper class is not renderable');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|