@cyberalien/svg-utils 1.0.6 → 1.0.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/components/svelte.js
CHANGED
|
@@ -19,8 +19,12 @@ function createSvelteComponent(data, options) {
|
|
|
19
19
|
const useTS = options.ts ?? false;
|
|
20
20
|
const assets = [];
|
|
21
21
|
const imports = createFactoryImports();
|
|
22
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
22
23
|
const hasFallback = !!data.fallback;
|
|
23
|
-
if (hasFallback)
|
|
24
|
+
if (hasFallback) {
|
|
25
|
+
imports.default["@iconify/css-svelte"] = "Icon";
|
|
26
|
+
dependencies.add("@iconify/css-svelte");
|
|
27
|
+
}
|
|
24
28
|
const styleContent = generateCSSFilesForComponent(data.icon, imports, assets, {
|
|
25
29
|
...options,
|
|
26
30
|
componentType: "svelte"
|
|
@@ -99,7 +103,8 @@ ${template}
|
|
|
99
103
|
assets,
|
|
100
104
|
content,
|
|
101
105
|
style,
|
|
102
|
-
types
|
|
106
|
+
types,
|
|
107
|
+
dependencies: dependencies.size ? dependencies : void 0
|
|
103
108
|
};
|
|
104
109
|
}
|
|
105
110
|
|
|
@@ -18,8 +18,12 @@ import { stringifyFactoryPropsAsJSON } from "./helpers/props/object.js";
|
|
|
18
18
|
function createVueFunctionalComponent(data, options) {
|
|
19
19
|
const assets = [];
|
|
20
20
|
const imports = createFactoryImports();
|
|
21
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
21
22
|
const hasFallback = !!data.fallback;
|
|
22
|
-
if (hasFallback)
|
|
23
|
+
if (hasFallback) {
|
|
24
|
+
imports.named["@iconify/css-vue"] = new Set(["Icon"]);
|
|
25
|
+
dependencies.add("@iconify/css-vue");
|
|
26
|
+
}
|
|
23
27
|
const vueNamedImports = new Set(["defineComponent", "h"]);
|
|
24
28
|
imports.named["vue"] = vueNamedImports;
|
|
25
29
|
const style = generateCSSFilesForComponent(data.icon, imports, assets, options);
|
|
@@ -94,7 +98,8 @@ function createVueFunctionalComponent(data, options) {
|
|
|
94
98
|
assets,
|
|
95
99
|
content: `${stringifyFactoryImports(imports)}\n${componentFunction}\nexport default Component;\n`,
|
|
96
100
|
style: isEmbeddedCSS ? void 0 : style,
|
|
97
|
-
types
|
|
101
|
+
types,
|
|
102
|
+
dependencies: dependencies.size ? dependencies : void 0
|
|
98
103
|
};
|
|
99
104
|
}
|
|
100
105
|
|
package/lib/components/vue.js
CHANGED
|
@@ -19,8 +19,12 @@ function createVueComponent(data, options) {
|
|
|
19
19
|
const useTS = options.ts ?? false;
|
|
20
20
|
const assets = [];
|
|
21
21
|
const imports = createFactoryImports();
|
|
22
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
22
23
|
const hasFallback = !!data.fallback;
|
|
23
|
-
if (hasFallback)
|
|
24
|
+
if (hasFallback) {
|
|
25
|
+
imports.named["@iconify/css-vue"] = new Set(["Icon"]);
|
|
26
|
+
dependencies.add("@iconify/css-vue");
|
|
27
|
+
}
|
|
24
28
|
const vueNamedImports = /* @__PURE__ */ new Set();
|
|
25
29
|
imports.named["vue"] = vueNamedImports;
|
|
26
30
|
const styleContent = generateCSSFilesForComponent(data.icon, imports, assets, options);
|
|
@@ -98,7 +102,8 @@ ${template}
|
|
|
98
102
|
assets,
|
|
99
103
|
content,
|
|
100
104
|
style,
|
|
101
|
-
types
|
|
105
|
+
types,
|
|
106
|
+
dependencies: dependencies.size ? dependencies : void 0
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
109
|
|
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.0.
|
|
6
|
+
"version": "1.0.7",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": "https://github.com/cyberalien/svg-utils/issues",
|
|
9
9
|
"homepage": "https://cyberalien.dev/",
|