@astrojs/language-server 0.13.3 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/core/documents/utils.d.ts +1 -0
- package/dist/core/documents/utils.js +2 -0
- package/dist/plugins/astro/AstroPlugin.d.ts +1 -1
- package/dist/plugins/astro/AstroPlugin.js +1 -1
- package/dist/plugins/astro/features/CompletionsProvider.d.ts +2 -2
- package/dist/plugins/astro/features/CompletionsProvider.js +4 -5
- package/dist/plugins/css/CSSPlugin.js +9 -1
- package/dist/plugins/css/features/astro-selectors.js +1 -2
- package/dist/plugins/html/features/astro-attributes.js +56 -1
- package/dist/plugins/html/utils.d.ts +1 -1
- package/dist/plugins/html/utils.js +1 -1
- package/dist/plugins/typescript/TypeScriptPlugin.js +3 -0
- package/dist/plugins/typescript/features/DocumentSymbolsProvider.js +6 -3
- package/dist/plugins/typescript/features/SemanticTokenProvider.js +4 -1
- package/dist/plugins/typescript/language-service.js +1 -1
- package/dist/plugins/typescript/snapshots/SnapshotManager.js +2 -1
- package/package.json +2 -2
- package/types/astro-jsx.d.ts +112 -113
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,7 @@ export interface TagInformation {
|
|
|
11
11
|
start: number;
|
|
12
12
|
end: number;
|
|
13
13
|
};
|
|
14
|
+
closed: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare function walk(node: Node): Generator<Node, void, unknown>;
|
|
16
17
|
export declare function extractStyleTags(source: string, html?: HTMLDocument): TagInformation[];
|
|
@@ -9,7 +9,7 @@ export declare class AstroPlugin implements Plugin {
|
|
|
9
9
|
private readonly completionProvider;
|
|
10
10
|
constructor(docManager: DocumentManager, configManager: ConfigManager, workspaceUris: string[]);
|
|
11
11
|
getCompletions(document: AstroDocument, position: Position, completionContext?: CompletionContext): Promise<AppCompletionList | null>;
|
|
12
|
-
getFoldingRanges(document: AstroDocument):
|
|
12
|
+
getFoldingRanges(document: AstroDocument): FoldingRange[];
|
|
13
13
|
getDefinitions(document: AstroDocument, position: Position): Promise<DefinitionLink[]>;
|
|
14
14
|
private isInsideFrontmatter;
|
|
15
15
|
private isComponentTag;
|
|
@@ -22,7 +22,7 @@ class AstroPlugin {
|
|
|
22
22
|
const completions = this.completionProvider.getCompletions(document, position, completionContext);
|
|
23
23
|
return completions;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
getFoldingRanges(document) {
|
|
26
26
|
const foldingRanges = [];
|
|
27
27
|
const { frontmatter } = document.astroMeta;
|
|
28
28
|
// Currently editing frontmatter, don't fold
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AppCompletionList } from '../../interfaces';
|
|
1
|
+
import type { AppCompletionList, CompletionsProvider } from '../../interfaces';
|
|
2
2
|
import type { AstroDocument, DocumentManager } from '../../../core/documents';
|
|
3
3
|
import { CompletionContext, Position } from 'vscode-languageserver';
|
|
4
4
|
import { LanguageServiceManager as TypeScriptLanguageServiceManager } from '../../typescript/LanguageServiceManager';
|
|
5
|
-
export declare class CompletionsProviderImpl {
|
|
5
|
+
export declare class CompletionsProviderImpl implements CompletionsProvider {
|
|
6
6
|
private readonly docManager;
|
|
7
7
|
private readonly languageServiceManager;
|
|
8
8
|
directivesHTMLLang: import("vscode-html-languageservice").LanguageService;
|
|
@@ -31,19 +31,18 @@ class CompletionsProviderImpl {
|
|
|
31
31
|
if (frontmatter)
|
|
32
32
|
items.push(frontmatter);
|
|
33
33
|
}
|
|
34
|
+
const html = document.html;
|
|
34
35
|
const offset = document.offsetAt(position);
|
|
35
|
-
if (
|
|
36
|
+
if ((0, utils_1.isInComponentStartTag)(html, offset)) {
|
|
36
37
|
const props = await this.getPropCompletions(document, position, completionContext);
|
|
37
38
|
if (props.length) {
|
|
38
39
|
items.push(...props);
|
|
39
40
|
}
|
|
40
|
-
}
|
|
41
|
-
const html = document.html;
|
|
42
|
-
if ((0, utils_1.isInComponentStartTag)(html, offset)) {
|
|
43
41
|
const node = html.findNodeAt(offset);
|
|
44
42
|
const isAstro = await this.isAstroComponent(document, node);
|
|
45
43
|
if (!isAstro) {
|
|
46
|
-
|
|
44
|
+
const directives = (0, utils_4.removeDataAttrCompletion)(this.directivesHTMLLang.doComplete(document, position, html).items);
|
|
45
|
+
items.push(...directives);
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
return vscode_languageserver_1.CompletionList.create(items, true);
|
|
@@ -25,6 +25,12 @@ class CSSPlugin {
|
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
const styleTag = this.getStyleTagForPosition(document, position);
|
|
28
|
+
// We technically can return results even for open tags, however, a lot of the info returned is not valid
|
|
29
|
+
// Since most editors will automatically close the tag before the user start working in them, this shouldn't be a problem
|
|
30
|
+
if (styleTag && !styleTag.closed) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
// If we don't have a style tag at this position, we might be in a style property instead, let's check
|
|
28
34
|
if (!styleTag) {
|
|
29
35
|
const attributeContext = (0, parseHtml_1.getAttributeContextAtPosition)(document, position);
|
|
30
36
|
if (!attributeContext) {
|
|
@@ -61,7 +67,9 @@ class CSSPlugin {
|
|
|
61
67
|
return null;
|
|
62
68
|
}
|
|
63
69
|
const styleTag = this.getStyleTagForPosition(document, position);
|
|
64
|
-
|
|
70
|
+
if (styleTag && !styleTag.closed) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
65
73
|
if (!styleTag) {
|
|
66
74
|
const attributeContext = (0, parseHtml_1.getAttributeContextAtPosition)(document, position);
|
|
67
75
|
if (!attributeContext) {
|
|
@@ -4,8 +4,7 @@ exports.pseudoClass = void 0;
|
|
|
4
4
|
exports.pseudoClass = [
|
|
5
5
|
{
|
|
6
6
|
name: ':global()',
|
|
7
|
-
description:
|
|
8
|
-
Apply styles to a selector globally`,
|
|
7
|
+
description: 'Apply styles to a selector globally',
|
|
9
8
|
references: [
|
|
10
9
|
{
|
|
11
10
|
name: 'Astro documentation',
|
|
@@ -43,7 +43,7 @@ exports.astroAttributes = (0, vscode_html_languageservice_1.newHTMLDataProvider)
|
|
|
43
43
|
// The VS Code tag definitions does not provide a description for the deprecated `charset` attribute on script tags
|
|
44
44
|
// Which mean that since we get no hover info for this, we instead get JSX hover info. So we'll just specify a description ourselves for this specific case
|
|
45
45
|
name: 'charset',
|
|
46
|
-
description: "
|
|
46
|
+
description: "**Deprecated**\n\nIt's unnecessary to specify the charset attribute, because documents must use UTF-8, and the script element inherits its character encoding from the document.",
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
name: 'define:vars',
|
|
@@ -55,6 +55,28 @@ exports.astroAttributes = (0, vscode_html_languageservice_1.newHTMLDataProvider)
|
|
|
55
55
|
},
|
|
56
56
|
],
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
name: 'hoist',
|
|
60
|
+
description: '**Deprecated in Astro >= 0.26.0**\n\nBuilds, optimizes, and bundles your script with the other JavaScript on the page',
|
|
61
|
+
valueSet: 'v',
|
|
62
|
+
references: [
|
|
63
|
+
{
|
|
64
|
+
name: 'Astro documentation',
|
|
65
|
+
url: 'https://docs.astro.build/en/core-concepts/astro-components/#using-hoisted-scripts',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'is:inline',
|
|
71
|
+
description: 'Leave a script tag inline in the page template. No processing will be done on its content',
|
|
72
|
+
valueSet: 'v',
|
|
73
|
+
references: [
|
|
74
|
+
{
|
|
75
|
+
name: 'Astro documentation',
|
|
76
|
+
url: 'https://docs.astro.build/en/migrate/#new-default-script-behavior',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
58
80
|
],
|
|
59
81
|
},
|
|
60
82
|
{
|
|
@@ -70,6 +92,39 @@ exports.astroAttributes = (0, vscode_html_languageservice_1.newHTMLDataProvider)
|
|
|
70
92
|
},
|
|
71
93
|
],
|
|
72
94
|
},
|
|
95
|
+
{
|
|
96
|
+
name: 'global',
|
|
97
|
+
description: '**Deprecated in favor of `is:global` in >= Astro 0.26.0**\n\nOpts-out of automatic CSS scoping, all contents will be available globally',
|
|
98
|
+
valueSet: 'v',
|
|
99
|
+
references: [
|
|
100
|
+
{
|
|
101
|
+
name: 'Astro documentation',
|
|
102
|
+
url: 'https://docs.astro.build/en/guides/styling/#global-styles',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'is:global',
|
|
108
|
+
description: 'Opts-out of automatic CSS scoping, all contents will be available globally',
|
|
109
|
+
valueSet: 'v',
|
|
110
|
+
references: [
|
|
111
|
+
{
|
|
112
|
+
name: 'Astro documentation',
|
|
113
|
+
url: 'https://docs.astro.build/en/guides/styling/#global-styles',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'is:inline',
|
|
119
|
+
description: 'Leave a style tag inline in the page template. No processing will be done on its content',
|
|
120
|
+
valueSet: 'v',
|
|
121
|
+
references: [
|
|
122
|
+
{
|
|
123
|
+
name: 'Astro documentation',
|
|
124
|
+
url: 'https://docs.astro.build/en/migrate/#new-default-script-behavior',
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
73
128
|
],
|
|
74
129
|
},
|
|
75
130
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CompletionItem } from 'vscode-languageserver-types';
|
|
2
2
|
/**
|
|
3
3
|
* The VS Code HTML language service provides a completion for data attributes that is independent from
|
|
4
|
-
* data providers, which mean that you can't disable it, so this function removes them from
|
|
4
|
+
* data providers, which mean that you can't disable it, so this function removes them from completions
|
|
5
5
|
*/
|
|
6
6
|
export declare function removeDataAttrCompletion(items: CompletionItem[]): CompletionItem[];
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.removeDataAttrCompletion = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* The VS Code HTML language service provides a completion for data attributes that is independent from
|
|
6
|
-
* data providers, which mean that you can't disable it, so this function removes them from
|
|
6
|
+
* data providers, which mean that you can't disable it, so this function removes them from completions
|
|
7
7
|
*/
|
|
8
8
|
function removeDataAttrCompletion(items) {
|
|
9
9
|
return items.filter((item) => !item.label.startsWith('data-'));
|
|
@@ -79,6 +79,9 @@ class TypeScriptPlugin {
|
|
|
79
79
|
return edit;
|
|
80
80
|
}
|
|
81
81
|
async getSemanticTokens(textDocument, range, cancellationToken) {
|
|
82
|
+
if (!this.featureEnabled('semanticTokens')) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
82
85
|
return this.semanticTokensProvider.getSemanticTokens(textDocument, range, cancellationToken);
|
|
83
86
|
}
|
|
84
87
|
async getDocumentSymbols(document) {
|
|
@@ -20,17 +20,20 @@ class DocumentSymbolsProviderImpl {
|
|
|
20
20
|
}
|
|
21
21
|
const symbols = [];
|
|
22
22
|
this.collectSymbols(navTree, fragment, undefined, (symbol) => symbols.push(symbol));
|
|
23
|
+
const originalContainerName = symbols[0].name;
|
|
23
24
|
const result = [];
|
|
24
25
|
// Add a "Frontmatter" namespace for the frontmatter if we have a closed one
|
|
25
26
|
if (document.astroMeta.frontmatter.state === 'closed') {
|
|
26
|
-
result.push(vscode_languageserver_types_1.SymbolInformation.create('Frontmatter', vscode_languageserver_types_1.SymbolKind.Namespace, vscode_languageserver_types_1.Range.create(document.positionAt(document.astroMeta.frontmatter.startOffset), document.positionAt(document.astroMeta.frontmatter.endOffset))));
|
|
27
|
+
result.push(vscode_languageserver_types_1.SymbolInformation.create('Frontmatter', vscode_languageserver_types_1.SymbolKind.Namespace, vscode_languageserver_types_1.Range.create(document.positionAt(document.astroMeta.frontmatter.startOffset), document.positionAt(document.astroMeta.frontmatter.endOffset)), document.getURL()));
|
|
27
28
|
}
|
|
28
29
|
// Add a "Template" namespace for everything under the frontmatter
|
|
29
|
-
result.push(vscode_languageserver_types_1.SymbolInformation.create('Template', vscode_languageserver_types_1.SymbolKind.Namespace, vscode_languageserver_types_1.Range.create(document.positionAt((_a = document.astroMeta.frontmatter.endOffset) !== null && _a !== void 0 ? _a : 0), document.positionAt(document.getTextLength()))));
|
|
30
|
+
result.push(vscode_languageserver_types_1.SymbolInformation.create('Template', vscode_languageserver_types_1.SymbolKind.Namespace, vscode_languageserver_types_1.Range.create(document.positionAt((_a = document.astroMeta.frontmatter.endOffset) !== null && _a !== void 0 ? _a : 0), document.positionAt(document.getTextLength())), document.getURL()));
|
|
30
31
|
for (let symbol of symbols.splice(1)) {
|
|
31
32
|
symbol = (0, documents_1.mapSymbolInformationToOriginal)(fragment, symbol);
|
|
32
33
|
if (document.offsetAt(symbol.location.range.end) >= ((_b = document.astroMeta.content.firstNonWhitespaceOffset) !== null && _b !== void 0 ? _b : 0)) {
|
|
33
|
-
symbol.containerName
|
|
34
|
+
if (symbol.containerName === originalContainerName) {
|
|
35
|
+
symbol.containerName = 'Template';
|
|
36
|
+
}
|
|
34
37
|
// For some reason, it seems like TypeScript thinks that the "class" attribute is a real class, weird
|
|
35
38
|
if (symbol.kind === vscode_languageserver_types_1.SymbolKind.Class && symbol.name === '<class>') {
|
|
36
39
|
const node = document.html.findNodeAt(document.offsetAt(symbol.location.range.start));
|
|
@@ -22,7 +22,10 @@ class SemanticTokensProviderImpl {
|
|
|
22
22
|
const start = range ? fragment.offsetAt(fragment.getGeneratedPosition(range.start)) : 0;
|
|
23
23
|
const { spans } = lang.getEncodedSemanticClassifications(filePath, {
|
|
24
24
|
start,
|
|
25
|
-
length: range
|
|
25
|
+
length: range
|
|
26
|
+
? fragment.offsetAt(fragment.getGeneratedPosition(range.end)) - start
|
|
27
|
+
: // We don't want tokens for things added by astro2tsx
|
|
28
|
+
fragment.text.lastIndexOf('export default function (_props:') || fragment.text.length,
|
|
26
29
|
}, typescript_1.default.SemanticClassificationFormat.TwentyTwenty);
|
|
27
30
|
const tokens = [];
|
|
28
31
|
let i = 0;
|
|
@@ -64,7 +64,7 @@ async function getLanguageServiceForTsconfig(tsconfigPath, docContext) {
|
|
|
64
64
|
}
|
|
65
65
|
exports.getLanguageServiceForTsconfig = getLanguageServiceForTsconfig;
|
|
66
66
|
async function createLanguageService(tsconfigPath, docContext) {
|
|
67
|
-
const workspaceRoot = tsconfigPath ? (0, path_1.dirname)(tsconfigPath) :
|
|
67
|
+
const workspaceRoot = tsconfigPath ? (0, path_1.dirname)(tsconfigPath) : '';
|
|
68
68
|
// `raw` here represent the tsconfig merged with any extended config
|
|
69
69
|
const { compilerOptions, fileNames: files, raw: fullConfig } = getParsedTSConfig();
|
|
70
70
|
let projectVersion = 0;
|
|
@@ -185,7 +185,8 @@ class SnapshotManager {
|
|
|
185
185
|
if (date.getTime() - this.lastLogged.getTime() > 60000) {
|
|
186
186
|
this.lastLogged = date;
|
|
187
187
|
const projectFiles = this.getProjectFileNames();
|
|
188
|
-
|
|
188
|
+
let allFiles = Array.from(new Set([...projectFiles, ...this.getFileNames()]));
|
|
189
|
+
allFiles = allFiles.map((file) => (0, utils_2.ensureRealFilePath)(file));
|
|
189
190
|
console.log('SnapshotManager File Statistics:\n' +
|
|
190
191
|
`Project files: ${projectFiles.length}\n` +
|
|
191
192
|
`Astro files: ${allFiles.filter((name) => name.endsWith('.astro')).length}\n` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/language-server",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"author": "withastro",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsc",
|
|
18
18
|
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
19
|
-
"test": "cross-env TS_NODE_TRANSPILE_ONLY=true mocha --require ts-node/register \"test/**/*.ts\" --exclude \"test/**/*.d.ts\""
|
|
19
|
+
"test": "cross-env TS_NODE_TRANSPILE_ONLY=true mocha --timeout 20000 --require ts-node/register \"test/**/*.ts\" --exclude \"test/**/*.d.ts\""
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@astrojs/svelte-language-integration": "^0.1.2",
|
package/types/astro-jsx.d.ts
CHANGED
|
@@ -43,6 +43,19 @@ declare namespace astroHTML.JSX {
|
|
|
43
43
|
'define:vars'?: any;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// Usable exclusively on style tags
|
|
47
|
+
interface AstroStyle {
|
|
48
|
+
global?: boolean;
|
|
49
|
+
'is:global'?: boolean;
|
|
50
|
+
'is:inline'?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Usable exclusively on script tags
|
|
54
|
+
interface AstroScript {
|
|
55
|
+
hoist?: boolean;
|
|
56
|
+
'is:inline'?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
type Element = HTMLElement;
|
|
47
60
|
|
|
48
61
|
//
|
|
@@ -68,155 +81,141 @@ declare namespace astroHTML.JSX {
|
|
|
68
81
|
type TransitionEventHandler<T extends EventTarget> = EventHandler<TransitionEvent, T>;
|
|
69
82
|
type MessageEventHandler<T extends EventTarget> = EventHandler<MessageEvent, T>;
|
|
70
83
|
|
|
71
|
-
// See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords
|
|
72
|
-
// See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords
|
|
73
|
-
// "all CSS properties can accept these values"
|
|
74
|
-
type CSSWideKeyword = 'initial' | 'inherit' | 'unset';
|
|
75
|
-
|
|
76
|
-
// See CSS 3 <percentage> type https://drafts.csswg.org/css-values-3/#percentages
|
|
77
|
-
type CSSPercentage = string;
|
|
78
|
-
|
|
79
|
-
// See CSS 3 <length> type https://drafts.csswg.org/css-values-3/#lengths
|
|
80
|
-
type CSSLength = number | string;
|
|
81
|
-
|
|
82
|
-
// This interface is not complete. Only properties accepting
|
|
83
|
-
// unit-less numbers are listed here (see CSSProperty.js in React)
|
|
84
|
-
|
|
85
84
|
interface DOMAttributes<T extends EventTarget> {
|
|
86
85
|
children?: Children;
|
|
87
86
|
|
|
88
87
|
// Clipboard Events
|
|
89
|
-
oncopy?: ClipboardEventHandler<T> | undefined | null;
|
|
90
|
-
oncut?: ClipboardEventHandler<T> | undefined | null;
|
|
91
|
-
onpaste?: ClipboardEventHandler<T> | undefined | null;
|
|
88
|
+
oncopy?: ClipboardEventHandler<T> | string | undefined | null;
|
|
89
|
+
oncut?: ClipboardEventHandler<T> | string | undefined | null;
|
|
90
|
+
onpaste?: ClipboardEventHandler<T> | string | undefined | null;
|
|
92
91
|
|
|
93
92
|
// Composition Events
|
|
94
|
-
oncompositionend?: CompositionEventHandler<T> | undefined | null;
|
|
95
|
-
oncompositionstart?: CompositionEventHandler<T> | undefined | null;
|
|
96
|
-
oncompositionupdate?: CompositionEventHandler<T> | undefined | null;
|
|
93
|
+
oncompositionend?: CompositionEventHandler<T> | string | undefined | null;
|
|
94
|
+
oncompositionstart?: CompositionEventHandler<T> | string | undefined | null;
|
|
95
|
+
oncompositionupdate?: CompositionEventHandler<T> | string | undefined | null;
|
|
97
96
|
|
|
98
97
|
// Focus Events
|
|
99
|
-
onfocus?: FocusEventHandler<T> | undefined | null;
|
|
100
|
-
onfocusin?: FocusEventHandler<T> | undefined | null;
|
|
101
|
-
onfocusout?: FocusEventHandler<T> | undefined | null;
|
|
102
|
-
onblur?: FocusEventHandler<T> | undefined | null;
|
|
98
|
+
onfocus?: FocusEventHandler<T> | string | undefined | null;
|
|
99
|
+
onfocusin?: FocusEventHandler<T> | string | undefined | null;
|
|
100
|
+
onfocusout?: FocusEventHandler<T> | string | undefined | null;
|
|
101
|
+
onblur?: FocusEventHandler<T> | string | undefined | null;
|
|
103
102
|
|
|
104
103
|
// Form Events
|
|
105
|
-
onchange?: FormEventHandler<T> | undefined | null;
|
|
106
|
-
oninput?: FormEventHandler<T> | undefined | null;
|
|
107
|
-
onreset?: FormEventHandler<T> | undefined | null;
|
|
108
|
-
onsubmit?: EventHandler<SubmitEvent, T> | undefined | null;
|
|
109
|
-
oninvalid?: EventHandler<Event, T> | undefined | null;
|
|
110
|
-
onbeforeinput?: EventHandler<InputEvent, T> | undefined | null;
|
|
104
|
+
onchange?: FormEventHandler<T> | string | undefined | null;
|
|
105
|
+
oninput?: FormEventHandler<T> | string | undefined | null;
|
|
106
|
+
onreset?: FormEventHandler<T> | string | undefined | null;
|
|
107
|
+
onsubmit?: EventHandler<SubmitEvent, T> | string | undefined | null;
|
|
108
|
+
oninvalid?: EventHandler<Event, T> | string | undefined | null;
|
|
109
|
+
onbeforeinput?: EventHandler<InputEvent, T> | string | undefined | null;
|
|
111
110
|
|
|
112
111
|
// Image Events
|
|
113
|
-
onload?: EventHandler | undefined | null;
|
|
114
|
-
onerror?: EventHandler | undefined | null; // also a Media Event
|
|
112
|
+
onload?: EventHandler | string | undefined | null;
|
|
113
|
+
onerror?: EventHandler | string | undefined | null; // also a Media Event
|
|
115
114
|
|
|
116
115
|
// Detail Events
|
|
117
|
-
ontoggle?: EventHandler<Event, T> | undefined | null;
|
|
116
|
+
ontoggle?: EventHandler<Event, T> | string | undefined | null;
|
|
118
117
|
|
|
119
118
|
// Keyboard Events
|
|
120
|
-
onkeydown?: KeyboardEventHandler<T> | undefined | null;
|
|
121
|
-
onkeypress?: KeyboardEventHandler<T> | undefined | null;
|
|
122
|
-
onkeyup?: KeyboardEventHandler<T> | undefined | null;
|
|
119
|
+
onkeydown?: KeyboardEventHandler<T> | string | undefined | null;
|
|
120
|
+
onkeypress?: KeyboardEventHandler<T> | string | undefined | null;
|
|
121
|
+
onkeyup?: KeyboardEventHandler<T> | string | undefined | null;
|
|
123
122
|
|
|
124
123
|
// Media Events
|
|
125
|
-
onabort?: EventHandler<Event, T> | undefined | null;
|
|
126
|
-
oncanplay?: EventHandler<Event, T> | undefined | null;
|
|
127
|
-
oncanplaythrough?: EventHandler<Event, T> | undefined | null;
|
|
128
|
-
oncuechange?: EventHandler<Event, T> | undefined | null;
|
|
129
|
-
ondurationchange?: EventHandler<Event, T> | undefined | null;
|
|
130
|
-
onemptied?: EventHandler<Event, T> | undefined | null;
|
|
131
|
-
onencrypted?: EventHandler<Event, T> | undefined | null;
|
|
132
|
-
onended?: EventHandler<Event, T> | undefined | null;
|
|
133
|
-
onloadeddata?: EventHandler<Event, T> | undefined | null;
|
|
134
|
-
onloadedmetadata?: EventHandler<Event, T> | undefined | null;
|
|
135
|
-
onloadstart?: EventHandler<Event, T> | undefined | null;
|
|
136
|
-
onpause?: EventHandler<Event, T> | undefined | null;
|
|
137
|
-
onplay?: EventHandler<Event, T> | undefined | null;
|
|
138
|
-
onplaying?: EventHandler<Event, T> | undefined | null;
|
|
139
|
-
onprogress?: EventHandler<Event, T> | undefined | null;
|
|
140
|
-
onratechange?: EventHandler<Event, T> | undefined | null;
|
|
141
|
-
onseeked?: EventHandler<Event, T> | undefined | null;
|
|
142
|
-
onseeking?: EventHandler<Event, T> | undefined | null;
|
|
143
|
-
onstalled?: EventHandler<Event, T> | undefined | null;
|
|
144
|
-
onsuspend?: EventHandler<Event, T> | undefined | null;
|
|
145
|
-
ontimeupdate?: EventHandler<Event, T> | undefined | null;
|
|
146
|
-
onvolumechange?: EventHandler<Event, T> | undefined | null;
|
|
147
|
-
onwaiting?: EventHandler<Event, T> | undefined | null;
|
|
124
|
+
onabort?: EventHandler<Event, T> | string | undefined | null;
|
|
125
|
+
oncanplay?: EventHandler<Event, T> | string | undefined | null;
|
|
126
|
+
oncanplaythrough?: EventHandler<Event, T> | string | undefined | null;
|
|
127
|
+
oncuechange?: EventHandler<Event, T> | string | undefined | null;
|
|
128
|
+
ondurationchange?: EventHandler<Event, T> | string | undefined | null;
|
|
129
|
+
onemptied?: EventHandler<Event, T> | string | undefined | null;
|
|
130
|
+
onencrypted?: EventHandler<Event, T> | string | undefined | null;
|
|
131
|
+
onended?: EventHandler<Event, T> | string | undefined | null;
|
|
132
|
+
onloadeddata?: EventHandler<Event, T> | string | undefined | null;
|
|
133
|
+
onloadedmetadata?: EventHandler<Event, T> | string | undefined | null;
|
|
134
|
+
onloadstart?: EventHandler<Event, T> | string | undefined | null;
|
|
135
|
+
onpause?: EventHandler<Event, T> | string | undefined | null;
|
|
136
|
+
onplay?: EventHandler<Event, T> | string | undefined | null;
|
|
137
|
+
onplaying?: EventHandler<Event, T> | string | undefined | null;
|
|
138
|
+
onprogress?: EventHandler<Event, T> | string | undefined | null;
|
|
139
|
+
onratechange?: EventHandler<Event, T> | string | undefined | null;
|
|
140
|
+
onseeked?: EventHandler<Event, T> | string | undefined | null;
|
|
141
|
+
onseeking?: EventHandler<Event, T> | string | undefined | null;
|
|
142
|
+
onstalled?: EventHandler<Event, T> | string | undefined | null;
|
|
143
|
+
onsuspend?: EventHandler<Event, T> | string | undefined | null;
|
|
144
|
+
ontimeupdate?: EventHandler<Event, T> | string | undefined | null;
|
|
145
|
+
onvolumechange?: EventHandler<Event, T> | string | undefined | null;
|
|
146
|
+
onwaiting?: EventHandler<Event, T> | string | undefined | null;
|
|
148
147
|
|
|
149
148
|
// MouseEvents
|
|
150
|
-
onauxclick?: MouseEventHandler<T> | undefined | null;
|
|
151
|
-
onclick?: MouseEventHandler<T> | undefined | null;
|
|
152
|
-
oncontextmenu?: MouseEventHandler<T> | undefined | null;
|
|
153
|
-
ondblclick?: MouseEventHandler<T> | undefined | null;
|
|
154
|
-
ondrag?: DragEventHandler<T> | undefined | null;
|
|
155
|
-
ondragend?: DragEventHandler<T> | undefined | null;
|
|
156
|
-
ondragenter?: DragEventHandler<T> | undefined | null;
|
|
157
|
-
ondragexit?: DragEventHandler<T> | undefined | null;
|
|
158
|
-
ondragleave?: DragEventHandler<T> | undefined | null;
|
|
159
|
-
ondragover?: DragEventHandler<T> | undefined | null;
|
|
160
|
-
ondragstart?: DragEventHandler<T> | undefined | null;
|
|
161
|
-
ondrop?: DragEventHandler<T> | undefined | null;
|
|
162
|
-
onmousedown?: MouseEventHandler<T> | undefined | null;
|
|
163
|
-
onmouseenter?: MouseEventHandler<T> | undefined | null;
|
|
164
|
-
onmouseleave?: MouseEventHandler<T> | undefined | null;
|
|
165
|
-
onmousemove?: MouseEventHandler<T> | undefined | null;
|
|
166
|
-
onmouseout?: MouseEventHandler<T> | undefined | null;
|
|
167
|
-
onmouseover?: MouseEventHandler<T> | undefined | null;
|
|
168
|
-
onmouseup?: MouseEventHandler<T> | undefined | null;
|
|
149
|
+
onauxclick?: MouseEventHandler<T> | string | undefined | null;
|
|
150
|
+
onclick?: MouseEventHandler<T> | string | undefined | null;
|
|
151
|
+
oncontextmenu?: MouseEventHandler<T> | string | undefined | null;
|
|
152
|
+
ondblclick?: MouseEventHandler<T> | string | undefined | null;
|
|
153
|
+
ondrag?: DragEventHandler<T> | string | undefined | null;
|
|
154
|
+
ondragend?: DragEventHandler<T> | string | undefined | null;
|
|
155
|
+
ondragenter?: DragEventHandler<T> | string | undefined | null;
|
|
156
|
+
ondragexit?: DragEventHandler<T> | string | undefined | null;
|
|
157
|
+
ondragleave?: DragEventHandler<T> | string | undefined | null;
|
|
158
|
+
ondragover?: DragEventHandler<T> | string | undefined | null;
|
|
159
|
+
ondragstart?: DragEventHandler<T> | string | undefined | null;
|
|
160
|
+
ondrop?: DragEventHandler<T> | string | undefined | null;
|
|
161
|
+
onmousedown?: MouseEventHandler<T> | string | undefined | null;
|
|
162
|
+
onmouseenter?: MouseEventHandler<T> | string | undefined | null;
|
|
163
|
+
onmouseleave?: MouseEventHandler<T> | string | undefined | null;
|
|
164
|
+
onmousemove?: MouseEventHandler<T> | string | undefined | null;
|
|
165
|
+
onmouseout?: MouseEventHandler<T> | string | undefined | null;
|
|
166
|
+
onmouseover?: MouseEventHandler<T> | string | undefined | null;
|
|
167
|
+
onmouseup?: MouseEventHandler<T> | string | undefined | null;
|
|
169
168
|
|
|
170
169
|
// Selection Events
|
|
171
|
-
onselect?: EventHandler<Event, T> | undefined | null;
|
|
172
|
-
onselectionchange?: EventHandler<Event, T> | undefined | null;
|
|
173
|
-
onselectstart?: EventHandler<Event, T> | undefined | null;
|
|
170
|
+
onselect?: EventHandler<Event, T> | string | undefined | null;
|
|
171
|
+
onselectionchange?: EventHandler<Event, T> | string | undefined | null;
|
|
172
|
+
onselectstart?: EventHandler<Event, T> | string | undefined | null;
|
|
174
173
|
|
|
175
174
|
// Touch Events
|
|
176
|
-
ontouchcancel?: TouchEventHandler<T> | undefined | null;
|
|
177
|
-
ontouchend?: TouchEventHandler<T> | undefined | null;
|
|
178
|
-
ontouchmove?: TouchEventHandler<T> | undefined | null;
|
|
179
|
-
ontouchstart?: TouchEventHandler<T> | undefined | null;
|
|
175
|
+
ontouchcancel?: TouchEventHandler<T> | string | undefined | null;
|
|
176
|
+
ontouchend?: TouchEventHandler<T> | string | undefined | null;
|
|
177
|
+
ontouchmove?: TouchEventHandler<T> | string | undefined | null;
|
|
178
|
+
ontouchstart?: TouchEventHandler<T> | string | undefined | null;
|
|
180
179
|
|
|
181
180
|
// Pointer Events
|
|
182
|
-
ongotpointercapture?: PointerEventHandler<T> | undefined | null;
|
|
183
|
-
onpointercancel?: PointerEventHandler<T> | undefined | null;
|
|
184
|
-
onpointerdown?: PointerEventHandler<T> | undefined | null;
|
|
185
|
-
onpointerenter?: PointerEventHandler<T> | undefined | null;
|
|
186
|
-
onpointerleave?: PointerEventHandler<T> | undefined | null;
|
|
187
|
-
onpointermove?: PointerEventHandler<T> | undefined | null;
|
|
188
|
-
onpointerout?: PointerEventHandler<T> | undefined | null;
|
|
189
|
-
onpointerover?: PointerEventHandler<T> | undefined | null;
|
|
190
|
-
onpointerup?: PointerEventHandler<T> | undefined | null;
|
|
191
|
-
onlostpointercapture?: PointerEventHandler<T> | undefined | null;
|
|
181
|
+
ongotpointercapture?: PointerEventHandler<T> | string | undefined | null;
|
|
182
|
+
onpointercancel?: PointerEventHandler<T> | string | undefined | null;
|
|
183
|
+
onpointerdown?: PointerEventHandler<T> | string | undefined | null;
|
|
184
|
+
onpointerenter?: PointerEventHandler<T> | string | undefined | null;
|
|
185
|
+
onpointerleave?: PointerEventHandler<T> | string | undefined | null;
|
|
186
|
+
onpointermove?: PointerEventHandler<T> | string | undefined | null;
|
|
187
|
+
onpointerout?: PointerEventHandler<T> | string | undefined | null;
|
|
188
|
+
onpointerover?: PointerEventHandler<T> | string | undefined | null;
|
|
189
|
+
onpointerup?: PointerEventHandler<T> | string | undefined | null;
|
|
190
|
+
onlostpointercapture?: PointerEventHandler<T> | string | undefined | null;
|
|
192
191
|
|
|
193
192
|
// UI Events
|
|
194
|
-
onscroll?: UIEventHandler<T> | undefined | null;
|
|
195
|
-
onresize?: UIEventHandler<T> | undefined | null;
|
|
193
|
+
onscroll?: UIEventHandler<T> | string | undefined | null;
|
|
194
|
+
onresize?: UIEventHandler<T> | string | undefined | null;
|
|
196
195
|
|
|
197
196
|
// Wheel Events
|
|
198
|
-
onwheel?: WheelEventHandler<T> | undefined | null;
|
|
197
|
+
onwheel?: WheelEventHandler<T> | string | undefined | null;
|
|
199
198
|
|
|
200
199
|
// Animation Events
|
|
201
|
-
onanimationstart?: AnimationEventHandler<T> | undefined | null;
|
|
202
|
-
onanimationend?: AnimationEventHandler<T> | undefined | null;
|
|
203
|
-
onanimationiteration?: AnimationEventHandler<T> | undefined | null;
|
|
200
|
+
onanimationstart?: AnimationEventHandler<T> | string | undefined | null;
|
|
201
|
+
onanimationend?: AnimationEventHandler<T> | string | undefined | null;
|
|
202
|
+
onanimationiteration?: AnimationEventHandler<T> | string | undefined | null;
|
|
204
203
|
|
|
205
204
|
// Transition Events
|
|
206
|
-
ontransitionstart?: TransitionEventHandler<T> | undefined | null;
|
|
207
|
-
ontransitionrun?: TransitionEventHandler<T> | undefined | null;
|
|
208
|
-
ontransitionend?: TransitionEventHandler<T> | undefined | null;
|
|
209
|
-
ontransitioncancel?: TransitionEventHandler<T> | undefined | null;
|
|
205
|
+
ontransitionstart?: TransitionEventHandler<T> | string | undefined | null;
|
|
206
|
+
ontransitionrun?: TransitionEventHandler<T> | string | undefined | null;
|
|
207
|
+
ontransitionend?: TransitionEventHandler<T> | string | undefined | null;
|
|
208
|
+
ontransitioncancel?: TransitionEventHandler<T> | string | undefined | null;
|
|
210
209
|
|
|
211
210
|
// Message Events
|
|
212
|
-
onmessage?: MessageEventHandler<T> | undefined | null;
|
|
213
|
-
onmessageerror?: MessageEventHandler<T> | undefined | null;
|
|
211
|
+
onmessage?: MessageEventHandler<T> | string | undefined | null;
|
|
212
|
+
onmessageerror?: MessageEventHandler<T> | string | undefined | null;
|
|
214
213
|
|
|
215
214
|
// Global Events
|
|
216
|
-
oncancel?: EventHandler<Event, T> | undefined | null;
|
|
217
|
-
onclose?: EventHandler<Event, T> | undefined | null;
|
|
218
|
-
onfullscreenchange?: EventHandler<Event, T> | undefined | null;
|
|
219
|
-
onfullscreenerror?: EventHandler<Event, T> | undefined | null;
|
|
215
|
+
oncancel?: EventHandler<Event, T> | string | undefined | null;
|
|
216
|
+
onclose?: EventHandler<Event, T> | string | undefined | null;
|
|
217
|
+
onfullscreenchange?: EventHandler<Event, T> | string | undefined | null;
|
|
218
|
+
onfullscreenerror?: EventHandler<Event, T> | string | undefined | null;
|
|
220
219
|
}
|
|
221
220
|
|
|
222
221
|
// All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
|
|
@@ -988,14 +987,14 @@ declare namespace astroHTML.JSX {
|
|
|
988
987
|
ruby: HTMLProps<HTMLElement>;
|
|
989
988
|
s: HTMLProps<HTMLElement>;
|
|
990
989
|
samp: HTMLProps<HTMLElement>;
|
|
991
|
-
script: HTMLProps<HTMLElement> & AstroDefineVars;
|
|
990
|
+
script: HTMLProps<HTMLElement> & AstroDefineVars & AstroScript;
|
|
992
991
|
section: HTMLProps<HTMLElement>;
|
|
993
992
|
select: HTMLProps<HTMLSelectElement>;
|
|
994
993
|
small: HTMLProps<HTMLElement>;
|
|
995
994
|
source: HTMLProps<HTMLSourceElement>;
|
|
996
995
|
span: HTMLProps<HTMLSpanElement>;
|
|
997
996
|
strong: HTMLProps<HTMLElement>;
|
|
998
|
-
style: HTMLProps<HTMLStyleElement> & AstroDefineVars;
|
|
997
|
+
style: HTMLProps<HTMLStyleElement> & AstroDefineVars & AstroStyle;
|
|
999
998
|
sub: HTMLProps<HTMLElement>;
|
|
1000
999
|
summary: HTMLProps<HTMLElement>;
|
|
1001
1000
|
sup: HTMLProps<HTMLElement>;
|