@os-design/use-cursor-position 1.0.2 → 1.0.5
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/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +5 -4
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["useCursorPosition","useState","x","y","cursorPosition","setCursorPosition","mouseMoveHandler","useCallback","e","clientX","clientY","touchMoveHandler","touches","length","useEvent","window"],"sources":["../../src/index.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport useEvent from '@os-design/use-event';\n\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\nconst useCursorPosition = () => {\n const [cursorPosition, setCursorPosition] = useState<CursorPosition>({\n x: 0,\n y: 0,\n });\n\n const mouseMoveHandler = useCallback((e: MouseEvent) => {\n setCursorPosition({ x: e.clientX, y: e.clientY });\n }, []);\n\n const touchMoveHandler = useCallback((e: TouchEvent) => {\n if (e.touches.length === 0) return;\n setCursorPosition({ x: e.touches[0].clientX, y: e.touches[0].clientY });\n }, []);\n\n useEvent(window, 'mousemove', mouseMoveHandler);\n useEvent(window, 'touchstart', touchMoveHandler);\n useEvent(window, 'touchmove', touchMoveHandler);\n\n return cursorPosition;\n};\n\nexport default useCursorPosition;\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;;;;;;;;;AAOA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,GAAM;EAC9B,gBAA4C,IAAAC,eAAA,EAAyB;IACnEC,CAAC,EAAE,CADgE;IAEnEC,CAAC,EAAE;EAFgE,CAAzB,CAA5C;EAAA;EAAA,IAAOC,cAAP;EAAA,IAAuBC,iBAAvB;;EAKA,IAAMC,gBAAgB,GAAG,IAAAC,kBAAA,EAAY,UAACC,CAAD,EAAmB;IACtDH,iBAAiB,CAAC;MAAEH,CAAC,EAAEM,CAAC,CAACC,OAAP;MAAgBN,CAAC,EAAEK,CAAC,CAACE;IAArB,CAAD,CAAjB;EACD,CAFwB,EAEtB,EAFsB,CAAzB;EAIA,IAAMC,gBAAgB,GAAG,IAAAJ,kBAAA,EAAY,UAACC,CAAD,EAAmB;IACtD,IAAIA,CAAC,CAACI,OAAF,CAAUC,MAAV,KAAqB,CAAzB,EAA4B;IAC5BR,iBAAiB,CAAC;MAAEH,CAAC,EAAEM,CAAC,CAACI,OAAF,CAAU,CAAV,EAAaH,OAAlB;MAA2BN,CAAC,EAAEK,CAAC,CAACI,OAAF,CAAU,CAAV,EAAaF;IAA3C,CAAD,CAAjB;EACD,CAHwB,EAGtB,EAHsB,CAAzB;EAKA,IAAAI,oBAAA,EAASC,MAAT,EAAiB,WAAjB,EAA8BT,gBAA9B;EACA,IAAAQ,oBAAA,EAASC,MAAT,EAAiB,YAAjB,EAA+BJ,gBAA/B;EACA,IAAAG,oBAAA,EAASC,MAAT,EAAiB,WAAjB,EAA8BJ,gBAA9B;EAEA,OAAOP,cAAP;AACD,CApBD;;eAsBeJ,iB"}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["useCallback","useState","useEvent","useCursorPosition","cursorPosition","setCursorPosition","x","y","mouseMoveHandler","e","clientX","clientY","touchMoveHandler","touches","length","window"],"sources":["../../src/index.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport useEvent from '@os-design/use-event';\n\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\nconst useCursorPosition = () => {\n const [cursorPosition, setCursorPosition] = useState<CursorPosition>({\n x: 0,\n y: 0,\n });\n\n const mouseMoveHandler = useCallback((e: MouseEvent) => {\n setCursorPosition({ x: e.clientX, y: e.clientY });\n }, []);\n\n const touchMoveHandler = useCallback((e: TouchEvent) => {\n if (e.touches.length === 0) return;\n setCursorPosition({ x: e.touches[0].clientX, y: e.touches[0].clientY });\n }, []);\n\n useEvent(window, 'mousemove', mouseMoveHandler);\n useEvent(window, 'touchstart', touchMoveHandler);\n useEvent(window, 'touchmove', touchMoveHandler);\n\n return cursorPosition;\n};\n\nexport default useCursorPosition;\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,QAAtB,QAAsC,OAAtC;AACA,OAAOC,QAAP,MAAqB,sBAArB;;AAOA,MAAMC,iBAAiB,GAAG,MAAM;EAC9B,MAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsCJ,QAAQ,CAAiB;IACnEK,CAAC,EAAE,CADgE;IAEnEC,CAAC,EAAE;EAFgE,CAAjB,CAApD;EAKA,MAAMC,gBAAgB,GAAGR,WAAW,CAAES,CAAD,IAAmB;IACtDJ,iBAAiB,CAAC;MAAEC,CAAC,EAAEG,CAAC,CAACC,OAAP;MAAgBH,CAAC,EAAEE,CAAC,CAACE;IAArB,CAAD,CAAjB;EACD,CAFmC,EAEjC,EAFiC,CAApC;EAIA,MAAMC,gBAAgB,GAAGZ,WAAW,CAAES,CAAD,IAAmB;IACtD,IAAIA,CAAC,CAACI,OAAF,CAAUC,MAAV,KAAqB,CAAzB,EAA4B;IAC5BT,iBAAiB,CAAC;MAAEC,CAAC,EAAEG,CAAC,CAACI,OAAF,CAAU,CAAV,EAAaH,OAAlB;MAA2BH,CAAC,EAAEE,CAAC,CAACI,OAAF,CAAU,CAAV,EAAaF;IAA3C,CAAD,CAAjB;EACD,CAHmC,EAGjC,EAHiC,CAApC;EAKAT,QAAQ,CAACa,MAAD,EAAS,WAAT,EAAsBP,gBAAtB,CAAR;EACAN,QAAQ,CAACa,MAAD,EAAS,YAAT,EAAuBH,gBAAvB,CAAR;EACAV,QAAQ,CAACa,MAAD,EAAS,WAAT,EAAsBH,gBAAtB,CAAR;EAEA,OAAOR,cAAP;AACD,CApBD;;AAsBA,eAAeD,iBAAf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/use-cursor-position",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"require": "./dist/cjs/index.js",
|
|
12
12
|
"default": "./dist/esm/index.js"
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"dist"
|
|
@@ -28,10 +29,10 @@
|
|
|
28
29
|
"access": "public"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@os-design/use-event": "^1.0.
|
|
32
|
+
"@os-design/use-event": "^1.0.9"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": ">=18"
|
|
35
36
|
},
|
|
36
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "bf790a74d01c9745a6cd8bae8ac6ad650ae42b62"
|
|
37
38
|
}
|