@iconify/tools 2.1.1 → 2.2.0-beta.1

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 (89) hide show
  1. package/lib/colors/attribs.cjs +0 -2
  2. package/lib/colors/attribs.d.ts +4 -4
  3. package/lib/colors/detect.cjs +0 -2
  4. package/lib/colors/parse.cjs +0 -2
  5. package/lib/colors/parse.d.ts +4 -4
  6. package/lib/colors/validate.cjs +0 -2
  7. package/lib/css/parse.cjs +0 -2
  8. package/lib/css/parser/error.cjs +0 -2
  9. package/lib/css/parser/export.cjs +0 -2
  10. package/lib/css/parser/strings.cjs +0 -2
  11. package/lib/css/parser/text.cjs +0 -2
  12. package/lib/css/parser/tokens.cjs +0 -2
  13. package/lib/css/parser/tree.cjs +0 -2
  14. package/lib/css/parser/types.d.ts +4 -4
  15. package/lib/download/api/cache.cjs +0 -2
  16. package/lib/download/api/download.cjs +1 -7
  17. package/lib/download/api/index.cjs +1 -7
  18. package/lib/download/git/branch.cjs +0 -2
  19. package/lib/download/git/hash.cjs +0 -2
  20. package/lib/download/git/index.cjs +0 -2
  21. package/lib/download/git/reset.cjs +0 -2
  22. package/lib/download/github/hash.cjs +0 -2
  23. package/lib/download/github/index.cjs +0 -2
  24. package/lib/download/gitlab/hash.cjs +0 -2
  25. package/lib/download/gitlab/index.cjs +0 -2
  26. package/lib/download/gitlab/types.cjs +0 -2
  27. package/lib/download/helpers/untar.cjs +0 -2
  28. package/lib/download/helpers/unzip.cjs +1 -7
  29. package/lib/download/index.cjs +0 -2
  30. package/lib/download/index.d.ts +4 -4
  31. package/lib/download/npm/index.cjs +0 -2
  32. package/lib/download/npm/version.cjs +0 -2
  33. package/lib/download/types/modified.d.ts +1 -1
  34. package/lib/download/types/sources.d.ts +1 -1
  35. package/lib/export/directory.cjs +0 -2
  36. package/lib/export/helpers/custom-files.cjs +0 -2
  37. package/lib/export/helpers/prepare.cjs +0 -2
  38. package/lib/export/helpers/types-version.cjs +0 -2
  39. package/lib/export/icon-package.cjs +0 -2
  40. package/lib/export/json-package.cjs +0 -2
  41. package/lib/icon-set/index.cjs +0 -2
  42. package/lib/icon-set/match.cjs +0 -2
  43. package/lib/icon-set/merge.cjs +0 -2
  44. package/lib/icon-set/modified.cjs +0 -2
  45. package/lib/icon-set/props.cjs +0 -2
  46. package/lib/icon-set/tags.cjs +0 -2
  47. package/lib/icon-set/types.d.ts +7 -7
  48. package/lib/import/directory.cjs +0 -2
  49. package/lib/import/directory.d.ts +2 -2
  50. package/lib/import/figma/index.cjs +0 -2
  51. package/lib/import/figma/nodes.cjs +0 -2
  52. package/lib/import/figma/query.cjs +0 -2
  53. package/lib/import/figma/types/api.d.ts +1 -1
  54. package/lib/import/figma/types/nodes.d.ts +5 -5
  55. package/lib/import/figma/types/options.d.ts +1 -1
  56. package/lib/index.cjs +0 -2
  57. package/lib/misc/bump-version.cjs +0 -2
  58. package/lib/misc/cheerio.d.ts +2 -2
  59. package/lib/misc/compare-dirs.cjs +0 -2
  60. package/lib/misc/exec.cjs +0 -2
  61. package/lib/misc/keyword.cjs +0 -2
  62. package/lib/misc/scan.cjs +0 -2
  63. package/lib/misc/scan.d.ts +5 -5
  64. package/lib/misc/write-json.cjs +0 -2
  65. package/lib/optimise/flags.cjs +0 -2
  66. package/lib/optimise/global-style.cjs +0 -2
  67. package/lib/optimise/scale.cjs +0 -2
  68. package/lib/optimise/svgo.cjs +1 -3
  69. package/lib/optimise/svgo.d.ts +4 -4
  70. package/lib/optimise/svgo.mjs +1 -1
  71. package/lib/svg/analyse/error.cjs +0 -2
  72. package/lib/svg/analyse/types.d.ts +1 -1
  73. package/lib/svg/analyse.cjs +0 -2
  74. package/lib/svg/cleanup/attribs.cjs +0 -2
  75. package/lib/svg/cleanup/bad-tags.cjs +0 -2
  76. package/lib/svg/cleanup/inline-style.cjs +0 -2
  77. package/lib/svg/cleanup/root-style.cjs +0 -2
  78. package/lib/svg/cleanup/root-svg.cjs +0 -2
  79. package/lib/svg/cleanup/svgo-style.cjs +0 -2
  80. package/lib/svg/cleanup.cjs +0 -2
  81. package/lib/svg/data/attributes.cjs +0 -2
  82. package/lib/svg/data/tags.cjs +0 -2
  83. package/lib/svg/index.cjs +1 -7
  84. package/lib/svg/parse-style.cjs +0 -2
  85. package/lib/svg/parse-style.d.ts +3 -3
  86. package/lib/svg/parse.cjs +0 -2
  87. package/lib/svg/parse.d.ts +1 -1
  88. package/license.txt +0 -0
  89. package/package.json +533 -422
@@ -7,8 +7,8 @@ import '../../../icon-set/types.js';
7
7
  import '../../../svg/index.js';
8
8
  import '@iconify/utils/lib/icon-set/tree';
9
9
 
10
- declare type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP';
11
- declare type FigmaImportIconNodeType = IconFigmaNode['type'];
10
+ type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP';
11
+ type FigmaImportIconNodeType = IconFigmaNode['type'];
12
12
  /**
13
13
  * Node information passed to callback
14
14
  */
@@ -30,14 +30,14 @@ interface FigmaImportNodeData {
30
30
  *
31
31
  * Used to speed up processing by eleminating pages, frames and groups that do not need processing
32
32
  */
33
- declare type FigmaImportParentNodeFilter = (node: FigmaParentNodeData[], document: FigmaDocument) => boolean;
33
+ type FigmaImportParentNodeFilter = (node: FigmaParentNodeData[], document: FigmaDocument) => boolean;
34
34
  /**
35
35
  * Check if node is an icon.
36
36
  *
37
37
  * Returns icon name on success, null or undefined if not should be ignored.
38
38
  * Function can also return FigmaIconNode object, where it can put extra properties that can be used later
39
39
  */
40
- declare type FigmaIconNodeWithKeyword = Partial<FigmaIconNode> & Pick<FigmaIconNode, 'keyword'>;
41
- declare type FigmaImportNodeFilter = (node: FigmaImportNodeData, nodes: FigmaNodesImportResult, document: FigmaDocument) => string | FigmaIconNodeWithKeyword | null | undefined;
40
+ type FigmaIconNodeWithKeyword = Partial<FigmaIconNode> & Pick<FigmaIconNode, 'keyword'>;
41
+ type FigmaImportNodeFilter = (node: FigmaImportNodeData, nodes: FigmaNodesImportResult, document: FigmaDocument) => string | FigmaIconNodeWithKeyword | null | undefined;
42
42
 
43
43
  export { FigmaImportIconNodeType, FigmaImportNodeData, FigmaImportNodeFilter, FigmaImportParentNodeFilter, FigmaImportParentNodeType, FigmaParentNodeData };
@@ -42,7 +42,7 @@ interface FigmaGetIconNodesOptions {
42
42
  /**
43
43
  * Callback to call before or after importing icon
44
44
  */
45
- declare type FigmaImportedIconCallback = (node: FigmaIconNode, iconSet: IconSet) => void | Promise<void>;
45
+ type FigmaImportedIconCallback = (node: FigmaIconNode, iconSet: IconSet) => void | Promise<void>;
46
46
  /**
47
47
  * Options for main import function
48
48
  */
package/lib/index.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_index = require('./svg/index.cjs');
6
4
  const svg_parse = require('./svg/parse.cjs');
7
5
  const svg_parseStyle = require('./svg/parse-style.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function bumpVersion(version) {
6
4
  const versionParts = version.split(".");
7
5
  const lastPart = versionParts.pop();
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shortcuts for Cheerio elements
3
3
  */
4
- declare type CheerioElement = cheerio.TagElement;
5
- declare type WrappedCheerioElement = cheerio.Cheerio;
4
+ type CheerioElement = cheerio.TagElement;
5
+ type WrappedCheerioElement = cheerio.Cheerio;
6
6
 
7
7
  export { CheerioElement, WrappedCheerioElement };
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const fs = require('fs');
6
4
  const export_helpers_prepare = require('../export/helpers/prepare.cjs');
7
5
  const misc_scan = require('./scan.cjs');
package/lib/misc/exec.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const pathe = require('pathe');
6
4
  const child_process = require('child_process');
7
5
 
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function cleanupIconKeyword(keyword, convertCamelCase = false) {
6
4
  if (convertCamelCase) {
7
5
  keyword = keyword.replace(
package/lib/misc/scan.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const fs = require('fs');
6
4
 
7
5
  async function scanDirectory(path, callback, subdirs = true) {
@@ -13,11 +13,11 @@ import { Stats } from 'fs';
13
13
  * - string to include custom string (such as file without extension)
14
14
  * - custom object to return custom object
15
15
  */
16
- declare type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
17
- declare type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
18
- declare type ScanDirectoryCallbackAsString = (ext: string, file: string, subdir: string, path: string, stat: Stats) => ScanDirectoryCallbackStringResult | Promise<ScanDirectoryCallbackStringResult>;
19
- declare type ScanDirectoryCallbackAsCustom<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T | ScanDirectoryCallbackFalseResult | Promise<T | ScanDirectoryCallbackFalseResult>;
20
- declare type ScanDirectoryCallback = ScanDirectoryCallbackAsCustom<unknown> | ScanDirectoryCallbackAsString;
16
+ type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
17
+ type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
18
+ type ScanDirectoryCallbackAsString = (ext: string, file: string, subdir: string, path: string, stat: Stats) => ScanDirectoryCallbackStringResult | Promise<ScanDirectoryCallbackStringResult>;
19
+ type ScanDirectoryCallbackAsCustom<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T | ScanDirectoryCallbackFalseResult | Promise<T | ScanDirectoryCallbackFalseResult>;
20
+ type ScanDirectoryCallback = ScanDirectoryCallbackAsCustom<unknown> | ScanDirectoryCallbackAsString;
21
21
  /**
22
22
  * Find all files in directory
23
23
  */
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const fs = require('fs');
6
4
 
7
5
  async function writeJSONFile(filename, data) {
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_parse = require('../svg/parse.cjs');
6
4
 
7
5
  const CLOSE_PATH = 1;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_data_tags = require('../svg/data/tags.cjs');
6
4
  const svg_parse = require('../svg/parse.cjs');
7
5
  const svg_parseStyle = require('../svg/parse-style.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const optimise_svgo = require('./svgo.cjs');
6
4
  require('svgo');
7
5
 
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svgo = require('svgo');
6
4
 
7
5
  function getSVGOPlugins(options) {
@@ -48,7 +46,7 @@ function getSVGOPlugins(options) {
48
46
  ],
49
47
  ...options.cleanupIDs !== false ? [
50
48
  {
51
- name: "cleanupIDs",
49
+ name: "cleanupIds",
52
50
  params: {
53
51
  prefix: typeof options.cleanupIDs === "string" ? options.cleanupIDs : "svgID"
54
52
  }
@@ -1,4 +1,4 @@
1
- import { Plugin } from 'svgo';
1
+ import { PluginConfig } from 'svgo';
2
2
  import { SVG } from '../svg/index.js';
3
3
  import '@iconify/types';
4
4
  import '@iconify/utils/lib/customisations/defaults';
@@ -13,7 +13,7 @@ interface GetSVGOPluingOptions extends CleanupIDsOption {
13
13
  /**
14
14
  * Get list of plugins
15
15
  */
16
- declare function getSVGOPlugins(options: GetSVGOPluingOptions): Plugin[];
16
+ declare function getSVGOPlugins(options: GetSVGOPluingOptions): PluginConfig[];
17
17
  /**
18
18
  * Options
19
19
  */
@@ -21,13 +21,13 @@ interface SVGOCommonOptions {
21
21
  multipass?: boolean;
22
22
  }
23
23
  interface SVGOOptionsWithPlugin extends SVGOCommonOptions {
24
- plugins: Plugin[];
24
+ plugins: PluginConfig[];
25
25
  }
26
26
  interface SVGOptionsWithoutPlugin extends SVGOCommonOptions, CleanupIDsOption {
27
27
  plugins?: undefined;
28
28
  keepShapes?: boolean;
29
29
  }
30
- declare type SVGOOptions = SVGOOptionsWithPlugin | SVGOptionsWithoutPlugin;
30
+ type SVGOOptions = SVGOOptionsWithPlugin | SVGOptionsWithoutPlugin;
31
31
  /**
32
32
  * Run SVGO on icon
33
33
  */
@@ -44,7 +44,7 @@ function getSVGOPlugins(options) {
44
44
  ],
45
45
  ...options.cleanupIDs !== false ? [
46
46
  {
47
- name: "cleanupIDs",
47
+ name: "cleanupIds",
48
48
  params: {
49
49
  prefix: typeof options.cleanupIDs === "string" ? options.cleanupIDs : "svgID"
50
50
  }
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function analyseTagError(element) {
6
4
  let result = "<" + element.tagName;
7
5
  if (element._id) {
@@ -75,7 +75,7 @@ interface ElementsTreeItem {
75
75
  /**
76
76
  * Elements map
77
77
  */
78
- declare type ElementsMap = Map<number, ExtendedTagElement>;
78
+ type ElementsMap = Map<number, ExtendedTagElement>;
79
79
  /**
80
80
  * Result
81
81
  */
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_parse = require('./parse.cjs');
6
4
  const svg_data_attributes = require('./data/attributes.cjs');
7
5
  const svg_data_tags = require('./data/tags.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_data_attributes = require('../data/attributes.cjs');
6
4
  const svg_data_tags = require('../data/tags.cjs');
7
5
  const svg_parse = require('../parse.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_parse = require('../parse.cjs');
6
4
  const svg_data_tags = require('../data/tags.cjs');
7
5
 
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const css_parse = require('../../css/parse.cjs');
6
4
  const svg_data_attributes = require('../data/attributes.cjs');
7
5
  const svg_parse = require('../parse.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_parseStyle = require('../parse-style.cjs');
6
4
  require('../../css/parse.cjs');
7
5
  require('../../css/parser/tokens.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_data_attributes = require('../data/attributes.cjs');
6
4
  const svg_data_tags = require('../data/tags.cjs');
7
5
 
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_data_attributes = require('../data/attributes.cjs');
6
4
  const svg_parseStyle = require('../parse-style.cjs');
7
5
  const optimise_svgo = require('../../optimise/svgo.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_cleanup_attribs = require('./cleanup/attribs.cjs');
6
4
  const svg_cleanup_badTags = require('./cleanup/bad-tags.cjs');
7
5
  const svg_cleanup_inlineStyle = require('./cleanup/inline-style.cjs');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const svg_data_tags = require('./tags.cjs');
6
4
 
7
5
  const badAttributes = /* @__PURE__ */ new Set([
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const badTags = /* @__PURE__ */ new Set([
6
4
  "foreignObject",
7
5
  "script",
package/lib/svg/index.cjs CHANGED
@@ -1,14 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const cheerio = require('cheerio');
6
4
  const utils = require('@iconify/utils');
7
5
 
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
9
-
10
- const cheerio__default = /*#__PURE__*/_interopDefaultLegacy(cheerio);
11
-
12
6
  class SVG {
13
7
  constructor(content) {
14
8
  this.load(content);
@@ -90,7 +84,7 @@ class SVG {
90
84
  );
91
85
  remove('xml:space="preserve"', "", "");
92
86
  content = content.replace(/<g>\s*<\/g>/g, "");
93
- this.$svg = cheerio__default.load(content.trim(), {
87
+ this.$svg = cheerio.load(content.trim(), {
94
88
  lowerCaseAttributeNames: false,
95
89
  xmlMode: true
96
90
  });
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const css_parse = require('../css/parse.cjs');
6
4
  const css_parser_export = require('../css/parser/export.cjs');
7
5
  const css_parser_tokens = require('../css/parser/tokens.cjs');
@@ -24,15 +24,15 @@ interface ParseSVGStyleCallbackItemGlobal extends ParseSVGStyleCallbackItemCommo
24
24
  prevTokens: (CSSToken | null)[];
25
25
  nextTokens: CSSToken[];
26
26
  }
27
- declare type ParseSVGStyleCallbackItem = ParseSVGStyleCallbackItemInline | ParseSVGStyleCallbackItemGlobal;
27
+ type ParseSVGStyleCallbackItem = ParseSVGStyleCallbackItemInline | ParseSVGStyleCallbackItemGlobal;
28
28
  /**
29
29
  * Result: undefined to remove item, string to change/keep item
30
30
  */
31
- declare type ParseSVGStyleCallbackResult = string | undefined;
31
+ type ParseSVGStyleCallbackResult = string | undefined;
32
32
  /**
33
33
  * Callback function
34
34
  */
35
- declare type ParseSVGStyleCallback = (item: ParseSVGStyleCallbackItem) => ParseSVGStyleCallbackResult | Promise<ParseSVGStyleCallbackResult>;
35
+ type ParseSVGStyleCallback = (item: ParseSVGStyleCallbackItem) => ParseSVGStyleCallbackResult | Promise<ParseSVGStyleCallbackResult>;
36
36
  /**
37
37
  * Parse styles in SVG
38
38
  *
package/lib/svg/parse.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  async function parseSVG(svg, callback) {
6
4
  async function checkNode(element, parents) {
7
5
  if (element.type !== "tag") {
@@ -18,7 +18,7 @@ interface ParseSVGCallbackItem {
18
18
  /**
19
19
  * Callback function
20
20
  */
21
- declare type ParseSVGCallback = (item: ParseSVGCallbackItem) => void | Promise<void>;
21
+ type ParseSVGCallback = (item: ParseSVGCallbackItem) => void | Promise<void>;
22
22
  /**
23
23
  * Parse SVG
24
24
  *
package/license.txt CHANGED
File without changes