modern-monaco 0.1.4 → 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/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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-monaco",
3
3
  "description": "A modern version of Monaco Editor",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",