@vuer-ai/vuer-uikit 0.0.22 → 0.0.23

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.
@@ -37,50 +37,58 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
37
37
  };
38
38
  document.addEventListener("click", stopClick2, true);
39
39
  }, []);
40
- const bind = useGesture({
41
- onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
42
- event.stopPropagation();
43
- event.preventDefault();
44
- if (selectRange.current[0] === null) {
45
- selectRange.current[0] = getHoverElementAndIndex(
46
- typeof document !== "undefined" ? document.elementFromPoint(...initial) : null,
47
- inputs.current
48
- );
49
- }
50
- let newMX = memo + dx / 2;
51
- if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
52
- const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
53
- const newValue = value.map((v, i) => {
54
- const [first, last] = selectRange.current;
55
- if (first === null || last === null) {
56
- return v;
57
- } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
58
- return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
59
- } else {
60
- return v;
61
- }
62
- });
63
- onValuesChange == null ? void 0 : onValuesChange(newValue);
64
- newMX = 0;
65
- inputChange.current = true;
66
- changeElementsHoverState(inputs.current, selectRange.current, "x");
67
- stopClick();
68
- }
69
- if (!inputChange.current) {
70
- const currentElement = typeof document !== "undefined" ? document.elementFromPoint(...xy) : null;
71
- const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
72
- selectRange.current[1] = currentIndex ?? selectRange.current[1];
73
- changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
74
- stopClick();
40
+ const bind = useGesture(
41
+ {
42
+ onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
43
+ if (typeof document === "undefined") return memo || 0;
44
+ event.stopPropagation();
45
+ event.preventDefault();
46
+ if (selectRange.current[0] === null) {
47
+ selectRange.current[0] = getHoverElementAndIndex(
48
+ document.elementFromPoint(...initial),
49
+ inputs.current
50
+ );
51
+ }
52
+ let newMX = memo + dx / 2;
53
+ if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
54
+ const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
55
+ const newValue = value.map((v, i) => {
56
+ const [first, last] = selectRange.current;
57
+ if (first === null || last === null) {
58
+ return v;
59
+ } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
60
+ return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
61
+ } else {
62
+ return v;
63
+ }
64
+ });
65
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
66
+ newMX = 0;
67
+ inputChange.current = true;
68
+ changeElementsHoverState(inputs.current, selectRange.current, "x");
69
+ stopClick();
70
+ }
71
+ if (!inputChange.current) {
72
+ const currentElement = document.elementFromPoint(...xy);
73
+ const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
74
+ selectRange.current[1] = currentIndex ?? selectRange.current[1];
75
+ changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
76
+ stopClick();
77
+ }
78
+ return newMX;
79
+ },
80
+ onDragEnd: () => {
81
+ if (typeof document === "undefined") return;
82
+ selectRange.current = [null, null];
83
+ inputChange.current = false;
84
+ changeElementsHoverState(inputs.current, selectRange.current, "none");
75
85
  }
76
- return newMX;
77
86
  },
78
- onDragEnd: () => {
79
- selectRange.current = [null, null];
80
- inputChange.current = false;
81
- changeElementsHoverState(inputs.current, selectRange.current, "none");
87
+ {
88
+ // Pass config options to make gesture library SSR-safe
89
+ enabled: typeof document !== "undefined"
82
90
  }
83
- });
91
+ );
84
92
  const valueChangeHandler = useCallback(
85
93
  (index) => {
86
94
  return (e) => {
@@ -3,7 +3,7 @@
3
3
  var chunkEFIRD3FN_js = require('./chunk-EFIRD3FN.js');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
 
6
- var PACKAGE_VERSION = "0.0.22" ;
6
+ var PACKAGE_VERSION = "0.0.23" ;
7
7
  var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
8
8
  function VersionBadge({
9
9
  className,
@@ -39,50 +39,58 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
39
39
  };
40
40
  document.addEventListener("click", stopClick2, true);
41
41
  }, []);
42
- const bind = react$1.useGesture({
43
- onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
44
- event.stopPropagation();
45
- event.preventDefault();
46
- if (selectRange.current[0] === null) {
47
- selectRange.current[0] = getHoverElementAndIndex(
48
- typeof document !== "undefined" ? document.elementFromPoint(...initial) : null,
49
- inputs.current
50
- );
51
- }
52
- let newMX = memo + dx / 2;
53
- if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
54
- const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
55
- const newValue = value.map((v, i) => {
56
- const [first, last] = selectRange.current;
57
- if (first === null || last === null) {
58
- return v;
59
- } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
60
- return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
61
- } else {
62
- return v;
63
- }
64
- });
65
- onValuesChange == null ? void 0 : onValuesChange(newValue);
66
- newMX = 0;
67
- inputChange.current = true;
68
- changeElementsHoverState(inputs.current, selectRange.current, "x");
69
- stopClick();
70
- }
71
- if (!inputChange.current) {
72
- const currentElement = typeof document !== "undefined" ? document.elementFromPoint(...xy) : null;
73
- const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
74
- selectRange.current[1] = currentIndex ?? selectRange.current[1];
75
- changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
76
- stopClick();
42
+ const bind = react$1.useGesture(
43
+ {
44
+ onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
45
+ if (typeof document === "undefined") return memo || 0;
46
+ event.stopPropagation();
47
+ event.preventDefault();
48
+ if (selectRange.current[0] === null) {
49
+ selectRange.current[0] = getHoverElementAndIndex(
50
+ document.elementFromPoint(...initial),
51
+ inputs.current
52
+ );
53
+ }
54
+ let newMX = memo + dx / 2;
55
+ if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
56
+ const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
57
+ const newValue = value.map((v, i) => {
58
+ const [first, last] = selectRange.current;
59
+ if (first === null || last === null) {
60
+ return v;
61
+ } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
62
+ return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
63
+ } else {
64
+ return v;
65
+ }
66
+ });
67
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
68
+ newMX = 0;
69
+ inputChange.current = true;
70
+ changeElementsHoverState(inputs.current, selectRange.current, "x");
71
+ stopClick();
72
+ }
73
+ if (!inputChange.current) {
74
+ const currentElement = document.elementFromPoint(...xy);
75
+ const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
76
+ selectRange.current[1] = currentIndex ?? selectRange.current[1];
77
+ changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
78
+ stopClick();
79
+ }
80
+ return newMX;
81
+ },
82
+ onDragEnd: () => {
83
+ if (typeof document === "undefined") return;
84
+ selectRange.current = [null, null];
85
+ inputChange.current = false;
86
+ changeElementsHoverState(inputs.current, selectRange.current, "none");
77
87
  }
78
- return newMX;
79
88
  },
80
- onDragEnd: () => {
81
- selectRange.current = [null, null];
82
- inputChange.current = false;
83
- changeElementsHoverState(inputs.current, selectRange.current, "none");
89
+ {
90
+ // Pass config options to make gesture library SSR-safe
91
+ enabled: typeof document !== "undefined"
84
92
  }
85
- });
93
+ );
86
94
  const valueChangeHandler = react.useCallback(
87
95
  (index) => {
88
96
  return (e) => {
@@ -1,7 +1,7 @@
1
1
  import { Badge } from './chunk-WO3WHXDP.mjs';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
- var PACKAGE_VERSION = "0.0.22" ;
4
+ var PACKAGE_VERSION = "0.0.23" ;
5
5
  var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
6
6
  function VersionBadge({
7
7
  className,
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./chunk-N7CINZS2.js');
4
4
  var chunk2YCL2ET2_js = require('./chunk-2YCL2ET2.js');
5
- var chunk6ESGGXBG_js = require('./chunk-6ESGGXBG.js');
5
+ var chunkC7VFXWS6_js = require('./chunk-C7VFXWS6.js');
6
6
  var chunkH5P4IX7R_js = require('./chunk-H5P4IX7R.js');
7
7
  var chunkPVRQNCSJ_js = require('./chunk-PVRQNCSJ.js');
8
8
  var chunkAOUGWGQR_js = require('./chunk-AOUGWGQR.js');
@@ -22,7 +22,7 @@ var chunkX55EAYE2_js = require('./chunk-X55EAYE2.js');
22
22
  var chunk5TVG5JK5_js = require('./chunk-5TVG5JK5.js');
23
23
  var chunk2JCULHBM_js = require('./chunk-2JCULHBM.js');
24
24
  var chunkFP26SRGL_js = require('./chunk-FP26SRGL.js');
25
- var chunkFORVP7XH_js = require('./chunk-FORVP7XH.js');
25
+ var chunkFUQCOZWA_js = require('./chunk-FUQCOZWA.js');
26
26
  var chunk6N5422RT_js = require('./chunk-6N5422RT.js');
27
27
  require('./chunk-KJ42IGH6.js');
28
28
  var chunkQEY7BWIR_js = require('./chunk-QEY7BWIR.js');
@@ -47,7 +47,7 @@ Object.defineProperty(exports, "TreeView", {
47
47
  });
48
48
  Object.defineProperty(exports, "VersionBadge", {
49
49
  enumerable: true,
50
- get: function () { return chunk6ESGGXBG_js.VersionBadge; }
50
+ get: function () { return chunkC7VFXWS6_js.VersionBadge; }
51
51
  });
52
52
  Object.defineProperty(exports, "Switch", {
53
53
  enumerable: true,
@@ -327,7 +327,7 @@ Object.defineProperty(exports, "DropdownMenuTrigger", {
327
327
  });
328
328
  Object.defineProperty(exports, "InputNumbers", {
329
329
  enumerable: true,
330
- get: function () { return chunkFORVP7XH_js.InputNumbers; }
330
+ get: function () { return chunkFUQCOZWA_js.InputNumbers; }
331
331
  });
332
332
  Object.defineProperty(exports, "Avatar", {
333
333
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import './chunk-F56ZKT7B.mjs';
2
2
  export { TreeView } from './chunk-UKFVRXAR.mjs';
3
- export { VersionBadge } from './chunk-YW3YL6GR.mjs';
3
+ export { VersionBadge } from './chunk-QZVQRU25.mjs';
4
4
  export { Switch } from './chunk-JAMJUXBY.mjs';
5
5
  export { ThemeProvider, useTheme } from './chunk-LEPXSM36.mjs';
6
6
  export { Timeline } from './chunk-ZVG2UKKC.mjs';
@@ -20,7 +20,7 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
20
20
  export { Checkbox } from './chunk-G6PRZVSE.mjs';
21
21
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './chunk-FRT225GK.mjs';
22
22
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './chunk-EUY74AXP.mjs';
23
- export { InputNumbers } from './chunk-G5KMD72J.mjs';
23
+ export { InputNumbers } from './chunk-7JAADHQO.mjs';
24
24
  export { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from './chunk-F776EMXP.mjs';
25
25
  import './chunk-VGCVIHBR.mjs';
26
26
  export { CursorProvider } from './chunk-OOI3SJDU.mjs';
package/dist/ui/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('../chunk-N7CINZS2.js');
4
4
  var chunk2YCL2ET2_js = require('../chunk-2YCL2ET2.js');
5
- var chunk6ESGGXBG_js = require('../chunk-6ESGGXBG.js');
5
+ var chunkC7VFXWS6_js = require('../chunk-C7VFXWS6.js');
6
6
  var chunkH5P4IX7R_js = require('../chunk-H5P4IX7R.js');
7
7
  var chunkPVRQNCSJ_js = require('../chunk-PVRQNCSJ.js');
8
8
  var chunkAOUGWGQR_js = require('../chunk-AOUGWGQR.js');
@@ -22,7 +22,7 @@ var chunkX55EAYE2_js = require('../chunk-X55EAYE2.js');
22
22
  var chunk5TVG5JK5_js = require('../chunk-5TVG5JK5.js');
23
23
  var chunk2JCULHBM_js = require('../chunk-2JCULHBM.js');
24
24
  var chunkFP26SRGL_js = require('../chunk-FP26SRGL.js');
25
- var chunkFORVP7XH_js = require('../chunk-FORVP7XH.js');
25
+ var chunkFUQCOZWA_js = require('../chunk-FUQCOZWA.js');
26
26
  var chunk6N5422RT_js = require('../chunk-6N5422RT.js');
27
27
  var chunkIXHMIR5P_js = require('../chunk-IXHMIR5P.js');
28
28
  var chunk5OUTEHVX_js = require('../chunk-5OUTEHVX.js');
@@ -42,7 +42,7 @@ Object.defineProperty(exports, "TreeView", {
42
42
  });
43
43
  Object.defineProperty(exports, "VersionBadge", {
44
44
  enumerable: true,
45
- get: function () { return chunk6ESGGXBG_js.VersionBadge; }
45
+ get: function () { return chunkC7VFXWS6_js.VersionBadge; }
46
46
  });
47
47
  Object.defineProperty(exports, "Switch", {
48
48
  enumerable: true,
@@ -322,7 +322,7 @@ Object.defineProperty(exports, "DropdownMenuTrigger", {
322
322
  });
323
323
  Object.defineProperty(exports, "InputNumbers", {
324
324
  enumerable: true,
325
- get: function () { return chunkFORVP7XH_js.InputNumbers; }
325
+ get: function () { return chunkFUQCOZWA_js.InputNumbers; }
326
326
  });
327
327
  Object.defineProperty(exports, "Avatar", {
328
328
  enumerable: true,
package/dist/ui/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import '../chunk-F56ZKT7B.mjs';
2
2
  export { TreeView } from '../chunk-UKFVRXAR.mjs';
3
- export { VersionBadge } from '../chunk-YW3YL6GR.mjs';
3
+ export { VersionBadge } from '../chunk-QZVQRU25.mjs';
4
4
  export { Switch } from '../chunk-JAMJUXBY.mjs';
5
5
  export { ThemeProvider, useTheme } from '../chunk-LEPXSM36.mjs';
6
6
  export { Timeline } from '../chunk-ZVG2UKKC.mjs';
@@ -20,7 +20,7 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
20
20
  export { Checkbox } from '../chunk-G6PRZVSE.mjs';
21
21
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../chunk-FRT225GK.mjs';
22
22
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '../chunk-EUY74AXP.mjs';
23
- export { InputNumbers } from '../chunk-G5KMD72J.mjs';
23
+ export { InputNumbers } from '../chunk-7JAADHQO.mjs';
24
24
  export { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '../chunk-F776EMXP.mjs';
25
25
  export { Tabs, TabsContent, TabsList, TabsTrigger } from '../chunk-MRVMXKZO.mjs';
26
26
  export { Textarea } from '../chunk-DDOX4EEM.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkFORVP7XH_js = require('../chunk-FORVP7XH.js');
3
+ var chunkFUQCOZWA_js = require('../chunk-FUQCOZWA.js');
4
4
  require('../chunk-SKO72K64.js');
5
5
  require('../chunk-XWS4SIB5.js');
6
6
  require('../chunk-EOFYA6CS.js');
@@ -10,5 +10,5 @@ require('../chunk-XXWQ4RVP.js');
10
10
 
11
11
  Object.defineProperty(exports, "InputNumbers", {
12
12
  enumerable: true,
13
- get: function () { return chunkFORVP7XH_js.InputNumbers; }
13
+ get: function () { return chunkFUQCOZWA_js.InputNumbers; }
14
14
  });
@@ -1,4 +1,4 @@
1
- export { InputNumbers } from '../chunk-G5KMD72J.mjs';
1
+ export { InputNumbers } from '../chunk-7JAADHQO.mjs';
2
2
  import '../chunk-QYRRQ65X.mjs';
3
3
  import '../chunk-M4IVLZIH.mjs';
4
4
  import '../chunk-Q5KEB4UK.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk6ESGGXBG_js = require('../chunk-6ESGGXBG.js');
3
+ var chunkC7VFXWS6_js = require('../chunk-C7VFXWS6.js');
4
4
  require('../chunk-EFIRD3FN.js');
5
5
  require('../chunk-XWS4SIB5.js');
6
6
  require('../chunk-EOFYA6CS.js');
@@ -10,5 +10,5 @@ require('../chunk-XXWQ4RVP.js');
10
10
 
11
11
  Object.defineProperty(exports, "VersionBadge", {
12
12
  enumerable: true,
13
- get: function () { return chunk6ESGGXBG_js.VersionBadge; }
13
+ get: function () { return chunkC7VFXWS6_js.VersionBadge; }
14
14
  });
@@ -1,4 +1,4 @@
1
- export { VersionBadge } from '../chunk-YW3YL6GR.mjs';
1
+ export { VersionBadge } from '../chunk-QZVQRU25.mjs';
2
2
  import '../chunk-WO3WHXDP.mjs';
3
3
  import '../chunk-M4IVLZIH.mjs';
4
4
  import '../chunk-Q5KEB4UK.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuer-ai/vuer-uikit",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "React UI Kit components",
5
5
  "keywords": [
6
6
  "react",
@@ -63,62 +63,73 @@ const InputNumbers = forwardRef<HTMLDivElement, InputNumbersProps>(function Inpu
63
63
  document.addEventListener("click", stopClick, true);
64
64
  }, []);
65
65
 
66
- const bind = useGesture({
67
- onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
68
- event.stopPropagation();
69
- event.preventDefault();
70
-
71
- if (selectRange.current[0] === null) {
72
- selectRange.current[0] = getHoverElementAndIndex(
73
- typeof document !== "undefined" ? document.elementFromPoint(...initial) : null,
74
- inputs.current,
75
- );
76
- }
77
-
78
- let newMX: number = memo + dx / 2;
79
-
80
- if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
81
- const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
82
-
83
- const newValue = value.map((v, i) => {
84
- const [first, last] = selectRange.current;
85
- if (first === null || last === null) {
86
- return v;
87
- } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
88
- return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
89
- } else {
90
- return v;
91
- }
92
- });
93
- onValuesChange?.(newValue);
94
- newMX = 0;
95
- inputChange.current = true;
96
-
97
- changeElementsHoverState(inputs.current, selectRange.current, "x");
98
-
99
- stopClick();
100
- }
101
-
102
- if (!inputChange.current) {
103
- const currentElement =
104
- typeof document !== "undefined" ? document.elementFromPoint(...xy) : null;
105
-
106
- const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
107
- selectRange.current[1] = currentIndex ?? selectRange.current[1];
108
-
109
- changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
110
-
111
- stopClick();
112
- }
113
-
114
- return newMX;
66
+ const bind = useGesture(
67
+ {
68
+ onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
69
+ // SSR guard - if no document, return early
70
+ if (typeof document === "undefined") return memo || 0;
71
+
72
+ event.stopPropagation();
73
+ event.preventDefault();
74
+
75
+ if (selectRange.current[0] === null) {
76
+ selectRange.current[0] = getHoverElementAndIndex(
77
+ document.elementFromPoint(...initial),
78
+ inputs.current,
79
+ );
80
+ }
81
+
82
+ let newMX: number = memo + dx / 2;
83
+
84
+ if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
85
+ const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
86
+
87
+ const newValue = value.map((v, i) => {
88
+ const [first, last] = selectRange.current;
89
+ if (first === null || last === null) {
90
+ return v;
91
+ } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
92
+ return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
93
+ } else {
94
+ return v;
95
+ }
96
+ });
97
+ onValuesChange?.(newValue);
98
+ newMX = 0;
99
+ inputChange.current = true;
100
+
101
+ changeElementsHoverState(inputs.current, selectRange.current, "x");
102
+
103
+ stopClick();
104
+ }
105
+
106
+ if (!inputChange.current) {
107
+ const currentElement = document.elementFromPoint(...xy);
108
+
109
+ const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
110
+ selectRange.current[1] = currentIndex ?? selectRange.current[1];
111
+
112
+ changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
113
+
114
+ stopClick();
115
+ }
116
+
117
+ return newMX;
118
+ },
119
+ onDragEnd: () => {
120
+ // SSR guard
121
+ if (typeof document === "undefined") return;
122
+
123
+ selectRange.current = [null, null];
124
+ inputChange.current = false;
125
+ changeElementsHoverState(inputs.current, selectRange.current, "none");
126
+ },
115
127
  },
116
- onDragEnd: () => {
117
- selectRange.current = [null, null];
118
- inputChange.current = false;
119
- changeElementsHoverState(inputs.current, selectRange.current, "none");
128
+ {
129
+ // Pass config options to make gesture library SSR-safe
130
+ enabled: typeof document !== "undefined",
120
131
  },
121
- });
132
+ );
122
133
 
123
134
  const valueChangeHandler = useCallback(
124
135
  (index: number) => {