some aspirational compiler output

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

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

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

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

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

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

@ -1,50 +1,51 @@
/* generated by Svelte vX.Y.Z */
import { _differsImmutable, assign, flush, init, noop, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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({
root: component.root,
store: component.store,
data: nested_initial_data
props: { foo: "bar" }
});
return {
c() {
nested._fragment.c();
nested.$$.fragment.c();
},
m(target, anchor) {
nested._mount(target, anchor);
mount_component(nested, target, anchor);
current = true;
},
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) {
nested.destroy(detach);
nested.$destroy(detach);
}
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
flush(this);
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
init(this, options, noop, create_fragment, not_equal);
}
}
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._differs = _differsImmutable;
export default SvelteComponent;

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

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

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

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insert, noop, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div;
function create_fragment(component, ctx) {
var div, current;
return {
c() {
@ -13,10 +13,19 @@ function create_main_fragment(component, ctx) {
m(target, anchor) {
insert(target, div, anchor);
current = true;
},
p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) {
if (detach) {
detachNode(div);
@ -25,39 +34,25 @@ function create_main_fragment(component, ctx) {
};
}
class SvelteComponent extends HTMLElement {
constructor(options = {}) {
class SvelteComponent extends SvelteElement {
constructor(options) {
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._fragment = create_main_fragment(this, this._state);
this._fragment.c();
this._fragment.m(this.shadowRoot, null);
init(this, { target: this.shadowRoot }, noop, create_fragment, safe_not_equal);
if (options.target) this._mount(options.target, options.anchor);
if (options) {
if (options.target) {
insert(options.target, this, options.anchor);
}
}
}
static get observedAttributes() {
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);
export default SvelteComponent;

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

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

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

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

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

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

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div0, text, div1;
function create_fragment(component, ctx) {
var div0, text, div1, current;
return {
c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, div0, anchor);
insert(target, text, anchor);
insert(target, div1, anchor);
current = true;
},
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) {
if (detach) {
detachNode(div0);
@ -35,18 +44,30 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { bar } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set bar(value) {
this.$set({ bar: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insert, proto, setAttribute } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div0, text, div1;
function create_fragment(component, ctx) {
var div0, text, div1, current;
return {
c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, div0, anchor);
insert(target, text, anchor);
insert(target, div1, anchor);
current = true;
},
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) {
if (detach) {
detachNode(div0);
@ -35,18 +44,30 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { bar } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set bar(value) {
this.$set({ bar: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { append, assign, createSvgElement, detachNode, init, insert, proto, setAttribute } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var svg, g0, g1;
function create_fragment(component, ctx) {
var svg, g0, g1, current;
return {
c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, svg, anchor);
append(svg, g0);
append(svg, g1);
current = true;
},
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) {
if (detach) {
detachNode(svg);
@ -33,18 +42,30 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { bar } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set bar(value) {
this.$set({ bar: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,46 +1,72 @@
/* generated by Svelte vX.Y.Z */
import { assign, flush, init, noop, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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 LazyLoad({
root: component.root,
store: component.store,
data: lazyload_initial_data
var lazyload = new ctx.LazyLoad({
props: { load: func }
});
return {
c() {
lazyload._fragment.c();
lazyload.$$.fragment.c();
},
m(target, anchor) {
lazyload._mount(target, anchor);
mount_component(lazyload, target, anchor);
current = true;
},
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) {
lazyload.destroy(detach);
lazyload.$destroy(detach);
}
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { LazyLoad } = $$props;
$$self.$$.get = () => ({ LazyLoad });
this._fragment = create_main_fragment(this, this._state);
$$self.$$.set = $$props => {
if ('LazyLoad' in $$props) LazyLoad = $$props.LazyLoad;
};
}
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
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;

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

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { append, assign, blankObject, createComment, createElement, createText, detachNode, fixAndOutroAndDestroyBlock, fixPosition, init, insert, proto, setData, updateKeyedEach, wrapAnimation } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
const dx = animation.from.left - animation.to.left;
@ -13,7 +13,7 @@ function foo(node, animation, params) {
node.dy = u * dy;
}
};
};
}
function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx);
@ -21,50 +21,7 @@ function get_each_context(ctx, list, i) {
return child_ctx;
}
function create_main_fragment(component, ctx) {
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)}
// (19:0) {#each things as thing (thing.id)}
function create_each_block(component, key_1, ctx) {
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) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function create_fragment(component, ctx) {
var each_blocks_1 = [], each_lookup = blankObject(), each_anchor, current;
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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set things(value) {
this.$set({ things: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { append, assign, blankObject, createComment, createElement, createText, destroyBlock, detachNode, init, insert, proto, setData, updateKeyedEach } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
const child_ctx = Object.create(ctx);
@ -7,8 +7,42 @@ function get_each_context(ctx, list, i) {
return child_ctx;
}
function create_main_fragment(component, ctx) {
var each_blocks_1 = [], each_lookup = blankObject(), each_anchor;
// (1:0) {#each things as thing (thing.id)}
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;
@ -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);
insert(target, each_anchor, anchor);
current = true;
},
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);
},
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);
@ -48,52 +91,30 @@ function create_main_fragment(component, ctx) {
};
}
// (1:0) {#each things as thing (thing.id)}
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);
},
function define($$self, $$props) {
let { things } = $$props;
p(changed, ctx) {
if ((changed.things) && text_value !== (text_value = ctx.thing.name)) {
setData(text, text_value);
}
},
$$self.$$.get = () => ({ things });
d(detach) {
if (detach) {
detachNode(div);
}
}
$$self.$$.set = $$props => {
if ('things' in $$props) things = $$props.things;
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
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 things() {
return this.$$.get().things;
}
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
set things(value) {
this.$set({ things: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,60 +1,77 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insert, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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 ) {
// code goes here
};
var methods = {
foo ( bar ) {
console.log( bar );
}
};
function handleFoo(bar) {
console.log(bar);
}
function create_main_fragment(component, ctx) {
var button, foo_handler;
function create_fragment(component, ctx) {
var button, current;
return {
c() {
button = createElement("button");
button.textContent = "foo";
foo_handler = foo.call(component, button, function(event) {
component.foo( ctx.bar );
});
addListener(button, "foo", ctx.foo_handler);
},
m(target, anchor) {
insert(target, button, anchor);
current = true;
},
p(changed, _ctx) {
ctx = _ctx;
p: noop,
i(target, anchor) {
if (current) return;
this.m(target, anchor);
},
o: run,
d(detach) {
if (detach) {
detachNode(button);
}
foo_handler.destroy();
removeListener(button, "foo", ctx.foo_handler);
}
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { bar } = $$props;
this._fragment = create_main_fragment(this, this._state);
function foo(node, callback) {
// code goes here
}
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
function foo_handler() {
return handleFoo(bar);
}
// 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);
assign(SvelteComponent.prototype, methods);
class SvelteComponent extends SvelteComponent_1 {
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;

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

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

@ -1,54 +1,36 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insert, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var if_block_anchor;
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);
// (3:0) {:else}
function create_else_block(component, ctx) {
var p;
return {
c() {
if_block.c();
if_block_anchor = createComment();
p = createElement("p");
p.textContent = "not foo!";
},
m(target, anchor) {
if_block.m(target, 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);
}
insert(target, p, anchor);
},
d(detach) {
if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
detachNode(p);
}
}
};
}
// (3:0) {:else}
function create_else_block(component, ctx) {
// (1:0) {#if foo}
function create_if_block(component, ctx) {
var p;
return {
c() {
p = createElement("p");
p.textContent = "not foo!";
p.textContent = "foo!";
},
m(target, anchor) {
@ -63,40 +45,80 @@ function create_else_block(component, ctx) {
};
}
// (1:0) {#if foo}
function create_if_block(component, ctx) {
var p;
function create_fragment(component, ctx) {
var if_block_anchor, current;
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 {
c() {
p = createElement("p");
p.textContent = "foo!";
if_block.c();
if_block_anchor = createComment();
},
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) {
if_block.d(detach);
if (detach) {
detachNode(p);
detachNode(if_block_anchor);
}
}
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { foo } = $$props;
// 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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set foo(value) {
this.$set({ foo: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

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

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div;
function create_fragment(component, ctx) {
var div, current;
return {
c() {
@ -13,6 +13,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) {
insert(target, div, anchor);
current = true;
},
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) {
if (detach) {
detachNode(div);
@ -33,18 +42,50 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { color, x, y } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set y(value) {
this.$set({ y: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div;
function create_fragment(component, ctx) {
var div, current;
return {
c() {
@ -12,6 +12,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) {
insert(target, div, anchor);
current = true;
},
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) {
if (detach) {
detachNode(div);
@ -28,18 +37,30 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { data } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set data(value) {
this.$set({ data: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insert, proto, setStyle } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div;
function create_fragment(component, ctx) {
var div, current;
return {
c() {
@ -12,6 +12,7 @@ function create_main_fragment(component, ctx) {
m(target, anchor) {
insert(target, div, anchor);
current = true;
},
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) {
if (detach) {
detachNode(div);
@ -28,18 +36,30 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { color } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set color(value) {
this.$set({ color: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insert, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var div0, text, div1, div1_style_value;
function create_fragment(component, ctx) {
var div0, text, div1, div1_style_value, current;
return {
c() {
@ -17,6 +17,7 @@ function create_main_fragment(component, ctx) {
insert(target, div0, anchor);
insert(target, text, anchor);
insert(target, div1, anchor);
current = true;
},
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) {
if (detach) {
detachNode(div0);
@ -39,18 +47,50 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { style, key, value } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set value(value) {
this.$set({ value: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

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

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

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

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

@ -1,61 +1,31 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, flush, init, insert, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe;
function audio_timeupdate_handler() {
cancelAnimationFrame(audio_animationframe);
if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler);
audio_updating = true;
component.set({ played: timeRangesToArray(audio.played), currentTime: audio.currentTime });
audio_updating = false;
}
function audio_durationchange_handler() {
component.set({ duration: audio.duration });
}
function audio_play_pause_handler() {
audio_updating = true;
component.set({ paused: audio.paused });
audio_updating = false;
}
function audio_progress_handler() {
component.set({ buffered: timeRangesToArray(audio.buffered) });
}
function audio_loadedmetadata_handler() {
component.set({ buffered: timeRangesToArray(audio.buffered), seekable: timeRangesToArray(audio.seekable) });
}
function audio_volumechange_handler() {
audio_updating = true;
component.set({ volume: audio.volume });
audio_updating = false;
}
function create_fragment(component, ctx) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe, current;
return {
c() {
audio = createElement("audio");
addListener(audio, "timeupdate", audio_timeupdate_handler);
if (!('played' in ctx && 'currentTime' in ctx)) component.root._beforecreate.push(audio_timeupdate_handler);
addListener(audio, "durationchange", audio_durationchange_handler);
if (!('duration' in ctx)) component.root._beforecreate.push(audio_durationchange_handler);
addListener(audio, "play", audio_play_pause_handler);
addListener(audio, "pause", audio_play_pause_handler);
addListener(audio, "progress", audio_progress_handler);
if (!('buffered' in ctx)) component.root._beforecreate.push(audio_progress_handler);
addListener(audio, "loadedmetadata", audio_loadedmetadata_handler);
if (!('buffered' in ctx && 'seekable' in ctx)) component.root._beforecreate.push(audio_loadedmetadata_handler);
addListener(audio, "volumechange", audio_volumechange_handler);
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) {
@ -64,36 +34,165 @@ function create_main_fragment(component, ctx) {
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", audio_timeupdate_handler);
removeListener(audio, "durationchange", audio_durationchange_handler);
removeListener(audio, "play", audio_play_pause_handler);
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);
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 SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
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() {
cancelAnimationFrame(audio_animationframe);
if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler);
played = timeRangesToArray(this.played);
currentTime = this.currentTime;
$$make_dirty('played');
$$make_dirty('currentTime');
}
function audio_durationchange_handler() {
duration = this.duration;
$$make_dirty('duration');
}
function audio_play_pause_handler() {
paused = this.paused;
$$make_dirty('paused');
}
function audio_progress_handler() {
buffered = timeRangesToArray(this.buffered);
$$make_dirty('buffered');
}
function audio_loadedmetadata_handler() {
buffered = timeRangesToArray(this.buffered);
seekable = timeRangesToArray(this.seekable);
$$make_dirty('buffered');
$$make_dirty('seekable');
}
function audio_volumechange_handler() {
volume = this.volume;
$$make_dirty('volume');
}
$$self.$$.get = () => ({
buffered,
seekable,
played,
currentTime,
duration,
paused,
volume,
audio_timeupdate_handler,
audio_durationchange_handler,
audio_play_pause_handler,
audio_progress_handler,
audio_loadedmetadata_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;
};
}
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 buffered() {
return this.$$.get().buffered;
}
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
set buffered(value) {
this.$set({ buffered: value });
flush();
}
get seekable() {
return this.$$.get().seekable;
}
set seekable(value) {
this.$set({ seekable: value });
flush();
}
get played() {
return this.$$.get().played;
}
set played(value) {
this.$set({ played: value });
flush();
}
get currentTime() {
return this.$$.get().currentTime;
}
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;

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

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import { append, assign, createElement, detachNode, init, insert, proto } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var select, option0, option1, select_value_value;
function create_fragment(component, ctx) {
var select, option0, option1, select_value_value, current;
return {
c() {
@ -31,6 +31,8 @@ function create_main_fragment(component, ctx) {
break;
}
}
current = true;
},
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) {
if (detach) {
detachNode(select);
@ -54,18 +64,30 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
function define($$self, $$props) {
let { current } = $$props;
$$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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set current(value) {
this.$set({ current: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

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

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

@ -1,16 +1,33 @@
"use strict";
/* generated by Svelte vX.Y.Z-alpha1 */
import { onMount, onDestroy } from "svelte";
function preload(input) {
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 {};
};
}
SvelteComponent.render = function(state, options = {}) {
var SvelteComponent = {};
SvelteComponent.render = function(props = {}, options = {}) {
var components = new Set();
function addComponent(component) {
@ -18,7 +35,7 @@ SvelteComponent.render = function(state, options = {}) {
}
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');
@ -32,10 +49,10 @@ SvelteComponent.render = function(state, options = {}) {
};
}
SvelteComponent._render = function(__result, ctx, options) {
__result.addComponent(SvelteComponent);
SvelteComponent.$$render = function($$result, props, options) {
const ctx = define(props);
ctx = Object.assign({}, ctx);
$$result.addComponent(SvelteComponent);
return ``;
};
@ -46,7 +63,4 @@ SvelteComponent.css = {
};
var warned = false;
SvelteComponent.preload = preload;
module.exports = SvelteComponent;
export default SvelteComponent;

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

@ -1,12 +1,7 @@
"use strict";
/* generated by Svelte vX.Y.Z-alpha1 */
var SvelteComponent = {};
var SvelteComponent = {};;
SvelteComponent.data = function() {
return {};
};
SvelteComponent.render = function(state, options = {}) {
SvelteComponent.render = function(props = {}, options = {}) {
var components = new Set();
function addComponent(component) {
@ -14,7 +9,7 @@ SvelteComponent.render = function(state, options = {}) {
}
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');
@ -28,14 +23,12 @@ SvelteComponent.render = function(state, options = {}) {
};
}
SvelteComponent._render = function(__result, ctx, options) {
__result.addComponent(SvelteComponent);
ctx = Object.assign({}, ctx);
SvelteComponent.$$render = function($$result, ctx, options) {
$$result.addComponent(SvelteComponent);
return `<div>content</div>
<!-- comment -->
<div>more content</div>`;
<!-- comment -->
<div>more content</div>`;
};
SvelteComponent.css = {
@ -44,5 +37,4 @@ SvelteComponent.css = {
};
var warned = false;
module.exports = SvelteComponent;
export default SvelteComponent;

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

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

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

@ -1,21 +1,13 @@
/* generated by Svelte vX.Y.Z */
import { append, assign, createElement, createText, detachNode, init, insert, proto, setData } from "svelte/shared.js";
/* generated by Svelte vX.Y.Z-alpha1 */
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) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text0, text1;
function create_fragment(component, ctx) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text0, text1, current;
function onwindowscroll(event) {
if (window_updating) return;
window_updating = true;
component.set({
y: this.pageYOffset
});
window_updating = false;
}
window.addEventListener("scroll", onwindowscroll);
window.addEventListener("scroll", ctx.onwindowscroll);
add_render_callback(ctx.onwindowscroll);
component.on("state", ({ changed, current }) => {
component.$on("state", ({ changed, current }) => {
if (changed["y"] && !window_updating) {
window_updating = true;
clearTimeout(window_updating_timeout);
@ -35,6 +27,7 @@ function create_main_fragment(component, ctx) {
insert(target, p, anchor);
append(p, text0);
append(p, text1);
current = true;
},
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) {
window.removeEventListener("scroll", onwindowscroll);
window.removeEventListener("scroll", ctx.onwindowscroll);
if (detach) {
detachNode(p);
@ -53,22 +54,38 @@ function create_main_fragment(component, ctx) {
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if ("y" in this._state) {
window.scrollTo(window.pageXOffset, this._state.y);
function define($$self, $$make_dirty) {
let { y } = $$props;
function onwindowscroll() {
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) {
this._fragment.c();
this._mount(options.target, options.anchor);
set y(value) {
this.$set({ y: value });
flush();
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;
Loading…
Cancel
Save