|
|
@ -1,7 +1,7 @@
|
|
|
|
/* generated by Svelte vX.Y.Z */
|
|
|
|
/* generated by Svelte vX.Y.Z */
|
|
|
|
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
|
|
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
|
|
|
|
|
|
|
|
|
|
|
|
function create_main_fragment(state, component) {
|
|
|
|
function create_main_fragment(component, state) {
|
|
|
|
var text, p, text_1;
|
|
|
|
var text, p, text_1;
|
|
|
|
|
|
|
|
|
|
|
|
var comments = state.comments;
|
|
|
|
var comments = state.comments;
|
|
|
@ -9,7 +9,10 @@ function create_main_fragment(state, component) {
|
|
|
|
var each_blocks = [];
|
|
|
|
var each_blocks = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
|
|
|
|
each_blocks[i] = create_each_block(component, assign({}, state, {
|
|
|
|
|
|
|
|
comment: comments[i],
|
|
|
|
|
|
|
|
i: i
|
|
|
|
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -38,10 +41,15 @@ function create_main_fragment(state, component) {
|
|
|
|
|
|
|
|
|
|
|
|
if (changed.comments || changed.elapsed || changed.time) {
|
|
|
|
if (changed.comments || changed.elapsed || changed.time) {
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
for (var i = 0; i < comments.length; i += 1) {
|
|
|
|
|
|
|
|
var each_context = assign({}, state, {
|
|
|
|
|
|
|
|
comment: comments[i],
|
|
|
|
|
|
|
|
i: i
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (each_blocks[i]) {
|
|
|
|
if (each_blocks[i]) {
|
|
|
|
each_blocks[i].p(changed, state, comments, comments[i], i);
|
|
|
|
each_blocks[i].p(changed, each_context);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
|
|
|
|
each_blocks[i] = create_each_block(component, each_context);
|
|
|
|
each_blocks[i].c();
|
|
|
|
each_blocks[i].c();
|
|
|
|
each_blocks[i].m(text.parentNode, text);
|
|
|
|
each_blocks[i].m(text.parentNode, text);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -75,14 +83,14 @@ function create_main_fragment(state, component) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// (1:0) {{#each comments as comment, i}}
|
|
|
|
// (1:0) {{#each comments as comment, i}}
|
|
|
|
function create_each_block(state, comments, comment, i, component) {
|
|
|
|
function create_each_block(component, state) {
|
|
|
|
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;
|
|
|
|
var div, strong, text, text_1, span, text_2_value = state.comment.author, text_2, text_3, text_4_value = state.elapsed(state.comment.time, state.time), text_4, text_5, text_6, raw_value = state.comment.html, raw_before;
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
c: function create() {
|
|
|
|
c: function create() {
|
|
|
|
div = createElement("div");
|
|
|
|
div = createElement("div");
|
|
|
|
strong = createElement("strong");
|
|
|
|
strong = createElement("strong");
|
|
|
|
text = createText(i);
|
|
|
|
text = createText(state.i);
|
|
|
|
text_1 = createText("\n\n\t\t");
|
|
|
|
text_1 = createText("\n\n\t\t");
|
|
|
|
span = createElement("span");
|
|
|
|
span = createElement("span");
|
|
|
|
text_2 = createText(text_2_value);
|
|
|
|
text_2 = createText(text_2_value);
|
|
|
@ -114,16 +122,16 @@ function create_each_block(state, comments, comment, i, component) {
|
|
|
|
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
|
|
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
p: function update(changed, state, comments, comment, i) {
|
|
|
|
p: function update(changed, state) {
|
|
|
|
if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
|
|
|
|
if ((changed.comments) && text_2_value !== (text_2_value = state.comment.author)) {
|
|
|
|
text_2.data = text_2_value;
|
|
|
|
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))) {
|
|
|
|
if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(state.comment.time, state.time))) {
|
|
|
|
text_4.data = text_4_value;
|
|
|
|
text_4.data = text_4_value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
|
|
|
|
if ((changed.comments) && raw_value !== (raw_value = state.comment.html)) {
|
|
|
|
detachAfter(raw_before);
|
|
|
|
detachAfter(raw_before);
|
|
|
|
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
|
|
raw_before.insertAdjacentHTML("afterend", raw_value);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -143,7 +151,7 @@ function SvelteComponent(options) {
|
|
|
|
init(this, options);
|
|
|
|
init(this, options);
|
|
|
|
this._state = assign({}, options.data);
|
|
|
|
this._state = assign({}, options.data);
|
|
|
|
|
|
|
|
|
|
|
|
this._fragment = create_main_fragment(this._state, this);
|
|
|
|
this._fragment = create_main_fragment(this, this._state);
|
|
|
|
|
|
|
|
|
|
|
|
if (options.target) {
|
|
|
|
if (options.target) {
|
|
|
|
this._fragment.c();
|
|
|
|
this._fragment.c();
|
|
|
|