@iconify/tools 4.0.3 → 4.0.5

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.
@@ -6,6 +6,7 @@ import 'cheerio';
6
6
  import '@iconify/types';
7
7
  import '@iconify/utils/lib/customisations/defaults';
8
8
  import '../misc/cheerio.cjs';
9
+ import 'domhandler';
9
10
 
10
11
  /**
11
12
  * Result
@@ -6,6 +6,7 @@ import 'cheerio';
6
6
  import '@iconify/types';
7
7
  import '@iconify/utils/lib/customisations/defaults';
8
8
  import '../misc/cheerio.mjs';
9
+ import 'domhandler';
9
10
 
10
11
  /**
11
12
  * Result
@@ -6,6 +6,7 @@ import 'cheerio';
6
6
  import '@iconify/types';
7
7
  import '@iconify/utils/lib/customisations/defaults';
8
8
  import '../misc/cheerio.js';
9
+ import 'domhandler';
9
10
 
10
11
  /**
11
12
  * Result
@@ -7,6 +7,7 @@ import '@iconify/utils/lib/colors/types';
7
7
  import './attribs.cjs';
8
8
  import '../svg/analyse/types.cjs';
9
9
  import '../misc/cheerio.cjs';
10
+ import 'domhandler';
10
11
 
11
12
  /**
12
13
  * Validate colors in icon
@@ -7,6 +7,7 @@ import '@iconify/utils/lib/colors/types';
7
7
  import './attribs.mjs';
8
8
  import '../svg/analyse/types.mjs';
9
9
  import '../misc/cheerio.mjs';
10
+ import 'domhandler';
10
11
 
11
12
  /**
12
13
  * Validate colors in icon
@@ -7,6 +7,7 @@ import '@iconify/utils/lib/colors/types';
7
7
  import './attribs.js';
8
8
  import '../svg/analyse/types.js';
9
9
  import '../misc/cheerio.js';
10
+ import 'domhandler';
10
11
 
11
12
  /**
12
13
  * Validate colors in icon
@@ -57,7 +57,7 @@ function getFigmaIconNodes(document, options) {
57
57
  case "FRAME":
58
58
  case "GROUP":
59
59
  case "SECTION":
60
- case "COMPONENT": {
60
+ case "COMPONENT_SET": {
61
61
  const parentItem = {
62
62
  ...node,
63
63
  type: parentNodeType
@@ -55,7 +55,7 @@ function getFigmaIconNodes(document, options) {
55
55
  case "FRAME":
56
56
  case "GROUP":
57
57
  case "SECTION":
58
- case "COMPONENT": {
58
+ case "COMPONENT_SET": {
59
59
  const parentItem = {
60
60
  ...node,
61
61
  type: parentNodeType
@@ -8,7 +8,7 @@ import '../../../svg/index.cjs';
8
8
  import 'cheerio';
9
9
  import '@iconify/utils/lib/icon-set/tree';
10
10
 
11
- type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION' | 'COMPONENT';
11
+ type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION' | 'COMPONENT_SET';
12
12
  type FigmaImportIconNodeType = IconFigmaNode['type'];
13
13
  /**
14
14
  * Node information passed to callback
@@ -8,7 +8,7 @@ import '../../../svg/index.mjs';
8
8
  import 'cheerio';
9
9
  import '@iconify/utils/lib/icon-set/tree';
10
10
 
11
- type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION' | 'COMPONENT';
11
+ type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION' | 'COMPONENT_SET';
12
12
  type FigmaImportIconNodeType = IconFigmaNode['type'];
13
13
  /**
14
14
  * Node information passed to callback
@@ -8,7 +8,7 @@ import '../../../svg/index.js';
8
8
  import 'cheerio';
9
9
  import '@iconify/utils/lib/icon-set/tree';
10
10
 
11
- type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION' | 'COMPONENT';
11
+ type FigmaImportParentNodeType = 'CANVAS' | 'FRAME' | 'GROUP' | 'SECTION' | 'COMPONENT_SET';
12
12
  type FigmaImportIconNodeType = IconFigmaNode['type'];
13
13
  /**
14
14
  * Node information passed to callback
package/lib/index.d.cts CHANGED
@@ -55,6 +55,7 @@ import 'cheerio';
55
55
  import '@iconify/types';
56
56
  import '@iconify/utils/lib/customisations/defaults';
57
57
  import './misc/cheerio.cjs';
58
+ import 'domhandler';
58
59
  import './css/parser/types.cjs';
59
60
  import './svg/analyse/types.cjs';
60
61
  import './icon-set/types.cjs';
package/lib/index.d.mts CHANGED
@@ -55,6 +55,7 @@ import 'cheerio';
55
55
  import '@iconify/types';
56
56
  import '@iconify/utils/lib/customisations/defaults';
57
57
  import './misc/cheerio.mjs';
58
+ import 'domhandler';
58
59
  import './css/parser/types.mjs';
59
60
  import './svg/analyse/types.mjs';
60
61
  import './icon-set/types.mjs';
package/lib/index.d.ts CHANGED
@@ -55,6 +55,7 @@ import 'cheerio';
55
55
  import '@iconify/types';
56
56
  import '@iconify/utils/lib/customisations/defaults';
57
57
  import './misc/cheerio.js';
58
+ import 'domhandler';
58
59
  import './css/parser/types.js';
59
60
  import './svg/analyse/types.js';
60
61
  import './icon-set/types.js';
@@ -1,9 +1,10 @@
1
- import * as cheerio from 'cheerio';
1
+ import { Element } from 'domhandler';
2
+ import { Cheerio } from 'cheerio';
2
3
 
3
4
  /**
4
5
  * Shortcuts for Cheerio elements
5
6
  */
6
- type CheerioElement = cheerio.Element;
7
- type WrappedCheerioElement = cheerio.Cheerio<cheerio.Element>;
7
+ type CheerioElement = Element;
8
+ type WrappedCheerioElement = Cheerio<CheerioElement>;
8
9
 
9
10
  export type { CheerioElement, WrappedCheerioElement };
@@ -1,9 +1,10 @@
1
- import * as cheerio from 'cheerio';
1
+ import { Element } from 'domhandler';
2
+ import { Cheerio } from 'cheerio';
2
3
 
3
4
  /**
4
5
  * Shortcuts for Cheerio elements
5
6
  */
6
- type CheerioElement = cheerio.Element;
7
- type WrappedCheerioElement = cheerio.Cheerio<cheerio.Element>;
7
+ type CheerioElement = Element;
8
+ type WrappedCheerioElement = Cheerio<CheerioElement>;
8
9
 
9
10
  export type { CheerioElement, WrappedCheerioElement };
@@ -1,9 +1,10 @@
1
- import * as cheerio from 'cheerio';
1
+ import { Element } from 'domhandler';
2
+ import { Cheerio } from 'cheerio';
2
3
 
3
4
  /**
4
5
  * Shortcuts for Cheerio elements
5
6
  */
6
- type CheerioElement = cheerio.Element;
7
- type WrappedCheerioElement = cheerio.Cheerio<cheerio.Element>;
7
+ type CheerioElement = Element;
8
+ type WrappedCheerioElement = Cheerio<CheerioElement>;
8
9
 
9
10
  export type { CheerioElement, WrappedCheerioElement };
@@ -1,5 +1,6 @@
1
1
  import { ExtendedTagElement } from './types.cjs';
2
2
  import '../../misc/cheerio.cjs';
3
+ import 'domhandler';
3
4
  import 'cheerio';
4
5
 
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  import { ExtendedTagElement } from './types.mjs';
2
2
  import '../../misc/cheerio.mjs';
3
+ import 'domhandler';
3
4
  import 'cheerio';
4
5
 
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  import { ExtendedTagElement } from './types.js';
2
2
  import '../../misc/cheerio.js';
3
+ import 'domhandler';
3
4
  import 'cheerio';
4
5
 
5
6
  /**
@@ -1,4 +1,5 @@
1
1
  import { CheerioElement } from '../../misc/cheerio.cjs';
2
+ import 'domhandler';
2
3
  import 'cheerio';
3
4
 
4
5
  /**
@@ -1,4 +1,5 @@
1
1
  import { CheerioElement } from '../../misc/cheerio.mjs';
2
+ import 'domhandler';
2
3
  import 'cheerio';
3
4
 
4
5
  /**
@@ -1,4 +1,5 @@
1
1
  import { CheerioElement } from '../../misc/cheerio.js';
2
+ import 'domhandler';
2
3
  import 'cheerio';
3
4
 
4
5
  /**
@@ -4,6 +4,7 @@ import 'cheerio';
4
4
  import '@iconify/types';
5
5
  import '@iconify/utils/lib/customisations/defaults';
6
6
  import '../misc/cheerio.cjs';
7
+ import 'domhandler';
7
8
 
8
9
  /**
9
10
  * Find all IDs, links, which elements use palette, which items aren't used
@@ -4,6 +4,7 @@ import 'cheerio';
4
4
  import '@iconify/types';
5
5
  import '@iconify/utils/lib/customisations/defaults';
6
6
  import '../misc/cheerio.mjs';
7
+ import 'domhandler';
7
8
 
8
9
  /**
9
10
  * Find all IDs, links, which elements use palette, which items aren't used
@@ -4,6 +4,7 @@ import 'cheerio';
4
4
  import '@iconify/types';
5
5
  import '@iconify/utils/lib/customisations/defaults';
6
6
  import '../misc/cheerio.js';
7
+ import 'domhandler';
7
8
 
8
9
  /**
9
10
  * Find all IDs, links, which elements use palette, which items aren't used
package/lib/svg/index.cjs CHANGED
@@ -136,6 +136,7 @@ class SVG {
136
136
  remove('xml:space="preserve"', "", "");
137
137
  content = content.replace(/<g>\s*<\/g>/g, "");
138
138
  this.$svg = cheerio__namespace.load(content.trim(), {
139
+ // @ts-expect-error Legacy attribute, kept because Cheerio types are a mess
139
140
  lowerCaseAttributeNames: false,
140
141
  xmlMode: true
141
142
  });
package/lib/svg/index.mjs CHANGED
@@ -120,6 +120,7 @@ class SVG {
120
120
  remove('xml:space="preserve"', "", "");
121
121
  content = content.replace(/<g>\s*<\/g>/g, "");
122
122
  this.$svg = cheerio.load(content.trim(), {
123
+ // @ts-expect-error Legacy attribute, kept because Cheerio types are a mess
123
124
  lowerCaseAttributeNames: false,
124
125
  xmlMode: true
125
126
  });
@@ -5,6 +5,7 @@ import 'cheerio';
5
5
  import '@iconify/types';
6
6
  import '@iconify/utils/lib/customisations/defaults';
7
7
  import '../misc/cheerio.cjs';
8
+ import 'domhandler';
8
9
 
9
10
  /**
10
11
  * Item in callback
@@ -5,6 +5,7 @@ import 'cheerio';
5
5
  import '@iconify/types';
6
6
  import '@iconify/utils/lib/customisations/defaults';
7
7
  import '../misc/cheerio.mjs';
8
+ import 'domhandler';
8
9
 
9
10
  /**
10
11
  * Item in callback
@@ -5,6 +5,7 @@ import 'cheerio';
5
5
  import '@iconify/types';
6
6
  import '@iconify/utils/lib/customisations/defaults';
7
7
  import '../misc/cheerio.js';
8
+ import 'domhandler';
8
9
 
9
10
  /**
10
11
  * Item in callback
@@ -1,5 +1,6 @@
1
1
  import { CheerioElement, WrappedCheerioElement } from '../misc/cheerio.cjs';
2
2
  import { SVG } from './index.cjs';
3
+ import 'domhandler';
3
4
  import 'cheerio';
4
5
  import '@iconify/types';
5
6
  import '@iconify/utils/lib/customisations/defaults';
@@ -1,5 +1,6 @@
1
1
  import { CheerioElement, WrappedCheerioElement } from '../misc/cheerio.mjs';
2
2
  import { SVG } from './index.mjs';
3
+ import 'domhandler';
3
4
  import 'cheerio';
4
5
  import '@iconify/types';
5
6
  import '@iconify/utils/lib/customisations/defaults';
@@ -1,5 +1,6 @@
1
1
  import { CheerioElement, WrappedCheerioElement } from '../misc/cheerio.js';
2
2
  import { SVG } from './index.js';
3
+ import 'domhandler';
3
4
  import 'cheerio';
4
5
  import '@iconify/types';
5
6
  import '@iconify/utils/lib/customisations/defaults';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "Collection of functions for cleaning up and parsing SVG for Iconify project",
5
5
  "author": "Vjacheslav Trushkin",
6
- "version": "4.0.3",
6
+ "version": "4.0.5",
7
7
  "license": "MIT",
8
8
  "bugs": "https://github.com/iconify/tools/issues",
9
9
  "homepage": "https://github.com/iconify/tools",
@@ -16,30 +16,31 @@
16
16
  "types": "./lib/index.d.ts",
17
17
  "dependencies": {
18
18
  "@iconify/types": "^2.0.0",
19
- "@iconify/utils": "^2.1.22",
20
- "@types/tar": "^6.1.12",
21
- "axios": "^1.6.8",
22
- "cheerio": "1.0.0-rc.12",
19
+ "@iconify/utils": "^2.1.29",
20
+ "@types/tar": "^6.1.13",
21
+ "axios": "^1.7.3",
22
+ "cheerio": "1.0.0",
23
+ "domhandler": "^5.0.3",
23
24
  "extract-zip": "^2.0.1",
24
25
  "local-pkg": "^0.5.0",
25
26
  "pathe": "^1.1.2",
26
- "svgo": "^3.2.0",
27
+ "svgo": "^3.3.2",
27
28
  "tar": "^6.2.1"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/jest": "^29.5.12",
31
- "@types/node": "^20.12.4",
32
+ "@types/node": "^20.14.14",
32
33
  "@typescript-eslint/eslint-plugin": "^6.21.0",
33
34
  "@typescript-eslint/parser": "^6.21.0",
34
35
  "cross-env": "^7.0.3",
35
36
  "eslint": "^8.57.0",
36
37
  "eslint-config-prettier": "^9.1.0",
37
- "eslint-plugin-prettier": "^5.1.3",
38
+ "eslint-plugin-prettier": "^5.2.1",
38
39
  "jest": "^29.7.0",
39
- "prettier": "^3.2.5",
40
- "rimraf": "^5.0.5",
41
- "ts-jest": "^29.1.2",
42
- "typescript": "^5.4.3",
40
+ "prettier": "^3.3.3",
41
+ "rimraf": "^6.0.1",
42
+ "ts-jest": "^29.2.4",
43
+ "typescript": "^5.5.4",
43
44
  "unbuild": "^2.0.0"
44
45
  },
45
46
  "exports": {