@iconify/tools 2.0.13 → 2.0.16
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 +30 -0
- package/lib/colors/attribs.d.ts +13 -10
- package/lib/colors/attribs.mjs +7 -13
- package/lib/colors/parse.cjs +269 -0
- package/lib/colors/parse.d.ts +15 -11
- package/lib/colors/parse.mjs +27 -31
- package/lib/colors/validate.cjs +52 -0
- package/lib/colors/validate.d.ts +11 -4
- package/lib/colors/validate.mjs +19 -6
- package/lib/css/parse.cjs +26 -0
- package/lib/css/parse.d.ts +3 -1
- package/lib/css/parse.mjs +8 -6
- package/lib/css/parser/error.cjs +25 -0
- package/lib/css/parser/error.d.ts +4 -2
- package/lib/css/parser/error.mjs +2 -4
- package/lib/css/parser/export.cjs +48 -0
- package/lib/css/parser/export.d.ts +5 -2
- package/lib/css/parser/export.mjs +4 -6
- package/lib/css/parser/strings.cjs +77 -0
- package/lib/css/parser/strings.d.ts +6 -3
- package/lib/css/parser/strings.mjs +4 -6
- package/lib/css/parser/text.cjs +135 -0
- package/lib/css/parser/text.d.ts +8 -5
- package/lib/css/parser/text.mjs +3 -8
- package/lib/css/parser/tokens.cjs +184 -0
- package/lib/css/parser/tokens.d.ts +6 -3
- package/lib/css/parser/tokens.mjs +7 -13
- package/lib/css/parser/tree.cjs +42 -0
- package/lib/css/parser/tree.d.ts +5 -2
- package/lib/css/parser/tree.mjs +2 -4
- package/lib/css/parser/types.cjs +2 -0
- package/lib/css/parser/types.d.ts +13 -11
- package/lib/css/parser/types.mjs +1 -0
- package/lib/download/api/cache.cjs +86 -0
- package/lib/download/api/cache.d.ts +8 -5
- package/lib/download/api/cache.mjs +14 -19
- package/lib/download/api/download.cjs +28 -0
- package/lib/download/api/download.d.ts +5 -2
- package/lib/download/api/download.mjs +8 -9
- package/lib/download/api/index.cjs +51 -0
- package/lib/download/api/index.d.ts +5 -2
- package/lib/download/api/index.mjs +8 -6
- package/lib/download/api/types.cjs +2 -0
- package/lib/download/api/types.d.ts +4 -2
- package/lib/download/api/types.mjs +1 -0
- package/lib/download/git/branch.cjs +22 -0
- package/lib/download/git/branch.d.ts +5 -2
- package/lib/download/git/branch.mjs +5 -5
- package/lib/download/git/hash.cjs +15 -0
- package/lib/download/git/hash.d.ts +5 -2
- package/lib/download/git/hash.mjs +5 -5
- package/lib/download/git/index.cjs +76 -0
- package/lib/download/git/index.d.ts +10 -8
- package/lib/download/git/index.mjs +41 -26
- package/lib/download/git/reset.cjs +41 -0
- package/lib/download/git/reset.d.ts +3 -1
- package/lib/download/git/reset.mjs +29 -5
- package/lib/download/github/hash.cjs +32 -0
- package/lib/download/github/hash.d.ts +5 -2
- package/lib/download/github/hash.mjs +10 -7
- package/lib/download/github/index.cjs +98 -0
- package/lib/download/github/index.d.ts +11 -9
- package/lib/download/github/index.mjs +23 -17
- package/lib/download/github/types.cjs +2 -0
- package/lib/download/github/types.d.ts +3 -1
- package/lib/download/github/types.mjs +1 -0
- package/lib/download/gitlab/hash.cjs +32 -0
- package/lib/download/gitlab/hash.d.ts +5 -2
- package/lib/download/gitlab/hash.mjs +10 -6
- package/lib/download/gitlab/index.cjs +98 -0
- package/lib/download/gitlab/index.d.ts +11 -9
- package/lib/download/gitlab/index.mjs +24 -18
- package/lib/download/gitlab/types.cjs +7 -0
- package/lib/download/gitlab/types.d.ts +4 -2
- package/lib/download/gitlab/types.mjs +3 -5
- package/lib/download/helpers/untar.cjs +14 -0
- package/lib/download/helpers/untar.d.ts +3 -1
- package/lib/download/helpers/untar.mjs +4 -5
- package/lib/download/helpers/unzip.cjs +19 -0
- package/lib/download/helpers/unzip.d.ts +3 -1
- package/lib/download/helpers/unzip.mjs +6 -7
- package/lib/download/index.cjs +64 -0
- package/lib/download/index.d.ts +18 -13
- package/lib/download/index.mjs +46 -19
- package/lib/download/npm/index.cjs +82 -0
- package/lib/download/npm/index.d.ts +10 -8
- package/lib/download/npm/index.mjs +16 -13
- package/lib/download/npm/types.cjs +2 -0
- package/lib/download/npm/types.d.ts +3 -1
- package/lib/download/npm/types.mjs +1 -0
- package/lib/download/npm/version.cjs +23 -0
- package/lib/download/npm/version.d.ts +7 -4
- package/lib/download/npm/version.mjs +8 -10
- package/lib/download/types/modified.cjs +2 -0
- package/lib/download/types/modified.d.ts +3 -1
- package/lib/download/types/modified.mjs +1 -0
- package/lib/download/types/sources.cjs +2 -0
- package/lib/download/types/sources.d.ts +4 -2
- package/lib/download/types/sources.mjs +1 -0
- package/lib/export/directory.cjs +45 -0
- package/lib/export/directory.d.ts +11 -4
- package/lib/export/directory.mjs +8 -8
- package/lib/export/helpers/custom-files.cjs +28 -0
- package/lib/export/helpers/custom-files.d.ts +4 -2
- package/lib/export/helpers/custom-files.mjs +8 -9
- package/lib/export/helpers/prepare.cjs +36 -0
- package/lib/export/helpers/prepare.d.ts +5 -3
- package/lib/export/helpers/prepare.mjs +7 -9
- package/lib/export/helpers/types-version.cjs +22 -0
- package/lib/export/helpers/types-version.d.ts +3 -1
- package/lib/export/helpers/types-version.mjs +15 -37
- package/lib/export/icon-package.cjs +59 -0
- package/lib/export/icon-package.d.ts +12 -5
- package/lib/export/icon-package.mjs +15 -16
- package/lib/export/json-package.cjs +133 -0
- package/lib/export/json-package.d.ts +12 -5
- package/lib/export/json-package.mjs +20 -21
- package/lib/icon-set/index.cjs +588 -0
- package/lib/icon-set/index.d.ts +9 -6
- package/lib/icon-set/index.mjs +40 -54
- package/lib/icon-set/match.cjs +58 -0
- package/lib/icon-set/match.d.ts +10 -3
- package/lib/icon-set/match.mjs +5 -6
- package/lib/icon-set/merge.cjs +83 -0
- package/lib/icon-set/merge.d.ts +9 -2
- package/lib/icon-set/merge.mjs +15 -10
- package/lib/icon-set/props.cjs +28 -0
- package/lib/icon-set/props.d.ts +8 -4
- package/lib/icon-set/props.mjs +7 -10
- package/lib/icon-set/types.cjs +2 -0
- package/lib/icon-set/types.d.ts +19 -17
- package/lib/icon-set/types.mjs +1 -0
- package/lib/import/directory.cjs +76 -0
- package/lib/import/directory.d.ts +11 -5
- package/lib/import/directory.mjs +36 -11
- package/lib/import/figma/index.cjs +105 -0
- package/lib/import/figma/index.d.ts +15 -5
- package/lib/import/figma/index.mjs +40 -13
- package/lib/import/figma/nodes.cjs +86 -0
- package/lib/import/figma/nodes.d.ts +13 -4
- package/lib/import/figma/nodes.mjs +3 -11
- package/lib/import/figma/query.cjs +218 -0
- package/lib/import/figma/query.d.ts +18 -9
- package/lib/import/figma/query.mjs +9 -12
- package/lib/import/figma/types/api.cjs +2 -0
- package/lib/import/figma/types/api.d.ts +8 -7
- package/lib/import/figma/types/api.mjs +1 -0
- package/lib/import/figma/types/nodes.cjs +2 -0
- package/lib/import/figma/types/nodes.d.ts +16 -9
- package/lib/import/figma/types/nodes.mjs +1 -0
- package/lib/import/figma/types/options.cjs +2 -0
- package/lib/import/figma/types/options.d.ts +17 -10
- package/lib/import/figma/types/options.mjs +1 -0
- package/lib/import/figma/types/result.cjs +2 -0
- package/lib/import/figma/types/result.d.ts +12 -5
- package/lib/import/figma/types/result.mjs +1 -0
- package/lib/index.cjs +138 -0
- package/lib/index.d.ts +66 -44
- package/lib/index.mjs +83 -94
- package/lib/misc/bump-version.cjs +17 -0
- package/lib/misc/bump-version.d.ts +3 -1
- package/lib/misc/bump-version.mjs +2 -4
- package/lib/misc/compare-dirs.cjs +75 -0
- package/lib/misc/compare-dirs.d.ts +4 -2
- package/lib/misc/compare-dirs.mjs +12 -12
- package/lib/misc/exec.cjs +25 -0
- package/lib/misc/exec.d.ts +6 -4
- package/lib/misc/exec.mjs +4 -5
- package/lib/misc/keyword.cjs +19 -0
- package/lib/misc/keyword.d.ts +3 -1
- package/lib/misc/keyword.mjs +2 -4
- package/lib/misc/scan.cjs +51 -0
- package/lib/misc/scan.d.ts +7 -6
- package/lib/misc/scan.mjs +6 -7
- package/lib/misc/write-json.cjs +11 -0
- package/lib/misc/write-json.d.ts +3 -1
- package/lib/misc/write-json.mjs +5 -6
- package/lib/optimise/flags.cjs +252 -0
- package/lib/optimise/flags.d.ts +7 -2
- package/lib/optimise/flags.mjs +18 -19
- package/lib/optimise/global-style.cjs +154 -0
- package/lib/optimise/global-style.d.ts +7 -2
- package/lib/optimise/global-style.mjs +68 -47
- package/lib/optimise/scale.cjs +26 -0
- package/lib/optimise/scale.d.ts +7 -2
- package/lib/optimise/scale.mjs +5 -5
- package/lib/optimise/svgo.cjs +83 -0
- package/lib/optimise/svgo.d.ts +10 -6
- package/lib/optimise/svgo.mjs +6 -9
- package/lib/svg/analyse/error.cjs +18 -0
- package/lib/svg/analyse/error.d.ts +5 -2
- package/lib/svg/analyse/error.mjs +2 -4
- package/lib/svg/analyse/types.cjs +2 -0
- package/lib/svg/analyse/types.d.ts +11 -11
- package/lib/svg/analyse/types.mjs +1 -0
- package/lib/svg/analyse.cjs +291 -0
- package/lib/svg/analyse.d.ts +8 -3
- package/lib/svg/analyse.mjs +15 -30
- package/lib/svg/cleanup/attribs.cjs +41 -0
- package/lib/svg/cleanup/attribs.d.ts +7 -2
- package/lib/svg/cleanup/attribs.mjs +6 -12
- package/lib/svg/cleanup/bad-tags.cjs +51 -0
- package/lib/svg/cleanup/bad-tags.d.ts +7 -2
- package/lib/svg/cleanup/bad-tags.mjs +10 -25
- package/lib/svg/cleanup/inline-style.cjs +64 -0
- package/lib/svg/cleanup/inline-style.d.ts +7 -2
- package/lib/svg/cleanup/inline-style.mjs +14 -19
- package/lib/svg/cleanup/root-svg.cjs +81 -0
- package/lib/svg/cleanup/root-svg.d.ts +7 -2
- package/lib/svg/cleanup/root-svg.mjs +7 -18
- package/lib/svg/cleanup/svgo-style.cjs +38 -0
- package/lib/svg/cleanup/svgo-style.d.ts +7 -2
- package/lib/svg/cleanup/svgo-style.mjs +16 -11
- package/lib/svg/cleanup.cjs +32 -0
- package/lib/svg/cleanup.d.ts +7 -2
- package/lib/svg/cleanup.mjs +21 -9
- package/lib/svg/data/attributes.cjs +355 -0
- package/lib/svg/data/attributes.d.ts +27 -25
- package/lib/svg/data/attributes.mjs +90 -115
- package/lib/svg/data/tags.cjs +137 -0
- package/lib/svg/data/tags.d.ts +25 -23
- package/lib/svg/data/tags.mjs +25 -49
- package/lib/svg/index.cjs +130 -0
- package/lib/svg/index.d.ts +16 -5
- package/lib/svg/index.mjs +48 -11
- package/lib/svg/parse-style.cjs +134 -0
- package/lib/svg/parse-style.d.ts +12 -8
- package/lib/svg/parse-style.mjs +11 -9
- package/lib/svg/parse.cjs +42 -0
- package/lib/svg/parse.d.ts +11 -7
- package/lib/svg/parse.mjs +2 -4
- package/package.json +99 -94
- package/lib/colors/attribs.js +0 -26
- package/lib/colors/parse.js +0 -341
- package/lib/colors/validate.js +0 -48
- package/lib/css/parse.js +0 -23
- package/lib/css/parser/error.js +0 -27
- package/lib/css/parser/export.js +0 -69
- package/lib/css/parser/strings.js +0 -93
- package/lib/css/parser/text.js +0 -171
- package/lib/css/parser/tokens.js +0 -200
- package/lib/css/parser/tree.js +0 -44
- package/lib/css/parser/types.js +0 -2
- package/lib/download/api/cache.js +0 -108
- package/lib/download/api/download.js +0 -27
- package/lib/download/api/index.js +0 -52
- package/lib/download/api/types.js +0 -2
- package/lib/download/git/branch.js +0 -22
- package/lib/download/git/hash.js +0 -14
- package/lib/download/git/index.js +0 -75
- package/lib/download/git/reset.js +0 -16
- package/lib/download/github/hash.js +0 -28
- package/lib/download/github/index.js +0 -116
- package/lib/download/github/types.js +0 -2
- package/lib/download/gitlab/hash.js +0 -27
- package/lib/download/gitlab/index.js +0 -115
- package/lib/download/gitlab/types.js +0 -7
- package/lib/download/helpers/untar.js +0 -14
- package/lib/download/helpers/unzip.js +0 -18
- package/lib/download/index.js +0 -27
- package/lib/download/npm/index.js +0 -91
- package/lib/download/npm/types.js +0 -2
- package/lib/download/npm/version.js +0 -27
- package/lib/download/types/modified.js +0 -2
- package/lib/download/types/sources.js +0 -2
- package/lib/export/directory.js +0 -52
- package/lib/export/helpers/custom-files.js +0 -32
- package/lib/export/helpers/prepare.js +0 -49
- package/lib/export/helpers/types-version.js +0 -12
- package/lib/export/icon-package.js +0 -77
- package/lib/export/json-package.js +0 -156
- package/lib/icon-set/index.js +0 -749
- package/lib/icon-set/match.js +0 -66
- package/lib/icon-set/merge.js +0 -90
- package/lib/icon-set/props.js +0 -34
- package/lib/icon-set/types.js +0 -2
- package/lib/import/directory.js +0 -59
- package/lib/import/figma/index.js +0 -90
- package/lib/import/figma/nodes.js +0 -106
- package/lib/import/figma/query.js +0 -244
- package/lib/import/figma/types/api.js +0 -12
- package/lib/import/figma/types/nodes.js +0 -2
- package/lib/import/figma/types/options.js +0 -2
- package/lib/import/figma/types/result.js +0 -2
- package/lib/index.js +0 -103
- package/lib/misc/bump-version.js +0 -19
- package/lib/misc/compare-dirs.js +0 -84
- package/lib/misc/exec.js +0 -26
- package/lib/misc/keyword.js +0 -31
- package/lib/misc/scan.js +0 -55
- package/lib/misc/write-json.js +0 -11
- package/lib/optimise/flags.js +0 -312
- package/lib/optimise/global-style.js +0 -158
- package/lib/optimise/scale.js +0 -42
- package/lib/optimise/svgo.js +0 -99
- package/lib/svg/analyse/error.js +0 -22
- package/lib/svg/analyse/types.js +0 -2
- package/lib/svg/analyse.js +0 -352
- package/lib/svg/cleanup/attribs.js +0 -51
- package/lib/svg/cleanup/bad-tags.js +0 -65
- package/lib/svg/cleanup/inline-style.js +0 -77
- package/lib/svg/cleanup/root-svg.js +0 -107
- package/lib/svg/cleanup/svgo-style.js +0 -35
- package/lib/svg/cleanup.js +0 -24
- package/lib/svg/data/attributes.js +0 -403
- package/lib/svg/data/tags.js +0 -188
- package/lib/svg/index.js +0 -125
- package/lib/svg/parse-style.js +0 -151
- package/lib/svg/parse.js +0 -49
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const svg_data_tags = require('./tags.cjs');
|
|
6
|
+
|
|
7
|
+
const badAttributes = /* @__PURE__ */ new Set([
|
|
8
|
+
"cursor",
|
|
9
|
+
"pointer-events",
|
|
10
|
+
"shape-rendering",
|
|
11
|
+
"tabindex",
|
|
12
|
+
"requiredExtensions",
|
|
13
|
+
"requiredFeatures",
|
|
14
|
+
"systemLanguage",
|
|
15
|
+
"role",
|
|
16
|
+
"title"
|
|
17
|
+
]);
|
|
18
|
+
const junkSVGAttributes = /* @__PURE__ */ new Set([
|
|
19
|
+
"xmlns:xlink",
|
|
20
|
+
"baseProfile",
|
|
21
|
+
"contentScriptType",
|
|
22
|
+
"contentStyleType",
|
|
23
|
+
"version",
|
|
24
|
+
"x",
|
|
25
|
+
"y",
|
|
26
|
+
"zoomAndPan"
|
|
27
|
+
]);
|
|
28
|
+
const badSoftwareAttributes = /* @__PURE__ */ new Set([
|
|
29
|
+
"color-interpolation-filters",
|
|
30
|
+
"isolation",
|
|
31
|
+
"enable-background",
|
|
32
|
+
"overflow",
|
|
33
|
+
"marker",
|
|
34
|
+
"white-space",
|
|
35
|
+
"direction"
|
|
36
|
+
]);
|
|
37
|
+
const badAttributePrefixes = /* @__PURE__ */ new Set([
|
|
38
|
+
"image",
|
|
39
|
+
"mix",
|
|
40
|
+
"block",
|
|
41
|
+
"data",
|
|
42
|
+
"aria",
|
|
43
|
+
"text",
|
|
44
|
+
"font",
|
|
45
|
+
"letter",
|
|
46
|
+
"baseline",
|
|
47
|
+
"word",
|
|
48
|
+
"line",
|
|
49
|
+
"writing",
|
|
50
|
+
""
|
|
51
|
+
]);
|
|
52
|
+
const commonAttributes = /* @__PURE__ */ new Set(["id"]);
|
|
53
|
+
const stylingAttributes = /* @__PURE__ */ new Set(["class", "style"]);
|
|
54
|
+
const insideClipPathAttributes = /* @__PURE__ */ new Set(["clip-rule"]);
|
|
55
|
+
const fillPresentationalAttributes = /* @__PURE__ */ new Set([
|
|
56
|
+
"fill-opacity",
|
|
57
|
+
"fill-rule"
|
|
58
|
+
]);
|
|
59
|
+
const strokePresentationalAttributes = /* @__PURE__ */ new Set([
|
|
60
|
+
"stroke-dasharray",
|
|
61
|
+
"stroke-dashoffset",
|
|
62
|
+
"stroke-linecap",
|
|
63
|
+
"stroke-linejoin",
|
|
64
|
+
"stroke-miterlimit",
|
|
65
|
+
"stroke-opacity",
|
|
66
|
+
"stroke-width"
|
|
67
|
+
]);
|
|
68
|
+
const urlPresentationalAttributes = /* @__PURE__ */ new Set([
|
|
69
|
+
"clip-path",
|
|
70
|
+
"filter",
|
|
71
|
+
"mask"
|
|
72
|
+
]);
|
|
73
|
+
const visibilityPresentationalAttributes = /* @__PURE__ */ new Set([
|
|
74
|
+
"display",
|
|
75
|
+
"opacity",
|
|
76
|
+
"visibility"
|
|
77
|
+
]);
|
|
78
|
+
const commonColorPresentationalAttributes = /* @__PURE__ */ new Set([
|
|
79
|
+
"color",
|
|
80
|
+
"fill",
|
|
81
|
+
"stroke"
|
|
82
|
+
]);
|
|
83
|
+
const otherPresentationalAttributes = /* @__PURE__ */ new Set([
|
|
84
|
+
"color-interpolation",
|
|
85
|
+
"color-rendering",
|
|
86
|
+
"transform",
|
|
87
|
+
"vector-effect"
|
|
88
|
+
]);
|
|
89
|
+
const presentationalAttributes = /* @__PURE__ */ new Set([
|
|
90
|
+
...fillPresentationalAttributes,
|
|
91
|
+
...strokePresentationalAttributes,
|
|
92
|
+
...urlPresentationalAttributes,
|
|
93
|
+
...visibilityPresentationalAttributes,
|
|
94
|
+
...commonColorPresentationalAttributes,
|
|
95
|
+
...otherPresentationalAttributes
|
|
96
|
+
]);
|
|
97
|
+
const markerAttributes = /* @__PURE__ */ new Set([
|
|
98
|
+
"marker-start",
|
|
99
|
+
"marker-mid",
|
|
100
|
+
"marker-end"
|
|
101
|
+
]);
|
|
102
|
+
const otherShapeAttributes = /* @__PURE__ */ new Set(["pathLength"]);
|
|
103
|
+
const animationTimingAttributes = /* @__PURE__ */ new Set([
|
|
104
|
+
"begin",
|
|
105
|
+
"dur",
|
|
106
|
+
"end",
|
|
107
|
+
"min",
|
|
108
|
+
"max",
|
|
109
|
+
"restart",
|
|
110
|
+
"repeatCount",
|
|
111
|
+
"repeatDur",
|
|
112
|
+
"fill"
|
|
113
|
+
]);
|
|
114
|
+
const animationValueAttributes = /* @__PURE__ */ new Set([
|
|
115
|
+
"calcMode",
|
|
116
|
+
"values",
|
|
117
|
+
"keyTimes",
|
|
118
|
+
"keySplines",
|
|
119
|
+
"from",
|
|
120
|
+
"to",
|
|
121
|
+
"by"
|
|
122
|
+
]);
|
|
123
|
+
const otherAnimationAttributes = /* @__PURE__ */ new Set([
|
|
124
|
+
"attributeName",
|
|
125
|
+
"additive",
|
|
126
|
+
"accumulate"
|
|
127
|
+
]);
|
|
128
|
+
const commonGradientAttributes = /* @__PURE__ */ new Set([
|
|
129
|
+
"gradientUnits",
|
|
130
|
+
"gradientTransform",
|
|
131
|
+
"href",
|
|
132
|
+
"spreadMethod"
|
|
133
|
+
]);
|
|
134
|
+
const commonFeAttributes = /* @__PURE__ */ new Set([
|
|
135
|
+
"x",
|
|
136
|
+
"y",
|
|
137
|
+
"width",
|
|
138
|
+
"height",
|
|
139
|
+
"color-interpolation-filters"
|
|
140
|
+
]);
|
|
141
|
+
const feFuncAttributes = /* @__PURE__ */ new Set([
|
|
142
|
+
"type",
|
|
143
|
+
"tableValues",
|
|
144
|
+
"slope",
|
|
145
|
+
"intercept",
|
|
146
|
+
"amplitude",
|
|
147
|
+
"exponent",
|
|
148
|
+
"offset",
|
|
149
|
+
...commonFeAttributes
|
|
150
|
+
]);
|
|
151
|
+
const tagSpecificAnimatedAttributes = {
|
|
152
|
+
circle: /* @__PURE__ */ new Set(["cx", "cy", "r"]),
|
|
153
|
+
ellipse: /* @__PURE__ */ new Set(["cx", "cy", "rx", "ry"]),
|
|
154
|
+
line: /* @__PURE__ */ new Set(["x1", "x2", "y1", "y2"]),
|
|
155
|
+
path: /* @__PURE__ */ new Set(["d"]),
|
|
156
|
+
polygon: /* @__PURE__ */ new Set(["points"]),
|
|
157
|
+
polyline: /* @__PURE__ */ new Set(["points"]),
|
|
158
|
+
rect: /* @__PURE__ */ new Set(["x", "y", "width", "height", "rx", "ry"])
|
|
159
|
+
};
|
|
160
|
+
const tagSpecificPresentationalAttributes = {
|
|
161
|
+
svg: /* @__PURE__ */ new Set(["width", "height", ...presentationalAttributes]),
|
|
162
|
+
clipPath: /* @__PURE__ */ new Set([...presentationalAttributes]),
|
|
163
|
+
defs: /* @__PURE__ */ new Set([]),
|
|
164
|
+
g: /* @__PURE__ */ new Set([...presentationalAttributes]),
|
|
165
|
+
mask: /* @__PURE__ */ new Set(["x", "y", "width", "height", ...presentationalAttributes]),
|
|
166
|
+
symbol: /* @__PURE__ */ new Set(["x", "y", "width", "height", ...presentationalAttributes]),
|
|
167
|
+
use: /* @__PURE__ */ new Set([
|
|
168
|
+
"x",
|
|
169
|
+
"y",
|
|
170
|
+
"width",
|
|
171
|
+
"height",
|
|
172
|
+
"refX",
|
|
173
|
+
"refY",
|
|
174
|
+
...presentationalAttributes
|
|
175
|
+
]),
|
|
176
|
+
marker: /* @__PURE__ */ new Set([...presentationalAttributes]),
|
|
177
|
+
linearGradient: /* @__PURE__ */ new Set([
|
|
178
|
+
"x1",
|
|
179
|
+
"x2",
|
|
180
|
+
"y1",
|
|
181
|
+
"y2",
|
|
182
|
+
...presentationalAttributes
|
|
183
|
+
]),
|
|
184
|
+
radialGradient: /* @__PURE__ */ new Set([
|
|
185
|
+
"cx",
|
|
186
|
+
"cy",
|
|
187
|
+
"fr",
|
|
188
|
+
"fx",
|
|
189
|
+
"fy",
|
|
190
|
+
"r",
|
|
191
|
+
...presentationalAttributes
|
|
192
|
+
]),
|
|
193
|
+
stop: /* @__PURE__ */ new Set(["offset", "stop-color", "stop-opacity"]),
|
|
194
|
+
feFlood: /* @__PURE__ */ new Set(["flood-color", "flood-opacity"]),
|
|
195
|
+
feDropShadow: /* @__PURE__ */ new Set(["flood-color", "flood-opacity"])
|
|
196
|
+
};
|
|
197
|
+
svg_data_tags.shapeTags.forEach((tag) => {
|
|
198
|
+
tagSpecificPresentationalAttributes[tag] = /* @__PURE__ */ new Set([
|
|
199
|
+
...presentationalAttributes,
|
|
200
|
+
...markerAttributes,
|
|
201
|
+
...tagSpecificPresentationalAttributes[tag] || []
|
|
202
|
+
]);
|
|
203
|
+
});
|
|
204
|
+
svg_data_tags.filterChildTags.forEach((tag) => {
|
|
205
|
+
tagSpecificPresentationalAttributes[tag] = /* @__PURE__ */ new Set([
|
|
206
|
+
...commonFeAttributes,
|
|
207
|
+
...tagSpecificPresentationalAttributes[tag] || []
|
|
208
|
+
]);
|
|
209
|
+
});
|
|
210
|
+
const tagSpecificNonPresentationalAttributes = {
|
|
211
|
+
svg: /* @__PURE__ */ new Set(["xmlns", "viewBox", "preserveAspectRatio"]),
|
|
212
|
+
clipPath: /* @__PURE__ */ new Set(["clipPathUnits"]),
|
|
213
|
+
mask: /* @__PURE__ */ new Set(["maskContentUnits", "maskUnits"]),
|
|
214
|
+
symbol: /* @__PURE__ */ new Set(["viewBox", "preserveAspectRatio"]),
|
|
215
|
+
circle: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
216
|
+
ellipse: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
217
|
+
line: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
218
|
+
path: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
219
|
+
polygon: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
220
|
+
polyline: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
221
|
+
rect: /* @__PURE__ */ new Set([...otherShapeAttributes]),
|
|
222
|
+
use: /* @__PURE__ */ new Set(["href"]),
|
|
223
|
+
marker: /* @__PURE__ */ new Set([
|
|
224
|
+
"markerHeight",
|
|
225
|
+
"markerUnits",
|
|
226
|
+
"markerWidth",
|
|
227
|
+
"orient",
|
|
228
|
+
"preserveAspectRatio",
|
|
229
|
+
"refX",
|
|
230
|
+
"refY",
|
|
231
|
+
"viewBox"
|
|
232
|
+
]),
|
|
233
|
+
animate: /* @__PURE__ */ new Set([
|
|
234
|
+
...animationTimingAttributes,
|
|
235
|
+
...animationValueAttributes,
|
|
236
|
+
...otherAnimationAttributes
|
|
237
|
+
]),
|
|
238
|
+
animateMotion: /* @__PURE__ */ new Set([
|
|
239
|
+
"keyPoints",
|
|
240
|
+
"path",
|
|
241
|
+
"rotate",
|
|
242
|
+
...animationTimingAttributes,
|
|
243
|
+
...animationValueAttributes,
|
|
244
|
+
...otherAnimationAttributes
|
|
245
|
+
]),
|
|
246
|
+
animateTransform: /* @__PURE__ */ new Set([
|
|
247
|
+
"by",
|
|
248
|
+
"from",
|
|
249
|
+
"to",
|
|
250
|
+
"type",
|
|
251
|
+
...animationTimingAttributes,
|
|
252
|
+
...animationValueAttributes,
|
|
253
|
+
...otherAnimationAttributes
|
|
254
|
+
]),
|
|
255
|
+
discard: /* @__PURE__ */ new Set(["begin", "href"]),
|
|
256
|
+
set: /* @__PURE__ */ new Set([
|
|
257
|
+
"to",
|
|
258
|
+
...animationTimingAttributes,
|
|
259
|
+
...otherAnimationAttributes
|
|
260
|
+
]),
|
|
261
|
+
mpath: /* @__PURE__ */ new Set(["href"]),
|
|
262
|
+
linearGradient: /* @__PURE__ */ new Set([...commonGradientAttributes]),
|
|
263
|
+
radialGradient: /* @__PURE__ */ new Set([...commonGradientAttributes]),
|
|
264
|
+
feSpotLight: /* @__PURE__ */ new Set([
|
|
265
|
+
"x",
|
|
266
|
+
"y",
|
|
267
|
+
"z",
|
|
268
|
+
"pointsAtX",
|
|
269
|
+
"pointsAtY",
|
|
270
|
+
"pointsAtZ",
|
|
271
|
+
"specularExponent",
|
|
272
|
+
"limitingConeAngle"
|
|
273
|
+
]),
|
|
274
|
+
feBlend: /* @__PURE__ */ new Set(["in", "in2", "mode"]),
|
|
275
|
+
feColorMatrix: /* @__PURE__ */ new Set(["in", "type", "values"]),
|
|
276
|
+
feComponentTransfer: /* @__PURE__ */ new Set(["in"]),
|
|
277
|
+
feComposite: /* @__PURE__ */ new Set(["in", "in2", "operator", "k1", "k2", "k3", "k4"]),
|
|
278
|
+
feConvolveMatrix: /* @__PURE__ */ new Set([
|
|
279
|
+
"in",
|
|
280
|
+
"order",
|
|
281
|
+
"kernelMatrix",
|
|
282
|
+
"divisor",
|
|
283
|
+
"bias",
|
|
284
|
+
"targetX",
|
|
285
|
+
"targetY",
|
|
286
|
+
"edgeMode",
|
|
287
|
+
"kernelUnitLength",
|
|
288
|
+
"preserveAlpha"
|
|
289
|
+
]),
|
|
290
|
+
feDiffuseLighting: /* @__PURE__ */ new Set([
|
|
291
|
+
"in",
|
|
292
|
+
"surfaceScale",
|
|
293
|
+
"diffuseConstant",
|
|
294
|
+
"kernelUnitLength"
|
|
295
|
+
]),
|
|
296
|
+
feDisplacementMap: /* @__PURE__ */ new Set([
|
|
297
|
+
"in",
|
|
298
|
+
"in2",
|
|
299
|
+
"scale",
|
|
300
|
+
"xChannelSelector",
|
|
301
|
+
"yChannelSelector"
|
|
302
|
+
]),
|
|
303
|
+
feDistantLight: /* @__PURE__ */ new Set(["azimuth", "elevation"]),
|
|
304
|
+
feDropShadow: /* @__PURE__ */ new Set(["dx", "dy", "stdDeviation"]),
|
|
305
|
+
feGaussianBlur: /* @__PURE__ */ new Set(["in", "stdDeviation", "edgeMode"]),
|
|
306
|
+
feFuncA: feFuncAttributes,
|
|
307
|
+
feFuncR: feFuncAttributes,
|
|
308
|
+
feFuncG: feFuncAttributes,
|
|
309
|
+
feFuncB: feFuncAttributes,
|
|
310
|
+
feMergeNode: /* @__PURE__ */ new Set(["in"]),
|
|
311
|
+
feMorphology: /* @__PURE__ */ new Set(["in", "operator", "radius"]),
|
|
312
|
+
feOffset: /* @__PURE__ */ new Set(["in", "dx", "dy"]),
|
|
313
|
+
fePointLight: /* @__PURE__ */ new Set(["x", "y", "z"]),
|
|
314
|
+
feSpecularLighting: /* @__PURE__ */ new Set([
|
|
315
|
+
"in",
|
|
316
|
+
"surfaceScale",
|
|
317
|
+
"specularConstant",
|
|
318
|
+
"specularExponent",
|
|
319
|
+
"kernelUnitLength"
|
|
320
|
+
]),
|
|
321
|
+
feTile: /* @__PURE__ */ new Set(["in"]),
|
|
322
|
+
feTurbulence: /* @__PURE__ */ new Set([
|
|
323
|
+
"baseFrequency",
|
|
324
|
+
"numOctaves",
|
|
325
|
+
"seed",
|
|
326
|
+
"stitchTiles",
|
|
327
|
+
"type"
|
|
328
|
+
])
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
exports.animationTimingAttributes = animationTimingAttributes;
|
|
332
|
+
exports.animationValueAttributes = animationValueAttributes;
|
|
333
|
+
exports.badAttributePrefixes = badAttributePrefixes;
|
|
334
|
+
exports.badAttributes = badAttributes;
|
|
335
|
+
exports.badSoftwareAttributes = badSoftwareAttributes;
|
|
336
|
+
exports.commonAttributes = commonAttributes;
|
|
337
|
+
exports.commonColorPresentationalAttributes = commonColorPresentationalAttributes;
|
|
338
|
+
exports.commonFeAttributes = commonFeAttributes;
|
|
339
|
+
exports.commonGradientAttributes = commonGradientAttributes;
|
|
340
|
+
exports.feFuncAttributes = feFuncAttributes;
|
|
341
|
+
exports.fillPresentationalAttributes = fillPresentationalAttributes;
|
|
342
|
+
exports.insideClipPathAttributes = insideClipPathAttributes;
|
|
343
|
+
exports.junkSVGAttributes = junkSVGAttributes;
|
|
344
|
+
exports.markerAttributes = markerAttributes;
|
|
345
|
+
exports.otherAnimationAttributes = otherAnimationAttributes;
|
|
346
|
+
exports.otherPresentationalAttributes = otherPresentationalAttributes;
|
|
347
|
+
exports.otherShapeAttributes = otherShapeAttributes;
|
|
348
|
+
exports.presentationalAttributes = presentationalAttributes;
|
|
349
|
+
exports.strokePresentationalAttributes = strokePresentationalAttributes;
|
|
350
|
+
exports.stylingAttributes = stylingAttributes;
|
|
351
|
+
exports.tagSpecificAnimatedAttributes = tagSpecificAnimatedAttributes;
|
|
352
|
+
exports.tagSpecificNonPresentationalAttributes = tagSpecificNonPresentationalAttributes;
|
|
353
|
+
exports.tagSpecificPresentationalAttributes = tagSpecificPresentationalAttributes;
|
|
354
|
+
exports.urlPresentationalAttributes = urlPresentationalAttributes;
|
|
355
|
+
exports.visibilityPresentationalAttributes = visibilityPresentationalAttributes;
|
|
@@ -6,66 +6,68 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Attributes that icons should not mess with or that are irrelevant. They should be removed
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
declare const badAttributes: Set<string>;
|
|
10
10
|
/**
|
|
11
11
|
* Attributes for SVG element that should be removed
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
declare const junkSVGAttributes: Set<string>;
|
|
14
14
|
/**
|
|
15
15
|
* Attributes and styles often added by bad software to wrong tags, such as Adobe Illustrator and Inkscape
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
declare const badSoftwareAttributes: Set<string>;
|
|
18
|
+
declare const badAttributePrefixes: Set<string>;
|
|
19
19
|
/**
|
|
20
20
|
* Common attributes that can exist on any element
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
declare const commonAttributes: Set<string>;
|
|
23
|
+
declare const stylingAttributes: Set<string>;
|
|
24
24
|
/**
|
|
25
25
|
* Attributes that exist only on child elements of <clipPath>
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
declare const insideClipPathAttributes: Set<string>;
|
|
28
28
|
/***** Other attributes, added to tagSpecificAttributes variable below *****/
|
|
29
29
|
/**
|
|
30
30
|
* Presentational attributes
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
declare const fillPresentationalAttributes: Set<string>;
|
|
33
|
+
declare const strokePresentationalAttributes: Set<string>;
|
|
34
|
+
declare const urlPresentationalAttributes: Set<string>;
|
|
35
|
+
declare const visibilityPresentationalAttributes: Set<string>;
|
|
36
|
+
declare const commonColorPresentationalAttributes: Set<string>;
|
|
37
|
+
declare const otherPresentationalAttributes: Set<string>;
|
|
38
|
+
declare const presentationalAttributes: Set<string>;
|
|
39
39
|
/**
|
|
40
40
|
* Markers
|
|
41
41
|
*
|
|
42
42
|
* Presentational attributes
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
declare const markerAttributes: Set<string>;
|
|
45
45
|
/**
|
|
46
46
|
* Shapes
|
|
47
47
|
*
|
|
48
48
|
* Not presentational
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
declare const otherShapeAttributes: Set<string>;
|
|
51
51
|
/**
|
|
52
52
|
* Animations
|
|
53
53
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
declare const animationTimingAttributes: Set<string>;
|
|
55
|
+
declare const animationValueAttributes: Set<string>;
|
|
56
|
+
declare const otherAnimationAttributes: Set<string>;
|
|
57
57
|
/**
|
|
58
58
|
* Gradients
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
declare const commonGradientAttributes: Set<string>;
|
|
61
61
|
/**
|
|
62
62
|
* Filters
|
|
63
63
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
declare const commonFeAttributes: Set<string>;
|
|
65
|
+
declare const feFuncAttributes: Set<string>;
|
|
66
66
|
/**
|
|
67
67
|
* Tag specific attributes
|
|
68
68
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
declare const tagSpecificAnimatedAttributes: Record<string, Set<string>>;
|
|
70
|
+
declare const tagSpecificPresentationalAttributes: Record<string, Set<string>>;
|
|
71
|
+
declare const tagSpecificNonPresentationalAttributes: Record<string, Set<string>>;
|
|
72
|
+
|
|
73
|
+
export { animationTimingAttributes, animationValueAttributes, badAttributePrefixes, badAttributes, badSoftwareAttributes, commonAttributes, commonColorPresentationalAttributes, commonFeAttributes, commonGradientAttributes, feFuncAttributes, fillPresentationalAttributes, insideClipPathAttributes, junkSVGAttributes, markerAttributes, otherAnimationAttributes, otherPresentationalAttributes, otherShapeAttributes, presentationalAttributes, strokePresentationalAttributes, stylingAttributes, tagSpecificAnimatedAttributes, tagSpecificNonPresentationalAttributes, tagSpecificPresentationalAttributes, urlPresentationalAttributes, visibilityPresentationalAttributes };
|