From 1d08982e2c856bfc60d0f5eb8593cc2826076a42 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Thu, 13 Jun 2024 13:04:21 +0800 Subject: [PATCH 1/3] feat: implement react component --- packages/core/package.json | 9 ++- packages/core/src/editor-instance.ts | 4 ++ packages/core/src/index.ts | 4 +- .../core/src/react/editor-cache-context.tsx | 65 +++++++++++++++++++ .../core/src/react/editor-react-component.tsx | 58 +++++++++++++++++ pnpm-lock.yaml | 35 ++++++++++ 6 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 packages/core/src/react/editor-cache-context.tsx create mode 100644 packages/core/src/react/editor-react-component.tsx diff --git a/packages/core/package.json b/packages/core/package.json index 67f0e8f..91e780a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -28,6 +28,8 @@ "@codemirror/state": "^6.4.1", "@codemirror/view": "^6.26.3", "@rollup/plugin-typescript": "^11.1.6", + "@types/react": "^18.3.3", + "react": "^18.3.1", "rollup": "^4.18.0", "tslib": "^2.6.3", "typescript": "^5.4.5" @@ -37,12 +39,13 @@ "@codemirror/language": "^6.10.2", "@codemirror/search": "^6.5.6", "@codemirror/state": "^6.4.1", - "@codemirror/view": "^6.26.3" + "@codemirror/view": "^6.26.3", + "react": "^18.3.1" }, "dependencies": { "@tidbcloud/tisqleditor-extensions-basic-setup": "workspace:^", - "@tidbcloud/tisqleditor-extensions-sql-parser": "workspace:^", "@tidbcloud/tisqleditor-extensions-cur-sql": "workspace:^", - "@tidbcloud/tisqleditor-extensions-lang-sql": "workspace:^" + "@tidbcloud/tisqleditor-extensions-lang-sql": "workspace:^", + "@tidbcloud/tisqleditor-extensions-sql-parser": "workspace:^" } } diff --git a/packages/core/src/editor-instance.ts b/packages/core/src/editor-instance.ts index c522edc..2988f85 100644 --- a/packages/core/src/editor-instance.ts +++ b/packages/core/src/editor-instance.ts @@ -20,6 +20,7 @@ import { export class SQLEditorInstance { constructor( + public editorId: string, public editor: EditorView, public themeCompartment: Compartment, public sqlCompartment: Compartment, @@ -55,6 +56,7 @@ export class SQLEditorInstance { } export type CreateSQLEditorOptions = { + editorId: string doc: string basicSetupOptions?: BasicSetupOptions @@ -67,6 +69,7 @@ export type CreateSQLEditorOptions = { } export const createSQLEditorInstance = ({ + editorId, doc, basicSetupOptions = {}, sqlConfig = {}, @@ -101,6 +104,7 @@ export const createSQLEditorInstance = ({ }) }) const editorInst = new SQLEditorInstance( + editorId, editor, themeCompartment, sqlCompartment, diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index e99ed42..c823ff0 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,2 +1,4 @@ - export * from './editor-instance' + +export * from './react/editor-cache-context' +export * from './react/editor-react-component' diff --git a/packages/core/src/react/editor-cache-context.tsx b/packages/core/src/react/editor-cache-context.tsx new file mode 100644 index 0000000..2d322bb --- /dev/null +++ b/packages/core/src/react/editor-cache-context.tsx @@ -0,0 +1,65 @@ +import { createContext, useContext, useEffect } from 'react' +import { SQLEditorInstance } from '../editor-instance' + +//------------- + +class EditorCache { + cache: Map = new Map() + activeEditorId: string = '' + + addEditor = (editorId: string, editor: SQLEditorInstance) => { + this.cache.set(editorId, editor) + } + + getEditor = (editorId: string) => { + return this.cache.get(editorId) + } + + deleteEditor = (editorId: string) => { + this.cache.delete(editorId) + } + + clearEditors = () => { + this.cache.clear() + } + + setActiveEditorId(editorId: string) { + this.activeEditorId = editorId + } + + getActiveEditor() { + return this.getEditor(this.activeEditorId) + } +} + +//------------- + +type EditorCacheCtxValue = EditorCache + +const EditorCacheContext = createContext(null) + +export const useEditorCacheContext = () => { + const context = useContext(EditorCacheContext) + + if (!context) { + throw new Error('useEditorCacheContext must be used within a provider') + } + + return context +} + +export function EditorCacheProvider(props: { children: React.ReactNode }) { + const cache = new EditorCache() + + useEffect(() => { + return () => { + cache.clearEditors() + } + }, []) + + return ( + + {props.children} + + ) +} diff --git a/packages/core/src/react/editor-react-component.tsx b/packages/core/src/react/editor-react-component.tsx new file mode 100644 index 0000000..ce19bf8 --- /dev/null +++ b/packages/core/src/react/editor-react-component.tsx @@ -0,0 +1,58 @@ +import { useEffect, useLayoutEffect, useRef } from 'react' + +import { useEditorCacheContext } from './editor-cache-context' +import { + CreateSQLEditorOptions, + createSQLEditorInstance +} from '../editor-instance' + +type SQLEditorProps = CreateSQLEditorOptions & { + editorId: string + className?: string +} + +export default function SQLEditor({ + className, + editorId, + theme, + sqlConfig, + ...rest +}: SQLEditorProps) { + const editorContainerRef = useRef(null) + const cacheCtx = useEditorCacheContext() + + useLayoutEffect(() => { + if (!editorContainerRef.current) return + + let editorInst = cacheCtx.getEditor(editorId) + if (!editorInst) { + editorInst = createSQLEditorInstance({ + editorId, + theme, + sqlConfig, + ...rest + }) + cacheCtx.addEditor(editorId, editorInst) + } + + editorContainerRef.current.appendChild(editorInst.editor.dom) + editorInst.editor.focus() + + return () => { + if (editorContainerRef.current && editorInst) { + editorContainerRef.current.removeChild(editorInst.editor.dom) + } + } + }, [editorId]) + + // use `useLayoutEffect` to avoid flicker + useLayoutEffect(() => { + cacheCtx.getEditor(editorId)?.changeTheme(theme ?? []) + }, [editorId, theme]) + + useEffect(() => { + cacheCtx.getEditor(editorId)?.changeSQLConfig(sqlConfig ?? {}) + }, [editorId, sqlConfig]) + + return
+} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b7185b..9593d34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,6 +60,12 @@ importers: '@rollup/plugin-typescript': specifier: ^11.1.6 version: 11.1.6(rollup@4.18.0)(tslib@2.6.3)(typescript@5.4.5) + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + react: + specifier: ^18.3.1 + version: 18.3.1 rollup: specifier: ^4.18.0 version: 4.18.0 @@ -781,6 +787,17 @@ packages: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true + /@types/prop-types@15.7.12: + resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} + dev: true + + /@types/react@18.3.3: + resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} + dependencies: + '@types/prop-types': 15.7.12 + csstype: 3.1.3 + dev: true + /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true @@ -1106,6 +1123,10 @@ packages: which: 2.0.2 dev: true + /csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + dev: true + /csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} dev: true @@ -2144,6 +2165,13 @@ packages: wrap-ansi: 9.0.0 dev: true + /loose-envify@1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + dev: true + /lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: @@ -2471,6 +2499,13 @@ packages: engines: {node: '>=8'} dev: true + /react@18.3.1: + resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + dev: true + /read-pkg-up@7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} From 1aa98f99be6f6a3f7ea573ad39e0fb5adf01a059 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Thu, 13 Jun 2024 15:01:19 +0800 Subject: [PATCH 2/3] refine --- packages/core/src/editor-instance.ts | 18 +++++++++--------- .../core/src/react/editor-react-component.tsx | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/core/src/editor-instance.ts b/packages/core/src/editor-instance.ts index 2988f85..edddc69 100644 --- a/packages/core/src/editor-instance.ts +++ b/packages/core/src/editor-instance.ts @@ -21,37 +21,37 @@ import { export class SQLEditorInstance { constructor( public editorId: string, - public editor: EditorView, + public editorView: EditorView, public themeCompartment: Compartment, public sqlCompartment: Compartment, public extraData: {} ) {} changeTheme(theme: Extension) { - if (this.themeCompartment.get(this.editor.state) === theme) return + if (this.themeCompartment.get(this.editorView.state) === theme) return - this.editor.dispatch({ + this.editorView.dispatch({ effects: this.themeCompartment.reconfigure(theme) }) } changeSQLConfig(sqlConfig: SQLConfig) { - this.editor.dispatch({ + this.editorView.dispatch({ effects: this.sqlCompartment.reconfigure(langSql(sqlConfig)) }) } getAllStatements() { - return getSqlStatements(this.editor.state) + return getSqlStatements(this.editorView.state) } getCurStatements() { - return getCurStatements(this.editor.state) + return getCurStatements(this.editorView.state) } getNearbyStatement() { const { from } = this.getCurStatements()[0] - return getNearbyStatement(this.editor.state, from) + return getNearbyStatement(this.editorView.state, from) } } @@ -97,7 +97,7 @@ export const createSQLEditorInstance = ({ curSql(), extraExts ] - const editor = new EditorView({ + const editorView = new EditorView({ state: EditorState.create({ doc, extensions @@ -105,7 +105,7 @@ export const createSQLEditorInstance = ({ }) const editorInst = new SQLEditorInstance( editorId, - editor, + editorView, themeCompartment, sqlCompartment, extraData diff --git a/packages/core/src/react/editor-react-component.tsx b/packages/core/src/react/editor-react-component.tsx index ce19bf8..ba22e99 100644 --- a/packages/core/src/react/editor-react-component.tsx +++ b/packages/core/src/react/editor-react-component.tsx @@ -35,12 +35,12 @@ export default function SQLEditor({ cacheCtx.addEditor(editorId, editorInst) } - editorContainerRef.current.appendChild(editorInst.editor.dom) - editorInst.editor.focus() + editorContainerRef.current.appendChild(editorInst.editorView.dom) + editorInst.editorView.focus() return () => { if (editorContainerRef.current && editorInst) { - editorContainerRef.current.removeChild(editorInst.editor.dom) + editorContainerRef.current.removeChild(editorInst.editorView.dom) } } }, [editorId]) From f22b1efb5f80ad449cc962574d58524305a95ec7 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Thu, 13 Jun 2024 15:54:26 +0800 Subject: [PATCH 3/3] feat: extract to a individual package --- packages/core/package.json | 5 +- packages/core/src/editor-cache.tsx | 23 +++++++ packages/core/src/index.ts | 4 +- .../core/src/react/editor-cache-context.tsx | 65 ------------------- packages/react/package.json | 38 +++++++++++ packages/react/rollup.config.js | 10 +++ packages/react/src/editor-cache-context.tsx | 46 +++++++++++++ packages/react/src/index.ts | 2 + .../src/sql-editor.tsx} | 10 +-- packages/react/tsconfig.json | 29 +++++++++ pnpm-lock.yaml | 31 +++++++-- 11 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 packages/core/src/editor-cache.tsx delete mode 100644 packages/core/src/react/editor-cache-context.tsx create mode 100644 packages/react/package.json create mode 100644 packages/react/rollup.config.js create mode 100644 packages/react/src/editor-cache-context.tsx create mode 100644 packages/react/src/index.ts rename packages/{core/src/react/editor-react-component.tsx => react/src/sql-editor.tsx} (81%) create mode 100644 packages/react/tsconfig.json diff --git a/packages/core/package.json b/packages/core/package.json index 91e780a..0a49d17 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -28,8 +28,6 @@ "@codemirror/state": "^6.4.1", "@codemirror/view": "^6.26.3", "@rollup/plugin-typescript": "^11.1.6", - "@types/react": "^18.3.3", - "react": "^18.3.1", "rollup": "^4.18.0", "tslib": "^2.6.3", "typescript": "^5.4.5" @@ -39,8 +37,7 @@ "@codemirror/language": "^6.10.2", "@codemirror/search": "^6.5.6", "@codemirror/state": "^6.4.1", - "@codemirror/view": "^6.26.3", - "react": "^18.3.1" + "@codemirror/view": "^6.26.3" }, "dependencies": { "@tidbcloud/tisqleditor-extensions-basic-setup": "workspace:^", diff --git a/packages/core/src/editor-cache.tsx b/packages/core/src/editor-cache.tsx new file mode 100644 index 0000000..8d000eb --- /dev/null +++ b/packages/core/src/editor-cache.tsx @@ -0,0 +1,23 @@ +import { SQLEditorInstance } from './editor-instance' + +//------------- + +export class EditorCache { + cache: Map = new Map() + + addEditor = (editorId: string, editor: SQLEditorInstance) => { + this.cache.set(editorId, editor) + } + + getEditor = (editorId: string) => { + return this.cache.get(editorId) + } + + deleteEditor = (editorId: string) => { + this.cache.delete(editorId) + } + + clearEditors = () => { + this.cache.clear() + } +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index c823ff0..4a04223 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,4 +1,2 @@ export * from './editor-instance' - -export * from './react/editor-cache-context' -export * from './react/editor-react-component' +export * from './editor-cache' diff --git a/packages/core/src/react/editor-cache-context.tsx b/packages/core/src/react/editor-cache-context.tsx deleted file mode 100644 index 2d322bb..0000000 --- a/packages/core/src/react/editor-cache-context.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { createContext, useContext, useEffect } from 'react' -import { SQLEditorInstance } from '../editor-instance' - -//------------- - -class EditorCache { - cache: Map = new Map() - activeEditorId: string = '' - - addEditor = (editorId: string, editor: SQLEditorInstance) => { - this.cache.set(editorId, editor) - } - - getEditor = (editorId: string) => { - return this.cache.get(editorId) - } - - deleteEditor = (editorId: string) => { - this.cache.delete(editorId) - } - - clearEditors = () => { - this.cache.clear() - } - - setActiveEditorId(editorId: string) { - this.activeEditorId = editorId - } - - getActiveEditor() { - return this.getEditor(this.activeEditorId) - } -} - -//------------- - -type EditorCacheCtxValue = EditorCache - -const EditorCacheContext = createContext(null) - -export const useEditorCacheContext = () => { - const context = useContext(EditorCacheContext) - - if (!context) { - throw new Error('useEditorCacheContext must be used within a provider') - } - - return context -} - -export function EditorCacheProvider(props: { children: React.ReactNode }) { - const cache = new EditorCache() - - useEffect(() => { - return () => { - cache.clearEditors() - } - }, []) - - return ( - - {props.children} - - ) -} diff --git a/packages/react/package.json b/packages/react/package.json new file mode 100644 index 0000000..5a0dcf2 --- /dev/null +++ b/packages/react/package.json @@ -0,0 +1,38 @@ +{ + "name": "@tidbcloud/tisqleditor-react", + "version": "0.0.1", + "description": "", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist/*.js", + "dist/*.ts", + "package.json", + "README.md" + ], + "scripts": { + "tsc:watch": "tsc --watch", + "rollup:watch": "rollup -c --watch", + "dev": "concurrently --kill-others \"pnpm tsc:watch\" \"pnpm rollup:watch\"", + "build": "tsc && rollup -c" + }, + "keywords": [], + "author": "", + "license": "MIT", + "dependencies": { + "@tidbcloud/tisqleditor": "workspace:^" + }, + "devDependencies": { + "@rollup/plugin-typescript": "^11.1.6", + "@types/react": "^18.3.3", + "react": "^18.3.1", + "rollup": "^4.18.0", + "tslib": "^2.6.3", + "typescript": "^5.4.5" + }, + "peerDependencies": { + "react": "^18.3.1" + } +} diff --git a/packages/react/rollup.config.js b/packages/react/rollup.config.js new file mode 100644 index 0000000..63f6347 --- /dev/null +++ b/packages/react/rollup.config.js @@ -0,0 +1,10 @@ +import typescript from '@rollup/plugin-typescript' + +export default { + input: 'src/index.ts', + output: { + dir: 'dist', + format: 'es' + }, + plugins: [typescript()] +} diff --git a/packages/react/src/editor-cache-context.tsx b/packages/react/src/editor-cache-context.tsx new file mode 100644 index 0000000..ec66d9a --- /dev/null +++ b/packages/react/src/editor-cache-context.tsx @@ -0,0 +1,46 @@ +import { createContext, useContext, useEffect, useMemo, useState } from 'react' +import { EditorCache } from '@tidbcloud/tisqleditor' + +type EditorCacheCtxValue = { + cache: EditorCache + + activeEditorId: string + setActiveEditorId: (editorId: string) => void +} + +const EditorCacheContext = createContext(null) + +export const useEditorCacheContext = () => { + const context = useContext(EditorCacheContext) + + if (!context) { + throw new Error('useEditorCacheContext must be used within a provider') + } + + return context +} + +export function EditorCacheProvider(props: { children: React.ReactNode }) { + const [activeEditorId, setActiveEditorId] = useState('') + const cache = useMemo(() => new EditorCache(), []) + const ctxValue = useMemo( + () => ({ + cache, + activeEditorId, + setActiveEditorId + }), + [activeEditorId] + ) + + useEffect(() => { + return () => { + cache.clearEditors() + } + }, []) + + return ( + + {props.children} + + ) +} diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts new file mode 100644 index 0000000..c98593e --- /dev/null +++ b/packages/react/src/index.ts @@ -0,0 +1,2 @@ +export * from './editor-cache-context' +export * from './sql-editor' diff --git a/packages/core/src/react/editor-react-component.tsx b/packages/react/src/sql-editor.tsx similarity index 81% rename from packages/core/src/react/editor-react-component.tsx rename to packages/react/src/sql-editor.tsx index ba22e99..933e9f4 100644 --- a/packages/core/src/react/editor-react-component.tsx +++ b/packages/react/src/sql-editor.tsx @@ -4,7 +4,7 @@ import { useEditorCacheContext } from './editor-cache-context' import { CreateSQLEditorOptions, createSQLEditorInstance -} from '../editor-instance' +} from '@tidbcloud/tisqleditor' type SQLEditorProps = CreateSQLEditorOptions & { editorId: string @@ -24,7 +24,7 @@ export default function SQLEditor({ useLayoutEffect(() => { if (!editorContainerRef.current) return - let editorInst = cacheCtx.getEditor(editorId) + let editorInst = cacheCtx.cache.getEditor(editorId) if (!editorInst) { editorInst = createSQLEditorInstance({ editorId, @@ -32,7 +32,7 @@ export default function SQLEditor({ sqlConfig, ...rest }) - cacheCtx.addEditor(editorId, editorInst) + cacheCtx.cache.addEditor(editorId, editorInst) } editorContainerRef.current.appendChild(editorInst.editorView.dom) @@ -47,11 +47,11 @@ export default function SQLEditor({ // use `useLayoutEffect` to avoid flicker useLayoutEffect(() => { - cacheCtx.getEditor(editorId)?.changeTheme(theme ?? []) + cacheCtx.cache.getEditor(editorId)?.changeTheme(theme ?? []) }, [editorId, theme]) useEffect(() => { - cacheCtx.getEditor(editorId)?.changeSQLConfig(sqlConfig ?? {}) + cacheCtx.cache.getEditor(editorId)?.changeSQLConfig(sqlConfig ?? {}) }, [editorId, sqlConfig]) return
diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json new file mode 100644 index 0000000..a7af85a --- /dev/null +++ b/packages/react/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* declaration */ + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "./dist", + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + // "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9593d34..06464ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,12 +60,6 @@ importers: '@rollup/plugin-typescript': specifier: ^11.1.6 version: 11.1.6(rollup@4.18.0)(tslib@2.6.3)(typescript@5.4.5) - '@types/react': - specifier: ^18.3.3 - version: 18.3.3 - react: - specifier: ^18.3.1 - version: 18.3.1 rollup: specifier: ^4.18.0 version: 4.18.0 @@ -189,6 +183,31 @@ importers: specifier: ^5.4.5 version: 5.4.5 + packages/react: + dependencies: + '@tidbcloud/tisqleditor': + specifier: workspace:^ + version: link:../core + devDependencies: + '@rollup/plugin-typescript': + specifier: ^11.1.6 + version: 11.1.6(rollup@4.18.0)(tslib@2.6.3)(typescript@5.4.5) + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 + react: + specifier: ^18.3.1 + version: 18.3.1 + rollup: + specifier: ^4.18.0 + version: 4.18.0 + tslib: + specifier: ^2.6.3 + version: 2.6.3 + typescript: + specifier: ^5.4.5 + version: 5.4.5 + packages: /@babel/code-frame@7.24.7: