From 32bd930daeef163143f6bce9edf7bbc2311bff3d Mon Sep 17 00:00:00 2001 From: "Alan.He" Date: Sat, 2 Nov 2024 10:59:44 +0800 Subject: [PATCH] feat: support cursor editor (#88) Co-authored-by: Eric Clemmons --- .changeset/many-lies-fold.md | 5 +++++ .gitignore | 1 + packages/click-to-react-component/README.md | 2 +- packages/click-to-react-component/src/types.d.ts | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/many-lies-fold.md diff --git a/.changeset/many-lies-fold.md b/.changeset/many-lies-fold.md new file mode 100644 index 0000000..f8b751d --- /dev/null +++ b/.changeset/many-lies-fold.md @@ -0,0 +1,5 @@ +--- +"click-to-react-component": patch +--- + +feat: support cursor diff --git a/.gitignore b/.gitignore index 30293be..6126de9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .turbo +.idea # Logs logs diff --git a/packages/click-to-react-component/README.md b/packages/click-to-react-component/README.md index 97d8775..ea23514 100644 --- a/packages/click-to-react-component/README.md +++ b/packages/click-to-react-component/README.md @@ -18,7 +18,7 @@ [Create React App](https://create-react-app.dev/), & [Vite](https://github.com/vitejs/vite/tree/main/packages/plugin-react) that use [@babel/plugin-transform-react-jsx-source](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source) -- Supports `vscode` & `vscode-insiders`' [URL handling](https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls) +- Supports `vscode` & `vscode-insiders` & `cursor` [URL handling](https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls) - Automatically **tree-shaken** from `production` builds - Keyboard navigation in context menu (e.g. , , ) - More context & faster than using React DevTools: diff --git a/packages/click-to-react-component/src/types.d.ts b/packages/click-to-react-component/src/types.d.ts index 727e296..5a5314c 100644 --- a/packages/click-to-react-component/src/types.d.ts +++ b/packages/click-to-react-component/src/types.d.ts @@ -1,6 +1,6 @@ -export { ClickToComponent } from './ClickToComponent' +export { ClickToComponent } from './ClickToComponent'; -export type Editor = 'vscode' | 'vscode-insiders' +export type Editor = 'vscode' | 'vscode-insiders' | 'cursor'; export type PathModifier = (path: string) => string; @@ -16,4 +16,4 @@ export type Target = HTMLElement export type ContextMenuProps = { onClose?: () => void; pathModifier?: PathModifier; -} \ No newline at end of file +}