@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.
- package/lib/colors/attribs.cjs +0 -2
- package/lib/colors/attribs.d.ts +4 -4
- package/lib/colors/detect.cjs +0 -2
- package/lib/colors/parse.cjs +0 -2
- package/lib/colors/parse.d.ts +4 -4
- package/lib/colors/validate.cjs +0 -2
- package/lib/css/parse.cjs +0 -2
- package/lib/css/parser/error.cjs +0 -2
- package/lib/css/parser/export.cjs +0 -2
- package/lib/css/parser/strings.cjs +0 -2
- package/lib/css/parser/text.cjs +0 -2
- package/lib/css/parser/tokens.cjs +0 -2
- package/lib/css/parser/tree.cjs +0 -2
- package/lib/css/parser/types.d.ts +4 -4
- package/lib/download/api/cache.cjs +0 -2
- package/lib/download/api/download.cjs +1 -7
- package/lib/download/api/index.cjs +1 -7
- package/lib/download/git/branch.cjs +0 -2
- package/lib/download/git/hash.cjs +0 -2
- package/lib/download/git/index.cjs +0 -2
- package/lib/download/git/reset.cjs +0 -2
- package/lib/download/github/hash.cjs +0 -2
- package/lib/download/github/index.cjs +0 -2
- package/lib/download/gitlab/hash.cjs +0 -2
- package/lib/download/gitlab/index.cjs +0 -2
- package/lib/download/gitlab/types.cjs +0 -2
- package/lib/download/helpers/untar.cjs +0 -2
- package/lib/download/helpers/unzip.cjs +1 -7
- package/lib/download/index.cjs +0 -2
- package/lib/download/index.d.ts +4 -4
- package/lib/download/npm/index.cjs +0 -2
- package/lib/download/npm/version.cjs +0 -2
- package/lib/download/types/modified.d.ts +1 -1
- package/lib/download/types/sources.d.ts +1 -1
- package/lib/export/directory.cjs +0 -2
- package/lib/export/helpers/custom-files.cjs +0 -2
- package/lib/export/helpers/prepare.cjs +0 -2
- package/lib/export/helpers/types-version.cjs +0 -2
- package/lib/export/icon-package.cjs +0 -2
- package/lib/export/json-package.cjs +0 -2
- package/lib/icon-set/index.cjs +0 -2
- package/lib/icon-set/match.cjs +0 -2
- package/lib/icon-set/merge.cjs +0 -2
- package/lib/icon-set/modified.cjs +0 -2
- package/lib/icon-set/props.cjs +0 -2
- package/lib/icon-set/tags.cjs +0 -2
- package/lib/icon-set/types.d.ts +7 -7
- package/lib/import/directory.cjs +0 -2
- package/lib/import/directory.d.ts +2 -2
- package/lib/import/figma/index.cjs +0 -2
- package/lib/import/figma/nodes.cjs +0 -2
- package/lib/import/figma/query.cjs +0 -2
- package/lib/import/figma/types/api.d.ts +1 -1
- package/lib/import/figma/types/nodes.d.ts +5 -5
- package/lib/import/figma/types/options.d.ts +1 -1
- package/lib/index.cjs +0 -2
- package/lib/misc/bump-version.cjs +0 -2
- package/lib/misc/cheerio.d.ts +2 -2
- package/lib/misc/compare-dirs.cjs +0 -2
- package/lib/misc/exec.cjs +0 -2
- package/lib/misc/keyword.cjs +0 -2
- package/lib/misc/scan.cjs +0 -2
- package/lib/misc/scan.d.ts +5 -5
- package/lib/misc/write-json.cjs +0 -2
- package/lib/optimise/flags.cjs +0 -2
- package/lib/optimise/global-style.cjs +0 -2
- package/lib/optimise/scale.cjs +0 -2
- package/lib/optimise/svgo.cjs +1 -3
- package/lib/optimise/svgo.d.ts +4 -4
- package/lib/optimise/svgo.mjs +1 -1
- package/lib/svg/analyse/error.cjs +0 -2
- package/lib/svg/analyse/types.d.ts +1 -1
- package/lib/svg/analyse.cjs +0 -2
- package/lib/svg/cleanup/attribs.cjs +0 -2
- package/lib/svg/cleanup/bad-tags.cjs +0 -2
- package/lib/svg/cleanup/inline-style.cjs +0 -2
- package/lib/svg/cleanup/root-style.cjs +0 -2
- package/lib/svg/cleanup/root-svg.cjs +0 -2
- package/lib/svg/cleanup/svgo-style.cjs +0 -2
- package/lib/svg/cleanup.cjs +0 -2
- package/lib/svg/data/attributes.cjs +0 -2
- package/lib/svg/data/tags.cjs +0 -2
- package/lib/svg/index.cjs +1 -7
- package/lib/svg/parse-style.cjs +0 -2
- package/lib/svg/parse-style.d.ts +3 -3
- package/lib/svg/parse.cjs +0 -2
- package/lib/svg/parse.d.ts +1 -1
- package/license.txt +0 -0
- 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
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
package/lib/misc/cheerio.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shortcuts for Cheerio elements
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type CheerioElement = cheerio.TagElement;
|
|
5
|
+
type WrappedCheerioElement = cheerio.Cheerio;
|
|
6
6
|
|
|
7
7
|
export { CheerioElement, WrappedCheerioElement };
|
package/lib/misc/exec.cjs
CHANGED
package/lib/misc/keyword.cjs
CHANGED
package/lib/misc/scan.cjs
CHANGED
package/lib/misc/scan.d.ts
CHANGED
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
*/
|
package/lib/misc/write-json.cjs
CHANGED
package/lib/optimise/flags.cjs
CHANGED
package/lib/optimise/scale.cjs
CHANGED
package/lib/optimise/svgo.cjs
CHANGED
|
@@ -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: "
|
|
49
|
+
name: "cleanupIds",
|
|
52
50
|
params: {
|
|
53
51
|
prefix: typeof options.cleanupIDs === "string" ? options.cleanupIDs : "svgID"
|
|
54
52
|
}
|
package/lib/optimise/svgo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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):
|
|
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:
|
|
24
|
+
plugins: PluginConfig[];
|
|
25
25
|
}
|
|
26
26
|
interface SVGOptionsWithoutPlugin extends SVGOCommonOptions, CleanupIDsOption {
|
|
27
27
|
plugins?: undefined;
|
|
28
28
|
keepShapes?: boolean;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
type SVGOOptions = SVGOOptionsWithPlugin | SVGOptionsWithoutPlugin;
|
|
31
31
|
/**
|
|
32
32
|
* Run SVGO on icon
|
|
33
33
|
*/
|
package/lib/optimise/svgo.mjs
CHANGED
package/lib/svg/analyse.cjs
CHANGED
package/lib/svg/cleanup.cjs
CHANGED
|
@@ -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');
|
package/lib/svg/data/tags.cjs
CHANGED
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 =
|
|
87
|
+
this.$svg = cheerio.load(content.trim(), {
|
|
94
88
|
lowerCaseAttributeNames: false,
|
|
95
89
|
xmlMode: true
|
|
96
90
|
});
|
package/lib/svg/parse-style.cjs
CHANGED
package/lib/svg/parse-style.d.ts
CHANGED
|
@@ -24,15 +24,15 @@ interface ParseSVGStyleCallbackItemGlobal extends ParseSVGStyleCallbackItemCommo
|
|
|
24
24
|
prevTokens: (CSSToken | null)[];
|
|
25
25
|
nextTokens: CSSToken[];
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
type ParseSVGStyleCallbackItem = ParseSVGStyleCallbackItemInline | ParseSVGStyleCallbackItemGlobal;
|
|
28
28
|
/**
|
|
29
29
|
* Result: undefined to remove item, string to change/keep item
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
type ParseSVGStyleCallbackResult = string | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Callback function
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
type ParseSVGStyleCallback = (item: ParseSVGStyleCallbackItem) => ParseSVGStyleCallbackResult | Promise<ParseSVGStyleCallbackResult>;
|
|
36
36
|
/**
|
|
37
37
|
* Parse styles in SVG
|
|
38
38
|
*
|
package/lib/svg/parse.cjs
CHANGED
package/lib/svg/parse.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface ParseSVGCallbackItem {
|
|
|
18
18
|
/**
|
|
19
19
|
* Callback function
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
type ParseSVGCallback = (item: ParseSVGCallbackItem) => void | Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* Parse SVG
|
|
24
24
|
*
|
package/license.txt
CHANGED
|
File without changes
|