@radix-ui/react-use-escape-keydown 1.1.7-rc.1796411593667 → 1.1.7
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/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/use-escape-keydown.tsx"],
|
|
4
|
-
"sourcesContent": ["export { useEscapeKeydown } from './use-escape-keydown';\n", "import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n *\n * @deprecated Attach listeners directly via useEffect for more granular control\n * over how callbacks are stabilized, when to detach listeners, etc.\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document,\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // An Escape during an IME composition belongs to the input method (see DismissableLayer).\n if (event.key === 'Escape' && !event.isComposing && event.keyCode !== 229) {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n"],
|
|
4
|
+
"sourcesContent": ["export { useEscapeKeydown } from './use-escape-keydown.js';\n", "import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n *\n * @deprecated Attach listeners directly via useEffect for more granular control\n * over how callbacks are stabilized, when to detach listeners, etc.\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document,\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // An Escape during an IME composition belongs to the input method (see DismissableLayer).\n if (event.key === 'Escape' && !event.isComposing && event.keyCode !== 229) {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,oCAA+B;AAQ/B,SAAS,iBACP,qBACA,gBAA0B,YAAY,UACtC;AACA,QAAM,sBAAkB,8CAAe,mBAAmB;AAE1D,EAAM,gBAAU,MAAM;AACpB,UAAM,gBAAgB,wBAAC,UAAyB;AAE9C,UAAI,MAAM,QAAQ,YAAY,CAAC,MAAM,eAAe,MAAM,YAAY,KAAK;AACzE,wBAAgB,KAAK;AAAA,MACvB;AAAA,IACF,GALsB;AAMtB,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAAA,EAC5F,GAAG,CAAC,iBAAiB,aAAa,CAAC;AACrC;AAhBS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-use-escape-keydown",
|
|
3
|
-
"version": "1.1.7
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@radix-ui/react-use-callback-ref": "1.1.
|
|
14
|
+
"@radix-ui/react-use-callback-ref": "1.1.6"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/react": "^19.3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"lint": "oxlint --max-warnings 0 src",
|
|
45
45
|
"clean": "rm -rf dist",
|
|
46
46
|
"reset": "rm -rf dist node_modules",
|
|
47
|
-
"
|
|
47
|
+
"types:check:pkg": "tsc --noEmit",
|
|
48
48
|
"build": "radix-build"
|
|
49
49
|
},
|
|
50
50
|
"types": "./dist/index.d.ts",
|