@pikacss/plugin-icons 0.0.29 → 0.0.31

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/dist/index.cjs CHANGED
@@ -1,155 +1,117 @@
1
- 'use strict';
2
-
3
- const utils = require('@iconify/utils');
4
- const core = require('@pikacss/core');
5
- const presetIcons = require('@unocss/preset-icons');
6
- const ofetch = require('ofetch');
1
+ let __iconify_utils = require("@iconify/utils");
2
+ let __pikacss_core = require("@pikacss/core");
3
+ let __unocss_preset_icons = require("@unocss/preset-icons");
4
+ let ofetch = require("ofetch");
7
5
 
6
+ //#region src/index.ts
8
7
  function icons() {
9
- return createIconsPlugin(createIconsLoader);
8
+ return createIconsPlugin(createIconsLoader);
10
9
  }
11
10
  function createCDNLoader(cdnBase) {
12
- return presetIcons.createCDNFetchLoader(ofetch.$fetch, cdnBase);
11
+ return (0, __unocss_preset_icons.createCDNFetchLoader)(ofetch.$fetch, cdnBase);
13
12
  }
14
13
  async function createIconsLoader(config) {
15
- const {
16
- cdn
17
- } = config;
18
- const loaders = [];
19
- const {
20
- isNode,
21
- isVSCode,
22
- isESLint
23
- } = presetIcons.getEnvFlags();
24
- if (isNode && !isVSCode && !isESLint) {
25
- const nodeLoader = await presetIcons.createNodeLoader();
26
- if (nodeLoader != null)
27
- loaders.push(nodeLoader);
28
- }
29
- if (cdn)
30
- loaders.push(createCDNLoader(cdn));
31
- loaders.push(utils.loadIcon);
32
- return presetIcons.combineLoaders(loaders);
14
+ const { cdn } = config;
15
+ const loaders = [];
16
+ const { isNode, isVSCode, isESLint } = (0, __unocss_preset_icons.getEnvFlags)();
17
+ if (isNode && !isVSCode && !isESLint) {
18
+ const nodeLoader = await (0, __unocss_preset_icons.createNodeLoader)();
19
+ if (nodeLoader != null) loaders.push(nodeLoader);
20
+ }
21
+ if (cdn) loaders.push(createCDNLoader(cdn));
22
+ loaders.push(__iconify_utils.loadIcon);
23
+ return (0, __unocss_preset_icons.combineLoaders)(loaders);
33
24
  }
34
25
  const globalColonRE = /:/g;
35
26
  function createIconsPlugin(lookupIconLoader) {
36
- let engine;
37
- let iconsConfig;
38
- return core.defineEnginePlugin({
39
- name: "icons",
40
- configureRawConfig: async (config) => {
41
- iconsConfig = config.icons || {};
42
- },
43
- configureEngine: async (_engine) => {
44
- engine = _engine;
45
- const {
46
- scale = 1,
47
- mode = "auto",
48
- prefix = "i-",
49
- iconifyCollectionsNames,
50
- collections: customCollections,
51
- customizations = {},
52
- autoInstall = false,
53
- collectionsNodeResolvePath,
54
- unit,
55
- extraProperties = {},
56
- processor,
57
- autocomplete: _autocomplete
58
- } = iconsConfig;
59
- const loaderOptions = {
60
- addXmlNs: true,
61
- scale,
62
- customCollections,
63
- autoInstall,
64
- cwd: collectionsNodeResolvePath,
65
- // avoid warn from @iconify/loader: we'll warn below if not found
66
- warn: void 0,
67
- customizations: {
68
- ...customizations,
69
- additionalProps: { ...extraProperties },
70
- trimCustomSvg: true,
71
- async iconCustomizer(collection, icon, props) {
72
- await customizations.iconCustomizer?.(collection, icon, props);
73
- if (unit) {
74
- if (!props.width)
75
- props.width = `${scale}${unit}`;
76
- if (!props.height)
77
- props.height = `${scale}${unit}`;
78
- }
79
- }
80
- }
81
- };
82
- const prefixRE = new RegExp(`^(${[prefix].flat().join("|")})`);
83
- const autocompletePrefix = [prefix].flat();
84
- const autocomplete = [
85
- ...autocompletePrefix,
86
- ...autocompletePrefix.flatMap((p) => _autocomplete?.map((a) => `${p}${a.replace(prefixRE, "")}`) || [])
87
- ];
88
- let iconLoader;
89
- engine.shortcuts.add({
90
- shortcut: new RegExp(`^(?:${[prefix].flat().join("|")})([\\w:-]+)(?:\\?(mask|bg|auto))?$`),
91
- value: async (match) => {
92
- let [full, body, _mode = mode] = match;
93
- iconLoader = iconLoader || await lookupIconLoader(iconsConfig);
94
- const usedProps = {};
95
- const parsed = await presetIcons.parseIconWithLoader(
96
- body,
97
- iconLoader,
98
- { ...loaderOptions, usedProps },
99
- iconifyCollectionsNames
100
- );
101
- if (parsed == null) {
102
- core.warn(`failed to load icon "${full}"`);
103
- return {};
104
- }
105
- const url = `url("data:image/svg+xml;utf8,${utils.encodeSvgForCss(parsed.svg)}")`;
106
- const varName = `--${engine.config.prefix}svg-icon-${body.replace(globalColonRE, "-")}`;
107
- if (engine.variables.store.has(varName) === false) {
108
- engine.variables.add({
109
- [varName]: {
110
- value: url,
111
- autocomplete: { asValueOf: "-", asProperty: false },
112
- pruneUnused: true
113
- }
114
- });
115
- }
116
- if (_mode === "auto")
117
- _mode = parsed.svg.includes("currentColor") ? "mask" : "bg";
118
- let styleItem;
119
- if (_mode === "mask") {
120
- styleItem = {
121
- "--svg-icon": `var(${varName})`,
122
- "-webkit-mask": "var(--svg-icon) no-repeat",
123
- "mask": "var(--svg-icon) no-repeat",
124
- "-webkit-mask-size": "100% 100%",
125
- "mask-size": "100% 100%",
126
- "background-color": "currentColor",
127
- // for Safari https://github.com/elk-zone/elk/pull/264
128
- "color": "inherit",
129
- ...usedProps
130
- };
131
- } else {
132
- styleItem = {
133
- "--svg-icon": `var(${varName})`,
134
- "background": "var(--svg-icon) no-repeat",
135
- "background-size": "100% 100%",
136
- "background-color": "transparent",
137
- ...usedProps
138
- };
139
- }
140
- processor?.(
141
- styleItem,
142
- {
143
- ...parsed,
144
- mode: _mode
145
- }
146
- );
147
- return styleItem;
148
- },
149
- autocomplete
150
- });
151
- }
152
- });
27
+ let engine;
28
+ let iconsConfig;
29
+ return (0, __pikacss_core.defineEnginePlugin)({
30
+ name: "icons",
31
+ configureRawConfig: async (config) => {
32
+ iconsConfig = config.icons || {};
33
+ },
34
+ configureEngine: async (_engine) => {
35
+ engine = _engine;
36
+ const { scale = 1, mode = "auto", prefix = "i-", iconifyCollectionsNames, collections: customCollections, customizations = {}, autoInstall = false, collectionsNodeResolvePath, unit, extraProperties = {}, processor, autocomplete: _autocomplete } = iconsConfig;
37
+ const loaderOptions = {
38
+ addXmlNs: true,
39
+ scale,
40
+ customCollections,
41
+ autoInstall,
42
+ cwd: collectionsNodeResolvePath,
43
+ warn: void 0,
44
+ customizations: {
45
+ ...customizations,
46
+ additionalProps: { ...extraProperties },
47
+ trimCustomSvg: true,
48
+ async iconCustomizer(collection, icon, props) {
49
+ await customizations.iconCustomizer?.(collection, icon, props);
50
+ if (unit) {
51
+ if (!props.width) props.width = `${scale}${unit}`;
52
+ if (!props.height) props.height = `${scale}${unit}`;
53
+ }
54
+ }
55
+ }
56
+ };
57
+ const prefixRE = /* @__PURE__ */ new RegExp(`^(${[prefix].flat().join("|")})`);
58
+ const autocompletePrefix = [prefix].flat();
59
+ const autocomplete = [...autocompletePrefix, ...autocompletePrefix.flatMap((p) => _autocomplete?.map((a) => `${p}${a.replace(prefixRE, "")}`) || [])];
60
+ let iconLoader;
61
+ engine.shortcuts.add({
62
+ shortcut: /* @__PURE__ */ new RegExp(`^(?:${[prefix].flat().join("|")})([\\w:-]+)(?:\\?(mask|bg|auto))?$`),
63
+ value: async (match) => {
64
+ let [full, body, _mode = mode] = match;
65
+ iconLoader = iconLoader || await lookupIconLoader(iconsConfig);
66
+ const usedProps = {};
67
+ const parsed = await (0, __unocss_preset_icons.parseIconWithLoader)(body, iconLoader, {
68
+ ...loaderOptions,
69
+ usedProps
70
+ }, iconifyCollectionsNames);
71
+ if (parsed == null) {
72
+ (0, __pikacss_core.warn)(`failed to load icon "${full}"`);
73
+ return {};
74
+ }
75
+ const url = `url("data:image/svg+xml;utf8,${(0, __iconify_utils.encodeSvgForCss)(parsed.svg)}")`;
76
+ const varName = `--${engine.config.prefix}svg-icon-${body.replace(globalColonRE, "-")}`;
77
+ if (engine.variables.store.has(varName) === false) engine.variables.add({ [varName]: {
78
+ value: url,
79
+ autocomplete: {
80
+ asValueOf: "-",
81
+ asProperty: false
82
+ },
83
+ pruneUnused: true
84
+ } });
85
+ if (_mode === "auto") _mode = parsed.svg.includes("currentColor") ? "mask" : "bg";
86
+ let styleItem;
87
+ if (_mode === "mask") styleItem = {
88
+ "--svg-icon": `var(${varName})`,
89
+ "-webkit-mask": "var(--svg-icon) no-repeat",
90
+ "mask": "var(--svg-icon) no-repeat",
91
+ "-webkit-mask-size": "100% 100%",
92
+ "mask-size": "100% 100%",
93
+ "background-color": "currentColor",
94
+ "color": "inherit",
95
+ ...usedProps
96
+ };
97
+ else styleItem = {
98
+ "--svg-icon": `var(${varName})`,
99
+ "background": "var(--svg-icon) no-repeat",
100
+ "background-size": "100% 100%",
101
+ "background-color": "transparent",
102
+ ...usedProps
103
+ };
104
+ processor?.(styleItem, {
105
+ ...parsed,
106
+ mode: _mode
107
+ });
108
+ return styleItem;
109
+ },
110
+ autocomplete
111
+ });
112
+ }
113
+ });
153
114
  }
154
115
 
155
- exports.icons = icons;
116
+ //#endregion
117
+ exports.icons = icons;
package/dist/index.d.cts CHANGED
@@ -1,27 +1,28 @@
1
- import { Simplify, StyleItem, EnginePlugin } from '@pikacss/core';
2
- import { IconsOptions } from '@unocss/preset-icons';
1
+ import { EnginePlugin, Simplify, StyleItem } from "@pikacss/core";
2
+ import { IconsOptions } from "@unocss/preset-icons";
3
3
 
4
+ //#region src/index.d.ts
4
5
  interface IconMeta {
5
- collection: string;
6
- name: string;
7
- svg: string;
8
- mode?: IconsConfig['mode'];
6
+ collection: string;
7
+ name: string;
8
+ svg: string;
9
+ mode?: IconsConfig['mode'];
9
10
  }
10
11
  type IconsConfig = Simplify<Omit<IconsOptions, 'warn' | 'layer' | 'processor' | 'customFetcher'> & {
11
- /**
12
- * Processor for the CSS object before stringify
13
- */
14
- processor?: (styleItem: StyleItem, meta: Required<IconMeta>) => void;
15
- /**
16
- * Specify the icons for auto-completion.
17
- */
18
- autocomplete?: string[];
12
+ /**
13
+ * Processor for the CSS object before stringify
14
+ */
15
+ processor?: (styleItem: StyleItem, meta: Required<IconMeta>) => void;
16
+ /**
17
+ * Specify the icons for auto-completion.
18
+ */
19
+ autocomplete?: string[];
19
20
  }>;
20
21
  declare module '@pikacss/core' {
21
- interface EngineConfig {
22
- icons?: IconsConfig;
23
- }
22
+ interface EngineConfig {
23
+ icons?: IconsConfig;
24
+ }
24
25
  }
25
26
  declare function icons(): EnginePlugin;
26
-
27
- export { type IconsConfig, icons };
27
+ //#endregion
28
+ export { IconsConfig, icons };
package/dist/index.d.mts CHANGED
@@ -1,27 +1,28 @@
1
- import { Simplify, StyleItem, EnginePlugin } from '@pikacss/core';
2
- import { IconsOptions } from '@unocss/preset-icons';
1
+ import { EnginePlugin, Simplify, StyleItem } from "@pikacss/core";
2
+ import { IconsOptions } from "@unocss/preset-icons";
3
3
 
4
+ //#region src/index.d.ts
4
5
  interface IconMeta {
5
- collection: string;
6
- name: string;
7
- svg: string;
8
- mode?: IconsConfig['mode'];
6
+ collection: string;
7
+ name: string;
8
+ svg: string;
9
+ mode?: IconsConfig['mode'];
9
10
  }
10
11
  type IconsConfig = Simplify<Omit<IconsOptions, 'warn' | 'layer' | 'processor' | 'customFetcher'> & {
11
- /**
12
- * Processor for the CSS object before stringify
13
- */
14
- processor?: (styleItem: StyleItem, meta: Required<IconMeta>) => void;
15
- /**
16
- * Specify the icons for auto-completion.
17
- */
18
- autocomplete?: string[];
12
+ /**
13
+ * Processor for the CSS object before stringify
14
+ */
15
+ processor?: (styleItem: StyleItem, meta: Required<IconMeta>) => void;
16
+ /**
17
+ * Specify the icons for auto-completion.
18
+ */
19
+ autocomplete?: string[];
19
20
  }>;
20
21
  declare module '@pikacss/core' {
21
- interface EngineConfig {
22
- icons?: IconsConfig;
23
- }
22
+ interface EngineConfig {
23
+ icons?: IconsConfig;
24
+ }
24
25
  }
25
26
  declare function icons(): EnginePlugin;
26
-
27
- export { type IconsConfig, icons };
27
+ //#endregion
28
+ export { IconsConfig, icons };
package/dist/index.mjs CHANGED
@@ -1,153 +1,117 @@
1
- import { encodeSvgForCss, loadIcon } from '@iconify/utils';
2
- import { defineEnginePlugin, warn } from '@pikacss/core';
3
- import { parseIconWithLoader, getEnvFlags, createNodeLoader, combineLoaders, createCDNFetchLoader } from '@unocss/preset-icons';
4
- import { $fetch } from 'ofetch';
1
+ import { encodeSvgForCss, loadIcon } from "@iconify/utils";
2
+ import { defineEnginePlugin, warn } from "@pikacss/core";
3
+ import { combineLoaders, createCDNFetchLoader, createNodeLoader, getEnvFlags, parseIconWithLoader } from "@unocss/preset-icons";
4
+ import { $fetch } from "ofetch";
5
5
 
6
+ //#region src/index.ts
6
7
  function icons() {
7
- return createIconsPlugin(createIconsLoader);
8
+ return createIconsPlugin(createIconsLoader);
8
9
  }
9
10
  function createCDNLoader(cdnBase) {
10
- return createCDNFetchLoader($fetch, cdnBase);
11
+ return createCDNFetchLoader($fetch, cdnBase);
11
12
  }
12
13
  async function createIconsLoader(config) {
13
- const {
14
- cdn
15
- } = config;
16
- const loaders = [];
17
- const {
18
- isNode,
19
- isVSCode,
20
- isESLint
21
- } = getEnvFlags();
22
- if (isNode && !isVSCode && !isESLint) {
23
- const nodeLoader = await createNodeLoader();
24
- if (nodeLoader != null)
25
- loaders.push(nodeLoader);
26
- }
27
- if (cdn)
28
- loaders.push(createCDNLoader(cdn));
29
- loaders.push(loadIcon);
30
- return combineLoaders(loaders);
14
+ const { cdn } = config;
15
+ const loaders = [];
16
+ const { isNode, isVSCode, isESLint } = getEnvFlags();
17
+ if (isNode && !isVSCode && !isESLint) {
18
+ const nodeLoader = await createNodeLoader();
19
+ if (nodeLoader != null) loaders.push(nodeLoader);
20
+ }
21
+ if (cdn) loaders.push(createCDNLoader(cdn));
22
+ loaders.push(loadIcon);
23
+ return combineLoaders(loaders);
31
24
  }
32
25
  const globalColonRE = /:/g;
33
26
  function createIconsPlugin(lookupIconLoader) {
34
- let engine;
35
- let iconsConfig;
36
- return defineEnginePlugin({
37
- name: "icons",
38
- configureRawConfig: async (config) => {
39
- iconsConfig = config.icons || {};
40
- },
41
- configureEngine: async (_engine) => {
42
- engine = _engine;
43
- const {
44
- scale = 1,
45
- mode = "auto",
46
- prefix = "i-",
47
- iconifyCollectionsNames,
48
- collections: customCollections,
49
- customizations = {},
50
- autoInstall = false,
51
- collectionsNodeResolvePath,
52
- unit,
53
- extraProperties = {},
54
- processor,
55
- autocomplete: _autocomplete
56
- } = iconsConfig;
57
- const loaderOptions = {
58
- addXmlNs: true,
59
- scale,
60
- customCollections,
61
- autoInstall,
62
- cwd: collectionsNodeResolvePath,
63
- // avoid warn from @iconify/loader: we'll warn below if not found
64
- warn: void 0,
65
- customizations: {
66
- ...customizations,
67
- additionalProps: { ...extraProperties },
68
- trimCustomSvg: true,
69
- async iconCustomizer(collection, icon, props) {
70
- await customizations.iconCustomizer?.(collection, icon, props);
71
- if (unit) {
72
- if (!props.width)
73
- props.width = `${scale}${unit}`;
74
- if (!props.height)
75
- props.height = `${scale}${unit}`;
76
- }
77
- }
78
- }
79
- };
80
- const prefixRE = new RegExp(`^(${[prefix].flat().join("|")})`);
81
- const autocompletePrefix = [prefix].flat();
82
- const autocomplete = [
83
- ...autocompletePrefix,
84
- ...autocompletePrefix.flatMap((p) => _autocomplete?.map((a) => `${p}${a.replace(prefixRE, "")}`) || [])
85
- ];
86
- let iconLoader;
87
- engine.shortcuts.add({
88
- shortcut: new RegExp(`^(?:${[prefix].flat().join("|")})([\\w:-]+)(?:\\?(mask|bg|auto))?$`),
89
- value: async (match) => {
90
- let [full, body, _mode = mode] = match;
91
- iconLoader = iconLoader || await lookupIconLoader(iconsConfig);
92
- const usedProps = {};
93
- const parsed = await parseIconWithLoader(
94
- body,
95
- iconLoader,
96
- { ...loaderOptions, usedProps },
97
- iconifyCollectionsNames
98
- );
99
- if (parsed == null) {
100
- warn(`failed to load icon "${full}"`);
101
- return {};
102
- }
103
- const url = `url("data:image/svg+xml;utf8,${encodeSvgForCss(parsed.svg)}")`;
104
- const varName = `--${engine.config.prefix}svg-icon-${body.replace(globalColonRE, "-")}`;
105
- if (engine.variables.store.has(varName) === false) {
106
- engine.variables.add({
107
- [varName]: {
108
- value: url,
109
- autocomplete: { asValueOf: "-", asProperty: false },
110
- pruneUnused: true
111
- }
112
- });
113
- }
114
- if (_mode === "auto")
115
- _mode = parsed.svg.includes("currentColor") ? "mask" : "bg";
116
- let styleItem;
117
- if (_mode === "mask") {
118
- styleItem = {
119
- "--svg-icon": `var(${varName})`,
120
- "-webkit-mask": "var(--svg-icon) no-repeat",
121
- "mask": "var(--svg-icon) no-repeat",
122
- "-webkit-mask-size": "100% 100%",
123
- "mask-size": "100% 100%",
124
- "background-color": "currentColor",
125
- // for Safari https://github.com/elk-zone/elk/pull/264
126
- "color": "inherit",
127
- ...usedProps
128
- };
129
- } else {
130
- styleItem = {
131
- "--svg-icon": `var(${varName})`,
132
- "background": "var(--svg-icon) no-repeat",
133
- "background-size": "100% 100%",
134
- "background-color": "transparent",
135
- ...usedProps
136
- };
137
- }
138
- processor?.(
139
- styleItem,
140
- {
141
- ...parsed,
142
- mode: _mode
143
- }
144
- );
145
- return styleItem;
146
- },
147
- autocomplete
148
- });
149
- }
150
- });
27
+ let engine;
28
+ let iconsConfig;
29
+ return defineEnginePlugin({
30
+ name: "icons",
31
+ configureRawConfig: async (config) => {
32
+ iconsConfig = config.icons || {};
33
+ },
34
+ configureEngine: async (_engine) => {
35
+ engine = _engine;
36
+ const { scale = 1, mode = "auto", prefix = "i-", iconifyCollectionsNames, collections: customCollections, customizations = {}, autoInstall = false, collectionsNodeResolvePath, unit, extraProperties = {}, processor, autocomplete: _autocomplete } = iconsConfig;
37
+ const loaderOptions = {
38
+ addXmlNs: true,
39
+ scale,
40
+ customCollections,
41
+ autoInstall,
42
+ cwd: collectionsNodeResolvePath,
43
+ warn: void 0,
44
+ customizations: {
45
+ ...customizations,
46
+ additionalProps: { ...extraProperties },
47
+ trimCustomSvg: true,
48
+ async iconCustomizer(collection, icon, props) {
49
+ await customizations.iconCustomizer?.(collection, icon, props);
50
+ if (unit) {
51
+ if (!props.width) props.width = `${scale}${unit}`;
52
+ if (!props.height) props.height = `${scale}${unit}`;
53
+ }
54
+ }
55
+ }
56
+ };
57
+ const prefixRE = /* @__PURE__ */ new RegExp(`^(${[prefix].flat().join("|")})`);
58
+ const autocompletePrefix = [prefix].flat();
59
+ const autocomplete = [...autocompletePrefix, ...autocompletePrefix.flatMap((p) => _autocomplete?.map((a) => `${p}${a.replace(prefixRE, "")}`) || [])];
60
+ let iconLoader;
61
+ engine.shortcuts.add({
62
+ shortcut: /* @__PURE__ */ new RegExp(`^(?:${[prefix].flat().join("|")})([\\w:-]+)(?:\\?(mask|bg|auto))?$`),
63
+ value: async (match) => {
64
+ let [full, body, _mode = mode] = match;
65
+ iconLoader = iconLoader || await lookupIconLoader(iconsConfig);
66
+ const usedProps = {};
67
+ const parsed = await parseIconWithLoader(body, iconLoader, {
68
+ ...loaderOptions,
69
+ usedProps
70
+ }, iconifyCollectionsNames);
71
+ if (parsed == null) {
72
+ warn(`failed to load icon "${full}"`);
73
+ return {};
74
+ }
75
+ const url = `url("data:image/svg+xml;utf8,${encodeSvgForCss(parsed.svg)}")`;
76
+ const varName = `--${engine.config.prefix}svg-icon-${body.replace(globalColonRE, "-")}`;
77
+ if (engine.variables.store.has(varName) === false) engine.variables.add({ [varName]: {
78
+ value: url,
79
+ autocomplete: {
80
+ asValueOf: "-",
81
+ asProperty: false
82
+ },
83
+ pruneUnused: true
84
+ } });
85
+ if (_mode === "auto") _mode = parsed.svg.includes("currentColor") ? "mask" : "bg";
86
+ let styleItem;
87
+ if (_mode === "mask") styleItem = {
88
+ "--svg-icon": `var(${varName})`,
89
+ "-webkit-mask": "var(--svg-icon) no-repeat",
90
+ "mask": "var(--svg-icon) no-repeat",
91
+ "-webkit-mask-size": "100% 100%",
92
+ "mask-size": "100% 100%",
93
+ "background-color": "currentColor",
94
+ "color": "inherit",
95
+ ...usedProps
96
+ };
97
+ else styleItem = {
98
+ "--svg-icon": `var(${varName})`,
99
+ "background": "var(--svg-icon) no-repeat",
100
+ "background-size": "100% 100%",
101
+ "background-color": "transparent",
102
+ ...usedProps
103
+ };
104
+ processor?.(styleItem, {
105
+ ...parsed,
106
+ mode: _mode
107
+ });
108
+ return styleItem;
109
+ },
110
+ autocomplete
111
+ });
112
+ }
113
+ });
151
114
  }
152
115
 
153
- export { icons };
116
+ //#endregion
117
+ export { icons };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.29",
7
+ "version": "0.0.31",
8
8
  "author": "DevilTea <ch19980814@gmail.com>",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -30,19 +30,18 @@
30
30
  },
31
31
  "main": "dist/index.cjs",
32
32
  "module": "dist/index.mjs",
33
- "types": "dist/index.d.ts",
33
+ "types": "dist/index.d.mts",
34
34
  "files": [
35
35
  "dist"
36
36
  ],
37
37
  "dependencies": {
38
38
  "@iconify/utils": "^2.3.0",
39
39
  "@unocss/preset-icons": "^65.4.3",
40
- "ofetch": "^1.4.1",
41
- "@pikacss/core": "0.0.29"
40
+ "ofetch": "^1.5.1",
41
+ "@pikacss/core": "0.0.31"
42
42
  },
43
43
  "scripts": {
44
- "build": "unbuild",
45
- "stub": "unbuild --stub",
44
+ "build": "tsdown",
46
45
  "typecheck": "pnpm typecheck:package && pnpm typecheck:test",
47
46
  "typecheck:package": "tsc --project ./tsconfig.package.json --noEmit",
48
47
  "typecheck:test": "tsc --project ./tsconfig.tests.json --noEmit",
package/dist/index.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import { Simplify, StyleItem, EnginePlugin } from '@pikacss/core';
2
- import { IconsOptions } from '@unocss/preset-icons';
3
-
4
- interface IconMeta {
5
- collection: string;
6
- name: string;
7
- svg: string;
8
- mode?: IconsConfig['mode'];
9
- }
10
- type IconsConfig = Simplify<Omit<IconsOptions, 'warn' | 'layer' | 'processor' | 'customFetcher'> & {
11
- /**
12
- * Processor for the CSS object before stringify
13
- */
14
- processor?: (styleItem: StyleItem, meta: Required<IconMeta>) => void;
15
- /**
16
- * Specify the icons for auto-completion.
17
- */
18
- autocomplete?: string[];
19
- }>;
20
- declare module '@pikacss/core' {
21
- interface EngineConfig {
22
- icons?: IconsConfig;
23
- }
24
- }
25
- declare function icons(): EnginePlugin;
26
-
27
- export { type IconsConfig, icons };