@willbooster/monaco-react 1.0.6 → 1.0.7

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 CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Test](https://github.com/WillBooster/monaco-react/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/monaco-react/actions/workflows/test.yml)
4
4
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
5
+
5
6
  [![monthly downloads](https://img.shields.io/npm/dm/@willbooster/monaco-react)](https://www.npmjs.com/package/@willbooster/monaco-react)
6
7
  [![npm version](https://img.shields.io/npm/v/@willbooster/monaco-react.svg?style=flat)](https://www.npmjs.com/package/@willbooster/monaco-react)
7
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"DiffEditor.d.ts","sourceRoot":"","sources":["../../src/DiffEditor/DiffEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,SAAS,CAAC;AAGjE,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAmBxD;AAqPD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"DiffEditor.d.ts","sourceRoot":"","sources":["../../src/DiffEditor/DiffEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,SAAS,CAAC;AAGjE,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAmBxD;eAqPc,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DiffEditor/index.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,SAAS,CAAC;;AAExB,wBAAgC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DiffEditor/index.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/Editor/Editor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAmBhD;AAgSD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/Editor/Editor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAmBhD;eAgSc,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Editor/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,cAAc,SAAS,CAAC;;AAExB,wBAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Editor/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,cAAc,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../../src/Loading/Loading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI7D,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAE9D;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../../src/Loading/Loading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI7D,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAE9D;eAEc,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Loading/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Loading/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;eAEjB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Loading/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAQzC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Loading/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAQzC,CAAC;eAEa,MAAM"}
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { ContainerProps } from './types';
3
- declare function MonacoContainer({ width, height, isEditorReady, loading, _ref, className, wrapperProps }: ContainerProps): ReactElement;
3
+ declare function MonacoContainer({ width, height, isEditorReady, loading, _ref, className, wrapperProps, }: ContainerProps): ReactElement;
4
4
  export default MonacoContainer;
5
5
  //# sourceMappingURL=MonacoContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MonacoContainer.d.ts","sourceRoot":"","sources":["../../src/MonacoContainer/MonacoContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C,iBAAS,eAAe,CAAC,EACvB,KAAK,EACL,MAAM,EACN,aAAa,EACb,OAAO,EACP,IAAI,EACJ,SAAS,EACT,YAAY,EACb,EAAE,cAAc,GAAG,YAAY,CAO/B;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"MonacoContainer.d.ts","sourceRoot":"","sources":["../../src/MonacoContainer/MonacoContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C,iBAAS,eAAe,CAAC,EACvB,KAAK,EACL,MAAM,EACN,aAAa,EACb,OAAO,EACP,IAAI,EACJ,SAAS,EACT,YAAY,GACb,EAAE,cAAc,GAAG,YAAY,CAO/B;eAEc,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MonacoContainer/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,mBAAmB,CAAC;;AAEhD,wBAAqC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MonacoContainer/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/MonacoContainer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAYzC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/MonacoContainer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAYzC,CAAC;eAEa,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMonaco/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGpC,iBAAS,SAAS,IAAI,MAAM,GAAG,SAAS,CAQvC;AAkBD,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMonaco/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGpC,iBAAS,SAAS,IAAI,MAAM,GAAG,SAAS,CAQvC;eAkBc,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"initMonaco.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMonaco/initMonaco.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAIpC,iBAAS,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAGrC;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"initMonaco.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMonaco/initMonaco.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAIpC,iBAAS,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAGrC;eAEc,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMount/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,iBAAS,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAI9C;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMount/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,iBAAS,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAI9C;eAEc,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePrevious/index.ts"],"names":[],"mappings":"AAEA,iBAAS,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAQ/C;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePrevious/index.ts"],"names":[],"mappings":"AAEA,iBAAS,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAQ/C;eAEc,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUpdate/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,iBAAS,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,UAAO,GAAG,IAAI,CAiB1F;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUpdate/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,iBAAS,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,UAAO,GAAG,IAAI,CAiB1F;eAEc,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,eAAe,MAAM,CAAC;AAGtB,OAAO,KAAK,KAAK,MAAM,MAAM,2CAA2C,CAAC;AACzE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAGnC,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;eACH,MAAM;AAGrB,OAAO,KAAK,KAAK,MAAM,MAAM,2CAA2C,CAAC;AACzE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAGnC,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e,r){return e.Uri.parse(r)}exports.getOrCreateModel=function(r,t,n,o){var u;return null!=(u=function(r,t){return r.editor.getModel(e(r,t))}(r,o))?u:function(r,t,n,o){return r.editor.createModel(t,n,o?e(r,o):void 0)}(r,t,n,o)},exports.noop=function(){};
1
+ "use strict";function t(t,r){if(function(t){return/^[a-z][a-z0-9+.-]+:/i.test(t)}(r))return t.Uri.parse(r);const e=r.replaceAll("\\","/");if(e.startsWith("//")){const[r,...i]=e.slice(2).split("/");return t.Uri.from({scheme:"file",authority:r,path:`/${i.join("/")}`})}return t.Uri.from({scheme:"file",path:e.startsWith("/")?e:`/${e}`})}exports.getOrCreateModel=function(r,e,i,n){var o;return null!=(o=function(r,e){return r.editor.getModel(t(r,e))}(r,n))?o:function(r,e,i,n){return r.editor.createModel(e,i,n?t(r,n):void 0)}(r,e,i,n)},exports.noop=function(){};
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/utils/index.ts"],"sourcesContent":["import type { Monaco } from '..';\nimport type { Uri, editor } from 'monaco-editor/esm/vs/editor/editor.api.js';\n\n/**\n * noop is a helper function that does nothing\n * @returns undefined\n */\nfunction noop(): void {\n /** no-op */\n}\n\n/**\n * getOrCreateModel is a helper function that will return a model if it exists\n * or create a new model if it does not exist.\n * This is useful for when you want to create a model for a file that may or may not exist yet.\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was found or created\n */\nfunction getOrCreateModel(monaco: Monaco, value: string, language: string, path: string): editor.ITextModel {\n return getModel(monaco, path) ?? createModel(monaco, value, language, path);\n}\n\n/**\n * getModel is a helper function that will return a model if it exists\n * or return undefined if it does not exist.\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model that was found or undefined\n */\nfunction getModel(monaco: Monaco, path: string): editor.ITextModel | null {\n return monaco.editor.getModel(createModelUri(monaco, path));\n}\n\n/**\n * createModel is a helper function that will create a new model\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was created\n */\nfunction createModel(monaco: Monaco, value: string, language?: string, path?: string): editor.ITextModel {\n return monaco.editor.createModel(value, language, path ? createModelUri(monaco, path) : undefined);\n}\n\n/**\n * createModelUri is a helper function that will create a new model uri\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model uri that was created\n */\nfunction createModelUri(monaco: Monaco, path: string): Uri {\n return monaco.Uri.parse(path);\n}\n\nexport { noop, getOrCreateModel };\n"],"names":["createModelUri","monaco","path","Uri","parse","value","language","_getModel","editor","getModel","createModel","undefined"],"mappings":"aAsDA,SAASA,EAAeC,EAAgBC,GACtC,OAAOD,EAAOE,IAAIC,MAAMF,EAC1B,0BAnCA,SAA0BD,EAAgBI,EAAeC,EAAkBJ,GAAiC,IAAAK,EAC1G,OAA6B,OAA7BA,EAUF,SAAkBN,EAAgBC,GAChC,OAAOD,EAAOO,OAAOC,SAAST,EAAeC,EAAQC,GACvD,CAZSO,CAASR,EAAQC,IAAKK,EAsB/B,SAAqBN,EAAgBI,EAAeC,EAAmBJ,GACrE,OAAOD,EAAOO,OAAOE,YAAYL,EAAOC,EAAUJ,EAAOF,EAAeC,EAAQC,QAAQS,EAC1F,CAxBmCD,CAAYT,EAAQI,EAAOC,EAAUJ,EACxE,eAhBA,WACE"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/utils/index.ts"],"sourcesContent":["import type { Monaco } from '..';\nimport type { Uri, editor } from 'monaco-editor/esm/vs/editor/editor.api.js';\n\n/**\n * noop is a helper function that does nothing\n * @returns undefined\n */\nfunction noop(): void {\n /** no-op */\n}\n\n/**\n * getOrCreateModel is a helper function that will return a model if it exists\n * or create a new model if it does not exist.\n * This is useful for when you want to create a model for a file that may or may not exist yet.\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was found or created\n */\nfunction getOrCreateModel(monaco: Monaco, value: string, language: string, path: string): editor.ITextModel {\n return getModel(monaco, path) ?? createModel(monaco, value, language, path);\n}\n\n/**\n * getModel is a helper function that will return a model if it exists\n * or return undefined if it does not exist.\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model that was found or undefined\n */\nfunction getModel(monaco: Monaco, path: string): editor.ITextModel | null {\n return monaco.editor.getModel(createModelUri(monaco, path));\n}\n\n/**\n * createModel is a helper function that will create a new model\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was created\n */\nfunction createModel(monaco: Monaco, value: string, language?: string, path?: string): editor.ITextModel {\n return monaco.editor.createModel(value, language, path ? createModelUri(monaco, path) : undefined);\n}\n\n/**\n * createModelUri is a helper function that will create a new model uri\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model uri that was created\n */\nfunction createModelUri(monaco: Monaco, path: string): Uri {\n if (hasUriScheme(path)) {\n return monaco.Uri.parse(path);\n }\n\n const normalizedPath = path.replaceAll('\\\\', '/');\n if (normalizedPath.startsWith('//')) {\n const [authority, ...pathParts] = normalizedPath.slice(2).split('/');\n return monaco.Uri.from({\n scheme: 'file',\n authority,\n path: `/${pathParts.join('/')}`,\n });\n }\n\n return monaco.Uri.from({\n scheme: 'file',\n path: normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`,\n });\n}\n\nfunction hasUriScheme(path: string): boolean {\n return /^[a-z][a-z0-9+.-]+:/i.test(path);\n}\n\nexport { noop, getOrCreateModel };\n"],"names":["createModelUri","monaco","path","test","hasUriScheme","Uri","parse","normalizedPath","replaceAll","startsWith","authority","pathParts","slice","split","from","scheme","join","value","language","_getModel","editor","getModel","createModel","undefined"],"mappings":"aAsDA,SAASA,EAAeC,EAAgBC,GACtC,GAoBF,SAAsBA,GACpB,MAAO,uBAAuBC,KAAKD,EACrC,CAtBME,CAAaF,GACf,OAAOD,EAAOI,IAAIC,MAAMJ,GAG1B,MAAMK,EAAiBL,EAAKM,WAAW,KAAM,KAC7C,GAAID,EAAeE,WAAW,MAAO,CACnC,MAAOC,KAAcC,GAAaJ,EAAeK,MAAM,GAAGC,MAAM,KAChE,OAAOZ,EAAOI,IAAIS,KAAK,CACrBC,OAAQ,OACRL,YACAR,KAAM,IAAIS,EAAUK,KAAK,QAE7B,CAEA,OAAOf,EAAOI,IAAIS,KAAK,CACrBC,OAAQ,OACRb,KAAMK,EAAeE,WAAW,KAAOF,EAAiB,IAAIA,KAEhE,0BApDA,SAA0BN,EAAgBgB,EAAeC,EAAkBhB,GAAiC,IAAAiB,EAC1G,OAA6B,OAA7BA,EAUF,SAAkBlB,EAAgBC,GAChC,OAAOD,EAAOmB,OAAOC,SAASrB,EAAeC,EAAQC,GACvD,CAZSmB,CAASpB,EAAQC,IAAKiB,EAsB/B,SAAqBlB,EAAgBgB,EAAeC,EAAmBhB,GACrE,OAAOD,EAAOmB,OAAOE,YAAYL,EAAOC,EAAUhB,EAAOF,EAAeC,EAAQC,QAAQqB,EAC1F,CAxBmCD,CAAYrB,EAAQgB,EAAOC,EAAUhB,EACxE,eAhBA,WACE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAE7E;;;GAGG;AACH,iBAAS,IAAI,IAAI,IAAI,CAEpB;AAED;;;;;;;;;GASG;AACH,iBAAS,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAE1G;AAmCD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAE7E;;;GAGG;AACH,iBAAS,IAAI,IAAI,IAAI,CAEpB;AAED;;;;;;;;;GASG;AACH,iBAAS,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAE1G;AAwDD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- function n(){}function r(n,r,e,o){var u;return null!=(u=function(n,r){return n.editor.getModel(t(n,r))}(n,o))?u:function(n,r,e,o){return n.editor.createModel(r,e,o?t(n,o):void 0)}(n,r,e,o)}function t(n,r){return n.Uri.parse(r)}export{r as getOrCreateModel,n as noop};
1
+ function t(){}function r(t,r,i,n){var o;return null!=(o=function(t,r){return t.editor.getModel(e(t,r))}(t,n))?o:function(t,r,i,n){return t.editor.createModel(r,i,n?e(t,n):void 0)}(t,r,i,n)}function e(t,r){if(function(t){return/^[a-z][a-z0-9+.-]+:/i.test(t)}(r))return t.Uri.parse(r);const e=r.replaceAll("\\","/");if(e.startsWith("//")){const[r,...i]=e.slice(2).split("/");return t.Uri.from({scheme:"file",authority:r,path:`/${i.join("/")}`})}return t.Uri.from({scheme:"file",path:e.startsWith("/")?e:`/${e}`})}export{r as getOrCreateModel,t as noop};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import type { Monaco } from '..';\nimport type { Uri, editor } from 'monaco-editor/esm/vs/editor/editor.api.js';\n\n/**\n * noop is a helper function that does nothing\n * @returns undefined\n */\nfunction noop(): void {\n /** no-op */\n}\n\n/**\n * getOrCreateModel is a helper function that will return a model if it exists\n * or create a new model if it does not exist.\n * This is useful for when you want to create a model for a file that may or may not exist yet.\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was found or created\n */\nfunction getOrCreateModel(monaco: Monaco, value: string, language: string, path: string): editor.ITextModel {\n return getModel(monaco, path) ?? createModel(monaco, value, language, path);\n}\n\n/**\n * getModel is a helper function that will return a model if it exists\n * or return undefined if it does not exist.\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model that was found or undefined\n */\nfunction getModel(monaco: Monaco, path: string): editor.ITextModel | null {\n return monaco.editor.getModel(createModelUri(monaco, path));\n}\n\n/**\n * createModel is a helper function that will create a new model\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was created\n */\nfunction createModel(monaco: Monaco, value: string, language?: string, path?: string): editor.ITextModel {\n return monaco.editor.createModel(value, language, path ? createModelUri(monaco, path) : undefined);\n}\n\n/**\n * createModelUri is a helper function that will create a new model uri\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model uri that was created\n */\nfunction createModelUri(monaco: Monaco, path: string): Uri {\n return monaco.Uri.parse(path);\n}\n\nexport { noop, getOrCreateModel };\n"],"names":["noop","getOrCreateModel","monaco","value","language","path","_getModel","editor","getModel","createModelUri","createModel","undefined","Uri","parse"],"mappings":"AAOA,SAASA,IACP,CAaF,SAASC,EAAiBC,EAAgBC,EAAeC,EAAkBC,GAAiC,IAAAC,EAC1G,OAA6B,OAA7BA,EAUF,SAAkBJ,EAAgBG,GAChC,OAAOH,EAAOK,OAAOC,SAASC,EAAeP,EAAQG,GACvD,CAZSG,CAASN,EAAQG,IAAKC,EAsB/B,SAAqBJ,EAAgBC,EAAeC,EAAmBC,GACrE,OAAOH,EAAOK,OAAOG,YAAYP,EAAOC,EAAUC,EAAOI,EAAeP,EAAQG,QAAQM,EAC1F,CAxBmCD,CAAYR,EAAQC,EAAOC,EAAUC,EACxE,CA+BA,SAASI,EAAeP,EAAgBG,GACtC,OAAOH,EAAOU,IAAIC,MAAMR,EAC1B"}
1
+ {"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import type { Monaco } from '..';\nimport type { Uri, editor } from 'monaco-editor/esm/vs/editor/editor.api.js';\n\n/**\n * noop is a helper function that does nothing\n * @returns undefined\n */\nfunction noop(): void {\n /** no-op */\n}\n\n/**\n * getOrCreateModel is a helper function that will return a model if it exists\n * or create a new model if it does not exist.\n * This is useful for when you want to create a model for a file that may or may not exist yet.\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was found or created\n */\nfunction getOrCreateModel(monaco: Monaco, value: string, language: string, path: string): editor.ITextModel {\n return getModel(monaco, path) ?? createModel(monaco, value, language, path);\n}\n\n/**\n * getModel is a helper function that will return a model if it exists\n * or return undefined if it does not exist.\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model that was found or undefined\n */\nfunction getModel(monaco: Monaco, path: string): editor.ITextModel | null {\n return monaco.editor.getModel(createModelUri(monaco, path));\n}\n\n/**\n * createModel is a helper function that will create a new model\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was created\n */\nfunction createModel(monaco: Monaco, value: string, language?: string, path?: string): editor.ITextModel {\n return monaco.editor.createModel(value, language, path ? createModelUri(monaco, path) : undefined);\n}\n\n/**\n * createModelUri is a helper function that will create a new model uri\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model uri that was created\n */\nfunction createModelUri(monaco: Monaco, path: string): Uri {\n if (hasUriScheme(path)) {\n return monaco.Uri.parse(path);\n }\n\n const normalizedPath = path.replaceAll('\\\\', '/');\n if (normalizedPath.startsWith('//')) {\n const [authority, ...pathParts] = normalizedPath.slice(2).split('/');\n return monaco.Uri.from({\n scheme: 'file',\n authority,\n path: `/${pathParts.join('/')}`,\n });\n }\n\n return monaco.Uri.from({\n scheme: 'file',\n path: normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`,\n });\n}\n\nfunction hasUriScheme(path: string): boolean {\n return /^[a-z][a-z0-9+.-]+:/i.test(path);\n}\n\nexport { noop, getOrCreateModel };\n"],"names":["noop","getOrCreateModel","monaco","value","language","path","_getModel","editor","getModel","createModelUri","createModel","undefined","test","hasUriScheme","Uri","parse","normalizedPath","replaceAll","startsWith","authority","pathParts","slice","split","from","scheme","join"],"mappings":"AAOA,SAASA,IACP,CAaF,SAASC,EAAiBC,EAAgBC,EAAeC,EAAkBC,GAAiC,IAAAC,EAC1G,OAA6B,OAA7BA,EAUF,SAAkBJ,EAAgBG,GAChC,OAAOH,EAAOK,OAAOC,SAASC,EAAeP,EAAQG,GACvD,CAZSG,CAASN,EAAQG,IAAKC,EAsB/B,SAAqBJ,EAAgBC,EAAeC,EAAmBC,GACrE,OAAOH,EAAOK,OAAOG,YAAYP,EAAOC,EAAUC,EAAOI,EAAeP,EAAQG,QAAQM,EAC1F,CAxBmCD,CAAYR,EAAQC,EAAOC,EAAUC,EACxE,CA+BA,SAASI,EAAeP,EAAgBG,GACtC,GAoBF,SAAsBA,GACpB,MAAO,uBAAuBO,KAAKP,EACrC,CAtBMQ,CAAaR,GACf,OAAOH,EAAOY,IAAIC,MAAMV,GAG1B,MAAMW,EAAiBX,EAAKY,WAAW,KAAM,KAC7C,GAAID,EAAeE,WAAW,MAAO,CACnC,MAAOC,KAAcC,GAAaJ,EAAeK,MAAM,GAAGC,MAAM,KAChE,OAAOpB,EAAOY,IAAIS,KAAK,CACrBC,OAAQ,OACRL,YACAd,KAAM,IAAIe,EAAUK,KAAK,QAE7B,CAEA,OAAOvB,EAAOY,IAAIS,KAAK,CACrBC,OAAQ,OACRnB,KAAMW,EAAeE,WAAW,KAAOF,EAAiB,IAAIA,KAEhE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/monaco-react",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins",
5
5
  "keywords": [
6
6
  "code",
@@ -14,19 +14,13 @@
14
14
  "bugs": {
15
15
  "url": "https://github.com/WillBooster/monaco-react/issues"
16
16
  },
17
- "license": "MIT",
18
- "author": "WillBooster Inc.",
19
17
  "repository": {
20
18
  "type": "git",
21
19
  "url": "git+https://github.com/WillBooster/monaco-react.git"
22
20
  },
23
- "files": [
24
- "dist/"
25
- ],
21
+ "license": "MIT",
22
+ "author": "WillBooster Inc.",
26
23
  "type": "module",
27
- "main": "dist/index.cjs",
28
- "module": "dist/index.js",
29
- "types": "dist/index.d.ts",
30
24
  "exports": {
31
25
  ".": {
32
26
  "types": "./dist/index.d.ts",
@@ -34,18 +28,19 @@
34
28
  "import": "./dist/index.js"
35
29
  }
36
30
  },
37
- "publishConfig": {
38
- "access": "public"
39
- },
31
+ "main": "dist/index.cjs",
32
+ "module": "dist/index.js",
33
+ "types": "dist/index.d.ts",
34
+ "files": [
35
+ "dist/"
36
+ ],
40
37
  "scripts": {
41
38
  "build": "yarn run build/core",
42
39
  "build/core": "build-ts lib",
43
- "check-all-for-ai": "yarn check-for-ai && yarn test",
44
- "check-for-ai": "yarn install > /dev/null && yarn format > /dev/null 2> /dev/null || true && yarn lint-fix --quiet",
45
40
  "cleanup": "yarn format && yarn lint-fix",
46
41
  "common/ci-setup": "yarn run build/core",
47
42
  "format": "sort-package-json && yarn format-code",
48
- "format-code": "oxfmt --write --no-error-on-unmatched-pattern .",
43
+ "format-code": "oxfmt --write --no-error-on-unmatched-pattern . '!**/package.json'",
49
44
  "lint": "oxlint --no-error-on-unmatched-pattern .",
50
45
  "lint-fix": "yarn lint --fix",
51
46
  "prepare": "lefthook install || true",
@@ -53,7 +48,9 @@
53
48
  "test:e2e:next": "yarn build && next build e2e/next-app && playwright test --config e2e/next-app/playwright.config.ts",
54
49
  "test:unit": "vitest",
55
50
  "test/ci-setup": "playwright install chromium",
56
- "typecheck": "tsgo --noEmit"
51
+ "typecheck": "wb typecheck",
52
+ "verify": "wb verify",
53
+ "verify-full": "wb verify --full"
57
54
  },
58
55
  "dependencies": {
59
56
  "@willbooster/monaco-loader": "1.1.1",
@@ -69,17 +66,19 @@
69
66
  "@types/node": "25.6.0",
70
67
  "@types/react": "19.2.14",
71
68
  "@types/react-dom": "19.2.3",
72
- "@typescript/native-preview": "7.0.0-dev.20260418.1",
73
- "@willbooster/oxfmt-config": "1.2.1",
74
- "@willbooster/oxlint-config": "1.4.4",
75
- "build-ts": "17.1.5",
69
+ "@typescript/native-preview": "7.0.0-dev.20260421.2",
70
+ "@willbooster/oxfmt-config": "1.2.2",
71
+ "@willbooster/oxlint-config": "1.4.6",
72
+ "@willbooster/wb": "13.20.0",
73
+ "build-ts": "17.1.15",
76
74
  "conventional-changelog-conventionalcommits": "9.3.1",
77
75
  "jsdom": "29.0.2",
78
- "lefthook": "2.1.5",
76
+ "lefthook": "2.1.6",
79
77
  "next": "16.2.4",
80
- "oxfmt": "0.45.0",
81
- "oxlint": "1.60.0",
82
- "oxlint-tsgolint": "0.21.0",
78
+ "oxfmt": "0.50.0",
79
+ "oxlint": "1.65.0",
80
+ "oxlint-tsgolint": "0.22.1",
81
+ "prettier": "3.8.3",
83
82
  "react": "19.2.5",
84
83
  "react-dom": "19.2.5",
85
84
  "semantic-release": "25.0.3",
@@ -90,8 +89,11 @@
90
89
  "react": "^19.0.0",
91
90
  "react-dom": "^19.0.0"
92
91
  },
92
+ "packageManager": "yarn@4.15.0",
93
93
  "engines": {
94
94
  "node": ">=24"
95
95
  },
96
- "packageManager": "yarn@4.14.1"
96
+ "publishConfig": {
97
+ "access": "public"
98
+ }
97
99
  }