@rogieking/figui3 11.2.0 → 11.2.2

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
@@ -144,6 +144,10 @@ dialog[is="fig-toast"] {
144
144
  width: 15rem;
145
145
  padding: 0;
146
146
  pointer-events: auto;
147
+
148
+ & > fig-content {
149
+ padding-top: 0;
150
+ }
147
151
  }
148
152
 
149
153
  fig-palette-editor {
@@ -326,7 +330,7 @@ fig-fill-picker {
326
330
  aspect-ratio: auto;
327
331
  width: calc(100% - var(--spacer-3) * 2);
328
332
  margin: var(--spacer-2) var(--spacer-3);
329
- margin-top: calc(var(--spacer-4) + var(--spacer-1));
333
+ margin-top: var(--spacer-4);
330
334
  margin-bottom:0;
331
335
  background: transparent;
332
336
  &::after{
package/fig-editor.js CHANGED
@@ -4283,13 +4283,10 @@ class FigFillPicker extends HTMLElement {
4283
4283
  if (!gradientBarInput) return;
4284
4284
  this.#syncingGradientBar = true;
4285
4285
  try {
4286
- gradientBarInput.setAttribute(
4287
- "value",
4288
- JSON.stringify({
4289
- type: "gradient",
4290
- gradient: gradientToValueShape(gradient),
4291
- }),
4292
- );
4286
+ gradientBarInput.value = {
4287
+ type: "gradient",
4288
+ gradient: gradientToValueShape(gradient),
4289
+ };
4293
4290
  } finally {
4294
4291
  this.#syncingGradientBar = false;
4295
4292
  }
@@ -4772,13 +4769,10 @@ class FigFillPicker extends HTMLElement {
4772
4769
  );
4773
4770
  if (barInput) {
4774
4771
  this.#syncingGradientBar = true;
4775
- barInput.setAttribute(
4776
- "value",
4777
- JSON.stringify({
4778
- type: "gradient",
4779
- gradient: gradientToValueShape(this.#gradient),
4780
- }),
4781
- );
4772
+ barInput.value = {
4773
+ type: "gradient",
4774
+ gradient: gradientToValueShape(this.#gradient),
4775
+ };
4782
4776
  this.#syncingGradientBar = false;
4783
4777
  }
4784
4778
 
package/fig.js CHANGED
@@ -11067,8 +11067,8 @@ class FigInputPalette extends HTMLElement {
11067
11067
  const popup = document.createElement("dialog", { is: "fig-popup" });
11068
11068
  popup.setAttribute("is", "fig-popup");
11069
11069
  popup.setAttribute("title", "Edit palette");
11070
- popup.setAttribute("position", "bottom left");
11071
- popup.setAttribute("offset", "0 8");
11070
+ popup.setAttribute("position", "center left");
11071
+ popup.setAttribute("offset", "8 0");
11072
11072
  popup.setAttribute("viewport-margin", "8");
11073
11073
  popup.setAttribute("popover", "manual");
11074
11074
  popup.className = "fig-palette-editor-popup";
@@ -11109,6 +11109,9 @@ class FigInputPalette extends HTMLElement {
11109
11109
  popup.addEventListener("toggle", this.#boundPickerClosed);
11110
11110
 
11111
11111
  (figGetOverlayRoot() ?? document.body).append(popup);
11112
+ popup
11113
+ .querySelector(":scope > fig-header")
11114
+ ?.setAttribute("borderless", "");
11112
11115
  this.#pickerPopup = popup;
11113
11116
  this.#pickerEditor = editor;
11114
11117
  this.querySelector(".palette-colors-inline")?.setAttribute(
@@ -12339,11 +12342,14 @@ class FigInputGradient extends HTMLElement {
12339
12342
  }
12340
12343
 
12341
12344
  set value(val) {
12342
- if (typeof val === "string") {
12343
- this.setAttribute("value", val);
12344
- } else {
12345
- this.setAttribute("value", JSON.stringify(val));
12345
+ const serialized = typeof val === "string" ? val : JSON.stringify(val);
12346
+ if (this.getAttribute("value") === serialized) {
12347
+ this.#parseValue();
12348
+ this.#syncSwatch();
12349
+ this.#syncHandles();
12350
+ return;
12346
12351
  }
12352
+ this.setAttribute("value", serialized);
12347
12353
  }
12348
12354
 
12349
12355
  focus(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
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": "SEE LICENSE IN LICENSE",