@rogieking/figui3 4.1.3 → 4.1.4

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/components.css CHANGED
@@ -1377,7 +1377,7 @@ fig-input-file {
1377
1377
 
1378
1378
  fig-image {
1379
1379
  --image-size: 2rem;
1380
- --fit: cover;
1380
+ --fit: contain;
1381
1381
  --image-width: var(--image-size);
1382
1382
  --image-height: var(--image-size);
1383
1383
  --aspect-ratio: 1 / 1;
package/fig.js CHANGED
@@ -7933,6 +7933,7 @@ class FigImage extends HTMLElement {
7933
7933
  }
7934
7934
 
7935
7935
  #handleFileInput(e) {
7936
+ if (e.target !== this.#fileInput) return;
7936
7937
  const file = e.detail?.files?.[0];
7937
7938
 
7938
7939
  if (!file) {
@@ -7968,7 +7969,9 @@ class FigImage extends HTMLElement {
7968
7969
  );
7969
7970
 
7970
7971
  if (this.#fileInput) {
7972
+ this.#fileInput.removeEventListener("change", this.#boundHandleFileInput);
7971
7973
  this.#fileInput.clear();
7974
+ this.#fileInput.addEventListener("change", this.#boundHandleFileInput);
7972
7975
  this.#fileInput.setAttribute("label", "Replace");
7973
7976
  }
7974
7977
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "A lightweight web components library for building Figma plugin and widget UIs with native look and feel",
5
5
  "author": "Rogie King",
6
6
  "license": "MIT",