2022-12-08 13:03:51 +01:00
|
|
|
{
|
|
|
|
|
"Create Lit Component": {
|
|
|
|
|
"prefix": "lit new",
|
|
|
|
|
"scope": "typescript",
|
|
|
|
|
"body": [
|
2023-09-05 16:16:04 +02:00
|
|
|
"import { UmbTextStyles } from '@umbraco-ui/backoffice/style';",
|
2023-04-25 20:56:34 +12:00
|
|
|
"import { css, html } from 'lit';",
|
2022-12-08 13:03:51 +01:00
|
|
|
"import { customElement } from 'lit/decorators.js';",
|
2023-04-25 20:56:34 +12:00
|
|
|
"import { UmbLitElement } from '@umbraco-cms/internal/lit-element';",
|
2022-12-08 13:03:51 +01:00
|
|
|
"",
|
|
|
|
|
"@customElement('umb-${TM_FILENAME_BASE/(.*)\\..+$/$1/}')",
|
2023-04-25 20:56:34 +12:00
|
|
|
"export class Umb${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element extends UmbLitElement {",
|
2022-12-08 13:03:51 +01:00
|
|
|
"\trender() {",
|
|
|
|
|
"\t\treturn html`${0:umb-${TM_FILENAME_BASE/(.*)\\..+$/$1/}}`;",
|
|
|
|
|
"\t}",
|
2023-04-25 20:56:34 +12:00
|
|
|
"",
|
2023-09-05 16:16:04 +02:00
|
|
|
"\tstatic styles = [UmbTextStyles, css``];",
|
2022-12-08 13:03:51 +01:00
|
|
|
"}",
|
|
|
|
|
"",
|
2023-04-25 20:56:34 +12:00
|
|
|
"export default Umb${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element",
|
|
|
|
|
"",
|
2022-12-08 13:03:51 +01:00
|
|
|
"declare global {",
|
|
|
|
|
"\tinterface HTMLElementTagNameMap {",
|
|
|
|
|
"\t\t'umb-${TM_FILENAME_BASE/(.*)\\..+$/$1/}': Umb${TM_FILENAME_BASE/(.*)\\..+$/${1:/pascalcase}/}Element;",
|
|
|
|
|
"\t}",
|
|
|
|
|
"}"
|
|
|
|
|
],
|
|
|
|
|
"description": "Create a new Lit Component"
|
|
|
|
|
}
|
|
|
|
|
}
|