mirror of https://github.com/sveltejs/svelte
parent
286cabaf63
commit
ab79cc6608
@ -1,204 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function data() {
|
|
||||||
return { foo: 42 }
|
|
||||||
}
|
|
||||||
function add_css() {
|
|
||||||
var style = createElement("style");
|
|
||||||
style.id = 'svelte-1a7i8ec-style';
|
|
||||||
style.textContent = "p.svelte-1a7i8ec,.svelte-1a7i8ec p{color:red}";
|
|
||||||
appendNode(style, document.head);
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var p, text;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText(state.foo);
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
p.className = "svelte-1a7i8ec";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.foo) {
|
|
||||||
text.data = state.foo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign(data(), options.data);
|
|
||||||
|
|
||||||
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,204 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function data() {
|
|
||||||
return { foo: 42 }
|
|
||||||
}
|
|
||||||
function add_css() {
|
|
||||||
var style = createElement("style");
|
|
||||||
style.id = 'svelte-1a7i8ec-style';
|
|
||||||
style.textContent = "p.svelte-1a7i8ec,.svelte-1a7i8ec p{color:red}";
|
|
||||||
appendNode(style, document.head);
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var p, text;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText(state.foo);
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
p.className = "svelte-1a7i8ec";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.foo) {
|
|
||||||
text.data = state.foo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign(data(), options.data);
|
|
||||||
|
|
||||||
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function data() {
|
|
||||||
return { foo: 42 }
|
|
||||||
};
|
|
||||||
|
|
||||||
function add_css() {
|
|
||||||
var style = createElement("style");
|
|
||||||
style.id = 'svelte-1a7i8ec-style';
|
|
||||||
style.textContent = "p.svelte-1a7i8ec,.svelte-1a7i8ec p{color:red}";
|
|
||||||
appendNode(style, document.head);
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var p, text;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText(state.foo);
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
p.className = "svelte-1a7i8ec";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.foo) {
|
|
||||||
text.data = state.foo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign(data(), options.data);
|
|
||||||
|
|
||||||
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
|
|
||||||
<!-- a -->
|
|
||||||
|
|
||||||
<!-- b -->
|
|
||||||
|
|
||||||
<p>{foo}</p>
|
|
||||||
|
|
||||||
<!-- c -->
|
|
||||||
|
|
||||||
<!-- d -->
|
|
||||||
|
|
||||||
<style>
|
|
||||||
p {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!-- e -->
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data: function () {
|
|
||||||
return { foo: 42 }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- f -->
|
|
||||||
|
|
||||||
<!-- g -->
|
|
||||||
@ -1,8 +1,8 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
a: x => x * 2,
|
a: ({ x }) => x * 2,
|
||||||
b: x => x * 3
|
b: ({ x }) => x * 3
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -1,276 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroyEach(iterations) {
|
|
||||||
for (var i = 0; i < iterations.length; i += 1) {
|
|
||||||
if (iterations[i]) iterations[i].d();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var each_anchor;
|
|
||||||
|
|
||||||
var each_value = state.createElement;
|
|
||||||
|
|
||||||
var each_blocks = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
node: each_value[i],
|
|
||||||
node_index: i
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
each_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(target, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertNode(each_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
var each_value = state.createElement;
|
|
||||||
|
|
||||||
if (changed.createElement) {
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
var each_context = assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
node: each_value[i],
|
|
||||||
node_index: i
|
|
||||||
});
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(changed, each_context);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(component, each_context);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(each_anchor.parentNode, each_anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
each_blocks[i].d();
|
|
||||||
}
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
}
|
|
||||||
|
|
||||||
detachNode(each_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
destroyEach(each_blocks);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#each createElement as node}
|
|
||||||
function create_each_block(component, state) {
|
|
||||||
var node = state.node, each_value = state.each_value, node_index = state.node_index;
|
|
||||||
var span, text_value = node, text;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
span = createElement("span");
|
|
||||||
text = createText(text_value);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(span, target, anchor);
|
|
||||||
appendNode(text, span);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
node = state.node;
|
|
||||||
each_value = state.each_value;
|
|
||||||
node_index = state.node_index;
|
|
||||||
if ((changed.createElement) && text_value !== (text_value = node)) {
|
|
||||||
text.data = text_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(span);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,276 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroyEach(iterations) {
|
|
||||||
for (var i = 0; i < iterations.length; i += 1) {
|
|
||||||
if (iterations[i]) iterations[i].d();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var each_anchor;
|
|
||||||
|
|
||||||
var each_value = state.createElement;
|
|
||||||
|
|
||||||
var each_blocks = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
node: each_value[i],
|
|
||||||
node_index: i
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
each_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(target, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertNode(each_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
var each_value = state.createElement;
|
|
||||||
|
|
||||||
if (changed.createElement) {
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
var each_context = assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
node: each_value[i],
|
|
||||||
node_index: i
|
|
||||||
});
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(changed, each_context);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(component, each_context);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(each_anchor.parentNode, each_anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
each_blocks[i].d();
|
|
||||||
}
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
}
|
|
||||||
|
|
||||||
detachNode(each_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
destroyEach(each_blocks);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#each createElement as node}
|
|
||||||
function create_each_block(component, state) {
|
|
||||||
var node = state.node, each_value = state.each_value, node_index = state.node_index;
|
|
||||||
var span, text_value = node, text;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
span = createElement("span");
|
|
||||||
text = createText(text_value);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(span, target, anchor);
|
|
||||||
appendNode(text, span);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
node = state.node;
|
|
||||||
each_value = state.each_value;
|
|
||||||
node_index = state.node_index;
|
|
||||||
if ((changed.createElement) && text_value !== (text_value = node)) {
|
|
||||||
text.data = text_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(span);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createComment, createElement, createText, destroyEach, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var each_anchor;
|
|
||||||
|
|
||||||
var each_value = state.createElement;
|
|
||||||
|
|
||||||
var each_blocks = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
node: each_value[i],
|
|
||||||
node_index: i
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
each_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(target, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertNode(each_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
var each_value = state.createElement;
|
|
||||||
|
|
||||||
if (changed.createElement) {
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
var each_context = assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
node: each_value[i],
|
|
||||||
node_index: i
|
|
||||||
});
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(changed, each_context);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(component, each_context);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(each_anchor.parentNode, each_anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
each_blocks[i].d();
|
|
||||||
}
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
}
|
|
||||||
|
|
||||||
detachNode(each_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy() {
|
|
||||||
destroyEach(each_blocks);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#each createElement as node}
|
|
||||||
function create_each_block(component, state) {
|
|
||||||
var node = state.node, each_value = state.each_value, node_index = state.node_index;
|
|
||||||
var span, text_value = node, text;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
span = createElement("span");
|
|
||||||
text = createText(text_value);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(span, target, anchor);
|
|
||||||
appendNode(text, span);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
node = state.node;
|
|
||||||
each_value = state.each_value;
|
|
||||||
node_index = state.node_index;
|
|
||||||
if ((changed.createElement) && text_value !== (text_value = node)) {
|
|
||||||
text.data = text_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(span);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{#each createElement as node}
|
|
||||||
<span>{node}</span>
|
|
||||||
{/each}
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
{{#each createElement as node}}
|
{#each createElement as node}
|
||||||
<span>{{node}}</span>
|
<span>{node}</span>
|
||||||
{{/each}}
|
{/each}
|
||||||
@ -1,232 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroyDev(detach) {
|
|
||||||
destroy.call(this, detach);
|
|
||||||
this.destroy = function() {
|
|
||||||
console.warn('Component was already destroyed');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDev(newState) {
|
|
||||||
if (typeof newState !== 'object') {
|
|
||||||
throw new Error(
|
|
||||||
this._debugName + '.set was called without an object of data key-values to update.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
this._checkReadOnly(newState);
|
|
||||||
set.call(this, newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var protoDev = {
|
|
||||||
destroy: destroyDev,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set: setDev,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function bar({ foo }) {
|
|
||||||
return foo * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var p, text_value = state.Math.max(0, state.foo), text, text_1, text_2;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText(text_value);
|
|
||||||
text_1 = createText("\n\t");
|
|
||||||
text_2 = createText(state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
appendNode(text_2, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if ((changed.Math || changed.foo) && text_value !== (text_value = state.Math.max(0, state.foo))) {
|
|
||||||
text.data = text_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.bar) {
|
|
||||||
text_2.data = state.bar;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
this._debugName = '<SvelteComponent>';
|
|
||||||
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({ Math : Math }, options.data);
|
|
||||||
this._recompute({ foo: 1 }, this._state);
|
|
||||||
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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'");
|
|
||||||
};
|
|
||||||
|
|
||||||
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
|
|
||||||
if (changed.foo) {
|
|
||||||
if (this._differs(state.bar, (state.bar = bar(state)))) changed.bar = true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,232 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroyDev(detach) {
|
|
||||||
destroy.call(this, detach);
|
|
||||||
this.destroy = function() {
|
|
||||||
console.warn('Component was already destroyed');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDev(newState) {
|
|
||||||
if (typeof newState !== 'object') {
|
|
||||||
throw new Error(
|
|
||||||
this._debugName + '.set was called without an object of data key-values to update.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
this._checkReadOnly(newState);
|
|
||||||
set.call(this, newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var protoDev = {
|
|
||||||
destroy: destroyDev,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set: setDev,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function bar({ foo }) {
|
|
||||||
return foo * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var p, text_value = state.Math.max(0, state.foo), text, text_1, text_2;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText(text_value);
|
|
||||||
text_1 = createText("\n\t");
|
|
||||||
text_2 = createText(state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
appendNode(text_2, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if ((changed.Math || changed.foo) && text_value !== (text_value = state.Math.max(0, state.foo))) {
|
|
||||||
text.data = text_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.bar) {
|
|
||||||
text_2.data = state.bar;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
this._debugName = '<SvelteComponent>';
|
|
||||||
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({ Math : Math }, options.data);
|
|
||||||
this._recompute({ foo: 1 }, this._state);
|
|
||||||
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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'");
|
|
||||||
};
|
|
||||||
|
|
||||||
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
|
|
||||||
if (changed.foo) {
|
|
||||||
if (this._differs(state.bar, (state.bar = bar(state)))) changed.bar = true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, protoDev } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function bar({ foo }) {
|
|
||||||
return foo * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var p, text_value = state.Math.max(0, state.foo), text, text_1, text_2;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText(text_value);
|
|
||||||
text_1 = createText("\n\t");
|
|
||||||
text_2 = createText(state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
appendNode(text_2, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if ((changed.Math || changed.foo) && text_value !== (text_value = state.Math.max(0, state.foo))) {
|
|
||||||
text.data = text_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.bar) {
|
|
||||||
text_2.data = state.bar;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
this._debugName = '<SvelteComponent>';
|
|
||||||
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({ Math : Math }, options.data);
|
|
||||||
this._recompute({ foo: 1 }, this._state);
|
|
||||||
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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'");
|
|
||||||
};
|
|
||||||
|
|
||||||
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
|
|
||||||
if (changed.foo) {
|
|
||||||
if (this._differs(state.bar, (state.bar = bar(state)))) changed.bar = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<p>
|
|
||||||
{Math.max(0, foo)}
|
|
||||||
{bar}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
computed: {
|
|
||||||
bar: ({ foo }) => foo * 2
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@ -1,12 +1,12 @@
|
|||||||
<p>
|
<p>
|
||||||
{{Math.max(0, foo)}}
|
{Math.max(0, foo)}
|
||||||
{{bar}}
|
{bar}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
bar: foo => foo * 2
|
bar: ({ foo }) => foo * 2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -1,193 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
div.dataset.foo = "bar";
|
|
||||||
div_1.dataset.foo = state.bar;
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
div_1.dataset.foo = state.bar;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,193 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
div.dataset.foo = "bar";
|
|
||||||
div_1.dataset.foo = state.bar;
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
div_1.dataset.foo = state.bar;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
div.dataset.foo = "bar";
|
|
||||||
div_1.dataset.foo = state.bar;
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
div_1.dataset.foo = state.bar;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<div data-foo='bar'/>
|
|
||||||
<div data-foo='{bar}'/>
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
<div data-foo='bar'/>
|
<div data-foo='bar'/>
|
||||||
<div data-foo='{{bar}}'/>
|
<div data-foo='{bar}'/>
|
||||||
|
|||||||
@ -1,197 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAttribute(node, attribute, value) {
|
|
||||||
node.setAttribute(attribute, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setAttribute(div, "data-foo", "bar");
|
|
||||||
setAttribute(div_1, "data-foo", state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
setAttribute(div_1, "data-foo", state.bar);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,197 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAttribute(node, attribute, value) {
|
|
||||||
node.setAttribute(attribute, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setAttribute(div, "data-foo", "bar");
|
|
||||||
setAttribute(div_1, "data-foo", state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
setAttribute(div_1, "data-foo", state.bar);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setAttribute(div, "data-foo", "bar");
|
|
||||||
setAttribute(div_1, "data-foo", state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
setAttribute(div_1, "data-foo", state.bar);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<div data-foo='bar'/>
|
|
||||||
<div data-foo='{bar}'/>
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
<div data-foo='bar'/>
|
<div data-foo='bar'/>
|
||||||
<div data-foo='{{bar}}'/>
|
<div data-foo='{bar}'/>
|
||||||
|
|||||||
@ -1,195 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSvgElement(name) {
|
|
||||||
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAttribute(node, attribute, value) {
|
|
||||||
node.setAttribute(attribute, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var svg, g, g_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
svg = createSvgElement("svg");
|
|
||||||
g = createSvgElement("g");
|
|
||||||
g_1 = createSvgElement("g");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setAttribute(g, "data-foo", "bar");
|
|
||||||
setAttribute(g_1, "data-foo", state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(svg, target, anchor);
|
|
||||||
appendNode(g, svg);
|
|
||||||
appendNode(g_1, svg);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
setAttribute(g_1, "data-foo", state.bar);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(svg);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,195 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSvgElement(name) {
|
|
||||||
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAttribute(node, attribute, value) {
|
|
||||||
node.setAttribute(attribute, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var svg, g, g_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
svg = createSvgElement("svg");
|
|
||||||
g = createSvgElement("g");
|
|
||||||
g_1 = createSvgElement("g");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setAttribute(g, "data-foo", "bar");
|
|
||||||
setAttribute(g_1, "data-foo", state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(svg, target, anchor);
|
|
||||||
appendNode(g, svg);
|
|
||||||
appendNode(g_1, svg);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
setAttribute(g_1, "data-foo", state.bar);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(svg);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createSvgElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var svg, g, g_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
svg = createSvgElement("svg");
|
|
||||||
g = createSvgElement("g");
|
|
||||||
g_1 = createSvgElement("g");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setAttribute(g, "data-foo", "bar");
|
|
||||||
setAttribute(g_1, "data-foo", state.bar);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(svg, target, anchor);
|
|
||||||
appendNode(g, svg);
|
|
||||||
appendNode(g_1, svg);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.bar) {
|
|
||||||
setAttribute(g_1, "data-foo", state.bar);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(svg);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
|
Before Width: | Height: | Size: 57 B |
|
Before Width: | Height: | Size: 59 B After Width: | Height: | Size: 57 B |
@ -1,323 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachAfter(before) {
|
|
||||||
while (before.nextSibling) {
|
|
||||||
before.parentNode.removeChild(before.nextSibling);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroyEach(iterations) {
|
|
||||||
for (var i = 0; i < iterations.length; i += 1) {
|
|
||||||
if (iterations[i]) iterations[i].d();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var text, p, text_1;
|
|
||||||
|
|
||||||
var each_value = state.comments;
|
|
||||||
|
|
||||||
var each_blocks = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
comment: each_value[i],
|
|
||||||
i: i
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
text = createText("\n\n");
|
|
||||||
p = createElement("p");
|
|
||||||
text_1 = createText(state.foo);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(target, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
var each_value = state.comments;
|
|
||||||
|
|
||||||
if (changed.comments || changed.elapsed || changed.time) {
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
var each_context = assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
comment: each_value[i],
|
|
||||||
i: i
|
|
||||||
});
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(changed, each_context);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(component, each_context);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(text.parentNode, text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
each_blocks[i].d();
|
|
||||||
}
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.foo) {
|
|
||||||
text_1.data = state.foo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
}
|
|
||||||
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
destroyEach(each_blocks);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#each comments as comment, i}
|
|
||||||
function create_each_block(component, state) {
|
|
||||||
var comment = state.comment, each_value = state.each_value, i = state.i;
|
|
||||||
var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
strong = createElement("strong");
|
|
||||||
text = createText(i);
|
|
||||||
text_1 = createText("\n\n\t\t");
|
|
||||||
span = createElement("span");
|
|
||||||
text_2 = createText(text_2_value);
|
|
||||||
text_3 = createText(" wrote ");
|
|
||||||
text_4 = createText(text_4_value);
|
|
||||||
text_5 = createText(" ago:");
|
|
||||||
text_6 = createText("\n\n\t\t");
|
|
||||||
raw_before = createElement('noscript');
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
span.className = "meta";
|
|
||||||
div.className = "comment";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
appendNode(strong, div);
|
|
||||||
appendNode(text, strong);
|
|
||||||
appendNode(text_1, div);
|
|
||||||
appendNode(span, div);
|
|
||||||
appendNode(text_2, span);
|
|
||||||
appendNode(text_3, span);
|
|
||||||
appendNode(text_4, span);
|
|
||||||
appendNode(text_5, span);
|
|
||||||
appendNode(text_6, div);
|
|
||||||
appendNode(raw_before, div);
|
|
||||||
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
comment = state.comment;
|
|
||||||
each_value = state.each_value;
|
|
||||||
i = state.i;
|
|
||||||
if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
|
|
||||||
text_2.data = text_2_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(comment.time, state.time))) {
|
|
||||||
text_4.data = text_4_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
|
|
||||||
detachAfter(raw_before);
|
|
||||||
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachAfter(raw_before);
|
|
||||||
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,323 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachAfter(before) {
|
|
||||||
while (before.nextSibling) {
|
|
||||||
before.parentNode.removeChild(before.nextSibling);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroyEach(iterations) {
|
|
||||||
for (var i = 0; i < iterations.length; i += 1) {
|
|
||||||
if (iterations[i]) iterations[i].d();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var text, p, text_1;
|
|
||||||
|
|
||||||
var each_value = state.comments;
|
|
||||||
|
|
||||||
var each_blocks = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
comment: each_value[i],
|
|
||||||
i: i
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
text = createText("\n\n");
|
|
||||||
p = createElement("p");
|
|
||||||
text_1 = createText(state.foo);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(target, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
var each_value = state.comments;
|
|
||||||
|
|
||||||
if (changed.comments || changed.elapsed || changed.time) {
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
var each_context = assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
comment: each_value[i],
|
|
||||||
i: i
|
|
||||||
});
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(changed, each_context);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(component, each_context);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(text.parentNode, text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
each_blocks[i].d();
|
|
||||||
}
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.foo) {
|
|
||||||
text_1.data = state.foo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
}
|
|
||||||
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
destroyEach(each_blocks);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#each comments as comment, i}
|
|
||||||
function create_each_block(component, state) {
|
|
||||||
var comment = state.comment, each_value = state.each_value, i = state.i;
|
|
||||||
var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
strong = createElement("strong");
|
|
||||||
text = createText(i);
|
|
||||||
text_1 = createText("\n\n\t\t");
|
|
||||||
span = createElement("span");
|
|
||||||
text_2 = createText(text_2_value);
|
|
||||||
text_3 = createText(" wrote ");
|
|
||||||
text_4 = createText(text_4_value);
|
|
||||||
text_5 = createText(" ago:");
|
|
||||||
text_6 = createText("\n\n\t\t");
|
|
||||||
raw_before = createElement('noscript');
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
span.className = "meta";
|
|
||||||
div.className = "comment";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
appendNode(strong, div);
|
|
||||||
appendNode(text, strong);
|
|
||||||
appendNode(text_1, div);
|
|
||||||
appendNode(span, div);
|
|
||||||
appendNode(text_2, span);
|
|
||||||
appendNode(text_3, span);
|
|
||||||
appendNode(text_4, span);
|
|
||||||
appendNode(text_5, span);
|
|
||||||
appendNode(text_6, div);
|
|
||||||
appendNode(raw_before, div);
|
|
||||||
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
comment = state.comment;
|
|
||||||
each_value = state.each_value;
|
|
||||||
i = state.i;
|
|
||||||
if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
|
|
||||||
text_2.data = text_2_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(comment.time, state.time))) {
|
|
||||||
text_4.data = text_4_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
|
|
||||||
detachAfter(raw_before);
|
|
||||||
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachAfter(raw_before);
|
|
||||||
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,169 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var text, p, text_1;
|
|
||||||
|
|
||||||
var each_value = state.comments;
|
|
||||||
|
|
||||||
var each_blocks = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
comment: each_value[i],
|
|
||||||
i: i
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
text = createText("\n\n");
|
|
||||||
p = createElement("p");
|
|
||||||
text_1 = createText(state.foo);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(target, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
var each_value = state.comments;
|
|
||||||
|
|
||||||
if (changed.comments || changed.elapsed || changed.time) {
|
|
||||||
for (var i = 0; i < each_value.length; i += 1) {
|
|
||||||
var each_context = assign(assign({}, state), {
|
|
||||||
each_value: each_value,
|
|
||||||
comment: each_value[i],
|
|
||||||
i: i
|
|
||||||
});
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(changed, each_context);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(component, each_context);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(text.parentNode, text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
each_blocks[i].d();
|
|
||||||
}
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.foo) {
|
|
||||||
text_1.data = state.foo;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].u();
|
|
||||||
}
|
|
||||||
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy() {
|
|
||||||
destroyEach(each_blocks);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#each comments as comment, i}
|
|
||||||
function create_each_block(component, state) {
|
|
||||||
var comment = state.comment, each_value = state.each_value, i = state.i;
|
|
||||||
var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
strong = createElement("strong");
|
|
||||||
text = createText(i);
|
|
||||||
text_1 = createText("\n\n\t\t");
|
|
||||||
span = createElement("span");
|
|
||||||
text_2 = createText(text_2_value);
|
|
||||||
text_3 = createText(" wrote ");
|
|
||||||
text_4 = createText(text_4_value);
|
|
||||||
text_5 = createText(" ago:");
|
|
||||||
text_6 = createText("\n\n\t\t");
|
|
||||||
raw_before = createElement('noscript');
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
span.className = "meta";
|
|
||||||
div.className = "comment";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
appendNode(strong, div);
|
|
||||||
appendNode(text, strong);
|
|
||||||
appendNode(text_1, div);
|
|
||||||
appendNode(span, div);
|
|
||||||
appendNode(text_2, span);
|
|
||||||
appendNode(text_3, span);
|
|
||||||
appendNode(text_4, span);
|
|
||||||
appendNode(text_5, span);
|
|
||||||
appendNode(text_6, div);
|
|
||||||
appendNode(raw_before, div);
|
|
||||||
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
comment = state.comment;
|
|
||||||
each_value = state.each_value;
|
|
||||||
i = state.i;
|
|
||||||
if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
|
|
||||||
text_2.data = text_2_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(comment.time, state.time))) {
|
|
||||||
text_4.data = text_4_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
|
|
||||||
detachAfter(raw_before);
|
|
||||||
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachAfter(raw_before);
|
|
||||||
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
{#each comments as comment, i}
|
|
||||||
<div class='comment'>
|
|
||||||
<strong>{i}</strong>
|
|
||||||
|
|
||||||
<span class='meta'>
|
|
||||||
{comment.author} wrote {elapsed(comment.time, time)} ago:
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{@html comment.html}
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
|
|
||||||
<p>{foo}</p>
|
|
||||||
@ -1,13 +1,13 @@
|
|||||||
{{#each comments as comment, i}}
|
{#each comments as comment, i}
|
||||||
<div class='comment'>
|
<div class='comment'>
|
||||||
<strong>{{i}}</strong>
|
<strong>{i}</strong>
|
||||||
|
|
||||||
<span class='meta'>
|
<span class='meta'>
|
||||||
{{comment.author}} wrote {{elapsed(comment.time, time)}} ago:
|
{comment.author} wrote {elapsed(comment.time, time)} ago:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{{{comment.html}}}
|
{@html comment.html}
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{/each}
|
||||||
|
|
||||||
<p>{{foo}}</p>
|
<p>{foo}</p>
|
||||||
@ -1,184 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var meta, meta_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
meta = createElement("meta");
|
|
||||||
meta_1 = createElement("meta");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
meta.name = "twitter:creator";
|
|
||||||
meta.content = "@sveltejs";
|
|
||||||
meta_1.name = "twitter:title";
|
|
||||||
meta_1.content = "Svelte";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
appendNode(meta, document.head);
|
|
||||||
appendNode(meta_1, document.head);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: noop,
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(meta);
|
|
||||||
detachNode(meta_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,184 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var meta, meta_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
meta = createElement("meta");
|
|
||||||
meta_1 = createElement("meta");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
meta.name = "twitter:creator";
|
|
||||||
meta.content = "@sveltejs";
|
|
||||||
meta_1.name = "twitter:title";
|
|
||||||
meta_1.content = "Svelte";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
appendNode(meta, document.head);
|
|
||||||
appendNode(meta_1, document.head);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: noop,
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(meta);
|
|
||||||
detachNode(meta_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var meta, meta_1;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
meta = createElement("meta");
|
|
||||||
meta_1 = createElement("meta");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
meta.name = "twitter:creator";
|
|
||||||
meta.content = "@sveltejs";
|
|
||||||
meta_1.name = "twitter:title";
|
|
||||||
meta_1.content = "Svelte";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
appendNode(meta, document.head);
|
|
||||||
appendNode(meta_1, document.head);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: noop,
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(meta);
|
|
||||||
detachNode(meta_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
<svelte:head>
|
|
||||||
<meta name='twitter:creator' content='@sveltejs'>
|
|
||||||
<meta name='twitter:title' content='Svelte'>
|
|
||||||
</svelte:head>
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<meta name='twitter:creator' content='@sveltejs'>
|
<meta name='twitter:creator' content='@sveltejs'>
|
||||||
<meta name='twitter:title' content='Svelte'>
|
<meta name='twitter:title' content='Svelte'>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
@ -1,242 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var if_block_anchor;
|
|
||||||
|
|
||||||
function select_block_type(state) {
|
|
||||||
if (state.foo) return create_if_block;
|
|
||||||
return create_if_block_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var current_block_type = select_block_type(state);
|
|
||||||
var if_block = current_block_type(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
if_block.c();
|
|
||||||
if_block_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if_block.m(target, anchor);
|
|
||||||
insertNode(if_block_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (current_block_type !== (current_block_type = select_block_type(state))) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = current_block_type(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
if_block.u();
|
|
||||||
detachNode(if_block_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
if_block.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#if foo}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (3:0) {:else}
|
|
||||||
function create_if_block_1(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "not foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,242 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var if_block_anchor;
|
|
||||||
|
|
||||||
function select_block_type(state) {
|
|
||||||
if (state.foo) return create_if_block;
|
|
||||||
return create_if_block_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var current_block_type = select_block_type(state);
|
|
||||||
var if_block = current_block_type(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
if_block.c();
|
|
||||||
if_block_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if_block.m(target, anchor);
|
|
||||||
insertNode(if_block_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (current_block_type !== (current_block_type = select_block_type(state))) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = current_block_type(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
if_block.u();
|
|
||||||
detachNode(if_block_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
if_block.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#if foo}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (3:0) {:else}
|
|
||||||
function create_if_block_1(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "not foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,104 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var if_block_anchor;
|
|
||||||
|
|
||||||
function select_block_type(state) {
|
|
||||||
if (state.foo) return create_if_block;
|
|
||||||
return create_if_block_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var current_block_type = select_block_type(state);
|
|
||||||
var if_block = current_block_type(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
if_block.c();
|
|
||||||
if_block_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if_block.m(target, anchor);
|
|
||||||
insertNode(if_block_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (current_block_type !== (current_block_type = select_block_type(state))) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = current_block_type(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
if_block.u();
|
|
||||||
detachNode(if_block_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy() {
|
|
||||||
if_block.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#if foo}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (3:0) {:else}
|
|
||||||
function create_if_block_1(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "not foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
{#if foo}
|
|
||||||
<p>foo!</p>
|
|
||||||
{:else}
|
|
||||||
<p>not foo!</p>
|
|
||||||
{/if}
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
{{#if foo}}
|
{#if foo}
|
||||||
<p>foo!</p>
|
<p>foo!</p>
|
||||||
{{else}}
|
{:else}
|
||||||
<p>not foo!</p>
|
<p>not foo!</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
@ -1,218 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var if_block_anchor;
|
|
||||||
|
|
||||||
var if_block = (state.foo) && create_if_block(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
if_block_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if (if_block) if_block.m(target, anchor);
|
|
||||||
insertNode(if_block_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (state.foo) {
|
|
||||||
if (!if_block) {
|
|
||||||
if_block = create_if_block(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
if (if_block) if_block.u();
|
|
||||||
detachNode(if_block_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
if (if_block) if_block.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#if foo}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,218 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var if_block_anchor;
|
|
||||||
|
|
||||||
var if_block = (state.foo) && create_if_block(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
if_block_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if (if_block) if_block.m(target, anchor);
|
|
||||||
insertNode(if_block_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (state.foo) {
|
|
||||||
if (!if_block) {
|
|
||||||
if_block = create_if_block(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
if (if_block) if_block.u();
|
|
||||||
detachNode(if_block_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
if (if_block) if_block.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#if foo}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var if_block_anchor;
|
|
||||||
|
|
||||||
var if_block = (state.foo) && create_if_block(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
if_block_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if (if_block) if_block.m(target, anchor);
|
|
||||||
insertNode(if_block_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (state.foo) {
|
|
||||||
if (!if_block) {
|
|
||||||
if_block = create_if_block(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
if (if_block) if_block.u();
|
|
||||||
detachNode(if_block_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy() {
|
|
||||||
if (if_block) if_block.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (1:0) {#if foo}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "foo!";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{#if foo}
|
|
||||||
<p>foo!</p>
|
|
||||||
{/if}
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
{{#if foo}}
|
{#if foo}
|
||||||
<p>foo!</p>
|
<p>foo!</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
@ -1,191 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStyle(node, key, value) {
|
|
||||||
node.style.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.color) {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.x || changed.y) {
|
|
||||||
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,191 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStyle(node, key, value) {
|
|
||||||
node.style.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.color) {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.x || changed.y) {
|
|
||||||
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.color) {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed.x || changed.y) {
|
|
||||||
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<div style='color: {color}; transform: translate({x}px,{y}px);'></div>
|
|
||||||
@ -1 +1 @@
|
|||||||
<div style='color: {{color}}; transform: translate({{x}}px,{{y}}px);'></div>
|
<div style='color: {color}; transform: translate({x}px,{y}px);'></div>
|
||||||
@ -1,186 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStyle(node, key, value) {
|
|
||||||
node.style.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.data) {
|
|
||||||
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,186 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStyle(node, key, value) {
|
|
||||||
node.style.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.data) {
|
|
||||||
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.data) {
|
|
||||||
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<div style='background: url(data:image/png;base64,{data})'></div>
|
|
||||||
@ -1 +1 @@
|
|||||||
<div style='background: url(data:image/png;base64,{{data}})'></div>
|
<div style='background: url(data:image/png;base64,{data})'></div>
|
||||||
@ -1,186 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStyle(node, key, value) {
|
|
||||||
node.style.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.color) {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,186 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStyle(node, key, value) {
|
|
||||||
node.style.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.color) {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.color) {
|
|
||||||
setStyle(div, "color", state.color);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<div style='color: {color}'></div>
|
|
||||||
@ -1 +1 @@
|
|||||||
<div style='color: {{color}}'></div>
|
<div style='color: {color}'></div>
|
||||||
@ -1,197 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1, div_1_style_value;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
div.style.cssText = state.style;
|
|
||||||
div_1.style.cssText = div_1_style_value = "" + state.key + ": " + state.value;
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.style) {
|
|
||||||
div.style.cssText = state.style;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.key || changed.value) && div_1_style_value !== (div_1_style_value = "" + state.key + ": " + state.value)) {
|
|
||||||
div_1.style.cssText = div_1_style_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,197 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1, div_1_style_value;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
div.style.cssText = state.style;
|
|
||||||
div_1.style.cssText = div_1_style_value = "" + state.key + ": " + state.value;
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.style) {
|
|
||||||
div.style.cssText = state.style;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.key || changed.value) && div_1_style_value !== (div_1_style_value = "" + state.key + ": " + state.value)) {
|
|
||||||
div_1.style.cssText = div_1_style_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, div_1, div_1_style_value;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
text = createText("\n");
|
|
||||||
div_1 = createElement("div");
|
|
||||||
this.h();
|
|
||||||
},
|
|
||||||
|
|
||||||
h: function hydrate() {
|
|
||||||
div.style.cssText = state.style;
|
|
||||||
div_1.style.cssText = div_1_style_value = "" + state.key + ": " + state.value;
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
insertNode(text, target, anchor);
|
|
||||||
insertNode(div_1, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.style) {
|
|
||||||
div.style.cssText = state.style;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((changed.key || changed.value) && div_1_style_value !== (div_1_style_value = "" + state.key + ": " + state.value)) {
|
|
||||||
div_1.style.cssText = div_1_style_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
detachNode(text);
|
|
||||||
detachNode(div_1);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<div style='{style}'></div>
|
|
||||||
<div style='{key}: {value}'></div>
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
<div style='{{style}}'></div>
|
<div style='{style}'></div>
|
||||||
<div style='{{key}}: {{value}}'></div>
|
<div style='{key}: {value}'></div>
|
||||||
@ -1,161 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var title_value;
|
|
||||||
|
|
||||||
document.title = title_value = "a " + state.custom + " title";
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: noop,
|
|
||||||
|
|
||||||
m: noop,
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if ((changed.custom) && title_value !== (title_value = "a " + state.custom + " title")) {
|
|
||||||
document.title = title_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: noop,
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,161 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var title_value;
|
|
||||||
|
|
||||||
document.title = title_value = "a " + state.custom + " title";
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: noop,
|
|
||||||
|
|
||||||
m: noop,
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if ((changed.custom) && title_value !== (title_value = "a " + state.custom + " title")) {
|
|
||||||
document.title = title_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: noop,
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { assign, init, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var title_value;
|
|
||||||
|
|
||||||
document.title = title_value = "a " + state.custom + " title";
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: noop,
|
|
||||||
|
|
||||||
m: noop,
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if ((changed.custom) && title_value !== (title_value = "a " + state.custom + " title")) {
|
|
||||||
document.title = title_value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: noop,
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<svelte:head>
|
|
||||||
<title>a {custom} title</title>
|
|
||||||
</svelte:head>
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>a {{custom}} title</title>
|
<title>a {custom} title</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
@ -1,408 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
|
|
||||||
|
|
||||||
var if_block = (state.a) && create_if_block(component, state);
|
|
||||||
|
|
||||||
var if_block_1 = (state.b) && create_if_block_1(component, state);
|
|
||||||
|
|
||||||
var if_block_2 = (state.c) && create_if_block_2(component, state);
|
|
||||||
|
|
||||||
var if_block_3 = (state.d) && create_if_block_3(component, state);
|
|
||||||
|
|
||||||
var if_block_4 = (state.e) && create_if_block_4(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
text = createText("\n\n\t");
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "this can be used as an anchor";
|
|
||||||
text_2 = createText("\n\n\t");
|
|
||||||
if (if_block_1) if_block_1.c();
|
|
||||||
text_3 = createText("\n\n\t");
|
|
||||||
if (if_block_2) if_block_2.c();
|
|
||||||
text_4 = createText("\n\n\t");
|
|
||||||
p_1 = createElement("p");
|
|
||||||
p_1.textContent = "so can this";
|
|
||||||
text_6 = createText("\n\n\t");
|
|
||||||
if (if_block_3) if_block_3.c();
|
|
||||||
text_8 = createText("\n\n");
|
|
||||||
if (if_block_4) if_block_4.c();
|
|
||||||
if_block_4_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
if (if_block) if_block.m(div, null);
|
|
||||||
appendNode(text, div);
|
|
||||||
appendNode(p, div);
|
|
||||||
appendNode(text_2, div);
|
|
||||||
if (if_block_1) if_block_1.m(div, null);
|
|
||||||
appendNode(text_3, div);
|
|
||||||
if (if_block_2) if_block_2.m(div, null);
|
|
||||||
appendNode(text_4, div);
|
|
||||||
appendNode(p_1, div);
|
|
||||||
appendNode(text_6, div);
|
|
||||||
if (if_block_3) if_block_3.m(div, null);
|
|
||||||
insertNode(text_8, target, anchor);
|
|
||||||
if (if_block_4) if_block_4.m(target, anchor);
|
|
||||||
insertNode(if_block_4_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (state.a) {
|
|
||||||
if (!if_block) {
|
|
||||||
if_block = create_if_block(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(div, text);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.b) {
|
|
||||||
if (!if_block_1) {
|
|
||||||
if_block_1 = create_if_block_1(component, state);
|
|
||||||
if_block_1.c();
|
|
||||||
if_block_1.m(div, text_3);
|
|
||||||
}
|
|
||||||
} else if (if_block_1) {
|
|
||||||
if_block_1.u();
|
|
||||||
if_block_1.d();
|
|
||||||
if_block_1 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.c) {
|
|
||||||
if (!if_block_2) {
|
|
||||||
if_block_2 = create_if_block_2(component, state);
|
|
||||||
if_block_2.c();
|
|
||||||
if_block_2.m(div, text_4);
|
|
||||||
}
|
|
||||||
} else if (if_block_2) {
|
|
||||||
if_block_2.u();
|
|
||||||
if_block_2.d();
|
|
||||||
if_block_2 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.d) {
|
|
||||||
if (!if_block_3) {
|
|
||||||
if_block_3 = create_if_block_3(component, state);
|
|
||||||
if_block_3.c();
|
|
||||||
if_block_3.m(div, null);
|
|
||||||
}
|
|
||||||
} else if (if_block_3) {
|
|
||||||
if_block_3.u();
|
|
||||||
if_block_3.d();
|
|
||||||
if_block_3 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.e) {
|
|
||||||
if (!if_block_4) {
|
|
||||||
if_block_4 = create_if_block_4(component, state);
|
|
||||||
if_block_4.c();
|
|
||||||
if_block_4.m(if_block_4_anchor.parentNode, if_block_4_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block_4) {
|
|
||||||
if_block_4.u();
|
|
||||||
if_block_4.d();
|
|
||||||
if_block_4 = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
if (if_block) if_block.u();
|
|
||||||
if (if_block_1) if_block_1.u();
|
|
||||||
if (if_block_2) if_block_2.u();
|
|
||||||
if (if_block_3) if_block_3.u();
|
|
||||||
detachNode(text_8);
|
|
||||||
if (if_block_4) if_block_4.u();
|
|
||||||
detachNode(if_block_4_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
if (if_block) if_block.d();
|
|
||||||
if (if_block_1) if_block_1.d();
|
|
||||||
if (if_block_2) if_block_2.d();
|
|
||||||
if (if_block_3) if_block_3.d();
|
|
||||||
if (if_block_4) if_block_4.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (2:1) {#if a}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "a";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (8:1) {#if b}
|
|
||||||
function create_if_block_1(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "b";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (12:1) {#if c}
|
|
||||||
function create_if_block_2(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "c";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (18:1) {#if d}
|
|
||||||
function create_if_block_3(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "d";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (25:0) {#if e}
|
|
||||||
function create_if_block_4(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "e";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,408 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createComment() {
|
|
||||||
return document.createComment('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
|
|
||||||
|
|
||||||
var if_block = (state.a) && create_if_block(component, state);
|
|
||||||
|
|
||||||
var if_block_1 = (state.b) && create_if_block_1(component, state);
|
|
||||||
|
|
||||||
var if_block_2 = (state.c) && create_if_block_2(component, state);
|
|
||||||
|
|
||||||
var if_block_3 = (state.d) && create_if_block_3(component, state);
|
|
||||||
|
|
||||||
var if_block_4 = (state.e) && create_if_block_4(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
text = createText("\n\n\t");
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "this can be used as an anchor";
|
|
||||||
text_2 = createText("\n\n\t");
|
|
||||||
if (if_block_1) if_block_1.c();
|
|
||||||
text_3 = createText("\n\n\t");
|
|
||||||
if (if_block_2) if_block_2.c();
|
|
||||||
text_4 = createText("\n\n\t");
|
|
||||||
p_1 = createElement("p");
|
|
||||||
p_1.textContent = "so can this";
|
|
||||||
text_6 = createText("\n\n\t");
|
|
||||||
if (if_block_3) if_block_3.c();
|
|
||||||
text_8 = createText("\n\n");
|
|
||||||
if (if_block_4) if_block_4.c();
|
|
||||||
if_block_4_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
if (if_block) if_block.m(div, null);
|
|
||||||
appendNode(text, div);
|
|
||||||
appendNode(p, div);
|
|
||||||
appendNode(text_2, div);
|
|
||||||
if (if_block_1) if_block_1.m(div, null);
|
|
||||||
appendNode(text_3, div);
|
|
||||||
if (if_block_2) if_block_2.m(div, null);
|
|
||||||
appendNode(text_4, div);
|
|
||||||
appendNode(p_1, div);
|
|
||||||
appendNode(text_6, div);
|
|
||||||
if (if_block_3) if_block_3.m(div, null);
|
|
||||||
insertNode(text_8, target, anchor);
|
|
||||||
if (if_block_4) if_block_4.m(target, anchor);
|
|
||||||
insertNode(if_block_4_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (state.a) {
|
|
||||||
if (!if_block) {
|
|
||||||
if_block = create_if_block(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(div, text);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.b) {
|
|
||||||
if (!if_block_1) {
|
|
||||||
if_block_1 = create_if_block_1(component, state);
|
|
||||||
if_block_1.c();
|
|
||||||
if_block_1.m(div, text_3);
|
|
||||||
}
|
|
||||||
} else if (if_block_1) {
|
|
||||||
if_block_1.u();
|
|
||||||
if_block_1.d();
|
|
||||||
if_block_1 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.c) {
|
|
||||||
if (!if_block_2) {
|
|
||||||
if_block_2 = create_if_block_2(component, state);
|
|
||||||
if_block_2.c();
|
|
||||||
if_block_2.m(div, text_4);
|
|
||||||
}
|
|
||||||
} else if (if_block_2) {
|
|
||||||
if_block_2.u();
|
|
||||||
if_block_2.d();
|
|
||||||
if_block_2 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.d) {
|
|
||||||
if (!if_block_3) {
|
|
||||||
if_block_3 = create_if_block_3(component, state);
|
|
||||||
if_block_3.c();
|
|
||||||
if_block_3.m(div, null);
|
|
||||||
}
|
|
||||||
} else if (if_block_3) {
|
|
||||||
if_block_3.u();
|
|
||||||
if_block_3.d();
|
|
||||||
if_block_3 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.e) {
|
|
||||||
if (!if_block_4) {
|
|
||||||
if_block_4 = create_if_block_4(component, state);
|
|
||||||
if_block_4.c();
|
|
||||||
if_block_4.m(if_block_4_anchor.parentNode, if_block_4_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block_4) {
|
|
||||||
if_block_4.u();
|
|
||||||
if_block_4.d();
|
|
||||||
if_block_4 = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
if (if_block) if_block.u();
|
|
||||||
if (if_block_1) if_block_1.u();
|
|
||||||
if (if_block_2) if_block_2.u();
|
|
||||||
if (if_block_3) if_block_3.u();
|
|
||||||
detachNode(text_8);
|
|
||||||
if (if_block_4) if_block_4.u();
|
|
||||||
detachNode(if_block_4_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
if (if_block) if_block.d();
|
|
||||||
if (if_block_1) if_block_1.d();
|
|
||||||
if (if_block_2) if_block_2.d();
|
|
||||||
if (if_block_3) if_block_3.d();
|
|
||||||
if (if_block_4) if_block_4.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (2:1) {#if a}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "a";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (8:1) {#if b}
|
|
||||||
function create_if_block_1(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "b";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (12:1) {#if c}
|
|
||||||
function create_if_block_2(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "c";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (18:1) {#if d}
|
|
||||||
function create_if_block_3(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "d";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (25:0) {#if e}
|
|
||||||
function create_if_block_4(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "e";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,262 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
|
|
||||||
|
|
||||||
var if_block = (state.a) && create_if_block(component, state);
|
|
||||||
|
|
||||||
var if_block_1 = (state.b) && create_if_block_1(component, state);
|
|
||||||
|
|
||||||
var if_block_2 = (state.c) && create_if_block_2(component, state);
|
|
||||||
|
|
||||||
var if_block_3 = (state.d) && create_if_block_3(component, state);
|
|
||||||
|
|
||||||
var if_block_4 = (state.e) && create_if_block_4(component, state);
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
div = createElement("div");
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
text = createText("\n\n\t");
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "this can be used as an anchor";
|
|
||||||
text_2 = createText("\n\n\t");
|
|
||||||
if (if_block_1) if_block_1.c();
|
|
||||||
text_3 = createText("\n\n\t");
|
|
||||||
if (if_block_2) if_block_2.c();
|
|
||||||
text_4 = createText("\n\n\t");
|
|
||||||
p_1 = createElement("p");
|
|
||||||
p_1.textContent = "so can this";
|
|
||||||
text_6 = createText("\n\n\t");
|
|
||||||
if (if_block_3) if_block_3.c();
|
|
||||||
text_8 = createText("\n\n");
|
|
||||||
if (if_block_4) if_block_4.c();
|
|
||||||
if_block_4_anchor = createComment();
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(div, target, anchor);
|
|
||||||
if (if_block) if_block.m(div, null);
|
|
||||||
appendNode(text, div);
|
|
||||||
appendNode(p, div);
|
|
||||||
appendNode(text_2, div);
|
|
||||||
if (if_block_1) if_block_1.m(div, null);
|
|
||||||
appendNode(text_3, div);
|
|
||||||
if (if_block_2) if_block_2.m(div, null);
|
|
||||||
appendNode(text_4, div);
|
|
||||||
appendNode(p_1, div);
|
|
||||||
appendNode(text_6, div);
|
|
||||||
if (if_block_3) if_block_3.m(div, null);
|
|
||||||
insertNode(text_8, target, anchor);
|
|
||||||
if (if_block_4) if_block_4.m(target, anchor);
|
|
||||||
insertNode(if_block_4_anchor, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (state.a) {
|
|
||||||
if (!if_block) {
|
|
||||||
if_block = create_if_block(component, state);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(div, text);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.u();
|
|
||||||
if_block.d();
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.b) {
|
|
||||||
if (!if_block_1) {
|
|
||||||
if_block_1 = create_if_block_1(component, state);
|
|
||||||
if_block_1.c();
|
|
||||||
if_block_1.m(div, text_3);
|
|
||||||
}
|
|
||||||
} else if (if_block_1) {
|
|
||||||
if_block_1.u();
|
|
||||||
if_block_1.d();
|
|
||||||
if_block_1 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.c) {
|
|
||||||
if (!if_block_2) {
|
|
||||||
if_block_2 = create_if_block_2(component, state);
|
|
||||||
if_block_2.c();
|
|
||||||
if_block_2.m(div, text_4);
|
|
||||||
}
|
|
||||||
} else if (if_block_2) {
|
|
||||||
if_block_2.u();
|
|
||||||
if_block_2.d();
|
|
||||||
if_block_2 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.d) {
|
|
||||||
if (!if_block_3) {
|
|
||||||
if_block_3 = create_if_block_3(component, state);
|
|
||||||
if_block_3.c();
|
|
||||||
if_block_3.m(div, null);
|
|
||||||
}
|
|
||||||
} else if (if_block_3) {
|
|
||||||
if_block_3.u();
|
|
||||||
if_block_3.d();
|
|
||||||
if_block_3 = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.e) {
|
|
||||||
if (!if_block_4) {
|
|
||||||
if_block_4 = create_if_block_4(component, state);
|
|
||||||
if_block_4.c();
|
|
||||||
if_block_4.m(if_block_4_anchor.parentNode, if_block_4_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block_4) {
|
|
||||||
if_block_4.u();
|
|
||||||
if_block_4.d();
|
|
||||||
if_block_4 = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(div);
|
|
||||||
if (if_block) if_block.u();
|
|
||||||
if (if_block_1) if_block_1.u();
|
|
||||||
if (if_block_2) if_block_2.u();
|
|
||||||
if (if_block_3) if_block_3.u();
|
|
||||||
detachNode(text_8);
|
|
||||||
if (if_block_4) if_block_4.u();
|
|
||||||
detachNode(if_block_4_anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy() {
|
|
||||||
if (if_block) if_block.d();
|
|
||||||
if (if_block_1) if_block_1.d();
|
|
||||||
if (if_block_2) if_block_2.d();
|
|
||||||
if (if_block_3) if_block_3.d();
|
|
||||||
if (if_block_4) if_block_4.d();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (2:1) {#if a}
|
|
||||||
function create_if_block(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "a";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (8:1) {#if b}
|
|
||||||
function create_if_block_1(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "b";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (12:1) {#if c}
|
|
||||||
function create_if_block_2(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "c";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (18:1) {#if d}
|
|
||||||
function create_if_block_3(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "d";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// (25:0) {#if e}
|
|
||||||
function create_if_block_4(component, state) {
|
|
||||||
var p;
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
p.textContent = "e";
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: noop
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<div>
|
|
||||||
{#if a}
|
|
||||||
<p>a</p>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<p>this can be used as an anchor</p>
|
|
||||||
|
|
||||||
{#if b}
|
|
||||||
<p>b</p>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if c}
|
|
||||||
<p>c</p>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<p>so can this</p>
|
|
||||||
|
|
||||||
{#if d}
|
|
||||||
<p>d</p>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<!-- d can use 'null' as its anchor -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#if e}
|
|
||||||
<p>e</p>
|
|
||||||
{/if}
|
|
||||||
@ -1,27 +1,27 @@
|
|||||||
<div>
|
<div>
|
||||||
{{#if a}}
|
{#if a}
|
||||||
<p>a</p>
|
<p>a</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
|
|
||||||
<p>this can be used as an anchor</p>
|
<p>this can be used as an anchor</p>
|
||||||
|
|
||||||
{{#if b}}
|
{#if b}
|
||||||
<p>b</p>
|
<p>b</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
|
|
||||||
{{#if c}}
|
{#if c}
|
||||||
<p>c</p>
|
<p>c</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
|
|
||||||
<p>so can this</p>
|
<p>so can this</p>
|
||||||
|
|
||||||
{{#if d}}
|
{#if d}
|
||||||
<p>d</p>
|
<p>d</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
|
|
||||||
<!-- d can use 'null' as its anchor -->
|
<!-- d can use 'null' as its anchor -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if e}}
|
{#if e}
|
||||||
<p>e</p>
|
<p>e</p>
|
||||||
{{/if}}
|
{/if}
|
||||||
@ -1,210 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
|
|
||||||
|
|
||||||
function onwindowscroll(event) {
|
|
||||||
if (window_updating) return;
|
|
||||||
window_updating = true;
|
|
||||||
|
|
||||||
component.set({
|
|
||||||
y: this.pageYOffset
|
|
||||||
});
|
|
||||||
window_updating = false;
|
|
||||||
}
|
|
||||||
window.addEventListener("scroll", onwindowscroll);
|
|
||||||
|
|
||||||
component.observe("y", function(y) {
|
|
||||||
window_updating = true;
|
|
||||||
clearTimeout(window_updating_timeout);
|
|
||||||
window.scrollTo(window.pageXOffset, y);
|
|
||||||
window_updating_timeout = setTimeout(clear_window_updating, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText("scrolled to ");
|
|
||||||
text_1 = createText(state.y);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.y) {
|
|
||||||
text_1.data = state.y;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
window.removeEventListener("scroll", onwindowscroll);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
this._state.y = window.pageYOffset;
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,210 +0,0 @@
|
|||||||
function noop() {}
|
|
||||||
|
|
||||||
function assign(tar, src) {
|
|
||||||
for (var k in src) tar[k] = src[k];
|
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendNode(node, target) {
|
|
||||||
target.appendChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNode(node, target, anchor) {
|
|
||||||
target.insertBefore(node, anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
function detachNode(node) {
|
|
||||||
node.parentNode.removeChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createElement(name) {
|
|
||||||
return document.createElement(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createText(data) {
|
|
||||||
return document.createTextNode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function blankObject() {
|
|
||||||
return Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy(detach) {
|
|
||||||
this.destroy = noop;
|
|
||||||
this.fire('destroy');
|
|
||||||
this.set = this.get = noop;
|
|
||||||
|
|
||||||
if (detach !== false) this._fragment.u();
|
|
||||||
this._fragment.d();
|
|
||||||
this._fragment = this._state = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _differs(a, b) {
|
|
||||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function fire(eventName, data) {
|
|
||||||
var handlers =
|
|
||||||
eventName in this._handlers && this._handlers[eventName].slice();
|
|
||||||
if (!handlers) return;
|
|
||||||
|
|
||||||
for (var i = 0; i < handlers.length; i += 1) {
|
|
||||||
var handler = handlers[i];
|
|
||||||
|
|
||||||
if (!handler.__calling) {
|
|
||||||
handler.__calling = true;
|
|
||||||
handler.call(this, data);
|
|
||||||
handler.__calling = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
return this._state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(component, options) {
|
|
||||||
component._handlers = blankObject();
|
|
||||||
component._bind = options._bind;
|
|
||||||
|
|
||||||
component.options = options;
|
|
||||||
component.root = options.root || component;
|
|
||||||
component.store = component.root.store || options.store;
|
|
||||||
}
|
|
||||||
|
|
||||||
function on(eventName, handler) {
|
|
||||||
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
||||||
handlers.push(handler);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cancel: function() {
|
|
||||||
var index = handlers.indexOf(handler);
|
|
||||||
if (~index) handlers.splice(index, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(newState) {
|
|
||||||
this._set(assign({}, newState));
|
|
||||||
if (this.root._lock) return;
|
|
||||||
this.root._lock = true;
|
|
||||||
callAll(this.root._beforecreate);
|
|
||||||
callAll(this.root._oncreate);
|
|
||||||
callAll(this.root._aftercreate);
|
|
||||||
this.root._lock = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _set(newState) {
|
|
||||||
var oldState = this._state,
|
|
||||||
changed = {},
|
|
||||||
dirty = false;
|
|
||||||
|
|
||||||
for (var key in newState) {
|
|
||||||
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
|
|
||||||
}
|
|
||||||
if (!dirty) return;
|
|
||||||
|
|
||||||
this._state = assign(assign({}, oldState), newState);
|
|
||||||
this._recompute(changed, this._state);
|
|
||||||
if (this._bind) this._bind(changed, this._state);
|
|
||||||
|
|
||||||
if (this._fragment) {
|
|
||||||
this.fire("state", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
this._fragment.p(changed, this._state);
|
|
||||||
this.fire("update", { changed: changed, current: this._state, previous: oldState });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callAll(fns) {
|
|
||||||
while (fns && fns.length) fns.shift()();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _mount(target, anchor) {
|
|
||||||
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _unmount() {
|
|
||||||
if (this._fragment) this._fragment.u();
|
|
||||||
}
|
|
||||||
|
|
||||||
var proto = {
|
|
||||||
destroy,
|
|
||||||
get,
|
|
||||||
fire,
|
|
||||||
on,
|
|
||||||
set,
|
|
||||||
_recompute: noop,
|
|
||||||
_set,
|
|
||||||
_mount,
|
|
||||||
_unmount,
|
|
||||||
_differs
|
|
||||||
};
|
|
||||||
|
|
||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
|
|
||||||
|
|
||||||
function onwindowscroll(event) {
|
|
||||||
if (window_updating) return;
|
|
||||||
window_updating = true;
|
|
||||||
|
|
||||||
component.set({
|
|
||||||
y: this.pageYOffset
|
|
||||||
});
|
|
||||||
window_updating = false;
|
|
||||||
}
|
|
||||||
window.addEventListener("scroll", onwindowscroll);
|
|
||||||
|
|
||||||
component.observe("y", function(y) {
|
|
||||||
window_updating = true;
|
|
||||||
clearTimeout(window_updating_timeout);
|
|
||||||
window.scrollTo(window.pageXOffset, y);
|
|
||||||
window_updating_timeout = setTimeout(clear_window_updating, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText("scrolled to ");
|
|
||||||
text_1 = createText(state.y);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.y) {
|
|
||||||
text_1.data = state.y;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy$$1() {
|
|
||||||
window.removeEventListener("scroll", onwindowscroll);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
this._state.y = window.pageYOffset;
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
/* generated by Svelte vX.Y.Z */
|
|
||||||
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, proto } from "svelte/shared.js";
|
|
||||||
|
|
||||||
function create_main_fragment(component, state) {
|
|
||||||
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
|
|
||||||
|
|
||||||
function onwindowscroll(event) {
|
|
||||||
if (window_updating) return;
|
|
||||||
window_updating = true;
|
|
||||||
|
|
||||||
component.set({
|
|
||||||
y: this.pageYOffset
|
|
||||||
});
|
|
||||||
window_updating = false;
|
|
||||||
}
|
|
||||||
window.addEventListener("scroll", onwindowscroll);
|
|
||||||
|
|
||||||
component.observe("y", function(y) {
|
|
||||||
window_updating = true;
|
|
||||||
clearTimeout(window_updating_timeout);
|
|
||||||
window.scrollTo(window.pageXOffset, y);
|
|
||||||
window_updating_timeout = setTimeout(clear_window_updating, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
c: function create() {
|
|
||||||
p = createElement("p");
|
|
||||||
text = createText("scrolled to ");
|
|
||||||
text_1 = createText(state.y);
|
|
||||||
},
|
|
||||||
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insertNode(p, target, anchor);
|
|
||||||
appendNode(text, p);
|
|
||||||
appendNode(text_1, p);
|
|
||||||
},
|
|
||||||
|
|
||||||
p: function update(changed, state) {
|
|
||||||
if (changed.y) {
|
|
||||||
text_1.data = state.y;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
u: function unmount() {
|
|
||||||
detachNode(p);
|
|
||||||
},
|
|
||||||
|
|
||||||
d: function destroy() {
|
|
||||||
window.removeEventListener("scroll", onwindowscroll);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SvelteComponent(options) {
|
|
||||||
init(this, options);
|
|
||||||
this._state = assign({}, options.data);
|
|
||||||
this._state.y = window.pageYOffset;
|
|
||||||
|
|
||||||
this._fragment = create_main_fragment(this, this._state);
|
|
||||||
|
|
||||||
if (options.target) {
|
|
||||||
this._fragment.c();
|
|
||||||
this._mount(options.target, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assign(SvelteComponent.prototype, proto);
|
|
||||||
export default SvelteComponent;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<:Window bind:scrollY=y/>
|
|
||||||
|
|
||||||
<p>scrolled to {y}</p>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue