Refactors custom components to enable shared state accessors (like `authState`) and helpers (like `api.fetch`.) Schemas are now defined with [zod](https://zod.dev/?id=basic-usage) which enables runtime schema validation. See subtasks for full description of change: - https://github.com/webrecorder/browsertrix/pull/1979 - https://github.com/webrecorder/browsertrix/pull/1981 - https://github.com/webrecorder/browsertrix/pull/1985 - https://github.com/webrecorder/browsertrix/pull/1986 --------- Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
23 lines
592 B
Plaintext
23 lines
592 B
Plaintext
{
|
|
"Btrix Component": {
|
|
"scope": "javascript,typescript",
|
|
"prefix": ["component", "@customElement"],
|
|
"body": [
|
|
"import { localized } from \"@lit/localize\";",
|
|
"import { html } from \"lit\";",
|
|
"import { customElement } from \"lit/decorators.js\";",
|
|
"",
|
|
"import { BtrixElement } from \"@/classes/BtrixElement\";",
|
|
"",
|
|
"@localized()",
|
|
"@customElement(\"btrix-${1:component}\")",
|
|
"export class ${2:Component} extends BtrixElement {",
|
|
"\trender() {",
|
|
"\t\treturn html``;",
|
|
"\t}",
|
|
"}",
|
|
""
|
|
]
|
|
}
|
|
}
|