@cyberalien/svg-utils 1.2.6 → 1.2.8
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.d.ts +1 -1
- 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 +13 -5
- package/lib/components/prepare/iconify.js +2 -4
- package/lib/components/prepare/options.js +1 -3
- package/lib/components/prepare/states.js +4 -4
- package/lib/components/raw.js +1 -3
- package/lib/components/solid.js +12 -5
- package/lib/components/svelte.js +12 -5
- 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.d.ts +1 -0
- package/lib/components/types/options.js +1 -1
- package/lib/components/types/source.d.ts +1 -0
- package/lib/components/types/source.js +1 -1
- package/lib/components/vue-func.js +12 -5
- package/lib/components/vue.js +12 -5
- 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 +6 -4
- 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/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.d.ts +1 -1
- package/lib/svg-css/states/selector/parse.js +3 -4
- 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.d.ts +1 -0
- 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 +6 -11
- package/lib/svg-css/states/focus.d.ts +0 -10
- package/lib/svg-css/states/focus.js +0 -14
- /package/lib/iconify/icon/{nornalise.d.ts → normalise.d.ts} +0 -0
|
@@ -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 };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { mergeSelectorParts } from "./part/merge.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Merge sets of StateSelectorData into one
|
|
5
4
|
*/
|
|
@@ -25,5 +24,4 @@ function mergeSelectorsForStates(data) {
|
|
|
25
24
|
if (!next([], "", 0)) return null;
|
|
26
25
|
return Object.values(groupedResults);
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
export { mergeSelectorsForStates };
|
|
27
|
+
export { mergeSelectorsForStates };
|
|
@@ -3,7 +3,7 @@ import { StatefulIconSelectorsConfig, StatefulIconSelectorsContext } from "./typ
|
|
|
3
3
|
/**
|
|
4
4
|
* Create context object from config
|
|
5
5
|
*/
|
|
6
|
-
declare function createStatefulIconSelectorsContext(config: StatefulIconSelectorsConfig, states: IconStatesList): StatefulIconSelectorsContext;
|
|
6
|
+
declare function createStatefulIconSelectorsContext(config: StatefulIconSelectorsConfig, states: IconStatesList, staticClassname?: string): StatefulIconSelectorsContext;
|
|
7
7
|
/**
|
|
8
8
|
* Get selectors to render state values
|
|
9
9
|
*
|
|
@@ -2,14 +2,14 @@ import { getStatesFromKey } from "../key.js";
|
|
|
2
2
|
import { mergeSelectorsForStates } from "./merge.js";
|
|
3
3
|
import { splitSelectorsForState } from "./split.js";
|
|
4
4
|
import { stringifySelectorsForState } from "./stringify.js";
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Create context object from config
|
|
8
7
|
*/
|
|
9
|
-
function createStatefulIconSelectorsContext(config, states) {
|
|
8
|
+
function createStatefulIconSelectorsContext(config, states, staticClassname) {
|
|
10
9
|
return {
|
|
11
10
|
config,
|
|
12
11
|
states,
|
|
12
|
+
staticClassname,
|
|
13
13
|
data: Object.create(null),
|
|
14
14
|
parsed: Object.create(null)
|
|
15
15
|
};
|
|
@@ -70,5 +70,4 @@ function getSelectorsForStateValues(context, value) {
|
|
|
70
70
|
parsed[cacheKey] = stringified;
|
|
71
71
|
return stringified;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
export { createStatefulIconSelectorsContext, getSelectorsForStateValues };
|
|
73
|
+
export { createStatefulIconSelectorsContext, getSelectorsForStateValues };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { mergeMultipleArrays } from "../helpers/iterate.js";
|
|
2
2
|
import { mergeMultipleSelectorSubParts } from "../sub/merge.js";
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* Merge all selectors
|
|
6
5
|
*
|
|
@@ -33,5 +32,4 @@ function mergeSelectorParts(parts) {
|
|
|
33
32
|
}));
|
|
34
33
|
else return [baseResult];
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
export { mergeSelectorParts };
|
|
35
|
+
export { mergeSelectorParts };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { splitSelectorToSubParts } from "../sub/split.js";
|
|
2
|
-
|
|
3
2
|
const charAfterAtRule = [
|
|
4
3
|
".",
|
|
5
4
|
"&",
|
|
@@ -56,5 +55,4 @@ function splitSelectorToParts(selector) {
|
|
|
56
55
|
if (parents.length) result.parents = parents;
|
|
57
56
|
return result;
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
export { createSelectorParts, splitSelectorToParts };
|
|
58
|
+
export { createSelectorParts, splitSelectorToParts };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { stringifySelectorSubParts } from "../sub/stringify.js";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Join sub-parts of selector into one string
|
|
5
4
|
*/
|
|
@@ -28,5 +27,4 @@ function stringifySelectorParts(parts) {
|
|
|
28
27
|
if (firstItem.svg) results.push(stringifySelectorSubParts(firstItem.svg, true));
|
|
29
28
|
return results;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
export { stringifySelectorParts };
|
|
30
|
+
export { stringifySelectorParts };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { splitSelectorToParts } from "./part/split.js";
|
|
2
2
|
import { stringifySelectorSubParts } from "./sub/stringify.js";
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* Split comma separated selectors into parts, group by compatibility so later can be merged
|
|
6
5
|
*/
|
|
@@ -25,5 +24,4 @@ function splitSelectorsForState(selectors) {
|
|
|
25
24
|
}
|
|
26
25
|
return groups;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
export { splitSelectorsForState };
|
|
27
|
+
export { splitSelectorsForState };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { stringifySelectorParts } from "./part/stringify.js";
|
|
2
|
-
|
|
3
2
|
function joinSequence(parts) {
|
|
4
3
|
let selectors = [];
|
|
5
4
|
for (const part of parts) {
|
|
@@ -139,5 +138,4 @@ function stringifySelectorsForState(data) {
|
|
|
139
138
|
sequences.sort((a, b) => a.length - b.length);
|
|
140
139
|
return optimise(sequences);
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
export { stringifySelectorsForState };
|
|
141
|
+
export { stringifySelectorsForState };
|
|
@@ -13,5 +13,4 @@ function stringifySelectorSubParts(selector, isSVG = false) {
|
|
|
13
13
|
if (isSVG) return full ? `${combinator}svg${full}` : combinator.trim();
|
|
14
14
|
return `${combinator}${pseudo && full === pseudo ? "*" : ""}${full}`;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
export { stringifySelectorSubParts };
|
|
16
|
+
export { stringifySelectorSubParts };
|
|
@@ -31,6 +31,7 @@ type StatefulIconSelectorsConfig = Record<string, string | StateSelectorData | R
|
|
|
31
31
|
interface StatefulIconSelectorsContext {
|
|
32
32
|
config: StatefulIconSelectorsConfig;
|
|
33
33
|
states: IconStatesList;
|
|
34
|
+
staticClassname?: string;
|
|
34
35
|
data: Record<string, StateSelectorData | null>;
|
|
35
36
|
parsed: Record<string, string[][] | null>;
|
|
36
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -11,5 +11,4 @@ function getStateValue(state, value) {
|
|
|
11
11
|
if (typeof state === "string") return !!value && value !== "false" && value !== "0";
|
|
12
12
|
return typeof value !== "string" || !state[1].includes(value) ? getAdvancedStateDefaultValue(state) : value;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
export { getAdvancedStateDefaultValue, getStateValue };
|
|
14
|
+
export { getAdvancedStateDefaultValue, getStateValue };
|
package/lib/svg-css/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/lib/xml/iterate.js
CHANGED
package/lib/xml/parse.js
CHANGED
package/lib/xml/stringify.js
CHANGED
package/lib/xml/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Common functions for working with SVG used by various packages.",
|
|
5
5
|
"author": "Vjacheslav Trushkin",
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.8",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": "https://github.com/cyberalien/svg-utils/issues",
|
|
9
9
|
"homepage": "https://cyberalien.dev/",
|
|
@@ -23,21 +23,16 @@
|
|
|
23
23
|
"@iconify/types": "^2.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@eslint/eslintrc": "^3.3.4",
|
|
27
|
-
"@eslint/js": "^9.39.3",
|
|
28
26
|
"@iconify-json/ri": "^1.2.10",
|
|
29
27
|
"@types/jest": "^30.0.0",
|
|
30
|
-
"@types/node": "^25.
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"eslint": "^9.39.3",
|
|
34
|
-
"globals": "^17.4.0",
|
|
35
|
-
"tsdown": "^0.20.3",
|
|
28
|
+
"@types/node": "^25.5.0",
|
|
29
|
+
"oxlint": "^1.56.0",
|
|
30
|
+
"tsdown": "^0.21.4",
|
|
36
31
|
"typescript": "^5.9.3",
|
|
37
|
-
"vitest": "^4.0
|
|
32
|
+
"vitest": "^4.1.0"
|
|
38
33
|
},
|
|
39
34
|
"scripts": {
|
|
40
|
-
"lint": "
|
|
35
|
+
"lint": "oxlint --fix src/**/*.ts && tsc --noemit",
|
|
41
36
|
"prebuild": "pnpm run lint",
|
|
42
37
|
"build": "tsdown",
|
|
43
38
|
"test": "vitest"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IconStatesList, IconStatesState } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Check for focus state
|
|
4
|
-
*/
|
|
5
|
-
declare function isFocusState(state: IconStatesState | string): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Filter out focus state from states list
|
|
8
|
-
*/
|
|
9
|
-
declare function filterFocusState(states: IconStatesList): IconStatesList;
|
|
10
|
-
export { filterFocusState, isFocusState };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check for focus state
|
|
3
|
-
*/
|
|
4
|
-
function isFocusState(state) {
|
|
5
|
-
return state === "focus";
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Filter out focus state from states list
|
|
9
|
-
*/
|
|
10
|
-
function filterFocusState(states) {
|
|
11
|
-
return states.filter((state) => !isFocusState(state));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { filterFocusState, isFocusState };
|
|
File without changes
|