fix(core): update

This commit is contained in:
2022-06-16 01:17:58 +02:00
parent d2c6131e7c
commit 29515b468e
4 changed files with 1208 additions and 277 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartntml',
version: '1.0.9',
version: '1.0.10',
description: 'lit-html for the backend'
}

View File

@ -1,6 +1,7 @@
import * as plugins from './smartntml.plugins.js';
import type * as litTypes from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
export type { TemplateResult } from 'lit';
export class Smartntml {
@ -24,7 +25,8 @@ export class Smartntml {
// INSTANCE
private render: typeof litTypes.render;
html: typeof litTypes.html;
public html: typeof litTypes.html;
public unsafeHTML: typeof unsafeHTML;
constructor() {
this.init();
@ -32,8 +34,10 @@ export class Smartntml {
public async init() {
const lit = await import('lit');
const litUnsafeHtmlDirective = await import('lit/directives/unsafe-html.js');
this.render = lit.render;
this.html = lit.html;
this.unsafeHTML = litUnsafeHtmlDirective.unsafeHTML;
}
public async renderTemplateResult(templateResult: litTypes.TemplateResult, stripCommentsArg = true) {