modern-monaco 0.0.0-beta.5 → 0.1.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 +64 -56
- package/dist/core.js +5 -18
- package/dist/index.js +7 -7
- package/dist/shiki-wasm.js +1 -1
- package/dist/shiki.js +11 -7
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/workerd.js +1 -1
- package/package.json +4 -4
- package/types/index.d.ts +2 -2
- package/types/ssr.d.ts +1 -2
package/dist/shiki.js
CHANGED
|
@@ -10,7 +10,7 @@ var define_TM_GRAMMARS_default = [{ name: "abap", scopeName: "source.abap" }, {
|
|
|
10
10
|
// <define:TM_THEMES>
|
|
11
11
|
var define_TM_THEMES_default = ["andromeeda", "aurora-x", "ayu-dark", "catppuccin-frappe", "catppuccin-latte", "catppuccin-macchiato", "catppuccin-mocha", "dark-plus", "dracula", "dracula-soft", "everforest-dark", "everforest-light", "github-dark", "github-dark-default", "github-dark-dimmed", "github-dark-high-contrast", "github-light", "github-light-default", "github-light-high-contrast", "gruvbox-dark-hard", "gruvbox-dark-medium", "gruvbox-dark-soft", "gruvbox-light-hard", "gruvbox-light-medium", "gruvbox-light-soft", "houston", "kanagawa-dragon", "kanagawa-lotus", "kanagawa-wave", "laserwave", "light-plus", "material-theme", "material-theme-darker", "material-theme-lighter", "material-theme-ocean", "material-theme-palenight", "min-dark", "min-light", "monokai", "night-owl", "nord", "one-dark-pro", "one-light", "plastic", "poimandres", "red", "rose-pine", "rose-pine-dawn", "rose-pine-moon", "slack-dark", "slack-ochin", "snazzy-light", "solarized-dark", "solarized-light", "synthwave-84", "tokyo-night", "vesper", "vitesse-black", "vitesse-dark", "vitesse-light"];
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@shikijs+types@3.9.
|
|
13
|
+
// node_modules/.pnpm/@shikijs+types@3.9.2/node_modules/@shikijs/types/dist/index.mjs
|
|
14
14
|
var ShikiError = class extends Error {
|
|
15
15
|
constructor(message) {
|
|
16
16
|
super(message);
|
|
@@ -5405,7 +5405,7 @@ function all(parent) {
|
|
|
5405
5405
|
return results.join("");
|
|
5406
5406
|
}
|
|
5407
5407
|
|
|
5408
|
-
// node_modules/.pnpm/@shikijs+core@3.9.
|
|
5408
|
+
// node_modules/.pnpm/@shikijs+core@3.9.2/node_modules/@shikijs/core/dist/index.mjs
|
|
5409
5409
|
function resolveColorReplacements(theme, options) {
|
|
5410
5410
|
const replacements = typeof theme === "string" ? {} : { ...theme.colorReplacements };
|
|
5411
5411
|
const themeName = typeof theme === "string" ? theme : theme.name;
|
|
@@ -5700,11 +5700,15 @@ function transformerDecorations() {
|
|
|
5700
5700
|
const line = converter.lines[p2.line];
|
|
5701
5701
|
if (line === void 0)
|
|
5702
5702
|
throw new ShikiError(`Invalid decoration position ${JSON.stringify(p2)}. Lines length: ${converter.lines.length}`);
|
|
5703
|
-
|
|
5703
|
+
let character = p2.character;
|
|
5704
|
+
if (character < 0)
|
|
5705
|
+
character = line.length + character;
|
|
5706
|
+
if (character < 0 || character > line.length)
|
|
5704
5707
|
throw new ShikiError(`Invalid decoration position ${JSON.stringify(p2)}. Line ${p2.line} length: ${line.length}`);
|
|
5705
5708
|
return {
|
|
5706
5709
|
...p2,
|
|
5707
|
-
|
|
5710
|
+
character,
|
|
5711
|
+
offset: converter.posToIndex(p2.line, character)
|
|
5708
5712
|
};
|
|
5709
5713
|
}
|
|
5710
5714
|
};
|
|
@@ -7263,7 +7267,7 @@ async function createHighlighterCore(options) {
|
|
|
7263
7267
|
};
|
|
7264
7268
|
}
|
|
7265
7269
|
|
|
7266
|
-
// node_modules/.pnpm/@shikijs+engine-oniguruma@3.9.
|
|
7270
|
+
// node_modules/.pnpm/@shikijs+engine-oniguruma@3.9.2/node_modules/@shikijs/engine-oniguruma/dist/index.mjs
|
|
7267
7271
|
var ShikiError3 = class extends Error {
|
|
7268
7272
|
constructor(message) {
|
|
7269
7273
|
super(message);
|
|
@@ -7707,8 +7711,8 @@ async function createOnigurumaEngine(options) {
|
|
|
7707
7711
|
};
|
|
7708
7712
|
}
|
|
7709
7713
|
|
|
7710
|
-
// node_modules/.pnpm/tm-grammars@1.24.
|
|
7711
|
-
var version = "1.24.
|
|
7714
|
+
// node_modules/.pnpm/tm-grammars@1.24.3/node_modules/tm-grammars/package.json
|
|
7715
|
+
var version = "1.24.3";
|
|
7712
7716
|
|
|
7713
7717
|
// node_modules/.pnpm/tm-themes@1.10.7/node_modules/tm-themes/package.json
|
|
7714
7718
|
var version2 = "1.10.7";
|
package/dist/ssr/index.js
CHANGED
|
@@ -31,7 +31,7 @@ async function renderToString(input, options) {
|
|
|
31
31
|
}
|
|
32
32
|
async function renderToWebComponent(input, options) {
|
|
33
33
|
const prerender = await renderToString(input, options);
|
|
34
|
-
return '<monaco-editor><script type="application/json" class="monaco-editor-options">' + JSON.stringify([input, options]) + '<\/script><div class="monaco-editor-prerender" style="width:100%;height:100%;">' + prerender + "</div></monaco-editor>";
|
|
34
|
+
return '<monaco-editor><script type="application/json" class="monaco-editor-options">' + JSON.stringify([input, options]).replaceAll("/", "\\/") + '<\/script><div class="monaco-editor-prerender" style="width:100%;height:100%;">' + prerender + "</div></monaco-editor>";
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// src/ssr/index.ts
|
package/dist/ssr/workerd.js
CHANGED
|
@@ -30,7 +30,7 @@ async function renderToString(input, options) {
|
|
|
30
30
|
}
|
|
31
31
|
async function renderToWebComponent(input, options) {
|
|
32
32
|
const prerender = await renderToString(input, options);
|
|
33
|
-
return '<monaco-editor><script type="application/json" class="monaco-editor-options">' + JSON.stringify([input, options]) + '<\/script><div class="monaco-editor-prerender" style="width:100%;height:100%;">' + prerender + "</div></monaco-editor>";
|
|
33
|
+
return '<monaco-editor><script type="application/json" class="monaco-editor-options">' + JSON.stringify([input, options]).replaceAll("/", "\\/") + '<\/script><div class="monaco-editor-prerender" style="width:100%;height:100%;">' + prerender + "</div></monaco-editor>";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/ssr/workerd.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-monaco",
|
|
3
3
|
"description": "A modern version of Monaco Editor",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"sideEffects": false,
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@esm.sh/import-map": "0.1.1",
|
|
68
|
-
"@shikijs/core": "3.9.
|
|
69
|
-
"@shikijs/engine-oniguruma": "3.9.
|
|
68
|
+
"@shikijs/core": "3.9.2",
|
|
69
|
+
"@shikijs/engine-oniguruma": "3.9.2",
|
|
70
70
|
"monaco-editor-core": "0.52.2",
|
|
71
|
-
"tm-grammars": "1.24.
|
|
71
|
+
"tm-grammars": "1.24.3",
|
|
72
72
|
"tm-themes": "1.10.7",
|
|
73
73
|
"typescript": "5.9.2",
|
|
74
74
|
"vscode-css-languageservice": "6.3.7",
|
package/types/index.d.ts
CHANGED
|
@@ -60,8 +60,8 @@ export interface InitOptions extends ShikiInitOptions {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export function init(options?: InitOptions): Promise<typeof monacoNS>;
|
|
63
|
-
export function lazy(options?: InitOptions): void
|
|
64
|
-
export function hydrate(options?: InitOptions): void
|
|
63
|
+
export function lazy(options?: InitOptions): Promise<void>;
|
|
64
|
+
export function hydrate(options?: InitOptions): Promise<void>;
|
|
65
65
|
|
|
66
66
|
export const errors: {
|
|
67
67
|
NotFound: ErrorNotFound;
|
package/types/ssr.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type monacoNS from "./monaco.d.ts";
|
|
2
2
|
import type { ShikiInitOptions } from "./index.d.ts";
|
|
3
3
|
|
|
4
|
-
export type RenderInput = string | { filename: string; code: string };
|
|
4
|
+
export type RenderInput = string | { filename: string; code: string; version?: number };
|
|
5
5
|
|
|
6
6
|
export interface RenderOptions extends monacoNS.editor.IStandaloneEditorConstructionOptions {
|
|
7
|
-
filename?: string;
|
|
8
7
|
fontDigitWidth?: number;
|
|
9
8
|
userAgent?: string;
|
|
10
9
|
shiki?: ShikiInitOptions;
|