@cyberalien/svg-utils 1.2.6 → 1.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.
Files changed (139) hide show
  1. package/lib/classname/const.js +1 -2
  2. package/lib/classname/toggle.js +1 -3
  3. package/lib/components/export/dependencies.js +1 -2
  4. package/lib/components/export/exports.js +1 -2
  5. package/lib/components/export/file.js +1 -3
  6. package/lib/components/export/filename.js +1 -2
  7. package/lib/components/export/fs.js +1 -3
  8. package/lib/components/export/merge.js +1 -3
  9. package/lib/components/helpers/code/lines.js +1 -2
  10. package/lib/components/helpers/content/ratio.js +1 -2
  11. package/lib/components/helpers/content/size.js +1 -3
  12. package/lib/components/helpers/content/stringify.js +1 -3
  13. package/lib/components/helpers/css/generate.js +1 -3
  14. package/lib/components/helpers/filenames/asset.js +1 -2
  15. package/lib/components/helpers/filenames/css.js +1 -3
  16. package/lib/components/helpers/filenames/path.js +1 -2
  17. package/lib/components/helpers/filenames/types.js +1 -3
  18. package/lib/components/helpers/functions/custom.js +3 -5
  19. package/lib/components/helpers/functions/fallback.js +3 -5
  20. package/lib/components/helpers/functions/innerhtml.js +1 -3
  21. package/lib/components/helpers/functions/size.js +3 -5
  22. package/lib/components/helpers/imports/add.js +1 -2
  23. package/lib/components/helpers/imports/create.js +1 -2
  24. package/lib/components/helpers/imports/stringify.js +1 -2
  25. package/lib/components/helpers/imports/types.js +1 -1
  26. package/lib/components/helpers/props/object.js +1 -3
  27. package/lib/components/helpers/props/stringify.js +1 -2
  28. package/lib/components/helpers/props/ts.js +1 -2
  29. package/lib/components/helpers/props/types.js +1 -1
  30. package/lib/components/helpers/ts/jsx.js +1 -3
  31. package/lib/components/helpers/ts/solid.js +1 -3
  32. package/lib/components/helpers/ts/svelte.js +1 -3
  33. package/lib/components/helpers/ts/vue.js +1 -3
  34. package/lib/components/helpers/ts/wrapper.js +1 -3
  35. package/lib/components/jsx.js +1 -3
  36. package/lib/components/prepare/iconify.js +2 -4
  37. package/lib/components/prepare/options.js +1 -3
  38. package/lib/components/prepare/states.js +1 -3
  39. package/lib/components/raw.js +1 -3
  40. package/lib/components/solid.js +1 -3
  41. package/lib/components/svelte.js +1 -3
  42. package/lib/components/types/component.js +1 -1
  43. package/lib/components/types/css.js +1 -1
  44. package/lib/components/types/data.js +1 -1
  45. package/lib/components/types/jsx.js +1 -1
  46. package/lib/components/types/options.js +1 -1
  47. package/lib/components/types/source.js +1 -1
  48. package/lib/components/vue-func.js +1 -3
  49. package/lib/components/vue.js +1 -3
  50. package/lib/css/find/animations.js +1 -3
  51. package/lib/css/find/classname.js +1 -3
  52. package/lib/css/find/prop.js +1 -2
  53. package/lib/css/hash.js +1 -3
  54. package/lib/css/minify.js +1 -2
  55. package/lib/css/rules.js +1 -2
  56. package/lib/css/stringify.js +1 -2
  57. package/lib/css/stylesheet.js +1 -3
  58. package/lib/css/types.js +1 -1
  59. package/lib/helpers/data/compact.js +1 -2
  60. package/lib/helpers/data/expand.js +1 -2
  61. package/lib/helpers/hash/context.js +1 -2
  62. package/lib/helpers/hash/hash.js +1 -2
  63. package/lib/helpers/hash/stringify.js +1 -2
  64. package/lib/helpers/hash/types.js +1 -1
  65. package/lib/helpers/hash/unique.js +1 -3
  66. package/lib/helpers/misc/clone.js +1 -2
  67. package/lib/helpers/misc/compare.js +1 -3
  68. package/lib/helpers/misc/keys.js +1 -3
  69. package/lib/helpers/misc/promises.js +1 -3
  70. package/lib/helpers/misc/sort-object.js +1 -2
  71. package/lib/helpers/misc/strings.js +1 -2
  72. package/lib/helpers/reduce-motion.js +1 -2
  73. package/lib/iconify/icon/{nornalise.js → normalise.js} +1 -3
  74. package/lib/iconify/icon/types.js +1 -1
  75. package/lib/iconify/icon-set/defaults.js +1 -2
  76. package/lib/iconify/icon-set/icon.js +1 -3
  77. package/lib/iconify/icon-set/parse.js +1 -3
  78. package/lib/iconify/icon-set/types.js +1 -1
  79. package/lib/index.js +1 -2
  80. package/lib/svg/content/defs.js +1 -2
  81. package/lib/svg/ids/change.js +1 -3
  82. package/lib/svg/ids/duplicate.js +1 -3
  83. package/lib/svg/ids/string.js +1 -2
  84. package/lib/svg/ids/types.js +1 -1
  85. package/lib/svg/ids/unique.js +1 -3
  86. package/lib/svg/ids/unused.js +1 -3
  87. package/lib/svg/props/size.js +1 -2
  88. package/lib/svg/props/stringify.js +1 -2
  89. package/lib/svg/viewbox/minify.js +1 -2
  90. package/lib/svg/viewbox/parse.js +1 -2
  91. package/lib/svg/viewbox/square.js +1 -2
  92. package/lib/svg/viewbox/types.js +1 -1
  93. package/lib/svg/viewbox/value.js +1 -2
  94. package/lib/svg-css/content.js +1 -3
  95. package/lib/svg-css/icon/css.js +1 -3
  96. package/lib/svg-css/icon/types.js +1 -1
  97. package/lib/svg-css/icon-set/add.js +1 -3
  98. package/lib/svg-css/icon-set/create.js +1 -2
  99. package/lib/svg-css/icon-set/get.js +1 -3
  100. package/lib/svg-css/icon-set/minify/expand.js +1 -3
  101. package/lib/svg-css/icon-set/minify/keys.js +1 -2
  102. package/lib/svg-css/icon-set/minify/minify.js +1 -3
  103. package/lib/svg-css/icon-set/types.js +1 -1
  104. package/lib/svg-css/props/prop.js +1 -2
  105. package/lib/svg-css/props/props.js +3 -5
  106. package/lib/svg-css/props/tags.js +2 -3
  107. package/lib/svg-css/props/types.js +1 -1
  108. package/lib/svg-css/root.js +1 -3
  109. package/lib/svg-css/states/cleanup-values.js +1 -3
  110. package/lib/svg-css/states/fallback/parse.js +1 -2
  111. package/lib/svg-css/states/fallback/stringify.js +1 -2
  112. package/lib/svg-css/states/fallback/test.js +1 -3
  113. package/lib/svg-css/states/fallback/types.js +1 -1
  114. package/lib/svg-css/states/focus.js +1 -2
  115. package/lib/svg-css/states/generator.js +1 -3
  116. package/lib/svg-css/states/key.js +1 -2
  117. package/lib/svg-css/states/object.js +1 -3
  118. package/lib/svg-css/states/selector/helpers/iterate.js +1 -2
  119. package/lib/svg-css/states/selector/merge.js +1 -3
  120. package/lib/svg-css/states/selector/parse.js +1 -3
  121. package/lib/svg-css/states/selector/part/merge.js +1 -3
  122. package/lib/svg-css/states/selector/part/split.js +1 -3
  123. package/lib/svg-css/states/selector/part/stringify.js +1 -3
  124. package/lib/svg-css/states/selector/split.js +1 -3
  125. package/lib/svg-css/states/selector/stringify.js +1 -3
  126. package/lib/svg-css/states/selector/sub/merge.js +1 -2
  127. package/lib/svg-css/states/selector/sub/split.js +1 -2
  128. package/lib/svg-css/states/selector/sub/stringify.js +1 -2
  129. package/lib/svg-css/states/selector/types.js +1 -1
  130. package/lib/svg-css/states/types.js +1 -1
  131. package/lib/svg-css/states/validate.js +1 -2
  132. package/lib/svg-css/states/value.js +1 -2
  133. package/lib/svg-css/types.js +1 -1
  134. package/lib/xml/iterate.js +1 -2
  135. package/lib/xml/parse.js +1 -2
  136. package/lib/xml/stringify.js +1 -2
  137. package/lib/xml/types.js +1 -1
  138. package/package.json +9 -9
  139. /package/lib/iconify/icon/{nornalise.d.ts → normalise.d.ts} +0 -0
@@ -1,5 +1,4 @@
1
1
  import { mergeSelectorParts } from "./part/merge.js";
2
-
3
2
  /**
4
3
  * Merge sets of StateSelectorData into one
5
4
  */
@@ -25,5 +24,4 @@ function mergeSelectorsForStates(data) {
25
24
  if (!next([], "", 0)) return null;
26
25
  return Object.values(groupedResults);
27
26
  }
28
-
29
- export { mergeSelectorsForStates };
27
+ export { mergeSelectorsForStates };
@@ -2,7 +2,6 @@ import { getStatesFromKey } from "../key.js";
2
2
  import { mergeSelectorsForStates } from "./merge.js";
3
3
  import { splitSelectorsForState } from "./split.js";
4
4
  import { stringifySelectorsForState } from "./stringify.js";
5
-
6
5
  /**
7
6
  * Create context object from config
8
7
  */
@@ -70,5 +69,4 @@ function getSelectorsForStateValues(context, value) {
70
69
  parsed[cacheKey] = stringified;
71
70
  return stringified;
72
71
  }
73
-
74
- export { createStatefulIconSelectorsContext, getSelectorsForStateValues };
72
+ export { createStatefulIconSelectorsContext, getSelectorsForStateValues };
@@ -1,6 +1,5 @@
1
1
  import { mergeMultipleArrays } from "../helpers/iterate.js";
2
2
  import { mergeMultipleSelectorSubParts } from "../sub/merge.js";
3
-
4
3
  /**
5
4
  * Merge all selectors
6
5
  *
@@ -33,5 +32,4 @@ function mergeSelectorParts(parts) {
33
32
  }));
34
33
  else return [baseResult];
35
34
  }
36
-
37
- export { mergeSelectorParts };
35
+ export { mergeSelectorParts };
@@ -1,5 +1,4 @@
1
1
  import { splitSelectorToSubParts } from "../sub/split.js";
2
-
3
2
  const charAfterAtRule = [
4
3
  ".",
5
4
  "&",
@@ -56,5 +55,4 @@ function splitSelectorToParts(selector) {
56
55
  if (parents.length) result.parents = parents;
57
56
  return result;
58
57
  }
59
-
60
- export { createSelectorParts, splitSelectorToParts };
58
+ export { createSelectorParts, splitSelectorToParts };
@@ -1,5 +1,4 @@
1
1
  import { stringifySelectorSubParts } from "../sub/stringify.js";
2
-
3
2
  /**
4
3
  * Join sub-parts of selector into one string
5
4
  */
@@ -28,5 +27,4 @@ function stringifySelectorParts(parts) {
28
27
  if (firstItem.svg) results.push(stringifySelectorSubParts(firstItem.svg, true));
29
28
  return results;
30
29
  }
31
-
32
- export { stringifySelectorParts };
30
+ export { stringifySelectorParts };
@@ -1,6 +1,5 @@
1
1
  import { splitSelectorToParts } from "./part/split.js";
2
2
  import { stringifySelectorSubParts } from "./sub/stringify.js";
3
-
4
3
  /**
5
4
  * Split comma separated selectors into parts, group by compatibility so later can be merged
6
5
  */
@@ -25,5 +24,4 @@ function splitSelectorsForState(selectors) {
25
24
  }
26
25
  return groups;
27
26
  }
28
-
29
- export { splitSelectorsForState };
27
+ export { splitSelectorsForState };
@@ -1,5 +1,4 @@
1
1
  import { stringifySelectorParts } from "./part/stringify.js";
2
-
3
2
  function joinSequence(parts) {
4
3
  let selectors = [];
5
4
  for (const part of parts) {
@@ -139,5 +138,4 @@ function stringifySelectorsForState(data) {
139
138
  sequences.sort((a, b) => a.length - b.length);
140
139
  return optimise(sequences);
141
140
  }
142
-
143
- export { stringifySelectorsForState };
141
+ export { stringifySelectorsForState };
@@ -32,5 +32,4 @@ function mergeMultipleSelectorSubParts(parts) {
32
32
  }
33
33
  return result;
34
34
  }
35
-
36
- export { mergeMultipleSelectorSubParts };
35
+ export { mergeMultipleSelectorSubParts };
@@ -50,5 +50,4 @@ function splitSelectorToSubParts(selector) {
50
50
  }
51
51
  return result;
52
52
  }
53
-
54
- export { combinators, splitSelectorToSubParts };
53
+ export { combinators, splitSelectorToSubParts };
@@ -13,5 +13,4 @@ function stringifySelectorSubParts(selector, isSVG = false) {
13
13
  if (isSVG) return full ? `${combinator}svg${full}` : combinator.trim();
14
14
  return `${combinator}${pseudo && full === pseudo ? "*" : ""}${full}`;
15
15
  }
16
-
17
- export { stringifySelectorSubParts };
16
+ export { stringifySelectorSubParts };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -51,5 +51,4 @@ function assertValidStatesList(list) {
51
51
  if (reservedStateNames.has(stateName)) throw new Error(`State name "${stateName}" is reserved to avoid conflicts and cannot be used.`);
52
52
  }
53
53
  }
54
-
55
- export { assertValidStatesList };
54
+ export { assertValidStatesList };
@@ -11,5 +11,4 @@ function getStateValue(state, value) {
11
11
  if (typeof state === "string") return !!value && value !== "false" && value !== "0";
12
12
  return typeof value !== "string" || !state[1].includes(value) ? getAdvancedStateDefaultValue(state) : value;
13
13
  }
14
-
15
- export { getAdvancedStateDefaultValue, getStateValue };
14
+ export { getAdvancedStateDefaultValue, getStateValue };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -22,5 +22,4 @@ function iterateXMLContent(root, callback) {
22
22
  }
23
23
  return parseChildren(root);
24
24
  }
25
-
26
- export { iterateXMLContent };
25
+ export { iterateXMLContent };
package/lib/xml/parse.js CHANGED
@@ -78,5 +78,4 @@ function parseXMLContent(content, trim = true) {
78
78
  }
79
79
  } while (true);
80
80
  }
81
-
82
- export { parseXMLContent };
81
+ export { parseXMLContent };
@@ -58,5 +58,4 @@ function stringifyXMLContent(root, options) {
58
58
  for (const node of root) if (!add(node, 0)) return null;
59
59
  return output;
60
60
  }
61
-
62
- export { stringifyXMLContent };
61
+ export { stringifyXMLContent };
package/lib/xml/types.js CHANGED
@@ -1 +1 @@
1
- export { };
1
+ export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "Common functions for working with SVG used by various packages.",
5
5
  "author": "Vjacheslav Trushkin",
6
- "version": "1.2.6",
6
+ "version": "1.2.7",
7
7
  "license": "MIT",
8
8
  "bugs": "https://github.com/cyberalien/svg-utils/issues",
9
9
  "homepage": "https://cyberalien.dev/",
@@ -23,18 +23,18 @@
23
23
  "@iconify/types": "^2.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@eslint/eslintrc": "^3.3.4",
27
- "@eslint/js": "^9.39.3",
26
+ "@eslint/eslintrc": "^3.3.5",
27
+ "@eslint/js": "^10.0.1",
28
28
  "@iconify-json/ri": "^1.2.10",
29
29
  "@types/jest": "^30.0.0",
30
- "@types/node": "^25.3.3",
31
- "@typescript-eslint/eslint-plugin": "^8.56.1",
32
- "@typescript-eslint/parser": "^8.56.1",
33
- "eslint": "^9.39.3",
30
+ "@types/node": "^25.5.0",
31
+ "@typescript-eslint/eslint-plugin": "^8.57.1",
32
+ "@typescript-eslint/parser": "^8.57.1",
33
+ "eslint": "^10.0.3",
34
34
  "globals": "^17.4.0",
35
- "tsdown": "^0.20.3",
35
+ "tsdown": "^0.21.4",
36
36
  "typescript": "^5.9.3",
37
- "vitest": "^4.0.18"
37
+ "vitest": "^4.1.0"
38
38
  },
39
39
  "scripts": {
40
40
  "lint": "eslint --fix src/**/*.ts && tsc --noemit",