attrs-in-props 3.1.2 → 3.2.3

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