@fieldia/code 0.13.0 → 0.14.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/README.md +47 -8
- package/package.json +19 -4
- package/src/index.d.mts +2 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/index.mjs +2 -0
- package/src/index.mjs.map +1 -1
- package/src/lib/code.d.mts +6 -1
- package/src/lib/code.d.ts +6 -1
- package/src/lib/code.js +15 -4
- package/src/lib/code.js.map +1 -1
- package/src/lib/code.mjs +14 -4
- package/src/lib/code.mjs.map +1 -1
- package/src/lib/languages.d.mts +25 -0
- package/src/lib/languages.d.ts +25 -0
- package/src/lib/languages.js +137 -0
- package/src/lib/languages.js.map +1 -0
- package/src/lib/languages.mjs +132 -0
- package/src/lib/languages.mjs.map +1 -0
- package/src/lib/palette.d.mts +36 -0
- package/src/lib/palette.d.ts +36 -0
- package/src/lib/palette.js +50 -0
- package/src/lib/palette.js.map +1 -0
- package/src/lib/palette.mjs +47 -0
- package/src/lib/palette.mjs.map +1 -0
- package/src/lib/styles.d.mts +1 -1
- package/src/lib/styles.d.ts +1 -1
- package/src/lib/styles.js +12 -1
- package/src/lib/styles.js.map +1 -1
- package/src/lib/styles.mjs +12 -1
- package/src/lib/styles.mjs.map +1 -1
- package/src/lib/text-code.d.mts +2 -0
- package/src/lib/text-code.d.ts +2 -0
- package/src/lib/text-code.js +123 -0
- package/src/lib/text-code.js.map +1 -0
- package/src/lib/text-code.mjs +119 -0
- package/src/lib/text-code.mjs.map +1 -0
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# @fieldia/code
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
[Fieldia](https://fieldia.dev) fields in a code editor: JSON, and text in
|
|
4
|
+
any of 44 languages, coloured as you type. CodeMirror 6, installed with the
|
|
5
|
+
package, so it works offline; each language's grammar loads only when a
|
|
6
|
+
field uses it.
|
|
6
7
|
|
|
7
8
|
```sh
|
|
8
9
|
npm install @fieldia/code
|
|
@@ -15,13 +16,51 @@ import { codeWidgets } from '@fieldia/code';
|
|
|
15
16
|
mountViewer(host, { page, dataSource, widgets: codeWidgets });
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
A
|
|
19
|
+
A node opts in with `"widget": "code"`; others keep their plain box.
|
|
19
20
|
In React pass `widgets={codeWidgets}`, in Vue `:widgets="codeWidgets"`, in
|
|
20
21
|
Angular `[widgets]="codeWidgets"` (spread it beside `gridWidgets` to use both).
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
## Code in a language
|
|
24
|
+
|
|
25
|
+
On a `text` field (or a `char` field, kept to one line), name the language:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{ "type": "field", "field": "script", "widget": "code", "options": { "language": "python" } }
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- JavaScript, TypeScript (and either with JSX), Python, SQL (and the
|
|
32
|
+
PostgreSQL, MySQL, SQLite and SQL Server dialects), HTML, CSS, XML, YAML,
|
|
33
|
+
Markdown, JSON, Java, C, C++, PHP, Rust and Go; and shell, PowerShell,
|
|
34
|
+
Ruby, Perl, Lua, R, Swift, Kotlin, C#, Scala, Dart, Dockerfile, TOML, INI,
|
|
35
|
+
diff, nginx, Protocol Buffers, Haskell, Clojure, Erlang, Groovy and Julia.
|
|
36
|
+
`CODE_LANGUAGES` lists them, each with its other names (`py`, `bash`,
|
|
37
|
+
`yml`, `c++`…); a name is read in any case.
|
|
38
|
+
- Each grammar is a dynamic import of its own, so your bundler makes it a
|
|
39
|
+
file of its own: a page with one Python field loads Python's grammar and no
|
|
40
|
+
other.
|
|
41
|
+
- A language not on the list, or none, is plain text.
|
|
42
|
+
- What is typed reaches the form as text; an empty editor as nothing (null).
|
|
43
|
+
|
|
44
|
+
## JSON
|
|
45
|
+
|
|
46
|
+
On a `json` field, `"widget": "code"` edits the value as JSON: valid JSON
|
|
47
|
+
reaches the form as it is typed; text that is not valid is said so, and the
|
|
48
|
+
last good value stays.
|
|
49
|
+
|
|
50
|
+
## Every editor
|
|
51
|
+
|
|
52
|
+
- Line numbers, bracket matching, undo.
|
|
53
|
+
- Tab moves to the next field, as in every field; Ctrl+] and Ctrl+[ indent.
|
|
54
|
+
- Read-only when the field is; required, invalid and its messages said to
|
|
55
|
+
assistive technology, and named by the field's label.
|
|
56
|
+
- Code reads left to right, on an Arabic page too.
|
|
57
|
+
- Coloured in Fieldia's tokens: the box on the form's surface, comments in
|
|
58
|
+
its quiet words; keywords, strings and the rest in colours that read at
|
|
59
|
+
4.5:1 or more on every theme's surface, light and dark. Set your own with
|
|
60
|
+
the `--fd-code-keyword`, `--fd-code-string`, `--fd-code-literal`,
|
|
61
|
+
`--fd-code-function`, `--fd-code-type`, `--fd-code-tag` and
|
|
62
|
+
`--fd-code-property` tokens.
|
|
63
|
+
|
|
64
|
+
For VS Code's editor instead, see `@fieldia/monaco`.
|
|
26
65
|
|
|
27
66
|
MIT. CodeMirror is MIT too.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fieldia/code",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Fieldia
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "Fieldia fields in a code editor: JSON, and text in 44 languages from Python to SQL. CodeMirror 6, each grammar loaded only when a field uses it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://fieldia.dev",
|
|
7
7
|
"type": "commonjs",
|
|
@@ -22,13 +22,28 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@codemirror/commands": "^6.11.1",
|
|
25
|
+
"@codemirror/lang-cpp": "^6.0.3",
|
|
26
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
27
|
+
"@codemirror/lang-go": "^6.0.1",
|
|
28
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
29
|
+
"@codemirror/lang-java": "^6.0.2",
|
|
30
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
25
31
|
"@codemirror/lang-json": "^6.0.2",
|
|
32
|
+
"@codemirror/lang-markdown": "^6.5.2",
|
|
33
|
+
"@codemirror/lang-php": "^6.0.2",
|
|
34
|
+
"@codemirror/lang-python": "^6.2.1",
|
|
35
|
+
"@codemirror/lang-rust": "^6.0.2",
|
|
36
|
+
"@codemirror/lang-sql": "^6.10.0",
|
|
37
|
+
"@codemirror/lang-xml": "^6.1.0",
|
|
38
|
+
"@codemirror/lang-yaml": "^6.1.3",
|
|
26
39
|
"@codemirror/language": ">=6.12.4 <6.13.0 || >=6.13.1 <7.0.0",
|
|
40
|
+
"@codemirror/legacy-modes": "^6.5.4",
|
|
27
41
|
"@codemirror/lint": "^6.9.7",
|
|
28
42
|
"@codemirror/state": "^6.7.6",
|
|
29
43
|
"@codemirror/view": "^6.43.13",
|
|
30
|
-
"@fieldia/core": "0.
|
|
31
|
-
"@fieldia/widgets": "0.
|
|
44
|
+
"@fieldia/core": "0.14.0",
|
|
45
|
+
"@fieldia/widgets": "0.14.0",
|
|
46
|
+
"@lezer/highlight": "^1.2.5",
|
|
32
47
|
"tslib": "^2.8.1"
|
|
33
48
|
},
|
|
34
49
|
"sideEffects": false,
|
package/src/index.d.mts
CHANGED
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -3,4 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./lib/code"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./lib/styles"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/languages"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/palette"), exports);
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/code/src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,uDAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/code/src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,uDAA6B;AAC7B,0DAAgC;AAChC,wDAA8B"}
|
package/src/index.mjs
CHANGED
package/src/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../libs/code/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../libs/code/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
package/src/lib/code.d.mts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type WidgetFactory } from '@fieldia/widgets';
|
|
2
|
+
export { textCodeWidget } from './text-code.mjs';
|
|
2
3
|
export declare const codeWidget: WidgetFactory;
|
|
3
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Pass these to the viewer (`widgets`) to show nodes marked `"widget": "code"`
|
|
6
|
+
* in the editor: json as JSON, text and char in the language the node names
|
|
7
|
+
* (`"options": { "language": "python" }`).
|
|
8
|
+
*/
|
|
4
9
|
export declare const codeWidgets: Record<string, WidgetFactory>;
|
package/src/lib/code.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type WidgetFactory } from '@fieldia/widgets';
|
|
2
|
+
export { textCodeWidget } from './text-code';
|
|
2
3
|
export declare const codeWidget: WidgetFactory;
|
|
3
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Pass these to the viewer (`widgets`) to show nodes marked `"widget": "code"`
|
|
6
|
+
* in the editor: json as JSON, text and char in the language the node names
|
|
7
|
+
* (`"options": { "language": "python" }`).
|
|
8
|
+
*/
|
|
4
9
|
export declare const codeWidgets: Record<string, WidgetFactory>;
|
package/src/lib/code.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.codeWidgets = exports.codeWidget = void 0;
|
|
3
|
+
exports.codeWidgets = exports.codeWidget = exports.textCodeWidget = void 0;
|
|
4
4
|
const commands_1 = require("@codemirror/commands");
|
|
5
5
|
const lang_json_1 = require("@codemirror/lang-json");
|
|
6
6
|
const language_1 = require("@codemirror/language");
|
|
7
7
|
const state_1 = require("@codemirror/state");
|
|
8
8
|
const view_1 = require("@codemirror/view");
|
|
9
9
|
const widgets_1 = require("@fieldia/widgets");
|
|
10
|
+
const palette_1 = require("./palette");
|
|
10
11
|
const styles_1 = require("./styles");
|
|
12
|
+
const text_code_1 = require("./text-code");
|
|
13
|
+
var text_code_2 = require("./text-code");
|
|
14
|
+
Object.defineProperty(exports, "textCodeWidget", { enumerable: true, get: function () { return text_code_2.textCodeWidget; } });
|
|
11
15
|
/**
|
|
12
16
|
* A JSON field in a code editor: CodeMirror 6, bundled with the package, so it
|
|
13
17
|
* works offline and loads only on pages that ask for it (`"widget": "code"` on
|
|
@@ -31,6 +35,8 @@ const codeWidget = ({ form, name, id, document, labels = widgets_1.WIDGET_LABELS
|
|
|
31
35
|
(0, styles_1.installCodeStyles)(document);
|
|
32
36
|
const element = document.createElement('div');
|
|
33
37
|
element.className = 'fd-code';
|
|
38
|
+
// JSON reads left to right, on an Arabic page too: drawn right to left, its punctuation moves.
|
|
39
|
+
element.dir = 'ltr';
|
|
34
40
|
const error = document.createElement('div');
|
|
35
41
|
error.className = 'fd-error fd-code-error';
|
|
36
42
|
error.setAttribute('role', 'alert');
|
|
@@ -49,7 +55,8 @@ const codeWidget = ({ form, name, id, document, labels = widgets_1.WIDGET_LABELS
|
|
|
49
55
|
(0, commands_1.history)(),
|
|
50
56
|
(0, language_1.bracketMatching)(),
|
|
51
57
|
(0, language_1.indentOnInput)(),
|
|
52
|
-
|
|
58
|
+
// The code colours, light or dark with the page: CodeMirror's own are for light pages only.
|
|
59
|
+
(0, language_1.syntaxHighlighting)(palette_1.codeHighlightStyle),
|
|
53
60
|
(0, lang_json_1.json)(),
|
|
54
61
|
view_1.keymap.of([...commands_1.defaultKeymap, ...commands_1.historyKeymap]),
|
|
55
62
|
editable.of([view_1.EditorView.editable.of(true), state_1.EditorState.readOnly.of(false)]),
|
|
@@ -93,6 +100,10 @@ const codeWidget = ({ form, name, id, document, labels = widgets_1.WIDGET_LABELS
|
|
|
93
100
|
};
|
|
94
101
|
};
|
|
95
102
|
exports.codeWidget = codeWidget;
|
|
96
|
-
/**
|
|
97
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Pass these to the viewer (`widgets`) to show nodes marked `"widget": "code"`
|
|
105
|
+
* in the editor: json as JSON, text and char in the language the node names
|
|
106
|
+
* (`"options": { "language": "python" }`).
|
|
107
|
+
*/
|
|
108
|
+
exports.codeWidgets = { 'json.code': exports.codeWidget, 'text.code': text_code_1.textCodeWidget, 'char.code': text_code_1.textCodeWidget };
|
|
98
109
|
//# sourceMappingURL=code.js.map
|
package/src/lib/code.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../../../libs/code/src/lib/code.ts"],"names":[],"mappings":";;;AAAA,mDAA6E;AAC7E,qDAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../../../libs/code/src/lib/code.ts"],"names":[],"mappings":";;;AAAA,mDAA6E;AAC7E,qDAA6C;AAC7C,mDAA0F;AAC1F,6CAA6D;AAC7D,2CAAmE;AAEnE,8CAAqE;AACrE,uCAA+C;AAC/C,qCAA6C;AA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E,CAAC,CAAC;YAC9F,OAAO,GAAG,KAAK,CAAC;YAChB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAnEW,QAAA,UAAU,cAmErB;AAEF;;;;GAIG;AACU,QAAA,WAAW,GAAkC,EAAE,WAAW,EAAE,kBAAU,EAAE,WAAW,EAAE,0BAAc,EAAE,WAAW,EAAE,0BAAc,EAAE,CAAC"}
|
package/src/lib/code.mjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
2
2
|
import { json } from '@codemirror/lang-json';
|
|
3
|
-
import { bracketMatching,
|
|
3
|
+
import { bracketMatching, indentOnInput, syntaxHighlighting } from '@codemirror/language';
|
|
4
4
|
import { Compartment, EditorState } from '@codemirror/state';
|
|
5
5
|
import { EditorView, keymap, lineNumbers } from '@codemirror/view';
|
|
6
6
|
import { WIDGET_LABELS } from '@fieldia/widgets';
|
|
7
|
+
import { codeHighlightStyle } from './palette.mjs';
|
|
7
8
|
import { installCodeStyles } from './styles.mjs';
|
|
9
|
+
import { textCodeWidget } from './text-code.mjs';
|
|
10
|
+
export { textCodeWidget } from './text-code.mjs';
|
|
8
11
|
/**
|
|
9
12
|
* A JSON field in a code editor: CodeMirror 6, bundled with the package, so it
|
|
10
13
|
* works offline and loads only on pages that ask for it (`"widget": "code"` on
|
|
@@ -28,6 +31,8 @@ export const codeWidget = ({ form, name, id, document, labels = WIDGET_LABELS.en
|
|
|
28
31
|
installCodeStyles(document);
|
|
29
32
|
const element = document.createElement('div');
|
|
30
33
|
element.className = 'fd-code';
|
|
34
|
+
// JSON reads left to right, on an Arabic page too: drawn right to left, its punctuation moves.
|
|
35
|
+
element.dir = 'ltr';
|
|
31
36
|
const error = document.createElement('div');
|
|
32
37
|
error.className = 'fd-error fd-code-error';
|
|
33
38
|
error.setAttribute('role', 'alert');
|
|
@@ -46,7 +51,8 @@ export const codeWidget = ({ form, name, id, document, labels = WIDGET_LABELS.en
|
|
|
46
51
|
history(),
|
|
47
52
|
bracketMatching(),
|
|
48
53
|
indentOnInput(),
|
|
49
|
-
|
|
54
|
+
// The code colours, light or dark with the page: CodeMirror's own are for light pages only.
|
|
55
|
+
syntaxHighlighting(codeHighlightStyle),
|
|
50
56
|
json(),
|
|
51
57
|
keymap.of([...defaultKeymap, ...historyKeymap]),
|
|
52
58
|
editable.of([EditorView.editable.of(true), EditorState.readOnly.of(false)]),
|
|
@@ -89,6 +95,10 @@ export const codeWidget = ({ form, name, id, document, labels = WIDGET_LABELS.en
|
|
|
89
95
|
},
|
|
90
96
|
};
|
|
91
97
|
};
|
|
92
|
-
/**
|
|
93
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Pass these to the viewer (`widgets`) to show nodes marked `"widget": "code"`
|
|
100
|
+
* in the editor: json as JSON, text and char in the language the node names
|
|
101
|
+
* (`"options": { "language": "python" }`).
|
|
102
|
+
*/
|
|
103
|
+
export const codeWidgets = { 'json.code': codeWidget, 'text.code': textCodeWidget, 'char.code': textCodeWidget };
|
|
94
104
|
//# sourceMappingURL=code.mjs.map
|
package/src/lib/code.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.mjs","sourceRoot":"","sources":["../../../../../libs/code/src/lib/code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"code.mjs","sourceRoot":"","sources":["../../../../../libs/code/src/lib/code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sBA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C;aAClH,CAAC,CAAC;YACH,qGAAqG;YACrG,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;YACrD,IAAI,QAAQ,KAAK,KAAK;gBAAE,OAAO;YAC/B,KAAK,GAAG,QAAQ,CAAC;YACjB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9F,OAAO,GAAG,KAAK,CAAC;YAChB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAkC,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* The languages a code field can be written in (`options.language`), each
|
|
4
|
+
* grammar loaded only when a field asks for it: a dynamic import of its own,
|
|
5
|
+
* so a bundler splits it off and a page with one Python field carries
|
|
6
|
+
* Python's grammar alone. A name this list does not know is plain text.
|
|
7
|
+
*/
|
|
8
|
+
export interface CodeLanguage {
|
|
9
|
+
/** The name a page gives it: `{ "widget": "code", "options": { "language": "python" } }`. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Its name as people know it. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Other names a page may give it: `py`, `bash`, `yml`. */
|
|
14
|
+
aliases: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** Every language a code field can be written in, in the order a person picking one reads them. */
|
|
17
|
+
export declare const CODE_LANGUAGES: readonly CodeLanguage[];
|
|
18
|
+
/** The language a page names, by its id or another of its names, in any case; null for one not on the list. */
|
|
19
|
+
export declare function codeLanguage(name: unknown): CodeLanguage | null;
|
|
20
|
+
/**
|
|
21
|
+
* The grammar of the language a page names, ready for an editor: loaded the
|
|
22
|
+
* first time a field asks for it. Null for a language not on the list, and
|
|
23
|
+
* for one whose file could not be fetched — the field stays plain text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadCodeLanguage(name: unknown): Promise<Extension | null>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* The languages a code field can be written in (`options.language`), each
|
|
4
|
+
* grammar loaded only when a field asks for it: a dynamic import of its own,
|
|
5
|
+
* so a bundler splits it off and a page with one Python field carries
|
|
6
|
+
* Python's grammar alone. A name this list does not know is plain text.
|
|
7
|
+
*/
|
|
8
|
+
export interface CodeLanguage {
|
|
9
|
+
/** The name a page gives it: `{ "widget": "code", "options": { "language": "python" } }`. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Its name as people know it. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Other names a page may give it: `py`, `bash`, `yml`. */
|
|
14
|
+
aliases: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** Every language a code field can be written in, in the order a person picking one reads them. */
|
|
17
|
+
export declare const CODE_LANGUAGES: readonly CodeLanguage[];
|
|
18
|
+
/** The language a page names, by its id or another of its names, in any case; null for one not on the list. */
|
|
19
|
+
export declare function codeLanguage(name: unknown): CodeLanguage | null;
|
|
20
|
+
/**
|
|
21
|
+
* The grammar of the language a page names, ready for an editor: loaded the
|
|
22
|
+
* first time a field asks for it. Null for a language not on the list, and
|
|
23
|
+
* for one whose file could not be fetched — the field stays plain text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadCodeLanguage(name: unknown): Promise<Extension | null>;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CODE_LANGUAGES = void 0;
|
|
4
|
+
exports.codeLanguage = codeLanguage;
|
|
5
|
+
exports.loadCodeLanguage = loadCodeLanguage;
|
|
6
|
+
const language_1 = require("@codemirror/language");
|
|
7
|
+
/** A grammar from @codemirror/legacy-modes, as a language the editor reads. */
|
|
8
|
+
const stream = (parser) => language_1.StreamLanguage.define(parser);
|
|
9
|
+
/** How each language's grammar loads: a dynamic import each, so each is a file of its own. */
|
|
10
|
+
const LOADERS = {
|
|
11
|
+
javascript: () => Promise.resolve().then(() => require('@codemirror/lang-javascript')).then((m) => m.javascript()),
|
|
12
|
+
typescript: () => Promise.resolve().then(() => require('@codemirror/lang-javascript')).then((m) => m.javascript({ typescript: true })),
|
|
13
|
+
jsx: () => Promise.resolve().then(() => require('@codemirror/lang-javascript')).then((m) => m.javascript({ jsx: true })),
|
|
14
|
+
tsx: () => Promise.resolve().then(() => require('@codemirror/lang-javascript')).then((m) => m.javascript({ jsx: true, typescript: true })),
|
|
15
|
+
python: () => Promise.resolve().then(() => require('@codemirror/lang-python')).then((m) => m.python()),
|
|
16
|
+
sql: () => Promise.resolve().then(() => require('@codemirror/lang-sql')).then((m) => m.sql()),
|
|
17
|
+
postgresql: () => Promise.resolve().then(() => require('@codemirror/lang-sql')).then((m) => m.sql({ dialect: m.PostgreSQL })),
|
|
18
|
+
mysql: () => Promise.resolve().then(() => require('@codemirror/lang-sql')).then((m) => m.sql({ dialect: m.MySQL })),
|
|
19
|
+
sqlite: () => Promise.resolve().then(() => require('@codemirror/lang-sql')).then((m) => m.sql({ dialect: m.SQLite })),
|
|
20
|
+
mssql: () => Promise.resolve().then(() => require('@codemirror/lang-sql')).then((m) => m.sql({ dialect: m.MSSQL })),
|
|
21
|
+
html: () => Promise.resolve().then(() => require('@codemirror/lang-html')).then((m) => m.html()),
|
|
22
|
+
css: () => Promise.resolve().then(() => require('@codemirror/lang-css')).then((m) => m.css()),
|
|
23
|
+
xml: () => Promise.resolve().then(() => require('@codemirror/lang-xml')).then((m) => m.xml()),
|
|
24
|
+
yaml: () => Promise.resolve().then(() => require('@codemirror/lang-yaml')).then((m) => m.yaml()),
|
|
25
|
+
markdown: () => Promise.resolve().then(() => require('@codemirror/lang-markdown')).then((m) => m.markdown()),
|
|
26
|
+
json: () => Promise.resolve().then(() => require('@codemirror/lang-json')).then((m) => m.json()),
|
|
27
|
+
java: () => Promise.resolve().then(() => require('@codemirror/lang-java')).then((m) => m.java()),
|
|
28
|
+
c: () => Promise.resolve().then(() => require('@codemirror/lang-cpp')).then((m) => m.cpp()),
|
|
29
|
+
cpp: () => Promise.resolve().then(() => require('@codemirror/lang-cpp')).then((m) => m.cpp()),
|
|
30
|
+
php: () => Promise.resolve().then(() => require('@codemirror/lang-php')).then((m) => m.php()),
|
|
31
|
+
rust: () => Promise.resolve().then(() => require('@codemirror/lang-rust')).then((m) => m.rust()),
|
|
32
|
+
go: () => Promise.resolve().then(() => require('@codemirror/lang-go')).then((m) => m.go()),
|
|
33
|
+
// The rest from CodeMirror 5's modes, each a small file of its own.
|
|
34
|
+
shell: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/shell')).then((m) => stream(m.shell)),
|
|
35
|
+
powershell: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/powershell')).then((m) => stream(m.powerShell)),
|
|
36
|
+
ruby: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/ruby')).then((m) => stream(m.ruby)),
|
|
37
|
+
perl: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/perl')).then((m) => stream(m.perl)),
|
|
38
|
+
lua: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/lua')).then((m) => stream(m.lua)),
|
|
39
|
+
r: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/r')).then((m) => stream(m.r)),
|
|
40
|
+
swift: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/swift')).then((m) => stream(m.swift)),
|
|
41
|
+
kotlin: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/clike')).then((m) => stream(m.kotlin)),
|
|
42
|
+
csharp: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/clike')).then((m) => stream(m.csharp)),
|
|
43
|
+
scala: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/clike')).then((m) => stream(m.scala)),
|
|
44
|
+
dart: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/clike')).then((m) => stream(m.dart)),
|
|
45
|
+
dockerfile: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/dockerfile')).then((m) => stream(m.dockerFile)),
|
|
46
|
+
toml: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/toml')).then((m) => stream(m.toml)),
|
|
47
|
+
ini: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/properties')).then((m) => stream(m.properties)),
|
|
48
|
+
diff: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/diff')).then((m) => stream(m.diff)),
|
|
49
|
+
nginx: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/nginx')).then((m) => stream(m.nginx)),
|
|
50
|
+
protobuf: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/protobuf')).then((m) => stream(m.protobuf)),
|
|
51
|
+
haskell: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/haskell')).then((m) => stream(m.haskell)),
|
|
52
|
+
clojure: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/clojure')).then((m) => stream(m.clojure)),
|
|
53
|
+
erlang: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/erlang')).then((m) => stream(m.erlang)),
|
|
54
|
+
groovy: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/groovy')).then((m) => stream(m.groovy)),
|
|
55
|
+
julia: () => Promise.resolve().then(() => require('@codemirror/legacy-modes/mode/julia')).then((m) => stream(m.julia)),
|
|
56
|
+
};
|
|
57
|
+
/** How a language is usually indented, where it is not by two spaces: four for Python, C and their kin, a tab for Go. */
|
|
58
|
+
const INDENTS = Object.fromEntries([
|
|
59
|
+
...['python', 'java', 'c', 'cpp', 'csharp', 'php', 'rust', 'kotlin', 'swift', 'powershell', 'perl', 'julia', 'groovy'].map((id) => [id, ' ']),
|
|
60
|
+
['go', '\t'],
|
|
61
|
+
]);
|
|
62
|
+
const language = (id, name, ...aliases) => ({ id, name, aliases });
|
|
63
|
+
/** Every language a code field can be written in, in the order a person picking one reads them. */
|
|
64
|
+
exports.CODE_LANGUAGES = [
|
|
65
|
+
language('javascript', 'JavaScript', 'js', 'mjs', 'cjs', 'node'),
|
|
66
|
+
language('typescript', 'TypeScript', 'ts', 'mts', 'cts'),
|
|
67
|
+
language('jsx', 'JavaScript with JSX'),
|
|
68
|
+
language('tsx', 'TypeScript with JSX'),
|
|
69
|
+
language('python', 'Python', 'py', 'python3'),
|
|
70
|
+
language('sql', 'SQL'),
|
|
71
|
+
language('postgresql', 'PostgreSQL', 'postgres', 'pgsql', 'psql'),
|
|
72
|
+
language('mysql', 'MySQL', 'mariadb'),
|
|
73
|
+
language('sqlite', 'SQLite'),
|
|
74
|
+
language('mssql', 'SQL Server', 'tsql', 't-sql', 'sqlserver'),
|
|
75
|
+
language('html', 'HTML', 'htm', 'xhtml'),
|
|
76
|
+
language('css', 'CSS'),
|
|
77
|
+
language('xml', 'XML', 'svg', 'xsl'),
|
|
78
|
+
language('yaml', 'YAML', 'yml'),
|
|
79
|
+
language('markdown', 'Markdown', 'md'),
|
|
80
|
+
language('json', 'JSON', 'jsonc'),
|
|
81
|
+
language('java', 'Java'),
|
|
82
|
+
language('c', 'C', 'h'),
|
|
83
|
+
language('cpp', 'C++', 'c++', 'cc', 'cxx', 'hpp'),
|
|
84
|
+
language('php', 'PHP'),
|
|
85
|
+
language('rust', 'Rust', 'rs'),
|
|
86
|
+
language('go', 'Go', 'golang'),
|
|
87
|
+
language('shell', 'Shell', 'sh', 'bash', 'zsh'),
|
|
88
|
+
language('powershell', 'PowerShell', 'ps1', 'pwsh'),
|
|
89
|
+
language('ruby', 'Ruby', 'rb'),
|
|
90
|
+
language('perl', 'Perl', 'pl'),
|
|
91
|
+
language('lua', 'Lua'),
|
|
92
|
+
language('r', 'R'),
|
|
93
|
+
language('swift', 'Swift'),
|
|
94
|
+
language('kotlin', 'Kotlin', 'kt', 'kts'),
|
|
95
|
+
language('csharp', 'C#', 'c#', 'cs'),
|
|
96
|
+
language('scala', 'Scala'),
|
|
97
|
+
language('dart', 'Dart'),
|
|
98
|
+
language('dockerfile', 'Dockerfile', 'docker'),
|
|
99
|
+
language('toml', 'TOML'),
|
|
100
|
+
language('ini', 'INI', 'properties', 'conf'),
|
|
101
|
+
language('diff', 'Diff', 'patch'),
|
|
102
|
+
language('nginx', 'nginx'),
|
|
103
|
+
language('protobuf', 'Protocol Buffers', 'proto'),
|
|
104
|
+
language('haskell', 'Haskell', 'hs'),
|
|
105
|
+
language('clojure', 'Clojure', 'clj'),
|
|
106
|
+
language('erlang', 'Erlang', 'erl'),
|
|
107
|
+
language('groovy', 'Groovy', 'gradle'),
|
|
108
|
+
language('julia', 'Julia', 'jl'),
|
|
109
|
+
];
|
|
110
|
+
const BY_NAME = new Map(exports.CODE_LANGUAGES.flatMap((language) => [language.id, ...language.aliases].map((name) => [name, language])));
|
|
111
|
+
/** The language a page names, by its id or another of its names, in any case; null for one not on the list. */
|
|
112
|
+
function codeLanguage(name) {
|
|
113
|
+
return typeof name === 'string' ? BY_NAME.get(name.trim().toLowerCase()) ?? null : null;
|
|
114
|
+
}
|
|
115
|
+
/** Each grammar's load, once: every field in that language shares it. */
|
|
116
|
+
const loading = new Map();
|
|
117
|
+
/**
|
|
118
|
+
* The grammar of the language a page names, ready for an editor: loaded the
|
|
119
|
+
* first time a field asks for it. Null for a language not on the list, and
|
|
120
|
+
* for one whose file could not be fetched — the field stays plain text.
|
|
121
|
+
*/
|
|
122
|
+
function loadCodeLanguage(name) {
|
|
123
|
+
const found = codeLanguage(name);
|
|
124
|
+
if (!found)
|
|
125
|
+
return Promise.resolve(null);
|
|
126
|
+
let load = loading.get(found.id);
|
|
127
|
+
if (!load) {
|
|
128
|
+
load = LOADERS[found.id]().then((support) => [support, language_1.indentUnit.of(INDENTS[found.id] ?? ' ')], () => {
|
|
129
|
+
// Not fetched (offline, say): plain text this time, and another try next time.
|
|
130
|
+
loading.delete(found.id);
|
|
131
|
+
return null;
|
|
132
|
+
});
|
|
133
|
+
loading.set(found.id, load);
|
|
134
|
+
}
|
|
135
|
+
return load;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../../../../libs/code/src/lib/languages.ts"],"names":[],"mappings":";;;AAkIA,oCAEC;AAUD,4CAaC;AA3JD,mDAAqF;AAmBrF,+EAA+E;AAC/E,MAAM,MAAM,GAAG,CAAC,MAA6B,EAAa,EAAE,CAAC,yBAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAE3F,8FAA8F;AAC9F,MAAM,OAAO,GAA6C;IACxD,UAAU,EAAE,GAAG,EAAE,CAAC,qCAAO,6BAA6B,GAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IACnF,UAAU,EAAE,GAAG,EAAE,CAAC,qCAAO,6BAA6B,GAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACvG,GAAG,EAAE,GAAG,EAAE,CAAC,qCAAO,6BAA6B,GAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE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