@rogieking/figui3 8.9.22 → 8.9.23
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/fig-editor.js +1 -1
- package/dist/fig.js +1 -1
- package/fig-editor.js +6 -5
- package/fig.js +16 -2
- package/package.json +1 -1
package/fig-editor.js
CHANGED
|
@@ -4475,7 +4475,7 @@ class FigFillPicker extends HTMLElement {
|
|
|
4475
4475
|
#applyDefaultVideo({ emit = true } = {}) {
|
|
4476
4476
|
if (this.#video.url) {
|
|
4477
4477
|
this.#video.missing = false;
|
|
4478
|
-
if (!this.#video.poster) this.#captureVideoPoster(this.#video.url
|
|
4478
|
+
if (!this.#video.poster) this.#captureVideoPoster(this.#video.url);
|
|
4479
4479
|
return;
|
|
4480
4480
|
}
|
|
4481
4481
|
const fallback = this.getAttribute("default-video");
|
|
@@ -4489,14 +4489,15 @@ class FigFillPicker extends HTMLElement {
|
|
|
4489
4489
|
".fig-fill-picker-video-preview",
|
|
4490
4490
|
);
|
|
4491
4491
|
if (preview) this.#updateVideoPreviewStyle(preview);
|
|
4492
|
-
this.#captureVideoPoster(fallback
|
|
4492
|
+
this.#captureVideoPoster(fallback);
|
|
4493
|
+
if (emit) this.#emitInput();
|
|
4493
4494
|
}
|
|
4494
4495
|
|
|
4495
|
-
#ensureVideoPoster(
|
|
4496
|
+
#ensureVideoPoster() {
|
|
4496
4497
|
if (this.#fillType !== "video") return;
|
|
4497
4498
|
const src = this.#video.url;
|
|
4498
4499
|
if (!src || this.#video.poster) return;
|
|
4499
|
-
this.#captureVideoPoster(src
|
|
4500
|
+
this.#captureVideoPoster(src);
|
|
4500
4501
|
}
|
|
4501
4502
|
|
|
4502
4503
|
async #videoFrameBitmap(video) {
|
|
@@ -4550,7 +4551,7 @@ class FigFillPicker extends HTMLElement {
|
|
|
4550
4551
|
: new Promise((resolve) => canvas.toBlob(resolve, "image/jpeg", 0.85));
|
|
4551
4552
|
}
|
|
4552
4553
|
|
|
4553
|
-
async #captureVideoPoster(src, { emit =
|
|
4554
|
+
async #captureVideoPoster(src, { emit = false } = {}) {
|
|
4554
4555
|
if (!src || this.#videoPosterCapturing === src) return;
|
|
4555
4556
|
this.#videoPosterCapturing = src;
|
|
4556
4557
|
const video = document.createElement("video");
|
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
|
-
|
|
10652
|
-
|
|
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