@fest-lib/icon 0.1.5 → 0.1.6

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/icon.js CHANGED
@@ -15,7 +15,7 @@ var NM = Object.defineProperty, EM = (M, I) => {
15
15
  const I = M.trim();
16
16
  if (!I.includes("<svg") || !I.includes("</svg>")) throw new Error("Invalid SVG: missing svg tags");
17
17
  if (I.length < 50) throw new Error("Invalid SVG: content too small");
18
- if (I.length > 1024 * 1024) throw new Error("Invalid SVG: content too large");
18
+ if (I.length > 1048576) throw new Error("Invalid SVG: content too large");
19
19
  const g = I.match(/<[^/?][^>]*>/g) || [], A = I.match(/<\/[^>]+>/g) || [], N = I.match(/<[^>]+\/>/g) || [];
20
20
  if (g.length + N.length < A.length) throw new Error("Invalid SVG: unbalanced tags");
21
21
  try {
@@ -48,7 +48,7 @@ var NM = Object.defineProperty, EM = (M, I) => {
48
48
  removeRasterIcon: () => WM,
49
49
  removeVectorIcon: () => HM,
50
50
  validateAndCleanCache: () => tM
51
- }), xM = 2, QM = "icon-cache", vM = "vector", GM = "raster", _ = ".cache-meta.json", bM = 10080 * 60 * 1e3, kM = 50 * 1024 * 1024, L = null, j = null, y = null, m = null, h = null, ZM = () => {
51
+ }), xM = 2, QM = "icon-cache", vM = "vector", GM = "raster", _ = ".cache-meta.json", bM = 6048e5, kM = 52428800, L = null, j = null, y = null, m = null, h = null, ZM = () => {
52
52
  try {
53
53
  const M = String(globalThis?.location?.protocol || "").toLowerCase();
54
54
  return M === "file:" || M === "about:" ? !1 : M === "https:" || M === "http:" || M === "chrome-extension:";
@@ -1823,7 +1823,7 @@ var oM = /* @__PURE__ */ new Set([
1823
1823
  const M = localStorage.getItem(s);
1824
1824
  if (!M) return;
1825
1825
  const I = JSON.parse(M);
1826
- I.rules && Array.isArray(I.rules) && (Date.now() - (I.timestamp || 0) < 1440 * 60 * 1e3 ? (Q = I.rules.filter((g) => MM(g?.cssText)), typeof console < "u" && console.log?.(`[icon-registry] Prepared ${Q.length} rules for restoration from cache`)) : localStorage.removeItem(s));
1826
+ I.rules && Array.isArray(I.rules) && (Date.now() - (I.timestamp || 0) < 864e5 ? (Q = I.rules.filter((g) => MM(g?.cssText)), typeof console < "u" && console.log?.(`[icon-registry] Prepared ${Q.length} rules for restoration from cache`)) : localStorage.removeItem(s));
1827
1827
  } catch {
1828
1828
  }
1829
1829
  }, gI = (M) => {
@@ -2127,7 +2127,7 @@ var Z = 4500, CM = 2, jI = 120, R = 1e3, F = 5, yI = () => {
2127
2127
  const I = M.trim();
2128
2128
  if (!I.includes("<svg") || !I.includes("</svg>")) throw new Error("Invalid SVG: missing svg tags");
2129
2129
  if (I.length < 50) throw new Error("Invalid SVG: content too small");
2130
- if (I.length > 1024 * 1024) throw new Error("Invalid SVG: content too large");
2130
+ if (I.length > 1048576) throw new Error("Invalid SVG: content too large");
2131
2131
  const g = I.match(/<[^/?][^>]*>/g) || [], A = I.match(/<\/[^>]+>/g) || [], N = I.match(/<[^>]+\/>/g) || [];
2132
2132
  if (g.length + N.length < A.length) throw new Error("Invalid SVG: unbalanced tags");
2133
2133
  try {
@@ -2229,7 +2229,7 @@ var Z = 4500, CM = 2, jI = 120, R = 1e3, F = 5, yI = () => {
2229
2229
  }
2230
2230
  }
2231
2231
  const i = cI(T), { blob: w } = await tI(i, Z, A);
2232
- if (w.size > 1024 * 1024) throw new Error(`Blob too large (${w.size} bytes)`);
2232
+ if (w.size > 1048576) throw new Error(`Blob too large (${w.size} bytes)`);
2233
2233
  const S = await w.text(), e = q(S);
2234
2234
  return l() && LM(C, w).catch(() => {
2235
2235
  }), e;
@@ -2465,7 +2465,6 @@ var Z = 4500, CM = 2, jI = 120, R = 1e3, F = 5, yI = () => {
2465
2465
  break;
2466
2466
  case "icon-base":
2467
2467
  this.#A = "", this.#I = "", this.isConnected && this.updateIcon(this.icon);
2468
- break;
2469
2468
  }
2470
2469
  }
2471
2470
  #C = 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fest-lib/icon",
3
3
  "description": "Icon components and loaders (Phosphor-based, fest-lib)",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": true,