@vuer-ai/vuer-uikit 0.0.21 → 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,8 +3,8 @@
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.21";
7
- var PACKAGE_NAME = "@vuer-ai/vuer-uikit";
6
+ var PACKAGE_VERSION = "0.0.23" ;
7
+ var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
8
8
  function VersionBadge({
9
9
  className,
10
10
  showPrefix = true,
@@ -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,8 +1,8 @@
1
1
  import { Badge } from './chunk-WO3WHXDP.mjs';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
- var PACKAGE_VERSION = "0.0.21";
5
- var PACKAGE_NAME = "@vuer-ai/vuer-uikit";
4
+ var PACKAGE_VERSION = "0.0.23" ;
5
+ var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
6
6
  function VersionBadge({
7
7
  className,
8
8
  showPrefix = true,
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkV4KNORQN_js = require('../chunk-V4KNORQN.js');
4
- require('../chunk-MZ4POL3U.js');
3
+ var chunkW7D57QE6_js = require('../chunk-W7D57QE6.js');
5
4
  require('../chunk-IXHMIR5P.js');
6
5
  require('../chunk-5OUTEHVX.js');
6
+ require('../chunk-MZ4POL3U.js');
7
+ require('../chunk-OQ237S4Z.js');
7
8
  require('../chunk-SKO72K64.js');
8
9
  require('../chunk-UFHMEEGL.js');
9
- require('../chunk-OQ237S4Z.js');
10
10
  require('../chunk-XWS4SIB5.js');
11
11
  require('../chunk-EOFYA6CS.js');
12
12
  require('../chunk-XXWQ4RVP.js');
@@ -17,21 +17,21 @@ require('../chunk-OTPUWWEB.js');
17
17
 
18
18
  Object.defineProperty(exports, "CursorButton", {
19
19
  enumerable: true,
20
- get: function () { return chunkV4KNORQN_js.CursorButton; }
20
+ get: function () { return chunkW7D57QE6_js.CursorButton; }
21
21
  });
22
22
  Object.defineProperty(exports, "CursorInputRoot", {
23
23
  enumerable: true,
24
- get: function () { return chunkV4KNORQN_js.CursorInputRoot; }
24
+ get: function () { return chunkW7D57QE6_js.CursorInputRoot; }
25
25
  });
26
26
  Object.defineProperty(exports, "CursorSelectTrigger", {
27
27
  enumerable: true,
28
- get: function () { return chunkV4KNORQN_js.CursorSelectTrigger; }
28
+ get: function () { return chunkW7D57QE6_js.CursorSelectTrigger; }
29
29
  });
30
30
  Object.defineProperty(exports, "CursorTabs", {
31
31
  enumerable: true,
32
- get: function () { return chunkV4KNORQN_js.CursorTabs; }
32
+ get: function () { return chunkW7D57QE6_js.CursorTabs; }
33
33
  });
34
34
  Object.defineProperty(exports, "CursorTextarea", {
35
35
  enumerable: true,
36
- get: function () { return chunkV4KNORQN_js.CursorTextarea; }
36
+ get: function () { return chunkW7D57QE6_js.CursorTextarea; }
37
37
  });
@@ -1,10 +1,10 @@
1
- export { CursorButton, CursorInputRoot, CursorSelectTrigger, CursorTabs, CursorTextarea } from '../chunk-HLJ7PQA7.mjs';
2
- import '../chunk-QVUX6LLD.mjs';
1
+ export { CursorButton, CursorInputRoot, CursorSelectTrigger, CursorTabs, CursorTextarea } from '../chunk-ALTUOIWV.mjs';
3
2
  import '../chunk-MRVMXKZO.mjs';
4
3
  import '../chunk-DDOX4EEM.mjs';
4
+ import '../chunk-QVUX6LLD.mjs';
5
+ import '../chunk-VXHM7V6F.mjs';
5
6
  import '../chunk-QYRRQ65X.mjs';
6
7
  import '../chunk-44KW6PTD.mjs';
7
- import '../chunk-VXHM7V6F.mjs';
8
8
  import '../chunk-M4IVLZIH.mjs';
9
9
  import '../chunk-Q5KEB4UK.mjs';
10
10
  import '../chunk-KTNZSZ5Y.mjs';
@@ -2,13 +2,13 @@
2
2
 
3
3
  require('../chunk-KJ42IGH6.js');
4
4
  var chunkQEY7BWIR_js = require('../chunk-QEY7BWIR.js');
5
- var chunkV4KNORQN_js = require('../chunk-V4KNORQN.js');
6
- require('../chunk-MZ4POL3U.js');
5
+ var chunkW7D57QE6_js = require('../chunk-W7D57QE6.js');
7
6
  require('../chunk-IXHMIR5P.js');
8
7
  require('../chunk-5OUTEHVX.js');
8
+ require('../chunk-MZ4POL3U.js');
9
+ require('../chunk-OQ237S4Z.js');
9
10
  require('../chunk-SKO72K64.js');
10
11
  var chunkUFHMEEGL_js = require('../chunk-UFHMEEGL.js');
11
- require('../chunk-OQ237S4Z.js');
12
12
  require('../chunk-XWS4SIB5.js');
13
13
  require('../chunk-EOFYA6CS.js');
14
14
  require('../chunk-XXWQ4RVP.js');
@@ -23,23 +23,23 @@ Object.defineProperty(exports, "CursorProvider", {
23
23
  });
24
24
  Object.defineProperty(exports, "CursorButton", {
25
25
  enumerable: true,
26
- get: function () { return chunkV4KNORQN_js.CursorButton; }
26
+ get: function () { return chunkW7D57QE6_js.CursorButton; }
27
27
  });
28
28
  Object.defineProperty(exports, "CursorInputRoot", {
29
29
  enumerable: true,
30
- get: function () { return chunkV4KNORQN_js.CursorInputRoot; }
30
+ get: function () { return chunkW7D57QE6_js.CursorInputRoot; }
31
31
  });
32
32
  Object.defineProperty(exports, "CursorSelectTrigger", {
33
33
  enumerable: true,
34
- get: function () { return chunkV4KNORQN_js.CursorSelectTrigger; }
34
+ get: function () { return chunkW7D57QE6_js.CursorSelectTrigger; }
35
35
  });
36
36
  Object.defineProperty(exports, "CursorTabs", {
37
37
  enumerable: true,
38
- get: function () { return chunkV4KNORQN_js.CursorTabs; }
38
+ get: function () { return chunkW7D57QE6_js.CursorTabs; }
39
39
  });
40
40
  Object.defineProperty(exports, "CursorTextarea", {
41
41
  enumerable: true,
42
- get: function () { return chunkV4KNORQN_js.CursorTextarea; }
42
+ get: function () { return chunkW7D57QE6_js.CursorTextarea; }
43
43
  });
44
44
  Object.defineProperty(exports, "withCursor", {
45
45
  enumerable: true,
@@ -1,12 +1,12 @@
1
1
  import '../chunk-VGCVIHBR.mjs';
2
2
  export { CursorProvider } from '../chunk-OOI3SJDU.mjs';
3
- export { CursorButton, CursorInputRoot, CursorSelectTrigger, CursorTabs, CursorTextarea } from '../chunk-HLJ7PQA7.mjs';
4
- import '../chunk-QVUX6LLD.mjs';
3
+ export { CursorButton, CursorInputRoot, CursorSelectTrigger, CursorTabs, CursorTextarea } from '../chunk-ALTUOIWV.mjs';
5
4
  import '../chunk-MRVMXKZO.mjs';
6
5
  import '../chunk-DDOX4EEM.mjs';
6
+ import '../chunk-QVUX6LLD.mjs';
7
+ import '../chunk-VXHM7V6F.mjs';
7
8
  import '../chunk-QYRRQ65X.mjs';
8
9
  export { withCursor } from '../chunk-44KW6PTD.mjs';
9
- import '../chunk-VXHM7V6F.mjs';
10
10
  import '../chunk-M4IVLZIH.mjs';
11
11
  import '../chunk-Q5KEB4UK.mjs';
12
12
  import '../chunk-KTNZSZ5Y.mjs';