@mpen/jsxhtml 0.1.19 → 0.1.21
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/custom-components.d.ts +2 -2
- package/dev.d.ts +1 -0
- package/escape.d.ts +1 -1
- package/htmlspec/AnchorElement.d.ts +83 -0
- package/htmlspec/GlobalAttributes.d.ts +286 -0
- package/htmlspec/IntrinsicElements.d.ts +152 -1
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.mjs +2 -2
- package/jsx-dev-runtime.cjs +2 -1
- package/jsx-dev-runtime.d.ts +2 -2
- package/jsx-dev-runtime.mjs +3 -2
- package/jsx-elements.d.ts +2 -2
- package/{jsx-runtime-K1okUiXU.js → jsx-runtime-FjVmLblX.js} +17 -55
- package/{jsx-runtime-fpN2EWm-.js → jsx-runtime-zSLyeHpr.js} +17 -55
- package/jsx-runtime.cjs +1 -1
- package/jsx-runtime.d.ts +3 -3
- package/jsx-runtime.mjs +1 -1
- package/{types.d.ts → jsx-types.d.ts} +10 -3
- package/jsx.d.ts +2 -3
- package/package.json +4 -1
- package/render.d.ts +1 -1
- package/styleObjectToString.d.ts +1 -1
- package/util-types.d.ts +5 -0
- package/util.d.ts +1 -1
package/custom-components.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocTypeProps, JsxComment, JsxDocType, JsxRawHtml } from './jsx-elements';
|
|
2
|
-
import {
|
|
2
|
+
import { AnyAttributes, StringChildren } from './jsx-types';
|
|
3
3
|
/**
|
|
4
4
|
* Unescaped HTML.
|
|
5
5
|
*/
|
|
@@ -15,7 +15,7 @@ export declare function DocType(props: DocTypeProps): JsxDocType;
|
|
|
15
15
|
/**
|
|
16
16
|
* `<!DOCTYPE html><html ...>{children}</html>`
|
|
17
17
|
*/
|
|
18
|
-
export declare function HtmlDocument({ children, ...htmlAttrs }:
|
|
18
|
+
export declare function HtmlDocument({ children, ...htmlAttrs }: AnyAttributes): import("./jsx-node").JsxNode;
|
|
19
19
|
/**
|
|
20
20
|
* No output.
|
|
21
21
|
*/
|
package/dev.d.ts
CHANGED
package/escape.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Attributes, AttributeValue, Stringable } from './types';
|
|
1
|
+
import { Attributes, AttributeValue, Stringable } from './jsx-types';
|
|
2
2
|
export declare function tagName(string: Stringable): string;
|
|
3
3
|
export declare function attrName(string: Stringable): string;
|
|
4
4
|
export declare function attrValue(value: Stringable): string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type AnchorElement = {
|
|
2
|
+
/**
|
|
3
|
+
* Causes the browser to treat the linked URL as a download. Can be used with or without a filename value:
|
|
4
|
+
*
|
|
5
|
+
* - Without a value, the browser will suggest a filename/extension, generated from various sources:
|
|
6
|
+
* - The `Content-Disposition` HTTP header
|
|
7
|
+
* - The final segment in the URL path
|
|
8
|
+
* - The media type (from the Content-Type header, the start of a data: URL, or Blob.type for a blob: URL)
|
|
9
|
+
* - `filename`: defining a value suggests it as the filename. / and \ characters are converted to underscores
|
|
10
|
+
* (_). Filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if
|
|
11
|
+
* necessary.
|
|
12
|
+
*/
|
|
13
|
+
download?: true | string;
|
|
14
|
+
/**
|
|
15
|
+
* The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs — they can use any URL scheme
|
|
16
|
+
* supported by browsers:
|
|
17
|
+
*
|
|
18
|
+
* - Sections of a page with document fragments
|
|
19
|
+
* - Specific text portions with text fragments
|
|
20
|
+
* - Pieces of media files with media fragments
|
|
21
|
+
* - Telephone numbers with tel: URLs
|
|
22
|
+
* - Email addresses with mailto: URLs
|
|
23
|
+
* - SMS text messages with sms: URLs
|
|
24
|
+
* - While web browsers may not support other URL schemes, websites can with registerProtocolHandler()
|
|
25
|
+
*/
|
|
26
|
+
href?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same as the
|
|
29
|
+
* global lang attribute.
|
|
30
|
+
*/
|
|
31
|
+
hreflang?: string;
|
|
32
|
+
/**
|
|
33
|
+
* A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body
|
|
34
|
+
* PING to the URLs. Typically for tracking.
|
|
35
|
+
*/
|
|
36
|
+
ping?: string;
|
|
37
|
+
/**
|
|
38
|
+
* How much of the referrer to send when following the link.
|
|
39
|
+
*/
|
|
40
|
+
referrerpolicy?: ReferrerPolicy | string;
|
|
41
|
+
/**
|
|
42
|
+
* The relationship of the linked URL as space-separated link types.
|
|
43
|
+
*/
|
|
44
|
+
rel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
|
|
47
|
+
*/
|
|
48
|
+
target?: '_self' | '_blank' | '_parent' | '_top' | string;
|
|
49
|
+
/**
|
|
50
|
+
* Hints at the linked URL's format with a MIME type. No built-in functionality.
|
|
51
|
+
*/
|
|
52
|
+
type?: string;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated
|
|
55
|
+
*/
|
|
56
|
+
charset?: string;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated
|
|
59
|
+
*/
|
|
60
|
+
coords?: string;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated
|
|
63
|
+
*/
|
|
64
|
+
name?: string;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
*/
|
|
68
|
+
rev?: string;
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated
|
|
71
|
+
*/
|
|
72
|
+
shape?: string;
|
|
73
|
+
};
|
|
74
|
+
export declare const enum ReferrerPolicy {
|
|
75
|
+
NoReferrer = "no-referrer",
|
|
76
|
+
NoReferrerWhenDowngrade = "no-referrer-when-downgrade",
|
|
77
|
+
Origin = "origin",
|
|
78
|
+
OriginWhenCrossOrigin = "origin-when-cross-origin",
|
|
79
|
+
SameOrigin = "same-origin",
|
|
80
|
+
StrictOrigin = "strict-origin",
|
|
81
|
+
StrictOriginWhenCrossOrigin = "strict-origin-when-cross-origin",
|
|
82
|
+
UnsafeUrl = "unsafe-url"
|
|
83
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/// <reference lib="dom" />
|
|
2
|
+
export type StandardGlobalAttributes = {
|
|
3
|
+
/**
|
|
4
|
+
* Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a
|
|
5
|
+
* space-separated list of characters. The browser should use the first one that exists on the computer keyboard
|
|
6
|
+
* layout.
|
|
7
|
+
*/
|
|
8
|
+
accesskey?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Controls whether and how text input is automatically capitalized as it is entered/edited by the user. It can
|
|
11
|
+
* have the following values:
|
|
12
|
+
*
|
|
13
|
+
* - `off` or `none`, no autocapitalization is applied (all letters default to lowercase)
|
|
14
|
+
* - `on` or `sentences`, the first letter of each sentence defaults to a capital letter; all other letters default
|
|
15
|
+
* to lowercase
|
|
16
|
+
* - `words`, the first letter of each word defaults to a capital letter; all other letters default to lowercase
|
|
17
|
+
* - `characters`, all letters should default to uppercase
|
|
18
|
+
*/
|
|
19
|
+
autocapitalize?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Indicates that an element is to be focused on page load, or as soon as the <dialog> it is part of is displayed.
|
|
22
|
+
* This attribute is a boolean, initially false.
|
|
23
|
+
*/
|
|
24
|
+
autofocus?: string;
|
|
25
|
+
/**
|
|
26
|
+
* A space-separated list of the classes of the element. Classes allow CSS and JavaScript to select and access
|
|
27
|
+
* specific elements via the class selectors or functions like the method Document.getElementsByClassName().
|
|
28
|
+
*/
|
|
29
|
+
class?: string;
|
|
30
|
+
/**
|
|
31
|
+
* An enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies
|
|
32
|
+
* its widget to allow editing. The attribute must take one of the following values:
|
|
33
|
+
*
|
|
34
|
+
* - `true` or the empty string, which indicates that the element must be editable;
|
|
35
|
+
* - `false`, which indicates that the element must not be editable.
|
|
36
|
+
*/
|
|
37
|
+
contenteditable?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The id of a `<menu>` to use as the contextual menu for this element.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated
|
|
42
|
+
*/
|
|
43
|
+
contextmenu?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged
|
|
46
|
+
* between the HTML and its DOM representation that may be used by scripts. All such custom data are available via
|
|
47
|
+
* the HTMLElement interface of the element the attribute is set on. The HTMLElement.dataset property gives access
|
|
48
|
+
* to them.
|
|
49
|
+
*/
|
|
50
|
+
[data: `data-${string}`]: string;
|
|
51
|
+
/**
|
|
52
|
+
* An enumerated attribute indicating the directionality of the element's text. It can have the following values:
|
|
53
|
+
*
|
|
54
|
+
* - `ltr`, which means left to right and is to be used for languages that are written from the left to the right
|
|
55
|
+
* (like English);
|
|
56
|
+
* - `rtl`, which means right to left and is to be used for languages that are written from the right to the left
|
|
57
|
+
* (like Arabic);
|
|
58
|
+
* - `auto`, which lets the user agent decide. It uses a basic algorithm as it parses the characters inside the
|
|
59
|
+
* element until it finds a character with a strong directionality, then it applies that directionality to the
|
|
60
|
+
* whole element.
|
|
61
|
+
*/
|
|
62
|
+
dir?: string;
|
|
63
|
+
/**
|
|
64
|
+
* An enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API. It can have
|
|
65
|
+
* the following values:
|
|
66
|
+
*
|
|
67
|
+
* - `true`, which indicates that the element may be dragged
|
|
68
|
+
* - `false`, which indicates that the element may not be dragged.
|
|
69
|
+
*/
|
|
70
|
+
draggable?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Hints what action label (or icon) to present for the enter key on virtual keyboards.
|
|
73
|
+
*/
|
|
74
|
+
enterkeyhint?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Used to transitively export shadow parts from a nested shadow tree into a containing light tree.
|
|
77
|
+
* @experimental
|
|
78
|
+
*/
|
|
79
|
+
exportparts?: string;
|
|
80
|
+
/**
|
|
81
|
+
* An enumerated attribute indicating that the element is not yet, or is no longer, relevant. For example, it can
|
|
82
|
+
* be used to hide elements of the page that can't be used until the login process has been completed. The browser
|
|
83
|
+
* won't render such elements. This attribute must not be used to hide content that could legitimately be shown.
|
|
84
|
+
*/
|
|
85
|
+
hidden?: boolean | 'hidden' | 'until-found';
|
|
86
|
+
/**
|
|
87
|
+
* Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the
|
|
88
|
+
* element when linking (using a fragment identifier), scripting, or styling (with CSS).
|
|
89
|
+
*/
|
|
90
|
+
id?: string;
|
|
91
|
+
/**
|
|
92
|
+
* A boolean value that makes the browser disregard user input events for the element. Useful when click events are
|
|
93
|
+
* present.
|
|
94
|
+
*/
|
|
95
|
+
inert?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Provides a hint to browsers about the type of virtual keyboard configuration to use when editing this element or
|
|
98
|
+
* its contents. Used primarily on <input> elements, but is usable on any element while in contenteditable mode.
|
|
99
|
+
*/
|
|
100
|
+
inputmode?: InputMode | string;
|
|
101
|
+
/**
|
|
102
|
+
* Allows you to specify that a standard HTML element should behave like a registered custom built-in element (see
|
|
103
|
+
* Using custom elements for more details).
|
|
104
|
+
*/
|
|
105
|
+
is?: string;
|
|
106
|
+
/**
|
|
107
|
+
* [Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)
|
|
108
|
+
*
|
|
109
|
+
* The unique, global identifier of an item.
|
|
110
|
+
*/
|
|
111
|
+
itemid?: string;
|
|
112
|
+
/**
|
|
113
|
+
* [Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)
|
|
114
|
+
*
|
|
115
|
+
* Used to add properties to an item. Every HTML element may have an itemprop attribute specified, where an
|
|
116
|
+
* itemprop consists of a name and value pair.
|
|
117
|
+
*/
|
|
118
|
+
itemprop?: string;
|
|
119
|
+
/**
|
|
120
|
+
* [Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)
|
|
121
|
+
*
|
|
122
|
+
* Properties that are not descendants of an element with the itemscope attribute can be associated with the item
|
|
123
|
+
* using an itemref. It provides a list of element ids (not itemids) with additional properties elsewhere in the
|
|
124
|
+
* document.
|
|
125
|
+
*/
|
|
126
|
+
itemref?: string;
|
|
127
|
+
/**
|
|
128
|
+
* [Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)
|
|
129
|
+
*
|
|
130
|
+
* itemscope (usually) works along with itemtype to specify that the HTML contained in a block is about a
|
|
131
|
+
* particular item. itemscope creates the Item and defines the scope of the itemtype associated with it. itemtype
|
|
132
|
+
* is a valid URL of a vocabulary (such as schema.org) that describes the item and its properties context.
|
|
133
|
+
*/
|
|
134
|
+
itemscope?: string;
|
|
135
|
+
/**
|
|
136
|
+
* [Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)
|
|
137
|
+
*
|
|
138
|
+
* Specifies the URL of the vocabulary that will be used to define itemprops (item properties) in the data
|
|
139
|
+
* structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will
|
|
140
|
+
* be active.
|
|
141
|
+
*/
|
|
142
|
+
itemtype?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Helps define the language of an element: the language that non-editable elements are in, or the language that
|
|
145
|
+
* editable elements should be written in by the user. The attribute contains one "language tag" (made of
|
|
146
|
+
* hyphen-separated "language subtags") in the format defined in RFC 5646: Tags for Identifying Languages (also
|
|
147
|
+
* known as BCP 47). xml:lang has priority over it.
|
|
148
|
+
*/
|
|
149
|
+
lang?: string;
|
|
150
|
+
/**
|
|
151
|
+
* A cryptographic nonce ("number used once") which can be used by Content Security Policy to determine whether or
|
|
152
|
+
* not a given fetch will be allowed to proceed.
|
|
153
|
+
*/
|
|
154
|
+
nonce?: string;
|
|
155
|
+
/**
|
|
156
|
+
* A space-separated list of the part names of the element. Part names allows CSS to select and style specific
|
|
157
|
+
* elements in a shadow tree via the ::part pseudo-element.
|
|
158
|
+
*/
|
|
159
|
+
part?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Used to designate an element as a popover element (see Popover API). Popover elements are hidden via display:
|
|
162
|
+
* none until opened via an invoking/control element (i.e. a <button> or <input type="button"> with a popovertarget
|
|
163
|
+
* attribute) or a HTMLElement.showPopover() call.
|
|
164
|
+
*/
|
|
165
|
+
popover?: string;
|
|
166
|
+
/**
|
|
167
|
+
* An enumerated attribute defines whether the element may be checked for spelling errors. It may have the
|
|
168
|
+
* following values:
|
|
169
|
+
*
|
|
170
|
+
* - empty string or true, which indicates that the element should be, if possible, checked for spelling errors;
|
|
171
|
+
* - `false`, which indicates that the element should not be checked for spelling errors.
|
|
172
|
+
*/
|
|
173
|
+
spellcheck?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be
|
|
176
|
+
* defined in a separate file or files. This attribute and the <style> element have mainly the purpose of allowing
|
|
177
|
+
* for quick styling, for example for testing purposes.
|
|
178
|
+
*/
|
|
179
|
+
style?: string;
|
|
180
|
+
/**
|
|
181
|
+
* An integer attribute indicating if the element can take input focus (is focusable), if it should participate to
|
|
182
|
+
* sequential keyboard navigation, and if so, at what position. It can take several values:
|
|
183
|
+
*
|
|
184
|
+
* - a negative value means that the element should be focusable, but should not be reachable via sequential
|
|
185
|
+
* keyboard navigation;
|
|
186
|
+
* - 0 means that the element should be focusable and reachable via sequential keyboard navigation, but its
|
|
187
|
+
* relative order is defined by the platform convention;
|
|
188
|
+
* - a positive value means that the element should be focusable and reachable via sequential keyboard navigation;
|
|
189
|
+
* the order in which the elements are focused is the increasing value of the tabindex. If several elements share
|
|
190
|
+
* the same tabindex, their relative order follows their relative positions in the document.
|
|
191
|
+
*/
|
|
192
|
+
tabindex?: Numeric;
|
|
193
|
+
/**
|
|
194
|
+
* Contains a text representing advisory information related to the element it belongs to. Such information can
|
|
195
|
+
* typically, but not necessarily, be presented to the user as a tooltip.
|
|
196
|
+
*/
|
|
197
|
+
title?: string;
|
|
198
|
+
/**
|
|
199
|
+
* An enumerated attribute that is used to specify whether an element's attribute values and the values of its Text
|
|
200
|
+
* node children are to be translated when the page is localized, or whether to leave them unchanged. It can have
|
|
201
|
+
* the following values:
|
|
202
|
+
*
|
|
203
|
+
* - empty string or yes, which indicates that the element will be translated.
|
|
204
|
+
* - no, which indicates that the element will not be translated.
|
|
205
|
+
*/
|
|
206
|
+
translate?: true | 'yes' | 'no';
|
|
207
|
+
/**
|
|
208
|
+
* An enumerated attribute used to control the on-screen virtual keyboard behavior on devices such as tablets,
|
|
209
|
+
* mobile phones, or other devices where a hardware keyboard may not be available for elements that also uses the
|
|
210
|
+
* contenteditable attribute.
|
|
211
|
+
*
|
|
212
|
+
* - `auto` or an empty string, which automatically shows the virtual keyboard when the element is focused or
|
|
213
|
+
* tapped.
|
|
214
|
+
* - `manual`, which decouples focus and tap on the element from the virtual keyboard's state.
|
|
215
|
+
*/
|
|
216
|
+
virtualkeyboardpolicy?: true | 'auto' | 'manual';
|
|
217
|
+
};
|
|
218
|
+
export type Numeric = number | `${number}`;
|
|
219
|
+
export declare const enum InputMode {
|
|
220
|
+
/**
|
|
221
|
+
* No virtual keyboard. For when the page implements its own keyboard input control.
|
|
222
|
+
*/
|
|
223
|
+
None = "none",
|
|
224
|
+
/**
|
|
225
|
+
* Standard input keyboard for the user's current locale.
|
|
226
|
+
*/
|
|
227
|
+
Text = "text",
|
|
228
|
+
/**
|
|
229
|
+
* Fractional numeric input keyboard containing the digits and decimal separator for the user's locale (typically .
|
|
230
|
+
* or ,). Devices may or may not show a minus key (-).
|
|
231
|
+
*/
|
|
232
|
+
Decimal = "decimal",
|
|
233
|
+
/**
|
|
234
|
+
* Numeric input keyboard, but only requires the digits 0–9. Devices may or may not show a minus key.
|
|
235
|
+
*/
|
|
236
|
+
Numeric = "numeric",
|
|
237
|
+
/**
|
|
238
|
+
* A telephone keypad input, including the digits 0–9, the asterisk (*), and the pound (#) key. Inputs that
|
|
239
|
+
* *require* a telephone number should typically use <input type="tel"> instead.
|
|
240
|
+
*/
|
|
241
|
+
Tel = "tel",
|
|
242
|
+
/**
|
|
243
|
+
* A virtual keyboard optimized for search input. For instance, the return/submit key may be labeled "Search",
|
|
244
|
+
* along with possible other optimizations. Inputs that require a search query should typically use <input
|
|
245
|
+
* type="search"> instead.
|
|
246
|
+
*/
|
|
247
|
+
Search = "search",
|
|
248
|
+
/**
|
|
249
|
+
* A virtual keyboard optimized for entering email addresses. Typically includes the @character as well as other
|
|
250
|
+
* optimizations. Inputs that require email addresses should typically use <input type="email"> instead.
|
|
251
|
+
*/
|
|
252
|
+
Email = "email",
|
|
253
|
+
/**
|
|
254
|
+
* A keypad optimized for entering URLs. This may have the / key more prominent, for example. Enhanced features
|
|
255
|
+
* could include history access and so on. Inputs that require a URL should typically use <input type="url">
|
|
256
|
+
* instead.
|
|
257
|
+
*/
|
|
258
|
+
Url = "url"
|
|
259
|
+
}
|
|
260
|
+
export type AriaAttributes = {
|
|
261
|
+
/**
|
|
262
|
+
* Roles define the semantic meaning of content, allowing screen readers and other tools to present and support
|
|
263
|
+
* interaction with an object in a way that is consistent with user expectations of that type of object. roles are
|
|
264
|
+
* added to HTML elements using role="role_type", where role_type is the name of a role in the ARIA specification.
|
|
265
|
+
*
|
|
266
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles
|
|
267
|
+
*/
|
|
268
|
+
role?: string;
|
|
269
|
+
[aria: `aria-${string}`]: string;
|
|
270
|
+
};
|
|
271
|
+
export type XmlAttributes = {
|
|
272
|
+
/**
|
|
273
|
+
* @deprecated
|
|
274
|
+
*/
|
|
275
|
+
'xml:lang': string;
|
|
276
|
+
/**
|
|
277
|
+
* @deprecated
|
|
278
|
+
*/
|
|
279
|
+
'xml:base': string;
|
|
280
|
+
};
|
|
281
|
+
export type GlobalEventHandlers = {
|
|
282
|
+
[evt in EventHandlerNames]?: string | ((this: HTMLElement) => void);
|
|
283
|
+
};
|
|
284
|
+
export type AllGlobalAttributes = StandardGlobalAttributes | AriaAttributes | GlobalEventHandlers;
|
|
285
|
+
type EventHandlerNames = 'onauxclick' | 'onbeforeinput' | 'onbeforematch' | 'onbeforetoggle' | 'onblur' | 'oncancel' | 'oncanplay' | 'oncanplaythrough' | 'onchange' | 'onclick' | 'onclose' | 'oncontextlost' | 'oncontextmenu' | 'oncontextrestored' | 'oncopy' | 'oncuechange' | 'oncut' | 'ondblclick' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'ondurationchange' | 'onemptied' | 'onended' | 'onerror' | 'onfocus' | 'onformdata' | 'oninput' | 'oninvalid' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onload' | 'onloadeddata' | 'onloadedmetadata' | 'onloadstart' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onpaste' | 'onpause' | 'onplay' | 'onplaying' | 'onprogress' | 'onratechange' | 'onreset' | 'onresize' | 'onscroll' | 'onscrollend' | 'onsecuritypolicyviolation' | 'onseeked' | 'onseeking' | 'onselect' | 'onslotchange' | 'onstalled' | 'onsubmit' | 'onsuspend' | 'ontimeupdate' | 'ontoggle' | 'onvolumechange' | 'onwaiting' | 'onwheel';
|
|
286
|
+
export {};
|
|
@@ -1 +1,152 @@
|
|
|
1
|
-
|
|
1
|
+
import { AnyAttributes, CommonProps } from '../jsx-types';
|
|
2
|
+
import { AnchorElement } from './AnchorElement';
|
|
3
|
+
export type IntrinsicElements = {
|
|
4
|
+
/**
|
|
5
|
+
* The <a> HTML element (or anchor element), with its href attribute, creates a hyperlink to web pages, files,
|
|
6
|
+
* email addresses, locations in the same page, or anything else a URL can address.
|
|
7
|
+
*
|
|
8
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
|
|
9
|
+
*/
|
|
10
|
+
a: AnchorElement & CommonProps;
|
|
11
|
+
abbr: AnyAttributes;
|
|
12
|
+
acronym: AnyAttributes;
|
|
13
|
+
address: AnyAttributes;
|
|
14
|
+
area: AnyAttributes;
|
|
15
|
+
article: AnyAttributes;
|
|
16
|
+
aside: AnyAttributes;
|
|
17
|
+
audio: AnyAttributes;
|
|
18
|
+
b: AnyAttributes;
|
|
19
|
+
base: AnyAttributes;
|
|
20
|
+
bdi: AnyAttributes;
|
|
21
|
+
bdo: AnyAttributes;
|
|
22
|
+
big: AnyAttributes;
|
|
23
|
+
blockquote: AnyAttributes;
|
|
24
|
+
body: AnyAttributes;
|
|
25
|
+
br: AnyAttributes;
|
|
26
|
+
button: AnyAttributes;
|
|
27
|
+
canvas: AnyAttributes;
|
|
28
|
+
caption: AnyAttributes;
|
|
29
|
+
center: AnyAttributes;
|
|
30
|
+
cite: AnyAttributes;
|
|
31
|
+
code: AnyAttributes;
|
|
32
|
+
col: AnyAttributes;
|
|
33
|
+
colgroup: AnyAttributes;
|
|
34
|
+
content: AnyAttributes;
|
|
35
|
+
data: AnyAttributes;
|
|
36
|
+
datalist: AnyAttributes;
|
|
37
|
+
dd: AnyAttributes;
|
|
38
|
+
del: AnyAttributes;
|
|
39
|
+
details: AnyAttributes;
|
|
40
|
+
dfn: AnyAttributes;
|
|
41
|
+
dialog: AnyAttributes;
|
|
42
|
+
dir: AnyAttributes;
|
|
43
|
+
div: AnyAttributes;
|
|
44
|
+
dl: AnyAttributes;
|
|
45
|
+
dt: AnyAttributes;
|
|
46
|
+
em: AnyAttributes;
|
|
47
|
+
embed: AnyAttributes;
|
|
48
|
+
fieldset: AnyAttributes;
|
|
49
|
+
figcaption: AnyAttributes;
|
|
50
|
+
figure: AnyAttributes;
|
|
51
|
+
font: AnyAttributes;
|
|
52
|
+
footer: AnyAttributes;
|
|
53
|
+
form: AnyAttributes;
|
|
54
|
+
frame: AnyAttributes;
|
|
55
|
+
frameset: AnyAttributes;
|
|
56
|
+
h1: AnyAttributes;
|
|
57
|
+
h2: AnyAttributes;
|
|
58
|
+
h3: AnyAttributes;
|
|
59
|
+
h4: AnyAttributes;
|
|
60
|
+
h5: AnyAttributes;
|
|
61
|
+
h6: AnyAttributes;
|
|
62
|
+
head: AnyAttributes;
|
|
63
|
+
header: AnyAttributes;
|
|
64
|
+
hgroup: AnyAttributes;
|
|
65
|
+
hr: AnyAttributes;
|
|
66
|
+
html: AnyAttributes;
|
|
67
|
+
i: AnyAttributes;
|
|
68
|
+
iframe: AnyAttributes;
|
|
69
|
+
image: AnyAttributes;
|
|
70
|
+
img: AnyAttributes;
|
|
71
|
+
/**
|
|
72
|
+
* The `<input>` HTML element is used to create interactive controls for web-based forms in order to accept data
|
|
73
|
+
* from the user; a wide variety of types of input data and control widgets are available, depending on the device
|
|
74
|
+
* and user agent. The `<input>` element is one of the most powerful and complex in all of HTML due to the sheer
|
|
75
|
+
* number of combinations of input types and attributes.
|
|
76
|
+
*/
|
|
77
|
+
input: AnyAttributes;
|
|
78
|
+
ins: AnyAttributes;
|
|
79
|
+
kbd: AnyAttributes;
|
|
80
|
+
keygen: AnyAttributes;
|
|
81
|
+
label: AnyAttributes;
|
|
82
|
+
legend: AnyAttributes;
|
|
83
|
+
li: AnyAttributes;
|
|
84
|
+
link: AnyAttributes;
|
|
85
|
+
main: AnyAttributes;
|
|
86
|
+
map: AnyAttributes;
|
|
87
|
+
mark: AnyAttributes;
|
|
88
|
+
marquee: AnyAttributes;
|
|
89
|
+
menu: AnyAttributes;
|
|
90
|
+
menuitem: AnyAttributes;
|
|
91
|
+
meta: AnyAttributes;
|
|
92
|
+
meter: AnyAttributes;
|
|
93
|
+
nav: AnyAttributes;
|
|
94
|
+
nobr: AnyAttributes;
|
|
95
|
+
noembed: AnyAttributes;
|
|
96
|
+
noframes: AnyAttributes;
|
|
97
|
+
noscript: AnyAttributes;
|
|
98
|
+
object: AnyAttributes;
|
|
99
|
+
ol: AnyAttributes;
|
|
100
|
+
optgroup: AnyAttributes;
|
|
101
|
+
option: AnyAttributes;
|
|
102
|
+
output: AnyAttributes;
|
|
103
|
+
p: AnyAttributes;
|
|
104
|
+
param: AnyAttributes;
|
|
105
|
+
picture: AnyAttributes;
|
|
106
|
+
plaintext: AnyAttributes;
|
|
107
|
+
portal: AnyAttributes;
|
|
108
|
+
pre: AnyAttributes;
|
|
109
|
+
progress: AnyAttributes;
|
|
110
|
+
q: AnyAttributes;
|
|
111
|
+
rb: AnyAttributes;
|
|
112
|
+
rp: AnyAttributes;
|
|
113
|
+
rt: AnyAttributes;
|
|
114
|
+
rtc: AnyAttributes;
|
|
115
|
+
ruby: AnyAttributes;
|
|
116
|
+
s: AnyAttributes;
|
|
117
|
+
samp: AnyAttributes;
|
|
118
|
+
script: AnyAttributes;
|
|
119
|
+
search: AnyAttributes;
|
|
120
|
+
section: AnyAttributes;
|
|
121
|
+
select: AnyAttributes;
|
|
122
|
+
shadow: AnyAttributes;
|
|
123
|
+
slot: AnyAttributes;
|
|
124
|
+
small: AnyAttributes;
|
|
125
|
+
source: AnyAttributes;
|
|
126
|
+
span: AnyAttributes;
|
|
127
|
+
strike: AnyAttributes;
|
|
128
|
+
strong: AnyAttributes;
|
|
129
|
+
style: AnyAttributes;
|
|
130
|
+
sub: AnyAttributes;
|
|
131
|
+
summary: AnyAttributes;
|
|
132
|
+
sup: AnyAttributes;
|
|
133
|
+
table: AnyAttributes;
|
|
134
|
+
tbody: AnyAttributes;
|
|
135
|
+
td: AnyAttributes;
|
|
136
|
+
template: AnyAttributes;
|
|
137
|
+
textarea: AnyAttributes;
|
|
138
|
+
tfoot: AnyAttributes;
|
|
139
|
+
th: AnyAttributes;
|
|
140
|
+
thead: AnyAttributes;
|
|
141
|
+
time: AnyAttributes;
|
|
142
|
+
title: AnyAttributes;
|
|
143
|
+
tr: AnyAttributes;
|
|
144
|
+
track: AnyAttributes;
|
|
145
|
+
tt: AnyAttributes;
|
|
146
|
+
u: AnyAttributes;
|
|
147
|
+
ul: AnyAttributes;
|
|
148
|
+
var: AnyAttributes;
|
|
149
|
+
video: AnyAttributes;
|
|
150
|
+
wbr: AnyAttributes;
|
|
151
|
+
xmp: AnyAttributes;
|
|
152
|
+
};
|
package/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var jsxRuntime = require("./jsx-runtime-
|
|
7
|
+
var jsxRuntime = require("./jsx-runtime-zSLyeHpr.js");
|
|
8
8
|
|
|
9
9
|
function RawHtml({children}) {
|
|
10
10
|
return new jsxRuntime.JsxRawHtml(jsxRuntime.flattenString(children));
|
package/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export * from './jsx-elements';
|
|
|
2
2
|
export * from './custom-components';
|
|
3
3
|
export * from './elysia-plugin';
|
|
4
4
|
export { isJsxNode } from './jsx-node';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AnyAttributes, JsxComponent, JsxRenderable } from './jsx-types';
|
|
6
6
|
import { Fragment as _Fragment } from './jsx-runtime';
|
|
7
7
|
declare namespace React {
|
|
8
|
-
function createElement(tag: string | JsxComponent, props:
|
|
8
|
+
function createElement(tag: string | JsxComponent, props: AnyAttributes, ...children: JsxRenderable[]): import("./jsx-node").JsxNode;
|
|
9
9
|
const Fragment: typeof _Fragment;
|
|
10
10
|
}
|
|
11
11
|
export default React;
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { J as JsxRawHtml, f as flattenString, E as EMPTY, a as JsxDocType, j as jsxs, b as jsx, F as Fragment, i as isJsxNode } from "./jsx-runtime-
|
|
1
|
+
import { J as JsxRawHtml, f as flattenString, E as EMPTY, a as JsxDocType, j as jsxs, b as jsx, F as Fragment, i as isJsxNode } from "./jsx-runtime-FjVmLblX.js";
|
|
2
2
|
|
|
3
|
-
export { d as JsxComment, c as JsxElement, e as JsxEmpty, g as JsxFragment } from "./jsx-runtime-
|
|
3
|
+
export { d as JsxComment, c as JsxElement, e as JsxEmpty, g as JsxFragment } from "./jsx-runtime-FjVmLblX.js";
|
|
4
4
|
|
|
5
5
|
function RawHtml({children}) {
|
|
6
6
|
return new JsxRawHtml(flattenString(children));
|
package/jsx-dev-runtime.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var jsxRuntime = require("./jsx-runtime-
|
|
3
|
+
var jsxRuntime = require("./jsx-runtime-zSLyeHpr.js");
|
|
4
4
|
|
|
5
5
|
function jsxDEV(tag, props, key, isStaticChildren, source, self) {
|
|
6
6
|
let node = jsxRuntime.jsx(...arguments);
|
|
7
|
+
if (process.env.JSXHTML_DEV) return node;
|
|
7
8
|
if (jsxRuntime.isJsxComponent(tag) && !(node instanceof jsxRuntime.JsxComment)) {
|
|
8
9
|
const name = tag.displayName ?? tag.name ?? "Unknown";
|
|
9
10
|
node = new jsxRuntime.JsxFragment([ new jsxRuntime.JsxComment(`<${name}>`), node, new jsxRuntime.JsxComment(`</${name}>`) ]);
|
package/jsx-dev-runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyAttributes, JsxComponent } from './jsx-types';
|
|
2
2
|
import { JsxNode } from './jsx-node';
|
|
3
3
|
export { jsx, Fragment } from './jsx-runtime';
|
|
4
|
-
export declare function jsxDEV(tag: string | JsxComponent, props:
|
|
4
|
+
export declare function jsxDEV(tag: string | JsxComponent, props: AnyAttributes, key: unknown, isStaticChildren: unknown, source: unknown, self: unknown): JsxNode;
|
package/jsx-dev-runtime.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { b as jsx, h as isJsxComponent, d as JsxComment, g as JsxFragment } from "./jsx-runtime-
|
|
1
|
+
import { b as jsx, h as isJsxComponent, d as JsxComment, g as JsxFragment } from "./jsx-runtime-FjVmLblX.js";
|
|
2
2
|
|
|
3
|
-
export { F as Fragment } from "./jsx-runtime-
|
|
3
|
+
export { F as Fragment } from "./jsx-runtime-FjVmLblX.js";
|
|
4
4
|
|
|
5
5
|
function jsxDEV(tag, props, key, isStaticChildren, source, self) {
|
|
6
6
|
let node = jsx(...arguments);
|
|
7
|
+
if (process.env.JSXHTML_DEV) return node;
|
|
7
8
|
if (isJsxComponent(tag) && !(node instanceof JsxComment)) {
|
|
8
9
|
const name = tag.displayName ?? tag.name ?? "Unknown";
|
|
9
10
|
node = new JsxFragment([ new JsxComment(`<${name}>`), node, new JsxComment(`</${name}>`) ]);
|
package/jsx-elements.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyAttributes, JsxChildren } from './jsx-types';
|
|
2
2
|
import { JsxNode } from './jsx-node';
|
|
3
3
|
export declare class JsxElement extends JsxNode {
|
|
4
4
|
private readonly tag;
|
|
5
5
|
private readonly props;
|
|
6
|
-
constructor(tag: string, props:
|
|
6
|
+
constructor(tag: string, props: AnyAttributes);
|
|
7
7
|
get [Symbol.toStringTag](): string;
|
|
8
8
|
toString(): string;
|
|
9
9
|
}
|
|
@@ -1316,62 +1316,22 @@ const entityMap = {
|
|
|
1316
1316
|
ffl: "ffllig"
|
|
1317
1317
|
};
|
|
1318
1318
|
|
|
1319
|
-
function
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
/*!
|
|
1328
|
-
Copyright (c) 2018 Jed Watson.
|
|
1329
|
-
Licensed under the MIT License (MIT), see
|
|
1330
|
-
http://jedwatson.github.io/classnames
|
|
1331
|
-
*/ (function(module) {
|
|
1332
|
-
(function() {
|
|
1333
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1334
|
-
function classNames() {
|
|
1335
|
-
var classes = [];
|
|
1336
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1337
|
-
var arg = arguments[i];
|
|
1338
|
-
if (!arg) continue;
|
|
1339
|
-
var argType = typeof arg;
|
|
1340
|
-
if (argType === "string" || argType === "number") {
|
|
1341
|
-
classes.push(arg);
|
|
1342
|
-
} else if (Array.isArray(arg)) {
|
|
1343
|
-
if (arg.length) {
|
|
1344
|
-
var inner = classNames.apply(null, arg);
|
|
1345
|
-
if (inner) {
|
|
1346
|
-
classes.push(inner);
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
} else if (argType === "object") {
|
|
1350
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
1351
|
-
classes.push(arg.toString());
|
|
1352
|
-
continue;
|
|
1353
|
-
}
|
|
1354
|
-
for (var key in arg) {
|
|
1355
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1356
|
-
classes.push(key);
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1319
|
+
function cc(names) {
|
|
1320
|
+
if (typeof names === "string" || typeof names === "number") return "" + names;
|
|
1321
|
+
let out = "";
|
|
1322
|
+
if (Array.isArray(names)) {
|
|
1323
|
+
for (let i = 0, tmp; i < names.length; i++) {
|
|
1324
|
+
if ((tmp = cc(names[i])) !== "") {
|
|
1325
|
+
out += (out && " ") + tmp;
|
|
1360
1326
|
}
|
|
1361
|
-
return classes.join(" ");
|
|
1362
1327
|
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
} else {
|
|
1367
|
-
window.classNames = classNames;
|
|
1328
|
+
} else {
|
|
1329
|
+
for (let k in names) {
|
|
1330
|
+
if (names[k]) out += (out && " ") + k;
|
|
1368
1331
|
}
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
var classnamesExports = classnames.exports;
|
|
1373
|
-
|
|
1374
|
-
var classNames = getDefaultExportFromCjs(classnamesExports);
|
|
1332
|
+
}
|
|
1333
|
+
return out;
|
|
1334
|
+
}
|
|
1375
1335
|
|
|
1376
1336
|
function isFunction(obj) {
|
|
1377
1337
|
return typeof obj === "function";
|
|
@@ -1496,7 +1456,7 @@ function attrKvPair(rawAttr, rawVal) {
|
|
|
1496
1456
|
return null;
|
|
1497
1457
|
}
|
|
1498
1458
|
if (rawAttr === "class" && !isString_1(rawVal)) {
|
|
1499
|
-
rawVal =
|
|
1459
|
+
rawVal = cc(rawVal);
|
|
1500
1460
|
}
|
|
1501
1461
|
if (rawAttr === "style" && isPlainObject_1(rawVal)) {
|
|
1502
1462
|
rawVal = styleObjectToString(rawVal);
|
|
@@ -1718,7 +1678,9 @@ function jsx(tag, props, key, isStaticChildren, source, self) {
|
|
|
1718
1678
|
return new JsxElement(tag, props);
|
|
1719
1679
|
}
|
|
1720
1680
|
|
|
1721
|
-
|
|
1681
|
+
function jsxs(...args) {
|
|
1682
|
+
return new JsxRawHtml(jsx(...args).toString());
|
|
1683
|
+
}
|
|
1722
1684
|
|
|
1723
1685
|
function Fragment({children}) {
|
|
1724
1686
|
return new JsxFragment(children);
|
|
@@ -1318,62 +1318,22 @@ const entityMap = {
|
|
|
1318
1318
|
ffl: "ffllig"
|
|
1319
1319
|
};
|
|
1320
1320
|
|
|
1321
|
-
function
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
/*!
|
|
1330
|
-
Copyright (c) 2018 Jed Watson.
|
|
1331
|
-
Licensed under the MIT License (MIT), see
|
|
1332
|
-
http://jedwatson.github.io/classnames
|
|
1333
|
-
*/ (function(module) {
|
|
1334
|
-
(function() {
|
|
1335
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1336
|
-
function classNames() {
|
|
1337
|
-
var classes = [];
|
|
1338
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1339
|
-
var arg = arguments[i];
|
|
1340
|
-
if (!arg) continue;
|
|
1341
|
-
var argType = typeof arg;
|
|
1342
|
-
if (argType === "string" || argType === "number") {
|
|
1343
|
-
classes.push(arg);
|
|
1344
|
-
} else if (Array.isArray(arg)) {
|
|
1345
|
-
if (arg.length) {
|
|
1346
|
-
var inner = classNames.apply(null, arg);
|
|
1347
|
-
if (inner) {
|
|
1348
|
-
classes.push(inner);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
} else if (argType === "object") {
|
|
1352
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
1353
|
-
classes.push(arg.toString());
|
|
1354
|
-
continue;
|
|
1355
|
-
}
|
|
1356
|
-
for (var key in arg) {
|
|
1357
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1358
|
-
classes.push(key);
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1321
|
+
function cc(names) {
|
|
1322
|
+
if (typeof names === "string" || typeof names === "number") return "" + names;
|
|
1323
|
+
let out = "";
|
|
1324
|
+
if (Array.isArray(names)) {
|
|
1325
|
+
for (let i = 0, tmp; i < names.length; i++) {
|
|
1326
|
+
if ((tmp = cc(names[i])) !== "") {
|
|
1327
|
+
out += (out && " ") + tmp;
|
|
1362
1328
|
}
|
|
1363
|
-
return classes.join(" ");
|
|
1364
1329
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
} else {
|
|
1369
|
-
window.classNames = classNames;
|
|
1330
|
+
} else {
|
|
1331
|
+
for (let k in names) {
|
|
1332
|
+
if (names[k]) out += (out && " ") + k;
|
|
1370
1333
|
}
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
var classnamesExports = classnames.exports;
|
|
1375
|
-
|
|
1376
|
-
var classNames = getDefaultExportFromCjs(classnamesExports);
|
|
1334
|
+
}
|
|
1335
|
+
return out;
|
|
1336
|
+
}
|
|
1377
1337
|
|
|
1378
1338
|
function isFunction(obj) {
|
|
1379
1339
|
return typeof obj === "function";
|
|
@@ -1498,7 +1458,7 @@ function attrKvPair(rawAttr, rawVal) {
|
|
|
1498
1458
|
return null;
|
|
1499
1459
|
}
|
|
1500
1460
|
if (rawAttr === "class" && !isString_1(rawVal)) {
|
|
1501
|
-
rawVal =
|
|
1461
|
+
rawVal = cc(rawVal);
|
|
1502
1462
|
}
|
|
1503
1463
|
if (rawAttr === "style" && isPlainObject_1(rawVal)) {
|
|
1504
1464
|
rawVal = styleObjectToString(rawVal);
|
|
@@ -1720,7 +1680,9 @@ function jsx(tag, props, key, isStaticChildren, source, self) {
|
|
|
1720
1680
|
return new JsxElement(tag, props);
|
|
1721
1681
|
}
|
|
1722
1682
|
|
|
1723
|
-
|
|
1683
|
+
function jsxs(...args) {
|
|
1684
|
+
return new JsxRawHtml(jsx(...args).toString());
|
|
1685
|
+
}
|
|
1724
1686
|
|
|
1725
1687
|
function Fragment({children}) {
|
|
1726
1688
|
return new JsxFragment(children);
|
package/jsx-runtime.cjs
CHANGED
package/jsx-runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JsxComponent,
|
|
1
|
+
import { JsxComponent, AnyAttributes, ChildrenOnly } from './jsx-types';
|
|
2
2
|
import { JsxFragment } from './jsx-elements';
|
|
3
3
|
import { JsxNode } from './jsx-node';
|
|
4
|
-
export declare function jsx(tag: string | JsxComponent, props:
|
|
5
|
-
export declare
|
|
4
|
+
export declare function jsx(tag: string | JsxComponent, props: AnyAttributes, key?: unknown, isStaticChildren?: unknown, source?: unknown, self?: unknown): JsxNode;
|
|
5
|
+
export declare function jsxs(...args: Parameters<typeof jsx>): JsxNode;
|
|
6
6
|
export declare function Fragment({ children }: ChildrenOnly): JsxFragment;
|
package/jsx-runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Fragment, b as jsx, j as jsxs } from "./jsx-runtime-
|
|
1
|
+
export { F as Fragment, b as jsx, j as jsxs } from "./jsx-runtime-FjVmLblX.js";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { JsxNode } from './jsx-node';
|
|
2
|
+
import { AllGlobalAttributes } from './htmlspec/GlobalAttributes';
|
|
3
|
+
import { Override } from './util-types';
|
|
2
4
|
export interface Stringable {
|
|
3
5
|
toString(): string;
|
|
4
6
|
}
|
|
5
7
|
export type PlainObject = Record<PropertyKey, unknown>;
|
|
6
|
-
export type ClassNames = import('
|
|
8
|
+
export type ClassNames = import('classcat').Class;
|
|
7
9
|
export type StyleObject = import('csstype').Properties | import('csstype').PropertiesHyphen;
|
|
8
10
|
export type AttributeValue = Stringable | StyleObject | ClassNames;
|
|
9
11
|
export type AttrKvPair = [name: string, value: AttributeValue];
|
|
@@ -17,12 +19,17 @@ export type HtmlSafe = {
|
|
|
17
19
|
};
|
|
18
20
|
export type JsxRenderable = any;
|
|
19
21
|
export type JsxChildren = JsxRenderable | Iterable<JsxRenderable>;
|
|
20
|
-
export type
|
|
22
|
+
export type SpecialProps = {
|
|
21
23
|
children?: JsxChildren;
|
|
22
24
|
style?: StyleObject | string;
|
|
25
|
+
/**
|
|
26
|
+
* CSS class.
|
|
27
|
+
*/
|
|
23
28
|
class?: ClassNames;
|
|
24
29
|
};
|
|
25
|
-
export type
|
|
30
|
+
export type CommonProps = Override<AllGlobalAttributes, SpecialProps>;
|
|
31
|
+
export type AnyAttributes = Override<AttrObj, CommonProps>;
|
|
32
|
+
export type JsxComponent<P = AnyAttributes> = ((props: P) => JsxNode) & {
|
|
26
33
|
displayName?: string;
|
|
27
34
|
name?: string;
|
|
28
35
|
};
|
package/jsx.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
1
2
|
declare namespace JSX {
|
|
2
|
-
type IntrinsicElements =
|
|
3
|
-
[_ in import('./htmlspec/IntrinsicElements').HtmlElements]: import('./types').CommonProps;
|
|
4
|
-
};
|
|
3
|
+
type IntrinsicElements = import('./htmlspec/IntrinsicElements').IntrinsicElements;
|
|
5
4
|
type Element = import('./jsx-node').JsxNode;
|
|
6
5
|
interface ElementChildrenAttribute {
|
|
7
6
|
children: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpen/jsxhtml",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"packageManager": "bun@1.0.7",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -25,5 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"optionalDependencies": {
|
|
27
27
|
"elysia": ">=0.7.21"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"classcat": "^5.0.4"
|
|
28
31
|
}
|
|
29
32
|
}
|
package/render.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { JsxRenderable } from './types';
|
|
1
|
+
import { JsxRenderable } from './jsx-types';
|
|
2
2
|
export declare function render(el: JsxRenderable): string;
|
package/styleObjectToString.d.ts
CHANGED
package/util-types.d.ts
ADDED
package/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlatString, JsxChildren, JsxComponent } from './types';
|
|
1
|
+
import { FlatString, JsxChildren, JsxComponent } from './jsx-types';
|
|
2
2
|
export declare function mapIter<In, Out>(iterable: Iterable<In>, cb: (el: In, i: number) => Out): Out[];
|
|
3
3
|
export declare function getStringTag(value: any): string;
|
|
4
4
|
export declare function isEmptyChildren(children: JsxChildren): boolean;
|