mirror of https://github.com/sveltejs/svelte
add some failing tests for #1480
parent
b5140cdad3
commit
7d356e1b9e
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
options: {
|
||||
nestedTransitions: true
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,70 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, createElement, detachNode, flush, init, insert, noop, proto, wrapTransition } from "svelte/shared.js";
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
var div, div_transition, current;
|
||||
|
||||
return {
|
||||
c() {
|
||||
div = createElement("div");
|
||||
div.textContent = "foo";
|
||||
},
|
||||
|
||||
m(target, anchor, introing) {
|
||||
insert(target, div, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
if (component.root._intro) {
|
||||
if (div_transition) div_transition.invalidate();
|
||||
|
||||
component.root._aftercreate.push(() => {
|
||||
if (!div_transition) div_transition = wrapTransition(component, div, foo, {}, 1);
|
||||
div_transition.run(1, null);
|
||||
});
|
||||
}
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (!div_transition) div_transition = wrapTransition(component, div, foo, {}, 0);
|
||||
div_transition.run(0, () => {
|
||||
outrocallback();
|
||||
div_transition = null;
|
||||
});
|
||||
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
if (detach) {
|
||||
detachNode(div);
|
||||
if (div_transition) div_transition.abort();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
|
||||
flush(this);
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
||||
@ -0,0 +1,7 @@
|
||||
<div transition:foo>foo</div>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
transitions: { foo }
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
options: {
|
||||
nestedTransitions: true
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,176 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, createComment, detachNode, flush, groupOutros, init, insert, proto } from "svelte/shared.js";
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
var if_block_anchor, current;
|
||||
|
||||
var if_block = (ctx.x) && create_if_block(component, ctx);
|
||||
|
||||
return {
|
||||
c() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = createComment();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
if (if_block) if_block.m(target, anchor, 1);
|
||||
insert(target, if_block_anchor, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p(changed, ctx) {
|
||||
if (ctx.x) {
|
||||
if (if_block) {
|
||||
if_block.p(changed, ctx);
|
||||
} else {
|
||||
if_block = create_if_block(component, ctx);
|
||||
if (if_block) if_block.c();
|
||||
}
|
||||
|
||||
if_block.i(if_block_anchor.parentNode, if_block_anchor);
|
||||
} else if (if_block) {
|
||||
groupOutros();
|
||||
if_block.o(function() {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (if_block) if_block.o(outrocallback, 1);
|
||||
else outrocallback();
|
||||
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
if (if_block) if_block.d(detach);
|
||||
if (detach) {
|
||||
detachNode(if_block_anchor);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// (2:1) {#if y}
|
||||
function create_if_block_1(component, ctx) {
|
||||
var current;
|
||||
|
||||
var widget = new Widget({
|
||||
root: component.root,
|
||||
store: component.store
|
||||
});
|
||||
|
||||
return {
|
||||
c() {
|
||||
widget._fragment.c();
|
||||
},
|
||||
|
||||
m(target, anchor, local) {
|
||||
widget._mount(target, anchor, local);
|
||||
current = true;
|
||||
},
|
||||
|
||||
i(target, anchor, local) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor, local);
|
||||
},
|
||||
|
||||
o(outrocallback, local) {
|
||||
if (!current) return;
|
||||
|
||||
if (widget) widget._fragment.o(outrocallback, local);
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
widget.destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// (1:0) {#if x}
|
||||
function create_if_block(component, ctx) {
|
||||
var if_block_anchor, current;
|
||||
|
||||
var if_block = (ctx.y) && create_if_block_1(component, ctx);
|
||||
|
||||
return {
|
||||
c() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = createComment();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
if (if_block) if_block.m(target, anchor, 1);
|
||||
insert(target, if_block_anchor, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p(changed, ctx) {
|
||||
if (ctx.y) {
|
||||
if (!if_block) {
|
||||
if_block = create_if_block_1(component, ctx);
|
||||
if_block.c();
|
||||
}
|
||||
if_block.i(if_block_anchor.parentNode, if_block_anchor, 1);
|
||||
} else if (if_block) {
|
||||
groupOutros();
|
||||
if_block.o(function() {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
}, 1);
|
||||
}
|
||||
},
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (if_block) if_block.o(outrocallback, 1);
|
||||
else outrocallback();
|
||||
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
if (if_block) if_block.d(detach);
|
||||
if (detach) {
|
||||
detachNode(if_block_anchor);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor, 1);
|
||||
|
||||
flush(this);
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
||||
@ -0,0 +1,11 @@
|
||||
{#if x}
|
||||
{#if y}
|
||||
<Widget/>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: { Widget }
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
options: {
|
||||
nestedTransitions: true
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,187 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, createComment, createElement, detachNode, flush, groupOutros, init, insert, proto, wrapTransition } from "svelte/shared.js";
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
var if_block_anchor, current;
|
||||
|
||||
var if_block = (ctx.x) && create_if_block(component, ctx);
|
||||
|
||||
return {
|
||||
c() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = createComment();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
if (if_block) if_block.i(target, anchor);
|
||||
insert(target, if_block_anchor, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p(changed, ctx) {
|
||||
if (ctx.x) {
|
||||
if (if_block) {
|
||||
if_block.p(changed, ctx);
|
||||
} else {
|
||||
if_block = create_if_block(component, ctx);
|
||||
if (if_block) if_block.c();
|
||||
}
|
||||
|
||||
if_block.i(if_block_anchor.parentNode, if_block_anchor);
|
||||
} else if (if_block) {
|
||||
groupOutros();
|
||||
if_block.o(function() {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (if_block) if_block.o(outrocallback);
|
||||
else outrocallback();
|
||||
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
if (if_block) if_block.d(detach);
|
||||
if (detach) {
|
||||
detachNode(if_block_anchor);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// (2:1) {#if y}
|
||||
function create_if_block_1(component, ctx) {
|
||||
var div, div_transition, current;
|
||||
|
||||
return {
|
||||
c() {
|
||||
div = createElement("div");
|
||||
div.textContent = "foo";
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
insert(target, div, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
if (component.root._intro) {
|
||||
if (div_transition) div_transition.invalidate();
|
||||
|
||||
component.root._aftercreate.push(() => {
|
||||
if (!div_transition) div_transition = wrapTransition(component, div, foo, {}, 1);
|
||||
div_transition.run(1);
|
||||
});
|
||||
}
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (!div_transition) div_transition = wrapTransition(component, div, foo, {}, 0);
|
||||
div_transition.run(0, () => {
|
||||
outrocallback();
|
||||
div_transition = null;
|
||||
});
|
||||
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
if (detach) {
|
||||
detachNode(div);
|
||||
if (div_transition) div_transition.abort();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// (1:0) {#if x}
|
||||
function create_if_block(component, ctx) {
|
||||
var if_block_anchor, current;
|
||||
|
||||
var if_block = (ctx.y) && create_if_block_1(component, ctx);
|
||||
|
||||
return {
|
||||
c() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = createComment();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
if (if_block) if_block.i(target, anchor);
|
||||
insert(target, if_block_anchor, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p(changed, ctx) {
|
||||
if (ctx.y) {
|
||||
if (!if_block) {
|
||||
if_block = create_if_block_1(component, ctx);
|
||||
if_block.c();
|
||||
}
|
||||
if_block.i(if_block_anchor.parentNode, if_block_anchor);
|
||||
} else if (if_block) {
|
||||
groupOutros();
|
||||
if_block.o(function() {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (if_block) if_block.o(outrocallback);
|
||||
else outrocallback();
|
||||
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
if (if_block) if_block.d(detach);
|
||||
if (detach) {
|
||||
detachNode(if_block_anchor);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
|
||||
flush(this);
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
||||
@ -0,0 +1,11 @@
|
||||
{#if x}
|
||||
{#if y}
|
||||
<div transition:foo>foo</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
export default {
|
||||
transitions: { foo }
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in new issue