@ -208,29 +208,36 @@ export default function dom(
this . _fragment = @create_main_fragment ( this . _state , this ) ;
this . _fragment = @create_main_fragment ( this . _state , this ) ;
if ( options . target ) {
$ { generator . customElement ? deindent `
$ { generator . hydratable
this . _fragment . create ( ) ;
? deindent `
this . _fragment . $ { block . hasIntroMethod ? 'intro' : 'mount' } ( this . shadowRoot , null ) ;
var nodes = @children ( options . target ) ;
options . hydrate ? this . _fragment . claim ( nodes ) : this . _fragment . create ( ) ;
if ( options . target ) this . _mount ( options . target , options . anchor || null ) ;
nodes . forEach ( @detachNode ) ;
` : deindent `
` :
if ( options . target ) {
deindent `
$ { generator . hydratable
$ { options . dev && ` if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \` hydratable: true \` option"); ` }
? deindent `
this . _fragment . create ( ) ;
var nodes = @children ( options . target ) ;
options . hydrate ? this . _fragment . claim ( nodes ) : this . _fragment . create ( ) ;
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"); ` }
this . _fragment . create ( ) ;
` }
this . _fragment . $ { block . hasIntroMethod ? 'intro' : 'mount' } ( options . target , options . anchor || null ) ;
$ { ( generator . hasComponents || generator . hasComplexBindings || templateProperties . oncreate || generator . hasIntroTransitions ) && deindent `
$ { generator . hasComponents && ` this._lock = true; ` }
$ { ( generator . hasComponents || generator . hasComplexBindings ) && ` @callAll(this._beforecreate); ` }
$ { ( generator . hasComponents || templateProperties . oncreate ) && ` @callAll(this._oncreate); ` }
$ { ( generator . hasComponents || generator . hasIntroTransitions ) && ` @callAll(this._aftercreate); ` }
$ { generator . hasComponents && ` this._lock = false; ` }
` }
` }
$ { generator . customElement ?
}
` this._mount(options.target, options.anchor || null); ` :
` }
` this._fragment. ${ block . hasIntroMethod ? 'intro' : 'mount' } (options.target, options.anchor || null); ` }
$ { ( generator . hasComponents || generator . hasComplexBindings || templateProperties . oncreate || generator . hasIntroTransitions ) && deindent `
$ { generator . hasComponents && ` this._lock = true; ` }
$ { ( generator . hasComponents || generator . hasComplexBindings ) && ` @callAll(this._beforecreate); ` }
$ { ( generator . hasComponents || templateProperties . oncreate ) && ` @callAll(this._oncreate); ` }
$ { ( generator . hasComponents || generator . hasIntroTransitions ) && ` @callAll(this._aftercreate); ` }
$ { generator . hasComponents && ` this._lock = false; ` }
` }
}
` ;
` ;
if ( generator . customElement ) {
if ( generator . customElement ) {
@ -272,7 +279,6 @@ export default function dom(
customElements . define ( "${generator.tag}" , $ { name } ) ;
customElements . define ( "${generator.tag}" , $ { name } ) ;
@assign ( $ { prototypeBase } , $ { proto } , {
@assign ( $ { prototypeBase } , $ { proto } , {
_mount ( target , anchor ) {
_mount ( target , anchor ) {
this . _fragment . $ { block . hasIntroMethod ? 'intro' : 'mount' } ( this . shadowRoot , null ) ;
target . insertBefore ( this , anchor ) ;
target . insertBefore ( this , anchor ) ;
} ,
} ,