@cyberalien/svg-utils 1.0.11 → 1.1.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 (205) hide show
  1. package/lib/classname/{toggle.js → toggle.mjs} +1 -1
  2. package/lib/components/export/{exports.d.ts → exports.d.mts} +1 -1
  3. package/lib/components/export/{file.d.ts → file.d.mts} +3 -3
  4. package/lib/components/export/{file.js → file.mjs} +1 -1
  5. package/lib/components/export/{filename.d.ts → filename.d.mts} +2 -2
  6. package/lib/components/export/{fs.d.ts → fs.d.mts} +1 -1
  7. package/lib/components/export/{merge.d.ts → merge.d.mts} +1 -1
  8. package/lib/components/helpers/content/{ratio.d.ts → ratio.d.mts} +1 -1
  9. package/lib/components/helpers/content/{size.d.ts → size.d.mts} +2 -2
  10. package/lib/components/helpers/content/{size.js → size.mjs} +1 -1
  11. package/lib/components/helpers/content/{stringify.d.ts → stringify.d.mts} +2 -2
  12. package/lib/components/helpers/content/{stringify.js → stringify.mjs} +1 -1
  13. package/lib/components/helpers/css/{generate.d.ts → generate.d.mts} +4 -4
  14. package/lib/components/helpers/css/{generate.js → generate.mjs} +13 -13
  15. package/lib/components/helpers/css/{name.js → name.mjs} +1 -1
  16. package/lib/components/helpers/filenames/{asset.d.ts → asset.d.mts} +1 -1
  17. package/lib/components/helpers/filenames/{css.d.ts → css.d.mts} +1 -1
  18. package/lib/components/helpers/filenames/{css.js → css.mjs} +1 -1
  19. package/lib/components/helpers/filenames/{path.d.ts → path.d.mts} +1 -1
  20. package/lib/components/helpers/filenames/types.d.mts +9 -0
  21. package/lib/components/helpers/filenames/{types.js → types.mjs} +4 -3
  22. package/lib/components/helpers/functions/{size.d.ts → size.d.mts} +3 -3
  23. package/lib/components/helpers/functions/{size.js → size.mjs} +1 -1
  24. package/lib/components/helpers/imports/{add.d.ts → add.d.mts} +1 -1
  25. package/lib/components/helpers/imports/{create.d.ts → create.d.mts} +1 -1
  26. package/lib/components/helpers/imports/{stringify.d.ts → stringify.d.mts} +1 -1
  27. package/lib/components/helpers/props/{object.d.ts → object.d.mts} +1 -1
  28. package/lib/components/helpers/props/{object.js → object.mjs} +1 -1
  29. package/lib/components/helpers/props/{stringify.d.ts → stringify.d.mts} +1 -1
  30. package/lib/components/helpers/props/{ts.d.ts → ts.d.mts} +1 -1
  31. package/lib/components/helpers/ts/jsx.d.mts +13 -0
  32. package/lib/components/helpers/ts/{jsx.js → jsx.mjs} +1 -1
  33. package/lib/components/helpers/ts/svelte.d.mts +9 -0
  34. package/lib/components/helpers/ts/{svelte.js → svelte.mjs} +1 -1
  35. package/lib/components/helpers/ts/vue.d.mts +9 -0
  36. package/lib/components/helpers/ts/{vue.js → vue.mjs} +1 -1
  37. package/lib/components/helpers/ts/wrapper.d.mts +9 -0
  38. package/lib/components/helpers/ts/{wrapper.js → wrapper.mjs} +2 -2
  39. package/lib/components/{jsx.d.ts → jsx.d.mts} +4 -4
  40. package/lib/components/{jsx.js → jsx.mjs} +14 -14
  41. package/lib/components/prepare/{iconify.d.ts → iconify.d.mts} +5 -5
  42. package/lib/components/prepare/{iconify.js → iconify.mjs} +3 -3
  43. package/lib/components/prepare/{options.d.ts → options.d.mts} +1 -1
  44. package/lib/components/prepare/{options.js → options.mjs} +2 -2
  45. package/lib/components/raw.d.mts +8 -0
  46. package/lib/components/{raw.js → raw.mjs} +8 -8
  47. package/lib/components/{svelte.d.ts → svelte.d.mts} +3 -3
  48. package/lib/components/{svelte.js → svelte.mjs} +14 -14
  49. package/lib/components/types/{data.d.ts → data.d.mts} +2 -2
  50. package/lib/components/types/{options.d.ts → options.d.mts} +3 -2
  51. package/lib/components/types/{source.d.ts → source.d.mts} +2 -2
  52. package/lib/components/vue-func.d.mts +8 -0
  53. package/lib/components/{vue-func.js → vue-func.mjs} +14 -14
  54. package/lib/components/{vue.d.ts → vue.d.mts} +3 -3
  55. package/lib/components/{vue.js → vue.mjs} +14 -14
  56. package/lib/css/hash.d.mts +6 -0
  57. package/lib/css/hash.mjs +15 -0
  58. package/lib/css/{stringify.d.ts → stringify.d.mts} +1 -1
  59. package/lib/css/{types.d.ts → types.d.mts} +2 -2
  60. package/lib/helpers/hash/context.d.mts +6 -0
  61. package/lib/helpers/hash/context.mjs +8 -0
  62. package/lib/helpers/hash/types.d.mts +28 -0
  63. package/lib/helpers/hash/{unique.d.ts → unique.d.mts} +1 -1
  64. package/lib/helpers/hash/{unique.js → unique.mjs} +6 -7
  65. package/lib/helpers/misc/{compare.js → compare.mjs} +1 -1
  66. package/lib/helpers/misc/{keys.js → keys.mjs} +1 -1
  67. package/lib/helpers/misc/{promises.d.ts → promises.d.mts} +1 -1
  68. package/lib/helpers/misc/{promises.js → promises.mjs} +1 -1
  69. package/lib/iconify/icon/{nornalise.d.ts → nornalise.d.mts} +1 -1
  70. package/lib/iconify/icon/{nornalise.js → nornalise.mjs} +1 -1
  71. package/lib/iconify/icon/types.d.mts +6 -0
  72. package/lib/iconify/icon-set/{icon.js → icon.mjs} +1 -1
  73. package/lib/iconify/icon-set/{parse.d.ts → parse.d.mts} +1 -1
  74. package/lib/iconify/icon-set/{parse.js → parse.mjs} +1 -1
  75. package/lib/index.d.mts +28 -0
  76. package/lib/index.mjs +25 -0
  77. package/lib/svg/ids/{change.d.ts → change.d.mts} +2 -2
  78. package/lib/svg/ids/{change.js → change.mjs} +5 -5
  79. package/lib/svg/ids/{duplicate.d.ts → duplicate.d.mts} +2 -2
  80. package/lib/svg/ids/{duplicate.js → duplicate.mjs} +1 -1
  81. package/lib/svg/ids/types.d.mts +8 -0
  82. package/lib/svg/ids/unique.d.mts +7 -0
  83. package/lib/svg/ids/unique.mjs +16 -0
  84. package/lib/svg/ids/{unused.d.ts → unused.d.mts} +2 -2
  85. package/lib/svg/ids/{unused.js → unused.mjs} +1 -1
  86. package/lib/svg/viewbox/{minify.d.ts → minify.d.mts} +1 -1
  87. package/lib/svg/viewbox/{parse.d.ts → parse.d.mts} +1 -1
  88. package/lib/svg/viewbox/{square.d.ts → square.d.mts} +1 -1
  89. package/lib/svg/viewbox/{value.d.ts → value.d.mts} +1 -1
  90. package/lib/svg-css/{content.d.ts → content.d.mts} +2 -2
  91. package/lib/svg-css/{content.js → content.mjs} +3 -3
  92. package/lib/svg-css/props/{props.d.ts → props.d.mts} +2 -2
  93. package/lib/svg-css/props/{props.js → props.mjs} +3 -3
  94. package/lib/svg-css/props/{types.d.ts → types.d.mts} +1 -1
  95. package/lib/svg-css/root.d.mts +10 -0
  96. package/lib/svg-css/root.mjs +26 -0
  97. package/lib/svg-css/{types.d.ts → types.d.mts} +3 -5
  98. package/lib/xml/{iterate.d.ts → iterate.d.mts} +1 -1
  99. package/lib/xml/{parse.d.ts → parse.d.mts} +1 -1
  100. package/lib/xml/{parse.js → parse.mjs} +9 -9
  101. package/lib/xml/{stringify.d.ts → stringify.d.mts} +1 -1
  102. package/package.json +11 -11
  103. package/lib/components/helpers/filenames/types.d.ts +0 -7
  104. package/lib/components/helpers/ts/jsx.d.ts +0 -13
  105. package/lib/components/helpers/ts/svelte.d.ts +0 -9
  106. package/lib/components/helpers/ts/vue.d.ts +0 -9
  107. package/lib/components/helpers/ts/wrapper.d.ts +0 -9
  108. package/lib/components/raw.d.ts +0 -8
  109. package/lib/components/vue-func.d.ts +0 -8
  110. package/lib/css/hash.d.ts +0 -6
  111. package/lib/css/hash.js +0 -17
  112. package/lib/helpers/hash/types.d.ts +0 -8
  113. package/lib/iconify/icon/types.d.ts +0 -6
  114. package/lib/index.d.ts +0 -27
  115. package/lib/index.js +0 -24
  116. package/lib/svg/ids/types.d.ts +0 -6
  117. package/lib/svg/ids/unique.d.ts +0 -6
  118. package/lib/svg/ids/unique.js +0 -18
  119. package/lib/svg-css/animations/attribute.d.ts +0 -11
  120. package/lib/svg-css/animations/attribute.js +0 -19
  121. package/lib/svg-css/animations/common.d.ts +0 -8
  122. package/lib/svg-css/animations/common.js +0 -16
  123. package/lib/svg-css/animations/find.d.ts +0 -9
  124. package/lib/svg-css/animations/find.js +0 -48
  125. package/lib/svg-css/animations/types.d.ts +0 -19
  126. package/lib/svg-css/root.d.ts +0 -10
  127. package/lib/svg-css/root.js +0 -28
  128. package/lib/xml/types.js +0 -1
  129. /package/lib/classname/{const.d.ts → const.d.mts} +0 -0
  130. /package/lib/classname/{const.js → const.mjs} +0 -0
  131. /package/lib/classname/{toggle.d.ts → toggle.d.mts} +0 -0
  132. /package/lib/components/export/{exports.js → exports.mjs} +0 -0
  133. /package/lib/components/export/{filename.js → filename.mjs} +0 -0
  134. /package/lib/components/export/{fs.js → fs.mjs} +0 -0
  135. /package/lib/components/export/{merge.js → merge.mjs} +0 -0
  136. /package/lib/components/helpers/code/{lines.d.ts → lines.d.mts} +0 -0
  137. /package/lib/components/helpers/code/{lines.js → lines.mjs} +0 -0
  138. /package/lib/components/helpers/content/{ratio.js → ratio.mjs} +0 -0
  139. /package/lib/components/helpers/css/{name.d.ts → name.d.mts} +0 -0
  140. /package/lib/components/helpers/filenames/{asset.js → asset.mjs} +0 -0
  141. /package/lib/components/helpers/filenames/{path.js → path.mjs} +0 -0
  142. /package/lib/components/helpers/imports/{add.js → add.mjs} +0 -0
  143. /package/lib/components/helpers/imports/{create.js → create.mjs} +0 -0
  144. /package/lib/components/helpers/imports/{stringify.js → stringify.mjs} +0 -0
  145. /package/lib/components/helpers/imports/{types.d.ts → types.d.mts} +0 -0
  146. /package/lib/components/helpers/imports/{types.js → types.mjs} +0 -0
  147. /package/lib/components/helpers/props/{stringify.js → stringify.mjs} +0 -0
  148. /package/lib/components/helpers/props/{ts.js → ts.mjs} +0 -0
  149. /package/lib/components/helpers/props/{types.d.ts → types.d.mts} +0 -0
  150. /package/lib/components/helpers/props/{types.js → types.mjs} +0 -0
  151. /package/lib/components/types/{component.d.ts → component.d.mts} +0 -0
  152. /package/lib/components/types/{component.js → component.mjs} +0 -0
  153. /package/lib/components/types/{css.d.ts → css.d.mts} +0 -0
  154. /package/lib/components/types/{css.js → css.mjs} +0 -0
  155. /package/lib/components/types/{data.js → data.mjs} +0 -0
  156. /package/lib/components/types/{jsx.d.ts → jsx.d.mts} +0 -0
  157. /package/lib/components/types/{jsx.js → jsx.mjs} +0 -0
  158. /package/lib/components/types/{options.js → options.mjs} +0 -0
  159. /package/lib/components/types/{source.js → source.mjs} +0 -0
  160. /package/lib/css/{stringify.js → stringify.mjs} +0 -0
  161. /package/lib/css/{types.js → types.mjs} +0 -0
  162. /package/lib/helpers/hash/{hash.d.ts → hash.d.mts} +0 -0
  163. /package/lib/helpers/hash/{hash.js → hash.mjs} +0 -0
  164. /package/lib/helpers/hash/{stringify.d.ts → stringify.d.mts} +0 -0
  165. /package/lib/helpers/hash/{stringify.js → stringify.mjs} +0 -0
  166. /package/lib/helpers/hash/{types.js → types.mjs} +0 -0
  167. /package/lib/helpers/misc/{clone.d.ts → clone.d.mts} +0 -0
  168. /package/lib/helpers/misc/{clone.js → clone.mjs} +0 -0
  169. /package/lib/helpers/misc/{compare.d.ts → compare.d.mts} +0 -0
  170. /package/lib/helpers/misc/{keys.d.ts → keys.d.mts} +0 -0
  171. /package/lib/helpers/misc/{sort-object.d.ts → sort-object.d.mts} +0 -0
  172. /package/lib/helpers/misc/{sort-object.js → sort-object.mjs} +0 -0
  173. /package/lib/helpers/misc/{strings.d.ts → strings.d.mts} +0 -0
  174. /package/lib/helpers/misc/{strings.js → strings.mjs} +0 -0
  175. /package/lib/iconify/icon/{types.js → types.mjs} +0 -0
  176. /package/lib/iconify/icon-set/{defaults.d.ts → defaults.d.mts} +0 -0
  177. /package/lib/iconify/icon-set/{defaults.js → defaults.mjs} +0 -0
  178. /package/lib/iconify/icon-set/{icon.d.ts → icon.d.mts} +0 -0
  179. /package/lib/iconify/icon-set/{types.d.ts → types.d.mts} +0 -0
  180. /package/lib/iconify/icon-set/{types.js → types.mjs} +0 -0
  181. /package/lib/svg/content/{defs.d.ts → defs.d.mts} +0 -0
  182. /package/lib/svg/content/{defs.js → defs.mjs} +0 -0
  183. /package/lib/svg/ids/{string.d.ts → string.d.mts} +0 -0
  184. /package/lib/svg/ids/{string.js → string.mjs} +0 -0
  185. /package/lib/{svg-css/types.js → svg/ids/types.mjs} +0 -0
  186. /package/lib/svg/props/{size.d.ts → size.d.mts} +0 -0
  187. /package/lib/svg/props/{size.js → size.mjs} +0 -0
  188. /package/lib/svg/props/{stringify.d.ts → stringify.d.mts} +0 -0
  189. /package/lib/svg/props/{stringify.js → stringify.mjs} +0 -0
  190. /package/lib/svg/viewbox/{minify.js → minify.mjs} +0 -0
  191. /package/lib/svg/viewbox/{parse.js → parse.mjs} +0 -0
  192. /package/lib/svg/viewbox/{square.js → square.mjs} +0 -0
  193. /package/lib/svg/viewbox/{types.d.ts → types.d.mts} +0 -0
  194. /package/lib/svg/{ids/types.js → viewbox/types.mjs} +0 -0
  195. /package/lib/svg/viewbox/{value.js → value.mjs} +0 -0
  196. /package/lib/svg-css/props/{prop.d.ts → prop.d.mts} +0 -0
  197. /package/lib/svg-css/props/{prop.js → prop.mjs} +0 -0
  198. /package/lib/svg-css/{animations/tags.d.ts → props/tags.d.mts} +0 -0
  199. /package/lib/svg-css/{animations/tags.js → props/tags.mjs} +0 -0
  200. /package/lib/svg-css/{animations/types.js → props/types.mjs} +0 -0
  201. /package/lib/svg-css/{props/types.js → types.mjs} +0 -0
  202. /package/lib/xml/{iterate.js → iterate.mjs} +0 -0
  203. /package/lib/xml/{stringify.js → stringify.mjs} +0 -0
  204. /package/lib/xml/{types.d.ts → types.d.mts} +0 -0
  205. /package/lib/{svg/viewbox/types.js → xml/types.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { defaultClassProp } from "./const.js";
1
+ import { defaultClassProp } from "./const.mjs";
2
2
 
3
3
  /**
4
4
  * Split class name by spaces
@@ -1,4 +1,4 @@
1
- import { FactoryComponent } from "../types/component.js";
1
+ import { FactoryComponent } from "../types/component.mjs";
2
2
  type Types = string | Record<string, string>;
3
3
  interface Options {
4
4
  ext?: string;
@@ -1,6 +1,6 @@
1
- import { FactoryComponent, FactoryGeneratedComponent } from "../types/component.js";
2
- import { FactoryIconData } from "../types/data.js";
3
- import { ComponentFactoryFileSystemOptions } from "../types/options.js";
1
+ import { FactoryComponent, FactoryGeneratedComponent } from "../types/component.mjs";
2
+ import { FactoryIconData } from "../types/data.mjs";
3
+ import { ComponentFactoryFileSystemOptions } from "../types/options.mjs";
4
4
  interface Options extends Pick<ComponentFactoryFileSystemOptions, 'doubleDirsForComponents' | 'prefixDirsForComponents'> {
5
5
  includePrefix?: boolean;
6
6
  extension: string;
@@ -1,4 +1,4 @@
1
- import { getGeneratedComponentFilename } from "./filename.js";
1
+ import { getGeneratedComponentFilename } from "./filename.mjs";
2
2
 
3
3
  /**
4
4
  * Add icon and filename to generated component
@@ -1,5 +1,5 @@
1
- import { FactoryIconData } from "../types/data.js";
2
- import { ComponentFactoryFileSystemOptions } from "../types/options.js";
1
+ import { FactoryIconData } from "../types/data.mjs";
2
+ import { ComponentFactoryFileSystemOptions } from "../types/options.mjs";
3
3
  /**
4
4
  * Generate component filename based on options
5
5
  *
@@ -1,4 +1,4 @@
1
- import { GeneratedComponentFile } from "../types/component.js";
1
+ import { GeneratedComponentFile } from "../types/component.mjs";
2
2
  /**
3
3
  * Save exported files to filesystem
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FactoryComponent, GeneratedComponentFile } from "../types/component.js";
1
+ import { FactoryComponent, GeneratedComponentFile } from "../types/component.mjs";
2
2
  /**
3
3
  * Merge exported component files into single array
4
4
  */
@@ -1,4 +1,4 @@
1
- import { IconViewBox } from "../../../svg/viewbox/types.js";
1
+ import { IconViewBox } from "../../../svg/viewbox/types.mjs";
2
2
  /**
3
3
  * Get viewBox ratio as string
4
4
  */
@@ -1,5 +1,5 @@
1
- import { IconViewBox } from "../../../svg/viewbox/types.js";
2
- import { ComponentFactoryRenderingOptions } from "../../types/options.js";
1
+ import { IconViewBox } from "../../../svg/viewbox/types.mjs";
2
+ import { ComponentFactoryRenderingOptions } from "../../types/options.mjs";
3
3
  interface SizeResult {
4
4
  width: string;
5
5
  height: string;
@@ -1,4 +1,4 @@
1
- import { calculateSize } from "../../../svg/props/size.js";
1
+ import { calculateSize } from "../../../svg/props/size.mjs";
2
2
 
3
3
  /**
4
4
  * Get size values for component
@@ -1,5 +1,5 @@
1
- import { ComponentFactorySource } from "../../types/source.js";
2
- import { ComponentFactoryRenderingOptions } from "../../types/options.js";
1
+ import { ComponentFactorySource } from "../../types/source.mjs";
2
+ import { ComponentFactoryRenderingOptions } from "../../types/options.mjs";
3
3
  /**
4
4
  * Convert icon content to a string literal
5
5
  */
@@ -1,4 +1,4 @@
1
- import { generateCSSDefaultImportName } from "../css/name.js";
1
+ import { generateCSSDefaultImportName } from "../css/name.mjs";
2
2
 
3
3
  /**
4
4
  * Convert icon content to a string literal
@@ -1,7 +1,7 @@
1
- import { GeneratedAssetFile } from "../../types/component.js";
2
- import { ComponentFactorySource } from "../../types/source.js";
3
- import { ComponentFactoryOptions } from "../../types/options.js";
4
- import { FactoryComponentImports } from "../imports/types.js";
1
+ import { GeneratedAssetFile } from "../../types/component.mjs";
2
+ import { ComponentFactorySource } from "../../types/source.mjs";
3
+ import { ComponentFactoryOptions } from "../../types/options.mjs";
4
+ import { FactoryComponentImports } from "../imports/types.mjs";
5
5
  interface Options extends Pick<ComponentFactoryOptions, 'cssMode' | 'cssPath' | 'doubleDirsForCSS' | 'mergeCSS'> {
6
6
  componentType?: 'svelte';
7
7
  }
@@ -1,6 +1,6 @@
1
- import { stringifyCSSKeyframes, stringifyCSSSelector } from "../../../css/stringify.js";
2
- import { generateCSSDefaultImportName } from "./name.js";
3
- import { getGeneratedCSSFilename } from "../filenames/css.js";
1
+ import { stringifyCSSKeyframes, stringifyCSSSelector } from "../../../css/stringify.mjs";
2
+ import { generateCSSDefaultImportName } from "./name.mjs";
3
+ import { getGeneratedCSSFilename } from "../filenames/css.mjs";
4
4
 
5
5
  /**
6
6
  * Generate CSS files for component
@@ -21,51 +21,51 @@ function generateCSSFilesForComponent(content, imports, assets, options) {
21
21
  const mergedContent = [];
22
22
  for (const className in classes) {
23
23
  const baseContent = stringifyCSSSelector(`${classNamePrefix}.${className}`, classes[className]);
24
- let content$1 = baseContent;
24
+ let content = baseContent;
25
25
  if (embedAnimations && keyframes) {
26
26
  for (const animationName in keyframes) if (baseContent.includes(animationName)) {
27
27
  const value = keyframes[animationName];
28
- content$1 += "\n" + (typeof value === "string" ? value : stringifyCSSKeyframes(keyframesPrefix + animationName, value));
28
+ content += "\n" + (typeof value === "string" ? value : stringifyCSSKeyframes(keyframesPrefix + animationName, value));
29
29
  }
30
30
  }
31
31
  if (mergeCSS) {
32
- mergedContent.push(content$1);
32
+ mergedContent.push(content);
33
33
  continue;
34
34
  }
35
35
  const filename = getGeneratedCSSFilename(className, options);
36
36
  assets.push({
37
37
  ...filename,
38
- content: content$1
38
+ content
39
39
  });
40
40
  if (isModule) imports.modules[filename.import] = generateCSSDefaultImportName(className);
41
41
  else imports.css.add(filename.import);
42
42
  }
43
43
  if (!embedAnimations && keyframes) for (const animationName in keyframes) {
44
44
  const value = keyframes[animationName];
45
- const content$1 = typeof value === "string" ? value : stringifyCSSKeyframes(keyframesPrefix + animationName, value);
45
+ const content = typeof value === "string" ? value : stringifyCSSKeyframes(keyframesPrefix + animationName, value);
46
46
  if (mergeCSS) {
47
- mergedContent.push(content$1);
47
+ mergedContent.push(content);
48
48
  continue;
49
49
  }
50
50
  const filename = getGeneratedCSSFilename(animationName, options);
51
51
  assets.push({
52
52
  ...filename,
53
- content: content$1
53
+ content
54
54
  });
55
55
  if (isModule) imports.modules[filename.import] = generateCSSDefaultImportName(animationName);
56
56
  else imports.css.add(filename.import);
57
57
  }
58
58
  if (mergeCSS && mergedContent.length) {
59
- const content$1 = mergedContent.join("\n");
59
+ const content = mergedContent.join("\n");
60
60
  if (typeof mergeCSS == "object") {
61
61
  assets.push({
62
62
  ...mergeCSS,
63
- content: content$1
63
+ content
64
64
  });
65
65
  if (isModule) imports.modules[mergeCSS.import] = "css";
66
66
  else if (!returnCSS) imports.css.add(mergeCSS.import);
67
67
  }
68
- return returnCSS ? content$1 : void 0;
68
+ return returnCSS ? content : void 0;
69
69
  }
70
70
  }
71
71
 
@@ -1,4 +1,4 @@
1
- import { camelize } from "../../../helpers/misc/strings.js";
1
+ import { camelize } from "../../../helpers/misc/strings.mjs";
2
2
 
3
3
  /**
4
4
  * Generate import name for CSS module
@@ -1,4 +1,4 @@
1
- import { GeneratedAssetPath } from "../../types/options.js";
1
+ import { GeneratedAssetPath } from "../../types/options.mjs";
2
2
  declare const defaultHelpersDirectory = "helpers";
3
3
  /**
4
4
  * Generate asset filename based on options
@@ -1,4 +1,4 @@
1
- import { ComponentFactoryOptions, GeneratedAssetPath } from "../../types/options.js";
1
+ import { ComponentFactoryOptions, GeneratedAssetPath } from "../../types/options.mjs";
2
2
  /**
3
3
  * Generate CSS filename based on options
4
4
  */
@@ -1,4 +1,4 @@
1
- import { getGeneratedAssetFilename } from "./asset.js";
1
+ import { getGeneratedAssetFilename } from "./asset.mjs";
2
2
 
3
3
  /**
4
4
  * Generate CSS filename based on options
@@ -1,4 +1,4 @@
1
- import { ComponentFactoryFileSystemOptions, GeneratedAssetPath } from "../../types/options.js";
1
+ import { ComponentFactoryFileSystemOptions, GeneratedAssetPath } from "../../types/options.mjs";
2
2
  /**
3
3
  * Get relative path to root directory from component
4
4
  *
@@ -0,0 +1,9 @@
1
+ import { UniqueHashPartialOptions } from "../../../helpers/hash/types.mjs";
2
+ import { FactoryIconData } from "../../types/data.mjs";
3
+ import { ComponentFactoryFileSystemOptions, GeneratedAssetPath } from "../../types/options.mjs";
4
+ interface Options extends Pick<UniqueHashPartialOptions, 'context'>, Pick<ComponentFactoryFileSystemOptions, 'rootPath' | 'doubleDirsForComponents' | 'prefixDirsForComponents' | 'sharedTypes'> {}
5
+ /**
6
+ * Generate component types filename based on options
7
+ */
8
+ declare function getGeneratedComponentTypesFilename(icon: Pick<FactoryIconData, 'name' | 'prefix'>, content: string, options: Options): GeneratedAssetPath;
9
+ export { getGeneratedComponentTypesFilename };
@@ -1,12 +1,13 @@
1
- import { getUniqueHash } from "../../../helpers/hash/unique.js";
2
- import { getGeneratedAssetFilename } from "./asset.js";
3
- import { getGeneratedComponentFilename } from "../../export/filename.js";
1
+ import { getUniqueHash } from "../../../helpers/hash/unique.mjs";
2
+ import { getGeneratedAssetFilename } from "./asset.mjs";
3
+ import { getGeneratedComponentFilename } from "../../export/filename.mjs";
4
4
 
5
5
  /**
6
6
  * Generate component types filename based on options
7
7
  */
8
8
  function getGeneratedComponentTypesFilename(icon, content, options) {
9
9
  if (options.sharedTypes) return getGeneratedAssetFilename(`types/${getUniqueHash(content, {
10
+ context: options.context,
10
11
  css: true,
11
12
  length: 8
12
13
  })}.d.ts`, options.rootPath);
@@ -1,6 +1,6 @@
1
- import { GeneratedAssetFile } from "../../types/component.js";
2
- import { ComponentFactoryOptions } from "../../types/options.js";
3
- import { FactoryComponentImports } from "../imports/types.js";
1
+ import { GeneratedAssetFile } from "../../types/component.mjs";
2
+ import { ComponentFactoryOptions } from "../../types/options.mjs";
3
+ import { FactoryComponentImports } from "../imports/types.mjs";
4
4
  /**
5
5
  * Adds getSizeProps() function to assets
6
6
  */
@@ -1,4 +1,4 @@
1
- import { defaultHelpersDirectory, getGeneratedAssetFilename } from "../filenames/asset.js";
1
+ import { defaultHelpersDirectory, getGeneratedAssetFilename } from "../filenames/asset.mjs";
2
2
 
3
3
  const functionName = "getSizeProps";
4
4
  const functionContent = `
@@ -1,4 +1,4 @@
1
- import { FactoryComponentImports } from "./types.js";
1
+ import { FactoryComponentImports } from "./types.mjs";
2
2
  /**
3
3
  * Add named import
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FactoryComponentImports } from "./types.js";
1
+ import { FactoryComponentImports } from "./types.mjs";
2
2
  /**
3
3
  * Create imports object
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FactoryComponentImports } from "./types.js";
1
+ import { FactoryComponentImports } from "./types.mjs";
2
2
  /**
3
3
  * Export imports as string
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FactoryComponentProps } from "./types.js";
1
+ import { FactoryComponentProps } from "./types.mjs";
2
2
  /**
3
3
  * Stringify properties for component as JS object
4
4
  */
@@ -1,4 +1,4 @@
1
- import { stringifyFactoryProps } from "./stringify.js";
1
+ import { stringifyFactoryProps } from "./stringify.mjs";
2
2
 
3
3
  /**
4
4
  * Stringify properties for component as JS object
@@ -1,4 +1,4 @@
1
- import { FactoryComponentProps } from "./types.js";
1
+ import { FactoryComponentProps } from "./types.mjs";
2
2
  /**
3
3
  * Template for property
4
4
  */
@@ -1,4 +1,4 @@
1
- import { FactoryComponentProps } from "./types.js";
1
+ import { FactoryComponentProps } from "./types.mjs";
2
2
  /**
3
3
  * Stringify properties for component
4
4
  */
@@ -0,0 +1,13 @@
1
+ import { GeneratedAssetFile } from "../../types/component.mjs";
2
+ import { FactoryIconData } from "../../types/data.mjs";
3
+ import { ComponentFactoryOptions } from "../../types/options.mjs";
4
+ import { FactoryComponentProps } from "../props/types.mjs";
5
+ import { JSXMode } from "../../types/jsx.mjs";
6
+ interface Options extends ComponentFactoryOptions {
7
+ jsx: JSXMode;
8
+ }
9
+ /**
10
+ * Add JSX component types
11
+ */
12
+ declare function addJSXComponentTypes(data: FactoryIconData, options: Options, assets: GeneratedAssetFile[], props: FactoryComponentProps): string;
13
+ export { addJSXComponentTypes };
@@ -1,4 +1,4 @@
1
- import { addComponentTypes } from "./wrapper.js";
1
+ import { addComponentTypes } from "./wrapper.mjs";
2
2
 
3
3
  const iconPropsTemplate = `interface IconProps {
4
4
  /* PROPS */
@@ -0,0 +1,9 @@
1
+ import { GeneratedAssetFile } from "../../types/component.mjs";
2
+ import { FactoryIconData } from "../../types/data.mjs";
3
+ import { ComponentFactoryOptions } from "../../types/options.mjs";
4
+ import { FactoryComponentProps } from "../props/types.mjs";
5
+ /**
6
+ * Add Svelte component types
7
+ */
8
+ declare const addSvelteComponentTypes: (data: FactoryIconData, options: ComponentFactoryOptions, assets: GeneratedAssetFile[], props: FactoryComponentProps) => string;
9
+ export { addSvelteComponentTypes };
@@ -1,4 +1,4 @@
1
- import { addComponentTypes } from "./wrapper.js";
1
+ import { addComponentTypes } from "./wrapper.mjs";
2
2
 
3
3
  /**
4
4
  * Add Svelte component types
@@ -0,0 +1,9 @@
1
+ import { GeneratedAssetFile } from "../../types/component.mjs";
2
+ import { FactoryIconData } from "../../types/data.mjs";
3
+ import { ComponentFactoryOptions } from "../../types/options.mjs";
4
+ import { FactoryComponentProps } from "../props/types.mjs";
5
+ /**
6
+ * Add Vue component types
7
+ */
8
+ declare const addVueComponentTypes: (data: FactoryIconData, options: ComponentFactoryOptions, assets: GeneratedAssetFile[], props: FactoryComponentProps) => string;
9
+ export { addVueComponentTypes };
@@ -1,4 +1,4 @@
1
- import { addComponentTypes } from "./wrapper.js";
1
+ import { addComponentTypes } from "./wrapper.mjs";
2
2
 
3
3
  /**
4
4
  * Add Vue component types
@@ -0,0 +1,9 @@
1
+ import { GeneratedAssetFile } from "../../types/component.mjs";
2
+ import { FactoryIconData } from "../../types/data.mjs";
3
+ import { ComponentFactoryOptions } from "../../types/options.mjs";
4
+ import { FactoryComponentProps } from "../props/types.mjs";
5
+ /**
6
+ * Add component types
7
+ */
8
+ declare function addComponentTypes(template: string, data: FactoryIconData, options: ComponentFactoryOptions, assets: GeneratedAssetFile[], props: FactoryComponentProps): string;
9
+ export { addComponentTypes };
@@ -1,5 +1,5 @@
1
- import { stringifyFactoryPropTypes } from "../props/ts.js";
2
- import { getGeneratedComponentTypesFilename } from "../filenames/types.js";
1
+ import { stringifyFactoryPropTypes } from "../props/ts.mjs";
2
+ import { getGeneratedComponentTypesFilename } from "../filenames/types.mjs";
3
3
 
4
4
  /**
5
5
  * Add component types
@@ -1,7 +1,7 @@
1
- import { FactoryGeneratedComponent } from "./types/component.js";
2
- import { FactoryIconData } from "./types/data.js";
3
- import { ComponentFactoryOptions } from "./types/options.js";
4
- import { JSXMode } from "./types/jsx.js";
1
+ import { FactoryGeneratedComponent } from "./types/component.mjs";
2
+ import { FactoryIconData } from "./types/data.mjs";
3
+ import { ComponentFactoryOptions } from "./types/options.mjs";
4
+ import { JSXMode } from "./types/jsx.mjs";
5
5
  interface Options extends ComponentFactoryOptions {
6
6
  jsx: JSXMode;
7
7
  fallbackPackage?: string;
@@ -1,16 +1,16 @@
1
- import { getComponentSizeValues } from "./helpers/content/size.js";
2
- import { stringifyFactoryIconContent } from "./helpers/content/stringify.js";
3
- import { stringifyIconViewBox } from "../svg/viewbox/value.js";
4
- import { createFactoryImports } from "./helpers/imports/create.js";
5
- import { generateCSSFilesForComponent } from "./helpers/css/generate.js";
6
- import { addSizeFunctionAsset } from "./helpers/functions/size.js";
7
- import { stringifyFactoryPropsAsJSON } from "./helpers/props/object.js";
8
- import { stringifyFactoryImports } from "./helpers/imports/stringify.js";
9
- import { makeSquareViewBox } from "../svg/viewbox/square.js";
10
- import { getUsedFactoryProps, stringifyFactoryPropTypes } from "./helpers/props/ts.js";
11
- import { minifyViewBox } from "../svg/viewbox/minify.js";
12
- import { getViewBoxRatio } from "./helpers/content/ratio.js";
13
- import { addJSXComponentTypes } from "./helpers/ts/jsx.js";
1
+ import { getComponentSizeValues } from "./helpers/content/size.mjs";
2
+ import { stringifyFactoryIconContent } from "./helpers/content/stringify.mjs";
3
+ import { stringifyIconViewBox } from "../svg/viewbox/value.mjs";
4
+ import { createFactoryImports } from "./helpers/imports/create.mjs";
5
+ import { generateCSSFilesForComponent } from "./helpers/css/generate.mjs";
6
+ import { addSizeFunctionAsset } from "./helpers/functions/size.mjs";
7
+ import { stringifyFactoryPropsAsJSON } from "./helpers/props/object.mjs";
8
+ import { stringifyFactoryImports } from "./helpers/imports/stringify.mjs";
9
+ import { makeSquareViewBox } from "../svg/viewbox/square.mjs";
10
+ import { getUsedFactoryProps, stringifyFactoryPropTypes } from "./helpers/props/ts.mjs";
11
+ import { minifyViewBox } from "../svg/viewbox/minify.mjs";
12
+ import { getViewBoxRatio } from "./helpers/content/ratio.mjs";
13
+ import { addJSXComponentTypes } from "./helpers/ts/jsx.mjs";
14
14
 
15
15
  /**
16
16
  * Create functional Vue component code
@@ -52,7 +52,7 @@ function createJSXComponent(data, options) {
52
52
  value: "props",
53
53
  template: "...props,"
54
54
  };
55
- const getViewBox = (viewBox$1) => isStringViewBox ? `'${stringifyIconViewBox(viewBox$1)}'` : JSON.stringify(minifyViewBox(viewBox$1));
55
+ const getViewBox = (viewBox) => isStringViewBox ? `'${stringifyIconViewBox(viewBox)}'` : JSON.stringify(minifyViewBox(viewBox));
56
56
  if (hasComputedViewbox) {
57
57
  componentExternalCode.push(`const baseViewBox = ${getViewBox(viewBox)};`, `const squareViewBox = ${getViewBox(makeSquareViewBox(viewBox))};`);
58
58
  componentInternalCode.push(`const viewBox = useMemo(() => square ? squareViewBox : baseViewBox, [square]);`);
@@ -1,7 +1,7 @@
1
- import { GeneratedAssetFile } from "../types/component.js";
2
- import { ConvertSVGContentOptions } from "../../svg-css/types.js";
3
- import { FactoryIconData } from "../types/data.js";
4
- import { GeneratedAssetPath } from "../types/options.js";
1
+ import { GeneratedAssetFile } from "../types/component.mjs";
2
+ import { ConvertSVGContentOptions } from "../../svg-css/types.mjs";
3
+ import { FactoryIconData } from "../types/data.mjs";
4
+ import { GeneratedAssetPath } from "../types/options.mjs";
5
5
  import { IconifyIcon, IconifyJSON } from "@iconify/types";
6
6
  interface Options extends ConvertSVGContentOptions {
7
7
  fallback?: string | boolean;
@@ -9,7 +9,7 @@ interface Options extends ConvertSVGContentOptions {
9
9
  /**
10
10
  * Convert IconifyIcon data to FactoryIconData
11
11
  */
12
- declare function convertIconifyIconToFactoryContent(icon: IconifyIcon, prefix: string, name: string, options?: Options): FactoryIconData;
12
+ declare function convertIconifyIconToFactoryContent(icon: IconifyIcon, prefix: string, name: string, options: Options): FactoryIconData;
13
13
  /**
14
14
  * Create metadata assets for an icon set
15
15
  */
@@ -1,6 +1,6 @@
1
- import { convertSVGContentToCSSRules } from "../../svg-css/content.js";
2
- import { getGeneratedAssetFilename } from "../helpers/filenames/asset.js";
3
- import { normaliseIconifyIcon } from "../../iconify/icon/nornalise.js";
1
+ import { convertSVGContentToCSSRules } from "../../svg-css/content.mjs";
2
+ import { getGeneratedAssetFilename } from "../helpers/filenames/asset.mjs";
3
+ import { normaliseIconifyIcon } from "../../iconify/icon/nornalise.mjs";
4
4
 
5
5
  /**
6
6
  * Convert IconifyIcon data to FactoryIconData
@@ -1,4 +1,4 @@
1
- import { ComponentFactoryFileSystemOptions } from "../types/options.js";
1
+ import { ComponentFactoryFileSystemOptions } from "../types/options.mjs";
2
2
  /**
3
3
  * Generate file system options
4
4
  */
@@ -1,5 +1,5 @@
1
- import { getGeneratedAssetFilename } from "../helpers/filenames/asset.js";
2
- import { getFactoryRelativeRootPath } from "../helpers/filenames/path.js";
1
+ import { getGeneratedAssetFilename } from "../helpers/filenames/asset.mjs";
2
+ import { getFactoryRelativeRootPath } from "../helpers/filenames/path.mjs";
3
3
 
4
4
  /**
5
5
  * Generate file system options
@@ -0,0 +1,8 @@
1
+ import { FactoryGeneratedComponent } from "./types/component.mjs";
2
+ import { FactoryIconData } from "./types/data.mjs";
3
+ import { ComponentFactoryOptions } from "./types/options.mjs";
4
+ /**
5
+ * Create raw component code
6
+ */
7
+ declare function createRawComponent(data: FactoryIconData, options: ComponentFactoryOptions): FactoryGeneratedComponent;
8
+ export { createRawComponent };
@@ -1,11 +1,11 @@
1
- import { getComponentSizeValues } from "./helpers/content/size.js";
2
- import { stringifyFactoryIconContent } from "./helpers/content/stringify.js";
3
- import { stringifyIconViewBox } from "../svg/viewbox/value.js";
4
- import { createFactoryImports } from "./helpers/imports/create.js";
5
- import { generateCSSFilesForComponent } from "./helpers/css/generate.js";
6
- import { factoryPropTemplate, stringifyFactoryProps } from "./helpers/props/stringify.js";
7
- import { stringifyFactoryImports } from "./helpers/imports/stringify.js";
8
- import { getGeneratedComponentTypesFilename } from "./helpers/filenames/types.js";
1
+ import { getComponentSizeValues } from "./helpers/content/size.mjs";
2
+ import { stringifyFactoryIconContent } from "./helpers/content/stringify.mjs";
3
+ import { stringifyIconViewBox } from "../svg/viewbox/value.mjs";
4
+ import { createFactoryImports } from "./helpers/imports/create.mjs";
5
+ import { generateCSSFilesForComponent } from "./helpers/css/generate.mjs";
6
+ import { factoryPropTemplate, stringifyFactoryProps } from "./helpers/props/stringify.mjs";
7
+ import { stringifyFactoryImports } from "./helpers/imports/stringify.mjs";
8
+ import { getGeneratedComponentTypesFilename } from "./helpers/filenames/types.mjs";
9
9
 
10
10
  /**
11
11
  * Create raw component code
@@ -1,6 +1,6 @@
1
- import { FactoryGeneratedComponent } from "./types/component.js";
2
- import { FactoryIconData } from "./types/data.js";
3
- import { ComponentFactoryOptions } from "./types/options.js";
1
+ import { FactoryGeneratedComponent } from "./types/component.mjs";
2
+ import { FactoryIconData } from "./types/data.mjs";
3
+ import { ComponentFactoryOptions } from "./types/options.mjs";
4
4
  interface SvelteOptions extends ComponentFactoryOptions {
5
5
  ts?: boolean;
6
6
  }
@@ -1,16 +1,16 @@
1
- import { getComponentSizeValues } from "./helpers/content/size.js";
2
- import { stringifyFactoryIconContent } from "./helpers/content/stringify.js";
3
- import { stringifyIconViewBox } from "../svg/viewbox/value.js";
4
- import { createFactoryImports } from "./helpers/imports/create.js";
5
- import { generateCSSFilesForComponent } from "./helpers/css/generate.js";
6
- import { addSizeFunctionAsset } from "./helpers/functions/size.js";
7
- import { stringifyFactoryProps } from "./helpers/props/stringify.js";
8
- import { stringifyFactoryImports } from "./helpers/imports/stringify.js";
9
- import { makeSquareViewBox } from "../svg/viewbox/square.js";
10
- import { getUsedFactoryProps, stringifyFactoryPropTypes } from "./helpers/props/ts.js";
11
- import { minifyViewBox } from "../svg/viewbox/minify.js";
12
- import { getViewBoxRatio } from "./helpers/content/ratio.js";
13
- import { addSvelteComponentTypes } from "./helpers/ts/svelte.js";
1
+ import { getComponentSizeValues } from "./helpers/content/size.mjs";
2
+ import { stringifyFactoryIconContent } from "./helpers/content/stringify.mjs";
3
+ import { stringifyIconViewBox } from "../svg/viewbox/value.mjs";
4
+ import { createFactoryImports } from "./helpers/imports/create.mjs";
5
+ import { generateCSSFilesForComponent } from "./helpers/css/generate.mjs";
6
+ import { addSizeFunctionAsset } from "./helpers/functions/size.mjs";
7
+ import { stringifyFactoryProps } from "./helpers/props/stringify.mjs";
8
+ import { stringifyFactoryImports } from "./helpers/imports/stringify.mjs";
9
+ import { makeSquareViewBox } from "../svg/viewbox/square.mjs";
10
+ import { getUsedFactoryProps, stringifyFactoryPropTypes } from "./helpers/props/ts.mjs";
11
+ import { minifyViewBox } from "../svg/viewbox/minify.mjs";
12
+ import { getViewBoxRatio } from "./helpers/content/ratio.mjs";
13
+ import { addSvelteComponentTypes } from "./helpers/ts/svelte.mjs";
14
14
 
15
15
  /**
16
16
  * Create Svelte component code
@@ -39,7 +39,7 @@ function createSvelteComponent(data, options) {
39
39
  const props = {};
40
40
  if (!hasFallback) props.xmlns = "http://www.w3.org/2000/svg";
41
41
  const viewBoxPropValue = `viewBox${hasComputedViewbox ? "Computed" : ""}`;
42
- const getViewBox = (viewBox$1) => isStringViewBox ? `'${stringifyIconViewBox(viewBox$1)}'` : JSON.stringify(minifyViewBox(viewBox$1));
42
+ const getViewBox = (viewBox) => isStringViewBox ? `'${stringifyIconViewBox(viewBox)}'` : JSON.stringify(minifyViewBox(viewBox));
43
43
  if (hasComputedViewbox) componentCode.push(`const baseViewBox = ${getViewBox(viewBox)};`, `const squareViewBox = ${getViewBox(makeSquareViewBox(viewBox))};`, `let ${viewBoxPropValue} = $derived(square ? squareViewBox : baseViewBox);`);
44
44
  else componentCode.push(`const ${viewBoxPropValue} = ${getViewBox(viewBox)};`);
45
45
  const ratioValue = getViewBoxRatio(viewBox);
@@ -1,5 +1,5 @@
1
- import { IconViewBox } from "../../svg/viewbox/types.js";
2
- import { ComponentFactorySource } from "./source.js";
1
+ import { IconViewBox } from "../../svg/viewbox/types.mjs";
2
+ import { ComponentFactorySource } from "./source.mjs";
3
3
  /**
4
4
  * Icon data
5
5
  */
@@ -1,4 +1,5 @@
1
- import { CSSExportMode } from "./css.js";
1
+ import { UniqueHashPartialOptions } from "../../helpers/hash/types.mjs";
2
+ import { CSSExportMode } from "./css.mjs";
2
3
  /**
3
4
  * Asset path, generated from configuration
4
5
  */
@@ -31,5 +32,5 @@ interface ComponentFactoryRenderingOptions {
31
32
  /**
32
33
  * Options for component factory
33
34
  */
34
- interface ComponentFactoryOptions extends ComponentFactoryFileSystemOptions, ComponentFactoryRenderingOptions {}
35
+ interface ComponentFactoryOptions extends ComponentFactoryFileSystemOptions, ComponentFactoryRenderingOptions, Pick<UniqueHashPartialOptions, 'context'> {}
35
36
  export { ComponentFactoryFileSystemOptions, ComponentFactoryOptions, ComponentFactoryRenderingOptions, GeneratedAssetPath };