@snack-uikit/code-editor 0.5.2-preview-76dd9d31.0 → 0.5.3-preview-fa4c1732.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/CHANGELOG.md +10 -0
- package/README.md +0 -5
- package/dist/cjs/components/index.d.ts +0 -1
- package/dist/cjs/components/index.js +1 -2
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.js +0 -1
- package/package.json +4 -4
- package/src/components/index.ts +0 -1
- package/dist/cjs/components/asyncLoader.d.ts +0 -9
- package/dist/cjs/components/asyncLoader.js +0 -46
- package/dist/esm/components/asyncLoader.d.ts +0 -9
- package/dist/esm/components/asyncLoader.js +0 -17
- package/src/components/asyncLoader.tsx +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.5.2 (2025-03-17)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/loaders@0.9.3](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/loaders/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/utils@3.8.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/utils/CHANGELOG.md)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## 0.5.1 (2025-03-04)
|
|
7
17
|
|
|
8
18
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -36,11 +36,6 @@
|
|
|
36
36
|
| onMount | `OnMount` | - | Signature: function(editor: monaco.editor.IStandaloneCodeEditor, monaco: Monaco) => void An event is emitted when the editor is mounted It gets the editor instance as a first argument and the monaco instance as a second Defaults to "noop" |
|
|
37
37
|
| onChange | `OnChange` | - | Signature: function(value: string \| undefined, ev: monaco.editor.IModelContentChangedEvent) => void An event is emitted when the content of the current model is changed |
|
|
38
38
|
| onValidate | `OnValidate` | - | Signature: function(markers: monaco.editor.IMarker[]) => void An event is emitted when the content of the current model is changed and the current model markers are ready Defaults to "noop" |
|
|
39
|
-
## asyncCodeEditor
|
|
40
|
-
### Props
|
|
41
|
-
| name | type | default value | description |
|
|
42
|
-
|------|------|---------------|-------------|
|
|
43
|
-
| configLoader* | `() => Promise<{ paths?: { vs?: string; }; 'vs/nls'?: { availableLanguages?: object; }; monaco?: typeof import("/Users/alssmirnov/p/snack-uikit/node_modules/monaco-editor/esm/vs/editor/editor.api"); }>` | - | |
|
|
44
39
|
|
|
45
40
|
|
|
46
41
|
[//]: DOCUMENTATION_SECTION_END
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.5.
|
|
7
|
+
"version": "0.5.3-preview-fa4c1732.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@monaco-editor/react": "4.6.0",
|
|
40
|
-
"@snack-uikit/loaders": "0.9.
|
|
41
|
-
"@snack-uikit/utils": "3.8.
|
|
40
|
+
"@snack-uikit/loaders": "0.9.3",
|
|
41
|
+
"@snack-uikit/utils": "3.8.1",
|
|
42
42
|
"chroma-js": "3.1.2",
|
|
43
43
|
"classnames": "2.5.1",
|
|
44
44
|
"monaco-yaml": "5.2.3"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/chroma-js": "2.4.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "00a30dbe43caf45949416597f8cb724a9562f6d7"
|
|
50
50
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { loader } from '@monaco-editor/react';
|
|
2
|
-
import { CodeEditor } from './CodeEditor';
|
|
3
|
-
type LoaderConfig = Parameters<(typeof loader)['config']>[0];
|
|
4
|
-
export declare const asyncCodeEditor: (opts: {
|
|
5
|
-
configLoader: () => Promise<LoaderConfig>;
|
|
6
|
-
}) => Promise<{
|
|
7
|
-
default: typeof CodeEditor;
|
|
8
|
-
}>;
|
|
9
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) {
|
|
5
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
6
|
-
resolve(value);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) {
|
|
11
|
-
try {
|
|
12
|
-
step(generator.next(value));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reject(e);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function rejected(value) {
|
|
18
|
-
try {
|
|
19
|
-
step(generator["throw"](value));
|
|
20
|
-
} catch (e) {
|
|
21
|
-
reject(e);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function step(result) {
|
|
25
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
-
}
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", {
|
|
31
|
-
value: true
|
|
32
|
-
});
|
|
33
|
-
exports.asyncCodeEditor = void 0;
|
|
34
|
-
const react_1 = require("@monaco-editor/react");
|
|
35
|
-
const CodeEditor_1 = require("./CodeEditor");
|
|
36
|
-
const asyncCodeEditor = opts => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
const {
|
|
38
|
-
configLoader
|
|
39
|
-
} = opts;
|
|
40
|
-
const config = yield configLoader();
|
|
41
|
-
react_1.loader.config(config);
|
|
42
|
-
return {
|
|
43
|
-
default: CodeEditor_1.CodeEditor
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
exports.asyncCodeEditor = asyncCodeEditor;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { loader } from '@monaco-editor/react';
|
|
2
|
-
import { CodeEditor } from './CodeEditor';
|
|
3
|
-
type LoaderConfig = Parameters<(typeof loader)['config']>[0];
|
|
4
|
-
export declare const asyncCodeEditor: (opts: {
|
|
5
|
-
configLoader: () => Promise<LoaderConfig>;
|
|
6
|
-
}) => Promise<{
|
|
7
|
-
default: typeof CodeEditor;
|
|
8
|
-
}>;
|
|
9
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { loader } from '@monaco-editor/react';
|
|
11
|
-
import { CodeEditor } from './CodeEditor';
|
|
12
|
-
export const asyncCodeEditor = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
13
|
-
const { configLoader } = opts;
|
|
14
|
-
const config = yield configLoader();
|
|
15
|
-
loader.config(config);
|
|
16
|
-
return { default: CodeEditor };
|
|
17
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { loader } from '@monaco-editor/react';
|
|
2
|
-
|
|
3
|
-
import { CodeEditor } from './CodeEditor';
|
|
4
|
-
|
|
5
|
-
type LoaderConfig = Parameters<(typeof loader)['config']>[0];
|
|
6
|
-
|
|
7
|
-
export const asyncCodeEditor = async (opts: { configLoader: () => Promise<LoaderConfig> }) => {
|
|
8
|
-
const { configLoader } = opts;
|
|
9
|
-
const config = await configLoader();
|
|
10
|
-
|
|
11
|
-
loader.config(config);
|
|
12
|
-
|
|
13
|
-
return { default: CodeEditor };
|
|
14
|
-
};
|