@cyberalien/svg-utils 1.2.6 → 1.2.7
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/classname/const.js +1 -2
- package/lib/classname/toggle.js +1 -3
- package/lib/components/export/dependencies.js +1 -2
- package/lib/components/export/exports.js +1 -2
- package/lib/components/export/file.js +1 -3
- package/lib/components/export/filename.js +1 -2
- package/lib/components/export/fs.js +1 -3
- package/lib/components/export/merge.js +1 -3
- package/lib/components/helpers/code/lines.js +1 -2
- package/lib/components/helpers/content/ratio.js +1 -2
- package/lib/components/helpers/content/size.js +1 -3
- package/lib/components/helpers/content/stringify.js +1 -3
- package/lib/components/helpers/css/generate.js +1 -3
- package/lib/components/helpers/filenames/asset.js +1 -2
- package/lib/components/helpers/filenames/css.js +1 -3
- package/lib/components/helpers/filenames/path.js +1 -2
- package/lib/components/helpers/filenames/types.js +1 -3
- package/lib/components/helpers/functions/custom.js +3 -5
- package/lib/components/helpers/functions/fallback.js +3 -5
- package/lib/components/helpers/functions/innerhtml.js +1 -3
- package/lib/components/helpers/functions/size.js +3 -5
- package/lib/components/helpers/imports/add.js +1 -2
- package/lib/components/helpers/imports/create.js +1 -2
- package/lib/components/helpers/imports/stringify.js +1 -2
- package/lib/components/helpers/imports/types.js +1 -1
- package/lib/components/helpers/props/object.js +1 -3
- package/lib/components/helpers/props/stringify.js +1 -2
- package/lib/components/helpers/props/ts.js +1 -2
- package/lib/components/helpers/props/types.js +1 -1
- package/lib/components/helpers/ts/jsx.js +1 -3
- package/lib/components/helpers/ts/solid.js +1 -3
- package/lib/components/helpers/ts/svelte.js +1 -3
- package/lib/components/helpers/ts/vue.js +1 -3
- package/lib/components/helpers/ts/wrapper.js +1 -3
- package/lib/components/jsx.js +1 -3
- package/lib/components/prepare/iconify.js +2 -4
- package/lib/components/prepare/options.js +1 -3
- package/lib/components/prepare/states.js +1 -3
- package/lib/components/raw.js +1 -3
- package/lib/components/solid.js +1 -3
- package/lib/components/svelte.js +1 -3
- package/lib/components/types/component.js +1 -1
- package/lib/components/types/css.js +1 -1
- package/lib/components/types/data.js +1 -1
- package/lib/components/types/jsx.js +1 -1
- package/lib/components/types/options.js +1 -1
- package/lib/components/types/source.js +1 -1
- package/lib/components/vue-func.js +1 -3
- package/lib/components/vue.js +1 -3
- package/lib/css/find/animations.js +1 -3
- package/lib/css/find/classname.js +1 -3
- package/lib/css/find/prop.js +1 -2
- package/lib/css/hash.js +1 -3
- package/lib/css/minify.js +1 -2
- package/lib/css/rules.js +1 -2
- package/lib/css/stringify.js +1 -2
- package/lib/css/stylesheet.js +1 -3
- package/lib/css/types.js +1 -1
- package/lib/helpers/data/compact.js +1 -2
- package/lib/helpers/data/expand.js +1 -2
- package/lib/helpers/hash/context.js +1 -2
- package/lib/helpers/hash/hash.js +1 -2
- package/lib/helpers/hash/stringify.js +1 -2
- package/lib/helpers/hash/types.js +1 -1
- package/lib/helpers/hash/unique.js +1 -3
- package/lib/helpers/misc/clone.js +1 -2
- package/lib/helpers/misc/compare.js +1 -3
- package/lib/helpers/misc/keys.js +1 -3
- package/lib/helpers/misc/promises.js +1 -3
- package/lib/helpers/misc/sort-object.js +1 -2
- package/lib/helpers/misc/strings.js +1 -2
- package/lib/helpers/reduce-motion.js +1 -2
- package/lib/iconify/icon/{nornalise.js → normalise.js} +1 -3
- package/lib/iconify/icon/types.js +1 -1
- package/lib/iconify/icon-set/defaults.js +1 -2
- package/lib/iconify/icon-set/icon.js +1 -3
- package/lib/iconify/icon-set/parse.js +1 -3
- package/lib/iconify/icon-set/types.js +1 -1
- package/lib/index.js +1 -2
- package/lib/svg/content/defs.js +1 -2
- package/lib/svg/ids/change.js +1 -3
- package/lib/svg/ids/duplicate.js +1 -3
- package/lib/svg/ids/string.js +1 -2
- package/lib/svg/ids/types.js +1 -1
- package/lib/svg/ids/unique.js +1 -3
- package/lib/svg/ids/unused.js +1 -3
- package/lib/svg/props/size.js +1 -2
- package/lib/svg/props/stringify.js +1 -2
- package/lib/svg/viewbox/minify.js +1 -2
- package/lib/svg/viewbox/parse.js +1 -2
- package/lib/svg/viewbox/square.js +1 -2
- package/lib/svg/viewbox/types.js +1 -1
- package/lib/svg/viewbox/value.js +1 -2
- package/lib/svg-css/content.js +1 -3
- package/lib/svg-css/icon/css.js +1 -3
- package/lib/svg-css/icon/types.js +1 -1
- package/lib/svg-css/icon-set/add.js +1 -3
- package/lib/svg-css/icon-set/create.js +1 -2
- package/lib/svg-css/icon-set/get.js +1 -3
- package/lib/svg-css/icon-set/minify/expand.js +1 -3
- package/lib/svg-css/icon-set/minify/keys.js +1 -2
- package/lib/svg-css/icon-set/minify/minify.js +1 -3
- package/lib/svg-css/icon-set/types.js +1 -1
- package/lib/svg-css/props/prop.js +1 -2
- package/lib/svg-css/props/props.js +3 -5
- package/lib/svg-css/props/tags.js +2 -3
- package/lib/svg-css/props/types.js +1 -1
- package/lib/svg-css/root.js +1 -3
- package/lib/svg-css/states/cleanup-values.js +1 -3
- package/lib/svg-css/states/fallback/parse.js +1 -2
- package/lib/svg-css/states/fallback/stringify.js +1 -2
- package/lib/svg-css/states/fallback/test.js +1 -3
- package/lib/svg-css/states/fallback/types.js +1 -1
- package/lib/svg-css/states/focus.js +1 -2
- package/lib/svg-css/states/generator.js +1 -3
- package/lib/svg-css/states/key.js +1 -2
- package/lib/svg-css/states/object.js +1 -3
- package/lib/svg-css/states/selector/helpers/iterate.js +1 -2
- package/lib/svg-css/states/selector/merge.js +1 -3
- package/lib/svg-css/states/selector/parse.js +1 -3
- package/lib/svg-css/states/selector/part/merge.js +1 -3
- package/lib/svg-css/states/selector/part/split.js +1 -3
- package/lib/svg-css/states/selector/part/stringify.js +1 -3
- package/lib/svg-css/states/selector/split.js +1 -3
- package/lib/svg-css/states/selector/stringify.js +1 -3
- package/lib/svg-css/states/selector/sub/merge.js +1 -2
- package/lib/svg-css/states/selector/sub/split.js +1 -2
- package/lib/svg-css/states/selector/sub/stringify.js +1 -2
- package/lib/svg-css/states/selector/types.js +1 -1
- package/lib/svg-css/states/types.js +1 -1
- package/lib/svg-css/states/validate.js +1 -2
- package/lib/svg-css/states/value.js +1 -2
- package/lib/svg-css/types.js +1 -1
- package/lib/xml/iterate.js +1 -2
- package/lib/xml/parse.js +1 -2
- package/lib/xml/stringify.js +1 -2
- package/lib/xml/types.js +1 -1
- package/package.json +9 -9
- /package/lib/iconify/icon/{nornalise.d.ts → normalise.d.ts} +0 -0
package/lib/css/stringify.js
CHANGED
|
@@ -50,5 +50,4 @@ function stringifyCSSKeyframes(animationName, keyframes, depth = 0) {
|
|
|
50
50
|
if (content.includes("@keyframes")) return content;
|
|
51
51
|
return `${indent(depth)}@keyframes ${animationName} {\n${indent(depth + 1)}${content}\n}\n`;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
export { stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector };
|
|
53
|
+
export { stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector };
|
package/lib/css/stylesheet.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { stringifyCSSKeyframes, stringifyCSSSelector } from "./stringify.js";
|
|
2
2
|
import { mergeCSSRules } from "./rules.js";
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* Create empty stylesheet
|
|
6
5
|
*/
|
|
@@ -65,5 +64,4 @@ function stringifyStylesheet(stylesheet) {
|
|
|
65
64
|
}
|
|
66
65
|
return lines.join("\n");
|
|
67
66
|
}
|
|
68
|
-
|
|
69
|
-
export { addGeneratedSelector, createEmptyStylesheet, stringifyStylesheet };
|
|
67
|
+
export { addGeneratedSelector, createEmptyStylesheet, stringifyStylesheet };
|
package/lib/css/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/lib/helpers/hash/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { sortObject } from "../misc/sort-object.js";
|
|
2
2
|
import { hashToString } from "./stringify.js";
|
|
3
3
|
import { hashString } from "./hash.js";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Hash an object, make sure hash is unique
|
|
7
6
|
*
|
|
@@ -35,5 +34,4 @@ function getUniqueHash(data, options) {
|
|
|
35
34
|
}
|
|
36
35
|
return result;
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
export { getUniqueHash };
|
|
37
|
+
export { getUniqueHash };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { sortObject } from "./sort-object.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Compare sets, returns true if identical
|
|
5
4
|
*/
|
|
@@ -15,5 +14,4 @@ function compareSets(set1, set2) {
|
|
|
15
14
|
function compareValues(value1, value2) {
|
|
16
15
|
return value1 === value2 || JSON.stringify(sortObject(value1)) === JSON.stringify(sortObject(value2));
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
export { compareSets, compareValues };
|
|
17
|
+
export { compareSets, compareValues };
|
package/lib/helpers/misc/keys.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { sortObject } from "./sort-object.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Compare keys, return true on match
|
|
5
4
|
*/
|
|
@@ -8,5 +7,4 @@ function compareKeys(key1, key2) {
|
|
|
8
7
|
if (typeof key1 !== "object" || typeof key2 !== "object" || !key1 || !key2) return false;
|
|
9
8
|
return JSON.stringify(sortObject(key1)) === JSON.stringify(sortObject(key2));
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
export { compareKeys };
|
|
10
|
+
export { compareKeys };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { compareKeys } from "./keys.js";
|
|
2
|
-
|
|
3
2
|
let cache = [];
|
|
4
3
|
/**
|
|
5
4
|
* Make sure multiple instances of Promise or callback are not ran at the same time
|
|
@@ -46,5 +45,4 @@ function uniquePromise(key, callback) {
|
|
|
46
45
|
else done(true, cb);
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
|
-
|
|
50
|
-
export { uniquePromise };
|
|
48
|
+
export { uniquePromise };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { wrapSVGContent } from "../../svg/content/defs.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Normalise icon: apply transformations
|
|
5
4
|
*/
|
|
@@ -59,5 +58,4 @@ function normaliseIconifyIcon(data) {
|
|
|
59
58
|
viewBox
|
|
60
59
|
};
|
|
61
60
|
}
|
|
62
|
-
|
|
63
|
-
export { normaliseIconifyIcon };
|
|
61
|
+
export { normaliseIconifyIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getIconifyIconSetDefaults } from "./defaults.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Get icon data from Iconify icon set
|
|
5
4
|
*/
|
|
@@ -20,5 +19,4 @@ function getIconifyIconSetIcon(data, name) {
|
|
|
20
19
|
} : null;
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
export { getIconifyIconSetIcon };
|
|
22
|
+
export { getIconifyIconSetIcon };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getIconifyIconSetDefaults } from "./defaults.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Parse Iconify icon set and call callback for each icon
|
|
5
4
|
*/
|
|
@@ -27,5 +26,4 @@ function parseIconifyIconSet(data, callback) {
|
|
|
27
26
|
}
|
|
28
27
|
if (data.not_found) for (const name of data.not_found) callback(name, null);
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
export { parseIconifyIconSet };
|
|
29
|
+
export { parseIconifyIconSet };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/lib/index.js
CHANGED
|
@@ -31,5 +31,4 @@ import { getObjectFromStates } from "./svg-css/states/object.js";
|
|
|
31
31
|
import { getSVGCSSIconFromIconSet } from "./svg-css/icon-set/get.js";
|
|
32
32
|
import { addIconToSVGCSSIconSet } from "./svg-css/icon-set/add.js";
|
|
33
33
|
import { createEmptySVGCSSIconSet } from "./svg-css/icon-set/create.js";
|
|
34
|
-
|
|
35
|
-
export { addGeneratedSelector, addIconToSVGCSSIconSet, changeIDInString, changeSVGIDs, classProps, cloneObject, compareKeys, compareSets, compareValues, convertSVGContentToCSSRules, convertSVGRootToCSS, createCSSClassName, createEmptySVGCSSIconSet, createEmptyStylesheet, createUniqueHashContext, createUniqueIDs, defaultClassProp, getAdvancedStateDefaultValue, getIconFallback, getObjectFromStates, getSVGCSSIconFromIconSet, getStateValue, getStatesFromKey, getUniqueHash, hashString, hashToString, iterateXMLContent, mergeCSSRules, minifyCSS, parseXMLContent, removeDuplicateIDs, removeUnusedIDs, sortObject, splitCSSRules, splitClassName, stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector, stringifyStylesheet, stringifyXMLContent, toggleClassName, uniquePromise };
|
|
34
|
+
export { addGeneratedSelector, addIconToSVGCSSIconSet, changeIDInString, changeSVGIDs, classProps, cloneObject, compareKeys, compareSets, compareValues, convertSVGContentToCSSRules, convertSVGRootToCSS, createCSSClassName, createEmptySVGCSSIconSet, createEmptyStylesheet, createUniqueHashContext, createUniqueIDs, defaultClassProp, getAdvancedStateDefaultValue, getIconFallback, getObjectFromStates, getSVGCSSIconFromIconSet, getStateValue, getStatesFromKey, getUniqueHash, hashString, hashToString, iterateXMLContent, mergeCSSRules, minifyCSS, parseXMLContent, removeDuplicateIDs, removeUnusedIDs, sortObject, splitCSSRules, splitClassName, stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector, stringifyStylesheet, stringifyXMLContent, toggleClassName, uniquePromise };
|
package/lib/svg/content/defs.js
CHANGED
|
@@ -40,5 +40,4 @@ function wrapSVGContent(body, start, end) {
|
|
|
40
40
|
const split = splitSVGDefs(body);
|
|
41
41
|
return mergeDefsAndContent(split.defs, start + split.content + end);
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
export { mergeDefsAndContent, splitSVGDefs, wrapSVGContent };
|
|
43
|
+
export { mergeDefsAndContent, splitSVGDefs, wrapSVGContent };
|
package/lib/svg/ids/change.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { iterateXMLContent } from "../../xml/iterate.js";
|
|
2
2
|
import { stringifyXMLContent } from "../../xml/stringify.js";
|
|
3
3
|
import { changeIDInString } from "./string.js";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Change IDs in SVG using a callback function
|
|
7
6
|
*/
|
|
@@ -113,5 +112,4 @@ function changeSVGIDs(root, callback) {
|
|
|
113
112
|
}
|
|
114
113
|
return results;
|
|
115
114
|
}
|
|
116
|
-
|
|
117
|
-
export { changeSVGIDs };
|
|
115
|
+
export { changeSVGIDs };
|
package/lib/svg/ids/duplicate.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { iterateXMLContent } from "../../xml/iterate.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Remove duplicate IDs from SVG
|
|
5
4
|
*/
|
|
@@ -18,5 +17,4 @@ function removeDuplicateIDs(root, data) {
|
|
|
18
17
|
}
|
|
19
18
|
return root;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
export { removeDuplicateIDs };
|
|
20
|
+
export { removeDuplicateIDs };
|
package/lib/svg/ids/string.js
CHANGED
|
@@ -5,5 +5,4 @@ function changeIDInString(value, oldID, newID) {
|
|
|
5
5
|
const escapedID = oldID.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
6
6
|
return value.replace(new RegExp("([#;\"])(" + escapedID + ")([\")]|\\.[a-z])", "g"), "$1" + newID + "$3");
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
export { changeIDInString };
|
|
8
|
+
export { changeIDInString };
|
package/lib/svg/ids/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/lib/svg/ids/unique.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getUniqueHash } from "../../helpers/hash/unique.js";
|
|
2
2
|
import { changeSVGIDs } from "./change.js";
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* Create unique IDs for SVG elements
|
|
6
5
|
*/
|
|
@@ -12,5 +11,4 @@ function createUniqueIDs(root, options) {
|
|
|
12
11
|
...options
|
|
13
12
|
}));
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
export { createUniqueIDs };
|
|
14
|
+
export { createUniqueIDs };
|
package/lib/svg/ids/unused.js
CHANGED
package/lib/svg/props/size.js
CHANGED
package/lib/svg/viewbox/parse.js
CHANGED
package/lib/svg/viewbox/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/lib/svg/viewbox/value.js
CHANGED
package/lib/svg-css/content.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { parseXMLContent } from "../xml/parse.js";
|
|
2
2
|
import { stringifyXMLContent } from "../xml/stringify.js";
|
|
3
3
|
import { convertSVGRootToCSS } from "./root.js";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Convert SVG content string to SVG+CSS
|
|
7
6
|
*/
|
|
@@ -18,5 +17,4 @@ function convertSVGContentToCSSRules(content, options) {
|
|
|
18
17
|
}
|
|
19
18
|
return { content };
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
export { convertSVGContentToCSSRules };
|
|
20
|
+
export { convertSVGContentToCSSRules };
|
package/lib/svg-css/icon/css.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { addGeneratedSelector, createEmptyStylesheet } from "../../css/stylesheet.js";
|
|
2
2
|
import { prefersReduceMotion } from "../../helpers/reduce-motion.js";
|
|
3
3
|
import { getSelectorsForStateValues } from "../states/selector/parse.js";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Add styles for stateful icon to stylesheet
|
|
7
6
|
*
|
|
@@ -53,5 +52,4 @@ function renderStatefulSVGCSSIconStyle(icon, context, commonStylesheet = createE
|
|
|
53
52
|
function renderSVGCSSIconStyle(icon, commonStylesheet) {
|
|
54
53
|
return renderStatefulSVGCSSIconStyle(icon, null, commonStylesheet);
|
|
55
54
|
}
|
|
56
|
-
|
|
57
|
-
export { renderSVGCSSIconStyle, renderStatefulSVGCSSIconStyle };
|
|
55
|
+
export { renderSVGCSSIconStyle, renderStatefulSVGCSSIconStyle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { stringifyCSSAnimationFrames, stringifyCSSRules } from "../../css/stringify.js";
|
|
2
2
|
import { minifyCSS } from "../../css/minify.js";
|
|
3
3
|
import { expandSVGCSSIconSetFallback } from "./minify/expand.js";
|
|
4
|
-
|
|
5
4
|
function minifyRules(value) {
|
|
6
5
|
return (value ? minifyCSS(typeof value === "string" ? value : stringifyCSSRules(value)) : void 0) || void 0;
|
|
7
6
|
}
|
|
@@ -56,5 +55,4 @@ function addIconToSVGCSSIconSet(iconSet, iconName, icon) {
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
export { addIconToSVGCSSIconSet };
|
|
58
|
+
export { addIconToSVGCSSIconSet };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { findUsedKeyframes } from "../../css/find/animations.js";
|
|
2
2
|
import { findUsedClassNames } from "../../css/find/classname.js";
|
|
3
3
|
import { expandSVGCSSIconSetClass } from "./minify/expand.js";
|
|
4
|
-
|
|
5
4
|
function getSVGCSSIconFromIconSet(iconSet, name) {
|
|
6
5
|
const fullName = iconSet.aliases?.[name] || name;
|
|
7
6
|
const data = iconSet.icons[fullName];
|
|
@@ -88,5 +87,4 @@ function getSVGCSSIconFromIconSet(iconSet, name) {
|
|
|
88
87
|
}
|
|
89
88
|
return result;
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
export { getSVGCSSIconFromIconSet };
|
|
90
|
+
export { getSVGCSSIconFromIconSet };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { expandItem } from "../../../helpers/data/expand.js";
|
|
2
2
|
import { iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys } from "./keys.js";
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* Expand class content from icon set
|
|
6
5
|
*/
|
|
@@ -46,5 +45,4 @@ function expandSVGCSSIconSet(iconSet) {
|
|
|
46
45
|
delete iconSet.css;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
|
|
50
|
-
export { expandSVGCSSIconSet, expandSVGCSSIconSetClass, expandSVGCSSIconSetFallback };
|
|
48
|
+
export { expandSVGCSSIconSet, expandSVGCSSIconSetClass, expandSVGCSSIconSetFallback };
|
|
@@ -5,5 +5,4 @@ const iconSetMinifySimpleKeys = [
|
|
|
5
5
|
];
|
|
6
6
|
const iconSetMinifyStatefulKeys = ["sr", "st"];
|
|
7
7
|
const iconSetMinifyKeys = [...iconSetMinifySimpleKeys, ...iconSetMinifyStatefulKeys];
|
|
8
|
-
|
|
9
|
-
export { iconSetMinifyKeys, iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys };
|
|
8
|
+
export { iconSetMinifyKeys, iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { iconSetMinifyKeys, iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys } from "./keys.js";
|
|
2
2
|
import { stringifyIconViewBox } from "../../../svg/viewbox/value.js";
|
|
3
3
|
import { compactItem, createCompactContext } from "../../../helpers/data/compact.js";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Create context for minification
|
|
7
6
|
*/
|
|
@@ -97,5 +96,4 @@ function minifySVGCSSIconSet(iconSet) {
|
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
|
-
|
|
101
|
-
export { createIconSetMinifyContext, minifySVGCSSIconSet };
|
|
99
|
+
export { createIconSetMinifyContext, minifySVGCSSIconSet };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { iterateXMLContent } from "../../xml/iterate.js";
|
|
2
2
|
import { convertSVGPropertyToCSS } from "./prop.js";
|
|
3
|
-
import { svgAnimateTransformTag, svgAnimationTag
|
|
4
|
-
|
|
3
|
+
import { svgAnimateTransformTag, svgAnimationTag } from "./tags.js";
|
|
5
4
|
/**
|
|
6
5
|
* Extract SVG tag properties that can be converted to CSS
|
|
7
6
|
*
|
|
@@ -15,7 +14,7 @@ function extractSVGTagPropertiesForCSS(tag, supportLegacyBrowsers = false) {
|
|
|
15
14
|
const animatedProps = /* @__PURE__ */ new Set();
|
|
16
15
|
iterateXMLContent(tag.children, (node) => {
|
|
17
16
|
if (node.type === "tag") switch (node.tag) {
|
|
18
|
-
case
|
|
17
|
+
case "set":
|
|
19
18
|
case svgAnimationTag: {
|
|
20
19
|
const prop = node.attribs.attributeName;
|
|
21
20
|
if (typeof prop === "string") animatedProps.add(prop);
|
|
@@ -38,5 +37,4 @@ function extractSVGTagPropertiesForCSS(tag, supportLegacyBrowsers = false) {
|
|
|
38
37
|
}
|
|
39
38
|
return result.props.length > 0 ? result : void 0;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
export { extractSVGTagPropertiesForCSS };
|
|
40
|
+
export { extractSVGTagPropertiesForCSS };
|
|
@@ -18,10 +18,9 @@ const svgAnimateMotionTag = "animateMotion";
|
|
|
18
18
|
* All tags for animating SVG
|
|
19
19
|
*/
|
|
20
20
|
const svgAnimationTags = [
|
|
21
|
-
|
|
21
|
+
"set",
|
|
22
22
|
svgAnimationTag,
|
|
23
23
|
svgAnimateTransformTag,
|
|
24
24
|
svgAnimateMotionTag
|
|
25
25
|
];
|
|
26
|
-
|
|
27
|
-
export { svgAnimateMotionTag, svgAnimateTransformTag, svgAnimationTag, svgAnimationTags, svgSetTag };
|
|
26
|
+
export { svgAnimateMotionTag, svgAnimateTransformTag, svgAnimationTag, svgAnimationTags, svgSetTag };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/lib/svg-css/root.js
CHANGED
|
@@ -2,7 +2,6 @@ import { iterateXMLContent } from "../xml/iterate.js";
|
|
|
2
2
|
import { createCSSClassName } from "../css/hash.js";
|
|
3
3
|
import { toggleClassName } from "../classname/toggle.js";
|
|
4
4
|
import { extractSVGTagPropertiesForCSS } from "./props/props.js";
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Convert SVG tags tree to SVG+CSS
|
|
8
7
|
*
|
|
@@ -22,5 +21,4 @@ function convertSVGRootToCSS(root, options) {
|
|
|
22
21
|
});
|
|
23
22
|
return rules;
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
export { convertSVGRootToCSS };
|
|
24
|
+
export { convertSVGRootToCSS };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getStateValue } from "./value.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Clean up state values object
|
|
5
4
|
*/
|
|
@@ -11,5 +10,4 @@ function cleanupStateValues(states, values, clone = false) {
|
|
|
11
10
|
}
|
|
12
11
|
return result;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
export { cleanupStateValues };
|
|
13
|
+
export { cleanupStateValues };
|
|
@@ -5,5 +5,4 @@ function getIconFallback(template, values, defaultValues) {
|
|
|
5
5
|
const stateValue = (state) => values[state] ?? defaultValues?.[state];
|
|
6
6
|
return template.map((chunk) => typeof chunk === "string" ? chunk : "values" in chunk ? chunk.values[+!!stateValue(chunk.state)] : stateValue(chunk.state)).join("");
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
export { getIconFallback };
|
|
8
|
+
export { getIconFallback };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { parseIconFallbackTemplate } from "./parse.js";
|
|
2
|
-
|
|
3
2
|
const match = /^[a-z0-9:-]*$/;
|
|
4
3
|
/**
|
|
5
4
|
* Parse and test fallback template string
|
|
@@ -17,5 +16,4 @@ function parseAndTestIconFallbackTemplate(fallback, states) {
|
|
|
17
16
|
}
|
|
18
17
|
return template;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
export { parseAndTestIconFallbackTemplate };
|
|
19
|
+
export { parseAndTestIconFallbackTemplate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getAdvancedStateDefaultValue } from "./value.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Generate code for object from states
|
|
5
4
|
*
|
|
@@ -27,5 +26,4 @@ function getStateInterface(state, optional = true) {
|
|
|
27
26
|
function generateInterfaceFromStates(states, optional = true) {
|
|
28
27
|
return states.map((state) => getStateInterface(state, optional)).join("\n ");
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
export { generateInterfaceFromStates, generateObjectFromStates, getStateInterface };
|
|
29
|
+
export { generateInterfaceFromStates, generateObjectFromStates, getStateInterface };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getAdvancedStateDefaultValue } from "./value.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Create reactive object from states
|
|
5
4
|
*/
|
|
@@ -9,5 +8,4 @@ function getObjectFromStates(states) {
|
|
|
9
8
|
else obj[state[0]] = getAdvancedStateDefaultValue(state);
|
|
10
9
|
return obj;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
export { getObjectFromStates };
|
|
11
|
+
export { getObjectFromStates };
|