attrs-in-props 3.2.3 → 3.2.7

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