@codingame/monaco-editor-wrapper 1.14.1 → 1.14.4
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 +2 -2
- package/dist/features/extensionConfigurations.js +1 -1
- package/dist/features/htmlContribution.js +1 -1
- package/dist/features/jsonContribution.js +1 -1
- package/dist/features/typescriptContribution.js +1 -1
- package/dist/index.js +1 -1
- package/dist/languages/textMate/index.d.ts +1 -1
- package/dist/main.js +19 -3
- package/dist/monaco.d.ts +9 -0
- package/package.json +1 -1
- package/stats.html +1 -1
package/README.md
CHANGED
|
@@ -32,14 +32,14 @@ npm install @codingame/monaco-editor-wrapper
|
|
|
32
32
|
### Usage
|
|
33
33
|
|
|
34
34
|
:warning: You should NEVER import `monaco-editor` directly in your code.
|
|
35
|
-
`monaco-editor/esm/vs/editor/
|
|
35
|
+
`monaco-editor/esm/vs/editor/editor.api` should be used instead or Monaco will load all languages/worker and break the loading.
|
|
36
36
|
There are 2 solutions:
|
|
37
37
|
- if webpack is used, a resolve alias can be used:
|
|
38
38
|
```javascript
|
|
39
39
|
{
|
|
40
40
|
resolve: {
|
|
41
41
|
alias: {
|
|
42
|
-
'monaco-editor$': require.resolve('monaco-editor/esm/vs/editor/
|
|
42
|
+
'monaco-editor$': require.resolve('monaco-editor/esm/vs/editor/editor.api')
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import 'monaco-editor/esm/vs/language/html/monaco.contribution';
|
|
3
3
|
import { r as registerConfigurations, g as getConfiguration, o as onConfigurationChanged } from '../index.js';
|
|
4
4
|
import { r as registerWorkerLoader } from '../worker.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _objectSpread2 } from '../_rollupPluginBabelHelpers.js';
|
|
2
2
|
import 'monaco-editor/esm/vs/language/json/monaco.contribution';
|
|
3
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/
|
|
3
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
4
4
|
import { r as registerWorkerLoader } from '../worker.js';
|
|
5
5
|
|
|
6
6
|
const registry = monaco.extra.Registry.as(monaco.extra.JsonContributionExtensions.JSONContribution); // Hack because the commands are filled by a code not run in monaco-editor
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _objectSpread2 } from '../_rollupPluginBabelHelpers.js';
|
|
2
2
|
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
|
|
3
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/
|
|
3
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
4
4
|
import { r as registerWorkerLoader } from '../worker.js';
|
|
5
5
|
|
|
6
6
|
var typescriptGlobal = "// Declare \"static\" methods in Error\ninterface ErrorConstructor {\n /** Create .stack property on a target object */\n captureStackTrace(targetObject: object, constructorOpt?: Function): void;\n\n /**\n * Optional override for formatting stack traces\n *\n * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces\n */\n prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;\n\n stackTraceLimit: number;\n}\n\n/*-----------------------------------------------*\n * *\n * GLOBAL *\n * *\n ------------------------------------------------*/\n\n// For backwards compability\ninterface NodeRequire extends NodeJS.Require { }\ninterface RequireResolve extends NodeJS.RequireResolve { }\ninterface NodeModule extends NodeJS.Module { }\n\ndeclare var process: NodeJS.Process;\ndeclare var console: Console;\n\ndeclare var __filename: string;\ndeclare var __dirname: string;\n\ndeclare var require: NodeRequire;\ndeclare var module: NodeModule;\n\n// Same as module.exports\ndeclare var exports: any;\n\n/**\n * Only available if `--expose-gc` is passed to the process.\n */\ndeclare var gc: undefined | (() => void);\n\n//#region borrowed\n// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib\n/** A controller object that allows you to abort one or more DOM requests as and when desired. */\ninterface AbortController {\n /**\n * Returns the AbortSignal object associated with this object.\n */\n\n readonly signal: AbortSignal;\n /**\n * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.\n */\n abort(): void;\n}\n\n/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */\ninterface AbortSignal {\n /**\n * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.\n */\n readonly aborted: boolean;\n}\n\ndeclare var AbortController: {\n prototype: AbortController;\n new(): AbortController;\n};\n\ndeclare var AbortSignal: {\n prototype: AbortSignal;\n new(): AbortSignal;\n // TODO: Add abort() static\n};\n//#endregion borrowed\n\n//#region ArrayLike.at()\ninterface RelativeIndexable<T> {\n /**\n * Takes an integer value and returns the item at that index,\n * allowing for positive and negative integers.\n * Negative integers count back from the last item in the array.\n */\n at(index: number): T | undefined;\n}\ninterface String extends RelativeIndexable<string> {}\ninterface Array<T> extends RelativeIndexable<T> {}\ninterface Int8Array extends RelativeIndexable<number> {}\ninterface Uint8Array extends RelativeIndexable<number> {}\ninterface Uint8ClampedArray extends RelativeIndexable<number> {}\ninterface Int16Array extends RelativeIndexable<number> {}\ninterface Uint16Array extends RelativeIndexable<number> {}\ninterface Int32Array extends RelativeIndexable<number> {}\ninterface Uint32Array extends RelativeIndexable<number> {}\ninterface Float32Array extends RelativeIndexable<number> {}\ninterface Float64Array extends RelativeIndexable<number> {}\ninterface BigInt64Array extends RelativeIndexable<bigint> {}\ninterface BigUint64Array extends RelativeIndexable<bigint> {}\n//#endregion ArrayLike.at() end\n\n/*----------------------------------------------*\n* *\n* GLOBAL INTERFACES *\n* *\n*-----------------------------------------------*/\ndeclare namespace NodeJS {\n interface CallSite {\n /**\n * Value of \"this\"\n */\n getThis(): unknown;\n\n /**\n * Type of \"this\" as a string.\n * This is the name of the function stored in the constructor field of\n * \"this\", if available. Otherwise the object's [[Class]] internal\n * property.\n */\n getTypeName(): string | null;\n\n /**\n * Current function\n */\n getFunction(): Function | undefined;\n\n /**\n * Name of the current function, typically its name property.\n * If a name property is not available an attempt will be made to try\n * to infer a name from the function's context.\n */\n getFunctionName(): string | null;\n\n /**\n * Name of the property [of \"this\" or one of its prototypes] that holds\n * the current function\n */\n getMethodName(): string | null;\n\n /**\n * Name of the script [if this function was defined in a script]\n */\n getFileName(): string | null;\n\n /**\n * Current line number [if this function was defined in a script]\n */\n getLineNumber(): number | null;\n\n /**\n * Current column number [if this function was defined in a script]\n */\n getColumnNumber(): number | null;\n\n /**\n * A call site object representing the location where eval was called\n * [if this function was created using a call to eval]\n */\n getEvalOrigin(): string | undefined;\n\n /**\n * Is this a toplevel invocation, that is, is \"this\" the global object?\n */\n isToplevel(): boolean;\n\n /**\n * Does this call take place in code defined by a call to eval?\n */\n isEval(): boolean;\n\n /**\n * Is this call in native V8 code?\n */\n isNative(): boolean;\n\n /**\n * Is this a constructor call?\n */\n isConstructor(): boolean;\n }\n\n interface ErrnoException extends Error {\n errno?: number | undefined;\n code?: string | undefined;\n path?: string | undefined;\n syscall?: string | undefined;\n }\n\n interface ReadableStream extends EventEmitter {\n readable: boolean;\n read(size?: number): string | Buffer;\n setEncoding(encoding: BufferEncoding): this;\n pause(): this;\n resume(): this;\n isPaused(): boolean;\n pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;\n unpipe(destination?: WritableStream): this;\n unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;\n wrap(oldStream: ReadableStream): this;\n [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;\n }\n\n interface WritableStream extends EventEmitter {\n writable: boolean;\n write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;\n write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;\n end(cb?: () => void): void;\n end(data: string | Uint8Array, cb?: () => void): void;\n end(str: string, encoding?: BufferEncoding, cb?: () => void): void;\n }\n\n interface ReadWriteStream extends ReadableStream, WritableStream { }\n\n interface RefCounted {\n ref(): this;\n unref(): this;\n }\n\n type TypedArray =\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigUint64Array\n | BigInt64Array\n | Float32Array\n | Float64Array;\n type ArrayBufferView = TypedArray | DataView;\n\n interface Require {\n (id: string): any;\n resolve: RequireResolve;\n cache: Dict<NodeModule>;\n /**\n * @deprecated\n */\n extensions: RequireExtensions;\n main: Module | undefined;\n }\n\n interface RequireResolve {\n (id: string, options?: { paths?: string[] | undefined; }): string;\n paths(request: string): string[] | null;\n }\n\n interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {\n '.js': (m: Module, filename: string) => any;\n '.json': (m: Module, filename: string) => any;\n '.node': (m: Module, filename: string) => any;\n }\n interface Module {\n /**\n * `true` if the module is running during the Node.js preload\n */\n isPreloading: boolean;\n exports: any;\n require: Require;\n id: string;\n filename: string;\n loaded: boolean;\n /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */\n parent: Module | null | undefined;\n children: Module[];\n /**\n * @since 11.14.0\n *\n * The directory name of the module. This is usually the same as the path.dirname() of the module.id.\n */\n path: string;\n paths: string[];\n }\n\n interface Dict<T> {\n [key: string]: T | undefined;\n }\n\n interface ReadOnlyDict<T> {\n readonly [key: string]: T | undefined;\n }\n}\n";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as monaco from 'monaco-editor';
|
|
2
2
|
import './semanticTokens';
|
|
3
|
-
export declare function getOrCreateTextMateTokensProvider(languageId: string): Promise<monaco.languages.ITokenizationSupport>;
|
|
3
|
+
export declare function getOrCreateTextMateTokensProvider(languageId: string): Promise<monaco.languages.ITokenizationSupport | null>;
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as monaco$2 from 'monaco-editor/esm/vs/editor/
|
|
1
|
+
import * as monaco$2 from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
export { monaco$2 as monaco };
|
|
3
3
|
import { _ as _objectSpread2, a as _defineProperty } from './_rollupPluginBabelHelpers.js';
|
|
4
4
|
import onigFile from 'vscode-oniguruma/release/onig.wasm';
|
|
@@ -6,6 +6,15 @@ import { loadWASM, createOnigScanner, createOnigString } from 'vscode-oniguruma'
|
|
|
6
6
|
import { e as extensions, g as getConfiguration$1, o as onConfigurationChanged } from './index.js';
|
|
7
7
|
export { g as getConfiguration, o as onConfigurationChanged, r as registerConfigurations, a as registerDefaultConfigurations, u as updateUserConfiguration } from './index.js';
|
|
8
8
|
import './worker.js';
|
|
9
|
+
import 'monaco-editor/esm/vs/editor/editor.all';
|
|
10
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp';
|
|
11
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard';
|
|
12
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens';
|
|
13
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess';
|
|
14
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess';
|
|
15
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess';
|
|
16
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess';
|
|
17
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch';
|
|
9
18
|
import * as shiftCommand from 'monaco-editor/esm/vs/editor/common/commands/shiftCommand';
|
|
10
19
|
|
|
11
20
|
function _mergeNamespaces(n, m) {
|
|
@@ -1532,6 +1541,11 @@ const languageService$2 = monaco$2.extra.StandaloneServices.get(monaco$2.languag
|
|
|
1532
1541
|
async function createTextMateTokensProvider(languageId) {
|
|
1533
1542
|
const grammarFactory = getOrCreateGrammarFactory();
|
|
1534
1543
|
const encodedLanguageId = languageService$2.languageIdCodec.encodeLanguageId(languageId);
|
|
1544
|
+
|
|
1545
|
+
if (!grammarFactory.has(languageId)) {
|
|
1546
|
+
return null;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1535
1549
|
const {
|
|
1536
1550
|
grammar,
|
|
1537
1551
|
initialState,
|
|
@@ -1539,7 +1553,7 @@ async function createTextMateTokensProvider(languageId) {
|
|
|
1539
1553
|
} = await grammarFactory.createGrammar(languageId, encodedLanguageId);
|
|
1540
1554
|
|
|
1541
1555
|
if (grammar == null) {
|
|
1542
|
-
|
|
1556
|
+
return null;
|
|
1543
1557
|
}
|
|
1544
1558
|
|
|
1545
1559
|
const tokenization = new monaco$2.extra.TMTokenization(grammar, initialState, containsEmbeddedLanguages);
|
|
@@ -4196,7 +4210,9 @@ monaco$2.extra.StandaloneServices.initialize({
|
|
|
4196
4210
|
return new MultiEditorStandaloneCodeEditorServiceImpl(monaco$2.extra.StandaloneServices.get(monaco$2.extra.IContextKeyService), monaco$2.extra.StandaloneServices.get(monaco$2.editor.IStandaloneThemeService), monaco$2.extra.StandaloneServices.get(monaco$2.extra.ITextModelService));
|
|
4197
4211
|
}
|
|
4198
4212
|
|
|
4199
|
-
}); //
|
|
4213
|
+
}); // Disable high contrast autodetection because it fallbacks on the hc-black no matter what
|
|
4214
|
+
|
|
4215
|
+
monaco$2.extra.StandaloneServices.get(monaco$2.editor.IStandaloneThemeService).setAutoDetectHighContrast(false); // Force EOL to be '\n' even on Windows
|
|
4200
4216
|
|
|
4201
4217
|
const configurationService = monaco$2.extra.StandaloneServices.get(monaco$2.extra.IConfigurationService);
|
|
4202
4218
|
configurationService.updateValue('files.eol', '\n').catch(error => {
|
package/dist/monaco.d.ts
CHANGED
|
@@ -3,6 +3,15 @@ import './languages';
|
|
|
3
3
|
import './theme';
|
|
4
4
|
import { EditorOpenHandler } from './services/MultiEditorStandaloneCodeEditorService';
|
|
5
5
|
import './worker';
|
|
6
|
+
import 'monaco-editor/esm/vs/editor/editor.all';
|
|
7
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp';
|
|
8
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard';
|
|
9
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens';
|
|
10
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess';
|
|
11
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess';
|
|
12
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess';
|
|
13
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess';
|
|
14
|
+
import 'monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch';
|
|
6
15
|
declare function createEditor(domElement: HTMLElement, options?: monaco.editor.IStandaloneEditorConstructionOptions): monaco.editor.IStandaloneCodeEditor;
|
|
7
16
|
declare function registerTextModelContentProvider(scheme: string, provider: monaco.extra.ITextModelContentProvider): monaco.IDisposable;
|
|
8
17
|
declare function registerEditorOpenHandler(handler: EditorOpenHandler): monaco.IDisposable;
|