Merge branch 'master' into gh-781

pull/812/head
Rich Harris 7 years ago committed by GitHub
commit 5ca6893f58

@ -340,9 +340,7 @@ export default class Block {
}
return deindent`
function ${this.name} ( ${this.params.join(', ')}, #component${this.key
? `, ${localKey}`
: ''} ) {
function ${this.name}(${this.params.join(', ')}, #component${this.key ? `, ${localKey}` : ''}) {
${this.variables.size > 0 &&
`var ${Array.from(this.variables.keys())
.map(key => {

@ -106,7 +106,7 @@ export default function dom(
if (generator.needsEncapsulateHelper) {
builder.addBlock(deindent`
function @encapsulateStyles(node) {
@setAttribute( node, '${generator.stylesheet.id}', '' );
@setAttribute(node, "${generator.stylesheet.id}", "");
}
`);
}
@ -119,7 +119,7 @@ export default function dom(
if (styles && generator.options.css !== false && !generator.customElement) {
builder.addBlock(deindent`
function @add_css() {
var style = @createElement( 'style' );
var style = @createElement("style");
style.id = '${generator.stylesheet.id}-style';
style.textContent = ${styles};
@appendNode(style, document.head);
@ -166,9 +166,7 @@ export default function dom(
`if (!('${prop}' in this._state)) console.warn("${debugName} was created without expected data property '${prop}'");`
)}
${generator.bindingGroups.length &&
`this._bindingGroups = [ ${Array(generator.bindingGroups.length)
.fill('[]')
.join(', ')} ];`}
`this._bindingGroups = [${Array(generator.bindingGroups.length).fill('[]').join(', ')}];`}
this._observers = {
pre: Object.create(null),
@ -189,7 +187,7 @@ export default function dom(
${css && `this.shadowRoot.innerHTML = \`<style>${options.dev ? `${css}\n/*# sourceMappingURL=${cssMap.toUrl()} */` : css}</style>\`;`}
` :
(generator.stylesheet.hasStyles && options.css !== false &&
`if ( !document.getElementById( '${generator.stylesheet.id}-style' ) ) @add_css();`)
`if (!document.getElementById("${generator.stylesheet.id}-style")) @add_css();`)
}
${templateProperties.oncreate && `var oncreate = @template.oncreate.bind(this);`}
@ -218,7 +216,7 @@ export default function dom(
nodes.forEach(@detachNode);
` :
deindent`
${options.dev && `if ( options.hydrate ) throw new Error( 'options.hydrate only works if the component was compiled with the \`hydratable: true\` option' );`}
${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`}
this._fragment.create();
`}
${generator.customElement ?
@ -271,7 +269,7 @@ export default function dom(
}
}
customElements.define('${generator.tag}', ${name});
customElements.define("${generator.tag}", ${name});
@assign(${prototypeBase}, ${proto}, {
_mount(target, anchor) {
this._fragment.${block.hasIntroMethod ? 'intro' : 'mount'}(this.shadowRoot, null);
@ -392,9 +390,7 @@ export default function dom(
// special case
const global = `_svelteTransitionManager`;
result += `\n\nvar ${generator.alias(
'transitionManager'
)} = window.${global} || ( window.${global} = ${code});`;
result += `\n\nvar ${generator.alias('transitionManager')} = window.${global} || (window.${global} = ${code});`;
} else {
const alias = generator.alias(expression.id.name);
if (alias !== expression.id.name)

@ -5,6 +5,7 @@ import { DomGenerator } from '../index';
import Block from '../Block';
import getTailSnippet from '../../../utils/getTailSnippet';
import getObject from '../../../utils/getObject';
import getExpressionPrecedence from '../../../utils/getExpressionPrecedence';
import { stringify } from '../../../utils/stringify';
import { Node } from '../../../interfaces';
import { State } from '../interfaces';
@ -279,7 +280,7 @@ export default function visitComponent(
`${block.alias('component')}.fire('${handler.name}', event);`);
block.builders.init.addBlock(deindent`
${name}.on( '${handler.name}', function ( event ) {
${name}.on("${handler.name}", function(event) {
${handlerBody}
});
`);
@ -392,7 +393,7 @@ function mungeAttribute(attribute: Node, block: Block): Attribute {
allDependencies.add(dependency);
});
return `( ${snippet} )`; // TODO only parenthesize if necessary
return getExpressionPrecedence(chunk.expression) <= 13 ? `( ${snippet} )` : snippet;
}
})
.join(' + ');

@ -81,8 +81,7 @@ export default function visitEachBlock(
block.builders.mount.addBlock(deindent`
if (${each_block_else}) {
${each_block_else}.${mountOrIntro}( ${state.parentNode ||
'#target'}, null );
${each_block_else}.${mountOrIntro}(${state.parentNode || '#target'}, null);
}
`);
@ -328,8 +327,7 @@ function keyed(
if (${last}) ${last}.next = ${iteration};
${iteration}.last = ${last};
${node._block.hasIntroMethod &&
`${iteration}.intro( ${parentNode}, ${anchor} );`}
${node._block.hasIntroMethod && `${iteration}.intro(${parentNode}, ${anchor});`}
${last} = ${iteration};
}

@ -2,6 +2,7 @@ import attributeLookup from './lookup';
import deindent from '../../../../utils/deindent';
import visitStyleAttribute, { optimizeStyle } from './StyleAttribute';
import { stringify } from '../../../../utils/stringify';
import getExpressionPrecedence from '../../../../utils/getExpressionPrecedence';
import getStaticAttributeValue from '../../../shared/getStaticAttributeValue';
import { DomGenerator } from '../../index';
import Block from '../../Block';
@ -99,7 +100,7 @@ export default function visitAttribute(
allDependencies.add(d);
});
return `( ${snippet} )`;
return getExpressionPrecedence(chunk.expression) <= 13 ? `(${snippet})` : snippet;
}
})
.join(' + ');
@ -164,9 +165,9 @@ export default function visitAttribute(
updater = `${state.parentNode}.${propertyName} = ${shouldCache || isSelectValueAttribute ? last : value};`;
} else {
block.builders.hydrate.addLine(
`${method}( ${state.parentNode}, '${name}', ${init} );`
`${method}(${state.parentNode}, "${name}", ${init});`
);
updater = `${method}( ${state.parentNode}, '${name}', ${shouldCache || isSelectValueAttribute ? last : value} );`;
updater = `${method}(${state.parentNode}, "${name}", ${shouldCache || isSelectValueAttribute ? last : value});`;
}
if (allDependencies.size || hasChangeableIndex || isSelectValueAttribute) {
@ -197,7 +198,7 @@ export default function visitAttribute(
const statement = (
isLegacyInputType ? `@setInputType(${state.parentNode}, ${value});` :
propertyName ? `${state.parentNode}.${propertyName} = ${value};` :
`${method}( ${state.parentNode}, '${name}', ${value} );`
`${method}(${state.parentNode}, "${name}", ${value});`
);
block.builders.hydrate.addLine(statement);

@ -134,7 +134,7 @@ export default function visitBinding(
block.addVariable(last, 'true');
updateCondition = `${last} !== (${last} = ${snippet})`;
updateElement = `${state.parentNode}[ ${last} ? 'pause' : 'play' ]();`;
updateElement = `${state.parentNode}[${last} ? "pause" : "play"]();`;
}
}
@ -149,21 +149,21 @@ export default function visitBinding(
if (node.name === 'input' && type === 'range') {
// need to bind to `input` and `change`, for the benefit of IE
block.builders.hydrate.addBlock(deindent`
@addListener( ${state.parentNode}, 'input', ${handler} );
@addListener( ${state.parentNode}, 'change', ${handler} );
@addListener(${state.parentNode}, "input", ${handler});
@addListener(${state.parentNode}, "change", ${handler});
`);
block.builders.destroy.addBlock(deindent`
@removeListener( ${state.parentNode}, 'input', ${handler} );
@removeListener( ${state.parentNode}, 'change', ${handler} );
@removeListener(${state.parentNode}, "input", ${handler});
@removeListener(${state.parentNode}, "change", ${handler});
`);
} else {
block.builders.hydrate.addLine(
`@addListener( ${state.parentNode}, '${eventName}', ${handler} );`
`@addListener(${state.parentNode}, "${eventName}", ${handler});`
);
block.builders.destroy.addLine(
`@removeListener( ${state.parentNode}, '${eventName}', ${handler} );`
`@removeListener(${state.parentNode}, "${eventName}", ${handler});`
);
}
@ -183,10 +183,10 @@ export default function visitBinding(
if (attribute.name === 'paused') {
block.builders.create.addLine(
`@addListener( ${state.parentNode}, 'play', ${handler} );`
`@addListener(${state.parentNode}, "play", ${handler});`
);
block.builders.destroy.addLine(
`@removeListener( ${state.parentNode}, 'play', ${handler} );`
`@removeListener(${state.parentNode}, "play", ${handler});`
);
}
}
@ -286,12 +286,8 @@ function getSetter(
list[index]${tail} = ${value};
${computed
? `#component.set({ ${dependencies
.map((prop: string) => `${prop}: state.${prop}`)
.join(', ')} });`
: `#component.set({ ${dependencies
.map((prop: string) => `${prop}: #component.get( '${prop}' )`)
.join(', ')} });`}
? `#component.set({${dependencies.map((prop: string) => `${prop}: state.${prop}`).join(', ')} });`
: `#component.set({${dependencies.map((prop: string) => `${prop}: #component.get('${prop}')`).join(', ')} });`}
`;
}
@ -299,9 +295,7 @@ function getSetter(
return deindent`
var state = #component.get();
${snippet} = ${value};
#component.set({ ${dependencies
.map((prop: string) => `${prop}: state.${prop}`)
.join(', ')} });
#component.set({ ${dependencies.map((prop: string) => `${prop}: state.${prop}`).join(', ')} });
`;
}

@ -71,7 +71,7 @@ export default function visitEventHandler(
${declarations}
${attribute.expression ?
`[✂${attribute.expression.start}-${attribute.expression.end}✂];` :
`${block.alias('component')}.fire('${attribute.name}', event);`}
`${block.alias('component')}.fire("${attribute.name}", event);`}
`;
if (isCustomEvent) {
@ -100,11 +100,11 @@ export default function visitEventHandler(
}
block.builders.hydrate.addLine(
`@addListener( ${state.parentNode}, '${name}', ${handlerName} );`
`@addListener(${state.parentNode}, "${name}", ${handlerName});`
);
block.builders.destroy.addLine(
`@removeListener( ${state.parentNode}, '${name}', ${handlerName} );`
`@removeListener(${state.parentNode}, "${name}", ${handlerName});`
);
}
}

@ -60,7 +60,7 @@ export default function visitStyleAttribute(
block.builders.update.addConditional(
condition,
`@setStyle(${node.var}, '${prop.key}', ${value});`
`@setStyle(${node.var}, "${prop.key}", ${value});`
);
}
} else {
@ -68,7 +68,7 @@ export default function visitStyleAttribute(
}
block.builders.hydrate.addLine(
`@setStyle(${node.var}, '${prop.key}', ${value});`
`@setStyle(${node.var}, "${prop.key}", ${value});`
);
});
}

@ -26,14 +26,14 @@ export default function addTransitions(
#component._root._aftercreate.push(function() {
if (!${name}) ${name} = @wrapTransition(#component, ${node.var}, ${fn}, ${snippet}, true, null);
${name}.run(true, function() {
#component.fire( 'intro.end', { node: ${node.var} });
#component.fire("intro.end", { node: ${node.var} });
});
});
`);
block.builders.outro.addBlock(deindent`
${name}.run(false, function() {
#component.fire( 'outro.end', { node: ${node.var} });
#component.fire("outro.end", { node: ${node.var} });
if (--#outros === 0) #outrocallback();
${name} = null;
});
@ -61,7 +61,7 @@ export default function addTransitions(
#component._root._aftercreate.push(function() {
${introName} = @wrapTransition(#component, ${node.var}, ${fn}, ${snippet}, true, null);
${introName}.run(true, function() {
#component.fire( 'intro.end', { node: ${node.var} });
#component.fire("intro.end", { node: ${node.var} });
});
});
`);
@ -80,7 +80,7 @@ export default function addTransitions(
block.builders.outro.addBlock(deindent`
${outroName} = @wrapTransition(#component, ${node.var}, ${fn}, ${snippet}, false, null);
${outroName}.run(false, function() {
#component.fire( 'outro.end', { node: ${node.var} });
#component.fire("outro.end", { node: ${node.var} });
if (--#outros === 0) #outrocallback();
});
`);

@ -61,11 +61,11 @@ export default function visitWindow(
function ${handlerName}(event) {
${handlerBody}
};
window.addEventListener( '${attribute.name}', ${handlerName} );
window.addEventListener("${attribute.name}", ${handlerName});
`);
block.builders.destroy.addBlock(deindent`
window.removeEventListener( '${attribute.name}', ${handlerName} );
window.removeEventListener("${attribute.name}", ${handlerName});
`);
}
@ -125,11 +125,11 @@ export default function visitWindow(
function ${handlerName}(event) {
${handlerBody}
};
window.addEventListener( '${event}', ${handlerName} );
window.addEventListener("${event}", ${handlerName});
`);
block.builders.destroy.addBlock(deindent`
window.removeEventListener( '${event}', ${handlerName} );
window.removeEventListener("${event}", ${handlerName});
`);
});
@ -141,10 +141,10 @@ export default function visitWindow(
function ${observerCallback}() {
if (${lock}) return;
var x = ${bindings.scrollX
? `#component.get( '${bindings.scrollX}' )`
? `#component.get("${bindings.scrollX}")`
: `window.scrollX`};
var y = ${bindings.scrollY
? `#component.get( '${bindings.scrollY}' )`
? `#component.get("${bindings.scrollY}")`
: `window.scrollY`};
window.scrollTo(x, y);
};
@ -152,18 +152,17 @@ export default function visitWindow(
if (bindings.scrollX)
block.builders.init.addLine(
`#component.observe( '${bindings.scrollX}', ${observerCallback} );`
`#component.observe("${bindings.scrollX}", ${observerCallback});`
);
if (bindings.scrollY)
block.builders.init.addLine(
`#component.observe( '${bindings.scrollY}', ${observerCallback} );`
`#component.observe("${bindings.scrollY}", ${observerCallback});`
);
} else if (bindings.scrollX || bindings.scrollY) {
const isX = !!bindings.scrollX;
block.builders.init.addBlock(deindent`
#component.observe( '${bindings.scrollX ||
bindings.scrollY}', function ( ${isX ? 'x' : 'y'} ) {
#component.observe("${bindings.scrollX || bindings.scrollY}", function(${isX ? 'x' : 'y'}) {
if (${lock}) return;
window.scrollTo(${isX ? 'x, window.scrollY' : 'window.scrollX, y'});
});
@ -177,8 +176,8 @@ export default function visitWindow(
function ${handlerName}(event) {
#component.set({ ${bindings.online}: navigator.onLine });
};
window.addEventListener( 'online', ${handlerName} );
window.addEventListener( 'offline', ${handlerName} );
window.addEventListener("online", ${handlerName});
window.addEventListener("offline", ${handlerName});
`);
// add initial value
@ -187,8 +186,8 @@ export default function visitWindow(
);
block.builders.destroy.addBlock(deindent`
window.removeEventListener( 'online', ${handlerName} );
window.removeEventListener( 'offline', ${handlerName} );
window.removeEventListener("online", ${handlerName});
window.removeEventListener("offline", ${handlerName});
`);
}
}

@ -236,9 +236,7 @@ function compound(
generator.blocks.push(deindent`
function ${select_block_type}(${params}) {
${branches
.map(({ condition, block }) => {
return `${condition ? `if ( ${condition} ) ` : ''}return ${block};`;
})
.map(({ condition, block }) => `${condition ? `if (${condition}) ` : ''}return ${block};`)
.join('\n')}
}
`);
@ -329,11 +327,7 @@ function compoundWithOutros(
function ${select_block_type}(${params}) {
${branches
.map(({ condition, block }, i) => {
return `${condition ? `if ( ${condition} ) ` : ''}return ${block
? i
: -1};`;
})
.map(({ condition, block }, i) => `${condition ? `if (${condition}) ` : ''}return ${block ? i : -1};`)
.join('\n')}
}
`);

@ -34,13 +34,13 @@ export default function visitRawMustacheTag(
insert = content => `${state.parentNode}.innerHTML = ${content};`;
} else if (anchorBefore === 'null') {
detach = `@detachBefore(${anchorAfter});`;
insert = content => `${anchorAfter}.insertAdjacentHTML('beforebegin', ${content});`;
insert = content => `${anchorAfter}.insertAdjacentHTML("beforebegin", ${content});`;
} else if (anchorAfter === 'null') {
detach = `@detachAfter(${anchorBefore});`;
insert = content => `${anchorBefore}.insertAdjacentHTML('afterend', ${content});`;
insert = content => `${anchorBefore}.insertAdjacentHTML("afterend", ${content});`;
} else {
detach = `@detachBetween(${anchorBefore}, ${anchorAfter});`;
insert = content => `${anchorBefore}.insertAdjacentHTML('afterend', ${content});`;
insert = content => `${anchorBefore}.insertAdjacentHTML("afterend", ${content});`;
}
const { init } = visitTag(

@ -116,9 +116,7 @@ export default function ssr(
${computations.map(
({ key, deps }) =>
`state.${key} = @template.computed.${key}( ${deps
.map(dep => `state.${dep}`)
.join(', ')} );`
`state.${key} = @template.computed.${key}(${deps.map(dep => `state.${dep}`).join(', ')});`
)}
${generator.bindings.length &&
@ -163,9 +161,7 @@ export default function ssr(
${templateProperties.components.value.properties.map(prop => {
const { name } = prop.key;
const expression =
generator.importedComponents.get(name) ||
`@template.components.${name}`;
const expression = generator.importedComponents.get(name) || `@template.components.${name}`;
return `addComponent(${expression});`;
})}
`}

@ -10,11 +10,7 @@ export default function visitEachBlock(
) {
const { dependencies, snippet } = block.contextualise(node.expression);
const open = `\${ ${node.else
? `${snippet}.length ? `
: ''}${snippet}.map( ${node.index
? `( ${node.context}, ${node.index} )`
: node.context} => \``;
const open = `\${ ${node.else ? `${snippet}.length ? ` : ''}${snippet}.map(${node.index ? `(${node.context}, ${node.index})` : node.context} => \``;
generator.append(open);
// TODO should this be the generator's job? It's duplicated between
@ -38,7 +34,7 @@ export default function visitEachBlock(
visit(generator, childBlock, child);
});
const close = `\` ).join( '' )`;
const close = `\`).join("")`;
generator.append(close);
if (node.else) {

@ -1,4 +1,4 @@
import { Node } from '../../../../interfaces';
import { Node } from '../../interfaces';
export default function getStaticAttributeValue(node: Node, name: string) {
const attribute = node.attributes.find(

@ -11,8 +11,7 @@ export default function getGlobals(imports: Node[], options: CompileOptions) {
if (!name) {
if (x.name.startsWith('__import')) {
const error = new Error(
`Could not determine name for imported module '${x.source
.value}' use options.globals`
`Could not determine name for imported module '${x.source.value}' use options.globals`
);
if (onerror) {
onerror(error);
@ -21,8 +20,7 @@ export default function getGlobals(imports: Node[], options: CompileOptions) {
}
} else {
const warning = {
message: `No name was supplied for imported module '${x.source
.value}'. Guessing '${x.name}', but you should use options.globals`,
message: `No name was supplied for imported module '${x.source.value}'. Guessing '${x.name}', but you should use options.globals`,
};
if (onwarn) {

@ -27,7 +27,7 @@ function getAmdIntro(options: CompileOptions, imports: Node[]) {
const id = options.amd && options.amd.id;
return `define(${id
? ` '${id}', `
? `"${id}", `
: ''}${sourceString}function(${paramString(imports)}) { 'use strict';\n\n`;
}
@ -51,9 +51,7 @@ function getIifeIntro(options: CompileOptions, imports: Node[]) {
throw new Error(`Missing required 'name' option for IIFE export`);
}
return `var ${options.name} = (function (${paramString(
imports
)}) { 'use strict';\n\n`;
return `var ${options.name} = (function(${paramString(imports)}) { 'use strict';\n\n`;
}
function getUmdIntro(options: CompileOptions, imports: Node[]) {
@ -88,7 +86,7 @@ function getEvalIntro(options: CompileOptions, imports: Node[]) {
}
function paramString(imports: Node[]) {
return imports.length ? ` ${imports.map(dep => dep.name).join(', ')} ` : '';
return imports.map(dep => dep.name).join(', ');
}
function removeExtension(file: string) {

@ -184,11 +184,11 @@ var template = (function () {
}());
function encapsulateStyles(node) {
setAttribute( node, 'svelte-3590263702', '' );
setAttribute(node, "svelte-3590263702", "");
}
function add_css() {
var style = createElement( 'style' );
var style = createElement("style");
style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head);
@ -242,7 +242,7 @@ function SvelteComponent ( options ) {
this._yield = options._yield;
this._bind = options._bind;
if ( !document.getElementById( 'svelte-3590263702-style' ) ) add_css();
if (!document.getElementById("svelte-3590263702-style")) add_css();
this._fragment = create_main_fragment(this._state, this);

@ -9,11 +9,11 @@ var template = (function () {
}());
function encapsulateStyles(node) {
setAttribute( node, 'svelte-3590263702', '' );
setAttribute(node, "svelte-3590263702", "");
}
function add_css() {
var style = createElement( 'style' );
var style = createElement("style");
style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head);
@ -67,7 +67,7 @@ function SvelteComponent ( options ) {
this._yield = options._yield;
this._bind = options._bind;
if ( !document.getElementById( 'svelte-3590263702-style' ) ) add_css();
if (!document.getElementById("svelte-3590263702-style")) add_css();
this._fragment = create_main_fragment(this._state, this);

@ -172,11 +172,11 @@ var proto = {
};
function encapsulateStyles(node) {
setAttribute( node, 'svelte-2363328337', '' );
setAttribute(node, "svelte-2363328337", "");
}
function add_css() {
var style = createElement( 'style' );
var style = createElement("style");
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
@ -224,7 +224,7 @@ function SvelteComponent ( options ) {
this._yield = options._yield;
this._bind = options._bind;
if ( !document.getElementById( 'svelte-2363328337-style' ) ) add_css();
if (!document.getElementById("svelte-2363328337-style")) add_css();
this._fragment = create_main_fragment(this._state, this);

@ -1,11 +1,11 @@
import { appendNode, assign, createElement, detachNode, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function encapsulateStyles(node) {
setAttribute( node, 'svelte-2363328337', '' );
setAttribute(node, "svelte-2363328337", "");
}
function add_css() {
var style = createElement( 'style' );
var style = createElement("style");
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
@ -53,7 +53,7 @@ function SvelteComponent ( options ) {
this._yield = options._yield;
this._bind = options._bind;
if ( !document.getElementById( 'svelte-2363328337-style' ) ) add_css();
if (!document.getElementById("svelte-2363328337-style")) add_css();
this._fragment = create_main_fragment(this._state, this);

@ -247,7 +247,7 @@ class SvelteComponent extends HTMLElement {
}
}
customElements.define('custom-element', SvelteComponent);
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto , {
_mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);

@ -76,7 +76,7 @@ class SvelteComponent extends HTMLElement {
}
}
customElements.define('custom-element', SvelteComponent);
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto , {
_mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);

@ -192,7 +192,7 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setAttribute( slot_1, 'name', "foo" );
setAttribute(slot_1, "name", "foo");
},
mount: function(target, anchor) {
@ -263,7 +263,7 @@ class SvelteComponent extends HTMLElement {
}
}
customElements.define('custom-element', SvelteComponent);
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto , {
_mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);

@ -17,7 +17,7 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setAttribute( slot_1, 'name', "foo" );
setAttribute(slot_1, "name", "foo");
},
mount: function(target, anchor) {
@ -88,7 +88,7 @@ class SvelteComponent extends HTMLElement {
}
}
customElements.define('custom-element', SvelteComponent);
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto , {
_mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);

@ -248,7 +248,7 @@ class SvelteComponent extends HTMLElement {
}
}
customElements.define('custom-element', SvelteComponent);
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto , {
_mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);

@ -77,7 +77,7 @@ class SvelteComponent extends HTMLElement {
}
}
customElements.define('custom-element', SvelteComponent);
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto , {
_mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);

@ -293,7 +293,7 @@ function create_each_block ( state, each_block_value, comment, i, component ) {
appendNode(text_5, span);
appendNode(text_6, div);
appendNode(raw_before, div);
raw_before.insertAdjacentHTML('afterend', raw_value);
raw_before.insertAdjacentHTML("afterend", raw_value);
},
update: function(changed, state, each_block_value, comment, i) {
@ -307,7 +307,7 @@ function create_each_block ( state, each_block_value, comment, i, component ) {
if ( (changed.comments) && raw_value !== (raw_value = comment.html) ) {
detachAfter(raw_before);
raw_before.insertAdjacentHTML('afterend', raw_value);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},

@ -109,7 +109,7 @@ function create_each_block ( state, each_block_value, comment, i, component ) {
appendNode(text_5, span);
appendNode(text_6, div);
appendNode(raw_before, div);
raw_before.insertAdjacentHTML('afterend', raw_value);
raw_before.insertAdjacentHTML("afterend", raw_value);
},
update: function(changed, state, each_block_value, comment, i) {
@ -123,7 +123,7 @@ function create_each_block ( state, each_block_value, comment, i, component ) {
if ( (changed.comments) && raw_value !== (raw_value = comment.html) ) {
detachAfter(raw_before);
raw_before.insertAdjacentHTML('afterend', raw_value);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},

@ -177,8 +177,8 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setStyle(div, 'color', state.color);
setStyle(div, 'transform', "translate(" + state.x + "px," + state.y + "px)");
setStyle(div, "color", state.color);
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
},
mount: function(target, anchor) {
@ -187,11 +187,11 @@ function create_main_fragment ( state, component ) {
update: function(changed, state) {
if ( changed.color ) {
setStyle(div, 'color', state.color);
setStyle(div, "color", state.color);
}
if ( changed.x || changed.y ) {
setStyle(div, 'transform', "translate(" + state.x + "px," + state.y + "px)");
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
}
},

@ -10,8 +10,8 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setStyle(div, 'color', state.color);
setStyle(div, 'transform', "translate(" + state.x + "px," + state.y + "px)");
setStyle(div, "color", state.color);
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
},
mount: function(target, anchor) {
@ -20,11 +20,11 @@ function create_main_fragment ( state, component ) {
update: function(changed, state) {
if ( changed.color ) {
setStyle(div, 'color', state.color);
setStyle(div, "color", state.color);
}
if ( changed.x || changed.y ) {
setStyle(div, 'transform', "translate(" + state.x + "px," + state.y + "px)");
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
}
},

@ -177,7 +177,7 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setStyle(div, 'background', "url(data:image/png;base64," + state.data + ")");
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
},
mount: function(target, anchor) {
@ -186,7 +186,7 @@ function create_main_fragment ( state, component ) {
update: function(changed, state) {
if ( changed.data ) {
setStyle(div, 'background', "url(data:image/png;base64," + state.data + ")");
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
}
},

@ -10,7 +10,7 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setStyle(div, 'background', "url(data:image/png;base64," + state.data + ")");
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
},
mount: function(target, anchor) {
@ -19,7 +19,7 @@ function create_main_fragment ( state, component ) {
update: function(changed, state) {
if ( changed.data ) {
setStyle(div, 'background', "url(data:image/png;base64," + state.data + ")");
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
}
},

@ -177,7 +177,7 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setStyle(div, 'color', state.color);
setStyle(div, "color", state.color);
},
mount: function(target, anchor) {
@ -186,7 +186,7 @@ function create_main_fragment ( state, component ) {
update: function(changed, state) {
if ( changed.color ) {
setStyle(div, 'color', state.color);
setStyle(div, "color", state.color);
}
},

@ -10,7 +10,7 @@ function create_main_fragment ( state, component ) {
},
hydrate: function(nodes) {
setStyle(div, 'color', state.color);
setStyle(div, "color", state.color);
},
mount: function(target, anchor) {
@ -19,7 +19,7 @@ function create_main_fragment ( state, component ) {
update: function(changed, state) {
if ( changed.color ) {
setStyle(div, 'color', state.color);
setStyle(div, "color", state.color);
}
},

@ -180,7 +180,7 @@ function create_main_fragment ( state, component ) {
hydrate: function(nodes) {
div.style.cssText = state.style;
div_1.style.cssText = div_1_style_value = "" + ( state.key ) + ": " + ( state.value );
div_1.style.cssText = div_1_style_value = "" + state.key + ": " + state.value;
},
mount: function(target, anchor) {
@ -194,7 +194,7 @@ function create_main_fragment ( state, component ) {
div.style.cssText = state.style;
}
if ( ( changed.key || changed.value ) && div_1_style_value !== ( div_1_style_value = "" + ( state.key ) + ": " + ( state.value ) ) ) {
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;
}
},

@ -13,7 +13,7 @@ function create_main_fragment ( state, component ) {
hydrate: function(nodes) {
div.style.cssText = state.style;
div_1.style.cssText = div_1_style_value = "" + ( state.key ) + ": " + ( state.value );
div_1.style.cssText = div_1_style_value = "" + state.key + ": " + state.value;
},
mount: function(target, anchor) {
@ -27,7 +27,7 @@ function create_main_fragment ( state, component ) {
div.style.cssText = state.style;
}
if ( ( changed.key || changed.value ) && div_1_style_value !== ( div_1_style_value = "" + ( state.key ) + ": " + ( state.value ) ) ) {
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;
}
},

Loading…
Cancel
Save