@rogieking/figui3 8.9.22 → 8.9.24

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/fig-editor.css CHANGED
@@ -1,3 +1,4 @@
1
+ /* Copyright (c) 2026 Rogie King. PolyForm Shield 1.0.0. See LICENSE. */
1
2
  @import url("fig-layer.css");
2
3
 
3
4
  :root,
package/fig-editor.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* Copyright (c) 2026 Rogie King. PolyForm Shield 1.0.0. See LICENSE. */
1
2
  import "./fig.js";
2
3
  import "./fig-lab.js";
3
4
 
@@ -4475,7 +4476,7 @@ class FigFillPicker extends HTMLElement {
4475
4476
  #applyDefaultVideo({ emit = true } = {}) {
4476
4477
  if (this.#video.url) {
4477
4478
  this.#video.missing = false;
4478
- if (!this.#video.poster) this.#captureVideoPoster(this.#video.url, { emit });
4479
+ if (!this.#video.poster) this.#captureVideoPoster(this.#video.url);
4479
4480
  return;
4480
4481
  }
4481
4482
  const fallback = this.getAttribute("default-video");
@@ -4489,14 +4490,15 @@ class FigFillPicker extends HTMLElement {
4489
4490
  ".fig-fill-picker-video-preview",
4490
4491
  );
4491
4492
  if (preview) this.#updateVideoPreviewStyle(preview);
4492
- this.#captureVideoPoster(fallback, { emit });
4493
+ this.#captureVideoPoster(fallback);
4494
+ if (emit) this.#emitInput();
4493
4495
  }
4494
4496
 
4495
- #ensureVideoPoster({ emit = true } = {}) {
4497
+ #ensureVideoPoster() {
4496
4498
  if (this.#fillType !== "video") return;
4497
4499
  const src = this.#video.url;
4498
4500
  if (!src || this.#video.poster) return;
4499
- this.#captureVideoPoster(src, { emit });
4501
+ this.#captureVideoPoster(src);
4500
4502
  }
4501
4503
 
4502
4504
  async #videoFrameBitmap(video) {
@@ -4550,7 +4552,7 @@ class FigFillPicker extends HTMLElement {
4550
4552
  : new Promise((resolve) => canvas.toBlob(resolve, "image/jpeg", 0.85));
4551
4553
  }
4552
4554
 
4553
- async #captureVideoPoster(src, { emit = true } = {}) {
4555
+ async #captureVideoPoster(src, { emit = false } = {}) {
4554
4556
  if (!src || this.#videoPosterCapturing === src) return;
4555
4557
  this.#videoPosterCapturing = src;
4556
4558
  const video = document.createElement("video");
package/fig-lab.css CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * FigUI3 Lab — Experimental component styles
3
+ * Copyright (c) 2026 Rogie King. PolyForm Shield 1.0.0. See LICENSE.
3
4
  *
4
5
  * Depends on base.css and components.css tokens.
5
6
  * Import alongside components.css for opt-in access:
package/fig-lab.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * FigUI3 Lab — Experimental components
3
+ * Copyright (c) 2026 Rogie King. PolyForm Shield 1.0.0. See LICENSE.
3
4
  *
4
5
  * These components are unstable and may change or be removed without notice.
5
6
  * Import alongside fig.js for opt-in access:
package/fig.js CHANGED
@@ -10648,8 +10648,17 @@ class FigInputGradient extends HTMLElement {
10648
10648
  .join(", ");
10649
10649
  const interp = gradientInterpolationClause(gradient);
10650
10650
  const interpolation = interp ? ` ${interp}` : "";
10651
- // Compact swatch always previews L→R, regardless of linear angle /
10652
- // radial / angular type (stop handles also use this axis when editing).
10651
+ if (this.#editMode === "picker") {
10652
+ switch (gradient.type) {
10653
+ case "radial":
10654
+ return `radial-gradient(circle at ${gradient.centerX}% ${gradient.centerY}%${interpolation}, ${stops})`;
10655
+ case "angular":
10656
+ return `conic-gradient(from ${gradient.angle}deg${interpolation}, ${stops})`;
10657
+ default:
10658
+ return `linear-gradient(${gradient.angle}deg${interpolation}, ${stops})`;
10659
+ }
10660
+ }
10661
+ // Inline editor swatch previews L→R so stop handles share that axis.
10653
10662
  return `linear-gradient(to right${interpolation}, ${stops})`;
10654
10663
  }
10655
10664
 
@@ -10761,6 +10770,11 @@ class FigInputGradient extends HTMLElement {
10761
10770
  ...this.#gradient,
10762
10771
  ...detail.gradient,
10763
10772
  });
10773
+ if (this.#editMode === "picker" && typeof detail.css === "string" && detail.css) {
10774
+ this.#swatch?.setAttribute("background", detail.css);
10775
+ this.#syncSwatchSize();
10776
+ return;
10777
+ }
10764
10778
  this.#syncSwatch();
10765
10779
  };
10766
10780
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "8.9.22",
3
+ "version": "8.9.24",
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
- "license": "MIT",
6
+ "license": "SEE LICENSE IN LICENSE",
7
7
  "type": "module",
8
8
  "main": "dist/fig.js",
9
9
  "module": "dist/fig.js",