|
|
@ -138,11 +138,27 @@ export default class InlineComponentWrapper extends Wrapper {
|
|
|
|
const statements: Array<Node | Node[]> = [];
|
|
|
|
const statements: Array<Node | Node[]> = [];
|
|
|
|
const updates: Array<Node | Node[]> = [];
|
|
|
|
const updates: Array<Node | Node[]> = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.fragment) {
|
|
|
|
|
|
|
|
this.renderer.add_to_context('$$scope', true);
|
|
|
|
|
|
|
|
const default_slot = this.slots.get('default');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.fragment.nodes.forEach((child) => {
|
|
|
|
|
|
|
|
child.render(default_slot.block, null, x`#nodes` as unknown as Identifier);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let props;
|
|
|
|
let props;
|
|
|
|
const name_changes = block.get_unique_name(`${name.name}_changes`);
|
|
|
|
const name_changes = block.get_unique_name(`${name.name}_changes`);
|
|
|
|
|
|
|
|
|
|
|
|
const uses_spread = !!this.node.attributes.find(a => a.is_spread);
|
|
|
|
const uses_spread = !!this.node.attributes.find(a => a.is_spread);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// removing empty slot
|
|
|
|
|
|
|
|
for (const slot of this.slots.keys()) {
|
|
|
|
|
|
|
|
if (!this.slots.get(slot).block.has_content()) {
|
|
|
|
|
|
|
|
this.slots.delete(slot);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const initial_props = this.slots.size > 0
|
|
|
|
const initial_props = this.slots.size > 0
|
|
|
|
? [
|
|
|
|
? [
|
|
|
|
p`$$slots: {
|
|
|
|
p`$$slots: {
|
|
|
@ -172,15 +188,6 @@ export default class InlineComponentWrapper extends Wrapper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.fragment) {
|
|
|
|
|
|
|
|
this.renderer.add_to_context('$$scope', true);
|
|
|
|
|
|
|
|
const default_slot = this.slots.get('default');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.fragment.nodes.forEach((child) => {
|
|
|
|
|
|
|
|
child.render(default_slot.block, null, x`#nodes` as unknown as Identifier);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (component.compile_options.dev) {
|
|
|
|
if (component.compile_options.dev) {
|
|
|
|
// TODO this is a terrible hack, but without it the component
|
|
|
|
// TODO this is a terrible hack, but without it the component
|
|
|
|
// will complain that options.target is missing. This would
|
|
|
|
// will complain that options.target is missing. This would
|
|
|
|