mirror of https://github.com/sveltejs/svelte
parent
ad653c5834
commit
7407bccb79
@ -1,48 +1,51 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, flush, init, noop, proto } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js";
|
||||
|
||||
var Nested = window.Nested;
|
||||
const Nested = window.Nested;
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
function create_fragment(component, ctx) {
|
||||
var current;
|
||||
|
||||
var nested_initial_data = { foo: [1, 2, 3] };
|
||||
var nested = new Nested({
|
||||
root: component.root,
|
||||
store: component.store,
|
||||
data: nested_initial_data
|
||||
props: { foo: [1, 2, 3] }
|
||||
});
|
||||
|
||||
return {
|
||||
c() {
|
||||
nested._fragment.c();
|
||||
nested.$$.fragment.c();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
nested._mount(target, anchor);
|
||||
mount_component(nested, target, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (nested) nested.$$.fragment.o(outrocallback);
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
nested.destroy(detach);
|
||||
nested.$destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
|
||||
flush(this);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, noop, create_fragment, safe_not_equal);
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
@ -1,50 +1,51 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { _differsImmutable, assign, flush, init, noop, proto } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, not_equal } from "svelte/internal.js";
|
||||
|
||||
var Nested = window.Nested;
|
||||
const Nested = window.Nested;
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
function create_fragment(component, ctx) {
|
||||
var current;
|
||||
|
||||
var nested_initial_data = { foo: "bar" };
|
||||
var nested = new Nested({
|
||||
root: component.root,
|
||||
store: component.store,
|
||||
data: nested_initial_data
|
||||
props: { foo: "bar" }
|
||||
});
|
||||
|
||||
return {
|
||||
c() {
|
||||
nested._fragment.c();
|
||||
nested.$$.fragment.c();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
nested._mount(target, anchor);
|
||||
mount_component(nested, target, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
d(detach) {
|
||||
nested.destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
if (nested) nested.$$.fragment.o(outrocallback);
|
||||
current = false;
|
||||
},
|
||||
|
||||
flush(this);
|
||||
d(detach) {
|
||||
nested.$destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, noop, create_fragment, not_equal);
|
||||
}
|
||||
}
|
||||
|
||||
SvelteComponent.prototype._differs = _differsImmutable;
|
||||
export default SvelteComponent;
|
@ -1,48 +1,51 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, flush, init, noop, proto } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, init, mount_component, noop, safe_not_equal } from "svelte/internal.js";
|
||||
|
||||
var Nested = window.Nested;
|
||||
const Nested = window.Nested;
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
function create_fragment(component, ctx) {
|
||||
var current;
|
||||
|
||||
var nested_initial_data = { foo: "bar" };
|
||||
var nested = new Nested({
|
||||
root: component.root,
|
||||
store: component.store,
|
||||
data: nested_initial_data
|
||||
props: { foo: "bar" }
|
||||
});
|
||||
|
||||
return {
|
||||
c() {
|
||||
nested._fragment.c();
|
||||
nested.$$.fragment.c();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
nested._mount(target, anchor);
|
||||
mount_component(nested, target, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (nested) nested.$$.fragment.o(outrocallback);
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
nested.destroy(detach);
|
||||
nested.$destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
|
||||
flush(this);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, noop, create_fragment, safe_not_equal);
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
@ -1,48 +1,46 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, assignTrue, flush, init, noop, proto } from "svelte/shared.js";
|
||||
|
||||
function data_1() {
|
||||
return {
|
||||
foo: 'bar'
|
||||
};
|
||||
}
|
||||
|
||||
function oncreate() {
|
||||
alert(JSON.stringify(data()));
|
||||
};
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, flush, init, noop, run, safe_not_equal } from "svelte/internal.js";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
function create_fragment(component, ctx) {
|
||||
return {
|
||||
c: noop,
|
||||
|
||||
m: noop,
|
||||
|
||||
p: noop,
|
||||
|
||||
i: noop,
|
||||
o: run,
|
||||
d: noop
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign(data_1(), options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
function define($$self, $$props) {
|
||||
let { foo = 'bar' } = $$props;
|
||||
|
||||
this.root._oncreate.push(() => {
|
||||
oncreate.call(this);
|
||||
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
|
||||
onMount(() => {
|
||||
alert(JSON.stringify(data()));
|
||||
});
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
$$self.$$.get = () => ({ foo });
|
||||
|
||||
$$self.$$.set = $$props => {
|
||||
if ('foo' in $$props) foo = $$props.foo;
|
||||
};
|
||||
}
|
||||
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, define, create_fragment, safe_not_equal);
|
||||
}
|
||||
|
||||
get foo() {
|
||||
return this.$$.get().foo;
|
||||
}
|
||||
|
||||
flush(this);
|
||||
set foo(value) {
|
||||
this.$set({ foo: value });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
@ -1,46 +1,72 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, flush, init, noop, proto } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, flush, init, mount_component, safe_not_equal } from "svelte/internal.js";
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
function func() {
|
||||
return import('./Foo.html');
|
||||
}
|
||||
|
||||
function create_fragment(component, ctx) {
|
||||
var current;
|
||||
|
||||
var lazyload_initial_data = { load: () => import('./Foo.html') };
|
||||
var lazyload = new LazyLoad({
|
||||
root: component.root,
|
||||
store: component.store,
|
||||
data: lazyload_initial_data
|
||||
var lazyload = new ctx.LazyLoad({
|
||||
props: { load: func }
|
||||
});
|
||||
|
||||
return {
|
||||
c() {
|
||||
lazyload._fragment.c();
|
||||
lazyload.$$.fragment.c();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
lazyload._mount(target, anchor);
|
||||
mount_component(lazyload, target, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
if (lazyload) lazyload.$$.fragment.o(outrocallback);
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
lazyload.destroy(detach);
|
||||
lazyload.$destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
function define($$self, $$props) {
|
||||
let { LazyLoad } = $$props;
|
||||
|
||||
$$self.$$.get = () => ({ LazyLoad });
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
$$self.$$.set = $$props => {
|
||||
if ('LazyLoad' in $$props) LazyLoad = $$props.LazyLoad;
|
||||
};
|
||||
}
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, define, create_fragment, safe_not_equal);
|
||||
}
|
||||
|
||||
get LazyLoad() {
|
||||
return this.$$.get().LazyLoad;
|
||||
}
|
||||
|
||||
flush(this);
|
||||
set LazyLoad(value) {
|
||||
this.$set({ LazyLoad: value });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
@ -1,60 +1,77 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, createElement, detachNode, init, insert, proto } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, noop, removeListener, run, safe_not_equal } from "svelte/internal.js";
|
||||
|
||||
function foo( node, callback ) {
|
||||
// code goes here
|
||||
};
|
||||
|
||||
var methods = {
|
||||
foo ( bar ) {
|
||||
function handleFoo(bar) {
|
||||
console.log(bar);
|
||||
}
|
||||
};
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
var button, foo_handler;
|
||||
function create_fragment(component, ctx) {
|
||||
var button, current;
|
||||
|
||||
return {
|
||||
c() {
|
||||
button = createElement("button");
|
||||
button.textContent = "foo";
|
||||
foo_handler = foo.call(component, button, function(event) {
|
||||
component.foo( ctx.bar );
|
||||
});
|
||||
addListener(button, "foo", ctx.foo_handler);
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
insert(target, button, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p(changed, _ctx) {
|
||||
ctx = _ctx;
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o: run,
|
||||
|
||||
d(detach) {
|
||||
if (detach) {
|
||||
detachNode(button);
|
||||
}
|
||||
|
||||
foo_handler.destroy();
|
||||
removeListener(button, "foo", ctx.foo_handler);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
function define($$self, $$props) {
|
||||
let { bar } = $$props;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
function foo(node, callback) {
|
||||
// code goes here
|
||||
}
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
function foo_handler() {
|
||||
return handleFoo(bar);
|
||||
}
|
||||
|
||||
// TODO only what's needed by the template
|
||||
$$self.$$.get = () => ({ bar, foo_handler });
|
||||
|
||||
$$self.$$.set = $$props => {
|
||||
if ('bar' in $$props) bar = $$props.bar;
|
||||
};
|
||||
}
|
||||
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, define, create_fragment, safe_not_equal);
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
assign(SvelteComponent.prototype, methods);
|
||||
get bar() {
|
||||
return this.$$.get().bar;
|
||||
}
|
||||
|
||||
set bar(value) {
|
||||
this.$set({ bar: value });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
export default SvelteComponent;
|
@ -1,99 +1,198 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { addListener, assign, createElement, detachNode, flush, init, insert, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, addListener, add_render_callback, createElement, detachNode, flush, init, insert, removeListener, run, safe_not_equal, timeRangesToArray } from "svelte/internal.js";
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe;
|
||||
function create_fragment(component, ctx) {
|
||||
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe, current;
|
||||
|
||||
return {
|
||||
c() {
|
||||
audio = createElement("audio");
|
||||
addListener(audio, "timeupdate", ctx.audio_timeupdate_handler);
|
||||
if (ctx.played === void 0 || ctx.currentTime === void 0) add_render_callback(() => ctx.audio_timeupdate_handler.call(audio));
|
||||
addListener(audio, "durationchange", ctx.audio_durationchange_handler);
|
||||
if (ctx.duration === void 0) add_render_callback(() => ctx.audio_durationchange_handler.call(audio));
|
||||
addListener(audio, "play", ctx.audio_play_pause_handler);
|
||||
addListener(audio, "pause", ctx.audio_play_pause_handler);
|
||||
addListener(audio, "progress", ctx.audio_progress_handler);
|
||||
if (ctx.buffered === void 0) add_render_callback(() => ctx.audio_progress_handler.call(audio));
|
||||
addListener(audio, "loadedmetadata", ctx.audio_loadedmetadata_handler);
|
||||
if (ctx.buffered === void 0 || ctx.seekable === void 0) add_render_callback(() => ctx.audio_loadedmetadata_handler.call(audio));
|
||||
addListener(audio, "volumechange", ctx.audio_volumechange_handler);
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
insert(target, audio, anchor);
|
||||
|
||||
audio.volume = ctx.volume;
|
||||
|
||||
current = true;
|
||||
},
|
||||
|
||||
p(changed, ctx) {
|
||||
if (!audio_updating && !isNaN(ctx.currentTime ) && changed.currentTime) audio.currentTime = ctx.currentTime ;
|
||||
if (!audio_updating && audio_is_paused !== (audio_is_paused = ctx.paused ) && changed.paused) audio[audio_is_paused ? "pause" : "play"]();
|
||||
if (!audio_updating && !isNaN(ctx.volume) && changed.volume) audio.volume = ctx.volume;
|
||||
},
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o: run,
|
||||
|
||||
d(detach) {
|
||||
if (detach) {
|
||||
detachNode(audio);
|
||||
}
|
||||
|
||||
removeListener(audio, "timeupdate", ctx.audio_timeupdate_handler);
|
||||
removeListener(audio, "durationchange", ctx.audio_durationchange_handler);
|
||||
removeListener(audio, "play", ctx.audio_play_pause_handler);
|
||||
removeListener(audio, "pause", ctx.audio_play_pause_handler);
|
||||
removeListener(audio, "progress", ctx.audio_progress_handler);
|
||||
removeListener(audio, "loadedmetadata", ctx.audio_loadedmetadata_handler);
|
||||
removeListener(audio, "volumechange", ctx.audio_volumechange_handler);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function define($$self, $$make_dirty) {
|
||||
// TODO some of these are read-only...
|
||||
let { buffered, seekable, played, currentTime, duration, paused, volume } = $$props;
|
||||
|
||||
function audio_timeupdate_handler() {
|
||||
cancelAnimationFrame(audio_animationframe);
|
||||
if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler);
|
||||
audio_updating = true;
|
||||
component.set({ played: timeRangesToArray(audio.played), currentTime: audio.currentTime });
|
||||
audio_updating = false;
|
||||
played = timeRangesToArray(this.played);
|
||||
currentTime = this.currentTime;
|
||||
$$make_dirty('played');
|
||||
$$make_dirty('currentTime');
|
||||
}
|
||||
|
||||
function audio_durationchange_handler() {
|
||||
component.set({ duration: audio.duration });
|
||||
duration = this.duration;
|
||||
$$make_dirty('duration');
|
||||
}
|
||||
|
||||
function audio_play_pause_handler() {
|
||||
audio_updating = true;
|
||||
component.set({ paused: audio.paused });
|
||||
audio_updating = false;
|
||||
paused = this.paused;
|
||||
$$make_dirty('paused');
|
||||
}
|
||||
|
||||
function audio_progress_handler() {
|
||||
component.set({ buffered: timeRangesToArray(audio.buffered) });
|
||||
buffered = timeRangesToArray(this.buffered);
|
||||
$$make_dirty('buffered');
|
||||
}
|
||||
|
||||
function audio_loadedmetadata_handler() {
|
||||
component.set({ buffered: timeRangesToArray(audio.buffered), seekable: timeRangesToArray(audio.seekable) });
|
||||
buffered = timeRangesToArray(this.buffered);
|
||||
seekable = timeRangesToArray(this.seekable);
|
||||
$$make_dirty('buffered');
|
||||
$$make_dirty('seekable');
|
||||
}
|
||||
|
||||
function audio_volumechange_handler() {
|
||||
audio_updating = true;
|
||||
component.set({ volume: audio.volume });
|
||||
audio_updating = false;
|
||||
volume = this.volume;
|
||||
$$make_dirty('volume');
|
||||
}
|
||||
|
||||
return {
|
||||
c() {
|
||||
audio = createElement("audio");
|
||||
addListener(audio, "timeupdate", audio_timeupdate_handler);
|
||||
if (!('played' in ctx && 'currentTime' in ctx)) component.root._beforecreate.push(audio_timeupdate_handler);
|
||||
addListener(audio, "durationchange", audio_durationchange_handler);
|
||||
if (!('duration' in ctx)) component.root._beforecreate.push(audio_durationchange_handler);
|
||||
addListener(audio, "play", audio_play_pause_handler);
|
||||
addListener(audio, "pause", audio_play_pause_handler);
|
||||
addListener(audio, "progress", audio_progress_handler);
|
||||
if (!('buffered' in ctx)) component.root._beforecreate.push(audio_progress_handler);
|
||||
addListener(audio, "loadedmetadata", audio_loadedmetadata_handler);
|
||||
if (!('buffered' in ctx && 'seekable' in ctx)) component.root._beforecreate.push(audio_loadedmetadata_handler);
|
||||
addListener(audio, "volumechange", audio_volumechange_handler);
|
||||
},
|
||||
$$self.$$.get = () => ({
|
||||
buffered,
|
||||
seekable,
|
||||
played,
|
||||
currentTime,
|
||||
duration,
|
||||
paused,
|
||||
volume,
|
||||
audio_timeupdate_handler,
|
||||
audio_durationchange_handler,
|
||||
audio_play_pause_handler,
|
||||
audio_progress_handler,
|
||||
audio_loadedmetadata_handler,
|
||||
audio_volumechange_handler
|
||||
});
|
||||
|
||||
$$self.$$.set = $$props => {
|
||||
if ('buffered' in $$props) buffered = $$props.buffered;
|
||||
if ('seekable' in $$props) seekable = $$props.seekable;
|
||||
if ('played' in $$props) played = $$props.played;
|
||||
if ('currentTime' in $$props) currentTime = $$props.currentTime;
|
||||
if ('duration' in $$props) duration = $$props.duration;
|
||||
if ('paused' in $$props) paused = $$props.paused;
|
||||
if ('volume' in $$props) volume = $$props.volume;
|
||||
};
|
||||
}
|
||||
|
||||
m(target, anchor) {
|
||||
insert(target, audio, anchor);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, define, create_fragment, safe_not_equal);
|
||||
}
|
||||
|
||||
audio.volume = ctx.volume;
|
||||
},
|
||||
get buffered() {
|
||||
return this.$$.get().buffered;
|
||||
}
|
||||
|
||||
p(changed, ctx) {
|
||||
if (!audio_updating && !isNaN(ctx.currentTime ) && changed.currentTime) audio.currentTime = ctx.currentTime ;
|
||||
if (!audio_updating && audio_is_paused !== (audio_is_paused = ctx.paused ) && changed.paused) audio[audio_is_paused ? "pause" : "play"]();
|
||||
if (!audio_updating && !isNaN(ctx.volume) && changed.volume) audio.volume = ctx.volume;
|
||||
},
|
||||
set buffered(value) {
|
||||
this.$set({ buffered: value });
|
||||
flush();
|
||||
}
|
||||
|
||||
d(detach) {
|
||||
if (detach) {
|
||||
detachNode(audio);
|
||||
get seekable() {
|
||||
return this.$$.get().seekable;
|
||||
}
|
||||
|
||||
removeListener(audio, "timeupdate", audio_timeupdate_handler);
|
||||
removeListener(audio, "durationchange", audio_durationchange_handler);
|
||||
removeListener(audio, "play", audio_play_pause_handler);
|
||||
removeListener(audio, "pause", audio_play_pause_handler);
|
||||
removeListener(audio, "progress", audio_progress_handler);
|
||||
removeListener(audio, "loadedmetadata", audio_loadedmetadata_handler);
|
||||
removeListener(audio, "volumechange", audio_volumechange_handler);
|
||||
set seekable(value) {
|
||||
this.$set({ seekable: value });
|
||||
flush();
|
||||
}
|
||||
};
|
||||
|
||||
get played() {
|
||||
return this.$$.get().played;
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
set played(value) {
|
||||
this.$set({ played: value });
|
||||
flush();
|
||||
}
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
get currentTime() {
|
||||
return this.$$.get().currentTime;
|
||||
}
|
||||
|
||||
set currentTime(value) {
|
||||
this.$set({ currentTime: value });
|
||||
flush();
|
||||
}
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
get duration() {
|
||||
return this.$$.get().duration;
|
||||
}
|
||||
|
||||
set duration(value) {
|
||||
this.$set({ duration: value });
|
||||
flush();
|
||||
}
|
||||
|
||||
get paused() {
|
||||
return this.$$.get().paused;
|
||||
}
|
||||
|
||||
set paused(value) {
|
||||
this.$set({ paused: value });
|
||||
flush();
|
||||
}
|
||||
|
||||
get volume() {
|
||||
return this.$$.get().volume;
|
||||
}
|
||||
|
||||
flush(this);
|
||||
set volume(value) {
|
||||
this.$set({ volume: value });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
@ -1,62 +1,63 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, createText, detachNode, flush, init, insert, noop, proto } from "svelte/shared.js";
|
||||
import Imported from 'Imported.html';
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, callAfter, createText, detachNode, init, insert, mount_component, noop, safe_not_equal } from "svelte/internal.js";
|
||||
import Imported from "Imported.html";
|
||||
|
||||
function create_fragment(component, ctx) {
|
||||
var text, current;
|
||||
|
||||
var imported = new Imported({});
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
var text;
|
||||
|
||||
var imported = new Imported({
|
||||
root: component.root,
|
||||
store: component.store
|
||||
});
|
||||
|
||||
var nonimported = new NonImported({
|
||||
root: component.root,
|
||||
store: component.store
|
||||
});
|
||||
var nonimported = new NonImported({});
|
||||
|
||||
return {
|
||||
c() {
|
||||
imported._fragment.c();
|
||||
imported.$$.fragment.c();
|
||||
text = createText("\n");
|
||||
nonimported._fragment.c();
|
||||
nonimported.$$.fragment.c();
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
imported._mount(target, anchor);
|
||||
mount_component(imported, target, anchor);
|
||||
insert(target, text, anchor);
|
||||
nonimported._mount(target, anchor);
|
||||
mount_component(nonimported, target, anchor);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o(outrocallback) {
|
||||
if (!current) return;
|
||||
|
||||
outrocallback = callAfter(outrocallback, 2);
|
||||
|
||||
if (imported) imported.$$.fragment.o(outrocallback);
|
||||
if (nonimported) nonimported.$$.fragment.o(outrocallback);
|
||||
current = false;
|
||||
},
|
||||
|
||||
d(detach) {
|
||||
imported.destroy(detach);
|
||||
imported.$destroy(detach);
|
||||
|
||||
if (detach) {
|
||||
detachNode(text);
|
||||
}
|
||||
|
||||
nonimported.destroy(detach);
|
||||
nonimported.$destroy(detach);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
|
||||
flush(this);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, noop, create_fragment, safe_not_equal);
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
export default SvelteComponent;
|
@ -1,50 +1,32 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { assign, init, noop, proto } from "svelte/shared.js";
|
||||
/* generated by Svelte vX.Y.Z-alpha1 */
|
||||
import { SvelteComponent as SvelteComponent_1, init, noop, run, safe_not_equal } from "svelte/internal.js";
|
||||
|
||||
var methods = {
|
||||
foo ( bar ) {
|
||||
console.log( bar );
|
||||
}
|
||||
};
|
||||
export const SOME_CONSTANT = 42;
|
||||
|
||||
function setup(Component) {
|
||||
Component.SOME_CONSTANT = 42;
|
||||
Component.factory = function (target) {
|
||||
return new Component({
|
||||
target: target
|
||||
});
|
||||
}
|
||||
Component.prototype.foo( 'baz' );
|
||||
function foo(bar) {
|
||||
console.log(bar);
|
||||
}
|
||||
|
||||
function create_main_fragment(component, ctx) {
|
||||
|
||||
function create_fragment(component, ctx) {
|
||||
return {
|
||||
c: noop,
|
||||
|
||||
m: noop,
|
||||
|
||||
p: noop,
|
||||
|
||||
i: noop,
|
||||
o: run,
|
||||
d: noop
|
||||
};
|
||||
}
|
||||
|
||||
function SvelteComponent(options) {
|
||||
init(this, options);
|
||||
this._state = assign({}, options.data);
|
||||
this._intro = true;
|
||||
|
||||
this._fragment = create_main_fragment(this, this._state);
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, define, create_fragment, safe_not_equal);
|
||||
}
|
||||
|
||||
if (options.target) {
|
||||
this._fragment.c();
|
||||
this._mount(options.target, options.anchor);
|
||||
get foo() {
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
|
||||
assign(SvelteComponent.prototype, proto);
|
||||
assign(SvelteComponent.prototype, methods);
|
||||
|
||||
setup(SvelteComponent);
|
||||
export default SvelteComponent;
|
Loading…
Reference in new issue