-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.template.html
368 lines (354 loc) · 8.68 KB
/
index.template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!doctype html>
<html>
<head>
<title>JSX Elements Table</title>
<meta charset="UTF-8" />
<meta
name="description"
content="Table listing TypeScript types for `namespace JSX` for many frameworks."
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<link
href="./index.css"
rel="stylesheet"
/>
</head>
<body>
<section class="description">
<h1>namespace JSX Elements Table</h1>
<p>
This document shows a huge table of
<code>JSX HTML Elements</code>, it is generated using
<code>./jsx/data.json</code>. The table is automated and
generated on demand, with live data taken from the frameworks
repos, mdn, and browsers via puppeteer. Very few of the data
is hardcoded (such some of the obsolete
attributes/properties/tags that no longer exists in MDN).
</p>
<ul>
<li>
Tag Names: The <code>tagNames</code> come from a mashup
between frameworks and TypeScript
<code>TagNamesMaps</code> data.
</li>
<li>
Interfaces: The <code>interface names</code> comes from
<code
>document.createElementNS(ns,
tagName).constructor.name</code
>, which is more accurate than typescript.
</li>
<li>
Properties: Chrome/Firefox <code>attributes</code> come from
brute-forcing the element <code>setters</code> till an
<code>attribute</code> is added. The name of the
<code>attribute</code> is taken as <code>key</code>. When
something is marked as <code>prop</code> it means Chrome or
Firefox has a <code>setter</code> for it.
</li>
<li>
🗑️ indicates that the <code>tag</code> or
<code>attribute</code> is deprecated (live from mdn +
hardcoded)
</li>
<li>
🛑 indicates that the <code>key</code> resembles a
<code>prop</code> but such a prop does not exist. Setting
<code>node.propName = value</code> will not produce the
expected result.
<u
>Frameworks are <b>strongly discouraged</b> from inventing
non-existent <code>properties</code> (e.g., keys with
custom casing, except for event handlers like
<code>onClick</code>). This can cause confusion. For
example, <code>autoFocus</code> does not exist; the
correct name is <code>autofocus</code>.
</u>
</li>
<li>
🔗 indicates the <code>prop</code> it's inherited (from the
element prototype chain)
</li>
<li>
☢ indicates the <code>key</code> it's experimental (live
from mdn)
</li>
<li>
⚠ indicates the <code>key</code> it's non-standard (live
from mdn)
</li>
<li>
⁉ indicates something weird is going on with
<code>key</code> (to be investigated)
</li>
<li>
<code>SVG</code> is not shown because it needs some more
work
</li>
</ul>
<p>
This is an attempt to unify the effort required to update this
information.
</p>
<h2>Data Links:</h2>
<ul>
<li>
<a href="https://solidjs.com/">https://solidjs.com/</a>
</li>
<li>
<a href="https://github.com/potahtml/pota"
>https://github.com/potahtml/pota</a
>
</li>
<li>
<a href="https://github.com/vobyjs/voby"
>https://github.com/vobyjs/voby</a
>
</li>
<li><a href="https://vuejs.org/">https://vuejs.org/</a></li>
<li>
<a href="https://preactjs.com/">https://preactjs.com/</a>
</li>
<li><a href="https://react.dev/">https://react.dev/</a></li>
<li>
<a
href="https://github.com/microsoft/vscode-html-languageservice"
>https://github.com/microsoft/vscode-html-languageservice</a
>
</li>
<li>
<a href="https://developer.mozilla.org/"
>https://developer.mozilla.org/</a
>
</li>
<li>
<a href="https://www.google.com/chrome/"
>https://www.google.com/chrome/</a
>
</li>
<li>
<a href="https://www.mozilla.org/"
>https://www.mozilla.org/</a
>
</li>
</ul>
<h2>Table Settings</h2>
<form>
<fieldset>
<legend>Table Fixed:</legend>
<label>
<input
type="radio"
name="table-fixed"
value="yes"
/>
Yes</label
>
<label>
<input
type="radio"
name="table-fixed"
value="no"
checked
/>
No</label
>
</fieldset>
<fieldset>
<legend>Table Size:</legend>
<label>
<input
type="range"
min="20"
max="100"
name="table-size"
value="100"
/>
</label>
</fieldset>
<fieldset>
<legend>Data:</legend>
<label
><input
type="checkbox"
name="Solid"
value="Solid"
checked
/>
SolidJS</label
>
<label
><input
type="checkbox"
name="pota"
value="pota"
checked
/>
pota</label
>
<label
><input
type="checkbox"
name="Voby"
value="Voby"
checked
/>
Voby</label
>
<label
><input
type="checkbox"
name="Vue"
value="Vue"
checked
/>
Vue</label
>
<label
><input
type="checkbox"
name="Preact"
value="Preact"
checked
/>
Preact</label
>
<label
><input
type="checkbox"
name="React"
value="React"
checked
/>
React</label
>
<label
><input
type="checkbox"
name="VSCode"
value="VSCode"
/>
VSCode</label
>
</fieldset>
</form>
<style
type="text/css"
id="settings-styles"
></style>
<script type="text/javascript">
document.onclick = e => {
const tr = e.target.closest('tr')
if (tr) {
tr.style.background = tr.style.background ? null : 'black'
}
}
document.oninput = ({ target } = e) => {
if (target.type !== 'search') {
setSettings(target)
return
}
const search = target.value.trim().toLowerCase()
if (!search) {
const elements = document.querySelectorAll('tr, .table')
for (const el of [...elements]) {
el.style.display = null
}
return
}
// filter rows
const trs = document.querySelectorAll('tbody tr')
for (const tr of [...trs]) {
tr.style.display = tr.textContent
.toLowerCase()
.includes(search)
? null
: 'none'
}
// filter whole table and heading if nothing matched
const tables = document.querySelectorAll('table')
for (const table of [...tables]) {
if (
[...table.querySelectorAll('tbody tr')].some(
tr => tr.style.display !== 'none',
)
) {
table.parentNode.style.display = null
continue
}
table.parentNode.style.display = 'none'
}
}
// settings
const store = localStorage
function setSettings(target) {
const { name, value, checked, type } = target
store[name] = type === 'checkbox' ? checked : value
loadSettings()
}
function loadSettings() {
const body = document.body
const $ = document.querySelector.bind(document)
store['table-fixed'] = store['table-fixed'] || 'no'
body.dataset['tableFixed'] = store['table-fixed']
$(
`[name="table-fixed"][value="${store['table-fixed']}"]`,
).click()
store['table-size'] = store['table-size'] || '100'
body.dataset['tableSize'] = store['table-size']
$(`[name="table-size"]`).value = +store['table-size']
$('#settings-styles').textContent =
`.content{ max-width: ${store['table-size']}%}`
for (const name of [
'Solid',
'pota',
'Voby',
'Vue',
'Preact',
'React',
'VSCode',
]) {
store[name] = store[name] || 'true'
body.dataset[name.toLowerCase()] = store[name]
$(`[value="${name}"]`).checked = store[name] === 'true'
}
}
loadSettings()
</script>
<h2>Open Collective</h2>
<p>
<b>Sponsor</b> the project, Thanks!
<a href="https://opencollective.com/tito-bouzout"
>https://opencollective.com/tito-bouzout</a
>
</p>
</section>
<section class="sponsor">
Sponsored by
<a href="https://www.solidjs.com/"
>SolidJS
<img
src="https://www.solidjs.com/img/logo/without-wordmark/logo.png"
width="19"
/></a>
Become a
<a href="https://opencollective.com/tito-bouzout">Sponsor</a>
<a href="https://github.com/potahtml/namespace-jsx-project"
><img
class="github"
src="./github-mark-white.png"
width="19"
/></a>
</section>
<section class="content">
<script src="https://pota.quack.uy/importmap/importmap.quack.js"></script>
<script
type="module"
src="index.js"
></script>
</section>
</body>
</html>