@rogieking/figui3 6.4.2 → 6.4.3
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/components.css +18 -5
- package/dist/components.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +2 -2
- package/dist/fig.css +1 -1
- package/fig-lab.css +11 -13
- package/fig-lab.js +26 -8
- package/package.json +1 -1
package/fig-lab.css
CHANGED
|
@@ -195,8 +195,12 @@ fig-canvas-control {
|
|
|
195
195
|
--fig-canvas-control-radius-stroke-halo: #FFFFFF;
|
|
196
196
|
--fig-canvas-control-line-stroke-hover: #0D99FF;
|
|
197
197
|
--fig-canvas-control-line-stroke-active: #0D99FF;
|
|
198
|
-
--fig-canvas-control-line-stroke-width:
|
|
199
|
-
--fig-canvas-control-line-stroke-width-hover:
|
|
198
|
+
--fig-canvas-control-line-stroke-width: 1px;
|
|
199
|
+
--fig-canvas-control-line-stroke-width-hover: 2px;
|
|
200
|
+
|
|
201
|
+
&:has(.fig-canvas-control-radius-hit:hover) {
|
|
202
|
+
--fig-canvas-control-line-stroke-width: var(--fig-canvas-control-line-stroke-width-hover);
|
|
203
|
+
}
|
|
200
204
|
|
|
201
205
|
& > fig-handle,
|
|
202
206
|
& > fig-tooltip:has(fig-handle:not([size="small"])) {
|
|
@@ -217,7 +221,7 @@ fig-canvas-control {
|
|
|
217
221
|
|
|
218
222
|
.fig-canvas-control-radius-halo {
|
|
219
223
|
stroke: var(--fig-canvas-control-radius-stroke-halo);
|
|
220
|
-
stroke-width: calc(var(--fig-canvas-control-line-stroke-width)
|
|
224
|
+
stroke-width: calc(var(--fig-canvas-control-line-stroke-width) + 2px);
|
|
221
225
|
filter: none;
|
|
222
226
|
}
|
|
223
227
|
|
|
@@ -226,18 +230,12 @@ fig-canvas-control {
|
|
|
226
230
|
stroke-width: 12px;
|
|
227
231
|
pointer-events: stroke;
|
|
228
232
|
filter: none;
|
|
229
|
-
|
|
230
|
-
&:hover ~ circle:not(.fig-canvas-control-radius-halo) {
|
|
231
|
-
stroke-width: var(--fig-canvas-control-line-stroke-width-hover);
|
|
232
|
-
}
|
|
233
|
+
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
&.fig-canvas-control-ring-active
|
|
237
|
-
|
|
238
|
-
circle:not(.fig-canvas-control-radius-hit):not(.fig-canvas-control-radius-halo) {
|
|
239
|
-
stroke: var(--fig-canvas-control-line-stroke-active);
|
|
240
|
-
stroke-width: var(--fig-canvas-control-line-stroke-width-hover);
|
|
237
|
+
&.fig-canvas-control-ring-active{
|
|
238
|
+
--fig-canvas-control-line-stroke-width: var(--fig-canvas-control-line-stroke-width-hover);
|
|
241
239
|
}
|
|
242
240
|
|
|
243
241
|
.fig-canvas-control-angle-svg {
|
|
@@ -254,7 +252,7 @@ fig-canvas-control {
|
|
|
254
252
|
|
|
255
253
|
.fig-canvas-control-angle-line-halo {
|
|
256
254
|
stroke: var(--fig-canvas-control-radius-stroke-halo);
|
|
257
|
-
stroke-width: calc(var(--fig-canvas-control-line-stroke-width)
|
|
255
|
+
stroke-width: calc(var(--fig-canvas-control-line-stroke-width) + 2px);
|
|
258
256
|
stroke-linecap: butt;
|
|
259
257
|
filter: none;
|
|
260
258
|
}
|
package/fig-lab.js
CHANGED
|
@@ -571,8 +571,18 @@ class FigCanvasControl extends HTMLElement {
|
|
|
571
571
|
|
|
572
572
|
#wireHoverTooltip(target, getTooltip, getText, isDraggingRef) {
|
|
573
573
|
if (!target) return;
|
|
574
|
+
const shouldSuppress = () => !!isDraggingRef?.();
|
|
575
|
+
const hideTooltip = () => {
|
|
576
|
+
const tip = getTooltip();
|
|
577
|
+
if (!tip) return;
|
|
578
|
+
tip.removeAttribute("show");
|
|
579
|
+
tip.hidePopup?.();
|
|
580
|
+
};
|
|
574
581
|
const show = () => {
|
|
575
|
-
if (
|
|
582
|
+
if (shouldSuppress()) {
|
|
583
|
+
hideTooltip();
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
576
586
|
const tip = getTooltip();
|
|
577
587
|
if (!tip) return;
|
|
578
588
|
if (getText) tip.setAttribute("text", getText());
|
|
@@ -580,15 +590,21 @@ class FigCanvasControl extends HTMLElement {
|
|
|
580
590
|
tip.showPopup?.();
|
|
581
591
|
};
|
|
582
592
|
const hide = () => {
|
|
583
|
-
|
|
584
|
-
const tip = getTooltip();
|
|
585
|
-
if (!tip) return;
|
|
586
|
-
tip.removeAttribute("show");
|
|
593
|
+
hideTooltip();
|
|
587
594
|
};
|
|
588
595
|
target.addEventListener("pointerenter", show);
|
|
589
596
|
target.addEventListener("pointerleave", hide);
|
|
590
597
|
}
|
|
591
598
|
|
|
599
|
+
#hasActiveInteraction() {
|
|
600
|
+
return (
|
|
601
|
+
this.#isDragging ||
|
|
602
|
+
this.#isSecondDragging ||
|
|
603
|
+
this.#isRadiusDragging ||
|
|
604
|
+
this.#isAngleDragging
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
|
|
592
608
|
#wireHoverTooltips() {
|
|
593
609
|
if (this.#pointHandle) {
|
|
594
610
|
this.#wireHoverTooltip(
|
|
@@ -596,7 +612,7 @@ class FigCanvasControl extends HTMLElement {
|
|
|
596
612
|
() => this.#pointTooltip,
|
|
597
613
|
() => this.#pointTipText,
|
|
598
614
|
() =>
|
|
599
|
-
this.#
|
|
615
|
+
this.#hasActiveInteraction() ||
|
|
600
616
|
!!this.#pointHandle?.querySelector("fig-color-tip"),
|
|
601
617
|
);
|
|
602
618
|
}
|
|
@@ -605,7 +621,7 @@ class FigCanvasControl extends HTMLElement {
|
|
|
605
621
|
this.#angleHandle,
|
|
606
622
|
() => this.#angleTooltip,
|
|
607
623
|
() => `Angle ${Math.round(this.#angle)}°`,
|
|
608
|
-
() => this.#
|
|
624
|
+
() => this.#hasActiveInteraction(),
|
|
609
625
|
);
|
|
610
626
|
}
|
|
611
627
|
if (this.#secondHandle) {
|
|
@@ -613,7 +629,7 @@ class FigCanvasControl extends HTMLElement {
|
|
|
613
629
|
this.#secondHandle,
|
|
614
630
|
() => this.#secondTooltip,
|
|
615
631
|
() => this.#secondTipText,
|
|
616
|
-
() => this.#
|
|
632
|
+
() => this.#hasActiveInteraction(),
|
|
617
633
|
);
|
|
618
634
|
}
|
|
619
635
|
if (this.#radiusSvg) {
|
|
@@ -1102,6 +1118,7 @@ class FigCanvasControl extends HTMLElement {
|
|
|
1102
1118
|
origEvent.preventDefault();
|
|
1103
1119
|
this.#isAngleDragging = true;
|
|
1104
1120
|
this.classList.add("fig-canvas-control-ring-active");
|
|
1121
|
+
this.#angleHandle.setAttribute("selected", "");
|
|
1105
1122
|
const container = this.#container;
|
|
1106
1123
|
if (!container) return;
|
|
1107
1124
|
|
|
@@ -1142,6 +1159,7 @@ class FigCanvasControl extends HTMLElement {
|
|
|
1142
1159
|
const onUp = () => {
|
|
1143
1160
|
this.#isAngleDragging = false;
|
|
1144
1161
|
this.classList.remove("fig-canvas-control-ring-active");
|
|
1162
|
+
this.#angleHandle.removeAttribute("selected");
|
|
1145
1163
|
document.body.style.cursor = prevBodyCursor;
|
|
1146
1164
|
if (this.#angleTooltip) this.#angleTooltip.removeAttribute("show");
|
|
1147
1165
|
this.#syncValueAttribute();
|
package/package.json
CHANGED