@oscarpalmer/toretto 0.45.0 → 0.47.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 (61) hide show
  1. package/dist/aria.d.mts +68 -0
  2. package/dist/aria.mjs +49 -0
  3. package/dist/attribute/get.attribute.d.mts +3 -0
  4. package/dist/attribute/get.attribute.mjs +3 -3
  5. package/dist/attribute/index.d.mts +7 -1
  6. package/dist/attribute/set.attribute.d.mts +5 -0
  7. package/dist/attribute/set.attribute.mjs +1 -1
  8. package/dist/create.d.mts +4 -2
  9. package/dist/create.mjs +1 -1
  10. package/dist/data.d.mts +4 -0
  11. package/dist/data.mjs +1 -2
  12. package/dist/event/delegation.mjs +3 -4
  13. package/dist/event/index.d.mts +9 -1
  14. package/dist/event/index.mjs +3 -2
  15. package/dist/find/index.d.mts +14 -1
  16. package/dist/find/index.mjs +36 -1
  17. package/dist/find/relative.d.mts +5 -0
  18. package/dist/find/relative.mjs +1 -0
  19. package/dist/focusable.d.mts +4 -0
  20. package/dist/focusable.mjs +4 -0
  21. package/dist/html/index.d.mts +8 -4
  22. package/dist/html/index.mjs +4 -3
  23. package/dist/index.d.mts +185 -22
  24. package/dist/index.mjs +295 -144
  25. package/dist/internal/attribute.mjs +2 -2
  26. package/dist/internal/element-value.mjs +2 -4
  27. package/dist/internal/is.d.mts +15 -3
  28. package/dist/internal/is.mjs +15 -3
  29. package/dist/is.d.mts +5 -2
  30. package/dist/is.mjs +4 -3
  31. package/dist/models.d.mts +21 -8
  32. package/dist/property/get.property.d.mts +2 -0
  33. package/dist/property/get.property.mjs +4 -3
  34. package/dist/property/set.property.d.mts +3 -0
  35. package/dist/property/set.property.mjs +3 -4
  36. package/dist/style.d.mts +7 -0
  37. package/dist/style.mjs +8 -4
  38. package/dist/touch.d.mts +4 -0
  39. package/package.json +10 -6
  40. package/src/aria.ts +166 -0
  41. package/src/attribute/get.attribute.ts +5 -3
  42. package/src/attribute/index.ts +6 -0
  43. package/src/attribute/set.attribute.ts +5 -0
  44. package/src/create.ts +5 -3
  45. package/src/data.ts +11 -6
  46. package/src/event/delegation.ts +5 -6
  47. package/src/event/index.ts +11 -8
  48. package/src/find/index.ts +64 -1
  49. package/src/find/relative.ts +5 -0
  50. package/src/focusable.ts +4 -0
  51. package/src/html/index.ts +11 -9
  52. package/src/index.ts +1 -0
  53. package/src/internal/attribute.ts +4 -2
  54. package/src/internal/element-value.ts +2 -3
  55. package/src/internal/is.ts +22 -2
  56. package/src/is.ts +4 -1
  57. package/src/models.ts +122 -8
  58. package/src/property/get.property.ts +6 -5
  59. package/src/property/set.property.ts +5 -3
  60. package/src/style.ts +12 -6
  61. package/src/touch.ts +4 -0
@@ -1,6 +1,7 @@
1
1
  //#region src/focusable.ts
2
2
  /**
3
3
  * Get a list of focusable elements within a parent element
4
+ *
4
5
  * @param parent Parent element
5
6
  * @returns Focusable elements
6
7
  */
@@ -15,6 +16,7 @@ function getItem(element, tabbable) {
15
16
  }
16
17
  /**
17
18
  * Get a list of tabbable elements within a parent element
19
+ *
18
20
  * @param parent Parent element
19
21
  * @returns Tabbable elements
20
22
  */
@@ -74,6 +76,7 @@ function isEditable(element) {
74
76
  }
75
77
  /**
76
78
  * Is the element focusable?
79
+ *
77
80
  * @param element Element to check
78
81
  * @returns `true` if focusable, otherwise `false`
79
82
  */
@@ -109,6 +112,7 @@ function isSummarised(item) {
109
112
  }
110
113
  /**
111
114
  * Is the element tabbable?
115
+ *
112
116
  * @param element Element to check
113
117
  * @returns `true` if tabbable, otherwise `false`
114
118
  */
@@ -1,24 +1,27 @@
1
1
  //#region src/html/index.d.ts
2
2
  type HtmlOptions = {
3
3
  /**
4
- * Cache template element for the HTML string? _(defaults to `true`)_
4
+ * Cache template element for the _HTML_ string? _(defaults to `true`)_
5
5
  */
6
6
  cache?: boolean;
7
7
  };
8
8
  /**
9
9
  * Create nodes from a template string
10
+ *
10
11
  * @returns Created nodes
11
12
  */
12
13
  declare function html(strings: TemplateStringsArray, ...values: unknown[]): Node[];
13
14
  /**
14
- * Create nodes from an HTML string or a template element
15
- * @param value HTML string or id for a template element
15
+ * Create nodes from an _HTML_ string or a template element
16
+ *
17
+ * @param value _HTML_ string or ID for a template element
16
18
  * @param options Options for creating nodes
17
19
  * @returns Created nodes
18
20
  */
19
21
  declare function html(value: string, options?: HtmlOptions): Node[];
20
22
  /**
21
23
  * Create nodes from a template element
24
+ *
22
25
  * @param template Template element
23
26
  * @param options Options for creating nodes
24
27
  * @returns Created nodes
@@ -30,10 +33,11 @@ declare namespace html {
30
33
  }
31
34
  /**
32
35
  * Sanitize one or more nodes, recursively
36
+ *
33
37
  * @param value Node or nodes to sanitize
34
38
  * @param options Sanitization options
35
39
  * @returns Sanitized nodes
36
40
  */
37
41
  declare function sanitize(value: Node | Node[]): Node[];
38
42
  //#endregion
39
- export { html, sanitize };
43
+ export { HtmlOptions, html, sanitize };
@@ -96,8 +96,9 @@ html.clear = () => {
96
96
  templates.clear();
97
97
  };
98
98
  /**
99
- * Remove cached template element for an HTML string or id
100
- * @param template HTML string or id for a template element
99
+ * Remove cached template element for an _HTML_ string or _ID_
100
+ *
101
+ * @param template _HTML_ string or ID for a template element
101
102
  */
102
103
  html.remove = (template) => {
103
104
  templates.delete(template);
@@ -120,6 +121,7 @@ function replaceComments(origin, replacements) {
120
121
  }
121
122
  /**
122
123
  * Sanitize one or more nodes, recursively
124
+ *
123
125
  * @param value Node or nodes to sanitize
124
126
  * @param options Sanitization options
125
127
  * @returns Sanitized nodes
@@ -136,6 +138,5 @@ const TEMPLATE_TAG = "template";
136
138
  const TEMPORARY_ELEMENT = "<toretto-temporary></toretto-temporary>";
137
139
  const templates = new SizedMap(128);
138
140
  let parser;
139
- window.templates = templates;
140
141
  //#endregion
141
142
  export { html, sanitize };