From 4f87f70491dcc09a8ff9b6b2d4a695f7c65818fd Mon Sep 17 00:00:00 2001 From: Danilo Woznica Date: Mon, 9 Jan 2023 11:59:37 +0000 Subject: [PATCH] feat(code editor): upgrade codemirror dependencies (#679) --- sandpack-react/package.json | 27 +- .../CodeEditor/CodeMirror.stories.tsx | 93 +---- .../src/components/CodeEditor/CodeMirror.tsx | 29 +- .../useSyntaxHighlight.test.tsx.snap | 68 ++-- .../CodeEditor/useSyntaxHighlight.test.tsx | 3 +- .../CodeEditor/useSyntaxHighlight.ts | 7 +- .../src/components/CodeEditor/utils.ts | 29 +- .../src/presets/Sandpack.stories.tsx | 3 +- .../docs/docs/advanced-usage/components.md | 3 +- yarn.lock | 384 +++++++----------- 10 files changed, 239 insertions(+), 407 deletions(-) diff --git a/sandpack-react/package.json b/sandpack-react/package.json index 36c1c1e53..1e40c137d 100644 --- a/sandpack-react/package.json +++ b/sandpack-react/package.json @@ -37,20 +37,16 @@ ], "dependencies": { "@code-hike/classer": "^0.0.0-aa6efee", - "@codemirror/closebrackets": "^0.19.0", - "@codemirror/commands": "^0.19.6", - "@codemirror/comment": "^0.19.0", - "@codemirror/gutter": "^0.19.9", - "@codemirror/highlight": "^0.19.6", - "@codemirror/history": "^0.19.0", - "@codemirror/lang-css": "^0.19.3", - "@codemirror/lang-html": "^0.19.4", - "@codemirror/lang-javascript": "^0.19.3", - "@codemirror/language": "^0.19.7", - "@codemirror/matchbrackets": "^0.19.3", - "@codemirror/state": "^0.19.6", - "@codemirror/view": "^0.19.32", + "@codemirror/autocomplete": "^6.4.0", + "@codemirror/commands": "^6.1.3", + "@codemirror/lang-css": "^6.0.1", + "@codemirror/lang-html": "^6.4.0", + "@codemirror/lang-javascript": "^6.1.2", + "@codemirror/language": "^6.3.2", + "@codemirror/state": "^6.2.0", + "@codemirror/view": "^6.7.1", "@codesandbox/sandpack-client": "^1.18.0", + "@lezer/highlight": "^1.1.3", "@react-hook/intersection-observer": "^3.1.1", "@stitches/core": "^1.2.6", "clean-set": "^1.1.2", @@ -62,9 +58,8 @@ }, "devDependencies": { "@babel/core": "^7.12.3", - "@codemirror/lang-python": "^0.19.5", - "@codemirror/legacy-modes": "^0.19.1", - "@codemirror/stream-parser": "^0.19.9", + "@codemirror/lang-python": "^6.1.0", + "@codemirror/legacy-modes": "^6.3.1", "@codesandbox/sandpack-themes": "^1.17.0", "@playwright/test": "^1.26.1", "@storybook/addon-actions": "^6.1.9", diff --git a/sandpack-react/src/components/CodeEditor/CodeMirror.stories.tsx b/sandpack-react/src/components/CodeEditor/CodeMirror.stories.tsx index 0c5b9eaf3..504e4a7e9 100644 --- a/sandpack-react/src/components/CodeEditor/CodeMirror.stories.tsx +++ b/sandpack-react/src/components/CodeEditor/CodeMirror.stories.tsx @@ -1,7 +1,7 @@ import { python } from "@codemirror/lang-python"; -import { LanguageSupport } from "@codemirror/language"; +import { LanguageSupport, StreamLanguage } from "@codemirror/language"; import { shell } from "@codemirror/legacy-modes/mode/shell"; -import { StreamLanguage } from "@codemirror/stream-parser"; +import { storiesOf } from "@storybook/react"; import * as React from "react"; import { SandpackProvider } from "../../contexts/sandpackContext"; @@ -10,81 +10,20 @@ import * as mocks from "./languages-mocks"; import { CodeEditor } from "./index"; -export default { - title: "components/CodeMirror", - component: CodeEditor, -}; - -export const HTML: React.FC = () => ( - - - -); - -export const Javascript: React.FC = () => ( - - - -); - -export const JSX: React.FC = () => ( - - - -); - -export const CSS: React.FC = () => ( - - - -); - -export const Less: React.FC = () => ( - - - -); - -export const Vue: React.FC = () => ( - - - +const stories = storiesOf("components/CodeMirror", module); + +Object.entries(mocks).forEach(([languageName, mockFile]) => + stories.add(languageName, () => ( + + + + )) ); export const CustomLanguageShell: React.FC = () => ( diff --git a/sandpack-react/src/components/CodeEditor/CodeMirror.tsx b/sandpack-react/src/components/CodeEditor/CodeMirror.tsx index 1a317f1f2..71b58d9d0 100644 --- a/sandpack-react/src/components/CodeEditor/CodeMirror.tsx +++ b/sandpack-react/src/components/CodeEditor/CodeMirror.tsx @@ -1,17 +1,16 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import { useClasser } from "@code-hike/classer"; -import { closeBrackets, closeBracketsKeymap } from "@codemirror/closebrackets"; +import { closeBrackets, closeBracketsKeymap } from "@codemirror/autocomplete"; import { defaultKeymap, indentLess, indentMore, deleteGroupBackward, + history, + historyKeymap, } from "@codemirror/commands"; -import { commentKeymap } from "@codemirror/comment"; -import { lineNumbers } from "@codemirror/gutter"; -import { defaultHighlightStyle } from "@codemirror/highlight"; -import { history, historyKeymap } from "@codemirror/history"; -import { bracketMatching } from "@codemirror/matchbrackets"; +import { syntaxHighlighting } from "@codemirror/language"; +import { bracketMatching } from "@codemirror/language"; import type { Extension } from "@codemirror/state"; import { EditorState, EditorSelection, StateEffect } from "@codemirror/state"; import { Annotation } from "@codemirror/state"; @@ -20,6 +19,7 @@ import { highlightActiveLine, keymap, EditorView, + lineNumbers, } from "@codemirror/view"; import type { KeyBinding } from "@codemirror/view"; import useIntersectionObserver from "@react-hook/intersection-observer"; @@ -208,7 +208,7 @@ export const CodeMirror = React.forwardRef( ({ key }) => key === "Tab" ); - return customKey?.run(view) ?? true; + return customKey?.run?.(view) ?? true; }, }, { @@ -220,7 +220,7 @@ export const CodeMirror = React.forwardRef( ({ key }) => key === "Shift-Tab" ); - return customKey?.run(view) ?? true; + return customKey?.run?.(view) ?? true; }, }, { @@ -252,16 +252,13 @@ export const CodeMirror = React.forwardRef( ...closeBracketsKeymap, ...defaultKeymap, ...historyKeymap, - ...commentKeymap, ...customCommandsKeymap, ...extensionsKeymap, ] as KeyBinding[]), langSupport, - defaultHighlightStyle.fallback, - getEditorTheme(), - highlightTheme, + syntaxHighlighting(highlightTheme), ]; if (readOnly) { @@ -288,11 +285,6 @@ export const CodeMirror = React.forwardRef( extensionList.push(highlightInlineError()); } - const startState = EditorState.create({ - doc: code, - extensions: extensionList, - }); - const parentDiv = wrapper.current; const existingPlaceholder = parentDiv.querySelector( ".sp-pre-placeholder" @@ -302,7 +294,8 @@ export const CodeMirror = React.forwardRef( } const view = new EditorView({ - state: startState, + doc: code, + extensions: extensionList, parent: parentDiv, dispatch: (tr): void => { view.update([tr]); diff --git a/sandpack-react/src/components/CodeEditor/__snapshots__/useSyntaxHighlight.test.tsx.snap b/sandpack-react/src/components/CodeEditor/__snapshots__/useSyntaxHighlight.test.tsx.snap index edabfdd63..d475ef169 100644 --- a/sandpack-react/src/components/CodeEditor/__snapshots__/useSyntaxHighlight.test.tsx.snap +++ b/sandpack-react/src/components/CodeEditor/__snapshots__/useSyntaxHighlight.test.tsx.snap @@ -3,7 +3,7 @@ exports[`useSyntaxHighlight renders a css block 1`] = ` Array [ body , @@ -47,7 +47,7 @@ Array [ ", h1 , @@ -114,7 +114,7 @@ Array [ ", p , @@ -196,7 +196,7 @@ Array [ < , html , @@ -225,7 +225,7 @@ Array [ < , head , @@ -242,7 +242,7 @@ Array [ < , meta , @@ -271,7 +271,7 @@ Array [ < , meta , @@ -312,7 +312,7 @@ Array [ < , meta , @@ -353,7 +353,7 @@ Array [ < , title , @@ -369,7 +369,7 @@ Array [ </ , title , @@ -386,7 +386,7 @@ Array [ < , link , @@ -427,7 +427,7 @@ Array [ </ , head , @@ -444,7 +444,7 @@ Array [ < , body , @@ -461,7 +461,7 @@ Array [ < , script , @@ -488,7 +488,7 @@ Array [ </ , script , @@ -505,7 +505,7 @@ Array [ </ , body , @@ -522,7 +522,7 @@ Array [ </ , html , @@ -1220,7 +1220,7 @@ Array [ < , Greeting , @@ -1250,7 +1250,7 @@ Array [ < , Greeting , @@ -1280,7 +1280,7 @@ Array [ < , Greeting , @@ -1384,7 +1384,7 @@ Array [ , " + 10", px , @@ -1607,7 +1607,7 @@ Array [ < , template , @@ -1624,7 +1624,7 @@ Array [ < , div , @@ -1653,7 +1653,7 @@ Array [ < , label , @@ -1693,7 +1693,7 @@ Array [ </ , label , @@ -1710,7 +1710,7 @@ Array [ < , p , @@ -1739,7 +1739,7 @@ Array [ < , input , @@ -1816,7 +1816,7 @@ Array [ < , span , @@ -1856,7 +1856,7 @@ Array [ </ , span , @@ -1873,7 +1873,7 @@ Array [ </ , p , @@ -1890,7 +1890,7 @@ Array [ </ , div , @@ -1907,7 +1907,7 @@ Array [ </ , template , @@ -1925,7 +1925,7 @@ Array [ < , script , @@ -1991,7 +1991,7 @@ Array [ </ , script , diff --git a/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.test.tsx b/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.test.tsx index 4c86b78e8..1a5ab23ae 100644 --- a/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.test.tsx +++ b/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.test.tsx @@ -1,7 +1,6 @@ import { python } from "@codemirror/lang-python"; -import { LanguageSupport } from "@codemirror/language"; +import { LanguageSupport, StreamLanguage } from "@codemirror/language"; import { shell } from "@codemirror/legacy-modes/mode/shell"; -import { StreamLanguage } from "@codemirror/stream-parser"; import React from "react"; import { create } from "react-test-renderer"; diff --git a/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.ts b/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.ts index 51e428b3a..768bef2c1 100644 --- a/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.ts +++ b/sandpack-react/src/components/CodeEditor/useSyntaxHighlight.ts @@ -1,6 +1,5 @@ -import type { HighlightStyle } from "@codemirror/highlight"; -import { highlightTree } from "@codemirror/highlight"; -import type { LanguageSupport } from "@codemirror/language"; +import type { HighlightStyle, LanguageSupport } from "@codemirror/language"; +import { highlightTree } from "@lezer/highlight"; import { createElement } from "react"; export const useSyntaxHighlight = ({ @@ -35,7 +34,7 @@ export const useSyntaxHighlight = ({ } }; - highlightTree(tree, highlightTheme.match, (from, to, className) => { + highlightTree(tree, highlightTheme, (from, to, className) => { addElement(from, ""); addElement(to, className); }); diff --git a/sandpack-react/src/components/CodeEditor/utils.ts b/sandpack-react/src/components/CodeEditor/utils.ts index 8260efaad..546ddff7f 100644 --- a/sandpack-react/src/components/CodeEditor/utils.ts +++ b/sandpack-react/src/components/CodeEditor/utils.ts @@ -1,12 +1,12 @@ -import { HighlightStyle, tags } from "@codemirror/highlight"; import { css } from "@codemirror/lang-css"; import { html } from "@codemirror/lang-html"; import { javascript } from "@codemirror/lang-javascript"; import type { LanguageSupport } from "@codemirror/language"; -import type { Extension } from "@codemirror/state"; -import type { Text } from "@codemirror/text"; +import { HighlightStyle } from "@codemirror/language"; +import type { Extension, Text } from "@codemirror/state"; import { EditorView } from "@codemirror/view"; import * as React from "react"; +import { tags } from "@lezer/highlight"; import { THEME_PREFIX } from "../../styles"; import type { CustomLanguage, SandpackTheme } from "../../types"; @@ -119,18 +119,25 @@ export const getSyntaxHighlight = (theme: SandpackTheme): HighlightStyle => class: classNameToken("static"), }, { - tag: tags.tagName, - class: classNameToken("tag"), + tag: tags.variableName, + class: classNameToken("plain"), }, - { tag: tags.variableName, class: classNameToken("plain") }, { - // Highlight function call - tag: tags.function(tags.variableName), - class: classNameToken("definition"), + // Standard tags, e.g

+ tag: tags.standard(tags.tagName), + class: classNameToken("tag"), }, { - // Highlight function definition differently (eg: functional component def in React) - tag: tags.definition(tags.function(tags.variableName)), + tag: [ + // Highlight function call + tags.function(tags.variableName), + + // Highlight function definition differently (eg: functional component def in React) + tags.definition(tags.function(tags.variableName)), + + // "Custom tags", meaning React component + tags.tagName, + ], class: classNameToken("definition"), }, { diff --git a/sandpack-react/src/presets/Sandpack.stories.tsx b/sandpack-react/src/presets/Sandpack.stories.tsx index 6e6c63da9..e3ccd647e 100644 --- a/sandpack-react/src/presets/Sandpack.stories.tsx +++ b/sandpack-react/src/presets/Sandpack.stories.tsx @@ -1,6 +1,5 @@ -import { LanguageSupport } from "@codemirror/language"; +import { LanguageSupport, StreamLanguage } from "@codemirror/language"; import { shell } from "@codemirror/legacy-modes/mode/shell"; -import { StreamLanguage } from "@codemirror/stream-parser"; import React from "react"; import { Sandpack } from "../"; diff --git a/website/docs/docs/advanced-usage/components.md b/website/docs/docs/advanced-usage/components.md index 97ad455f5..a702e227c 100644 --- a/website/docs/docs/advanced-usage/components.md +++ b/website/docs/docs/advanced-usage/components.md @@ -304,8 +304,7 @@ import { python } from "@codemirror/lang-python"; When using a [stream language mode](https://www.npmjs.com/package/@codemirror/legacy-modes) you'll need to convert it into a `LanguageSupport` instance. ```jsx -import { LanguageSupport } from "@codemirror/language"; -import { StreamLanguage } from "@codemirror/stream-parser"; +import { LanguageSupport, StreamLanguage } from "@codemirror/language"; import { shell } from "@codemirror/legacy-modes/mode/shell"; diff --git a/yarn.lock b/yarn.lock index a98a693c8..8817710bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1309,222 +1309,112 @@ resolved "https://registry.yarnpkg.com/@code-hike/classer/-/classer-0.0.0-e48fa74.tgz#17243ca84d5af303c51e62b378e8db65e01cd3f4" integrity sha512-CyPYvfl4K5Hp9uyhLhUemul56eiGOF0FNXh5ALzzK9VNhRmRmj1O0mKtLDpoccI8W90r9kQES/nW2FC8jVVieg== -"@codemirror/autocomplete@^0.19.0": - version "0.19.15" - resolved "https://registry.yarnpkg.com/@codemirror/autocomplete/-/autocomplete-0.19.15.tgz#061f09063dc2a68668d85d7ac8430c7bc6df1a82" - integrity sha512-GQWzvvuXxNUyaEk+5gawbAD8s51/v2Chb++nx0e2eGWrphWk42isBtzOMdc3DxrxrZtPZ55q2ldNp+6G8KJLIQ== - dependencies: - "@codemirror/language" "^0.19.0" - "@codemirror/state" "^0.19.4" - "@codemirror/text" "^0.19.2" - "@codemirror/tooltip" "^0.19.12" - "@codemirror/view" "^0.19.0" - "@lezer/common" "^0.15.0" - -"@codemirror/closebrackets@^0.19.0": - version "0.19.2" - resolved "https://registry.yarnpkg.com/@codemirror/closebrackets/-/closebrackets-0.19.2.tgz#ff74dd78218cee57172623eb9ebf7b669fa6f4d4" - integrity sha512-ClMPzPcPP0eQiDcVjtVPl6OLxgdtZSYDazsvT0AKl70V1OJva0eHgl4/6kCW3RZ0pb2n34i9nJz4eXCmK+TYDA== - dependencies: - "@codemirror/language" "^0.19.0" - "@codemirror/rangeset" "^0.19.0" - "@codemirror/state" "^0.19.2" - "@codemirror/text" "^0.19.0" - "@codemirror/view" "^0.19.44" - -"@codemirror/commands@^0.19.6": - version "0.19.8" - resolved "https://registry.yarnpkg.com/@codemirror/commands/-/commands-0.19.8.tgz#1f99c1a8bf200d17c4d6997379099459f3678107" - integrity sha512-65LIMSGUGGpY3oH6mzV46YWRrgao6NmfJ+AuC7jNz3K5NPnH6GCV1H5I6SwOFyVbkiygGyd0EFwrWqywTBD1aw== - dependencies: - "@codemirror/language" "^0.19.0" - "@codemirror/matchbrackets" "^0.19.0" - "@codemirror/state" "^0.19.2" - "@codemirror/text" "^0.19.6" - "@codemirror/view" "^0.19.22" - "@lezer/common" "^0.15.0" - -"@codemirror/comment@^0.19.0": - version "0.19.1" - resolved "https://registry.yarnpkg.com/@codemirror/comment/-/comment-0.19.1.tgz#7def8345eeb9095ef1ef33676fbde1ab4fe33fad" - integrity sha512-uGKteBuVWAC6fW+Yt8u27DOnXMT/xV4Ekk2Z5mRsiADCZDqYvryrJd6PLL5+8t64BVyocwQwNfz1UswYS2CtFQ== - dependencies: - "@codemirror/state" "^0.19.9" - "@codemirror/text" "^0.19.0" - "@codemirror/view" "^0.19.0" - -"@codemirror/gutter@^0.19.4", "@codemirror/gutter@^0.19.9": - version "0.19.9" - resolved "https://registry.yarnpkg.com/@codemirror/gutter/-/gutter-0.19.9.tgz#bbb69f4d49570d9c1b3f3df5d134980c516cd42b" - integrity sha512-PFrtmilahin1g6uL27aG5tM/rqR9DZzZYZsIrCXA5Uc2OFTFqx4owuhoU9hqfYxHp5ovfvBwQ+txFzqS4vog6Q== - dependencies: - "@codemirror/rangeset" "^0.19.0" - "@codemirror/state" "^0.19.0" - "@codemirror/view" "^0.19.23" - -"@codemirror/highlight@^0.19.0", "@codemirror/highlight@^0.19.6", "@codemirror/highlight@^0.19.7": - version "0.19.8" - resolved "https://registry.yarnpkg.com/@codemirror/highlight/-/highlight-0.19.8.tgz#a95aee8ae4389b01f820aa79c48f7b4388087d92" - integrity sha512-v/lzuHjrYR8MN2mEJcUD6fHSTXXli9C1XGYpr+ElV6fLBIUhMTNKR3qThp611xuWfXfwDxeL7ppcbkM/MzPV3A== - dependencies: - "@codemirror/language" "^0.19.0" - "@codemirror/rangeset" "^0.19.0" - "@codemirror/state" "^0.19.3" - "@codemirror/view" "^0.19.39" - "@lezer/common" "^0.15.0" +"@codemirror/autocomplete@^6.0.0", "@codemirror/autocomplete@^6.3.2", "@codemirror/autocomplete@^6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@codemirror/autocomplete/-/autocomplete-6.4.0.tgz#76ac9a2a411a4cc6e13103014dba5e0fe601da5a" + integrity sha512-HLF2PnZAm1s4kGs30EiqKMgD7XsYaQ0XJnMR0rofEWQ5t5D60SfqpDIkIh1ze5tiEbyUWm8+VJ6W1/erVvBMIA== + dependencies: + "@codemirror/language" "^6.0.0" + "@codemirror/state" "^6.0.0" + "@codemirror/view" "^6.6.0" + "@lezer/common" "^1.0.0" + +"@codemirror/commands@^6.1.3": + version "6.1.3" + resolved "https://registry.yarnpkg.com/@codemirror/commands/-/commands-6.1.3.tgz#401d0b6d18e7d5eb9a96f6c8ae4ea56a08e8fd06" + integrity sha512-wUw1+vb34Ultv0Q9m/OVB7yizGXgtoDbkI5f5ErM8bebwLyUYjicdhJTKhTvPTpgkv8dq/BK0lQ3K5pRf2DAJw== + dependencies: + "@codemirror/language" "^6.0.0" + "@codemirror/state" "^6.2.0" + "@codemirror/view" "^6.0.0" + "@lezer/common" "^1.0.0" + +"@codemirror/lang-css@^6.0.0", "@codemirror/lang-css@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@codemirror/lang-css/-/lang-css-6.0.1.tgz#470fff614e4cfbbe796ec43103420d59c797dd7a" + integrity sha512-rlLq1Dt0WJl+2epLQeAsfqIsx3lGu4HStHCJu95nGGuz2P2fNugbU3dQYafr2VRjM4eMC9HviI6jvS98CNtG5w== + dependencies: + "@codemirror/autocomplete" "^6.0.0" + "@codemirror/language" "^6.0.0" + "@codemirror/state" "^6.0.0" + "@lezer/css" "^1.0.0" + +"@codemirror/lang-html@^6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@codemirror/lang-html/-/lang-html-6.4.0.tgz#55227541426ec4efb13d9da45d7a85cabaa45c73" + integrity sha512-HHged0d9AQ/mpjYLTYDVdtI7235dO0COFNgc5uuiGokgjWx3L/sjMSw5aS/Nk7JG++LhsohG5HMNTCuqAq3Tcg== + dependencies: + "@codemirror/autocomplete" "^6.0.0" + "@codemirror/lang-css" "^6.0.0" + "@codemirror/lang-javascript" "^6.0.0" + "@codemirror/language" "^6.0.0" + "@codemirror/state" "^6.0.0" + "@codemirror/view" "^6.2.2" + "@lezer/common" "^1.0.0" + "@lezer/css" "^1.1.0" + "@lezer/html" "^1.1.0" + +"@codemirror/lang-javascript@^6.0.0", "@codemirror/lang-javascript@^6.1.2": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@codemirror/lang-javascript/-/lang-javascript-6.1.2.tgz#a11812ca1d21301cdeb80e51b4c007edcf55f813" + integrity sha512-OcwLfZXdQ1OHrLiIcKCn7MqZ7nx205CMKlhe+vL88pe2ymhT9+2P+QhwkYGxMICj8TDHyp8HFKVwpiisUT7iEQ== + dependencies: + "@codemirror/autocomplete" "^6.0.0" + "@codemirror/language" "^6.0.0" + "@codemirror/lint" "^6.0.0" + "@codemirror/state" "^6.0.0" + "@codemirror/view" "^6.0.0" + "@lezer/common" "^1.0.0" + "@lezer/javascript" "^1.0.0" + +"@codemirror/lang-python@^6.1.0": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@codemirror/lang-python/-/lang-python-6.1.1.tgz#378c69199da41e0b09eaadc56f6d70ad6001fd34" + integrity sha512-AddGMIKUssUAqaDKoxKWA5GAzy/CVE0eSY7/ANgNzdS1GYBkp6N49XKEyMElkuN04UsZ+bTIQdj+tVV75NMwJw== + dependencies: + "@codemirror/autocomplete" "^6.3.2" + "@codemirror/language" "^6.0.0" + "@lezer/python" "^1.0.0" + +"@codemirror/language@^6.0.0", "@codemirror/language@^6.3.2": + version "6.3.2" + resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-6.3.2.tgz#a3d5796d17a2cd3110bac0f5126db67c7e90a0f3" + integrity sha512-g42uHhOcEMAXjmozGG+rdom5UsbyfMxQFh7AbkeoaNImddL6Xt4cQDL0+JxmG7+as18rUAvZaqzP/TjsciVIrA== + dependencies: + "@codemirror/state" "^6.0.0" + "@codemirror/view" "^6.0.0" + "@lezer/common" "^1.0.0" + "@lezer/highlight" "^1.0.0" + "@lezer/lr" "^1.0.0" style-mod "^4.0.0" -"@codemirror/history@^0.19.0": - version "0.19.2" - resolved "https://registry.yarnpkg.com/@codemirror/history/-/history-0.19.2.tgz#25e3fda755f77ac1223a6ae6e9d7899f5919265e" - integrity sha512-unhP4t3N2smzmHoo/Yio6ueWi+il8gm9VKrvi6wlcdGH5fOfVDNkmjHQ495SiR+EdOG35+3iNebSPYww0vN7ow== - dependencies: - "@codemirror/state" "^0.19.2" - "@codemirror/view" "^0.19.0" - -"@codemirror/lang-css@^0.19.0", "@codemirror/lang-css@^0.19.3": - version "0.19.3" - resolved "https://registry.yarnpkg.com/@codemirror/lang-css/-/lang-css-0.19.3.tgz#7a17adf78c6fcdab4ad5ee4e360631c41e949e4a" - integrity sha512-tyCUJR42/UlfOPLb94/p7dN+IPsYSIzHbAHP2KQHANj0I+Orqp+IyIOS++M8TuCX4zkWh9dvi8s92yy/Tn8Ifg== - dependencies: - "@codemirror/autocomplete" "^0.19.0" - "@codemirror/highlight" "^0.19.6" - "@codemirror/language" "^0.19.0" - "@codemirror/state" "^0.19.0" - "@lezer/css" "^0.15.2" - -"@codemirror/lang-html@^0.19.4": - version "0.19.4" - resolved "https://registry.yarnpkg.com/@codemirror/lang-html/-/lang-html-0.19.4.tgz#e6eec28462f18842a0e108732a214a7416b5e333" - integrity sha512-GpiEikNuCBeFnS+/TJSeanwqaOfNm8Kkp9WpVNEPZCLyW1mAMCuFJu/3xlWYeWc778Hc3vJqGn3bn+cLNubgCA== - dependencies: - "@codemirror/autocomplete" "^0.19.0" - "@codemirror/highlight" "^0.19.6" - "@codemirror/lang-css" "^0.19.0" - "@codemirror/lang-javascript" "^0.19.0" - "@codemirror/language" "^0.19.0" - "@codemirror/state" "^0.19.0" - "@lezer/common" "^0.15.0" - "@lezer/html" "^0.15.0" - -"@codemirror/lang-javascript@^0.19.0", "@codemirror/lang-javascript@^0.19.3": - version "0.19.7" - resolved "https://registry.yarnpkg.com/@codemirror/lang-javascript/-/lang-javascript-0.19.7.tgz#84581ef6abf2a16d78f017ffc96c2d6227de5eb5" - integrity sha512-DL9f3JLqOEHH9cIwEqqjnP5bkjdVXeECksLtV+/MbPm+l4H+AG+PkwZaJQ2oR1GfPZKh8MVSIE94aGWNkJP8WQ== - dependencies: - "@codemirror/autocomplete" "^0.19.0" - "@codemirror/highlight" "^0.19.7" - "@codemirror/language" "^0.19.0" - "@codemirror/lint" "^0.19.0" - "@codemirror/state" "^0.19.0" - "@codemirror/view" "^0.19.0" - "@lezer/javascript" "^0.15.1" - -"@codemirror/lang-python@^0.19.5": - version "0.19.5" - resolved "https://registry.yarnpkg.com/@codemirror/lang-python/-/lang-python-0.19.5.tgz#52ad893c45d9a20fdd9841ebfe1d6de52e1dead1" - integrity sha512-MQf7t0k6+i9KCzlFCI8EY+jjwyXLy5AwjmXsMyMCMbOw/97j70jFZYrs7Mm7RJakNE2rypWhnLGlyBTSYMqR5g== - dependencies: - "@codemirror/highlight" "^0.19.7" - "@codemirror/language" "^0.19.0" - "@lezer/python" "^0.15.0" - -"@codemirror/language@^0.19.0", "@codemirror/language@^0.19.7": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-0.19.10.tgz#c3d1330fa5de778c6b6b5177af5572a3d9d596b5" - integrity sha512-yA0DZ3RYn2CqAAGW62VrU8c4YxscMQn45y/I9sjBlqB1e2OTQLg4CCkMBuMSLXk4xaqjlsgazeOQWaJQOKfV8Q== - dependencies: - "@codemirror/state" "^0.19.0" - "@codemirror/text" "^0.19.0" - "@codemirror/view" "^0.19.0" - "@lezer/common" "^0.15.5" - "@lezer/lr" "^0.15.0" - -"@codemirror/legacy-modes@^0.19.1": - version "0.19.1" - resolved "https://registry.yarnpkg.com/@codemirror/legacy-modes/-/legacy-modes-0.19.1.tgz#7dc3b5df1842060648f75764ab6919fcfce3ea1a" - integrity sha512-vYPLsD/ON+3SXhlGj9Qb3fpFNNU3Ya/AtDiv/g3OyqVzhh5vs5rAnOvk8xopGWRwppdhlNPD9VyXjiOmZUQtmQ== - dependencies: - "@codemirror/stream-parser" "^0.19.0" - -"@codemirror/lint@^0.19.0": - version "0.19.6" - resolved "https://registry.yarnpkg.com/@codemirror/lint/-/lint-0.19.6.tgz#0379688da3e16739db4a6304c73db857ca85d7ec" - integrity sha512-Pbw1Y5kHVs2J+itQ0uez3dI4qY9ApYVap7eNfV81x1/3/BXgBkKfadaw0gqJ4h4FDG7OnJwb0VbPsjJQllHjaA== - dependencies: - "@codemirror/gutter" "^0.19.4" - "@codemirror/panel" "^0.19.0" - "@codemirror/rangeset" "^0.19.1" - "@codemirror/state" "^0.19.4" - "@codemirror/tooltip" "^0.19.16" - "@codemirror/view" "^0.19.22" +"@codemirror/legacy-modes@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@codemirror/legacy-modes/-/legacy-modes-6.3.1.tgz#77ab3f3db1ce3e47aad7a5baac3a4b12844734a5" + integrity sha512-icXmCs4Mhst2F8mE0TNpmG6l7YTj1uxam3AbZaFaabINH5oWAdg2CfR/PVi+d/rqxJ+TuTnvkKK5GILHrNThtw== + dependencies: + "@codemirror/language" "^6.0.0" + +"@codemirror/lint@^6.0.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@codemirror/lint/-/lint-6.1.0.tgz#f006142d3a580fdb8ffc2faa3361b2232c08e079" + integrity sha512-mdvDQrjRmYPvQ3WrzF6Ewaao+NWERYtpthJvoQ3tK3t/44Ynhk8ZGjTSL9jMEv8CgSMogmt75X8ceOZRDSXHtQ== + dependencies: + "@codemirror/state" "^6.0.0" + "@codemirror/view" "^6.0.0" crelt "^1.0.5" -"@codemirror/matchbrackets@^0.19.0", "@codemirror/matchbrackets@^0.19.3": - version "0.19.4" - resolved "https://registry.yarnpkg.com/@codemirror/matchbrackets/-/matchbrackets-0.19.4.tgz#50b5188eb2d53f32598dca906bf5fd66626a9ebc" - integrity sha512-VFkaOKPNudAA5sGP1zikRHCEKU0hjYmkKpr04pybUpQvfTvNJXlReCyP0rvH/1iEwAGPL990ZTT+QrLdu4MeEA== - dependencies: - "@codemirror/language" "^0.19.0" - "@codemirror/state" "^0.19.0" - "@codemirror/view" "^0.19.0" - "@lezer/common" "^0.15.0" - -"@codemirror/panel@^0.19.0": - version "0.19.1" - resolved "https://registry.yarnpkg.com/@codemirror/panel/-/panel-0.19.1.tgz#bf77d27b962cf16357139e50864d0eb69d634441" - integrity sha512-sYeOCMA3KRYxZYJYn5PNlt9yNsjy3zTNTrbYSfVgjgL9QomIVgOJWPO5hZ2sTN8lufO6lw0vTBsIPL9MSidmBg== - dependencies: - "@codemirror/state" "^0.19.0" - "@codemirror/view" "^0.19.0" - -"@codemirror/rangeset@^0.19.0", "@codemirror/rangeset@^0.19.1", "@codemirror/rangeset@^0.19.5": - version "0.19.9" - resolved "https://registry.yarnpkg.com/@codemirror/rangeset/-/rangeset-0.19.9.tgz#e80895de93c39dc7899f5be31d368c9d88aa4efc" - integrity sha512-V8YUuOvK+ew87Xem+71nKcqu1SXd5QROMRLMS/ljT5/3MCxtgrRie1Cvild0G/Z2f1fpWxzX78V0U4jjXBorBQ== - dependencies: - "@codemirror/state" "^0.19.0" - -"@codemirror/state@^0.19.0", "@codemirror/state@^0.19.2", "@codemirror/state@^0.19.3", "@codemirror/state@^0.19.4", "@codemirror/state@^0.19.6", "@codemirror/state@^0.19.9": - version "0.19.9" - resolved "https://registry.yarnpkg.com/@codemirror/state/-/state-0.19.9.tgz#b797f9fbc204d6dc7975485e231693c09001b0dd" - integrity sha512-psOzDolKTZkx4CgUqhBQ8T8gBc0xN5z4gzed109aF6x7D7umpDRoimacI/O6d9UGuyl4eYuDCZmDFr2Rq7aGOw== - dependencies: - "@codemirror/text" "^0.19.0" - -"@codemirror/stream-parser@^0.19.0", "@codemirror/stream-parser@^0.19.9": - version "0.19.9" - resolved "https://registry.yarnpkg.com/@codemirror/stream-parser/-/stream-parser-0.19.9.tgz#34955ea91a8047cf72abebd5ce28f0d332aeca48" - integrity sha512-WTmkEFSRCetpk8xIOvV2yyXdZs3DgYckM0IP7eFi4ewlxWnJO/H4BeJZLs4wQaydWsAqTQoDyIwNH1BCzK5LUQ== - dependencies: - "@codemirror/highlight" "^0.19.0" - "@codemirror/language" "^0.19.0" - "@codemirror/state" "^0.19.0" - "@codemirror/text" "^0.19.0" - "@lezer/common" "^0.15.0" - "@lezer/lr" "^0.15.0" - -"@codemirror/text@^0.19.0", "@codemirror/text@^0.19.2", "@codemirror/text@^0.19.6": - version "0.19.6" - resolved "https://registry.yarnpkg.com/@codemirror/text/-/text-0.19.6.tgz#9adcbd8137f69b75518eacd30ddb16fd67bbac45" - integrity sha512-T9jnREMIygx+TPC1bOuepz18maGq/92q2a+n4qTqObKwvNMg+8cMTslb8yxeEDEq7S3kpgGWxgO1UWbQRij0dA== - -"@codemirror/tooltip@^0.19.12", "@codemirror/tooltip@^0.19.16": - version "0.19.16" - resolved "https://registry.yarnpkg.com/@codemirror/tooltip/-/tooltip-0.19.16.tgz#6ba2c43f9d8e3d943d9d7bbae22bf800f7726a22" - integrity sha512-zxKDHryUV5/RS45AQL+wOeN+i7/l81wK56OMnUPoTSzCWNITfxHn7BToDsjtrRKbzHqUxKYmBnn/4hPjpZ4WJQ== - dependencies: - "@codemirror/state" "^0.19.0" - "@codemirror/view" "^0.19.0" - -"@codemirror/view@^0.19.0", "@codemirror/view@^0.19.22", "@codemirror/view@^0.19.23", "@codemirror/view@^0.19.32", "@codemirror/view@^0.19.39", "@codemirror/view@^0.19.44": - version "0.19.48" - resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-0.19.48.tgz#1c657e2b0f8ed896ac6448d6e2215ab115e2a0fc" - integrity sha512-0eg7D2Nz4S8/caetCTz61rK0tkHI17V/d15Jy0kLOT8dTLGGNJUponDnW28h2B6bERmPlVHKh8MJIr5OCp1nGw== - dependencies: - "@codemirror/rangeset" "^0.19.5" - "@codemirror/state" "^0.19.3" - "@codemirror/text" "^0.19.0" +"@codemirror/state@^6.0.0", "@codemirror/state@^6.1.4", "@codemirror/state@^6.2.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@codemirror/state/-/state-6.2.0.tgz#a0fb08403ced8c2a68d1d0acee926bd20be922f2" + integrity sha512-69QXtcrsc3RYtOtd+GsvczJ319udtBf1PTrr2KbLWM/e2CXUPnh0Nz9AUo8WfhSQ7GeL8dPVNUmhQVgpmuaNGA== + +"@codemirror/view@^6.0.0", "@codemirror/view@^6.2.2", "@codemirror/view@^6.6.0", "@codemirror/view@^6.7.1": + version "6.7.2" + resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-6.7.2.tgz#13830dd6366af15d48e34a5518ab26bb42c440cb" + integrity sha512-HeK2GyycxceaQVyvYVYXmn1vUKYYBsHCcfGRSsFO+3fRRtwXx2STK0YiFBmiWx2vtU9gUAJgIUXUN8a0osI8Ng== + dependencies: + "@codemirror/state" "^6.1.4" style-mod "^4.0.0" w3c-keyname "^2.2.4" @@ -3021,45 +2911,57 @@ npmlog "^4.1.2" write-file-atomic "^3.0.3" -"@lezer/common@^0.15.0", "@lezer/common@^0.15.5": - version "0.15.12" - resolved "https://registry.yarnpkg.com/@lezer/common/-/common-0.15.12.tgz#2f21aec551dd5fd7d24eb069f90f54d5bc6ee5e9" - integrity sha512-edfwCxNLnzq5pBA/yaIhwJ3U3Kz8VAUOTRg0hhxaizaI1N+qxV7EXDv/kLCkLeq2RzSFvxexlaj5Mzfn2kY0Ig== +"@lezer/common@^1.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@lezer/common/-/common-1.0.2.tgz#8fb9b86bdaa2ece57e7d59e5ffbcb37d71815087" + integrity sha512-SVgiGtMnMnW3ActR8SXgsDhw7a0w0ChHSYAyAUxxrOiJ1OqYWEKk/xJd84tTSPo1mo6DXLObAJALNnd0Hrv7Ng== -"@lezer/css@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@lezer/css/-/css-0.15.2.tgz#e96995da67df90bb4b191aaa8a486349cca5d8e7" - integrity sha512-tnMOMZY0Zs6JQeVjqfmREYMV0GnmZR1NitndLWioZMD6mA7VQF/PPKPmJX1f+ZgVZQc5Am0df9mX3aiJnNJlKQ== +"@lezer/css@^1.0.0", "@lezer/css@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@lezer/css/-/css-1.1.1.tgz#c36dcb0789317cb80c3740767dd3b85e071ad082" + integrity sha512-mSjx+unLLapEqdOYDejnGBokB5+AiJKZVclmud0MKQOKx3DLJ5b5VTCstgDDknR6iIV4gVrN6euzsCnj0A2gQA== dependencies: - "@lezer/lr" "^0.15.0" + "@lezer/highlight" "^1.0.0" + "@lezer/lr" "^1.0.0" -"@lezer/html@^0.15.0": - version "0.15.1" - resolved "https://registry.yarnpkg.com/@lezer/html/-/html-0.15.1.tgz#973a5a179560d0789bf8737c06e6d143cc211406" - integrity sha512-0ZYVhu+RwN6ZMM0gNnTxenRAdoycKc2wvpLfMjP0JkKR0vMxhtuLaIpsq9KW2Mv6l7ux5vdjq8CQ7fKDvia8KA== +"@lezer/highlight@^1.0.0", "@lezer/highlight@^1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@lezer/highlight/-/highlight-1.1.3.tgz#bf5a36c2ee227f526d74997ac91f7777e29bd25d" + integrity sha512-3vLKLPThO4td43lYRBygmMY18JN3CPh9w+XS2j8WC30vR4yZeFG4z1iFe4jXE43NtGqe//zHW5q8ENLlHvz9gw== dependencies: - "@lezer/lr" "^0.15.0" + "@lezer/common" "^1.0.0" -"@lezer/javascript@^0.15.1": - version "0.15.3" - resolved "https://registry.yarnpkg.com/@lezer/javascript/-/javascript-0.15.3.tgz#833a4c5650bae07805b9af88de6706368844dc55" - integrity sha512-8jA2NpOfpWwSPZxRhd9BxK2ZPvGd7nLE3LFTJ5AbMhXAzMHeMjneV6GEVd7dAIee85dtap0jdb6bgOSO0+lfwA== +"@lezer/html@^1.1.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@lezer/html/-/html-1.3.0.tgz#7e353dcefcdee9c4d3cd6bfc59416d0037f70c4c" + integrity sha512-jU/ah8DEoiECLTMouU/X/ujIg6k9WQMIOFMaCLebzaXfrguyGaR3DpTgmk0tbljiuIJ7hlmVJPcJcxGzmCd0Mg== dependencies: - "@lezer/lr" "^0.15.0" + "@lezer/common" "^1.0.0" + "@lezer/highlight" "^1.0.0" + "@lezer/lr" "^1.0.0" -"@lezer/lr@^0.15.0": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-0.15.8.tgz#1564a911e62b0a0f75ca63794a6aa8c5dc63db21" - integrity sha512-bM6oE6VQZ6hIFxDNKk8bKPa14hqFrV07J/vHGOeiAbJReIaQXmkVb6xQu4MR+JBTLa5arGRyAAjJe1qaQt3Uvg== +"@lezer/javascript@^1.0.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@lezer/javascript/-/javascript-1.4.0.tgz#fe71474fcadc6112fb0978310faed0788d0af824" + integrity sha512-MQ3oLJGEtpUgZ03LOLI60tDnjSkKO6h9hZSe31qJ1UQV+I9bpv3pwSnPUnX0+e+3E1PBVkox0GB2/MXkxg0M2w== dependencies: - "@lezer/common" "^0.15.0" + "@lezer/highlight" "^1.0.0" + "@lezer/lr" "^1.0.0" -"@lezer/python@^0.15.0": - version "0.15.1" - resolved "https://registry.yarnpkg.com/@lezer/python/-/python-0.15.1.tgz#dce18dade29fd93b01c1f7fc5dee4135e947f07b" - integrity sha512-Xdb2nh+FoxR8ssEADGsroDtsnP+EDhiPpW9zhER3h+6cpGtZ2e9Oq/Rwn9nFQRiKCfMT+AQaqC3ZgAbhbnumyQ== +"@lezer/lr@^1.0.0": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-1.2.5.tgz#e9088164a711690596f17378665e0554157c9b03" + integrity sha512-f9319YG1A/3ysgUE3bqCHEd7g+3ZZ71MWlwEc42mpnLVYXgfJJgtu1XAyBB4Kz8FmqmnFe9caopDqKeMMMAU6g== + dependencies: + "@lezer/common" "^1.0.0" + +"@lezer/python@^1.0.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@lezer/python/-/python-1.1.1.tgz#6d688071ed93d063a589a7d31df3279b1eba607a" + integrity sha512-ArUGh9kvdaOVu6IkSaYUS9WFQeMAFVWKRuZo6vexnxoeCLnxf0Y9DCFEAMMa7W9SQBGYE55OarSpPqSkdOXSCA== dependencies: - "@lezer/lr" "^0.15.0" + "@lezer/highlight" "^1.0.0" + "@lezer/lr" "^1.0.0" "@mdx-js/loader@^1.6.22": version "1.6.22"