@rogieking/figui3 3.20.1 → 3.20.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.
Files changed (2) hide show
  1. package/fig.js +14 -10
  2. package/package.json +1 -1
package/fig.js CHANGED
@@ -3533,8 +3533,8 @@ class FigInputText extends HTMLElement {
3533
3533
  valueTransformed = this.#formatNumber(valueTransformed);
3534
3534
  this.value = value;
3535
3535
  this.input.value = valueTransformed;
3536
- this.dispatchEvent(new CustomEvent("input", { bubbles: true }));
3537
- this.dispatchEvent(new CustomEvent("change", { bubbles: true }));
3536
+ this.dispatchEvent(new CustomEvent("input", { detail: this.value, bubbles: true }));
3537
+ this.dispatchEvent(new CustomEvent("change", { detail: this.value, bubbles: true }));
3538
3538
  }
3539
3539
  #handleMouseDown(e) {
3540
3540
  if (this.type !== "number") return;
@@ -4023,8 +4023,8 @@ class FigInputNumber extends HTMLElement {
4023
4023
  value = this.#sanitizeInput(value, false);
4024
4024
  this.value = value;
4025
4025
  this.input.value = this.#formatWithUnit(this.value);
4026
- this.dispatchEvent(new CustomEvent("input", { bubbles: true }));
4027
- this.dispatchEvent(new CustomEvent("change", { bubbles: true }));
4026
+ this.dispatchEvent(new CustomEvent("input", { detail: this.value, bubbles: true }));
4027
+ this.dispatchEvent(new CustomEvent("change", { detail: this.value, bubbles: true }));
4028
4028
  }
4029
4029
 
4030
4030
  #handleMouseDown(e) {
@@ -4801,18 +4801,18 @@ class FigInputColor extends HTMLElement {
4801
4801
  }
4802
4802
 
4803
4803
  #emitInputEvent() {
4804
- const e = new CustomEvent("input", {
4804
+ this.dispatchEvent(new CustomEvent("input", {
4805
4805
  bubbles: true,
4806
4806
  cancelable: true,
4807
- });
4808
- this.dispatchEvent(e);
4807
+ detail: { value: this.value, hex: this.hex, rgba: this.rgba },
4808
+ }));
4809
4809
  }
4810
4810
  #emitChangeEvent() {
4811
- const e = new CustomEvent("change", {
4811
+ this.dispatchEvent(new CustomEvent("change", {
4812
4812
  bubbles: true,
4813
4813
  cancelable: true,
4814
- });
4815
- this.dispatchEvent(e);
4814
+ detail: { value: this.value, hex: this.hex, rgba: this.rgba },
4815
+ }));
4816
4816
  }
4817
4817
 
4818
4818
  static get observedAttributes() {
@@ -9615,6 +9615,7 @@ class FigInputJoystick extends HTMLElement {
9615
9615
  new CustomEvent("input", {
9616
9616
  bubbles: true,
9617
9617
  cancelable: true,
9618
+ detail: { value: this.value, x: this.position.x, y: this.position.y },
9618
9619
  }),
9619
9620
  );
9620
9621
  }
@@ -9624,6 +9625,7 @@ class FigInputJoystick extends HTMLElement {
9624
9625
  new CustomEvent("change", {
9625
9626
  bubbles: true,
9626
9627
  cancelable: true,
9628
+ detail: { value: this.value, x: this.position.x, y: this.position.y },
9627
9629
  }),
9628
9630
  );
9629
9631
  }
@@ -10086,6 +10088,7 @@ class FigInputAngle extends HTMLElement {
10086
10088
  new CustomEvent("input", {
10087
10089
  bubbles: true,
10088
10090
  cancelable: true,
10091
+ detail: { value: this.value, angle: this.angle },
10089
10092
  }),
10090
10093
  );
10091
10094
  }
@@ -10095,6 +10098,7 @@ class FigInputAngle extends HTMLElement {
10095
10098
  new CustomEvent("change", {
10096
10099
  bubbles: true,
10097
10100
  cancelable: true,
10101
+ detail: { value: this.value, angle: this.angle },
10098
10102
  }),
10099
10103
  );
10100
10104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "3.20.1",
3
+ "version": "3.20.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": "MIT",