attrs-in-props 2.11.132 → 2.11.169
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/index.js +1057 -0
- package/package.json +5 -2
package/index.js
ADDED
|
@@ -0,0 +1,1057 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { isDefined, isString } from '@domql/utils'
|
|
4
|
+
|
|
5
|
+
export const ARIA_ROLES = [
|
|
6
|
+
'alert',
|
|
7
|
+
'alertdialog',
|
|
8
|
+
'application',
|
|
9
|
+
'article',
|
|
10
|
+
'banner',
|
|
11
|
+
'button',
|
|
12
|
+
'cell',
|
|
13
|
+
'checkbox',
|
|
14
|
+
'columnheader',
|
|
15
|
+
'combobox',
|
|
16
|
+
'complementary',
|
|
17
|
+
'contentinfo',
|
|
18
|
+
'definition',
|
|
19
|
+
'dialog',
|
|
20
|
+
'directory',
|
|
21
|
+
'document',
|
|
22
|
+
'feed',
|
|
23
|
+
'figure',
|
|
24
|
+
'form',
|
|
25
|
+
'grid',
|
|
26
|
+
'gridcell',
|
|
27
|
+
'group',
|
|
28
|
+
'heading',
|
|
29
|
+
'img',
|
|
30
|
+
'link',
|
|
31
|
+
'list',
|
|
32
|
+
'listbox',
|
|
33
|
+
'listitem',
|
|
34
|
+
'log',
|
|
35
|
+
'main',
|
|
36
|
+
'marquee',
|
|
37
|
+
'math',
|
|
38
|
+
'menu',
|
|
39
|
+
'menubar',
|
|
40
|
+
'menuitem',
|
|
41
|
+
'menuitemcheckbox',
|
|
42
|
+
'menuitemradio',
|
|
43
|
+
'navigation',
|
|
44
|
+
'none',
|
|
45
|
+
'note',
|
|
46
|
+
'option',
|
|
47
|
+
'presentation',
|
|
48
|
+
'progressbar',
|
|
49
|
+
'radio',
|
|
50
|
+
'radiogroup',
|
|
51
|
+
'region',
|
|
52
|
+
'row',
|
|
53
|
+
'rowgroup',
|
|
54
|
+
'rowheader',
|
|
55
|
+
'scrollbar',
|
|
56
|
+
'search',
|
|
57
|
+
'searchbox',
|
|
58
|
+
'separator',
|
|
59
|
+
'slider',
|
|
60
|
+
'spinbutton',
|
|
61
|
+
'status',
|
|
62
|
+
'switch',
|
|
63
|
+
'tab',
|
|
64
|
+
'table',
|
|
65
|
+
'tablist',
|
|
66
|
+
'tabpanel',
|
|
67
|
+
'term',
|
|
68
|
+
'textbox',
|
|
69
|
+
'timer',
|
|
70
|
+
'toolbar',
|
|
71
|
+
'tooltip',
|
|
72
|
+
'tree',
|
|
73
|
+
'treegrid',
|
|
74
|
+
'treeitem'
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
export const HTML_ATTRIBUTES = {
|
|
78
|
+
default: [
|
|
79
|
+
'accesskey',
|
|
80
|
+
'autofocus',
|
|
81
|
+
'class',
|
|
82
|
+
'contenteditable',
|
|
83
|
+
'contextmenu',
|
|
84
|
+
'dir',
|
|
85
|
+
'draggable',
|
|
86
|
+
'hidden',
|
|
87
|
+
'id',
|
|
88
|
+
'lang',
|
|
89
|
+
'part',
|
|
90
|
+
'placeholder',
|
|
91
|
+
'slot',
|
|
92
|
+
'spellcheck',
|
|
93
|
+
'style',
|
|
94
|
+
'tabindex',
|
|
95
|
+
'title',
|
|
96
|
+
'translate',
|
|
97
|
+
'inert',
|
|
98
|
+
'radiogroup',
|
|
99
|
+
'role',
|
|
100
|
+
'about',
|
|
101
|
+
'datatype',
|
|
102
|
+
'inlist',
|
|
103
|
+
'prefix',
|
|
104
|
+
'property',
|
|
105
|
+
'resource',
|
|
106
|
+
'typeof',
|
|
107
|
+
'vocab',
|
|
108
|
+
'autocapitalize',
|
|
109
|
+
'autocorrect',
|
|
110
|
+
'autosave',
|
|
111
|
+
'color',
|
|
112
|
+
'itemprop',
|
|
113
|
+
'itemscope',
|
|
114
|
+
'itemtype',
|
|
115
|
+
'itemid',
|
|
116
|
+
'itemref',
|
|
117
|
+
'results',
|
|
118
|
+
'security',
|
|
119
|
+
'unselectable',
|
|
120
|
+
'is'
|
|
121
|
+
],
|
|
122
|
+
|
|
123
|
+
a: [
|
|
124
|
+
'accesskey',
|
|
125
|
+
'charset',
|
|
126
|
+
'coords',
|
|
127
|
+
'download',
|
|
128
|
+
'href',
|
|
129
|
+
'hreflang',
|
|
130
|
+
'name',
|
|
131
|
+
'rel',
|
|
132
|
+
'rev',
|
|
133
|
+
'shape',
|
|
134
|
+
'target',
|
|
135
|
+
'type'
|
|
136
|
+
],
|
|
137
|
+
|
|
138
|
+
aria: [
|
|
139
|
+
'aria-activedescendant',
|
|
140
|
+
'aria-atomic',
|
|
141
|
+
'aria-autocomplete',
|
|
142
|
+
'aria-checked',
|
|
143
|
+
'aria-colcount',
|
|
144
|
+
'aria-colindex',
|
|
145
|
+
'aria-colspan',
|
|
146
|
+
'aria-controls',
|
|
147
|
+
'aria-current',
|
|
148
|
+
'aria-describedby',
|
|
149
|
+
'aria-details',
|
|
150
|
+
'aria-dropeffect',
|
|
151
|
+
'aria-errormessage',
|
|
152
|
+
'aria-expanded',
|
|
153
|
+
'aria-flowto',
|
|
154
|
+
'aria-grabbed',
|
|
155
|
+
'aria-haspopup',
|
|
156
|
+
'aria-hidden',
|
|
157
|
+
'aria-invalid',
|
|
158
|
+
'aria-keyshortcuts',
|
|
159
|
+
'aria-label',
|
|
160
|
+
'aria-labelledby',
|
|
161
|
+
'aria-level',
|
|
162
|
+
'aria-live',
|
|
163
|
+
'aria-modal',
|
|
164
|
+
'aria-multiline',
|
|
165
|
+
'aria-multiselectable',
|
|
166
|
+
'aria-orientation',
|
|
167
|
+
'aria-owns',
|
|
168
|
+
'aria-placeholder',
|
|
169
|
+
'aria-posinset',
|
|
170
|
+
'aria-pressed',
|
|
171
|
+
'aria-readonly',
|
|
172
|
+
'aria-relevant',
|
|
173
|
+
'aria-required',
|
|
174
|
+
'aria-roledescription',
|
|
175
|
+
'aria-rowcount',
|
|
176
|
+
'aria-rowindex',
|
|
177
|
+
'aria-rowspan',
|
|
178
|
+
'aria-selected',
|
|
179
|
+
'aria-setsize',
|
|
180
|
+
'aria-sort',
|
|
181
|
+
'aria-valuemax',
|
|
182
|
+
'aria-valuemin',
|
|
183
|
+
'aria-valuenow',
|
|
184
|
+
'aria-valuetext'
|
|
185
|
+
],
|
|
186
|
+
|
|
187
|
+
anchor: [
|
|
188
|
+
'download',
|
|
189
|
+
'href',
|
|
190
|
+
'hreflang',
|
|
191
|
+
'media',
|
|
192
|
+
'ping',
|
|
193
|
+
'rel',
|
|
194
|
+
'target',
|
|
195
|
+
'type',
|
|
196
|
+
'referrerpolicy'
|
|
197
|
+
],
|
|
198
|
+
|
|
199
|
+
audio: [
|
|
200
|
+
|
|
201
|
+
],
|
|
202
|
+
|
|
203
|
+
area: [
|
|
204
|
+
'alt',
|
|
205
|
+
'coords',
|
|
206
|
+
'download',
|
|
207
|
+
'href',
|
|
208
|
+
'hreflang',
|
|
209
|
+
'media',
|
|
210
|
+
'referrerpolicy',
|
|
211
|
+
'rel',
|
|
212
|
+
'shape',
|
|
213
|
+
'target',
|
|
214
|
+
'ping'
|
|
215
|
+
],
|
|
216
|
+
|
|
217
|
+
base: [
|
|
218
|
+
'href',
|
|
219
|
+
'target'
|
|
220
|
+
],
|
|
221
|
+
|
|
222
|
+
blockquote: [
|
|
223
|
+
'cite'
|
|
224
|
+
],
|
|
225
|
+
|
|
226
|
+
button: [
|
|
227
|
+
'disabled',
|
|
228
|
+
'form',
|
|
229
|
+
'formaction',
|
|
230
|
+
'formenctype',
|
|
231
|
+
'formmethod',
|
|
232
|
+
'formnovalidate',
|
|
233
|
+
'formtarget',
|
|
234
|
+
'name',
|
|
235
|
+
'type',
|
|
236
|
+
'value'
|
|
237
|
+
],
|
|
238
|
+
|
|
239
|
+
canvas: [
|
|
240
|
+
'height',
|
|
241
|
+
'width'
|
|
242
|
+
],
|
|
243
|
+
|
|
244
|
+
col: [
|
|
245
|
+
'span',
|
|
246
|
+
'width'
|
|
247
|
+
],
|
|
248
|
+
|
|
249
|
+
colgroup: [
|
|
250
|
+
'span'
|
|
251
|
+
],
|
|
252
|
+
|
|
253
|
+
data: [
|
|
254
|
+
'value'
|
|
255
|
+
],
|
|
256
|
+
|
|
257
|
+
details: [
|
|
258
|
+
'open'
|
|
259
|
+
],
|
|
260
|
+
|
|
261
|
+
del: [
|
|
262
|
+
'cite',
|
|
263
|
+
'datetime'
|
|
264
|
+
],
|
|
265
|
+
|
|
266
|
+
dialog: [
|
|
267
|
+
'open'
|
|
268
|
+
],
|
|
269
|
+
|
|
270
|
+
embed: [
|
|
271
|
+
'height',
|
|
272
|
+
'src',
|
|
273
|
+
'type',
|
|
274
|
+
'width'
|
|
275
|
+
],
|
|
276
|
+
|
|
277
|
+
fieldset: [
|
|
278
|
+
'disabled',
|
|
279
|
+
'form',
|
|
280
|
+
'name'
|
|
281
|
+
],
|
|
282
|
+
|
|
283
|
+
form: [
|
|
284
|
+
'acceptcharset',
|
|
285
|
+
'action',
|
|
286
|
+
'autocomplete',
|
|
287
|
+
'enctype',
|
|
288
|
+
'method',
|
|
289
|
+
'name',
|
|
290
|
+
'novalidate',
|
|
291
|
+
'target',
|
|
292
|
+
'rel'
|
|
293
|
+
],
|
|
294
|
+
|
|
295
|
+
html: [
|
|
296
|
+
'manifest'
|
|
297
|
+
],
|
|
298
|
+
|
|
299
|
+
iframe: [
|
|
300
|
+
'allow',
|
|
301
|
+
'allowfullscreen',
|
|
302
|
+
'allowtransparency',
|
|
303
|
+
'frameborder',
|
|
304
|
+
'height',
|
|
305
|
+
'loading',
|
|
306
|
+
'marginheight',
|
|
307
|
+
'marginwidth',
|
|
308
|
+
'name',
|
|
309
|
+
'referrerpolicy',
|
|
310
|
+
'sandbox',
|
|
311
|
+
'scrolling',
|
|
312
|
+
'seamless',
|
|
313
|
+
'src',
|
|
314
|
+
'srcdoc',
|
|
315
|
+
'width'
|
|
316
|
+
],
|
|
317
|
+
|
|
318
|
+
img: [
|
|
319
|
+
'alt',
|
|
320
|
+
'crossorigin',
|
|
321
|
+
'decoding',
|
|
322
|
+
'height',
|
|
323
|
+
'ismap',
|
|
324
|
+
'loading',
|
|
325
|
+
'referrerpolicy',
|
|
326
|
+
'sizes',
|
|
327
|
+
'src',
|
|
328
|
+
'srcset',
|
|
329
|
+
'usemap',
|
|
330
|
+
'width'
|
|
331
|
+
],
|
|
332
|
+
|
|
333
|
+
ins: [
|
|
334
|
+
'cite',
|
|
335
|
+
'datetime'
|
|
336
|
+
],
|
|
337
|
+
|
|
338
|
+
input: [
|
|
339
|
+
'accept',
|
|
340
|
+
'alt',
|
|
341
|
+
'autocomplete',
|
|
342
|
+
'capture',
|
|
343
|
+
'checked',
|
|
344
|
+
'crossorigin',
|
|
345
|
+
'disabled',
|
|
346
|
+
'form',
|
|
347
|
+
'formaction',
|
|
348
|
+
'formenctype',
|
|
349
|
+
'formmethod',
|
|
350
|
+
'formnovalidate',
|
|
351
|
+
'formtarget',
|
|
352
|
+
'height',
|
|
353
|
+
'indeterminate',
|
|
354
|
+
'list',
|
|
355
|
+
'max',
|
|
356
|
+
'maxlength',
|
|
357
|
+
'min',
|
|
358
|
+
'minlength',
|
|
359
|
+
'multiple',
|
|
360
|
+
'name',
|
|
361
|
+
'pattern',
|
|
362
|
+
'placeholder',
|
|
363
|
+
'readonly',
|
|
364
|
+
'required',
|
|
365
|
+
'size',
|
|
366
|
+
'src',
|
|
367
|
+
'step',
|
|
368
|
+
'type',
|
|
369
|
+
'value',
|
|
370
|
+
'width'
|
|
371
|
+
],
|
|
372
|
+
|
|
373
|
+
keygen: [
|
|
374
|
+
'challenge',
|
|
375
|
+
'disabled',
|
|
376
|
+
'form',
|
|
377
|
+
'keytype',
|
|
378
|
+
'keyparams',
|
|
379
|
+
'name'
|
|
380
|
+
],
|
|
381
|
+
|
|
382
|
+
label: [
|
|
383
|
+
'form',
|
|
384
|
+
'for'
|
|
385
|
+
],
|
|
386
|
+
|
|
387
|
+
li: [
|
|
388
|
+
'value'
|
|
389
|
+
],
|
|
390
|
+
|
|
391
|
+
link: [
|
|
392
|
+
'as',
|
|
393
|
+
'crossorigin',
|
|
394
|
+
'href',
|
|
395
|
+
'hreflang',
|
|
396
|
+
'integrity',
|
|
397
|
+
'media',
|
|
398
|
+
'imagesrcset',
|
|
399
|
+
'imagesizes',
|
|
400
|
+
'referrerpolicy',
|
|
401
|
+
'rel',
|
|
402
|
+
'sizes',
|
|
403
|
+
'type',
|
|
404
|
+
'charset'
|
|
405
|
+
],
|
|
406
|
+
|
|
407
|
+
map: [
|
|
408
|
+
'name'
|
|
409
|
+
],
|
|
410
|
+
|
|
411
|
+
menu: [
|
|
412
|
+
'type'
|
|
413
|
+
],
|
|
414
|
+
|
|
415
|
+
media: [
|
|
416
|
+
'autoplay',
|
|
417
|
+
'controls',
|
|
418
|
+
'currenttime',
|
|
419
|
+
'defaultmuted',
|
|
420
|
+
'defaultplaybackrate',
|
|
421
|
+
'loop',
|
|
422
|
+
'mediagroup',
|
|
423
|
+
'muted',
|
|
424
|
+
'playsinline',
|
|
425
|
+
'preload',
|
|
426
|
+
'src',
|
|
427
|
+
'volume'
|
|
428
|
+
],
|
|
429
|
+
|
|
430
|
+
meta: [
|
|
431
|
+
'charset',
|
|
432
|
+
'content',
|
|
433
|
+
'http-equiv',
|
|
434
|
+
'name',
|
|
435
|
+
'media'
|
|
436
|
+
],
|
|
437
|
+
|
|
438
|
+
meter: [
|
|
439
|
+
'form',
|
|
440
|
+
'high',
|
|
441
|
+
'low',
|
|
442
|
+
'max',
|
|
443
|
+
'min',
|
|
444
|
+
'optimum',
|
|
445
|
+
'value'
|
|
446
|
+
],
|
|
447
|
+
|
|
448
|
+
quote: [
|
|
449
|
+
'cite'
|
|
450
|
+
],
|
|
451
|
+
|
|
452
|
+
object: [
|
|
453
|
+
'classid',
|
|
454
|
+
'data',
|
|
455
|
+
'form',
|
|
456
|
+
'height',
|
|
457
|
+
'name',
|
|
458
|
+
'type',
|
|
459
|
+
'usemap',
|
|
460
|
+
'width',
|
|
461
|
+
'wmode'
|
|
462
|
+
],
|
|
463
|
+
|
|
464
|
+
ol: [
|
|
465
|
+
'reversed',
|
|
466
|
+
'start',
|
|
467
|
+
'type'
|
|
468
|
+
],
|
|
469
|
+
|
|
470
|
+
optgroup: [
|
|
471
|
+
'disabled',
|
|
472
|
+
'label'
|
|
473
|
+
],
|
|
474
|
+
|
|
475
|
+
option: [
|
|
476
|
+
'disabled',
|
|
477
|
+
'label',
|
|
478
|
+
'selected',
|
|
479
|
+
'value'
|
|
480
|
+
],
|
|
481
|
+
|
|
482
|
+
output: [
|
|
483
|
+
'form',
|
|
484
|
+
'for',
|
|
485
|
+
'name'
|
|
486
|
+
],
|
|
487
|
+
|
|
488
|
+
param: [
|
|
489
|
+
'name',
|
|
490
|
+
'value'
|
|
491
|
+
],
|
|
492
|
+
|
|
493
|
+
progress: [
|
|
494
|
+
'max',
|
|
495
|
+
'value'
|
|
496
|
+
],
|
|
497
|
+
|
|
498
|
+
slot: [
|
|
499
|
+
'name'
|
|
500
|
+
],
|
|
501
|
+
|
|
502
|
+
script: [
|
|
503
|
+
'async',
|
|
504
|
+
'charset',
|
|
505
|
+
'crossorigin',
|
|
506
|
+
'defer',
|
|
507
|
+
'integrity',
|
|
508
|
+
'nomodule',
|
|
509
|
+
'nonce',
|
|
510
|
+
'referrerpolicy',
|
|
511
|
+
'src',
|
|
512
|
+
'type'
|
|
513
|
+
],
|
|
514
|
+
|
|
515
|
+
select: [
|
|
516
|
+
'autocomplete',
|
|
517
|
+
'disabled',
|
|
518
|
+
'form',
|
|
519
|
+
'multiple',
|
|
520
|
+
'name',
|
|
521
|
+
'required',
|
|
522
|
+
'size',
|
|
523
|
+
'value',
|
|
524
|
+
|
|
525
|
+
'onchange'
|
|
526
|
+
],
|
|
527
|
+
|
|
528
|
+
source: [
|
|
529
|
+
'height',
|
|
530
|
+
'media',
|
|
531
|
+
'sizes',
|
|
532
|
+
'src',
|
|
533
|
+
'srcset',
|
|
534
|
+
'type',
|
|
535
|
+
'width'
|
|
536
|
+
],
|
|
537
|
+
|
|
538
|
+
style: [
|
|
539
|
+
'media',
|
|
540
|
+
'nonce',
|
|
541
|
+
'scoped',
|
|
542
|
+
'type'
|
|
543
|
+
],
|
|
544
|
+
|
|
545
|
+
table: [
|
|
546
|
+
'align',
|
|
547
|
+
'bgcolor',
|
|
548
|
+
'border',
|
|
549
|
+
'cellpadding',
|
|
550
|
+
'cellspacing',
|
|
551
|
+
'frame',
|
|
552
|
+
'rules',
|
|
553
|
+
'summary',
|
|
554
|
+
'width'
|
|
555
|
+
],
|
|
556
|
+
|
|
557
|
+
textarea: [
|
|
558
|
+
'autocomplete',
|
|
559
|
+
'cols',
|
|
560
|
+
'dirname',
|
|
561
|
+
'disabled',
|
|
562
|
+
'form',
|
|
563
|
+
'maxlength',
|
|
564
|
+
'minlength',
|
|
565
|
+
'name',
|
|
566
|
+
'placeholder',
|
|
567
|
+
'readonly',
|
|
568
|
+
'required',
|
|
569
|
+
'rows',
|
|
570
|
+
'value',
|
|
571
|
+
'wrap'
|
|
572
|
+
],
|
|
573
|
+
|
|
574
|
+
td: [
|
|
575
|
+
'align',
|
|
576
|
+
'colspan',
|
|
577
|
+
'headers',
|
|
578
|
+
'rowspan',
|
|
579
|
+
'scope',
|
|
580
|
+
'abbr',
|
|
581
|
+
'height',
|
|
582
|
+
'width',
|
|
583
|
+
'valign'
|
|
584
|
+
],
|
|
585
|
+
|
|
586
|
+
th: [
|
|
587
|
+
'align',
|
|
588
|
+
'colspan',
|
|
589
|
+
'headers',
|
|
590
|
+
'rowspan',
|
|
591
|
+
'scope',
|
|
592
|
+
'abbr'
|
|
593
|
+
],
|
|
594
|
+
|
|
595
|
+
time: [
|
|
596
|
+
'datetime'
|
|
597
|
+
],
|
|
598
|
+
|
|
599
|
+
track: [
|
|
600
|
+
'default',
|
|
601
|
+
'kind',
|
|
602
|
+
'label',
|
|
603
|
+
'src',
|
|
604
|
+
'srclang'
|
|
605
|
+
],
|
|
606
|
+
|
|
607
|
+
video: [
|
|
608
|
+
'height',
|
|
609
|
+
'playsinline',
|
|
610
|
+
'poster',
|
|
611
|
+
'width',
|
|
612
|
+
'disablepictureinpicture',
|
|
613
|
+
'disableremoteplayback'
|
|
614
|
+
],
|
|
615
|
+
|
|
616
|
+
svg: [
|
|
617
|
+
'className',
|
|
618
|
+
'class',
|
|
619
|
+
'color',
|
|
620
|
+
'height',
|
|
621
|
+
'id',
|
|
622
|
+
'lang',
|
|
623
|
+
'max',
|
|
624
|
+
'media',
|
|
625
|
+
'method',
|
|
626
|
+
'min',
|
|
627
|
+
'name',
|
|
628
|
+
'style',
|
|
629
|
+
'target',
|
|
630
|
+
'type',
|
|
631
|
+
'width',
|
|
632
|
+
|
|
633
|
+
// Other HTML properties supported by SVG elements in browsers
|
|
634
|
+
'role',
|
|
635
|
+
'tabindex',
|
|
636
|
+
'crossorigin',
|
|
637
|
+
|
|
638
|
+
// SVG Specific attributes
|
|
639
|
+
'accent-height',
|
|
640
|
+
'accumulate',
|
|
641
|
+
'additive',
|
|
642
|
+
'alignment-baseline',
|
|
643
|
+
'allowReorder',
|
|
644
|
+
'alphabetic',
|
|
645
|
+
'amplitude',
|
|
646
|
+
'arabic-form',
|
|
647
|
+
'ascent',
|
|
648
|
+
'attributeName',
|
|
649
|
+
'attributeType',
|
|
650
|
+
'autoReverse',
|
|
651
|
+
'azimuth',
|
|
652
|
+
'baseFrequency',
|
|
653
|
+
'baseline-shift',
|
|
654
|
+
'baseProfile',
|
|
655
|
+
'bbox',
|
|
656
|
+
'begin',
|
|
657
|
+
'bias',
|
|
658
|
+
'by',
|
|
659
|
+
'calcMode',
|
|
660
|
+
'cap-height',
|
|
661
|
+
'clip',
|
|
662
|
+
'clip-path',
|
|
663
|
+
'clipPathUnits',
|
|
664
|
+
'clip-rule',
|
|
665
|
+
'color-interpolation',
|
|
666
|
+
'color-interpolation-filters',
|
|
667
|
+
'color-profile',
|
|
668
|
+
'color-rendering',
|
|
669
|
+
'contentScriptType',
|
|
670
|
+
'contentStyleType',
|
|
671
|
+
'cursor',
|
|
672
|
+
'cx',
|
|
673
|
+
'cy',
|
|
674
|
+
'd',
|
|
675
|
+
'decelerate',
|
|
676
|
+
'descent',
|
|
677
|
+
'diffuseConstant',
|
|
678
|
+
'direction',
|
|
679
|
+
'display',
|
|
680
|
+
'divisor',
|
|
681
|
+
'dominant-baseline',
|
|
682
|
+
'dur',
|
|
683
|
+
'dx',
|
|
684
|
+
'dy',
|
|
685
|
+
'edgeMode',
|
|
686
|
+
'elevation',
|
|
687
|
+
'enable-background',
|
|
688
|
+
'end',
|
|
689
|
+
'exponent',
|
|
690
|
+
'externalResourcesRequired',
|
|
691
|
+
'fill',
|
|
692
|
+
'fill-opacity',
|
|
693
|
+
'fill-rule',
|
|
694
|
+
'filter',
|
|
695
|
+
'filterRes',
|
|
696
|
+
'filterUnits',
|
|
697
|
+
'flood-color',
|
|
698
|
+
'flood-opacity',
|
|
699
|
+
'focusable',
|
|
700
|
+
'font-family',
|
|
701
|
+
'font-size',
|
|
702
|
+
'font-size-adjust',
|
|
703
|
+
'font-stretch',
|
|
704
|
+
'font-style',
|
|
705
|
+
'font-variant',
|
|
706
|
+
'font-weight',
|
|
707
|
+
'format',
|
|
708
|
+
'from',
|
|
709
|
+
'fx',
|
|
710
|
+
'fy',
|
|
711
|
+
'g1',
|
|
712
|
+
'g2',
|
|
713
|
+
'glyph-name',
|
|
714
|
+
'glyph-orientation-horizontal',
|
|
715
|
+
'glyph-orientation-vertical',
|
|
716
|
+
'glyphRef',
|
|
717
|
+
'gradientTransform',
|
|
718
|
+
'gradientUnits',
|
|
719
|
+
'hanging',
|
|
720
|
+
'href',
|
|
721
|
+
'horiz-adv-x',
|
|
722
|
+
'horiz-origin-x',
|
|
723
|
+
'ideographic',
|
|
724
|
+
'image-rendering',
|
|
725
|
+
'in2',
|
|
726
|
+
'in',
|
|
727
|
+
'intercept',
|
|
728
|
+
'k1',
|
|
729
|
+
'k2',
|
|
730
|
+
'k3',
|
|
731
|
+
'k4',
|
|
732
|
+
'k',
|
|
733
|
+
'kernelMatrix',
|
|
734
|
+
'kernelUnitLength',
|
|
735
|
+
'kerning',
|
|
736
|
+
'keyPoints',
|
|
737
|
+
'keySplines',
|
|
738
|
+
'keyTimes',
|
|
739
|
+
'lengthAdjust',
|
|
740
|
+
'letter-spacing',
|
|
741
|
+
'lighting-color',
|
|
742
|
+
'limitingConeAngle',
|
|
743
|
+
'local',
|
|
744
|
+
'marker-end',
|
|
745
|
+
'markerHeight',
|
|
746
|
+
'marker-mid',
|
|
747
|
+
'marker-start',
|
|
748
|
+
'markerUnits',
|
|
749
|
+
'markerWidth',
|
|
750
|
+
'mask',
|
|
751
|
+
'maskContentUnits',
|
|
752
|
+
'maskUnits',
|
|
753
|
+
'mathematical',
|
|
754
|
+
'mode',
|
|
755
|
+
'numOctaves',
|
|
756
|
+
'offset',
|
|
757
|
+
'opacity',
|
|
758
|
+
'operator',
|
|
759
|
+
'order',
|
|
760
|
+
'orient',
|
|
761
|
+
'orientation',
|
|
762
|
+
'origin',
|
|
763
|
+
'overflow',
|
|
764
|
+
'overline-position',
|
|
765
|
+
'overline-thickness',
|
|
766
|
+
'paint-order',
|
|
767
|
+
'panose-1',
|
|
768
|
+
'path',
|
|
769
|
+
'pathLength',
|
|
770
|
+
'patternContentUnits',
|
|
771
|
+
'patternTransform',
|
|
772
|
+
'patternUnits',
|
|
773
|
+
'pointer-events',
|
|
774
|
+
'points',
|
|
775
|
+
'pointsAtX',
|
|
776
|
+
'pointsAtY',
|
|
777
|
+
'pointsAtZ',
|
|
778
|
+
'preserveAlpha',
|
|
779
|
+
'preserveAspectRatio',
|
|
780
|
+
'primitiveUnits',
|
|
781
|
+
'r',
|
|
782
|
+
'radius',
|
|
783
|
+
'refX',
|
|
784
|
+
'refY',
|
|
785
|
+
'rendering-intent',
|
|
786
|
+
'repeatCount',
|
|
787
|
+
'repeatDur',
|
|
788
|
+
'requiredExtensions',
|
|
789
|
+
'requiredFeatures',
|
|
790
|
+
'restart',
|
|
791
|
+
'result',
|
|
792
|
+
'rotate',
|
|
793
|
+
'rx',
|
|
794
|
+
'ry',
|
|
795
|
+
'scale',
|
|
796
|
+
'seed',
|
|
797
|
+
'shape-rendering',
|
|
798
|
+
'slope',
|
|
799
|
+
'spacing',
|
|
800
|
+
'specularConstant',
|
|
801
|
+
'specularExponent',
|
|
802
|
+
'speed',
|
|
803
|
+
'spreadMethod',
|
|
804
|
+
'startOffset',
|
|
805
|
+
'stdDeviation',
|
|
806
|
+
'stemh',
|
|
807
|
+
'stemv',
|
|
808
|
+
'stitchTiles',
|
|
809
|
+
'stop-color',
|
|
810
|
+
'stop-opacity',
|
|
811
|
+
'strikethrough-position',
|
|
812
|
+
'strikethrough-thickness',
|
|
813
|
+
'string',
|
|
814
|
+
'stroke',
|
|
815
|
+
'stroke-dasharray',
|
|
816
|
+
'stroke-dashoffset',
|
|
817
|
+
'stroke-linecap',
|
|
818
|
+
'stroke-linejoin',
|
|
819
|
+
'stroke-miterlimit',
|
|
820
|
+
'stroke-opacity',
|
|
821
|
+
'stroke-width',
|
|
822
|
+
'surfaceScale',
|
|
823
|
+
'systemLanguage',
|
|
824
|
+
'tableValues',
|
|
825
|
+
'targetX',
|
|
826
|
+
'targetY',
|
|
827
|
+
'text-anchor',
|
|
828
|
+
'text-decoration',
|
|
829
|
+
'textLength',
|
|
830
|
+
'text-rendering',
|
|
831
|
+
'to',
|
|
832
|
+
'transform',
|
|
833
|
+
'u1',
|
|
834
|
+
'u2',
|
|
835
|
+
'underline-position',
|
|
836
|
+
'underline-thickness',
|
|
837
|
+
'unicode',
|
|
838
|
+
'unicode-bidi',
|
|
839
|
+
'unicode-range',
|
|
840
|
+
'units-per-em',
|
|
841
|
+
'v-alphabetic',
|
|
842
|
+
'values',
|
|
843
|
+
'vector-effect',
|
|
844
|
+
'version',
|
|
845
|
+
'vert-adv-y',
|
|
846
|
+
'vert-origin-x',
|
|
847
|
+
'vert-origin-y',
|
|
848
|
+
'v-hanging',
|
|
849
|
+
'v-ideographic',
|
|
850
|
+
'viewBox',
|
|
851
|
+
'viewTarget',
|
|
852
|
+
'visibility',
|
|
853
|
+
'v-mathematical',
|
|
854
|
+
'widths',
|
|
855
|
+
'word-spacing',
|
|
856
|
+
'writing-mode',
|
|
857
|
+
'x1',
|
|
858
|
+
'x2',
|
|
859
|
+
'x',
|
|
860
|
+
'xChannelSelector',
|
|
861
|
+
'x-height',
|
|
862
|
+
'xlink:actuate',
|
|
863
|
+
'xlink:arcrole',
|
|
864
|
+
'xlink:href',
|
|
865
|
+
'xlink:role',
|
|
866
|
+
'xlink:show',
|
|
867
|
+
'xlink:title',
|
|
868
|
+
'xlink:type',
|
|
869
|
+
'xml:base',
|
|
870
|
+
'xml:lang',
|
|
871
|
+
'xmlns',
|
|
872
|
+
'xmlns:xlink',
|
|
873
|
+
'xml:space',
|
|
874
|
+
'y1',
|
|
875
|
+
'y2',
|
|
876
|
+
'y',
|
|
877
|
+
'yChannelSelector',
|
|
878
|
+
'z',
|
|
879
|
+
'zoomAndPan'
|
|
880
|
+
]
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export const DOM_EVENTS = [
|
|
884
|
+
// Clipboard Events
|
|
885
|
+
'oncopy',
|
|
886
|
+
'oncut',
|
|
887
|
+
'onpaste',
|
|
888
|
+
|
|
889
|
+
// Composition Events
|
|
890
|
+
'oncompositionend',
|
|
891
|
+
'oncompositionstart',
|
|
892
|
+
'oncompositionupdate',
|
|
893
|
+
|
|
894
|
+
// Focus Events
|
|
895
|
+
'onfocus',
|
|
896
|
+
'onfocusin',
|
|
897
|
+
'onfocusout',
|
|
898
|
+
'onblur',
|
|
899
|
+
|
|
900
|
+
// Form Events
|
|
901
|
+
'onchange',
|
|
902
|
+
'onbeforeinput',
|
|
903
|
+
'oninput',
|
|
904
|
+
'onreset',
|
|
905
|
+
'onsubmit',
|
|
906
|
+
'oninvalid',
|
|
907
|
+
'onformdata',
|
|
908
|
+
|
|
909
|
+
// Image Events
|
|
910
|
+
'onload',
|
|
911
|
+
'onerror', // also a Media Event
|
|
912
|
+
|
|
913
|
+
// Detail Events
|
|
914
|
+
'ontoggle',
|
|
915
|
+
|
|
916
|
+
// Keyboard Events
|
|
917
|
+
'onkeydown',
|
|
918
|
+
'onkeypress',
|
|
919
|
+
'onkeyup',
|
|
920
|
+
|
|
921
|
+
// Media Events
|
|
922
|
+
'onabort',
|
|
923
|
+
'oncanplay',
|
|
924
|
+
'oncanplaythrough',
|
|
925
|
+
'oncuechange',
|
|
926
|
+
'ondurationchange',
|
|
927
|
+
'onemptied',
|
|
928
|
+
'onencrypted',
|
|
929
|
+
'onended',
|
|
930
|
+
'onloadeddata',
|
|
931
|
+
'onloadedmetadata',
|
|
932
|
+
'onloadstart',
|
|
933
|
+
'onpause',
|
|
934
|
+
'onplay',
|
|
935
|
+
'onplaying',
|
|
936
|
+
'onprogress',
|
|
937
|
+
'onratechange',
|
|
938
|
+
'onseeked',
|
|
939
|
+
'onseeking',
|
|
940
|
+
'onstalled',
|
|
941
|
+
'onsuspend',
|
|
942
|
+
'ontimeupdate',
|
|
943
|
+
'onvolumechange',
|
|
944
|
+
'onwaiting',
|
|
945
|
+
|
|
946
|
+
// MouseEvents
|
|
947
|
+
'onauxclick',
|
|
948
|
+
'onclick',
|
|
949
|
+
'oncontextmenu',
|
|
950
|
+
'ondblclick',
|
|
951
|
+
'ondrag',
|
|
952
|
+
'ondragend',
|
|
953
|
+
'ondragenter',
|
|
954
|
+
'ondragexit',
|
|
955
|
+
'ondragleave',
|
|
956
|
+
'ondragover',
|
|
957
|
+
'ondragstart',
|
|
958
|
+
'ondrop',
|
|
959
|
+
'onmousedown',
|
|
960
|
+
'onmouseenter',
|
|
961
|
+
'onmouseleave',
|
|
962
|
+
'onmousemove',
|
|
963
|
+
'onmouseout',
|
|
964
|
+
'onmouseover',
|
|
965
|
+
'onmouseup',
|
|
966
|
+
|
|
967
|
+
// Selection Events
|
|
968
|
+
'onselect',
|
|
969
|
+
'onselectionchange',
|
|
970
|
+
'onselectstart',
|
|
971
|
+
|
|
972
|
+
// Touch Events
|
|
973
|
+
'ontouchcancel',
|
|
974
|
+
'ontouchend',
|
|
975
|
+
'ontouchmove',
|
|
976
|
+
'ontouchstart',
|
|
977
|
+
|
|
978
|
+
// Pointer Events
|
|
979
|
+
'ongotpointercapture',
|
|
980
|
+
'onpointercancel',
|
|
981
|
+
'onpointerdown',
|
|
982
|
+
'onpointerenter',
|
|
983
|
+
'onpointerleave',
|
|
984
|
+
'onpointermove',
|
|
985
|
+
'onpointerout',
|
|
986
|
+
'onpointerover',
|
|
987
|
+
'onpointerup',
|
|
988
|
+
'onlostpointercapture',
|
|
989
|
+
|
|
990
|
+
// UI Events
|
|
991
|
+
'onscroll',
|
|
992
|
+
'onresize',
|
|
993
|
+
|
|
994
|
+
// Wheel Events
|
|
995
|
+
'onwheel',
|
|
996
|
+
|
|
997
|
+
// Animation Events
|
|
998
|
+
'onanimationstart',
|
|
999
|
+
'onanimationend',
|
|
1000
|
+
'onanimationiteration',
|
|
1001
|
+
|
|
1002
|
+
// Transition Events
|
|
1003
|
+
'ontransitionstart',
|
|
1004
|
+
'ontransitionrun',
|
|
1005
|
+
'ontransitionend',
|
|
1006
|
+
'ontransitioncancel',
|
|
1007
|
+
|
|
1008
|
+
// Svelte Transition Events
|
|
1009
|
+
'onoutrostart',
|
|
1010
|
+
'onoutroend',
|
|
1011
|
+
'onintrostart',
|
|
1012
|
+
'onintroend',
|
|
1013
|
+
|
|
1014
|
+
// Message Events
|
|
1015
|
+
'onmessage',
|
|
1016
|
+
'onmessageerror',
|
|
1017
|
+
|
|
1018
|
+
// Document Events
|
|
1019
|
+
'onvisibilitychange',
|
|
1020
|
+
|
|
1021
|
+
// Global Events
|
|
1022
|
+
'oncancel',
|
|
1023
|
+
'onclose',
|
|
1024
|
+
'onfullscreenchange',
|
|
1025
|
+
'onfullscreenerror'
|
|
1026
|
+
]
|
|
1027
|
+
|
|
1028
|
+
export const checkAttributeByTagName = (tag, attribute) => {
|
|
1029
|
+
if (Object.prototype.hasOwnProperty.call(HTML_ATTRIBUTES, tag)) {
|
|
1030
|
+
const attributes = HTML_ATTRIBUTES[tag]
|
|
1031
|
+
return attributes.includes(attribute) || attributes.includes('default')
|
|
1032
|
+
} else {
|
|
1033
|
+
const defaultAttributes = HTML_ATTRIBUTES.default
|
|
1034
|
+
return defaultAttributes.includes(attribute)
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
export const checkEventFunctions = (key) => {
|
|
1038
|
+
if (!isString(key)) return false
|
|
1039
|
+
const normalizedKey = key.toLowerCase()
|
|
1040
|
+
return DOM_EVENTS.includes(normalizedKey)
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
export const filterAttributesByTagName = (tag, props) => {
|
|
1044
|
+
const filteredObject = {}
|
|
1045
|
+
|
|
1046
|
+
for (const key in props) {
|
|
1047
|
+
if (Object.prototype.hasOwnProperty.call(props, key)) {
|
|
1048
|
+
const isAttribute = checkAttributeByTagName(tag, key)
|
|
1049
|
+
const isEvent = checkEventFunctions(key)
|
|
1050
|
+
if (isDefined(props[key]) && (isAttribute || isEvent)) {
|
|
1051
|
+
filteredObject[key] = props[key]
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
return filteredObject
|
|
1057
|
+
}
|
package/package.json
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
"name": "attrs-in-props",
|
|
3
3
|
"description": "Utilize props as attributes",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "2.11.
|
|
5
|
+
"version": "2.11.169",
|
|
6
6
|
"repository": "https://github.com/symbo-ls/smbls",
|
|
7
7
|
"main": "index.js",
|
|
8
|
-
"gitHead": "
|
|
8
|
+
"gitHead": "65302965d0fc7e3c4342d5d4c4f2b4333af756a5",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@domql/utils": "latest"
|
|
11
|
+
}
|
|
9
12
|
}
|