@oscarpalmer/toretto 0.30.1 → 0.32.0

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.
Files changed (42) hide show
  1. package/dist/attribute/index.js +5 -5
  2. package/dist/event/delegation.js +21 -28
  3. package/dist/event/index.js +1 -1
  4. package/dist/find/index.js +3 -3
  5. package/dist/find/relative.js +22 -22
  6. package/dist/html/index.js +11 -8
  7. package/dist/html/sanitize.js +29 -14
  8. package/dist/index.js +2 -2
  9. package/dist/internal/attribute.js +5 -5
  10. package/dist/is.js +3 -3
  11. package/dist/style.js +2 -2
  12. package/dist/toretto.full.js +125 -264
  13. package/package.json +6 -6
  14. package/src/attribute/get.ts +4 -12
  15. package/src/attribute/index.ts +5 -5
  16. package/src/attribute/set.ts +13 -13
  17. package/src/data.ts +7 -16
  18. package/src/event/delegation.ts +24 -52
  19. package/src/event/index.ts +1 -7
  20. package/src/find/index.ts +2 -2
  21. package/src/find/relative.ts +43 -49
  22. package/src/html/index.ts +13 -12
  23. package/src/html/sanitize.ts +58 -31
  24. package/src/internal/attribute.ts +9 -9
  25. package/src/internal/element-value.ts +3 -4
  26. package/src/internal/get-value.ts +5 -8
  27. package/src/internal/is.ts +1 -3
  28. package/src/is.ts +4 -4
  29. package/src/models.ts +0 -5
  30. package/src/style.ts +12 -15
  31. package/types/attribute/get.d.ts +3 -3
  32. package/types/attribute/set.d.ts +9 -9
  33. package/types/data.d.ts +4 -5
  34. package/types/event/delegation.d.ts +1 -1
  35. package/types/find/index.d.ts +1 -1
  36. package/types/find/relative.d.ts +8 -2
  37. package/types/internal/attribute.d.ts +7 -7
  38. package/types/internal/element-value.d.ts +2 -3
  39. package/types/internal/get-value.d.ts +2 -3
  40. package/types/internal/is.d.ts +1 -2
  41. package/types/models.d.ts +0 -4
  42. package/types/style.d.ts +7 -7
package/types/style.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { HTMLOrSVGElement, TextDirection } from './models';
1
+ import type { TextDirection } from './models';
2
2
  export type StyleToggler = {
3
3
  /**
4
4
  * Set the provided styles on the element
@@ -16,7 +16,7 @@ export type StyleToggler = {
16
16
  * @param computed Get the computed style? _(defaults to `false`)_
17
17
  * @returns Style value
18
18
  */
19
- export declare function getStyle(element: HTMLOrSVGElement, property: keyof CSSStyleDeclaration, computed?: boolean): string | undefined;
19
+ export declare function getStyle(element: Element, property: keyof CSSStyleDeclaration, computed?: boolean): string | undefined;
20
20
  /**
21
21
  * Get styles from an element
22
22
  * @param element Element to get the styles from
@@ -24,31 +24,31 @@ export declare function getStyle(element: HTMLOrSVGElement, property: keyof CSSS
24
24
  * @param computed Get the computed styles? _(defaults to `false`)_
25
25
  * @returns Style values
26
26
  */
27
- export declare function getStyles<Property extends keyof CSSStyleDeclaration>(element: HTMLOrSVGElement, properties: Property[], computed?: boolean): Record<Property, string | undefined>;
27
+ export declare function getStyles<Property extends keyof CSSStyleDeclaration>(element: Element, properties: Property[], computed?: boolean): Record<Property, string | undefined>;
28
28
  /**
29
29
  * Get the text direction of an element
30
30
  * @param element Element to get the text direction from
31
31
  * @param computed Get the computed text direction? _(defaults to `false`)_
32
32
  * @returns Text direction
33
33
  */
34
- export declare function getTextDirection(element: HTMLOrSVGElement, computed?: boolean): TextDirection;
34
+ export declare function getTextDirection(element: Element, computed?: boolean): TextDirection;
35
35
  /**
36
36
  * Set a style on an element
37
37
  * @param element Element to set the style on
38
38
  * @param property Style name
39
39
  * @param value Style value
40
40
  */
41
- export declare function setStyle(element: HTMLOrSVGElement, property: keyof CSSStyleDeclaration, value?: string): void;
41
+ export declare function setStyle(element: Element, property: keyof CSSStyleDeclaration, value?: string): void;
42
42
  /**
43
43
  * Set styles on an element
44
44
  * @param element Element to set the styles on
45
45
  * @param styles Styles to set
46
46
  */
47
- export declare function setStyles(element: HTMLOrSVGElement, styles: Partial<CSSStyleDeclaration>): void;
47
+ export declare function setStyles(element: Element, styles: Partial<CSSStyleDeclaration>): void;
48
48
  /**
49
49
  * Toggle styles for an element
50
50
  * @param element Element to style
51
51
  * @param styles Styles to be set or removed
52
52
  * @returns Style toggler
53
53
  */
54
- export declare function toggleStyles(element: HTMLOrSVGElement, styles: Partial<CSSStyleDeclaration>): StyleToggler;
54
+ export declare function toggleStyles(element: Element, styles: Partial<CSSStyleDeclaration>): StyleToggler;