@rogieking/figui3 8.9.17 → 8.9.18

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
@@ -153,13 +153,15 @@ fig-fill-picker {
153
153
  width: 240px;
154
154
  padding: 0;
155
155
 
156
+ & > fig-content {
157
+ padding-bottom: var(--spacer-2-5);
158
+ padding-top: var(--spacer-2);
159
+ }
160
+
156
161
  fig-tab {
157
162
  font-size: 0.6875rem;
158
163
  padding: var(--spacer-1) var(--spacer-1);
159
164
  }
160
- & > fig-content {
161
- padding-bottom: var(--spacer-2-5);
162
- }
163
165
 
164
166
  .fig-fill-picker-close {
165
167
  margin-left: auto;
@@ -518,11 +520,14 @@ fig-fill-picker {
518
520
  }
519
521
 
520
522
  &.has-media {
521
- fig-button {
523
+ /* Replace/upload only — not fig-media-controls play. */
524
+ fig-preview fig-button,
525
+ fig-input-file fig-button {
522
526
  visibility: hidden;
523
527
  }
524
528
  &:hover {
525
- fig-button {
529
+ fig-preview fig-button,
530
+ fig-input-file fig-button {
526
531
  visibility: visible;
527
532
  }
528
533
  }
package/fig-editor.js CHANGED
@@ -1499,8 +1499,16 @@ function normalizeGradientConfig(gradient) {
1499
1499
  return next;
1500
1500
  }
1501
1501
 
1502
+ function lockFillPickerGradientInterpolation(gradient) {
1503
+ const next = normalizeGradientConfig(gradient);
1504
+ // Interpolation UI hidden for now — lock to sRGB.
1505
+ next.interpolationSpace = "srgb";
1506
+ delete next.hueInterpolation;
1507
+ return next;
1508
+ }
1509
+
1502
1510
  function gradientToValueShape(gradient) {
1503
- const normalized = normalizeGradientConfig(gradient);
1511
+ const normalized = lockFillPickerGradientInterpolation(gradient);
1504
1512
  const output = {
1505
1513
  ...normalized,
1506
1514
  interpolationSpace: normalized.interpolationSpace,
@@ -1991,7 +1999,7 @@ class FigFillPicker extends HTMLElement {
1991
1999
  // Gamut UI hidden for now — lock to sRGB.
1992
2000
  this.#gamut = "srgb";
1993
2001
  if (parsed.gradient) {
1994
- this.#gradient = normalizeGradientConfig({
2002
+ this.#gradient = lockFillPickerGradientInterpolation({
1995
2003
  ...this.#gradient,
1996
2004
  ...parsed.gradient,
1997
2005
  });
@@ -2281,6 +2289,7 @@ class FigFillPicker extends HTMLElement {
2281
2289
  {
2282
2290
  className: "fig-fill-picker-type",
2283
2291
  label: "Fill type",
2292
+ variant: "ghost",
2284
2293
  value: this.#fillType,
2285
2294
  },
2286
2295
  options,
@@ -3212,7 +3221,6 @@ class FigFillPicker extends HTMLElement {
3212
3221
  // ============ GRADIENT TAB ============
3213
3222
  #initGradientTab() {
3214
3223
  const container = this.#dialog.querySelector('[data-tab="gradient"]');
3215
- const interpolationValue = gradientInterpolationSelectValue(this.#gradient);
3216
3224
  const gradientType = figEditorCreateElement(
3217
3225
  "fig-select",
3218
3226
  {
@@ -3314,70 +3322,7 @@ class FigFillPicker extends HTMLElement {
3314
3322
  ),
3315
3323
  ],
3316
3324
  );
3317
- const interpolationModes = figEditorCreateElement(
3318
- "fig-segmented-control",
3319
- {
3320
- className: "fig-fill-picker-gradient-interpolation-modes",
3321
- "aria-label": "Color interpolation",
3322
- value: interpolationValue,
3323
- },
3324
- FigFillPicker.#GRADIENT_INTERPOLATION_MODES.filter(
3325
- (mode) => !mode.advanced,
3326
- ).map(({ value, space, title, subtitle }) =>
3327
- figEditorCreateElement(
3328
- "fig-tooltip",
3329
- { text: `${title} — ${subtitle}` },
3330
- figEditorCreateElement(
3331
- "fig-segment",
3332
- {
3333
- value,
3334
- "data-space": space,
3335
- "aria-label": `${title} — ${subtitle}`,
3336
- },
3337
- figEditorCreateElement("fig-interpolation-swatch", {
3338
- "aria-hidden": "true",
3339
- }),
3340
- ),
3341
- ),
3342
- ),
3343
- );
3344
- const interpolationSelect = figEditorCreateElement(
3345
- "fig-select",
3346
- {
3347
- className: "fig-fill-picker-gradient-space",
3348
- label: "Color interpolation",
3349
- value: interpolationValue,
3350
- },
3351
- figEditorCreateElement(
3352
- "fig-select-options",
3353
- {},
3354
- this.#createGradientInterpolationOptions(),
3355
- ),
3356
- );
3357
- // The select trigger overlays the icon button so its menu anchors correctly.
3358
- const interpolationMore = figEditorCreateElement(
3359
- "div",
3360
- { className: "fig-fill-picker-gradient-interpolation-more" },
3361
- [
3362
- figEditorCreateElement(
3363
- "fig-button",
3364
- {
3365
- icon: true,
3366
- variant: "ghost",
3367
- "aria-hidden": "true",
3368
- tabindex: "-1",
3369
- },
3370
- figEditorCreateIcon("more"),
3371
- ),
3372
- interpolationSelect,
3373
- ],
3374
- );
3375
- const interpolation = figEditorCreateElement(
3376
- "fig-field",
3377
- { className: "fig-fill-picker-gradient-interpolation-field" },
3378
- [interpolationModes, interpolationMore],
3379
- );
3380
- container.replaceChildren(header, preview, interpolation, stops);
3325
+ container.replaceChildren(header, preview, stops);
3381
3326
 
3382
3327
  this.#updateGradientUI();
3383
3328
  this.#setupGradientEvents(container);
@@ -3675,7 +3620,7 @@ class FigFillPicker extends HTMLElement {
3675
3620
  if (this.#syncingGradientBar) return;
3676
3621
  const detail = e.detail;
3677
3622
  if (!detail?.gradient) return;
3678
- this.#gradient = normalizeGradientConfig({
3623
+ this.#gradient = lockFillPickerGradientInterpolation({
3679
3624
  ...this.#gradient,
3680
3625
  ...detail.gradient,
3681
3626
  });
@@ -3846,7 +3791,7 @@ class FigFillPicker extends HTMLElement {
3846
3791
 
3847
3792
  const container = this.#dialog.querySelector('[data-tab="gradient"]');
3848
3793
  if (!container) return;
3849
- this.#gradient = normalizeGradientConfig(this.#gradient);
3794
+ this.#gradient = lockFillPickerGradientInterpolation(this.#gradient);
3850
3795
 
3851
3796
  const interpolationValue = gradientInterpolationSelectValue(this.#gradient);
3852
3797
  const interpolationSelect = container.querySelector(
@@ -4286,6 +4231,11 @@ class FigFillPicker extends HTMLElement {
4286
4231
  }
4287
4232
 
4288
4233
  element.setAttribute("src", this.#video.url);
4234
+ if (this.#video.poster) {
4235
+ element.setAttribute("poster", this.#video.poster);
4236
+ } else {
4237
+ element.removeAttribute("poster");
4238
+ }
4289
4239
  element.classList.add("has-media");
4290
4240
 
4291
4241
  const fileInput = element.querySelector("fig-input-file[data-generated]");
package/fig.js CHANGED
@@ -322,7 +322,7 @@ fig-select-options > .fig-overflow-end::before,
322
322
 
323
323
  const FIG_SHADOW_ICON_CSS = `
324
324
  fig-icon {
325
- contain: strict;
325
+ contain: size;
326
326
  --size: var(--spacer-4);
327
327
  display: inline-flex;
328
328
  width: var(--size);
@@ -13382,13 +13382,9 @@ class FigMediaControls extends HTMLElement {
13382
13382
  tooltip.setAttribute("text", "Play");
13383
13383
  const btn = document.createElement("fig-button");
13384
13384
  btn.setAttribute("variant", "ghost");
13385
- btn.setAttribute("size", "small");
13386
13385
  btn.setAttribute("icon", "true");
13387
13386
  btn.setAttribute("aria-label", "Play");
13388
- const icon = createFigIcon("play", {
13389
- className: "fig-media-controls-play-icon",
13390
- });
13391
- btn.append(icon);
13387
+ btn.append(createFigIcon("play"));
13392
13388
  tooltip.append(btn);
13393
13389
  btn.addEventListener("click", (e) => {
13394
13390
  e.preventDefault();
@@ -13478,7 +13474,7 @@ class FigMediaControls extends HTMLElement {
13478
13474
  const playing = this.playing;
13479
13475
  this.#playBtn.setAttribute("aria-label", playing ? "Pause" : "Play");
13480
13476
  this.#playTooltip?.setAttribute("text", playing ? "Pause" : "Play");
13481
- const icon = this.#playBtn.querySelector(".fig-media-controls-play-icon");
13477
+ const icon = this.#playBtn.querySelector("fig-icon");
13482
13478
  if (icon) {
13483
13479
  icon.setAttribute("name", playing ? "pause" : "play");
13484
13480
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "8.9.17",
3
+ "version": "8.9.18",
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",