@coze-editor/preset-code-languages 0.1.0-alpha.0eed04
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/LICENSE +21 -0
- package/dist/esm/index.js +175 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +211 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 coze-dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// src/preset.ts
|
|
2
|
+
import { asyncOption } from "@coze-editor/core";
|
|
3
|
+
|
|
4
|
+
// src/languages.ts
|
|
5
|
+
import { LanguageDescription, LanguageSupport } from "@codemirror/language";
|
|
6
|
+
var supportedLanguages = [
|
|
7
|
+
LanguageDescription.of({
|
|
8
|
+
name: "VUE",
|
|
9
|
+
extensions: ["vue"],
|
|
10
|
+
async load() {
|
|
11
|
+
return import("@codemirror/lang-vue").then((module) => module.vue());
|
|
12
|
+
}
|
|
13
|
+
}),
|
|
14
|
+
LanguageDescription.of({
|
|
15
|
+
name: "TS",
|
|
16
|
+
extensions: ["ts"],
|
|
17
|
+
async load() {
|
|
18
|
+
return import("@codemirror/lang-javascript").then(
|
|
19
|
+
(module) => module.javascript({ typescript: true })
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
LanguageDescription.of({
|
|
24
|
+
name: "JS",
|
|
25
|
+
extensions: ["js", "mjs", "cjs"],
|
|
26
|
+
async load() {
|
|
27
|
+
return import("@codemirror/lang-javascript").then(
|
|
28
|
+
(module) => module.javascript()
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
LanguageDescription.of({
|
|
33
|
+
name: "TSX",
|
|
34
|
+
extensions: ["tsx"],
|
|
35
|
+
async load() {
|
|
36
|
+
return import("@codemirror/lang-javascript").then(
|
|
37
|
+
(module) => module.javascript({
|
|
38
|
+
jsx: true,
|
|
39
|
+
typescript: true
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
LanguageDescription.of({
|
|
45
|
+
name: "JSX",
|
|
46
|
+
extensions: ["jsx"],
|
|
47
|
+
async load() {
|
|
48
|
+
return import("@codemirror/lang-javascript").then(
|
|
49
|
+
(module) => module.javascript({ jsx: true })
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
LanguageDescription.of({
|
|
54
|
+
name: "HTML",
|
|
55
|
+
extensions: ["html"],
|
|
56
|
+
async load() {
|
|
57
|
+
return import("@codemirror/lang-html").then((module) => module.html());
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
LanguageDescription.of({
|
|
61
|
+
name: "CSS",
|
|
62
|
+
extensions: ["css"],
|
|
63
|
+
async load() {
|
|
64
|
+
return import("@codemirror/lang-css").then((module) => module.css());
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
LanguageDescription.of({
|
|
68
|
+
name: "SASS",
|
|
69
|
+
extensions: ["sass"],
|
|
70
|
+
async load() {
|
|
71
|
+
return import("@codemirror/lang-sass").then(
|
|
72
|
+
(module) => module.sass({ indented: true })
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
LanguageDescription.of({
|
|
77
|
+
name: "SCSS",
|
|
78
|
+
extensions: ["scss"],
|
|
79
|
+
async load() {
|
|
80
|
+
return import("@codemirror/lang-sass").then(
|
|
81
|
+
(module) => module.sass({ indented: false })
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}),
|
|
85
|
+
LanguageDescription.of({
|
|
86
|
+
name: "JSON",
|
|
87
|
+
extensions: ["json"],
|
|
88
|
+
async load() {
|
|
89
|
+
return import("@codemirror/lang-json").then((module) => module.json());
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
LanguageDescription.of({
|
|
93
|
+
name: "Markdown",
|
|
94
|
+
extensions: ["md"],
|
|
95
|
+
async load() {
|
|
96
|
+
return import("@codemirror/lang-markdown").then(
|
|
97
|
+
(module) => module.markdown()
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
LanguageDescription.of({
|
|
102
|
+
name: "Wasm",
|
|
103
|
+
extensions: ["wat"],
|
|
104
|
+
async load() {
|
|
105
|
+
return import("@codemirror/lang-wast").then((module) => module.wast());
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
LanguageDescription.of({
|
|
109
|
+
name: "Python",
|
|
110
|
+
extensions: ["py"],
|
|
111
|
+
async load() {
|
|
112
|
+
return import("@codemirror/lang-python").then((module) => module.python());
|
|
113
|
+
}
|
|
114
|
+
}),
|
|
115
|
+
LanguageDescription.of({
|
|
116
|
+
name: "C++",
|
|
117
|
+
extensions: ["cpp"],
|
|
118
|
+
async load() {
|
|
119
|
+
return import("@codemirror/lang-cpp").then((module) => module.cpp());
|
|
120
|
+
}
|
|
121
|
+
}),
|
|
122
|
+
LanguageDescription.of({
|
|
123
|
+
name: "Shell",
|
|
124
|
+
extensions: ["sh"],
|
|
125
|
+
async load() {
|
|
126
|
+
return import("@coze-editor/code-language-shell").then(
|
|
127
|
+
(module) => new LanguageSupport(module.shellLanguage)
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
LanguageDescription.of({
|
|
132
|
+
name: "Sql",
|
|
133
|
+
extensions: ["sql"],
|
|
134
|
+
async load() {
|
|
135
|
+
return import("@codemirror/lang-sql").then((module) => module.sql());
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
];
|
|
139
|
+
var languageCache = /* @__PURE__ */ new Map();
|
|
140
|
+
async function getLanguage(fileName) {
|
|
141
|
+
const cacheKey = fileName.split(".").pop() || "default";
|
|
142
|
+
const cachedLanguage = languageCache.get(cacheKey);
|
|
143
|
+
if (cachedLanguage) {
|
|
144
|
+
return cachedLanguage;
|
|
145
|
+
}
|
|
146
|
+
const loadPromise = (async () => {
|
|
147
|
+
try {
|
|
148
|
+
const languageDescription = LanguageDescription.matchFilename(
|
|
149
|
+
supportedLanguages,
|
|
150
|
+
fileName
|
|
151
|
+
);
|
|
152
|
+
return languageDescription ? await languageDescription.load() : [];
|
|
153
|
+
} catch (e) {
|
|
154
|
+
console.error("Language load failed:", e);
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
languageCache.set(cacheKey, loadPromise);
|
|
159
|
+
return loadPromise;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/preset.ts
|
|
163
|
+
var preset = [
|
|
164
|
+
...asyncOption("path", (path) => getLanguage(path), {
|
|
165
|
+
reset: true
|
|
166
|
+
})
|
|
167
|
+
];
|
|
168
|
+
|
|
169
|
+
// src/index.ts
|
|
170
|
+
var index_default = preset;
|
|
171
|
+
export {
|
|
172
|
+
index_default as default,
|
|
173
|
+
getLanguage
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/preset.ts","../../src/languages.ts","../../src/index.ts"],"sourcesContent":["import { asyncOption } from '@coze-editor/core';\n\nimport { getLanguage } from './languages';\n\nexport const preset = [\n ...asyncOption('path', (path: string) => getLanguage(path), {\n reset: true,\n }),\n];\n","import { type Extension } from '@codemirror/state';\nimport { LanguageDescription, LanguageSupport } from '@codemirror/language';\n\nexport const supportedLanguages = [\n LanguageDescription.of({\n name: 'VUE',\n extensions: ['vue'],\n async load() {\n return import('@codemirror/lang-vue').then(module => module.vue());\n },\n }),\n LanguageDescription.of({\n name: 'TS',\n extensions: ['ts'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript({ typescript: true }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'JS',\n extensions: ['js', 'mjs', 'cjs'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript(),\n );\n },\n }),\n LanguageDescription.of({\n name: 'TSX',\n extensions: ['tsx'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript({\n jsx: true,\n typescript: true,\n }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'JSX',\n extensions: ['jsx'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript({ jsx: true }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'HTML',\n extensions: ['html'],\n async load() {\n return import('@codemirror/lang-html').then(module => module.html());\n },\n }),\n LanguageDescription.of({\n name: 'CSS',\n extensions: ['css'],\n async load() {\n return import('@codemirror/lang-css').then(module => module.css());\n },\n }),\n LanguageDescription.of({\n name: 'SASS',\n extensions: ['sass'],\n async load() {\n return import('@codemirror/lang-sass').then(module =>\n module.sass({ indented: true }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'SCSS',\n extensions: ['scss'],\n async load() {\n return import('@codemirror/lang-sass').then(module =>\n module.sass({ indented: false }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'JSON',\n extensions: ['json'],\n async load() {\n return import('@codemirror/lang-json').then(module => module.json());\n },\n }),\n LanguageDescription.of({\n name: 'Markdown',\n extensions: ['md'],\n async load() {\n return import('@codemirror/lang-markdown').then(module =>\n module.markdown(),\n );\n },\n }),\n LanguageDescription.of({\n name: 'Wasm',\n extensions: ['wat'],\n async load() {\n return import('@codemirror/lang-wast').then(module => module.wast());\n },\n }),\n LanguageDescription.of({\n name: 'Python',\n extensions: ['py'],\n async load() {\n return import('@codemirror/lang-python').then(module => module.python());\n },\n }),\n LanguageDescription.of({\n name: 'C++',\n extensions: ['cpp'],\n async load() {\n return import('@codemirror/lang-cpp').then(module => module.cpp());\n },\n }),\n LanguageDescription.of({\n name: 'Shell',\n extensions: ['sh'],\n async load() {\n return import('@coze-editor/code-language-shell').then(\n module => new LanguageSupport(module.shellLanguage),\n );\n },\n }),\n LanguageDescription.of({\n name: 'Sql',\n extensions: ['sql'],\n async load() {\n return import('@codemirror/lang-sql').then(module => module.sql());\n },\n }),\n];\n\n// 添加缓存机制\nconst languageCache = new Map<string, Promise<Extension>>();\n\nexport async function getLanguage(fileName: string): Promise<Extension> {\n const cacheKey = fileName.split('.').pop() || 'default';\n\n const cachedLanguage = languageCache.get(cacheKey);\n if (cachedLanguage) {\n return cachedLanguage;\n }\n\n const loadPromise = (async () => {\n try {\n const languageDescription = LanguageDescription.matchFilename(\n supportedLanguages,\n fileName,\n );\n return languageDescription ? await languageDescription.load() : [];\n } catch (e) {\n console.error('Language load failed:', e);\n return [];\n }\n })();\n\n languageCache.set(cacheKey, loadPromise);\n return loadPromise;\n}\n","import { preset } from './preset';\n\nexport { getLanguage } from './languages';\n\nexport default preset;\n"],"mappings":";AAAA,SAAS,mBAAmB;;;ACC5B,SAAS,qBAAqB,uBAAuB;AAE9C,IAAM,qBAAqB;AAAA,EAChC,oBAAoB,GAAG;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,CAAC,KAAK;AAAA,IAClB,MAAM,OAAO;AACX,aAAO,OAAO,sBAAsB,EAAE,KAAK,YAAU,OAAO,IAAI,CAAC;AAAA,IACnE;AAAA,EACF,CAAC;AAAA,EACD,oBAAoB,GAAG;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,CAAC,IAAI;AAAA,IACjB,MAAM,OAAO;AACX,aAAO,OAAO,6BAA6B,EAAE;AAAA,QAAK,YAChD,OAAO,WAAW,EAAE,YAAY,KAAK,CAAC;AAAA,MACxC;AAAA,IACF;AAAA,EACF,CAAC;AAAA,EACD,oBAAoB,GAAG;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,CAAC,MAAM,OAAO,KAAK;AAAA,IAC/B,MAAM,OAAO;AACX,aAAO,OAAO,6BAA6B,EAAE;AAAA,QAAK,YAChD,OAAO,WAAW;AAAA,MACpB;AAAA,IACF;AAAA,EACF,CAAC;AAAA,EACD,oBAAoB,GAAG;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,CAAC,KAAK;AAAA,IAClB,MAAM,OAAO;AACX,aAAO,OAAO,6BAA6B,EAAE;AAAA,QAAK,YAChD,OAAO,WAAW;AAAA,UAChB,KAAK;AAAA,UACL,YAAY;AAAA,QACd,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AAAA,EACD,oBAAoB,GAAG;AAAA,IACrB,MAAM;AAAA,IACN,YAAY,CAAC,KAAK;AAAA,IAClB,MAAM,OAAO;AACX,aAAO,OAAO,6BAA6B,EAAE;AAAA,QAAK,YAChD,OAAO,WAAW,EAAE,KAAK,KAAK,CAAC;AAAA,MACjC;AAAA,IACF;AAAA,E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;AAAA,MACF;AACA,aAAO,sBAAsB,MAAM,oBAAoB,KAAK,IAAI,CAAC;AAAA,IACnE,SAAS,GAAG;AACV,cAAQ,MAAM,yBAAyB,CAAC;AACxC,aAAO,CAAC;AAAA,IACV;AAAA,EACF,GAAG;AAEH,gBAAc,IAAI,UAAU,WAAW;AACvC,SAAO;AACT;;;AD/JO,IAAM,SAAS;AAAA,EACpB,GAAG,YAAY,QAAQ,CAAC,SAAiB,YAAY,IAAI,GAAG;AAAA,IAC1D,OAAO;AAAA,EACT,CAAC;AACH;;;AEJA,IAAO,gBAAQ;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _coze_editor_core from '@coze-editor/core';
|
|
2
|
+
import { Extension } from '@codemirror/state';
|
|
3
|
+
|
|
4
|
+
declare const preset: (_coze_editor_core.ExtensionPluginSpec | _coze_editor_core.OptionPluginSpec<"path", string>)[];
|
|
5
|
+
|
|
6
|
+
declare function getLanguage(fileName: string): Promise<Extension>;
|
|
7
|
+
|
|
8
|
+
export { preset as default, getLanguage };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _coze_editor_core from '@coze-editor/core';
|
|
2
|
+
import { Extension } from '@codemirror/state';
|
|
3
|
+
|
|
4
|
+
declare const preset: (_coze_editor_core.ExtensionPluginSpec | _coze_editor_core.OptionPluginSpec<"path", string>)[];
|
|
5
|
+
|
|
6
|
+
declare function getLanguage(fileName: string): Promise<Extension>;
|
|
7
|
+
|
|
8
|
+
export { preset as default, getLanguage };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
default: () => index_default,
|
|
33
|
+
getLanguage: () => getLanguage
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/preset.ts
|
|
38
|
+
var import_core = require("@coze-editor/core");
|
|
39
|
+
|
|
40
|
+
// src/languages.ts
|
|
41
|
+
var import_language = require("@codemirror/language");
|
|
42
|
+
var supportedLanguages = [
|
|
43
|
+
import_language.LanguageDescription.of({
|
|
44
|
+
name: "VUE",
|
|
45
|
+
extensions: ["vue"],
|
|
46
|
+
async load() {
|
|
47
|
+
return import("@codemirror/lang-vue").then((module2) => module2.vue());
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
import_language.LanguageDescription.of({
|
|
51
|
+
name: "TS",
|
|
52
|
+
extensions: ["ts"],
|
|
53
|
+
async load() {
|
|
54
|
+
return import("@codemirror/lang-javascript").then(
|
|
55
|
+
(module2) => module2.javascript({ typescript: true })
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
59
|
+
import_language.LanguageDescription.of({
|
|
60
|
+
name: "JS",
|
|
61
|
+
extensions: ["js", "mjs", "cjs"],
|
|
62
|
+
async load() {
|
|
63
|
+
return import("@codemirror/lang-javascript").then(
|
|
64
|
+
(module2) => module2.javascript()
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
import_language.LanguageDescription.of({
|
|
69
|
+
name: "TSX",
|
|
70
|
+
extensions: ["tsx"],
|
|
71
|
+
async load() {
|
|
72
|
+
return import("@codemirror/lang-javascript").then(
|
|
73
|
+
(module2) => module2.javascript({
|
|
74
|
+
jsx: true,
|
|
75
|
+
typescript: true
|
|
76
|
+
})
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}),
|
|
80
|
+
import_language.LanguageDescription.of({
|
|
81
|
+
name: "JSX",
|
|
82
|
+
extensions: ["jsx"],
|
|
83
|
+
async load() {
|
|
84
|
+
return import("@codemirror/lang-javascript").then(
|
|
85
|
+
(module2) => module2.javascript({ jsx: true })
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
import_language.LanguageDescription.of({
|
|
90
|
+
name: "HTML",
|
|
91
|
+
extensions: ["html"],
|
|
92
|
+
async load() {
|
|
93
|
+
return import("@codemirror/lang-html").then((module2) => module2.html());
|
|
94
|
+
}
|
|
95
|
+
}),
|
|
96
|
+
import_language.LanguageDescription.of({
|
|
97
|
+
name: "CSS",
|
|
98
|
+
extensions: ["css"],
|
|
99
|
+
async load() {
|
|
100
|
+
return import("@codemirror/lang-css").then((module2) => module2.css());
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
import_language.LanguageDescription.of({
|
|
104
|
+
name: "SASS",
|
|
105
|
+
extensions: ["sass"],
|
|
106
|
+
async load() {
|
|
107
|
+
return import("@codemirror/lang-sass").then(
|
|
108
|
+
(module2) => module2.sass({ indented: true })
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}),
|
|
112
|
+
import_language.LanguageDescription.of({
|
|
113
|
+
name: "SCSS",
|
|
114
|
+
extensions: ["scss"],
|
|
115
|
+
async load() {
|
|
116
|
+
return import("@codemirror/lang-sass").then(
|
|
117
|
+
(module2) => module2.sass({ indented: false })
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
import_language.LanguageDescription.of({
|
|
122
|
+
name: "JSON",
|
|
123
|
+
extensions: ["json"],
|
|
124
|
+
async load() {
|
|
125
|
+
return import("@codemirror/lang-json").then((module2) => module2.json());
|
|
126
|
+
}
|
|
127
|
+
}),
|
|
128
|
+
import_language.LanguageDescription.of({
|
|
129
|
+
name: "Markdown",
|
|
130
|
+
extensions: ["md"],
|
|
131
|
+
async load() {
|
|
132
|
+
return import("@codemirror/lang-markdown").then(
|
|
133
|
+
(module2) => module2.markdown()
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
137
|
+
import_language.LanguageDescription.of({
|
|
138
|
+
name: "Wasm",
|
|
139
|
+
extensions: ["wat"],
|
|
140
|
+
async load() {
|
|
141
|
+
return import("@codemirror/lang-wast").then((module2) => module2.wast());
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
import_language.LanguageDescription.of({
|
|
145
|
+
name: "Python",
|
|
146
|
+
extensions: ["py"],
|
|
147
|
+
async load() {
|
|
148
|
+
return import("@codemirror/lang-python").then((module2) => module2.python());
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
import_language.LanguageDescription.of({
|
|
152
|
+
name: "C++",
|
|
153
|
+
extensions: ["cpp"],
|
|
154
|
+
async load() {
|
|
155
|
+
return import("@codemirror/lang-cpp").then((module2) => module2.cpp());
|
|
156
|
+
}
|
|
157
|
+
}),
|
|
158
|
+
import_language.LanguageDescription.of({
|
|
159
|
+
name: "Shell",
|
|
160
|
+
extensions: ["sh"],
|
|
161
|
+
async load() {
|
|
162
|
+
return import("@coze-editor/code-language-shell").then(
|
|
163
|
+
(module2) => new import_language.LanguageSupport(module2.shellLanguage)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
}),
|
|
167
|
+
import_language.LanguageDescription.of({
|
|
168
|
+
name: "Sql",
|
|
169
|
+
extensions: ["sql"],
|
|
170
|
+
async load() {
|
|
171
|
+
return import("@codemirror/lang-sql").then((module2) => module2.sql());
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
];
|
|
175
|
+
var languageCache = /* @__PURE__ */ new Map();
|
|
176
|
+
async function getLanguage(fileName) {
|
|
177
|
+
const cacheKey = fileName.split(".").pop() || "default";
|
|
178
|
+
const cachedLanguage = languageCache.get(cacheKey);
|
|
179
|
+
if (cachedLanguage) {
|
|
180
|
+
return cachedLanguage;
|
|
181
|
+
}
|
|
182
|
+
const loadPromise = (async () => {
|
|
183
|
+
try {
|
|
184
|
+
const languageDescription = import_language.LanguageDescription.matchFilename(
|
|
185
|
+
supportedLanguages,
|
|
186
|
+
fileName
|
|
187
|
+
);
|
|
188
|
+
return languageDescription ? await languageDescription.load() : [];
|
|
189
|
+
} catch (e) {
|
|
190
|
+
console.error("Language load failed:", e);
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
193
|
+
})();
|
|
194
|
+
languageCache.set(cacheKey, loadPromise);
|
|
195
|
+
return loadPromise;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/preset.ts
|
|
199
|
+
var preset = [
|
|
200
|
+
...(0, import_core.asyncOption)("path", (path) => getLanguage(path), {
|
|
201
|
+
reset: true
|
|
202
|
+
})
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
// src/index.ts
|
|
206
|
+
var index_default = preset;
|
|
207
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
208
|
+
0 && (module.exports = {
|
|
209
|
+
getLanguage
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/preset.ts","../src/languages.ts"],"sourcesContent":["import { preset } from './preset';\n\nexport { getLanguage } from './languages';\n\nexport default preset;\n","import { asyncOption } from '@coze-editor/core';\n\nimport { getLanguage } from './languages';\n\nexport const preset = [\n ...asyncOption('path', (path: string) => getLanguage(path), {\n reset: true,\n }),\n];\n","import { type Extension } from '@codemirror/state';\nimport { LanguageDescription, LanguageSupport } from '@codemirror/language';\n\nexport const supportedLanguages = [\n LanguageDescription.of({\n name: 'VUE',\n extensions: ['vue'],\n async load() {\n return import('@codemirror/lang-vue').then(module => module.vue());\n },\n }),\n LanguageDescription.of({\n name: 'TS',\n extensions: ['ts'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript({ typescript: true }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'JS',\n extensions: ['js', 'mjs', 'cjs'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript(),\n );\n },\n }),\n LanguageDescription.of({\n name: 'TSX',\n extensions: ['tsx'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript({\n jsx: true,\n typescript: true,\n }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'JSX',\n extensions: ['jsx'],\n async load() {\n return import('@codemirror/lang-javascript').then(module =>\n module.javascript({ jsx: true }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'HTML',\n extensions: ['html'],\n async load() {\n return import('@codemirror/lang-html').then(module => module.html());\n },\n }),\n LanguageDescription.of({\n name: 'CSS',\n extensions: ['css'],\n async load() {\n return import('@codemirror/lang-css').then(module => module.css());\n },\n }),\n LanguageDescription.of({\n name: 'SASS',\n extensions: ['sass'],\n async load() {\n return import('@codemirror/lang-sass').then(module =>\n module.sass({ indented: true }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'SCSS',\n extensions: ['scss'],\n async load() {\n return import('@codemirror/lang-sass').then(module =>\n module.sass({ indented: false }),\n );\n },\n }),\n LanguageDescription.of({\n name: 'JSON',\n extensions: ['json'],\n async load() {\n return import('@codemirror/lang-json').then(module => module.json());\n },\n }),\n LanguageDescription.of({\n name: 'Markdown',\n extensions: ['md'],\n async load() {\n return import('@codemirror/lang-markdown').then(module =>\n module.markdown(),\n );\n },\n }),\n LanguageDescription.of({\n name: 'Wasm',\n extensions: ['wat'],\n async load() {\n return import('@codemirror/lang-wast').then(module => module.wast());\n },\n }),\n LanguageDescription.of({\n name: 'Python',\n extensions: ['py'],\n async load() {\n return import('@codemirror/lang-python').then(module => module.python());\n },\n }),\n LanguageDescription.of({\n name: 'C++',\n extensions: ['cpp'],\n async load() {\n return import('@codemirror/lang-cpp').then(module => module.cpp());\n },\n }),\n LanguageDescription.of({\n name: 'Shell',\n extensions: ['sh'],\n async load() {\n return import('@coze-editor/code-language-shell').then(\n module => new LanguageSupport(module.shellLanguage),\n );\n },\n }),\n LanguageDescription.of({\n name: 'Sql',\n extensions: ['sql'],\n async load() {\n return import('@codemirror/lang-sql').then(module => module.sql());\n },\n }),\n];\n\n// 添加缓存机制\nconst languageCache = new Map<string, Promise<Extension>>();\n\nexport async function getLanguage(fileName: string): Promise<Extension> {\n const cacheKey = fileName.split('.').pop() || 'default';\n\n const cachedLanguage = languageCache.get(cacheKey);\n if (cachedLanguage) {\n return cachedLanguage;\n }\n\n const loadPromise = (async () => {\n try {\n const languageDescription = LanguageDescription.matchFilename(\n supportedLanguages,\n fileName,\n );\n return languageDescription ? await languageDescription.load() : [];\n } catch (e) {\n console.error('Language load failed:', e);\n return [];\n }\n })();\n\n languageCache.set(cacheKey, loadPromise);\n return loadPromise;\n}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,gBAAgB;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,YAAY;AAC/B,QAAI;AACF,YAAM,sBAAsB,oCAAoB;AAAA,QAC9C;AAAA,QACA;AAAA,MACF;AACA,aAAO,sBAAsB,MAAM,oBAAoB,KAAK,IAAI,CAAC;AAAA,IACnE,SAAS,GAAG;AACV,cAAQ,MAAM,yBAAyB,CAAC;AACxC,aAAO,CAAC;AAAA,IACV;AAAA,EACF,GAAG;AAEH,gBAAc,IAAI,UAAU,WAAW;AACvC,SAAO;AACT;;;AD/JO,IAAM,SAAS;AAAA,EACpB,OAAG,yBAAY,QAAQ,CAAC,SAAiB,YAAY,IAAI,GAAG;AAAA,IAC1D,OAAO;AAAA,EACT,CAAC;AACH;;;ADJA,IAAO,gBAAQ;","names":["module"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coze-editor/preset-code-languages",
|
|
3
|
+
"version": "0.1.0-alpha.0eed04",
|
|
4
|
+
"description": "preset-code-languages",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "zhangyi",
|
|
7
|
+
"maintainers": [],
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css",
|
|
10
|
+
"**/*.less",
|
|
11
|
+
"**/*.sass",
|
|
12
|
+
"**/*.scss"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/esm/index.js",
|
|
15
|
+
"module": "./dist/esm/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup",
|
|
22
|
+
"lint": "eslint && tsc --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@codemirror/lang-cpp": "^6.0.2",
|
|
26
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
27
|
+
"@codemirror/lang-html": "^6.4.9",
|
|
28
|
+
"@codemirror/lang-javascript": "^6.2.1",
|
|
29
|
+
"@codemirror/lang-json": "^6.0.1",
|
|
30
|
+
"@codemirror/lang-markdown": "^6.3.2",
|
|
31
|
+
"@codemirror/lang-python": "^6.1.7",
|
|
32
|
+
"@codemirror/lang-sass": "^6.0.2",
|
|
33
|
+
"@codemirror/lang-sql": "^6.10.0",
|
|
34
|
+
"@codemirror/lang-vue": "^0.1.3",
|
|
35
|
+
"@codemirror/lang-wast": "^6.0.2",
|
|
36
|
+
"@coze-editor/code-language-shell": "0.1.0-alpha.0eed04",
|
|
37
|
+
"@coze-editor/core": "0.1.0-alpha.0eed04"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@codemirror/language": "^6.10.1",
|
|
41
|
+
"@codemirror/state": "^6.4.1",
|
|
42
|
+
"@codemirror/view": "^6.26.1",
|
|
43
|
+
"@coze-arch/ts-config": "workspace:*",
|
|
44
|
+
"@coze-editor/eslint-config": "workspace:*",
|
|
45
|
+
"@types/node": "^22",
|
|
46
|
+
"eslint": "9.14.0",
|
|
47
|
+
"tsup": "^8.0.1",
|
|
48
|
+
"typescript": "^5.8.2"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@codemirror/language": "^6.0.0",
|
|
52
|
+
"@codemirror/state": "^6.4.1",
|
|
53
|
+
"@codemirror/view": "^6.26.1"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public",
|
|
57
|
+
"registry": "https://registry.npmjs.org"
|
|
58
|
+
},
|
|
59
|
+
"test:main": "./src/index.ts"
|
|
60
|
+
}
|