@pixra/chrome-icons 0.0.5 → 0.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.
@@ -2397,7 +2397,6 @@ var require_jszip_min = __commonJS({
2397
2397
  });
2398
2398
 
2399
2399
  // src/plugin.ts
2400
- var import_jszip = __toESM(require_jszip_min());
2401
2400
  import * as pixra from "@pixra/plugin-sdk";
2402
2401
  var ICON_SIZES = [16, 32, 48, 96, 128];
2403
2402
  async function resizeImage(imageData, size) {
@@ -2413,14 +2412,15 @@ async function exportChromeIcons() {
2413
2412
  await pixra.window.showErrorMessage("No image is currently open");
2414
2413
  return;
2415
2414
  }
2416
- const zip = new import_jszip.default();
2415
+ const JSZip = (await Promise.resolve().then(() => __toESM(require_jszip_min()))).default;
2416
+ const zip = new JSZip();
2417
2417
  for (const size of ICON_SIZES) {
2418
2418
  const blob = await resizeImage(imageData, size);
2419
2419
  const arrayBuffer = await blob.arrayBuffer();
2420
2420
  zip.file(`icon-${size}.png`, arrayBuffer);
2421
2421
  }
2422
2422
  const zipBlob = await zip.generateAsync({ type: "arraybuffer" });
2423
- await pixra.workspace.downloadFile("chrome-icons.zip", zipBlob);
2423
+ await pixra.window.saveFile({ filename: "chrome-icons.zip", data: zipBlob });
2424
2424
  await pixra.window.showInformationMessage(
2425
2425
  `Exported ${ICON_SIZES.length} icons: ${ICON_SIZES.join(", ")}px`
2426
2426
  );
@@ -2453,4 +2453,4 @@ jszip/dist/jszip.min.js:
2453
2453
  https://github.com/nodeca/pako/blob/main/LICENSE
2454
2454
  *)
2455
2455
  */
2456
- //# sourceMappingURL=plugin.js.map
2456
+ //# sourceMappingURL=plugin.map
package/dist/plugin.json CHANGED
@@ -18,6 +18,6 @@
18
18
  ]
19
19
  }
20
20
  },
21
- "version": "0.0.5",
22
- "main": "plugin.js"
21
+ "version": "0.0.7",
22
+ "main": "plugin"
23
23
  }