@rogieking/figui3 9.0.10 → 9.0.11

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 (3) hide show
  1. package/dist/fig.js +1 -1
  2. package/fig.js +9 -0
  3. package/package.json +1 -1
package/fig.js CHANGED
@@ -18464,6 +18464,12 @@ class FigChooser extends HTMLElement {
18464
18464
  }
18465
18465
  };
18466
18466
 
18467
+ const onDragStart = (e) => {
18468
+ if (this.#dragState?.active) {
18469
+ e.preventDefault();
18470
+ }
18471
+ };
18472
+
18467
18473
  this.#dragState = {
18468
18474
  active: false,
18469
18475
  didDrag: false,
@@ -18478,6 +18484,7 @@ class FigChooser extends HTMLElement {
18478
18484
  onPointerUp,
18479
18485
  onClick,
18480
18486
  onPointerUpCapture,
18487
+ onDragStart,
18481
18488
  };
18482
18489
 
18483
18490
  this.addEventListener("pointerdown", onPointerDown);
@@ -18485,6 +18492,7 @@ class FigChooser extends HTMLElement {
18485
18492
  window.addEventListener("pointerup", onPointerUp);
18486
18493
  this.addEventListener("pointerup", onPointerUpCapture, true);
18487
18494
  this.addEventListener("click", onClick, true);
18495
+ this.addEventListener("dragstart", onDragStart);
18488
18496
  }
18489
18497
 
18490
18498
  #teardownDrag() {
@@ -18498,6 +18506,7 @@ class FigChooser extends HTMLElement {
18498
18506
  true,
18499
18507
  );
18500
18508
  this.removeEventListener("click", this.#dragState.onClick, true);
18509
+ this.removeEventListener("dragstart", this.#dragState.onDragStart);
18501
18510
  this.style.cursor = "";
18502
18511
  this.style.userSelect = "";
18503
18512
  this.#dragState = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "9.0.10",
3
+ "version": "9.0.11",
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",