@mlola-ui/behavior 1.1.15 → 1.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlola-ui/behavior",
3
- "version": "1.1.15",
3
+ "version": "1.1.18",
4
4
  "description": "Framework-free behavior for Mlola UI markup: standard DOM, no runtime peers",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -69,6 +69,13 @@ export function sliderValueForKey(key, current, { min = 0, max = 100, step = 1 }
69
69
  * least `threshold` pixels, and more sideways than up or down. Until then the
70
70
  * control changes nothing, so a person scrolling past it does not move it.
71
71
  */
72
+ /**
73
+ * On a touch screen, a finger holds still this long (ms) before a dragged
74
+ * thing lifts, and may drift this far (px) meanwhile; a finger that moves
75
+ * sooner is scrolling. Kanban and Gantt share it.
76
+ */
77
+ export const touchHold = Object.freeze({ delay: 250, slop: 8 });
78
+
72
79
  export function isSidewaysDrag(dx, dy, threshold = 6) {
73
80
  return Math.abs(dx) >= threshold && Math.abs(dx) >= Math.abs(dy);
74
81
  }
package/src/logic.d.ts CHANGED
@@ -149,6 +149,9 @@ export function fitMenu(
149
149
  options?: { offset?: number; padding?: number },
150
150
  ): { side: Side; shift: number };
151
151
 
152
+ /** On a touch screen: how long a finger holds still before a drag lifts (ms), and how far it may drift meanwhile (px). */
153
+ export const touchHold: { readonly delay: number; readonly slop: number };
154
+
152
155
  /** A CSS-anchored tooltip's side and its slide along that edge to stay on screen. */
153
156
  export function fitTooltip(
154
157
  anchor: Rect,