modern-monaco 0.1.3 → 0.1.5
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 +126 -113
- package/dist/core.js +7 -2
- package/dist/editor-core.js +5 -0
- package/dist/lsp/typescript/worker.js +183 -182
- package/dist/shiki.js +10 -2
- package/package.json +1 -1
- package/types/index.d.ts +2 -2
- package/types/lsp.d.ts +1 -1
- package/types/ssr.d.ts +2 -2
package/dist/shiki.js
CHANGED
|
@@ -7751,8 +7751,8 @@ var MINIMUM_LINE_HEIGHT = 8;
|
|
|
7751
7751
|
var MINIMUM_MAX_DIGIT_WIDTH = 5;
|
|
7752
7752
|
function render(highlighter, input, options = {}) {
|
|
7753
7753
|
const isBrowser = typeof globalThis.document?.querySelector === "function";
|
|
7754
|
-
if (!options.userAgent && !isBrowser) {
|
|
7755
|
-
throw new Error("`userAgent` option is required in non-browser environment");
|
|
7754
|
+
if (!options.userAgent && !options.fontFamily && !isBrowser) {
|
|
7755
|
+
throw new Error("`userAgent` or `fontFamily` option is required in non-browser environment");
|
|
7756
7756
|
}
|
|
7757
7757
|
const code = typeof input === "string" ? input : input.code;
|
|
7758
7758
|
const filename = typeof input === "string" ? void 0 : input.filename;
|
|
@@ -8132,7 +8132,15 @@ function getGarmmarInfoFromPath(path) {
|
|
|
8132
8132
|
function getLanguageIdFromPath(path) {
|
|
8133
8133
|
return getGarmmarInfoFromPath(path)?.name;
|
|
8134
8134
|
}
|
|
8135
|
+
function getExtnameFromLanguageId(language) {
|
|
8136
|
+
const g = tmGrammars.find((g2) => g2.name === language);
|
|
8137
|
+
if (g) {
|
|
8138
|
+
return g.aliases?.[0] ?? g.name;
|
|
8139
|
+
}
|
|
8140
|
+
return void 0;
|
|
8141
|
+
}
|
|
8135
8142
|
export {
|
|
8143
|
+
getExtnameFromLanguageId,
|
|
8136
8144
|
getGarmmarInfoFromPath,
|
|
8137
8145
|
getLanguageIdFromPath,
|
|
8138
8146
|
initShiki,
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type monacoNS from "./monaco.d.ts";
|
|
1
|
+
import type * as monacoNS from "./monaco.d.ts";
|
|
2
2
|
import type { LSPConfig } from "./lsp.d.ts";
|
|
3
3
|
import type { TextmateGrammarName, TextmateThemeName } from "./textmate.d.ts";
|
|
4
4
|
import type { ErrorNotFound, FileSystem, Workspace } from "./workspace.d.ts";
|
|
@@ -67,4 +67,4 @@ export const errors: {
|
|
|
67
67
|
NotFound: ErrorNotFound;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
export {
|
|
70
|
+
export { FileSystem, Workspace };
|
package/types/lsp.d.ts
CHANGED
package/types/ssr.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type monacoNS from "./monaco.d.ts";
|
|
1
|
+
import type * as monacoNS from "./monaco.d.ts";
|
|
2
2
|
import type { ShikiInitOptions } from "./index.d.ts";
|
|
3
3
|
|
|
4
4
|
export type RenderInput = string | { filename: string; code: string; version?: number };
|
|
5
5
|
|
|
6
|
-
export interface RenderOptions extends monacoNS.editor.IStandaloneEditorConstructionOptions {
|
|
6
|
+
export interface RenderOptions extends Omit<monacoNS.editor.IStandaloneEditorConstructionOptions, "model" | "value"> {
|
|
7
7
|
fontDigitWidth?: number;
|
|
8
8
|
userAgent?: string;
|
|
9
9
|
shiki?: ShikiInitOptions;
|