From f779f0a6c773d6456f18193cab033287a7277926 Mon Sep 17 00:00:00 2001 From: Phoomparin Mano Date: Sun, 17 Dec 2023 02:28:23 +0700 Subject: [PATCH] fix: add codemirror/state as direct dependency --- canvas/package.json | 2 ++ canvas/pnpm-lock.yaml | 26 +++++++------------ canvas/src/canvas/components/SlashCommand.tsx | 2 +- canvas/tsconfig.json | 2 +- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/canvas/package.json b/canvas/package.json index 090bc1f8..1af175dd 100644 --- a/canvas/package.json +++ b/canvas/package.json @@ -17,6 +17,8 @@ "@codemirror/autocomplete": "^6.11.1", "@codemirror/commands": "^6.3.2", "@codemirror/language": "^6.9.3", + "@codemirror/state": "^6.3.3", + "@codemirror/view": "^6.22.3", "@dnd-kit/core": "^6.1.0", "@dnd-kit/modifiers": "^7.0.0", "@iconify/react": "^4.1.1", diff --git a/canvas/pnpm-lock.yaml b/canvas/pnpm-lock.yaml index 89fd7370..168e48f3 100644 --- a/canvas/pnpm-lock.yaml +++ b/canvas/pnpm-lock.yaml @@ -14,6 +14,12 @@ dependencies: '@codemirror/language': specifier: ^6.9.3 version: 6.9.3 + '@codemirror/state': + specifier: ^6.3.3 + version: 6.3.3 + '@codemirror/view': + specifier: ^6.22.3 + version: 6.22.3 '@dnd-kit/core': specifier: ^6.1.0 version: 6.1.0(react-dom@18.2.0)(react@18.2.0) @@ -474,16 +480,16 @@ packages: resolution: {integrity: sha512-tjoi4MCWDNxgIpoLZ7+tezdS9OEB6pkiDKhfKx9ReJ/XBcs2G2RXIu+/FxXBlWsPTsz6C9q/r4gjzrsxpcnqCQ==} dependencies: '@codemirror/language': 6.9.3 - '@codemirror/state': 6.3.1 - '@codemirror/view': 6.21.4 + '@codemirror/state': 6.3.3 + '@codemirror/view': 6.22.3 '@lezer/common': 1.1.0 dev: false /@codemirror/language@6.9.3: resolution: {integrity: sha512-qq48pYzoi6ldYWV/52+Z9Ou6QouVI+8YwvxFbUypI33NbjG2UeRHKENRyhwljTTiOqjQ33FjyZj6EREQ9apAOQ==} dependencies: - '@codemirror/state': 6.3.1 - '@codemirror/view': 6.21.4 + '@codemirror/state': 6.3.3 + '@codemirror/view': 6.22.3 '@lezer/common': 1.1.0 '@lezer/highlight': 1.2.0 '@lezer/lr': 1.3.14 @@ -506,10 +512,6 @@ packages: crelt: 1.0.6 dev: false - /@codemirror/state@6.3.1: - resolution: {integrity: sha512-88e4HhMtKJyw6fKprGaN/yZfiaoGYOi2nM45YCUC6R/kex9sxFWBDGatS1vk4lMgnWmdIIB9tk8Gj1LmL8YfvA==} - dev: false - /@codemirror/state@6.3.3: resolution: {integrity: sha512-0wufKcTw2dEwEaADajjHf6hBy1sh3M6V0e+q4JKIhLuiMSe5td5HOWpUdvKth1fT1M9VYOboajoBHpkCd7PG7A==} dev: false @@ -523,14 +525,6 @@ packages: '@lezer/highlight': 1.2.0 dev: false - /@codemirror/view@6.21.4: - resolution: {integrity: sha512-WKVZ7nvN0lwWPfAf05WxWqTpwjC8YN3q5goj3CsSig7//DD81LULgOx3nBegqpqP0iygBqRmW8z0KSc2QTAdAg==} - dependencies: - '@codemirror/state': 6.3.1 - style-mod: 4.1.0 - w3c-keyname: 2.2.8 - dev: false - /@codemirror/view@6.22.3: resolution: {integrity: sha512-rqnq+Zospwoi3x1vZ8BGV1MlRsaGljX+6qiGYmIpJ++M+LCC+wjfDaPklhwpWSgv7pr/qx29KiAKQBH5+DOn4w==} dependencies: diff --git a/canvas/src/canvas/components/SlashCommand.tsx b/canvas/src/canvas/components/SlashCommand.tsx index 94220627..ba053d24 100644 --- a/canvas/src/canvas/components/SlashCommand.tsx +++ b/canvas/src/canvas/components/SlashCommand.tsx @@ -121,7 +121,7 @@ export function SlashCommand() { return } - const position = flow.project(cursor) + const position = flow.screenToFlowPosition(cursor) const ok = run(command, { input, position }) if (ok) hide() diff --git a/canvas/tsconfig.json b/canvas/tsconfig.json index aa40bf9f..57761e8d 100644 --- a/canvas/tsconfig.json +++ b/canvas/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2015", "ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", + "module": "ES2020", "skipLibCheck": true, /* Bundler mode */