modern-canvas 0.12.18 → 0.12.20

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/index.js +12 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -10157,12 +10157,21 @@ class ol extends de {
10157
10157
  t
10158
10158
  )) : createImageBitmap(s, t)) : (e.startsWith("data:image/svg+xml;") && (e = this._fixSVG(e)), new Promise((s) => {
10159
10159
  const i = new Image();
10160
- i.src = e, i.onload = () => {
10160
+ i.onerror = () => {
10161
+ console.warn(`Failed load image error: ${e}`), s(i);
10162
+ }, i.onload = () => {
10161
10163
  i.decode().finally(() => {
10162
10164
  s(i);
10163
10165
  });
10164
- };
10165
- }).then((s) => createImageBitmap(s, t)));
10166
+ }, i.src = e;
10167
+ }).then((s) => {
10168
+ if (s.complete && s.naturalWidth && s.naturalHeight)
10169
+ return createImageBitmap(s, t);
10170
+ {
10171
+ const i = document.createElement("canvas");
10172
+ return i.width = 1, i.height = 1, createImageBitmap(i);
10173
+ }
10174
+ }));
10166
10175
  }
10167
10176
  get(e) {
10168
10177
  let t = this._handled.get(e);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.12.18",
4
+ "version": "0.12.20",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "A JavaScript WebGL rendering engine. only the ESM.",
7
7
  "author": "wxm",
@@ -66,7 +66,7 @@
66
66
  "modern-font": "^0.4.4",
67
67
  "modern-idoc": "^0.10.5",
68
68
  "modern-path2d": "^1.4.10",
69
- "modern-text": "^1.10.0"
69
+ "modern-text": "^1.10.2"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "lottie-web": "^5",
@@ -85,7 +85,7 @@
85
85
  }
86
86
  },
87
87
  "devDependencies": {
88
- "@antfu/eslint-config": "^6.1.0",
88
+ "@antfu/eslint-config": "^6.2.0",
89
89
  "@types/earcut": "^3.0.0",
90
90
  "@types/node": "^24.9.2",
91
91
  "bumpp": "^10.3.1",
@@ -98,7 +98,7 @@
98
98
  "typescript": "^5.9.3",
99
99
  "unbuild": "^3.6.1",
100
100
  "vite": "^7.1.12",
101
- "vitest": "^4.0.4",
101
+ "vitest": "^4.0.5",
102
102
  "yoga-layout": "^3.2.1"
103
103
  },
104
104
  "simple-git-hooks": {