@corva/ui 3.80.0-rc.0 → 3.80.0
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/cjs-bundle/components/Chart/effects/useKeyboardControl.js +1 -1
- package/cjs-bundle/components/Chart/effects/useKeyboardControl.js.map +1 -1
- package/components/Chart/effects/useKeyboardControl.d.ts.map +1 -1
- package/components/Chart/effects/useKeyboardControl.js +1 -1
- package/components/Chart/effects/useKeyboardControl.js.map +1 -1
- package/mcp-server/server.mjs +3 -3
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.useKeyboardControl=function(t){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.useKeyboardControl=function(t){var r=t.keyCode,n=t.callback,o=e.useRef(n);o.current=n,e.useEffect((function(){var e=function(e){(e.metaKey||e.ctrlKey)&&e.keyCode===r&&(e.preventDefault(),o.current())};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r])};
|
|
2
2
|
//# sourceMappingURL=useKeyboardControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardControl.js","sources":["../../../../../src/components/Chart/effects/useKeyboardControl.js"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useKeyboardControl = ({ keyCode, callback }) => {\n const handleKeyDownAction = event => {\n
|
|
1
|
+
{"version":3,"file":"useKeyboardControl.js","sources":["../../../../../src/components/Chart/effects/useKeyboardControl.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nexport const useKeyboardControl = ({ keyCode, callback }) => {\n // The listener outlives every render, so it reads the callback through a ref: the chart it\n // zooms only exists from the second render on, and a captured callback would hold the first.\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n\n useEffect(() => {\n const handleKeyDownAction = event => {\n if ((event.metaKey || event.ctrlKey) && event.keyCode === keyCode) {\n event.preventDefault();\n callbackRef.current();\n }\n };\n\n document.addEventListener('keydown', handleKeyDownAction);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDownAction);\n };\n }, [keyCode]);\n};\n"],"names":["_ref","keyCode","callback","callbackRef","useRef","current","useEffect","handleKeyDownAction","event","metaKey","ctrlKey","preventDefault","document","addEventListener","removeEventListener"],"mappings":"sHAEkC,SAA2BA,GAAA,IAAxBC,IAAAA,QAASC,IAAAA,SAGtCC,EAAcC,SAAOF,GAC3BC,EAAYE,QAAUH,EAEtBI,EAAAA,WAAU,WACR,IAAMC,EAAsB,SAAAC,IACrBA,EAAMC,SAAWD,EAAME,UAAYF,EAAMP,UAAYA,IACxDO,EAAMG,iBACNR,EAAYE,YAMhB,OAFAO,SAASC,iBAAiB,UAAWN,GAE9B,WACLK,SAASE,oBAAoB,UAAWP,GAE5C,GAAG,CAACN,GACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardControl.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/effects/useKeyboardControl.js"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;
|
|
1
|
+
{"version":3,"file":"useKeyboardControl.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/effects/useKeyboardControl.js"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;UAoB9B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useRef as e,useEffect as n}from"react";var t=function(t){var r=t.keyCode,o=t.callback,c=e(o);c.current=o,n((function(){var e=function(e){(e.metaKey||e.ctrlKey)&&e.keyCode===r&&(e.preventDefault(),c.current())};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r])};export{t as useKeyboardControl};
|
|
2
2
|
//# sourceMappingURL=useKeyboardControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardControl.js","sources":["../../../../src/components/Chart/effects/useKeyboardControl.js"],"sourcesContent":["import { useEffect } from 'react';\n\nexport const useKeyboardControl = ({ keyCode, callback }) => {\n const handleKeyDownAction = event => {\n
|
|
1
|
+
{"version":3,"file":"useKeyboardControl.js","sources":["../../../../src/components/Chart/effects/useKeyboardControl.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nexport const useKeyboardControl = ({ keyCode, callback }) => {\n // The listener outlives every render, so it reads the callback through a ref: the chart it\n // zooms only exists from the second render on, and a captured callback would hold the first.\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n\n useEffect(() => {\n const handleKeyDownAction = event => {\n if ((event.metaKey || event.ctrlKey) && event.keyCode === keyCode) {\n event.preventDefault();\n callbackRef.current();\n }\n };\n\n document.addEventListener('keydown', handleKeyDownAction);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDownAction);\n };\n }, [keyCode]);\n};\n"],"names":["useKeyboardControl","_ref","keyCode","callback","callbackRef","useRef","current","useEffect","handleKeyDownAction","event","metaKey","ctrlKey","preventDefault","document","addEventListener","removeEventListener"],"mappings":"8CAEaA,IAAAA,EAAqB,SAA2BC,GAAA,IAAxBC,IAAAA,QAASC,IAAAA,SAGtCC,EAAcC,EAAOF,GAC3BC,EAAYE,QAAUH,EAEtBI,GAAU,WACR,IAAMC,EAAsB,SAAAC,IACrBA,EAAMC,SAAWD,EAAME,UAAYF,EAAMP,UAAYA,IACxDO,EAAMG,iBACNR,EAAYE,YAMhB,OAFAO,SAASC,iBAAiB,UAAWN,GAE9B,WACLK,SAASE,oBAAoB,UAAWP,GAE5C,GAAG,CAACN,GACN"}
|