@iconify/tools 4.0.0-beta.9 → 4.0.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.
- package/lib/colors/attribs.d.cts +27 -0
- package/lib/colors/attribs.d.mts +27 -0
- package/lib/colors/attribs.d.ts +1 -1
- package/lib/colors/detect.d.cts +16 -0
- package/lib/colors/detect.d.mts +16 -0
- package/lib/colors/parse.d.cts +60 -0
- package/lib/colors/parse.d.mts +60 -0
- package/lib/colors/parse.d.ts +1 -1
- package/lib/colors/validate.d.cts +20 -0
- package/lib/colors/validate.d.mts +20 -0
- package/lib/css/parse.d.cts +6 -0
- package/lib/css/parse.d.mts +6 -0
- package/lib/css/parser/error.d.cts +13 -0
- package/lib/css/parser/error.d.mts +13 -0
- package/lib/css/parser/error.d.ts +1 -1
- package/lib/css/parser/export.d.cts +8 -0
- package/lib/css/parser/export.d.mts +8 -0
- package/lib/css/parser/strings.d.cts +16 -0
- package/lib/css/parser/strings.d.mts +16 -0
- package/lib/css/parser/text.d.cts +20 -0
- package/lib/css/parser/text.d.mts +20 -0
- package/lib/css/parser/tokens.d.cts +9 -0
- package/lib/css/parser/tokens.d.mts +9 -0
- package/lib/css/parser/tree.d.cts +8 -0
- package/lib/css/parser/tree.d.mts +8 -0
- package/lib/css/parser/types.d.cts +52 -0
- package/lib/css/parser/types.d.mts +52 -0
- package/lib/css/parser/types.d.ts +1 -1
- package/lib/download/api/cache.d.cts +20 -0
- package/lib/download/api/cache.d.mts +20 -0
- package/lib/download/api/config.d.cts +18 -0
- package/lib/download/api/config.d.mts +18 -0
- package/lib/download/api/download.d.cts +8 -0
- package/lib/download/api/download.d.mts +8 -0
- package/lib/download/api/index.d.cts +8 -0
- package/lib/download/api/index.d.mts +8 -0
- package/lib/download/api/queue.d.cts +32 -0
- package/lib/download/api/queue.d.mts +32 -0
- package/lib/download/api/queue.d.ts +1 -1
- package/lib/download/api/types.d.cts +17 -0
- package/lib/download/api/types.d.mts +17 -0
- package/lib/download/api/types.d.ts +1 -1
- package/lib/download/git/branch.d.cts +8 -0
- package/lib/download/git/branch.d.mts +8 -0
- package/lib/download/git/hash.d.cts +8 -0
- package/lib/download/git/hash.d.mts +8 -0
- package/lib/download/git/index.d.cts +29 -0
- package/lib/download/git/index.d.mts +29 -0
- package/lib/download/git/index.d.ts +1 -1
- package/lib/download/git/reset.d.cts +6 -0
- package/lib/download/git/reset.d.mts +6 -0
- package/lib/download/github/hash.d.cts +8 -0
- package/lib/download/github/hash.d.mts +8 -0
- package/lib/download/github/index.d.cts +31 -0
- package/lib/download/github/index.d.mts +31 -0
- package/lib/download/github/index.d.ts +1 -1
- package/lib/download/github/types.d.cts +11 -0
- package/lib/download/github/types.d.mts +11 -0
- package/lib/download/github/types.d.ts +1 -1
- package/lib/download/gitlab/hash.d.cts +8 -0
- package/lib/download/gitlab/hash.d.mts +8 -0
- package/lib/download/gitlab/index.d.cts +31 -0
- package/lib/download/gitlab/index.d.mts +31 -0
- package/lib/download/gitlab/index.d.ts +1 -1
- package/lib/download/gitlab/types.d.cts +15 -0
- package/lib/download/gitlab/types.d.mts +15 -0
- package/lib/download/gitlab/types.d.ts +1 -1
- package/lib/download/helpers/untar.d.cts +6 -0
- package/lib/download/helpers/untar.d.mts +6 -0
- package/lib/download/helpers/unzip.d.cts +6 -0
- package/lib/download/helpers/unzip.d.mts +6 -0
- package/lib/download/index.d.cts +48 -0
- package/lib/download/index.d.mts +48 -0
- package/lib/download/index.d.ts +1 -1
- package/lib/download/npm/index.d.cts +30 -0
- package/lib/download/npm/index.d.mts +30 -0
- package/lib/download/npm/index.d.ts +1 -1
- package/lib/download/npm/types.d.cts +9 -0
- package/lib/download/npm/types.d.mts +9 -0
- package/lib/download/npm/types.d.ts +1 -1
- package/lib/download/npm/version.d.cts +16 -0
- package/lib/download/npm/version.d.mts +16 -0
- package/lib/download/npm/version.d.ts +1 -1
- package/lib/download/types/modified.d.cts +6 -0
- package/lib/download/types/modified.d.mts +6 -0
- package/lib/download/types/modified.d.ts +1 -1
- package/lib/download/types/sources.d.cts +12 -0
- package/lib/download/types/sources.d.mts +12 -0
- package/lib/download/types/sources.d.ts +1 -1
- package/lib/export/directory.d.cts +26 -0
- package/lib/export/directory.d.mts +26 -0
- package/lib/export/directory.d.ts +1 -1
- package/lib/export/helpers/custom-files.d.cts +12 -0
- package/lib/export/helpers/custom-files.d.mts +12 -0
- package/lib/export/helpers/custom-files.d.ts +1 -1
- package/lib/export/helpers/prepare.d.cts +19 -0
- package/lib/export/helpers/prepare.d.mts +19 -0
- package/lib/export/helpers/prepare.d.ts +1 -1
- package/lib/export/helpers/types-version.d.cts +6 -0
- package/lib/export/helpers/types-version.d.mts +6 -0
- package/lib/export/icon-package.d.cts +26 -0
- package/lib/export/icon-package.d.mts +26 -0
- package/lib/export/icon-package.d.ts +1 -3
- package/lib/export/json-package.d.cts +25 -0
- package/lib/export/json-package.d.mts +25 -0
- package/lib/export/json-package.d.ts +1 -1
- package/lib/icon-set/index.cjs +22 -0
- package/lib/icon-set/index.d.cts +162 -0
- package/lib/icon-set/index.d.mts +162 -0
- package/lib/icon-set/index.mjs +22 -0
- package/lib/icon-set/match.d.cts +15 -0
- package/lib/icon-set/match.d.mts +15 -0
- package/lib/icon-set/merge.d.cts +14 -0
- package/lib/icon-set/merge.d.mts +14 -0
- package/lib/icon-set/modified.d.cts +16 -0
- package/lib/icon-set/modified.d.mts +16 -0
- package/lib/icon-set/props.d.cts +13 -0
- package/lib/icon-set/props.d.mts +13 -0
- package/lib/icon-set/tags.d.cts +23 -0
- package/lib/icon-set/tags.d.mts +23 -0
- package/lib/icon-set/types.d.cts +75 -0
- package/lib/icon-set/types.d.mts +75 -0
- package/lib/icon-set/types.d.ts +1 -1
- package/lib/import/directory.d.cts +52 -0
- package/lib/import/directory.d.mts +52 -0
- package/lib/import/directory.d.ts +1 -1
- package/lib/import/figma/index.d.cts +20 -0
- package/lib/import/figma/index.d.mts +20 -0
- package/lib/import/figma/nodes.d.cts +18 -0
- package/lib/import/figma/nodes.d.mts +18 -0
- package/lib/import/figma/query.d.cts +42 -0
- package/lib/import/figma/query.d.mts +42 -0
- package/lib/import/figma/query.d.ts +1 -1
- package/lib/import/figma/types/api.d.cts +53 -0
- package/lib/import/figma/types/api.d.mts +53 -0
- package/lib/import/figma/types/api.d.ts +1 -1
- package/lib/import/figma/types/nodes.d.cts +44 -0
- package/lib/import/figma/types/nodes.d.mts +44 -0
- package/lib/import/figma/types/nodes.d.ts +1 -1
- package/lib/import/figma/types/options.d.cts +59 -0
- package/lib/import/figma/types/options.d.mts +59 -0
- package/lib/import/figma/types/options.d.ts +1 -1
- package/lib/import/figma/types/result.d.cts +44 -0
- package/lib/import/figma/types/result.d.mts +44 -0
- package/lib/import/figma/types/result.d.ts +1 -1
- package/lib/index.cjs +7 -5
- package/lib/index.d.cts +78 -0
- package/lib/index.d.mts +78 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.mjs +6 -5
- package/lib/misc/bump-version.d.cts +6 -0
- package/lib/misc/bump-version.d.mts +6 -0
- package/lib/misc/cheerio.d.cts +9 -0
- package/lib/misc/cheerio.d.mts +9 -0
- package/lib/misc/cheerio.d.ts +1 -1
- package/lib/misc/compare-dirs.d.cts +11 -0
- package/lib/misc/compare-dirs.d.mts +11 -0
- package/lib/misc/compare-dirs.d.ts +1 -1
- package/lib/misc/exec.d.cts +12 -0
- package/lib/misc/exec.d.mts +12 -0
- package/lib/misc/exec.d.ts +1 -1
- package/lib/misc/keyword.d.cts +6 -0
- package/lib/misc/keyword.d.mts +6 -0
- package/lib/misc/scan.d.cts +33 -0
- package/lib/misc/scan.d.mts +33 -0
- package/lib/misc/scan.d.ts +1 -1
- package/lib/misc/write-json.d.cts +6 -0
- package/lib/misc/write-json.d.mts +6 -0
- package/lib/optimise/figma.d.cts +11 -0
- package/lib/optimise/figma.d.mts +11 -0
- package/lib/optimise/flags.d.cts +11 -0
- package/lib/optimise/flags.d.mts +11 -0
- package/lib/optimise/global-style.d.cts +11 -0
- package/lib/optimise/global-style.d.mts +11 -0
- package/lib/optimise/mask.d.cts +24 -0
- package/lib/optimise/mask.d.mts +24 -0
- package/lib/optimise/origin.d.cts +11 -0
- package/lib/optimise/origin.d.mts +11 -0
- package/lib/optimise/scale.d.cts +11 -0
- package/lib/optimise/scale.d.mts +11 -0
- package/lib/optimise/svgo.d.cts +37 -0
- package/lib/optimise/svgo.d.mts +37 -0
- package/lib/svg/analyse/error.d.cts +10 -0
- package/lib/svg/analyse/error.d.mts +10 -0
- package/lib/svg/analyse/types.d.cts +92 -0
- package/lib/svg/analyse/types.d.mts +92 -0
- package/lib/svg/analyse/types.d.ts +1 -1
- package/lib/svg/analyse.d.cts +15 -0
- package/lib/svg/analyse.d.mts +15 -0
- package/lib/svg/cleanup/attribs.d.cts +11 -0
- package/lib/svg/cleanup/attribs.d.mts +11 -0
- package/lib/svg/cleanup/bad-tags.d.cts +17 -0
- package/lib/svg/cleanup/bad-tags.d.mts +17 -0
- package/lib/svg/cleanup/bad-tags.d.ts +1 -1
- package/lib/svg/cleanup/inline-style.d.cts +11 -0
- package/lib/svg/cleanup/inline-style.d.mts +11 -0
- package/lib/svg/cleanup/root-style.d.cts +17 -0
- package/lib/svg/cleanup/root-style.d.mts +17 -0
- package/lib/svg/cleanup/root-svg.d.cts +11 -0
- package/lib/svg/cleanup/root-svg.d.mts +11 -0
- package/lib/svg/cleanup/svgo-style.d.cts +11 -0
- package/lib/svg/cleanup/svgo-style.d.mts +11 -0
- package/lib/svg/cleanup.d.cts +16 -0
- package/lib/svg/cleanup.d.mts +16 -0
- package/lib/svg/cleanup.d.ts +1 -1
- package/lib/svg/data/attributes.d.cts +77 -0
- package/lib/svg/data/attributes.d.mts +77 -0
- package/lib/svg/data/tags.d.cts +95 -0
- package/lib/svg/data/tags.d.mts +95 -0
- package/lib/svg/index.cjs +17 -0
- package/lib/svg/index.d.cts +52 -0
- package/lib/svg/index.d.mts +52 -0
- package/lib/svg/index.d.ts +5 -1
- package/lib/svg/index.mjs +18 -1
- package/lib/svg/parse-style.d.cts +58 -0
- package/lib/svg/parse-style.d.mts +58 -0
- package/lib/svg/parse-style.d.ts +1 -1
- package/lib/svg/parse.d.cts +30 -0
- package/lib/svg/parse.d.mts +30 -0
- package/lib/svg/parse.d.ts +1 -1
- package/package.json +14 -17
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CheerioElement, WrappedCheerioElement } from '../misc/cheerio.cjs';
|
|
2
|
+
import { SVG } from './index.cjs';
|
|
3
|
+
import 'cheerio';
|
|
4
|
+
import '@iconify/types';
|
|
5
|
+
import '@iconify/utils/lib/customisations/defaults';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Item in callback
|
|
9
|
+
*/
|
|
10
|
+
interface ParseSVGCallbackItem {
|
|
11
|
+
tagName: string;
|
|
12
|
+
element: CheerioElement;
|
|
13
|
+
$element: WrappedCheerioElement;
|
|
14
|
+
svg: SVG;
|
|
15
|
+
parents: ParseSVGCallbackItem[];
|
|
16
|
+
testChildren: boolean;
|
|
17
|
+
removeNode: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Callback function
|
|
21
|
+
*/
|
|
22
|
+
type ParseSVGCallback = (item: ParseSVGCallbackItem) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Parse SVG
|
|
25
|
+
*
|
|
26
|
+
* This function finds all elements in SVG and calls callback for each element.
|
|
27
|
+
*/
|
|
28
|
+
declare function parseSVG(svg: SVG, callback: ParseSVGCallback): void;
|
|
29
|
+
|
|
30
|
+
export { type ParseSVGCallback, type ParseSVGCallbackItem, parseSVG };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CheerioElement, WrappedCheerioElement } from '../misc/cheerio.mjs';
|
|
2
|
+
import { SVG } from './index.mjs';
|
|
3
|
+
import 'cheerio';
|
|
4
|
+
import '@iconify/types';
|
|
5
|
+
import '@iconify/utils/lib/customisations/defaults';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Item in callback
|
|
9
|
+
*/
|
|
10
|
+
interface ParseSVGCallbackItem {
|
|
11
|
+
tagName: string;
|
|
12
|
+
element: CheerioElement;
|
|
13
|
+
$element: WrappedCheerioElement;
|
|
14
|
+
svg: SVG;
|
|
15
|
+
parents: ParseSVGCallbackItem[];
|
|
16
|
+
testChildren: boolean;
|
|
17
|
+
removeNode: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Callback function
|
|
21
|
+
*/
|
|
22
|
+
type ParseSVGCallback = (item: ParseSVGCallbackItem) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Parse SVG
|
|
25
|
+
*
|
|
26
|
+
* This function finds all elements in SVG and calls callback for each element.
|
|
27
|
+
*/
|
|
28
|
+
declare function parseSVG(svg: SVG, callback: ParseSVGCallback): void;
|
|
29
|
+
|
|
30
|
+
export { type ParseSVGCallback, type ParseSVGCallbackItem, parseSVG };
|
package/lib/svg/parse.d.ts
CHANGED
|
@@ -27,4 +27,4 @@ type ParseSVGCallback = (item: ParseSVGCallbackItem) => void;
|
|
|
27
27
|
*/
|
|
28
28
|
declare function parseSVG(svg: SVG, callback: ParseSVGCallback): void;
|
|
29
29
|
|
|
30
|
-
export { ParseSVGCallback, ParseSVGCallbackItem, parseSVG };
|
|
30
|
+
export { type ParseSVGCallback, type ParseSVGCallbackItem, parseSVG };
|
package/package.json
CHANGED
|
@@ -3,10 +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.0
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"tag": "next"
|
|
9
|
-
},
|
|
6
|
+
"version": "4.0.0",
|
|
10
7
|
"license": "MIT",
|
|
11
8
|
"bugs": "https://github.com/iconify/tools/issues",
|
|
12
9
|
"homepage": "https://github.com/iconify/tools",
|
|
@@ -19,31 +16,31 @@
|
|
|
19
16
|
"types": "./lib/index.d.ts",
|
|
20
17
|
"dependencies": {
|
|
21
18
|
"@iconify/types": "^2.0.0",
|
|
22
|
-
"@iconify/utils": "^2.1.
|
|
19
|
+
"@iconify/utils": "^2.1.14",
|
|
23
20
|
"@types/tar": "^6.1.10",
|
|
24
|
-
"axios": "^1.6.
|
|
21
|
+
"axios": "^1.6.3",
|
|
25
22
|
"cheerio": "1.0.0-rc.12",
|
|
26
23
|
"extract-zip": "^2.0.1",
|
|
27
|
-
"local-pkg": "^0.
|
|
24
|
+
"local-pkg": "^0.5.0",
|
|
28
25
|
"pathe": "^1.1.1",
|
|
29
26
|
"svgo": "^3.1.0",
|
|
30
27
|
"tar": "^6.2.0"
|
|
31
28
|
},
|
|
32
29
|
"devDependencies": {
|
|
33
|
-
"@types/jest": "^29.5.
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
36
|
-
"@typescript-eslint/parser": "^
|
|
30
|
+
"@types/jest": "^29.5.11",
|
|
31
|
+
"@types/node": "^20.10.5",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
33
|
+
"@typescript-eslint/parser": "^6.16.0",
|
|
37
34
|
"cross-env": "^7.0.3",
|
|
38
|
-
"eslint": "^8.
|
|
39
|
-
"eslint-config-prettier": "^
|
|
40
|
-
"eslint-plugin-prettier": "^
|
|
35
|
+
"eslint": "^8.56.0",
|
|
36
|
+
"eslint-config-prettier": "^9.1.0",
|
|
37
|
+
"eslint-plugin-prettier": "^5.1.2",
|
|
41
38
|
"jest": "^29.7.0",
|
|
42
|
-
"prettier": "^
|
|
39
|
+
"prettier": "^3.1.1",
|
|
43
40
|
"rimraf": "^5.0.5",
|
|
44
41
|
"ts-jest": "^29.1.1",
|
|
45
|
-
"typescript": "^5.3.
|
|
46
|
-
"unbuild": "^
|
|
42
|
+
"typescript": "^5.3.3",
|
|
43
|
+
"unbuild": "^2.0.0"
|
|
47
44
|
},
|
|
48
45
|
"exports": {
|
|
49
46
|
"./*": "./*",
|