@rogieking/figui3 6.9.4 → 6.9.6

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.js CHANGED
@@ -11060,7 +11060,14 @@ class FigMedia extends HTMLElement {
11060
11060
  }
11061
11061
 
11062
11062
  #ensureControls() {
11063
- if (this.#controlsEl && this.#controlsEl.isConnected) {
11063
+ const generatedControls = Array.from(
11064
+ this.querySelectorAll(":scope > fig-media-controls[data-generated]"),
11065
+ );
11066
+ const existingControls = generatedControls[0];
11067
+ generatedControls.slice(1).forEach((controls) => controls.remove());
11068
+
11069
+ if (existingControls) {
11070
+ this.#controlsEl = existingControls;
11064
11071
  this.#wireControlsToMedia();
11065
11072
  return;
11066
11073
  }
@@ -11157,10 +11164,9 @@ class FigMedia extends HTMLElement {
11157
11164
 
11158
11165
  #removeControls() {
11159
11166
  this.#unwireControls();
11160
- if (!this.#controlsEl) return;
11161
- if (this.#controlsEl.hasAttribute("data-generated")) {
11162
- this.#controlsEl.remove();
11163
- }
11167
+ this.querySelectorAll(":scope > fig-media-controls[data-generated]").forEach((controls) => {
11168
+ controls.remove();
11169
+ });
11164
11170
  this.#controlsEl = null;
11165
11171
  }
11166
11172
 
@@ -12944,6 +12950,7 @@ class FigEasingCurve extends HTMLElement {
12944
12950
  #startSpringDrag(e, handleType) {
12945
12951
  e.preventDefault();
12946
12952
  this.#isDragging = handleType;
12953
+ this.classList.toggle("spring-bounce-dragging", handleType === "bounce");
12947
12954
 
12948
12955
  const startDamping = this.#spring.damping;
12949
12956
  const startStiffness = this.#spring.stiffness;
@@ -12981,6 +12988,7 @@ class FigEasingCurve extends HTMLElement {
12981
12988
 
12982
12989
  const onUp = () => {
12983
12990
  this.#isDragging = null;
12991
+ this.classList.remove("spring-bounce-dragging");
12984
12992
  document.removeEventListener("pointermove", onMove);
12985
12993
  document.removeEventListener("pointerup", onUp);
12986
12994
  this.#emit("change");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "6.9.4",
3
+ "version": "6.9.6",
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",