From 63291469df30ce5ee6557fc9ce99b8de577dda2f Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Thu, 22 May 2025 12:09:59 +0800 Subject: [PATCH 1/2] feat(types): add new HTML attributes for improved JSX support - Move `enterKeyHint`, `exportparts`, and `part` attributes to `HTMLAttributes`. - Added `fetchpriority` attribute to `ImgHTMLAttributes`. - Updated `IntrinsicElementAttributes` to include `set` element support. --- packages/runtime-dom/src/jsx.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/runtime-dom/src/jsx.ts b/packages/runtime-dom/src/jsx.ts index 5292441cde9..0356b347b63 100644 --- a/packages/runtime-dom/src/jsx.ts +++ b/packages/runtime-dom/src/jsx.ts @@ -264,6 +264,14 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers { contextmenu?: string dir?: string draggable?: Booleanish + enterKeyHint?: + | 'enter' + | 'done' + | 'go' + | 'next' + | 'previous' + | 'search' + | 'send' hidden?: Booleanish | '' | 'hidden' | 'until-found' id?: string inert?: Booleanish @@ -323,6 +331,14 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers { * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is */ is?: string + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts + */ + exportparts?: string + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part + */ + part?: string } type HTMLAttributeReferrerPolicy = @@ -475,6 +491,7 @@ export interface ImgHTMLAttributes extends HTMLAttributes { alt?: string crossorigin?: 'anonymous' | 'use-credentials' | '' decoding?: 'async' | 'auto' | 'sync' + fetchpriority?: 'high' | 'low' | 'auto' height?: Numberish loading?: 'eager' | 'lazy' referrerpolicy?: HTMLAttributeReferrerPolicy @@ -524,14 +541,6 @@ export interface InputHTMLAttributes extends HTMLAttributes { checked?: Booleanish | any[] | Set // for IDE v-model multi-checkbox support crossorigin?: string disabled?: Booleanish - enterKeyHint?: - | 'enter' - | 'done' - | 'go' - | 'next' - | 'previous' - | 'search' - | 'send' form?: string formaction?: string formenctype?: string @@ -1257,6 +1266,7 @@ export interface IntrinsicElementAttributes { polyline: SVGAttributes radialGradient: SVGAttributes rect: SVGAttributes + set: SVGAttributes stop: SVGAttributes switch: SVGAttributes symbol: SVGAttributes From ce753e2a5b8d52aff087d4c40e326e6e95144fc9 Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Thu, 5 Jun 2025 23:42:11 +0800 Subject: [PATCH 2/2] fix: correct casing of `enterKeyHint` to `enterkeyhint` in HTMLAttributes --- packages/runtime-dom/src/jsx.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-dom/src/jsx.ts b/packages/runtime-dom/src/jsx.ts index 0356b347b63..da7a8433964 100644 --- a/packages/runtime-dom/src/jsx.ts +++ b/packages/runtime-dom/src/jsx.ts @@ -264,7 +264,7 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers { contextmenu?: string dir?: string draggable?: Booleanish - enterKeyHint?: + enterkeyhint?: | 'enter' | 'done' | 'go'