diff --git a/.eleventy.cjs b/.eleventy.cjs index 8fcb47d..5800279 100644 --- a/.eleventy.cjs +++ b/.eleventy.cjs @@ -1,17 +1,17 @@ -const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); +const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight'); -module.exports = function(eleventyConfig) { +module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(syntaxHighlight); eleventyConfig.addPassthroughCopy("docs-src/docs.css"); eleventyConfig.addPassthroughCopy("docs-src/.nojekyll"); return { dir: { - input: "docs-src", - output: "docs" + input: 'docs-src', + output: 'docs', }, templateExtensionAliases: { - "11ty.cjs": "11ty.js", - "11tydata.cjs": "11tydata.js" - } + '11ty.cjs': '11ty.js', + '11tydata.cjs': '11tydata.js', + }, }; }; diff --git a/.eslintrc.json b/.eslintrc.json index 7dbc806..7a9c364 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,17 +9,18 @@ "ecmaVersion": 2020, "sourceType": "module" }, - "plugins": [ - "@typescript-eslint" - ], + "plugins": ["@typescript-eslint"], "rules": { "no-unexpected-multiline": "off", "@typescript-eslint/indent": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-unused-vars": ["warn", { - "argsIgnorePattern": "^_" - }] + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_" + } + ] } } diff --git a/custom-elements.json b/custom-elements.json index 7c78250..a182afa 100644 --- a/custom-elements.json +++ b/custom-elements.json @@ -3,6 +3,7 @@ "tags": [ { "name": "my-element", + "path": "./src/my-element.ts", "description": "An example element.", "attributes": [ { diff --git a/docs/examples/index.html b/docs/examples/index.html index 6a24fce..5fa7252 100644 --- a/docs/examples/index.html +++ b/docs/examples/index.html @@ -53,9 +53,9 @@
This is child content
p {
border: solid 1px blue;
padding: 8px;
}
+ p {
border: solid 1px blue;
padding: 8px;
}
<my-element>
<p>This is child content</p>
</my-element>
+<my-element>
<p>This is child content</p>
</my-element>
diff --git a/docs/examples/name-property/index.html b/docs/examples/name-property/index.html
index 5c844fd..4970ead 100644
--- a/docs/examples/name-property/index.html
+++ b/docs/examples/name-property/index.html
@@ -45,7 +45,7 @@
<my-element name="Earth"></my-element>
+<my-element name="Earth"></my-element>
<my-element> is just an HTML element. You can it anywhere you can use HTML!
<my-element></my-element>
+<my-element></my-element>
<my-element> can be configured with attributed in plain HTML.
<my-element name="HTML"></my-element>
+<my-element name="HTML"></my-element>
<my-element> can be used with declarative rendering libraries like Angular, React, Vue, and lit-html
import {html, render} from 'lit-html';
const name="lit-html";
render(html`
<h2>This is a <my-element></h2>
<my-element .name=${name}></my-element>
`, document.body);
+import {html, render} from 'lit-html';
const name="lit-html";
render(html`
<h2>This is a <my-element></h2>
<my-element .name=${name}></my-element>
`, document.body);
<my-element> is distributed on npm, so you can install it locally or use it via npm CDNs like unpkg.com.
npm i my-element
+npm i my-element
npm CDNs like unpkg.com can directly serve files that have been published to npm. This works great for standard JavaScript modules that the browser can load natively.
For this element to work from unpkg.com specifically, you need to include the ?module query parameter, which tells unpkg.com to rewrite "bare" module specificers to full URLs.
<script type="module" src="https://unpkg.com/my-element?module"></script>
+<script type="module" src="https://unpkg.com/my-element?module"></script>
import {MyElement} from 'https://unpkg.com/my-element?module';
+import {MyElement} from 'https://unpkg.com/my-element?module';
0;){const s=f[d],i=l.exec(s)[2],e=i.toLowerCase()+"$lit$",o=t.getAttribute(e);t.removeAttribute(e);const r=o.split(n);this.parts.push({type:"attribute",index:a,name:i,strings:r}),d+=r.length-1}}"TEMPLATE"===t.tagName&&(o.push(t),h.currentNode=t.content)}else if(3===t.nodeType){const s=t.data;if(s.indexOf(i)>=0){const i=t.parentNode,o=s.split(n),h=o.length-1;for(let s=0;sHello, ${this.name}!
Hello, World!
Hello, Test!
Hello, World!