@yh-ui/icons 1.0.53 → 1.0.54

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.
Files changed (2) hide show
  1. package/dist/iconify.mjs +38 -29
  2. package/package.json +1 -1
package/dist/iconify.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { Icon as u, getIcon as p, loadIcon as l, addAPIProvider as y } from "@iconify/vue";
1
+ import { Icon as p, getIcon as d, loadIcon as u, addAPIProvider as l } from "@iconify/vue";
2
2
  import { h } from "vue";
3
3
  try {
4
- y("", {
4
+ l("", {
5
5
  resources: ["https://api.iconify.design", "https://api.simplesvg.com"],
6
6
  rotate: 1e3,
7
7
  timeout: 3e3
8
8
  });
9
9
  } catch {
10
10
  }
11
- const a = "yh-icon-spin-style", m = `
11
+ const f = "yh-icon-spin-style", m = `
12
12
  @keyframes yh-icon-spin {
13
13
  from { transform: rotate(0deg); }
14
14
  to { transform: rotate(360deg); }
@@ -18,53 +18,62 @@ const a = "yh-icon-spin-style", m = `
18
18
  }
19
19
  `;
20
20
  function g() {
21
- if (typeof document > "u" || document.getElementById(a)) return;
21
+ if (typeof document > "u" || document.getElementById(f)) return;
22
22
  const t = document.createElement("style");
23
- t.id = a, t.textContent = m, document.head.appendChild(t);
23
+ t.id = f, t.textContent = m, document.head.appendChild(t);
24
24
  }
25
25
  function I(t) {
26
- const { icon: n, size: e, color: r, spin: f, rotate: s } = t, o = {}, i = [];
27
- if (e) {
28
- const c = typeof e == "number" ? `${e}px` : e;
29
- o.width = c, o.height = c, o.fontSize = c;
26
+ const { icon: e, size: o, color: n, spin: i, rotate: a } = t, r = {}, s = [];
27
+ if (o) {
28
+ const c = typeof o == "number" ? `${o}px` : o;
29
+ r.width = c, r.height = c, r.fontSize = c;
30
30
  }
31
- return r && (o.color = r), s && (o.transform = `rotate(${s}deg)`), f && (g(), i.push("yh-icons--spin")), {
32
- icon: n,
33
- class: i.length > 0 ? i.join(" ") : void 0,
34
- style: Object.keys(o).length > 0 ? o : void 0
31
+ return n && (r.color = n), a && (r.transform = `rotate(${a}deg)`), i && (g(), s.push("yh-icons--spin")), {
32
+ icon: e,
33
+ class: s.length > 0 ? s.join(" ") : void 0,
34
+ style: Object.keys(r).length > 0 ? r : void 0
35
35
  };
36
36
  }
37
- function w() {
37
+ function S() {
38
38
  return (t) => {
39
- const n = I(t);
40
- return h(u, n);
39
+ const e = I(t);
40
+ return h(p, e);
41
41
  };
42
42
  }
43
- function d(t) {
43
+ function y(t) {
44
44
  return t.includes(":") ? t : t.includes("/") ? t.replace("/", ":") : `mdi:${t}`;
45
45
  }
46
- async function E(t) {
46
+ async function v(t) {
47
+ if (typeof t != "string" || !t.trim())
48
+ return !1;
47
49
  try {
48
- return !!d(t);
50
+ const e = y(t);
51
+ if (!/^[a-z0-9-]+:[a-z0-9-_]+$/i.test(e))
52
+ return !1;
53
+ const n = d(e);
54
+ if (n && n.body && typeof n.body == "string" && n.body.trim().length > 0)
55
+ return !0;
56
+ const i = await u(e);
57
+ return !!(i && i.body && typeof i.body == "string" && i.body.trim().length > 0);
49
58
  } catch {
50
59
  return !1;
51
60
  }
52
61
  }
53
- async function N(t) {
54
- const n = d(t), e = p(n);
55
- if (e) return e;
62
+ async function x(t) {
63
+ const e = y(t), o = d(e);
64
+ if (o) return o;
56
65
  try {
57
- const r = await l(n);
58
- if (!r)
66
+ const n = await u(e);
67
+ if (!n)
59
68
  throw new Error(`Icon not found: ${t}`);
60
- return r;
69
+ return n;
61
70
  } catch {
62
71
  throw new Error(`Failed to load icon: ${t}`);
63
72
  }
64
73
  }
65
74
  export {
66
- w as createIconifyComponent,
67
- N as getIconData,
68
- E as iconExists,
69
- d as parseIconName
75
+ S as createIconifyComponent,
76
+ x as getIconData,
77
+ v as iconExists,
78
+ y as parseIconName
70
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yh-ui/icons",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "YH-UI Icons - High performance icon library with Iconify integration",
5
5
  "type": "module",
6
6
  "sideEffects": false,