modern-monaco 0.3.1 → 0.3.2

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/dist/core.mjs CHANGED
@@ -40,7 +40,7 @@ function isObject(v) {
40
40
  }
41
41
 
42
42
  // package.json
43
- var version = "0.3.1";
43
+ var version = "0.3.2";
44
44
 
45
45
  // src/core.ts
46
46
  import { getExtnameFromLanguageId, getLanguageIdFromPath, grammars, initShiki, setDefaultWasmLoader, themes } from "./shiki.mjs";
@@ -48,7 +48,7 @@ import { initShikiMonacoTokenizer, registerShikiMonacoTokenizer } from "./shiki.
48
48
  import { render } from "./shiki.mjs";
49
49
  import { getWasmInstance } from "./shiki-wasm.mjs";
50
50
  import { NotFoundError, Workspace } from "./workspace.mjs";
51
- import { debunce, decode, getCDNUrl, isDigital } from "./util.mjs";
51
+ import { debunce, decode, isDigital } from "./util.mjs";
52
52
  var editorProps = [
53
53
  "autoDetectHighContrast",
54
54
  "automaticLayout",
@@ -90,7 +90,7 @@ var setStyle = (el, style) => Object.assign(el.style, style);
90
90
  async function init(options) {
91
91
  const langs = (options?.langs ?? []).concat(syntaxes);
92
92
  const shiki = await initShiki({ ...options, langs });
93
- return loadMonaco(shiki, options?.workspace, options?.lsp, options?.cdn);
93
+ return loadMonaco(shiki, options?.workspace, options?.lsp);
94
94
  }
95
95
  function lazy(options) {
96
96
  if (!customElements.get("monaco-editor")) {
@@ -253,7 +253,7 @@ function lazy(options) {
253
253
  }
254
254
  }
255
255
  {
256
- const monaco = await (monacoPromise ?? (monacoPromise = loadMonaco(highlighter, workspace, options?.lsp, options?.cdn)));
256
+ const monaco = await (monacoPromise ?? (monacoPromise = loadMonaco(highlighter, workspace, options?.lsp)));
257
257
  const editor = monaco.editor.create(containerEl, renderOptions);
258
258
  if (workspace) {
259
259
  const storeViewState = () => {
@@ -327,9 +327,10 @@ function lazy(options) {
327
327
  function hydrate(options) {
328
328
  return lazy(options);
329
329
  }
330
- async function loadMonaco(highlighter, workspace, lsp, cdn) {
331
- let editorCoreModuleUrl = getCDNUrl(`/modern-monaco@${version}/dist/editor-core.mjs`, cdn);
332
- let lspModuleUrl = getCDNUrl(`/modern-monaco@${version}/dist/lsp/index.mjs`, cdn);
330
+ async function loadMonaco(highlighter, workspace, lsp) {
331
+ let cdnUrl = `https://esm.sh/modern-monaco@${version}`;
332
+ let editorCoreModuleUrl = `${cdnUrl}/es2022/editor-core.mjs`;
333
+ let lspModuleUrl = `${cdnUrl}/es2022/lsp.mjs`;
333
334
  let importmapEl = null;
334
335
  if (importmapEl = document.querySelector("script[type='importmap']")) {
335
336
  try {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // node_modules/.pnpm/tm-themes@1.10.12/node_modules/tm-themes/themes/vitesse-dark.json
1
+ // node_modules/.pnpm/tm-themes@1.10.13/node_modules/tm-themes/themes/vitesse-dark.json
2
2
  var vitesse_dark_default = {
3
3
  colors: {
4
4
  "activityBar.activeBorder": "#4d9375",
@@ -693,7 +693,7 @@ var vitesse_dark_default = {
693
693
  type: "dark"
694
694
  };
695
695
 
696
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/html.json
696
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/html.json
697
697
  var html_default = {
698
698
  displayName: "HTML",
699
699
  injections: {
@@ -3322,7 +3322,7 @@ var html_default = {
3322
3322
  scopeName: "text.html.basic"
3323
3323
  };
3324
3324
 
3325
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/css.json
3325
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/css.json
3326
3326
  var css_default = {
3327
3327
  displayName: "CSS",
3328
3328
  name: "css",
@@ -5184,7 +5184,7 @@ var css_default = {
5184
5184
  scopeName: "source.css"
5185
5185
  };
5186
5186
 
5187
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/javascript.json
5187
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/javascript.json
5188
5188
  var javascript_default = {
5189
5189
  displayName: "JavaScript",
5190
5190
  name: "javascript",
@@ -11182,7 +11182,7 @@ var javascript_default = {
11182
11182
  scopeName: "source.js"
11183
11183
  };
11184
11184
 
11185
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/typescript.json
11185
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/typescript.json
11186
11186
  var typescript_default = {
11187
11187
  displayName: "TypeScript",
11188
11188
  name: "typescript",
@@ -16931,7 +16931,7 @@ var typescript_default = {
16931
16931
  scopeName: "source.ts"
16932
16932
  };
16933
16933
 
16934
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/jsx.json
16934
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/jsx.json
16935
16935
  var jsx_default = {
16936
16936
  displayName: "JSX",
16937
16937
  name: "jsx",
@@ -22929,7 +22929,7 @@ var jsx_default = {
22929
22929
  scopeName: "source.js.jsx"
22930
22930
  };
22931
22931
 
22932
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/tsx.json
22932
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/tsx.json
22933
22933
  var tsx_default = {
22934
22934
  displayName: "TSX",
22935
22935
  name: "tsx",
@@ -28927,7 +28927,7 @@ var tsx_default = {
28927
28927
  scopeName: "source.tsx"
28928
28928
  };
28929
28929
 
28930
- // node_modules/.pnpm/tm-grammars@1.25.3/node_modules/tm-grammars/grammars/json.json
28930
+ // node_modules/.pnpm/tm-grammars@1.26.0/node_modules/tm-grammars/grammars/json.json
28931
28931
  var json_default = {
28932
28932
  displayName: "JSON",
28933
28933
  name: "json",