some aspirational compiler output

pull/1839/head
Rich Harris 7 years ago
parent ad653c5834
commit 7407bccb79

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
function link(node) { function link(node) {
function onClick(event) { function onClick(event) {
event.preventDefault(); event.preventDefault();
history.pushState(null, null, event.target.href); history.pushState(null, null, event.target.href);
@ -15,10 +14,10 @@ function link(node) {
node.removeEventListener('click', onClick); node.removeEventListener('click', onClick);
} }
} }
}; }
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var a, link_action; var a, link_action, current;
return { return {
c() { c() {
@ -29,33 +28,34 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, a, anchor); insert(target, a, anchor);
link_action = link.call(component, a) || {}; link_action = link.call(null, a) || {};
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(a); detachNode(a);
} }
if (link_action && typeof link_action.destroy === 'function') link_action.destroy.call(component); if (link_action && typeof link_action.destroy === 'function') link_action.destroy();
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,6 +1,5 @@
<script> <script>
function link(node) { function link(node) {
function onClick(event) { function onClick(event) {
event.preventDefault(); event.preventDefault();
history.pushState(null, null, event.target.href); history.pushState(null, null, event.target.href);

@ -1,27 +1,32 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addResizeListener, assign, createElement, detachNode, flush, init, insert, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addResizeListener, add_render_callback, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div, div_resize_listener; var div, div_resize_listener, current;
function div_resize_handler() {
component.set({ w: div.offsetWidth, h: div.offsetHeight });
}
return { return {
c() { c() {
div = createElement("div"); div = createElement("div");
div.textContent = "some content"; div.textContent = "some content";
component.root._beforecreate.push(div_resize_handler); add_render_callback(() => ctx.div_resize_handler.call(div));
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
div_resize_listener = addResizeListener(div, div_resize_handler); div_resize_listener = addResizeListener(div, ctx.div_resize_handler);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -32,20 +37,43 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$make_dirty) {
init(this, options); let w;
this._state = assign({}, options.data); let h;
this._intro = true;
function div_resize_handler() {
w = this.offsetWidth;
h = this.offsetHeight;
$$make_dirty('w');
$$make_dirty('h');
}
$$self.$$.get = () => ({ w, h, div_resize_handler });
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get w() {
return this.$$.get().w;
}
set w(value) {
this.$set({ w: value });
flush();
}
if (options.target) { get h() {
this._fragment.c(); return this.$$.get().h;
this._mount(options.target, options.anchor); }
flush(this); set h(value) {
this.$set({ h: value });
flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,9 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createElement, createText, detachNode, init, insert, proto, setData } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
function data() {
return { foo: 42 }
};
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
@ -12,8 +8,8 @@ function add_css() {
append(document.head, style); append(document.head, style);
} }
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var p, text; var p, text, current;
return { return {
c() { c() {
@ -25,6 +21,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, p, anchor); insert(target, p, anchor);
append(p, text); append(p, text);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -33,6 +30,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(p); detachNode(p);
@ -41,20 +46,31 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props, $$make_dirty) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
this._fragment = create_main_fragment(this, this._state); let { foo = 42 } = $$props;
if (options.target) { $$self.$$.get = () => ({ foo });
this._fragment.c();
this._mount(options.target, options.anchor); $$self.$$.set = $$props => {
} if ('foo' in $$props) foo = $$props.foo;
};
} }
assign(SvelteComponent.prototype, proto); class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get foo() {
return this.$$.get().foo;
}
set foo(value) {
this.$set({ foo: value });
flush();
}
}
export default SvelteComponent; export default SvelteComponent;

@ -1,48 +1,51 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, flush, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js";
var Nested = window.Nested; const Nested = window.Nested;
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var current;
var nested_initial_data = { foo: [1, 2, 3] };
var nested = new Nested({ var nested = new Nested({
root: component.root, props: { foo: [1, 2, 3] }
store: component.store,
data: nested_initial_data
}); });
return { return {
c() { c() {
nested._fragment.c(); nested.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
nested._mount(target, anchor); mount_component(nested, target, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o(outrocallback) {
if (!current) return;
if (nested) nested.$$.fragment.o(outrocallback);
current = false;
},
d(detach) { d(detach) {
nested.destroy(detach); nested.$destroy(detach);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
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; export default SvelteComponent;

@ -1,50 +1,51 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { _differsImmutable, assign, flush, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, not_equal } from "svelte/internal.js";
var Nested = window.Nested; const Nested = window.Nested;
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var current;
var nested_initial_data = { foo: "bar" };
var nested = new Nested({ var nested = new Nested({
root: component.root, props: { foo: "bar" }
store: component.store,
data: nested_initial_data
}); });
return { return {
c() { c() {
nested._fragment.c(); nested.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
nested._mount(target, anchor); mount_component(nested, target, anchor);
current = true;
}, },
p: noop, p: noop,
d(detach) { i(target, anchor) {
nested.destroy(detach); if (current) return;
}
};
}
function SvelteComponent(options) { this.m(target, anchor);
init(this, options); },
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state); o(outrocallback) {
if (!current) return;
if (options.target) { if (nested) nested.$$.fragment.o(outrocallback);
this._fragment.c(); current = false;
this._mount(options.target, options.anchor); },
flush(this); d(detach) {
nested.$destroy(detach);
} }
};
} }
assign(SvelteComponent.prototype, proto); class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, noop, create_fragment, not_equal);
}
}
SvelteComponent.prototype._differs = _differsImmutable;
export default SvelteComponent; export default SvelteComponent;

@ -1,48 +1,51 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, flush, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js";
var Nested = window.Nested; const Nested = window.Nested;
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var current;
var nested_initial_data = { foo: "bar" };
var nested = new Nested({ var nested = new Nested({
root: component.root, props: { foo: "bar" }
store: component.store,
data: nested_initial_data
}); });
return { return {
c() { c() {
nested._fragment.c(); nested.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
nested._mount(target, anchor); mount_component(nested, target, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o(outrocallback) {
if (!current) return;
if (nested) nested.$$.fragment.o(outrocallback);
current = false;
},
d(detach) { d(detach) {
nested.destroy(detach); nested.$destroy(detach);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
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; export default SvelteComponent;

@ -1,15 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal.js";
function a({ x }) { function create_fragment(component, ctx) {
return x * 2; var current;
}
function b({ x }) {
return x * 3;
}
function create_main_fragment(component, ctx) {
return { return {
c: noop, c: noop,
@ -18,31 +11,45 @@ function create_main_fragment(component, ctx) {
p: noop, p: noop,
i: noop,
o: run,
d: noop d: noop
}; };
} }
function SvelteComponent(options) { function define($$self, $$props, $$make_dirty) {
init(this, options); let { x } = $$props;
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._intro = true;
this._fragment = create_main_fragment(this, this._state); function a() {
return x * 2;
}
if (options.target) { function b() {
this._fragment.c(); return x * 3;
this._mount(options.target, options.anchor);
} }
$$self.$$.get = () => ({ x, a, b });
$$self.$$.set = $$props => {
if ('x' in $$props) x = $$props.x;
};
} }
assign(SvelteComponent.prototype, proto); class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get x() {
return this.$$.get().x;
}
SvelteComponent.prototype._recompute = function _recompute(changed, state) { set x(value) {
if (changed.x) { this.$set({ x: value });
if (this._differs(state.a, (state.a = a(state)))) changed.a = true; flush();
if (this._differs(state.b, (state.b = b(state)))) changed.b = true;
} }
} }
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
@ -8,8 +8,8 @@ function add_css() {
append(document.head, style); append(document.head, style);
} }
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div; var div, current;
return { return {
c() { c() {
@ -19,10 +19,19 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -31,20 +40,12 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true;
if (!document.getElementById("svelte-1slhpfn-style")) add_css(); if (!document.getElementById("svelte-1slhpfn-style")) add_css();
init(this, options, noop, create_fragment, safe_not_equal);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, SvelteElement, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div; var div, current;
return { return {
c() { c() {
@ -13,10 +13,19 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -25,39 +34,25 @@ function create_main_fragment(component, ctx) {
}; };
} }
class SvelteComponent extends HTMLElement { class SvelteComponent extends SvelteElement {
constructor(options = {}) { constructor(options) {
super(); super();
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `<style>div{animation:foo 1s}@keyframes foo{0%{opacity:0}100%{opacity:1}}</style>`; this.shadowRoot.innerHTML = `<style>div{animation:foo 1s}@keyframes foo{0%{opacity:0}100%{opacity:1}}</style>`;
this._fragment = create_main_fragment(this, this._state); init(this, { target: this.shadowRoot }, noop, create_fragment, safe_not_equal);
this._fragment.c();
this._fragment.m(this.shadowRoot, null);
if (options.target) this._mount(options.target, options.anchor); if (options) {
if (options.target) {
insert(options.target, this, options.anchor);
}
}
} }
static get observedAttributes() { static get observedAttributes() {
return []; return [];
} }
attributeChangedCallback(attr, oldValue, newValue) {
this.set({ [attr]: newValue });
}
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, {
_mount(target, anchor) {
target.insertBefore(this, anchor);
}
});
customElements.define("custom-element", SvelteComponent); customElements.define("custom-element", SvelteComponent);
export default SvelteComponent; export default SvelteComponent;

@ -1,10 +1,10 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addLoc, append, assign, createElement, createText, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
const file = undefined; const file = undefined;
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var h1, text0, text1, text2, text3; var h1, text0, text1, text2, text3, current;
return { return {
c: function create() { c: function create() {
@ -17,12 +17,17 @@ function create_main_fragment(component, ctx) {
addLoc(h1, file, 0, 0, 0); addLoc(h1, file, 0, 0, 0);
}, },
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) { m: function mount(target, anchor) {
insert(target, h1, anchor); insert(target, h1, anchor);
append(h1, text0); append(h1, text0);
append(h1, text1); append(h1, text1);
append(h1, text2); append(h1, text2);
insert(target, text3, anchor); insert(target, text3, anchor);
current = true;
}, },
p: function update(changed, ctx) { p: function update(changed, ctx) {
@ -33,6 +38,14 @@ function create_main_fragment(component, ctx) {
debugger; debugger;
}, },
i: function intro(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d: function destroy(detach) { d: function destroy(detach) {
if (detach) { if (detach) {
detachNode(h1); detachNode(h1);
@ -42,28 +55,35 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
this._debugName = '<SvelteComponent>'; let { name } = $$props;
if (!options || (!options.target && !options.root)) {
throw new Error("'target' is a required option"); $$self.$$.get = () => ({ name });
}
init(this, options); $$self.$$.set = $$props => {
this._state = assign({}, options.data); if ('name' in $$props) name = $$props.name;
if (!('name' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'name'"); };
this._intro = true; }
this._fragment = create_main_fragment(this, this._state); class SvelteComponent extends SvelteComponentDev {
constructor(options) {
super(options);
init(this, options, define, create_fragment, safe_not_equal);
if (options.target) { const state = this.$$.get();
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); if (state.name === undefined) {
this._fragment.c(); console.warn("<SvelteComponent> was created without expected data property 'name'");
this._mount(options.target, options.anchor); }
} }
}
assign(SvelteComponent.prototype, protoDev); get name() {
return this.$$.get().name;
}
set name(value) {
this.$set({ name: value });
flush();
}
}
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
};
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addLoc, append, assign, createElement, createText, destroyEach, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
const file = undefined; const file = undefined;
@ -9,8 +9,53 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
function create_main_fragment(component, ctx) { // (1:0) {#each things as thing}
var text0, p, text1, text2; function create_each_block(component, ctx) {
var span, text0_value = ctx.thing.name, text0, text1;
return {
c: function create() {
span = createElement("span");
text0 = createText(text0_value);
text1 = createText("\n\t");
{
const { foo, bar, baz, thing } = ctx;
console.log({ foo, bar, baz, thing });
debugger;
}
addLoc(span, file, 1, 1, 25);
},
m: function mount(target, anchor) {
insert(target, span, anchor);
append(span, text0);
insert(target, text1, anchor);
},
p: function update(changed, ctx) {
if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) {
setData(text0, text0_value);
}
if (changed.foo || changed.bar || changed.baz || changed.things) {
const { foo, bar, baz, thing } = ctx;
console.log({ foo, bar, baz, thing });
debugger;
}
},
d: function destroy(detach) {
if (detach) {
detachNode(span);
detachNode(text1);
}
}
};
}
function create_fragment(component, ctx) {
var text0, p, text1, text2, current;
var each_value = ctx.things; var each_value = ctx.things;
@ -33,6 +78,10 @@ function create_main_fragment(component, ctx) {
addLoc(p, file, 5, 0, 91); addLoc(p, file, 5, 0, 91);
}, },
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) { m: function mount(target, anchor) {
for (var i = 0; i < each_blocks.length; i += 1) { for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
@ -42,6 +91,7 @@ function create_main_fragment(component, ctx) {
insert(target, p, anchor); insert(target, p, anchor);
append(p, text1); append(p, text1);
append(p, text2); append(p, text2);
current = true;
}, },
p: function update(changed, ctx) { p: function update(changed, ctx) {
@ -71,6 +121,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i: function intro(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d: function destroy(detach) { d: function destroy(detach) {
destroyEach(each_blocks, detach); destroyEach(each_blocks, detach);
@ -82,76 +140,74 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (1:0) {#each things as thing} function define($$self, $$props) {
function create_each_block(component, ctx) { let { things, foo, bar, baz } = $$props;
var span, text0_value = ctx.thing.name, text0, text1;
return { $$self.$$.get = () => ({ things, foo, bar, baz });
c: function create() {
span = createElement("span");
text0 = createText(text0_value);
text1 = createText("\n\t");
{ $$self.$$.set = $$props => {
const { foo, bar, baz, thing } = ctx; if ('things' in $$props) things = $$props.things;
console.log({ foo, bar, baz, thing }); if ('foo' in $$props) foo = $$props.foo;
debugger; if ('bar' in $$props) bar = $$props.bar;
} if ('baz' in $$props) baz = $$props.baz;
addLoc(span, file, 1, 1, 25); };
}, }
m: function mount(target, anchor) { class SvelteComponent extends SvelteComponentDev {
insert(target, span, anchor); constructor(options) {
append(span, text0); super(options);
insert(target, text1, anchor); init(this, options, define, create_fragment, safe_not_equal);
},
p: function update(changed, ctx) { const state = this.$$.get();
if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) { if (state.things === undefined) {
setData(text0, text0_value); console.warn("<SvelteComponent> was created without expected data property 'things'");
}
if (state.foo === undefined) {
console.warn("<SvelteComponent> was created without expected data property 'foo'");
}
if (state.bar === undefined) {
console.warn("<SvelteComponent> was created without expected data property 'bar'");
}
if (state.baz === undefined) {
console.warn("<SvelteComponent> was created without expected data property 'baz'");
}
} }
if (changed.foo || changed.bar || changed.baz || changed.things) { get things() {
const { foo, bar, baz, thing } = ctx; return this.$$.get().things;
console.log({ foo, bar, baz, thing });
debugger;
} }
},
d: function destroy(detach) { set things(value) {
if (detach) { this.$set({ things: value });
detachNode(span); flush();
detachNode(text1);
} }
get foo() {
return this.$$.get().foo;
}
set foo(value) {
this.$set({ foo: value });
flush();
} }
};
}
function SvelteComponent(options) { get bar() {
this._debugName = '<SvelteComponent>'; return this.$$.get().bar;
if (!options || (!options.target && !options.root)) {
throw new Error("'target' is a required option");
} }
init(this, options); set bar(value) {
this._state = assign({}, options.data); this.$set({ bar: value });
if (!('things' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'things'"); flush();
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'"); }
if (!('bar' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'bar'");
if (!('baz' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'baz'");
this._intro = true;
this._fragment = create_main_fragment(this, this._state); get baz() {
return this.$$.get().baz;
}
if (options.target) { set baz(value) {
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); this.$set({ baz: value });
this._fragment.c(); flush();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, protoDev);
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
};
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addLoc, append, assign, createElement, createText, destroyEach, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; import { SvelteComponentDev, addLoc, append, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
const file = undefined; const file = undefined;
@ -9,8 +9,53 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
function create_main_fragment(component, ctx) { // (1:0) {#each things as thing}
var text0, p, text1, text2; function create_each_block(component, ctx) {
var span, text0_value = ctx.thing.name, text0, text1;
return {
c: function create() {
span = createElement("span");
text0 = createText(text0_value);
text1 = createText("\n\t");
{
const { foo } = ctx;
console.log({ foo });
debugger;
}
addLoc(span, file, 1, 1, 25);
},
m: function mount(target, anchor) {
insert(target, span, anchor);
append(span, text0);
insert(target, text1, anchor);
},
p: function update(changed, ctx) {
if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) {
setData(text0, text0_value);
}
if (changed.foo) {
const { foo } = ctx;
console.log({ foo });
debugger;
}
},
d: function destroy(detach) {
if (detach) {
detachNode(span);
detachNode(text1);
}
}
};
}
function create_fragment(component, ctx) {
var text0, p, text1, text2, current;
var each_value = ctx.things; var each_value = ctx.things;
@ -33,6 +78,10 @@ function create_main_fragment(component, ctx) {
addLoc(p, file, 5, 0, 74); addLoc(p, file, 5, 0, 74);
}, },
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) { m: function mount(target, anchor) {
for (var i = 0; i < each_blocks.length; i += 1) { for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
@ -42,6 +91,7 @@ function create_main_fragment(component, ctx) {
insert(target, p, anchor); insert(target, p, anchor);
append(p, text1); append(p, text1);
append(p, text2); append(p, text2);
current = true;
}, },
p: function update(changed, ctx) { p: function update(changed, ctx) {
@ -71,6 +121,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i: function intro(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d: function destroy(detach) { d: function destroy(detach) {
destroyEach(each_blocks, detach); destroyEach(each_blocks, detach);
@ -82,74 +140,49 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (1:0) {#each things as thing} function define($$self, $$props) {
function create_each_block(component, ctx) { let { things, foo } = $$props;
var span, text0_value = ctx.thing.name, text0, text1;
return { // TODO only what's needed by the template
c: function create() { $$self.$$.get = () => ({ things, foo });
span = createElement("span");
text0 = createText(text0_value);
text1 = createText("\n\t");
{ $$self.$$.set = $$props => {
const { foo } = ctx; if ('things' in $$props) things = $$props.things;
console.log({ foo }); if ('foo' in $$props) foo = $$props.foo;
debugger; };
} }
addLoc(span, file, 1, 1, 25);
},
m: function mount(target, anchor) {
insert(target, span, anchor);
append(span, text0);
insert(target, text1, anchor);
},
p: function update(changed, ctx) { class SvelteComponent extends SvelteComponentDev {
if ((changed.things) && text0_value !== (text0_value = ctx.thing.name)) { constructor(options) {
setData(text0, text0_value); super(options);
} init(this, options, define, create_fragment, safe_not_equal);
if (changed.foo) { const state = this.$$.get();
const { foo } = ctx; if (state.things === undefined) {
console.log({ foo }); console.warn("<SvelteComponent> was created without expected data property 'things'");
debugger;
} }
}, if (state.foo === undefined) {
console.warn("<SvelteComponent> was created without expected data property 'foo'");
d: function destroy(detach) {
if (detach) {
detachNode(span);
detachNode(text1);
} }
} }
};
}
function SvelteComponent(options) { get things() {
this._debugName = '<SvelteComponent>'; return this.$$.get().things;
if (!options || (!options.target && !options.root)) {
throw new Error("'target' is a required option");
} }
init(this, options); set things(value) {
this._state = assign({}, options.data); this.$set({ things: value });
if (!('things' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'things'"); flush();
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'"); }
this._intro = true;
this._fragment = create_main_fragment(this, this._state); get foo() {
return this.$$.get().foo;
}
if (options.target) { set foo(value) {
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); this.$set({ foo: value });
this._fragment.c(); flush();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, protoDev);
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
};
export default SvelteComponent; export default SvelteComponent;

@ -1,14 +1,9 @@
"use strict"; /* generated by Svelte vX.Y.Z-alpha1 */
import { SvelteComponentDev, debug, each, escape } from "svelte/internal.js";
var { debug, each, escape } = require("svelte/shared.js"); var SvelteComponent = {};
var SvelteComponent = {};; SvelteComponent.render = function(props = {}, options = {}) {
SvelteComponent.data = function() {
return {};
};
SvelteComponent.render = function(state, options = {}) {
var components = new Set(); var components = new Set();
function addComponent(component) { function addComponent(component) {
@ -16,7 +11,7 @@ SvelteComponent.render = function(state, options = {}) {
} }
var result = { head: '', addComponent }; var result = { head: '', addComponent };
var html = SvelteComponent._render(result, state, options); var html = SvelteComponent.$$render(result, props, options);
var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n'); var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n');
@ -30,15 +25,13 @@ SvelteComponent.render = function(state, options = {}) {
}; };
} }
SvelteComponent._render = function(__result, ctx, options) { SvelteComponent.$$render = function($$result, ctx, options) {
__result.addComponent(SvelteComponent); $$result.addComponent(SvelteComponent);
ctx = Object.assign({}, ctx);
return `${ each(ctx.things, item => Object.assign({}, ctx, { thing: item }), ctx => `<span>${escape(ctx.thing.name)}</span> return `${ each(ctx.things, item => Object.assign({}, ctx, { thing: item }), ctx => `<span>${escape(ctx.thing.name)}</span>
${debug(null, 2, 2, { foo: ctx.foo })}`)} ${debug(null, 2, 2, { foo: ctx.foo })}`)}
<p>foo: ${escape(ctx.foo)}</p>`; <p>foo: ${escape(ctx.foo)}</p>`;
}; };
SvelteComponent.css = { SvelteComponent.css = {
@ -47,5 +40,4 @@ SvelteComponent.css = {
}; };
var warned = false; var warned = false;
export default SvelteComponent;
module.exports = SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createComment, createElement, createText, destroyEach, detachNode, init, insert, proto, setData } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createComment, createElement, createText, destroyEach, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
function get_each_context(ctx, list, i) { function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx); const child_ctx = Object.create(ctx);
@ -7,8 +7,37 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
function create_main_fragment(component, ctx) { // (1:0) {#each createElement as node}
var each_anchor; function create_each_block(component, ctx) {
var span, text_value = ctx.node, text;
return {
c() {
span = createElement("span");
text = createText(text_value);
},
m(target, anchor) {
insert(target, span, anchor);
append(span, text);
},
p(changed, ctx) {
if ((changed.createElement) && text_value !== (text_value = ctx.node)) {
setData(text, text_value);
}
},
d(detach) {
if (detach) {
detachNode(span);
}
}
};
}
function create_fragment(component, ctx) {
var each_anchor, current;
var each_value = ctx.createElement; var each_value = ctx.createElement;
@ -33,6 +62,7 @@ function create_main_fragment(component, ctx) {
} }
insert(target, each_anchor, anchor); insert(target, each_anchor, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -58,6 +88,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
destroyEach(each_blocks, detach); destroyEach(each_blocks, detach);
@ -68,47 +106,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (1:0) {#each createElement as node} function define($$self, $$props) {
function create_each_block(component, ctx) { let { createElement } = $$props;
var span, text_value = ctx.node, text;
return { $$self.$$.get = () => ({ createElement });
c() {
span = createElement("span");
text = createText(text_value);
},
m(target, anchor) { $$self.$$.set = $$props => {
insert(target, span, anchor); if ('createElement' in $$props) createElement = $$props.createElement;
append(span, text);
},
p(changed, ctx) {
if ((changed.createElement) && text_value !== (text_value = ctx.node)) {
setData(text, text_value);
}
},
d(detach) {
if (detach) {
detachNode(span);
}
}
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get createElement() {
return this.$$.get().createElement;
}
if (options.target) { set createElement(value) {
this._fragment.c(); this.$set({ createElement: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,48 +1,46 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, assignTrue, flush, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal.js";
import { onMount } from "svelte";
function data_1() {
return {
foo: 'bar'
};
}
function oncreate() {
alert(JSON.stringify(data()));
};
function create_main_fragment(component, ctx) {
function create_fragment(component, ctx) {
return { return {
c: noop, c: noop,
m: noop, m: noop,
p: noop, p: noop,
i: noop,
o: run,
d: noop d: noop
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { foo = 'bar' } = $$props;
this._state = assign(data_1(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state); onMount(() => {
alert(JSON.stringify(data()));
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
}); });
if (options.target) { $$self.$$.get = () => ({ foo });
this._fragment.c();
this._mount(options.target, options.anchor); $$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get foo() {
return this.$$.get().foo;
}
flush(this); set foo(value) {
this.$set({ foo: value });
flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,22 +1,22 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addLoc, append, assign, createElement, createText, detachNode, init, insert, protoDev, setData } from "svelte/shared.js"; import { SvelteComponentDev, addLoc, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
function bar({ foo }) {
return foo * 2;
}
const file = undefined; const file = undefined;
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var p, text0_value = ctx.Math.max(0, ctx.foo), text0, text1, text2; var p, text0_value = Math.max(0, ctx.foo), text0, text1, text2_value = ctx.bar(), text2, current;
return { return {
c: function create() { c: function create() {
p = createElement("p"); p = createElement("p");
text0 = createText(text0_value); text0 = createText(text0_value);
text1 = createText("\n\t"); text1 = createText("\n\t");
text2 = createText(ctx.bar); text2 = createText(text2_value);
addLoc(p, file, 0, 0, 0); addLoc(p, file, 8, 0, 77);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
}, },
m: function mount(target, anchor) { m: function mount(target, anchor) {
@ -24,18 +24,27 @@ function create_main_fragment(component, ctx) {
append(p, text0); append(p, text0);
append(p, text1); append(p, text1);
append(p, text2); append(p, text2);
current = true;
}, },
p: function update(changed, ctx) { p: function update(changed, ctx) {
if ((changed.Math || changed.foo) && text0_value !== (text0_value = ctx.Math.max(0, ctx.foo))) { if (text0_value !== (text0_value = Math.max(0, ctx.foo))) {
setData(text0, text0_value); setData(text0, text0_value);
} }
if (changed.bar) { if ((changed.bar || changed.foo) && text2_value !== (text2_value = ctx.bar())) {
setData(text2, ctx.bar); setData(text2, text2_value);
} }
}, },
i: function intro(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d: function destroy(detach) { d: function destroy(detach) {
if (detach) { if (detach) {
detachNode(p); detachNode(p);
@ -44,37 +53,39 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
this._debugName = '<SvelteComponent>'; let { foo } = $$props;
if (!options || (!options.target && !options.root)) {
throw new Error("'target' is a required option"); function bar() {
return foo * 2;
} }
init(this, options); $$self.$$.get = () => ({ foo, bar });
this._state = assign({ Math : Math }, options.data);
this._recompute({ foo: 1 }, this._state); $$self.$$.set = $$props => {
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'"); if ('foo' in $$props) foo = $$props.foo;
this._intro = true; };
}
this._fragment = create_main_fragment(this, this._state); class SvelteComponent extends SvelteComponentDev {
constructor(options) {
super(options);
init(this, options, define, create_fragment, safe_not_equal);
if (options.target) { const state = this.$$.get();
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); if (state.foo === undefined) {
this._fragment.c(); console.warn("<SvelteComponent> was created without expected data property 'foo'");
this._mount(options.target, options.anchor); }
} }
}
assign(SvelteComponent.prototype, protoDev);
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { get foo() {
if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error("<SvelteComponent>: Cannot set read-only property 'bar'"); return this.$$.get().foo;
}; }
SvelteComponent.prototype._recompute = function _recompute(changed, state) { set foo(value) {
if (changed.foo) { this.$set({ foo: value });
if (this._differs(state.bar, (state.bar = bar(state)))) changed.bar = true; flush();
} }
} }
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div0, text, div1; var div0, text, div1, current;
return { return {
c() { c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, div0, anchor); insert(target, div0, anchor);
insert(target, text, anchor); insert(target, text, anchor);
insert(target, div1, anchor); insert(target, div1, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -25,6 +26,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div0); detachNode(div0);
@ -35,18 +44,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { bar } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ bar });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get bar() {
return this.$$.get().bar;
}
if (options.target) { set bar(value) {
this._fragment.c(); this.$set({ bar: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, createText, detachNode, init, insert, proto, setAttribute } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div0, text, div1; var div0, text, div1, current;
return { return {
c() { c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, div0, anchor); insert(target, div0, anchor);
insert(target, text, anchor); insert(target, text, anchor);
insert(target, div1, anchor); insert(target, div1, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -25,6 +26,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div0); detachNode(div0);
@ -35,18 +44,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { bar } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ bar });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get bar() {
return this.$$.get().bar;
}
if (options.target) { set bar(value) {
this._fragment.c(); this.$set({ bar: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createSvgElement, detachNode, init, insert, proto, setAttribute } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createSvgElement, detachNode, flush, init, insert, run, safe_not_equal, setAttribute } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var svg, g0, g1; var svg, g0, g1, current;
return { return {
c() { c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, svg, anchor); insert(target, svg, anchor);
append(svg, g0); append(svg, g0);
append(svg, g1); append(svg, g1);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -25,6 +26,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(svg); detachNode(svg);
@ -33,18 +42,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { bar } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ bar });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get bar() {
return this.$$.get().bar;
}
if (options.target) { set bar(value) {
this._fragment.c(); this.$set({ bar: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,46 +1,72 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, flush, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, flush, init, mount_component, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function func() {
return import('./Foo.html');
}
function create_fragment(component, ctx) {
var current;
var lazyload_initial_data = { load: () => import('./Foo.html') }; var lazyload = new ctx.LazyLoad({
var lazyload = new LazyLoad({ props: { load: func }
root: component.root,
store: component.store,
data: lazyload_initial_data
}); });
return { return {
c() { c() {
lazyload._fragment.c(); lazyload.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
lazyload._mount(target, anchor); mount_component(lazyload, target, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o(outrocallback) {
if (!current) return;
if (lazyload) lazyload.$$.fragment.o(outrocallback);
current = false;
},
d(detach) { d(detach) {
lazyload.destroy(detach); lazyload.$destroy(detach);
} }
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { LazyLoad } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ LazyLoad });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('LazyLoad' in $$props) LazyLoad = $$props.LazyLoad;
};
}
if (options.target) { class SvelteComponent extends SvelteComponent_1 {
this._fragment.c(); constructor(options) {
this._mount(options.target, options.anchor); super();
init(this, options, define, create_fragment, safe_not_equal);
}
get LazyLoad() {
return this.$$.get().LazyLoad;
}
flush(this); set LazyLoad(value) {
this.$set({ LazyLoad: value });
flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insert, proto, setData } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createElement, createText, destroyEach, detachAfter, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
function get_each_context(ctx, list, i) { function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx); const child_ctx = Object.create(ctx);
@ -8,8 +8,67 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
function create_main_fragment(component, ctx) { // (1:0) {#each comments as comment, i}
var text0, p, text1; function create_each_block(component, ctx) {
var div, strong, text0, text1, span, text2_value = ctx.comment.author, text2, text3, text4_value = ctx.elapsed(ctx.comment.time, ctx.time), text4, text5, text6, raw_value = ctx.comment.html, raw_before;
return {
c() {
div = createElement("div");
strong = createElement("strong");
text0 = createText(ctx.i);
text1 = createText("\n\n\t\t");
span = createElement("span");
text2 = createText(text2_value);
text3 = createText(" wrote ");
text4 = createText(text4_value);
text5 = createText(" ago:");
text6 = createText("\n\n\t\t");
raw_before = createElement('noscript');
span.className = "meta";
div.className = "comment";
},
m(target, anchor) {
insert(target, div, anchor);
append(div, strong);
append(strong, text0);
append(div, text1);
append(div, span);
append(span, text2);
append(span, text3);
append(span, text4);
append(span, text5);
append(div, text6);
append(div, raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
},
p(changed, ctx) {
if ((changed.comments) && text2_value !== (text2_value = ctx.comment.author)) {
setData(text2, text2_value);
}
if ((changed.elapsed || changed.comments || changed.time) && text4_value !== (text4_value = ctx.elapsed(ctx.comment.time, ctx.time))) {
setData(text4, text4_value);
}
if ((changed.comments) && raw_value !== (raw_value = ctx.comment.html)) {
detachAfter(raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},
d(detach) {
if (detach) {
detachNode(div);
}
}
};
}
function create_fragment(component, ctx) {
var text0, p, text1, current;
var each_value = ctx.comments; var each_value = ctx.comments;
@ -38,6 +97,7 @@ function create_main_fragment(component, ctx) {
insert(target, text0, anchor); insert(target, text0, anchor);
insert(target, p, anchor); insert(target, p, anchor);
append(p, text1); append(p, text1);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -67,6 +127,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
destroyEach(each_blocks, detach); destroyEach(each_blocks, detach);
@ -78,77 +146,60 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (1:0) {#each comments as comment, i} function define($$self, $$props) {
function create_each_block(component, ctx) { let { comments, elapsed, time, foo } = $$props;
var div, strong, text0, text1, span, text2_value = ctx.comment.author, text2, text3, text4_value = ctx.elapsed(ctx.comment.time, ctx.time), text4, text5, text6, raw_value = ctx.comment.html, raw_before;
return { $$self.$$.get = () => ({ comments, elapsed, time, foo });
c() {
div = createElement("div");
strong = createElement("strong");
text0 = createText(ctx.i);
text1 = createText("\n\n\t\t");
span = createElement("span");
text2 = createText(text2_value);
text3 = createText(" wrote ");
text4 = createText(text4_value);
text5 = createText(" ago:");
text6 = createText("\n\n\t\t");
raw_before = createElement('noscript');
span.className = "meta";
div.className = "comment";
},
m(target, anchor) { $$self.$$.set = $$props => {
insert(target, div, anchor); if ('comments' in $$props) comments = $$props.comments;
append(div, strong); if ('elapsed' in $$props) elapsed = $$props.elapsed;
append(strong, text0); if ('time' in $$props) time = $$props.time;
append(div, text1); if ('foo' in $$props) foo = $$props.foo;
append(div, span); };
append(span, text2); }
append(span, text3);
append(span, text4);
append(span, text5);
append(div, text6);
append(div, raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
},
p(changed, ctx) { class SvelteComponent extends SvelteComponent_1 {
if ((changed.comments) && text2_value !== (text2_value = ctx.comment.author)) { constructor(options) {
setData(text2, text2_value); super();
init(this, options, define, create_fragment, safe_not_equal);
} }
if ((changed.elapsed || changed.comments || changed.time) && text4_value !== (text4_value = ctx.elapsed(ctx.comment.time, ctx.time))) { get comments() {
setData(text4, text4_value); return this.$$.get().comments;
} }
if ((changed.comments) && raw_value !== (raw_value = ctx.comment.html)) { set comments(value) {
detachAfter(raw_before); this.$set({ comments: value });
raw_before.insertAdjacentHTML("afterend", raw_value); flush();
} }
},
d(detach) { get elapsed() {
if (detach) { return this.$$.get().elapsed;
detachNode(div);
} }
set elapsed(value) {
this.$set({ elapsed: value });
flush();
} }
};
}
function SvelteComponent(options) { get time() {
init(this, options); return this.$$.get().time;
this._state = assign({}, options.data); }
this._intro = true;
this._fragment = create_main_fragment(this, this._state); set time(value) {
this.$set({ time: value });
flush();
}
get foo() {
return this.$$.get().foo;
}
if (options.target) { set foo(value) {
this._fragment.c(); this.$set({ foo: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fixPosition, init, insert, proto, setData, updateKeyedEach, wrapAnimation } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fixPosition, flush, init, insert, run, safe_not_equal, setData, updateKeyedEach, wrapAnimation } from "svelte/internal.js";
function foo(node, animation, params) { function foo(node, animation, params) {
const dx = animation.from.left - animation.to.left; const dx = animation.from.left - animation.to.left;
@ -13,7 +13,7 @@ function foo(node, animation, params) {
node.dy = u * dy; node.dy = u * dy;
} }
}; };
}; }
function get_each_context(ctx, list, i) { function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx); const child_ctx = Object.create(ctx);
@ -21,50 +21,7 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
function create_main_fragment(component, ctx) { // (19:0) {#each things as thing (thing.id)}
var each_blocks_1 = [], each_lookup = blankObject(), each_anchor;
var each_value = ctx.things;
const get_key = ctx => ctx.thing.id;
for (var i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
each_blocks_1[i] = each_lookup[key] = create_each_block(component, key, child_ctx);
}
return {
c() {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].c();
each_anchor = createComment();
},
m(target, anchor) {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor);
insert(target, each_anchor, anchor);
},
p(changed, ctx) {
const each_value = ctx.things;
for (let i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].r();
each_blocks_1 = updateKeyedEach(each_blocks_1, component, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, fixAndOutroAndDestroyBlock, create_each_block, "m", each_anchor, get_each_context);
for (let i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].a();
},
d(detach) {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach);
if (detach) {
detachNode(each_anchor);
}
}
};
}
// (1:0) {#each things as thing (thing.id)}
function create_each_block(component, key_1, ctx) { function create_each_block(component, key_1, ctx) {
var div, text_value = ctx.thing.name, text, rect, animation; var div, text_value = ctx.thing.name, text, rect, animation;
@ -112,18 +69,83 @@ function create_each_block(component, key_1, ctx) {
}; };
} }
function SvelteComponent(options) { function create_fragment(component, ctx) {
init(this, options); var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current;
this._state = assign({}, options.data);
this._intro = true; var each_value = ctx.things;
const get_key = ctx => ctx.thing.id;
for (var i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
each_blocks_1[i] = each_lookup[key] = create_each_block(component, key, child_ctx);
}
return {
c() {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].c();
each_anchor = createComment();
},
m(target, anchor) {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor);
insert(target, each_anchor, anchor);
current = true;
},
p(changed, ctx) {
const each_value = ctx.things;
for (let i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].r();
each_blocks_1 = updateKeyedEach(each_blocks_1, component, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, fixAndOutroAndDestroyBlock, create_each_block, "m", each_anchor, get_each_context);
for (let i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].a();
},
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach);
if (detach) {
detachNode(each_anchor);
}
}
};
}
function define($$self, $$props) {
let { things } = $$props;
// TODO only what's needed by the template
$$self.$$.get = () => ({ things });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('things' in $$props) things = $$props.things;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get things() {
return this.$$.get().things;
}
if (options.target) { set things(value) {
this._fragment.c(); this.$set({ things: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, blankObject, createComment, createElement, createText, destroyBlock, detachNode, init, insert, proto, setData, updateKeyedEach } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, blankObject, createComment, createElement, createText, destroyBlock, detachNode, flush, init, insert, run, safe_not_equal, setData, updateKeyedEach } from "svelte/internal.js";
function get_each_context(ctx, list, i) { function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx); const child_ctx = Object.create(ctx);
@ -7,8 +7,42 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
function create_main_fragment(component, ctx) { // (1:0) {#each things as thing (thing.id)}
var each_blocks_1 = [], each_lookup = blankObject(), each_anchor; function create_each_block(component, key_1, ctx) {
var div, text_value = ctx.thing.name, text;
return {
key: key_1,
first: null,
c() {
div = createElement("div");
text = createText(text_value);
this.first = div;
},
m(target, anchor) {
insert(target, div, anchor);
append(div, text);
},
p(changed, ctx) {
if ((changed.things) && text_value !== (text_value = ctx.thing.name)) {
setData(text, text_value);
}
},
d(detach) {
if (detach) {
detachNode(div);
}
}
};
}
function create_fragment(component, ctx) {
var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current;
var each_value = ctx.things; var each_value = ctx.things;
@ -31,6 +65,7 @@ function create_main_fragment(component, ctx) {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor); for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].m(target, anchor);
insert(target, each_anchor, anchor); insert(target, each_anchor, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -38,6 +73,14 @@ function create_main_fragment(component, ctx) {
each_blocks_1 = updateKeyedEach(each_blocks_1, component, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, destroyBlock, create_each_block, "m", each_anchor, get_each_context); each_blocks_1 = updateKeyedEach(each_blocks_1, component, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, destroyBlock, create_each_block, "m", each_anchor, get_each_context);
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach); for (i = 0; i < each_blocks_1.length; i += 1) each_blocks_1[i].d(detach);
@ -48,52 +91,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (1:0) {#each things as thing (thing.id)} function define($$self, $$props) {
function create_each_block(component, key_1, ctx) { let { things } = $$props;
var div, text_value = ctx.thing.name, text;
return {
key: key_1,
first: null,
c() {
div = createElement("div");
text = createText(text_value);
this.first = div;
},
m(target, anchor) {
insert(target, div, anchor);
append(div, text);
},
p(changed, ctx) { $$self.$$.get = () => ({ things });
if ((changed.things) && text_value !== (text_value = ctx.thing.name)) {
setData(text, text_value);
}
},
d(detach) { $$self.$$.set = $$props => {
if (detach) { if ('things' in $$props) things = $$props.things;
detachNode(div);
}
}
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get things() {
return this.$$.get().things;
}
if (options.target) { set things(value) {
this._fragment.c(); this.$set({ things: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,60 +1,77 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, removeListener, run, safe_not_equal } from "svelte/internal.js";
function foo( node, callback ) { function handleFoo(bar) {
// code goes here console.log(bar);
}; }
var methods = {
foo ( bar ) {
console.log( bar );
}
};
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var button, foo_handler; var button, current;
return { return {
c() { c() {
button = createElement("button"); button = createElement("button");
button.textContent = "foo"; button.textContent = "foo";
foo_handler = foo.call(component, button, function(event) { addListener(button, "foo", ctx.foo_handler);
component.foo( ctx.bar );
});
}, },
m(target, anchor) { m(target, anchor) {
insert(target, button, anchor); insert(target, button, anchor);
current = true;
}, },
p(changed, _ctx) { p: noop,
ctx = _ctx;
i(target, anchor) {
if (current) return;
this.m(target, anchor);
}, },
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(button); detachNode(button);
} }
foo_handler.destroy(); removeListener(button, "foo", ctx.foo_handler);
} }
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { bar } = $$props;
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state); function foo(node, callback) {
// code goes here
}
if (options.target) { function foo_handler() {
this._fragment.c(); return handleFoo(bar);
this._mount(options.target, options.anchor);
} }
// TODO only what's needed by the template
$$self.$$.get = () => ({ bar, foo_handler });
$$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
} }
assign(SvelteComponent.prototype, proto); class SvelteComponent extends SvelteComponent_1 {
assign(SvelteComponent.prototype, methods); constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get bar() {
return this.$$.get().bar;
}
set bar(value) {
this.$set({ bar: value });
flush();
}
}
export default SvelteComponent; export default SvelteComponent;

@ -2,7 +2,7 @@
export let bar; export let bar;
function handleFoo(bar) { function handleFoo(bar) {
console.log( bar ); console.log(bar);
} }
function foo(node, callback) { function foo(node, callback) {
@ -10,4 +10,4 @@
} }
</script> </script>
<button on:foo='{() => handleFoo( bar )}'>foo</button> <button use:foo='{() => handleFoo(bar)}'>foo</button>

@ -1,36 +1,16 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addListener, append, assign, createElement, createText, detachNode, init, insert, noop, proto, removeListener } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addListener, append, createElement, createText, detachNode, init, insert, noop, removeListener, run, safe_not_equal } from "svelte/internal.js";
var methods = { function handleTouchstart() {
handleTouchstart() {
// ... // ...
}, }
handleClick() { function handleClick() {
// ... // ...
} }
};
function create_main_fragment(component, ctx) {
var div, button0, text1, button1, text3, button2;
function click_handler(event) {
event.preventDefault();
event.stopPropagation();
component.handleClick();
}
function click_handler_1(event) {
component.handleClick();
}
function click_handler_2(event) {
component.handleClick();
}
function touchstart_handler(event) { function create_fragment(component, ctx) {
component.handleTouchstart(); var div, button0, text1, button1, text3, button2, current;
}
return { return {
c() { c() {
@ -43,10 +23,10 @@ function create_main_fragment(component, ctx) {
text3 = createText("\n\t"); text3 = createText("\n\t");
button2 = createElement("button"); button2 = createElement("button");
button2.textContent = "or me!"; button2.textContent = "or me!";
addListener(button0, "click", click_handler); addListener(button0, "click|stopPropagation|preventDefault", handleClick);
addListener(button1, "click", click_handler_1, { once: true, capture: true }); addListener(button1, "click|once|capture", handleClick);
addListener(button2, "click", click_handler_2, true); addListener(button2, "click|capture", handleClick);
addListener(div, "touchstart", touchstart_handler, { passive: true }); addListener(div, "touchstart", handleTouchstart, { passive: true });
}, },
m(target, anchor) { m(target, anchor) {
@ -56,36 +36,37 @@ function create_main_fragment(component, ctx) {
append(div, button1); append(div, button1);
append(div, text3); append(div, text3);
append(div, button2); append(div, button2);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
} }
removeListener(button0, "click", click_handler); removeListener(button0, "click|stopPropagation|preventDefault", handleClick);
removeListener(button1, "click", click_handler_1, { once: true, capture: true }); removeListener(button1, "click|once|capture", handleClick);
removeListener(button2, "click", click_handler_2, true); removeListener(button2, "click|capture", handleClick);
removeListener(div, "touchstart", touchstart_handler, { passive: true }); removeListener(div, "touchstart", handleTouchstart, { passive: true });
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, init, noop, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var meta0, meta1; var meta0, meta1, current;
return { return {
c() { c() {
@ -17,10 +17,19 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
append(document.head, meta0); append(document.head, meta0);
append(document.head, meta1); append(document.head, meta1);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
detachNode(meta0); detachNode(meta0);
detachNode(meta1); detachNode(meta1);
@ -28,18 +37,11 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,54 +1,36 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createComment, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { // (3:0) {:else}
var if_block_anchor; function create_else_block(component, ctx) {
var p;
function select_block_type(ctx) {
if (ctx.foo) return create_if_block;
return create_else_block;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(component, ctx);
return { return {
c() { c() {
if_block.c(); p = createElement("p");
if_block_anchor = createComment(); p.textContent = "not foo!";
}, },
m(target, anchor) { m(target, anchor) {
if_block.m(target, anchor); insert(target, p, anchor);
insert(target, if_block_anchor, anchor);
},
p(changed, ctx) {
if (current_block_type !== (current_block_type = select_block_type(ctx))) {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
}, },
d(detach) { d(detach) {
if_block.d(detach);
if (detach) { if (detach) {
detachNode(if_block_anchor); detachNode(p);
} }
} }
}; };
} }
// (3:0) {:else} // (1:0) {#if foo}
function create_else_block(component, ctx) { function create_if_block(component, ctx) {
var p; var p;
return { return {
c() { c() {
p = createElement("p"); p = createElement("p");
p.textContent = "not foo!"; p.textContent = "foo!";
}, },
m(target, anchor) { m(target, anchor) {
@ -63,40 +45,80 @@ function create_else_block(component, ctx) {
}; };
} }
// (1:0) {#if foo} function create_fragment(component, ctx) {
function create_if_block(component, ctx) { var if_block_anchor, current;
var p;
function select_block_type(ctx) {
if (ctx.foo) return create_if_block;
return create_else_block;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(component, ctx);
return { return {
c() { c() {
p = createElement("p"); if_block.c();
p.textContent = "foo!"; if_block_anchor = createComment();
}, },
m(target, anchor) { m(target, anchor) {
insert(target, p, anchor); if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
current = true;
},
p(changed, ctx) {
if (current_block_type !== (current_block_type = select_block_type(ctx))) {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if_block.d(detach);
if (detach) { if (detach) {
detachNode(p); detachNode(if_block_anchor);
} }
} }
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { foo } = $$props;
this._state = assign({}, options.data);
this._intro = true; // TODO only what's needed by the template
$$self.$$.get = () => ({ foo });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get foo() {
return this.$$.get().foo;
}
if (options.target) { set foo(value) {
this._fragment.c(); this.$set({ foo: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,30 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createComment, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createComment, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { // (1:0) {#if foo}
var if_block_anchor; function create_if_block(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "foo!";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
}
};
}
function create_fragment(component, ctx) {
var if_block_anchor, current;
var if_block = (ctx.foo) && create_if_block(component, ctx); var if_block = (ctx.foo) && create_if_block(component, ctx);
@ -15,6 +37,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
if (if_block) if_block.m(target, anchor); if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor); insert(target, if_block_anchor, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -30,6 +53,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (if_block) if_block.d(detach); if (if_block) if_block.d(detach);
if (detach) { if (detach) {
@ -39,40 +70,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (1:0) {#if foo} function define($$self, $$props) {
function create_if_block(component, ctx) { let { foo } = $$props;
var p;
return {
c() {
p = createElement("p");
p.textContent = "foo!";
},
m(target, anchor) { $$self.$$.get = () => ({ foo });
insert(target, p, anchor);
},
d(detach) { $$self.$$.set = $$props => {
if (detach) { if ('foo' in $$props) foo = $$props.foo;
detachNode(p);
}
}
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get foo() {
return this.$$.get().foo;
}
if (options.target) { set foo(value) {
this._fragment.c(); this.$set({ foo: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div; var div, current;
return { return {
c() { c() {
@ -13,6 +13,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -25,6 +26,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -33,18 +42,50 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { color, x, y } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ color, x, y });
$$self.$$.set = $$props => {
if ('color' in $$props) color = $$props.color;
if ('x' in $$props) x = $$props.x;
if ('y' in $$props) y = $$props.y;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get color() {
return this.$$.get().color;
}
set color(value) {
this.$set({ color: value });
flush();
}
get x() {
return this.$$.get().x;
}
set x(value) {
this.$set({ x: value });
flush();
}
get y() {
return this.$$.get().y;
}
if (options.target) { set y(value) {
this._fragment.c(); this.$set({ y: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div; var div, current;
return { return {
c() { c() {
@ -12,6 +12,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -20,6 +21,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -28,18 +37,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { data } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ data });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('data' in $$props) data = $$props.data;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get data() {
return this.$$.get().data;
}
if (options.target) { set data(value) {
this._fragment.c(); this.$set({ data: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, run, safe_not_equal, setStyle } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div; var div, current;
return { return {
c() { c() {
@ -12,6 +12,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -20,6 +21,13 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -28,18 +36,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { color } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ color });
$$self.$$.set = $$props => {
if ('color' in $$props) color = $$props.color;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get color() {
return this.$$.get().color;
}
if (options.target) { set color(value) {
this._fragment.c(); this.$set({ color: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var div0, text, div1, div1_style_value; var div0, text, div1, div1_style_value, current;
return { return {
c() { c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, div0, anchor); insert(target, div0, anchor);
insert(target, text, anchor); insert(target, text, anchor);
insert(target, div1, anchor); insert(target, div1, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -29,6 +30,13 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div0); detachNode(div0);
@ -39,18 +47,50 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { style, key, value } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ style, key, value });
$$self.$$.set = $$props => {
if ('style' in $$props) style = $$props.style;
if ('key' in $$props) key = $$props.key;
if ('value' in $$props) value = $$props.value;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get style() {
return this.$$.get().style;
}
this._fragment = create_main_fragment(this, this._state); set style(value) {
this.$set({ style: value });
flush();
}
get key() {
return this.$$.get().key;
}
set key(value) {
this.$set({ key: value });
flush();
}
get value() {
return this.$$.get().value;
}
if (options.target) { set value(value) {
this._fragment.c(); this.$set({ value: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,19 +1,13 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener, setAttribute } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, removeListener, run, safe_not_equal, setAttribute } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var input, input_updating = false; var input, input_updating = false, current;
function input_input_handler() {
input_updating = true;
component.set({ files: input.files });
input_updating = false;
}
return { return {
c() { c() {
input = createElement("input"); input = createElement("input");
addListener(input, "input", input_input_handler); addListener(input, "input", ctx.input_input_handler);
setAttribute(input, "type", "file"); setAttribute(input, "type", "file");
input.multiple = true; input.multiple = true;
}, },
@ -22,34 +16,60 @@ function create_main_fragment(component, ctx) {
insert(target, input, anchor); insert(target, input, anchor);
input.files = ctx.files; input.files = ctx.files;
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
if (!input_updating && changed.files) input.files = ctx.files; if (!input_updating && changed.files) input.files = ctx.files;
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(input); detachNode(input);
} }
removeListener(input, "input", input_input_handler); removeListener(input, "input", ctx.input_input_handler);
} }
}; };
} }
function SvelteComponent(options) { function define($$self, $$props, $$make_dirty) {
init(this, options); let { files } = $$props;
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state); function input_input_handler() {
files = this.files;
$$make_dirty('files');
}
$$self.$$.get = () => ({ files, input_input_handler });
$$self.$$.set = $$props => {
if ('files' in $$props) files = $$props.files;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get files() {
return this.$$.get().files;
}
if (options.target) { set files(value) {
this._fragment.c(); this.$set({ files: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,18 +1,14 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener, setAttribute, toNumber } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, removeListener, run, safe_not_equal, setAttribute, toNumber } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var input; var input, current;
function input_change_input_handler() {
component.set({ value: toNumber(input.value) });
}
return { return {
c() { c() {
input = createElement("input"); input = createElement("input");
addListener(input, "change", input_change_input_handler); addListener(input, "change", ctx.input_change_input_handler);
addListener(input, "input", input_change_input_handler); addListener(input, "input", ctx.input_change_input_handler);
setAttribute(input, "type", "range"); setAttribute(input, "type", "range");
}, },
@ -20,35 +16,62 @@ function create_main_fragment(component, ctx) {
insert(target, input, anchor); insert(target, input, anchor);
input.value = ctx.value; input.value = ctx.value;
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.value) input.value = ctx.value; if (changed.value) input.value = ctx.value;
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(input); detachNode(input);
} }
removeListener(input, "change", input_change_input_handler); removeListener(input, "change", ctx.input_change_input_handler);
removeListener(input, "input", input_change_input_handler); removeListener(input, "input", ctx.input_change_input_handler);
}
};
}
function define($$self, $$props, $$make_dirty) {
let { value } = $$props;
function input_change_input_handler() {
value = toNumber(this.value);
$$make_dirty('value');
} }
$$self.$$.get = () => ({ value, input_change_input_handler });
$$self.$$.set = $$props => {
if ('value' in $$props) value = $$props.value;
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get value() {
return this.$$.get().value;
}
if (options.target) { set value(value) {
this._fragment.c(); this.$set({ value: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,17 +1,13 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addListener, assign, createElement, detachNode, init, insert, proto, removeListener, setAttribute } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, removeListener, run, safe_not_equal, setAttribute } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var input; var input, current;
function input_change_handler() {
component.set({ foo: input.checked });
}
return { return {
c() { c() {
input = createElement("input"); input = createElement("input");
addListener(input, "change", input_change_handler); addListener(input, "change", ctx.input_change_handler);
setAttribute(input, "type", "checkbox"); setAttribute(input, "type", "checkbox");
}, },
@ -19,34 +15,61 @@ function create_main_fragment(component, ctx) {
insert(target, input, anchor); insert(target, input, anchor);
input.checked = ctx.foo; input.checked = ctx.foo;
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.foo) input.checked = ctx.foo; if (changed.foo) input.checked = ctx.foo;
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(input); detachNode(input);
} }
removeListener(input, "change", input_change_handler); removeListener(input, "change", ctx.input_change_handler);
}
};
}
function define($$self, $$props, $$make_dirty) {
let { foo } = $$props;
function input_change_handler() {
foo = this.checked;
$$make_dirty('foo');
} }
$$self.$$.get = () => ({ foo, input_change_handler });
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get foo() {
return this.$$.get().foo;
}
if (options.target) { set foo(value) {
this._fragment.c(); this.$set({ foo: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createElement, detachNode, init, insert, noop, proto, setInputType } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, createElement, detachNode, init, insert, noop, run, safe_not_equal, setInputType } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var input; var input, current;
return { return {
c() { c() {
@ -12,10 +12,19 @@ function create_main_fragment(component, ctx) {
m(target, anchor) { m(target, anchor) {
insert(target, input, anchor); insert(target, input, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(input); detachNode(input);
@ -24,18 +33,11 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,99 +1,198 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { addListener, assign, createElement, detachNode, flush, init, insert, proto, removeListener, timeRangesToArray } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, createElement, detachNode, flush, init, insert, removeListener, run, safe_not_equal, timeRangesToArray } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe; var audio, audio_is_paused = true, audio_updating = false, audio_animationframe, current;
return {
c() {
audio = createElement("audio");
addListener(audio, "timeupdate", ctx.audio_timeupdate_handler);
if (ctx.played === void 0 || ctx.currentTime === void 0) add_render_callback(() => ctx.audio_timeupdate_handler.call(audio));
addListener(audio, "durationchange", ctx.audio_durationchange_handler);
if (ctx.duration === void 0) add_render_callback(() => ctx.audio_durationchange_handler.call(audio));
addListener(audio, "play", ctx.audio_play_pause_handler);
addListener(audio, "pause", ctx.audio_play_pause_handler);
addListener(audio, "progress", ctx.audio_progress_handler);
if (ctx.buffered === void 0) add_render_callback(() => ctx.audio_progress_handler.call(audio));
addListener(audio, "loadedmetadata", ctx.audio_loadedmetadata_handler);
if (ctx.buffered === void 0 || ctx.seekable === void 0) add_render_callback(() => ctx.audio_loadedmetadata_handler.call(audio));
addListener(audio, "volumechange", ctx.audio_volumechange_handler);
},
m(target, anchor) {
insert(target, audio, anchor);
audio.volume = ctx.volume;
current = true;
},
p(changed, ctx) {
if (!audio_updating && !isNaN(ctx.currentTime ) && changed.currentTime) audio.currentTime = ctx.currentTime ;
if (!audio_updating && audio_is_paused !== (audio_is_paused = ctx.paused ) && changed.paused) audio[audio_is_paused ? "pause" : "play"]();
if (!audio_updating && !isNaN(ctx.volume) && changed.volume) audio.volume = ctx.volume;
},
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) {
if (detach) {
detachNode(audio);
}
removeListener(audio, "timeupdate", ctx.audio_timeupdate_handler);
removeListener(audio, "durationchange", ctx.audio_durationchange_handler);
removeListener(audio, "play", ctx.audio_play_pause_handler);
removeListener(audio, "pause", ctx.audio_play_pause_handler);
removeListener(audio, "progress", ctx.audio_progress_handler);
removeListener(audio, "loadedmetadata", ctx.audio_loadedmetadata_handler);
removeListener(audio, "volumechange", ctx.audio_volumechange_handler);
}
};
}
function define($$self, $$make_dirty) {
// TODO some of these are read-only...
let { buffered, seekable, played, currentTime, duration, paused, volume } = $$props;
function audio_timeupdate_handler() { function audio_timeupdate_handler() {
cancelAnimationFrame(audio_animationframe); cancelAnimationFrame(audio_animationframe);
if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler); if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler);
audio_updating = true; played = timeRangesToArray(this.played);
component.set({ played: timeRangesToArray(audio.played), currentTime: audio.currentTime }); currentTime = this.currentTime;
audio_updating = false; $$make_dirty('played');
$$make_dirty('currentTime');
} }
function audio_durationchange_handler() { function audio_durationchange_handler() {
component.set({ duration: audio.duration }); duration = this.duration;
$$make_dirty('duration');
} }
function audio_play_pause_handler() { function audio_play_pause_handler() {
audio_updating = true; paused = this.paused;
component.set({ paused: audio.paused }); $$make_dirty('paused');
audio_updating = false;
} }
function audio_progress_handler() { function audio_progress_handler() {
component.set({ buffered: timeRangesToArray(audio.buffered) }); buffered = timeRangesToArray(this.buffered);
$$make_dirty('buffered');
} }
function audio_loadedmetadata_handler() { function audio_loadedmetadata_handler() {
component.set({ buffered: timeRangesToArray(audio.buffered), seekable: timeRangesToArray(audio.seekable) }); buffered = timeRangesToArray(this.buffered);
seekable = timeRangesToArray(this.seekable);
$$make_dirty('buffered');
$$make_dirty('seekable');
} }
function audio_volumechange_handler() { function audio_volumechange_handler() {
audio_updating = true; volume = this.volume;
component.set({ volume: audio.volume }); $$make_dirty('volume');
audio_updating = false;
} }
return { $$self.$$.get = () => ({
c() { buffered,
audio = createElement("audio"); seekable,
addListener(audio, "timeupdate", audio_timeupdate_handler); played,
if (!('played' in ctx && 'currentTime' in ctx)) component.root._beforecreate.push(audio_timeupdate_handler); currentTime,
addListener(audio, "durationchange", audio_durationchange_handler); duration,
if (!('duration' in ctx)) component.root._beforecreate.push(audio_durationchange_handler); paused,
addListener(audio, "play", audio_play_pause_handler); volume,
addListener(audio, "pause", audio_play_pause_handler); audio_timeupdate_handler,
addListener(audio, "progress", audio_progress_handler); audio_durationchange_handler,
if (!('buffered' in ctx)) component.root._beforecreate.push(audio_progress_handler); audio_play_pause_handler,
addListener(audio, "loadedmetadata", audio_loadedmetadata_handler); audio_progress_handler,
if (!('buffered' in ctx && 'seekable' in ctx)) component.root._beforecreate.push(audio_loadedmetadata_handler); audio_loadedmetadata_handler,
addListener(audio, "volumechange", audio_volumechange_handler); audio_volumechange_handler
}, });
$$self.$$.set = $$props => {
if ('buffered' in $$props) buffered = $$props.buffered;
if ('seekable' in $$props) seekable = $$props.seekable;
if ('played' in $$props) played = $$props.played;
if ('currentTime' in $$props) currentTime = $$props.currentTime;
if ('duration' in $$props) duration = $$props.duration;
if ('paused' in $$props) paused = $$props.paused;
if ('volume' in $$props) volume = $$props.volume;
};
}
m(target, anchor) { class SvelteComponent extends SvelteComponent_1 {
insert(target, audio, anchor); constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
audio.volume = ctx.volume; get buffered() {
}, return this.$$.get().buffered;
}
p(changed, ctx) { set buffered(value) {
if (!audio_updating && !isNaN(ctx.currentTime ) && changed.currentTime) audio.currentTime = ctx.currentTime ; this.$set({ buffered: value });
if (!audio_updating && audio_is_paused !== (audio_is_paused = ctx.paused ) && changed.paused) audio[audio_is_paused ? "pause" : "play"](); flush();
if (!audio_updating && !isNaN(ctx.volume) && changed.volume) audio.volume = ctx.volume; }
},
d(detach) { get seekable() {
if (detach) { return this.$$.get().seekable;
detachNode(audio);
} }
removeListener(audio, "timeupdate", audio_timeupdate_handler); set seekable(value) {
removeListener(audio, "durationchange", audio_durationchange_handler); this.$set({ seekable: value });
removeListener(audio, "play", audio_play_pause_handler); flush();
removeListener(audio, "pause", audio_play_pause_handler);
removeListener(audio, "progress", audio_progress_handler);
removeListener(audio, "loadedmetadata", audio_loadedmetadata_handler);
removeListener(audio, "volumechange", audio_volumechange_handler);
} }
};
}
function SvelteComponent(options) { get played() {
init(this, options); return this.$$.get().played;
this._state = assign({}, options.data); }
this._intro = true;
this._fragment = create_main_fragment(this, this._state); set played(value) {
this.$set({ played: value });
flush();
}
if (options.target) { get currentTime() {
this._fragment.c(); return this.$$.get().currentTime;
this._mount(options.target, options.anchor); }
set currentTime(value) {
this.$set({ currentTime: value });
flush();
}
get duration() {
return this.$$.get().duration;
}
set duration(value) {
this.$set({ duration: value });
flush();
}
get paused() {
return this.$$.get().paused;
}
set paused(value) {
this.$set({ paused: value });
flush();
}
get volume() {
return this.$$.get().volume;
}
flush(this); set volume(value) {
this.$set({ volume: value });
flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,62 +1,63 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, createText, detachNode, flush, init, insert, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, callAfter, createText, detachNode, init, insert, mount_component, noop, safe_not_equal } from "svelte/internal.js";
import Imported from 'Imported.html'; import Imported from "Imported.html";
function create_fragment(component, ctx) {
var text, current;
var imported = new Imported({});
function create_main_fragment(component, ctx) { var nonimported = new NonImported({});
var text;
var imported = new Imported({
root: component.root,
store: component.store
});
var nonimported = new NonImported({
root: component.root,
store: component.store
});
return { return {
c() { c() {
imported._fragment.c(); imported.$$.fragment.c();
text = createText("\n"); text = createText("\n");
nonimported._fragment.c(); nonimported.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
imported._mount(target, anchor); mount_component(imported, target, anchor);
insert(target, text, anchor); insert(target, text, anchor);
nonimported._mount(target, anchor); mount_component(nonimported, target, anchor);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o(outrocallback) {
if (!current) return;
outrocallback = callAfter(outrocallback, 2);
if (imported) imported.$$.fragment.o(outrocallback);
if (nonimported) nonimported.$$.fragment.o(outrocallback);
current = false;
},
d(detach) { d(detach) {
imported.destroy(detach); imported.$destroy(detach);
if (detach) { if (detach) {
detachNode(text); detachNode(text);
} }
nonimported.destroy(detach); nonimported.$destroy(detach);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
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; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createElement, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createElement, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var select, option0, option1, select_value_value; var select, option0, option1, select_value_value, current;
return { return {
c() { c() {
@ -31,6 +31,8 @@ function create_main_fragment(component, ctx) {
break; break;
} }
} }
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -46,6 +48,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(select); detachNode(select);
@ -54,18 +64,30 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { current } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ current });
$$self.$$.set = $$props => {
if ('current' in $$props) current = $$props.current;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state); get current() {
return this.$$.get().current;
}
if (options.target) { set current(value) {
this._fragment.c(); this.$set({ current: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,50 +1,32 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, init, noop, run, safe_not_equal } from "svelte/internal.js";
var methods = { export const SOME_CONSTANT = 42;
foo ( bar ) {
console.log( bar );
}
};
function setup(Component) { function foo(bar) {
Component.SOME_CONSTANT = 42; console.log(bar);
Component.factory = function (target) {
return new Component({
target: target
});
}
Component.prototype.foo( 'baz' );
} }
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
return { return {
c: noop, c: noop,
m: noop, m: noop,
p: noop, p: noop,
i: noop,
o: run,
d: noop d: noop
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, define, create_fragment, safe_not_equal);
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) { get foo() {
this._fragment.c(); return foo;
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
setup(SvelteComponent);
export default SvelteComponent; export default SvelteComponent;

@ -1,9 +1,9 @@
<script scope="shared"> <script context="module">
export const SOME_CONSTANT = 42; export const SOME_CONSTANT = 42;
</script> </script>
<script> <script>
export function foo(bar) { export function foo(bar) {
console.log( bar ); console.log(bar);
} }
</script> </script>

@ -1,16 +1,33 @@
"use strict"; /* generated by Svelte vX.Y.Z-alpha1 */
import { onMount, onDestroy } from "svelte";
function preload(input) { function preload(input) {
return output; return output;
}; }
function foo() {
console.log('foo');
}
function swipe(node, callback) {
// TODO implement
}
var SvelteComponent = {};; function define($$props) {
onMount(() => {
console.log('onMount');
});
onDestroy(() => {
console.log('onDestroy');
});
SvelteComponent.data = function() {
return {}; return {};
}; }
SvelteComponent.render = function(state, options = {}) { var SvelteComponent = {};
SvelteComponent.render = function(props = {}, options = {}) {
var components = new Set(); var components = new Set();
function addComponent(component) { function addComponent(component) {
@ -18,7 +35,7 @@ SvelteComponent.render = function(state, options = {}) {
} }
var result = { head: '', addComponent }; var result = { head: '', addComponent };
var html = SvelteComponent._render(result, state, options); var html = SvelteComponent.$$render(result, props, options);
var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n'); var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n');
@ -32,10 +49,10 @@ SvelteComponent.render = function(state, options = {}) {
}; };
} }
SvelteComponent._render = function(__result, ctx, options) { SvelteComponent.$$render = function($$result, props, options) {
__result.addComponent(SvelteComponent); const ctx = define(props);
ctx = Object.assign({}, ctx); $$result.addComponent(SvelteComponent);
return ``; return ``;
}; };
@ -46,7 +63,4 @@ SvelteComponent.css = {
}; };
var warned = false; var warned = false;
export default SvelteComponent;
SvelteComponent.preload = preload;
module.exports = SvelteComponent;

@ -1,4 +1,4 @@
<script scope="shared"> <script context="module">
export function preload(input) { export function preload(input) {
return output; return output;
} }
@ -8,7 +8,7 @@
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
onMount(() => { onMount(() => {
console.log('oncreate'); console.log('onMount');
}); });
onDestroy(() => { onDestroy(() => {

@ -1,12 +1,7 @@
"use strict"; /* generated by Svelte vX.Y.Z-alpha1 */
var SvelteComponent = {};
var SvelteComponent = {};; SvelteComponent.render = function(props = {}, options = {}) {
SvelteComponent.data = function() {
return {};
};
SvelteComponent.render = function(state, options = {}) {
var components = new Set(); var components = new Set();
function addComponent(component) { function addComponent(component) {
@ -14,7 +9,7 @@ SvelteComponent.render = function(state, options = {}) {
} }
var result = { head: '', addComponent }; var result = { head: '', addComponent };
var html = SvelteComponent._render(result, state, options); var html = SvelteComponent.$$render(result, props, options);
var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n'); var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\n');
@ -28,14 +23,12 @@ SvelteComponent.render = function(state, options = {}) {
}; };
} }
SvelteComponent._render = function(__result, ctx, options) { SvelteComponent.$$render = function($$result, ctx, options) {
__result.addComponent(SvelteComponent); $$result.addComponent(SvelteComponent);
ctx = Object.assign({}, ctx);
return `<div>content</div> return `<div>content</div>
<!-- comment --> <!-- comment -->
<div>more content</div>`; <div>more content</div>`;
}; };
SvelteComponent.css = { SvelteComponent.css = {
@ -44,5 +37,4 @@ SvelteComponent.css = {
}; };
var warned = false; var warned = false;
export default SvelteComponent;
module.exports = SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createSvgElement, createText, detachNode, init, insert, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createSvgElement, createText, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var svg, title, text; var svg, title, text, current;
return { return {
c() { c() {
@ -15,10 +15,19 @@ function create_main_fragment(component, ctx) {
insert(target, svg, anchor); insert(target, svg, anchor);
append(svg, title); append(svg, title);
append(title, text); append(title, text);
current = true;
}, },
p: noop, p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(svg); detachNode(svg);
@ -27,18 +36,11 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends SvelteComponent_1 {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super();
this._intro = true; init(this, options, noop, create_fragment, safe_not_equal);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { assign, init, noop, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var title_value; var title_value, current;
document.title = title_value = "a " + ctx.custom + " title"; document.title = title_value = "a " + ctx.custom + " title";
@ -17,22 +17,38 @@ function create_main_fragment(component, ctx) {
} }
}, },
i: noop,
o: run,
d: noop d: noop
}; };
} }
function SvelteComponent(options) { function define($$self, $$props) {
init(this, options); let { custom } = $$props;
this._state = assign({}, options.data);
this._intro = true; $$self.$$.get = () => ({ custom });
this._fragment = create_main_fragment(this, this._state); $$self.$$.set = $$props => {
if ('custom' in $$props) custom = $$props.custom;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
}
get custom() {
return this.$$.get().custom;
}
if (options.target) { set custom(value) {
this._fragment.c(); this.$set({ custom: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,8 +1,118 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createComment, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, append, createComment, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal } from "svelte/internal.js";
function create_main_fragment(component, ctx) { // (2:1) {#if a}
var div, text0, p0, text2, text3, text4, p1, text6, text7, if_block4_anchor; function create_if_block_4(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "a";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
}
};
}
// (8:1) {#if b}
function create_if_block_3(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "b";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
}
};
}
// (12:1) {#if c}
function create_if_block_2(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "c";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
}
};
}
// (18:1) {#if d}
function create_if_block_1(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "d";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
}
};
}
// (25:0) {#if e}
function create_if_block(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "e";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
}
};
}
function create_fragment(component, ctx) {
var div, text0, p0, text2, text3, text4, p1, text6, text7, if_block4_anchor, current;
var if_block0 = (ctx.a) && create_if_block_4(component, ctx); var if_block0 = (ctx.a) && create_if_block_4(component, ctx);
@ -51,6 +161,7 @@ function create_main_fragment(component, ctx) {
insert(target, text7, anchor); insert(target, text7, anchor);
if (if_block4) if_block4.m(target, anchor); if (if_block4) if_block4.m(target, anchor);
insert(target, if_block4_anchor, anchor); insert(target, if_block4_anchor, anchor);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -110,6 +221,14 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
if (detach) { if (detach) {
detachNode(div); detachNode(div);
@ -131,128 +250,70 @@ function create_main_fragment(component, ctx) {
}; };
} }
// (2:1) {#if a} function define($$self, $$props) {
function create_if_block_4(component, ctx) { let { a, b, c, d, e } = $$props;
var p;
return { $$self.$$.get = () => ({ a, b, c, d, e });
c() {
p = createElement("p");
p.textContent = "a";
},
m(target, anchor) { $$self.$$.set = $$props => {
insert(target, p, anchor); if ('a' in $$props) a = $$props.a;
}, if ('b' in $$props) b = $$props.b;
if ('c' in $$props) c = $$props.c;
d(detach) { if ('d' in $$props) d = $$props.d;
if (detach) { if ('e' in $$props) e = $$props.e;
detachNode(p);
}
}
}; };
} }
// (8:1) {#if b} class SvelteComponent extends SvelteComponent_1 {
function create_if_block_3(component, ctx) { constructor(options) {
var p; super();
init(this, options, define, create_fragment, safe_not_equal);
return {
c() {
p = createElement("p");
p.textContent = "b";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
} }
};
}
// (12:1) {#if c}
function create_if_block_2(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "c";
},
m(target, anchor) { get a() {
insert(target, p, anchor); return this.$$.get().a;
},
d(detach) {
if (detach) {
detachNode(p);
}
} }
};
}
// (18:1) {#if d} set a(value) {
function create_if_block_1(component, ctx) { this.$set({ a: value });
var p; flush();
return {
c() {
p = createElement("p");
p.textContent = "d";
},
m(target, anchor) {
insert(target, p, anchor);
},
d(detach) {
if (detach) {
detachNode(p);
}
} }
};
}
// (25:0) {#if e} get b() {
function create_if_block(component, ctx) { return this.$$.get().b;
var p; }
return { set b(value) {
c() { this.$set({ b: value });
p = createElement("p"); flush();
p.textContent = "e"; }
},
m(target, anchor) { get c() {
insert(target, p, anchor); return this.$$.get().c;
}, }
d(detach) { set c(value) {
if (detach) { this.$set({ c: value });
detachNode(p); flush();
} }
get d() {
return this.$$.get().d;
} }
};
}
function SvelteComponent(options) { set d(value) {
init(this, options); this.$set({ d: value });
this._state = assign({}, options.data); flush();
this._intro = true; }
this._fragment = create_main_fragment(this, this._state); get e() {
return this.$$.get().e;
}
if (options.target) { set e(value) {
this._fragment.c(); this.$set({ e: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,21 +1,13 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z-alpha1 */
import { append, assign, createElement, createText, detachNode, init, insert, proto, setData } from "svelte/shared.js"; import { SvelteComponent as SvelteComponent_1, add_render_callback, append, createElement, createText, detachNode, flush, init, insert, run, safe_not_equal, setData } from "svelte/internal.js";
function create_main_fragment(component, ctx) { function create_fragment(component, ctx) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text0, text1; var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text0, text1, current;
function onwindowscroll(event) { window.addEventListener("scroll", ctx.onwindowscroll);
if (window_updating) return; add_render_callback(ctx.onwindowscroll);
window_updating = true;
component.set({
y: this.pageYOffset
});
window_updating = false;
}
window.addEventListener("scroll", onwindowscroll);
component.on("state", ({ changed, current }) => { component.$on("state", ({ changed, current }) => {
if (changed["y"] && !window_updating) { if (changed["y"] && !window_updating) {
window_updating = true; window_updating = true;
clearTimeout(window_updating_timeout); clearTimeout(window_updating_timeout);
@ -35,6 +27,7 @@ function create_main_fragment(component, ctx) {
insert(target, p, anchor); insert(target, p, anchor);
append(p, text0); append(p, text0);
append(p, text1); append(p, text1);
current = true;
}, },
p(changed, ctx) { p(changed, ctx) {
@ -43,8 +36,16 @@ function create_main_fragment(component, ctx) {
} }
}, },
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) { d(detach) {
window.removeEventListener("scroll", onwindowscroll); window.removeEventListener("scroll", ctx.onwindowscroll);
if (detach) { if (detach) {
detachNode(p); detachNode(p);
@ -53,22 +54,38 @@ function create_main_fragment(component, ctx) {
}; };
} }
function SvelteComponent(options) { function define($$self, $$make_dirty) {
init(this, options); let { y } = $$props;
this._state = assign({}, options.data);
if ("y" in this._state) { function onwindowscroll() {
window.scrollTo(window.pageXOffset, this._state.y); if (window_updating) return;
window_updating = true;
y = window.pageYOffset; $$make_dirty('y');
window_updating = false;
}
// TODO only what's needed by the template
$$self.$$.get = () => ({ y, onwindowscroll });
$$self.$$.set = $$props => {
if ('y' in $$props) y = $$props.y;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, define, create_fragment, safe_not_equal);
} }
this._state.y = window.pageYOffset;
this._intro = true;
this._fragment = create_main_fragment(this, this._state); get y() {
return this.$$.get().y;
}
if (options.target) { set y(value) {
this._fragment.c(); this.$set({ y: value });
this._mount(options.target, options.anchor); flush();
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;
Loading…
Cancel
Save