Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into release/v24.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
haschek committed Feb 6, 2025
2 parents e99f7e9 + a73e953 commit 689dfbd
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 14 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- implemented support for `disabled` state in code editor
- implemented support for `intent` states in code editor

### Fixed

- `MultiSelect`:
- Old suggestions might be shown for a very short time when typing in a new search query.
## [24.0.1] - 2025-02-06

### Changed

- `eslint` libraries were upgraded to v9, so `node` v18.18 or higher is required

### Fixed

- `MultiSelect`:
- Old suggestions might be shown for a very short time when typing in a new search query.
- `CodeEditor`:
- Broken highlighting for editor modes that leveraged adapted legacy modes.

## [24.0.0] - 2024-12-17

This is a major release, and it might be not compatible with your current usage of our library. Please read about the necessary changes in the section about how to migrate.
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@
"@blueprintjs/core": "^5.16.2",
"@blueprintjs/select": "^5.3.7",
"@carbon/icons": "^11.53.0",
"@carbon/react": "^1.72.0",
"@carbon/react": "1.72.0",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.3.1",
"@codemirror/lang-sql": "^6.8.0",
"@codemirror/lang-xml": "^6.1.0",
"@codemirror/lang-yaml": "^6.1.2",
"@codemirror/legacy-modes": "^6.4.2",
"@mavrin/remark-typograf": "^2.2.0",
"classnames": "^2.5.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
//adapted v6 modes imports
import { javascript } from "@codemirror/lang-javascript";
import { json } from "@codemirror/lang-json";
//modes imports
import { markdown } from "@codemirror/lang-markdown";
import { sql } from "@codemirror/lang-sql";
import { xml } from "@codemirror/lang-xml";
import { yaml } from "@codemirror/lang-yaml";
import { defaultHighlightStyle, LanguageSupport, StreamLanguage, StreamParser } from "@codemirror/language";
import { javascript } from "@codemirror/legacy-modes/mode/javascript";
//legacy mode imports
import { jinja2 } from "@codemirror/legacy-modes/mode/jinja2";
import { mathematica } from "@codemirror/legacy-modes/mode/mathematica";
import { ntriples } from "@codemirror/legacy-modes/mode/ntriples";
import { python } from "@codemirror/legacy-modes/mode/python";
import { sparql } from "@codemirror/legacy-modes/mode/sparql";
import { sql } from "@codemirror/legacy-modes/mode/sql";
import { turtle } from "@codemirror/legacy-modes/mode/turtle";
import { yaml } from "@codemirror/legacy-modes/mode/yaml";

//adaptations
import { adaptedSyntaxHighlighting } from "../tests/codemirrorTestHelper";
Expand All @@ -34,10 +35,19 @@ const supportedModes = {
export const supportedCodeEditorModes = Object.keys(supportedModes) as Array<keyof typeof supportedModes>;
export type SupportedCodeEditorModes = (typeof supportedCodeEditorModes)[number];

const v6AdaptedModes: ReadonlyMap<SupportedCodeEditorModes, boolean> = new Map([
["json", true],
["markdown", true],
["xml", true],
["sql", true],
["yaml", true],
["javascript", true],
]);

export const useCodeMirrorModeExtension = (mode?: SupportedCodeEditorModes) => {
return !mode
? adaptedSyntaxHighlighting(defaultHighlightStyle)
: ["json", "markdown", "xml"].includes(mode)
: v6AdaptedModes.has(mode)
? ((typeof supportedModes[mode] === "function" ? supportedModes[mode] : () => null) as () => LanguageSupport)()
: StreamLanguage?.define(supportedModes[mode] as StreamParser<unknown>);
};
42 changes: 38 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,7 @@
dependencies:
"@ibm/telemetry-js" "^1.5.0"

"@carbon/react@^1.72.0":
"@carbon/react@1.72.0":
version "1.72.0"
resolved "https://registry.yarnpkg.com/@carbon/react/-/react-1.72.0.tgz#ce4fee6e6ba45c6fde4fea4a6b9c382a267adf63"
integrity sha512-cQdf7EDeu7E4fTjP/vqfni4buc8V7XHw2YIlGVeRlLXVSc3WdoJgimLYaKUV4o0vvoqQvmiDEKDu0XdT7USJiw==
Expand Down Expand Up @@ -2535,7 +2535,7 @@
"@lezer/css" "^1.1.0"
"@lezer/html" "^1.3.0"

"@codemirror/lang-javascript@^6.0.0":
"@codemirror/lang-javascript@^6.0.0", "@codemirror/lang-javascript@^6.2.2":
version "6.2.2"
resolved "https://registry.yarnpkg.com/@codemirror/lang-javascript/-/lang-javascript-6.2.2.tgz#7141090b22994bef85bcc5608a3bc1257f2db2ad"
integrity sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==
Expand Down Expand Up @@ -2569,6 +2569,18 @@
"@lezer/common" "^1.2.1"
"@lezer/markdown" "^1.0.0"

"@codemirror/lang-sql@^6.8.0":
version "6.8.0"
resolved "https://registry.yarnpkg.com/@codemirror/lang-sql/-/lang-sql-6.8.0.tgz#1ae68ad49f378605ff88a4cc428ba667ce056068"
integrity sha512-aGLmY4OwGqN3TdSx3h6QeA1NrvaYtF7kkoWR/+W7/JzB0gQtJ+VJxewlnE3+VImhA4WVlhmkJr109PefOOhjLg==
dependencies:
"@codemirror/autocomplete" "^6.0.0"
"@codemirror/language" "^6.0.0"
"@codemirror/state" "^6.0.0"
"@lezer/common" "^1.2.0"
"@lezer/highlight" "^1.0.0"
"@lezer/lr" "^1.0.0"

"@codemirror/lang-xml@^6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@codemirror/lang-xml/-/lang-xml-6.1.0.tgz#e3e786e1a89fdc9520efe75c1d6d3de1c40eb91c"
Expand All @@ -2581,6 +2593,19 @@
"@lezer/common" "^1.0.0"
"@lezer/xml" "^1.0.0"

"@codemirror/lang-yaml@^6.1.2":
version "6.1.2"
resolved "https://registry.yarnpkg.com/@codemirror/lang-yaml/-/lang-yaml-6.1.2.tgz#c84280c68fa7af456a355d91183b5e537e9b7038"
integrity sha512-dxrfG8w5Ce/QbT7YID7mWZFKhdhsaTNOYjOkSIMt1qmC4VQnXSDSYVHHHn8k6kJUfIhtLo8t1JJgltlxWdsITw==
dependencies:
"@codemirror/autocomplete" "^6.0.0"
"@codemirror/language" "^6.0.0"
"@codemirror/state" "^6.0.0"
"@lezer/common" "^1.2.0"
"@lezer/highlight" "^1.2.0"
"@lezer/lr" "^1.0.0"
"@lezer/yaml" "^1.0.0"

"@codemirror/language@^6.0.0", "@codemirror/language@^6.3.0", "@codemirror/language@^6.4.0", "@codemirror/language@^6.6.0":
version "6.10.3"
resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-6.10.3.tgz#eb25fc5ade19032e7bf1dcaa957804e5f1660585"
Expand Down Expand Up @@ -3295,7 +3320,7 @@
"@lezer/highlight" "^1.0.0"
"@lezer/lr" "^1.0.0"

"@lezer/highlight@^1.0.0", "@lezer/highlight@^1.1.3":
"@lezer/highlight@^1.0.0", "@lezer/highlight@^1.1.3", "@lezer/highlight@^1.2.0":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@lezer/highlight/-/highlight-1.2.1.tgz#596fa8f9aeb58a608be0a563e960c373cbf23f8b"
integrity sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==
Expand Down Expand Up @@ -3329,7 +3354,7 @@
"@lezer/highlight" "^1.0.0"
"@lezer/lr" "^1.0.0"

"@lezer/lr@^1.0.0", "@lezer/lr@^1.3.0":
"@lezer/lr@^1.0.0", "@lezer/lr@^1.3.0", "@lezer/lr@^1.4.0":
version "1.4.2"
resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-1.4.2.tgz#931ea3dea8e9de84e90781001dae30dea9ff1727"
integrity sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==
Expand All @@ -3353,6 +3378,15 @@
"@lezer/highlight" "^1.0.0"
"@lezer/lr" "^1.0.0"

"@lezer/yaml@^1.0.0":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@lezer/yaml/-/yaml-1.0.3.tgz#b23770ab42b390056da6b187d861b998fd60b1ff"
integrity sha512-GuBLekbw9jDBDhGur82nuwkxKQ+a3W5H0GfaAthDXcAu+XdpS43VlnxA9E9hllkpSP5ellRDKjLLj7Lu9Wr6xA==
dependencies:
"@lezer/common" "^1.2.0"
"@lezer/highlight" "^1.0.0"
"@lezer/lr" "^1.4.0"

"@mavrin/remark-typograf@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@mavrin/remark-typograf/-/remark-typograf-2.2.0.tgz#4afc3502ce5a3570c64ca8708b21162b92fbf7ef"
Expand Down

0 comments on commit 689dfbd

Please sign in to comment.