@gradio/code 0.6.12 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @gradio/code
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Features
6
+
7
+ - [#8665](https://github.com/gradio-app/gradio/pull/8665) [`3b8238c`](https://github.com/gradio-app/gradio/commit/3b8238c2e222a6537b19b8901198b7e369e8319a) - Add c/cpp code support. Thanks @ginazhouhuiwu!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/atoms@0.7.6
12
+ - @gradio/utils@0.5.1
13
+ - @gradio/statustracker@0.7.1
14
+ - @gradio/upload@0.11.5
15
+ - @gradio/icons@0.6.0
16
+
17
+ ## 0.6.13
18
+
19
+ ### Dependency updates
20
+
21
+ - @gradio/upload@0.11.4
22
+
3
23
  ## 0.6.12
4
24
 
5
25
  ### Dependency updates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/code",
3
- "version": "0.6.12",
3
+ "version": "0.7.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -27,12 +27,12 @@
27
27
  "cm6-theme-basic-dark": "^0.2.0",
28
28
  "cm6-theme-basic-light": "^0.2.0",
29
29
  "codemirror": "^6.0.1",
30
- "@gradio/atoms": "^0.7.5",
31
- "@gradio/statustracker": "^0.7.0",
32
- "@gradio/upload": "^0.11.3",
33
- "@gradio/utils": "^0.5.0",
30
+ "@gradio/atoms": "^0.7.6",
31
+ "@gradio/icons": "^0.6.0",
32
+ "@gradio/statustracker": "^0.7.1",
33
+ "@gradio/utils": "^0.5.1",
34
34
  "@gradio/wasm": "^0.11.0",
35
- "@gradio/icons": "^0.5.0"
35
+ "@gradio/upload": "^0.11.5"
36
36
  },
37
37
  "main_changeset": true,
38
38
  "main": "./Index.svelte",
@@ -42,6 +42,6 @@
42
42
  "./package.json": "./package.json"
43
43
  },
44
44
  "devDependencies": {
45
- "@gradio/preview": "^0.10.0"
45
+ "@gradio/preview": "^0.10.1"
46
46
  }
47
47
  }
@@ -27,7 +27,9 @@
27
27
  dockerfile: "dockerfile",
28
28
  sh: "sh",
29
29
  shell: "sh",
30
- r: "r"
30
+ r: "r",
31
+ c: "c",
32
+ cpp: "cpp"
31
33
  };
32
34
 
33
35
  return exts[type] || "txt";
@@ -1,9 +1,12 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import { StreamLanguage } from "@codemirror/language";
3
3
  import { sql } from "@codemirror/legacy-modes/mode/sql";
4
+ import { _ } from "svelte-i18n";
4
5
 
5
6
  const possible_langs = [
6
7
  "python",
8
+ "c",
9
+ "cpp",
7
10
  "markdown",
8
11
  "json",
9
12
  "html",
@@ -35,6 +38,14 @@ const sql_dialects = [
35
38
 
36
39
  const lang_map: Record<string, (() => Promise<Extension>) | undefined> = {
37
40
  python: () => import("@codemirror/lang-python").then((m) => m.python()),
41
+ c: () =>
42
+ import("@codemirror/legacy-modes/mode/clike").then((m) =>
43
+ StreamLanguage.define(m.c)
44
+ ),
45
+ cpp: () =>
46
+ import("@codemirror/legacy-modes/mode/clike").then((m) =>
47
+ StreamLanguage.define(m.cpp)
48
+ ),
38
49
  markdown: async () => {
39
50
  const [md, frontmatter] = await Promise.all([
40
51
  import("@codemirror/lang-markdown"),