jsx-dom-runtime
Advanced tools
Comparing version 0.23.0 to 0.24.0
import { declarePreset } from '@babel/helper-plugin-utils'; | ||
const svg = new Set([ | ||
'svg', 'animate', 'circle', 'animateTransform', 'clipPath', 'defs', | ||
'desc', 'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer', | ||
const svgTags = new Set([ | ||
'animate', 'animateMotion', 'animateTransform', 'circle', 'clipPath', | ||
'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer', | ||
'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', | ||
'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', | ||
'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', | ||
'feOffset', 'feSpecularLighting', 'feTile', 'feTurbulence', 'filter', | ||
'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', | ||
'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', | ||
'stop', 'symbol', 'text', 'textPath', 'tspan', 'use', | ||
'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', | ||
'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', | ||
'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', | ||
'feTurbulence', 'filter', 'foreignObject', 'g', 'image', 'line', 'linearGradient', | ||
'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', | ||
'radialGradient', 'rect', 'set', 'stop', 'svg', 'switch', 'symbol', 'text', 'textPath', | ||
'tspan', 'use', 'view', | ||
]); | ||
const maybeSvg = new Set(['a', 'link', 'script', 'style', 'title']); | ||
const maybeSvg = new Set(['a', 'script', 'style', 'title']); | ||
const isSvgElement = (path) => { | ||
return svg.has(path.node.name.name) || | ||
(maybeSvg.has(path.node.name.name) && svg.has(path.parentPath.parent?.openingElement?.name?.name)); | ||
return svgTags.has(path.node.name.name) || | ||
(maybeSvg.has(path.node.name.name) && svgTags.has(path.parentPath.parent?.openingElement?.name?.name)); | ||
}; | ||
@@ -102,15 +103,21 @@ | ||
if (t.isJSXIdentifier(attr) && htmlTags.has(tag)) { | ||
switch (attr.name) { | ||
case 'className': { | ||
attr.name = 'class'; | ||
return; | ||
} | ||
if (!t.isJSXIdentifier(attr)) { | ||
return; | ||
} | ||
case 'htmlFor': { | ||
if (tag === 'label' || tag === 'output') { | ||
attr.name = 'for'; | ||
} | ||
return; | ||
} | ||
if ( | ||
attr.name === 'className' && | ||
(htmlTags.has(tag) || svgTags.has(tag)) | ||
) { | ||
attr.name = 'class'; | ||
return; | ||
} | ||
if (htmlTags.has(tag)) { | ||
if ( | ||
attr.name === 'htmlFor' && | ||
(tag === 'label' || tag === 'output') | ||
) { | ||
attr.name = 'for'; | ||
return; | ||
} | ||
@@ -124,2 +131,4 @@ | ||
} | ||
return; | ||
} | ||
@@ -126,0 +135,0 @@ } |
453
index.d.ts
/// <reference lib="dom" /> | ||
/// <reference lib="es2022" /> | ||
import * as CSS from 'csstype'; | ||
import { Properties } from 'csstype'; | ||
type Booleanish = boolean | 'true' | 'false' | ||
interface Attributes {} | ||
interface Attributes { } | ||
@@ -15,9 +15,3 @@ interface RefObject<T> { | ||
interface AttrWithRef<T> extends Attributes { | ||
ref?: RefCallback<T> | RefObject<T> | null | ||
} | ||
interface TChildren extends Array<TNode> {} | ||
type TNode = | ||
type TChild = | ||
| Node | ||
@@ -29,3 +23,3 @@ | Element | ||
| Text | ||
| TChildren | ||
| TChild[] | ||
| string | ||
@@ -37,16 +31,18 @@ | number | ||
type PropsWithChildren<P> = P & { children?: TNode | TChildren } | ||
type PropsWithChildren<P> = P & { children?: TChild | TChild[] } | ||
export function jsx<K extends keyof HTMLElementTagNameMap, T extends HTMLElementTagNameMap[K]>( | ||
export const properties: Set<string>; | ||
export function jsx<K extends keyof HTMLElementTagNameMap>( | ||
type: K | HTMLElementTagNameMap[K], | ||
props?: (HTMLAttributes<T> & AttrWithRef<T>), | ||
): T | ||
props: JSX.IntrinsicElements[K], | ||
): HTMLElementTagNameMap[K] | ||
export { jsx as jsxs, jsx as jsxDEV }; | ||
export function Fragment(props: { children?: TNode | TChildren }): DocumentFragment; | ||
export function Fragment(props: { children?: TChild | TChild[] }): DocumentFragment; | ||
export function Template(props: { children: string }): DocumentFragment; | ||
export interface FunctionComponent<P = {}, T extends JSX.Element = JSX.Element> { | ||
(props: PropsWithChildren<P>): T | null | ||
(props: PropsWithChildren<P>): T | null | string | ||
} | ||
@@ -93,9 +89,5 @@ export { FunctionComponent as FC }; | ||
export type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = AttrWithRef<T> & E | ||
interface DOMAttributes<T> { | ||
children?: TNode | TChildren | ||
innerHTML?: string; | ||
textContent?: string; | ||
ref?: RefCallback<T> | RefObject<T> | ||
children?: TChild | TChild[] | ||
// Clipboard Events | ||
@@ -105,3 +97,2 @@ oncopy?: ClipboardEventHandler<T> | ||
onpaste?: ClipboardEventHandler<T> | ||
// Composition Events | ||
@@ -111,7 +102,5 @@ oncompositionend?: CompositionEventHandler<T> | ||
oncompositionupdate?: CompositionEventHandler<T> | ||
// Focus Events | ||
onfocus?: FocusEventHandler<T> | ||
onblur?: FocusEventHandler<T> | ||
// Form Events | ||
@@ -124,7 +113,5 @@ onchange?: FormEventHandler<T> | ||
oninvalid?: FormEventHandler<T> | ||
// Image Events | ||
onload?: TEventHandler<T> | ||
onerror?: TEventHandler<T> // also a Media Event | ||
// Keyboard Events | ||
@@ -134,3 +121,2 @@ onkeydown?: KeyboardEventHandler<T> | ||
onkeyup?: KeyboardEventHandler<T> | ||
// Media Events | ||
@@ -159,3 +145,2 @@ onabort?: TEventHandler<T> | ||
onwaiting?: TEventHandler<T> | ||
// MouseEvents | ||
@@ -181,6 +166,4 @@ onauxclick?: MouseEventHandler<T> | ||
onmouseup?: MouseEventHandler<T> | ||
// Selection Events | ||
onselect?: TEventHandler<T> | ||
// Touch Events | ||
@@ -191,3 +174,2 @@ ontouchcancel?: TouchEventHandler<T> | ||
ontouchstart?: TouchEventHandler<T> | ||
// Pointer Events | ||
@@ -204,9 +186,6 @@ onpointerdown?: PointerEventHandler<T> | ||
onlostpointercapture?: PointerEventHandler<T> | ||
// UI Events | ||
onscroll?: UIEventHandler<T> | ||
// Wheel Events | ||
onwheel?: WheelEventHandler<T> | ||
// Animation Events | ||
@@ -216,3 +195,2 @@ onanimationstart?: AnimationEventHandler<T> | ||
onanimationiteration?: AnimationEventHandler<T> | ||
// Transition Events | ||
@@ -222,3 +200,3 @@ ontransitionend?: TransitionEventHandler<T> | ||
export interface CSSProperties extends CSS.Properties<string | number> { | ||
export interface CSSProperties extends Properties<string | number> { | ||
cssText?: string | null | ||
@@ -372,12 +350,12 @@ } | ||
'aria-relevant'?: | ||
| 'additions' | ||
| 'additions removals' | ||
| 'additions text' | ||
| 'all' | ||
| 'removals' | ||
| 'removals additions' | ||
| 'removals text' | ||
| 'text' | ||
| 'text additions' | ||
| 'text removals' | ||
| 'additions' | ||
| 'additions removals' | ||
| 'additions text' | ||
| 'all' | ||
| 'removals' | ||
| 'removals additions' | ||
| 'removals text' | ||
| 'text' | ||
| 'text additions' | ||
| 'text removals' | ||
@@ -450,9 +428,6 @@ /** Indicates that user input is required on the element before a form may be submitted. */ | ||
translate?: 'yes' | 'no' | ||
// Unknown | ||
radioGroup?: string // <command>, <menuitem> | ||
// WAI-ARIA | ||
role?: string | ||
// RDFa Attributes | ||
@@ -467,3 +442,2 @@ about?: string | ||
vocab?: string | ||
// Non-standard Attributes | ||
@@ -482,3 +456,2 @@ autoCapitalize?: string | ||
unselectable?: 'on' | 'off' | ||
// Living Standard | ||
@@ -503,2 +476,61 @@ /** | ||
export type TAutocomplete = | ||
| 'on' | ||
| 'off' | ||
| 'name' | ||
| 'honorific-prefix' | ||
| 'given-name' | ||
| 'additional-name' | ||
| 'family-name' | ||
| 'honorific-suffix' | ||
| 'nickname' | ||
| 'username' | ||
| 'new-password' | ||
| 'current-password' | ||
| 'one-time-code' | ||
| 'organization-title' | ||
| 'organization' | ||
| 'street-address' | ||
| 'address-line1' | ||
| 'address-line2' | ||
| 'address-line3' | ||
| 'address-level4' | ||
| 'address-level3' | ||
| 'address-level2' | ||
| 'address-level1' | ||
| 'country' | ||
| 'country-name' | ||
| 'postal-code' | ||
| 'cc-name' | ||
| 'cc-given-name' | ||
| 'cc-additional-name' | ||
| 'cc-family-name' | ||
| 'cc-number' | ||
| 'cc-exp' | ||
| 'cc-exp-month' | ||
| 'cc-exp-year' | ||
| 'cc-csc' | ||
| 'cc-type' | ||
| 'transaction-currency' | ||
| 'transaction-amount' | ||
| 'language' | ||
| 'bday' | ||
| 'bday-day' | ||
| 'bday-month' | ||
| 'bday-year' | ||
| 'sex' | ||
| 'url' | ||
| 'photo' | ||
| 'tel' | ||
| 'tel-country-code' | ||
| 'tel-national' | ||
| 'tel-area-code' | ||
| 'tel-local' | ||
| 'tel-local-prefix' | ||
| 'tel-local-suffix' | ||
| 'tel-extension' | ||
| 'email' | ||
| 'impp' | ||
| 'webauthn' | ||
export interface AnchorHTMLAttributes extends HTMLAttributes<HTMLAnchorElement> { | ||
@@ -517,3 +549,3 @@ download?: any | ||
interface AudioHTMLAttributes extends MediaHTMLAttributes<HTMLAudioElement> {} | ||
interface AudioHTMLAttributes extends MediaHTMLAttributes<HTMLAudioElement> { } | ||
@@ -606,4 +638,4 @@ interface AreaHTMLAttributes extends HTMLAttributes<HTMLAreaElement> { | ||
action?: string | ||
autoComplete?: string | ||
autocomplete?: string | ||
autoComplete?: TAutocomplete | ||
autocomplete?: TAutocomplete | ||
encType?: string | ||
@@ -672,4 +704,4 @@ enctype?: string | ||
alt?: string | ||
autoComplete?: string | ||
autocomplete?: string | ||
autoComplete?: TAutocomplete | ||
autocomplete?: TAutocomplete | ||
autoFocus?: boolean | ||
@@ -711,3 +743,2 @@ autofocus?: boolean | ||
width?: number | string | ||
onchange?: ChangeEventHandler<HTMLInputElement> | ||
@@ -859,3 +890,4 @@ } | ||
interface SelectHTMLAttributes extends HTMLAttributes<HTMLSelectElement> { | ||
autoComplete?: string | ||
autoComplete?: TAutocomplete | ||
autocomplete?: TAutocomplete | ||
autoFocus?: boolean | ||
@@ -901,3 +933,4 @@ autofocus?: boolean | ||
export interface TextareaHTMLAttributes extends HTMLAttributes<HTMLTextAreaElement> { | ||
autoComplete?: string | ||
autoComplete?: TAutocomplete | ||
autocomplete?: TAutocomplete | ||
autoFocus?: boolean | ||
@@ -919,3 +952,2 @@ autofocus?: boolean | ||
wrap?: string | ||
onchange?: ChangeEventHandler<HTMLTextAreaElement> | ||
@@ -994,3 +1026,3 @@ } | ||
namespace JSX { | ||
type Element = TNode | TChildren; | ||
type Element = HTMLElement | ||
@@ -1000,124 +1032,185 @@ interface ElementAttributesProperty { props: {}; } | ||
interface IntrinsicAttributes extends Attributes {} | ||
interface IntrinsicAttributes extends Attributes { } | ||
interface IntrinsicElements { | ||
a: DetailedHTMLProps<AnchorHTMLAttributes, HTMLAnchorElement> | ||
abbr: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
address: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
area: DetailedHTMLProps<AreaHTMLAttributes, HTMLAreaElement> | ||
article: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
aside: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
audio: DetailedHTMLProps<AudioHTMLAttributes, HTMLAudioElement> | ||
b: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
base: DetailedHTMLProps<BaseHTMLAttributes, HTMLBaseElement> | ||
bdi: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
bdo: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
big: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
blockquote: DetailedHTMLProps<BlockquoteHTMLAttributes, HTMLElement> | ||
body: DetailedHTMLProps<HTMLAttributes<HTMLBodyElement>, HTMLBodyElement> | ||
br: DetailedHTMLProps<HTMLAttributes<HTMLBRElement>, HTMLBRElement> | ||
button: DetailedHTMLProps<ButtonHTMLAttributes, HTMLButtonElement> | ||
canvas: DetailedHTMLProps<CanvasHTMLAttributes, HTMLCanvasElement> | ||
caption: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
cite: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
code: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
col: DetailedHTMLProps<ColHTMLAttributes, HTMLTableColElement> | ||
colgroup: DetailedHTMLProps<ColgroupHTMLAttributes, HTMLTableColElement> | ||
data: DetailedHTMLProps<DataHTMLAttributes, HTMLDataElement> | ||
datalist: DetailedHTMLProps<HTMLAttributes<HTMLDataListElement>, HTMLDataListElement> | ||
dd: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
del: DetailedHTMLProps<DelHTMLAttributes, HTMLElement> | ||
details: DetailedHTMLProps<DetailsHTMLAttributes, HTMLElement> | ||
dfn: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
dialog: DetailedHTMLProps<DialogHTMLAttributes, HTMLDialogElement> | ||
div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> | ||
dl: DetailedHTMLProps<HTMLAttributes<HTMLDListElement>, HTMLDListElement> | ||
dt: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
em: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
embed: DetailedHTMLProps<EmbedHTMLAttributes, HTMLEmbedElement> | ||
fieldset: DetailedHTMLProps<FieldsetHTMLAttributes, HTMLFieldSetElement> | ||
figcaption: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
figure: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
footer: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
form: DetailedHTMLProps<FormHTMLAttributes, HTMLFormElement> | ||
h1: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | ||
h2: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | ||
h3: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | ||
h4: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | ||
h5: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | ||
h6: DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement> | ||
head: DetailedHTMLProps<HTMLAttributes<HTMLHeadElement>, HTMLHeadElement> | ||
header: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
hgroup: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
hr: DetailedHTMLProps<HTMLAttributes<HTMLHRElement>, HTMLHRElement> | ||
html: DetailedHTMLProps<HtmlHTMLAttributes, HTMLHtmlElement> | ||
i: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
iframe: DetailedHTMLProps<IframeHTMLAttributes, HTMLIFrameElement> | ||
img: DetailedHTMLProps<ImgHTMLAttributes, HTMLImageElement> | ||
input: DetailedHTMLProps<InputHTMLAttributes, HTMLInputElement> | ||
ins: DetailedHTMLProps<InsHTMLAttributes, HTMLModElement> | ||
kbd: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
keygen: DetailedHTMLProps<KeygenHTMLAttributes, HTMLElement> | ||
label: DetailedHTMLProps<LabelHTMLAttributes, HTMLLabelElement> | ||
legend: DetailedHTMLProps<HTMLAttributes<HTMLLegendElement>, HTMLLegendElement> | ||
li: DetailedHTMLProps<LiHTMLAttributes, HTMLLIElement> | ||
link: DetailedHTMLProps<LinkHTMLAttributes, HTMLLinkElement> | ||
main: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
map: DetailedHTMLProps<MapHTMLAttributes, HTMLMapElement> | ||
mark: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
menu: DetailedHTMLProps<MenuHTMLAttributes, HTMLElement> | ||
menuitem: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
meta: DetailedHTMLProps<MetaHTMLAttributes, HTMLMetaElement> | ||
meter: DetailedHTMLProps<MeterHTMLAttributes, HTMLElement> | ||
nav: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
noindex: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
noscript: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
object: DetailedHTMLProps<ObjectHTMLAttributes, HTMLObjectElement> | ||
ol: DetailedHTMLProps<OlHTMLAttributes, HTMLOListElement> | ||
optgroup: DetailedHTMLProps<OptgroupHTMLAttributes, HTMLOptGroupElement> | ||
option: DetailedHTMLProps<OptionHTMLAttributes, HTMLOptionElement> | ||
output: DetailedHTMLProps<OutputHTMLAttributes, HTMLElement> | ||
p: DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement> | ||
param: DetailedHTMLProps<ParamHTMLAttributes, HTMLParamElement> | ||
picture: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
pre: DetailedHTMLProps<HTMLAttributes<HTMLPreElement>, HTMLPreElement> | ||
progress: DetailedHTMLProps<ProgressHTMLAttributes, HTMLProgressElement> | ||
q: DetailedHTMLProps<QuoteHTMLAttributes, HTMLQuoteElement> | ||
rp: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
rt: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
ruby: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
s: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
samp: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
script: DetailedHTMLProps<ScriptHTMLAttributes, HTMLScriptElement> | ||
section: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
select: DetailedHTMLProps<SelectHTMLAttributes, HTMLSelectElement> | ||
slot: DetailedHTMLProps<SlotHTMLAttributes, HTMLSlotElement> | ||
small: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
source: DetailedHTMLProps<SourceHTMLAttributes, HTMLSourceElement> | ||
span: DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | ||
strong: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
style: DetailedHTMLProps<StyleHTMLAttributes, HTMLStyleElement> | ||
sub: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
summary: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
sup: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
table: DetailedHTMLProps<TableHTMLAttributes, HTMLTableElement> | ||
template: DetailedHTMLProps<HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement> | ||
tbody: DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> | ||
td: DetailedHTMLProps<TdHTMLAttributes, HTMLTableDataCellElement> | ||
textarea: DetailedHTMLProps<TextareaHTMLAttributes, HTMLTextAreaElement> | ||
tfoot: DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> | ||
th: DetailedHTMLProps<ThHTMLAttributes, HTMLTableHeaderCellElement> | ||
thead: DetailedHTMLProps<HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> | ||
time: DetailedHTMLProps<TimeHTMLAttributes, HTMLElement> | ||
title: DetailedHTMLProps<HTMLAttributes<HTMLTitleElement>, HTMLTitleElement> | ||
tr: DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> | ||
track: DetailedHTMLProps<TrackHTMLAttributes, HTMLTrackElement> | ||
u: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
ul: DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement> | ||
var: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
video: DetailedHTMLProps<VideoHTMLAttributes, HTMLVideoElement> | ||
wbr: DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> | ||
webview: DetailedHTMLProps<WebViewHTMLAttributes, HTMLWebViewElement> | ||
a: AnchorHTMLAttributes | ||
abbr: HTMLAttributes<HTMLElement> | ||
address: HTMLAttributes<HTMLElement> | ||
area: AreaHTMLAttributes | ||
article: HTMLAttributes<HTMLElement> | ||
aside: HTMLAttributes<HTMLElement> | ||
audio: AudioHTMLAttributes | ||
b: HTMLAttributes<HTMLElement> | ||
base: BaseHTMLAttributes | ||
bdi: HTMLAttributes<HTMLElement> | ||
bdo: HTMLAttributes<HTMLElement> | ||
big: HTMLAttributes<HTMLElement> | ||
blockquote: BlockquoteHTMLAttributes | ||
body: HTMLAttributes<HTMLBodyElement> | ||
br: HTMLAttributes<HTMLBRElement> | ||
button: ButtonHTMLAttributes | ||
canvas: CanvasHTMLAttributes | ||
caption: HTMLAttributes<HTMLElement> | ||
cite: HTMLAttributes<HTMLElement> | ||
code: HTMLAttributes<HTMLElement> | ||
col: ColHTMLAttributes | ||
colgroup: ColgroupHTMLAttributes | ||
data: DataHTMLAttributes | ||
datalist: HTMLAttributes<HTMLDataListElement> | ||
dd: HTMLAttributes<HTMLElement> | ||
del: DelHTMLAttributes | ||
details: DetailsHTMLAttributes | ||
dfn: HTMLAttributes<HTMLElement> | ||
dialog: DialogHTMLAttributes | ||
div: HTMLAttributes<HTMLDivElement> | ||
dl: HTMLAttributes<HTMLDListElement> | ||
dt: HTMLAttributes<HTMLElement> | ||
em: HTMLAttributes<HTMLElement> | ||
embed: EmbedHTMLAttributes | ||
fieldset: FieldsetHTMLAttributes | ||
figcaption: HTMLAttributes<HTMLElement> | ||
figure: HTMLAttributes<HTMLElement> | ||
footer: HTMLAttributes<HTMLElement> | ||
form: FormHTMLAttributes | ||
h1: HTMLAttributes<HTMLHeadingElement> | ||
h2: HTMLAttributes<HTMLHeadingElement> | ||
h3: HTMLAttributes<HTMLHeadingElement> | ||
h4: HTMLAttributes<HTMLHeadingElement> | ||
h5: HTMLAttributes<HTMLHeadingElement> | ||
h6: HTMLAttributes<HTMLHeadingElement> | ||
head: HTMLAttributes<HTMLHeadElement> | ||
header: HTMLAttributes<HTMLElement> | ||
hgroup: HTMLAttributes<HTMLElement> | ||
hr: HTMLAttributes<HTMLHRElement> | ||
html: HtmlHTMLAttributes | ||
i: HTMLAttributes<HTMLElement> | ||
iframe: IframeHTMLAttributes | ||
img: ImgHTMLAttributes | ||
input: InputHTMLAttributes | ||
ins: InsHTMLAttributes | ||
kbd: HTMLAttributes<HTMLElement> | ||
keygen: KeygenHTMLAttributes | ||
label: LabelHTMLAttributes | ||
legend: HTMLAttributes<HTMLLegendElement> | ||
li: LiHTMLAttributes | ||
link: LinkHTMLAttributes | ||
main: HTMLAttributes<HTMLElement> | ||
map: MapHTMLAttributes | ||
mark: HTMLAttributes<HTMLElement> | ||
menu: MenuHTMLAttributes | ||
menuitem: HTMLAttributes<HTMLElement> | ||
meta: MetaHTMLAttributes | ||
meter: MeterHTMLAttributes | ||
nav: HTMLAttributes<HTMLElement> | ||
noindex: HTMLAttributes<HTMLElement> | ||
noscript: HTMLAttributes<HTMLElement> | ||
object: ObjectHTMLAttributes | ||
ol: OlHTMLAttributes | ||
optgroup: OptgroupHTMLAttributes | ||
option: OptionHTMLAttributes | ||
output: OutputHTMLAttributes | ||
p: HTMLAttributes<HTMLParagraphElement> | ||
param: ParamHTMLAttributes | ||
picture: HTMLAttributes<HTMLElement> | ||
pre: HTMLAttributes<HTMLPreElement> | ||
progress: ProgressHTMLAttributes | ||
q: QuoteHTMLAttributes | ||
rp: HTMLAttributes<HTMLElement> | ||
rt: HTMLAttributes<HTMLElement> | ||
ruby: HTMLAttributes<HTMLElement> | ||
s: HTMLAttributes<HTMLElement> | ||
samp: HTMLAttributes<HTMLElement> | ||
script: ScriptHTMLAttributes | ||
section: HTMLAttributes<HTMLElement> | ||
select: SelectHTMLAttributes | ||
slot: SlotHTMLAttributes | ||
small: HTMLAttributes<HTMLElement> | ||
source: SourceHTMLAttributes | ||
span: HTMLAttributes<HTMLSpanElement> | ||
strong: HTMLAttributes<HTMLElement> | ||
style: StyleHTMLAttributes | ||
sub: HTMLAttributes<HTMLElement> | ||
summary: HTMLAttributes<HTMLElement> | ||
sup: HTMLAttributes<HTMLElement> | ||
table: TableHTMLAttributes | ||
template: HTMLAttributes<HTMLTemplateElement> | ||
tbody: HTMLAttributes<HTMLTableSectionElement> | ||
td: TdHTMLAttributes | ||
textarea: TextareaHTMLAttributes | ||
tfoot: HTMLAttributes<HTMLTableSectionElement> | ||
th: ThHTMLAttributes | ||
thead: HTMLAttributes<HTMLTableSectionElement> | ||
time: TimeHTMLAttributes | ||
title: HTMLAttributes<HTMLTitleElement> | ||
tr: HTMLAttributes<HTMLTableRowElement> | ||
track: TrackHTMLAttributes | ||
u: HTMLAttributes<HTMLElement> | ||
ul: HTMLAttributes<HTMLUListElement> | ||
var: HTMLAttributes<HTMLElement> | ||
video: VideoHTMLAttributes | ||
wbr: HTMLAttributes<HTMLElement> | ||
webview: WebViewHTMLAttributes | ||
// TODO: | ||
animate: any | ||
animateMotion: any | ||
animateTransform: any | ||
circle: any | ||
clipPath: any | ||
defs: any | ||
desc: any | ||
ellipse: any | ||
feBlend: any | ||
feColorMatrix: any | ||
feComponentTransfer: any | ||
feComposite: any | ||
feConvolveMatrix: any | ||
feDiffuseLighting: any | ||
feDisplacementMap: any | ||
feDistantLight: any | ||
feDropShadow: any | ||
feFlood: any | ||
feFuncA: any | ||
feFuncB: any | ||
feFuncG: any | ||
feFuncR: any | ||
feGaussianBlur: any | ||
feImage: any | ||
feMerge: any | ||
feMergeNode: any | ||
feMorphology: any | ||
feOffset: any | ||
fePointLight: any | ||
feSpecularLighting: any | ||
feSpotLight: any | ||
feTile: any | ||
feTurbulence: any | ||
filter: any | ||
foreignObject: any | ||
g: any | ||
image: any | ||
line: any | ||
linearGradient: any | ||
marker: any | ||
mask: any | ||
metadata: any | ||
mpath: any | ||
path: any | ||
pattern: any | ||
polygon: any | ||
polyline: any | ||
radialGradient: any | ||
rect: any | ||
set: any | ||
stop: any | ||
svg: any | ||
switch: any | ||
symbol: any | ||
text: any | ||
textPath: any | ||
tspan: any | ||
use: any | ||
view: any | ||
} | ||
} | ||
} |
@@ -23,4 +23,4 @@ let appendChildren = (node, children) => { | ||
let internalKeys = new Set(['ref', 'children', '__ns']); | ||
let properties = new Set(['innerHTML', 'textContent', 'value']); | ||
let ignoreKeys = new Set(['ref', 'children', '__ns']); | ||
let jsx = (node, props) => { | ||
@@ -33,3 +33,3 @@ if (typeof node === 'function') { | ||
for (key in props) { | ||
if (ignoreKeys.has(key)) { | ||
if (internalKeys.has(key)) { | ||
continue; | ||
@@ -99,2 +99,2 @@ } | ||
export { Extend, Fragment, Template, appendChildren, createRef, jsx, jsx as jsxDEV, jsx as jsxs, parseFromString, createRef as useRef, useText }; | ||
export { Extend, Fragment, Template, appendChildren, createRef, jsx, jsx as jsxDEV, jsx as jsxs, parseFromString, properties, createRef as useRef, useText }; |
{ | ||
"name": "jsx-dom-runtime", | ||
"version": "0.23.0", | ||
"version": "0.24.0", | ||
"description": "A tiny in 500 bytes library to JSX syntax templates for DOM", | ||
@@ -51,3 +51,3 @@ "type": "module", | ||
"@evilmartians/lefthook": "^1.2.9", | ||
"@jest/globals": "^29.4.2", | ||
"@jest/globals": "^29.4.3", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
@@ -61,6 +61,6 @@ "@rollup/plugin-node-resolve": "^15.0.1", | ||
"@typescript-eslint/parser": "^5.52.0", | ||
"babel-jest": "^29.4.2", | ||
"babel-jest": "^29.4.3", | ||
"eslint": "^8.34.0", | ||
"jest": "^29.4.1", | ||
"jest-environment-jsdom": "^29.4.1", | ||
"jest": "^29.4.3", | ||
"jest-environment-jsdom": "^29.4.3", | ||
"rollup": "^3.15.0", | ||
@@ -67,0 +67,0 @@ "size-limit": "^8.2.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1581
57310