@oscarpalmer/toretto 0.39.2 → 0.41.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 (55) hide show
  1. package/{types/attribute/get.d.ts → dist/attribute/get.d.mts} +6 -3
  2. package/dist/attribute/{get.js → get.mjs} +2 -2
  3. package/{types/attribute/index.d.ts → dist/attribute/index.d.mts} +16 -12
  4. package/dist/attribute/{index.js → index.mjs} +3 -3
  5. package/{types/attribute/set.d.ts → dist/attribute/set.d.mts} +10 -7
  6. package/dist/attribute/{set.js → set.mjs} +2 -2
  7. package/{types/data.d.ts → dist/data.d.mts} +9 -5
  8. package/dist/{data.js → data.mjs} +4 -4
  9. package/dist/event/delegation.d.mts +11 -0
  10. package/dist/event/{delegation.js → delegation.mjs} +8 -8
  11. package/{types/event/index.d.ts → dist/event/index.d.mts} +12 -8
  12. package/dist/event/{index.js → index.mjs} +4 -4
  13. package/{types/find/index.d.ts → dist/find/index.d.mts} +11 -8
  14. package/dist/find/{index.js → index.mjs} +7 -7
  15. package/{types/find/relative.d.ts → dist/find/relative.d.mts} +8 -5
  16. package/{types/focusable.d.ts → dist/focusable.d.mts} +7 -4
  17. package/dist/{focusable.js → focusable.mjs} +20 -20
  18. package/dist/html/index.d.mts +42 -0
  19. package/dist/html/{index.js → index.mjs} +8 -8
  20. package/dist/html/sanitize.d.mts +5 -0
  21. package/dist/html/{sanitize.js → sanitize.mjs} +4 -4
  22. package/{types/index.d.ts → dist/index.d.mts} +157 -128
  23. package/dist/{toretto.full.js → index.mjs} +78 -173
  24. package/dist/internal/attribute.d.mts +15 -0
  25. package/dist/internal/{attribute.js → attribute.mjs} +14 -14
  26. package/dist/internal/element-value.d.mts +6 -0
  27. package/dist/internal/{element-value.js → element-value.mjs} +3 -3
  28. package/dist/internal/get-value.d.mts +7 -0
  29. package/dist/internal/{get-value.js → get-value.mjs} +1 -1
  30. package/{types/internal/is.d.ts → dist/internal/is.d.mts} +5 -2
  31. package/{types/is.d.ts → dist/is.d.mts} +8 -4
  32. package/dist/{is.js → is.mjs} +2 -2
  33. package/dist/models.d.mts +33 -0
  34. package/dist/models.mjs +1 -0
  35. package/dist/style.d.mts +58 -0
  36. package/dist/{style.js → style.mjs} +5 -5
  37. package/dist/touch.d.mts +21 -0
  38. package/dist/{touch.js → touch.mjs} +1 -1
  39. package/package.json +60 -63
  40. package/src/data.ts +1 -1
  41. package/src/find/index.ts +1 -1
  42. package/src/internal/attribute.ts +1 -1
  43. package/dist/index.js +0 -15
  44. package/dist/models.js +0 -0
  45. package/types/event/delegation.d.ts +0 -7
  46. package/types/html/index.d.ts +0 -40
  47. package/types/html/sanitize.d.ts +0 -2
  48. package/types/internal/attribute.d.ts +0 -11
  49. package/types/internal/element-value.d.ts +0 -3
  50. package/types/internal/get-value.d.ts +0 -4
  51. package/types/models.d.ts +0 -30
  52. package/types/style.d.ts +0 -54
  53. package/types/touch.d.ts +0 -19
  54. /package/dist/find/{relative.js → relative.mjs} +0 -0
  55. /package/dist/internal/{is.js → is.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { sanitizeNodes } from "./sanitize.js";
1
+ import { sanitizeNodes } from "./sanitize.mjs";
2
2
  import { isPlainObject } from "@oscarpalmer/atoms/is";
3
3
  //#region src/html/index.ts
4
4
  function createHtml(value) {
@@ -38,7 +38,7 @@ function getTemplate(value, options) {
38
38
  const element = EXPRESSION_ID.test(value) ? document.querySelector(`#${value}`) : null;
39
39
  return createTemplate(element instanceof HTMLTemplateElement ? element : value, options);
40
40
  }
41
- var html = ((value, options) => {
41
+ const html = ((value, options) => {
42
42
  return getNodes(value, getOptions(options));
43
43
  });
44
44
  html.clear = () => {
@@ -64,11 +64,11 @@ html.remove = (template) => {
64
64
  function sanitize(value) {
65
65
  return sanitizeNodes(Array.isArray(value) ? value : [value], 0);
66
66
  }
67
- var EXPRESSION_ID = /^[a-z][\w-]*$/i;
68
- var PARSE_TYPE_HTML = "text/html";
69
- var TEMPLATE_TAG = "template";
70
- var TEMPORARY_ELEMENT = "<toretto-temporary></toretto-temporary>";
71
- var parser;
72
- var templates = {};
67
+ const EXPRESSION_ID = /^[a-z][\w-]*$/i;
68
+ const PARSE_TYPE_HTML = "text/html";
69
+ const TEMPLATE_TAG = "template";
70
+ const TEMPORARY_ELEMENT = "<toretto-temporary></toretto-temporary>";
71
+ let parser;
72
+ let templates = {};
73
73
  //#endregion
74
74
  export { html, sanitize };
@@ -0,0 +1,5 @@
1
+ //#region src/html/sanitize.d.ts
2
+ declare function sanitizeAttributes(element: Element, attributes: Attr[]): void;
3
+ declare function sanitizeNodes(nodes: Node[], depth: number): Node[];
4
+ //#endregion
5
+ export { sanitizeAttributes, sanitizeNodes };
@@ -1,5 +1,5 @@
1
- import { _isBadAttribute, _isEmptyNonBooleanAttribute, _isInvalidBooleanAttribute } from "../internal/attribute.js";
2
- import { setAttribute } from "../attribute/set.js";
1
+ import { _isBadAttribute, _isEmptyNonBooleanAttribute, _isInvalidBooleanAttribute } from "../internal/attribute.mjs";
2
+ import { setAttribute } from "../attribute/set.mjs";
3
3
  //#region src/html/sanitize.ts
4
4
  function handleElement(element, depth) {
5
5
  if (depth === 0) {
@@ -56,7 +56,7 @@ function sanitizeNodes(nodes, depth) {
56
56
  }
57
57
  return nodes;
58
58
  }
59
- var COMMENT_HARMFUL = /<[/\w]/g;
60
- var REMOVE_SELECTOR = "script, toretto-temporary";
59
+ const COMMENT_HARMFUL = /<[/\w]/g;
60
+ const REMOVE_SELECTOR = "script, toretto-temporary";
61
61
  //#endregion
62
62
  export { sanitizeAttributes, sanitizeNodes };