@kong-ui-public/monaco-editor 0.1.2-pr.2609.2ce4f4787.0 → 0.2.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/dist/{abap-D0Neqhq6.js → abap-CrvW7_qN.js} +1 -7
- package/dist/{apex-B5LhxkeG.js → apex-BAOI8p1v.js} +4 -9
- package/dist/assets/css.worker-Cb0JI69t.js +93 -0
- package/dist/assets/editor.worker-DzMH9hFo.js +26 -0
- package/dist/assets/html.worker-BNFZMwEc.js +470 -0
- package/dist/assets/json.worker-BCybXpia.js +58 -0
- package/dist/assets/ts.worker-DAVh1bw1.js +67731 -0
- package/dist/{azcli-BrBH0QTU.js → azcli-BlCk_UqW.js} +1 -7
- package/dist/{bat-BfzAov64.js → bat-DPoEelVx.js} +1 -7
- package/dist/{bicep-C3bCSWel.js → bicep-Cp1F394l.js} +7 -13
- package/dist/{cameligo-sFL5plcd.js → cameligo-CWqtSlQs.js} +1 -7
- package/dist/{clojure-CfeExRz0.js → clojure-CKBp32Gf.js} +1 -7
- package/dist/{coffee-Xws5K0WL.js → coffee-CDo6vc-J.js} +3 -9
- package/dist/{cpp-CqOUEpxN.js → cpp-DokufPgf.js} +1 -7
- package/dist/{csharp-DVLiBOZb.js → csharp-BQi3szM0.js} +1 -7
- package/dist/{csp-DVFp9bw5.js → csp-BSGtCCZ-.js} +1 -7
- package/dist/{css-DwARn2R6.js → css-DEPFDJfb.js} +1 -7
- package/dist/cssMode-CoIMiITW.js +141 -0
- package/dist/{cypher-uY0Mffat.js → cypher-DAb1vOxS.js} +1 -7
- package/dist/{dart-D27H-mX_.js → dart-C8p4jewR.js} +1 -7
- package/dist/{dockerfile-CmV85WZK.js → dockerfile-DP0iLFPN.js} +1 -7
- package/dist/{ecl--fKn7yzB.js → ecl-BDQHA6fi.js} +1 -7
- package/dist/{elixir-DUhH17ON.js → elixir-D4II6kDM.js} +1 -7
- package/dist/{flow9-B3Dx2LLe.js → flow9-StcnL-VB.js} +1 -7
- package/dist/{freemarker2-DrnILGvf.js → freemarker2-BicaFOyj.js} +42 -55
- package/dist/{fsharp-SyqBfUAR.js → fsharp-DdUVp3EN.js} +1 -7
- package/dist/{go-BbMR2tdT.js → go-D1-I258M.js} +1 -7
- package/dist/{graphql-DDJE6tIl.js → graphql-DWkL3f8U.js} +1 -7
- package/dist/{handlebars-D2vGkdp7.js → handlebars-DDeLWwwt.js} +10 -23
- package/dist/{hcl-YBvpaUqf.js → hcl-D_0MNifv.js} +1 -7
- package/dist/{html-D3HI-WFO.js → html-BcKPVefE.js} +10 -23
- package/dist/htmlMode-BSsYu3sx.js +152 -0
- package/dist/{editor.main-BVWEsGeM.js → index-CS38iXeV.js} +115116 -98283
- package/dist/{ini-Ct73dBtM.js → ini-C4I2-MT7.js} +1 -7
- package/dist/{java-C_jlkwoG.js → java-OBvaP_SS.js} +1 -7
- package/dist/{javascript-DLZMP-Wa.js → javascript-DFhT72G7.js} +2 -8
- package/dist/jsonMode-BtUkp6V9.js +569 -0
- package/dist/{julia-D8WE5U1e.js → julia-BmDH8Kkf.js} +1 -7
- package/dist/{kotlin-Zy9aq5yB.js → kotlin-Dhu5AGOD.js} +7 -14
- package/dist/{less-sZ0iHtE8.js → less-CzmjXREq.js} +1 -7
- package/dist/{lexon-CsdNL29A.js → lexon-CV2c4pN9.js} +1 -7
- package/dist/{liquid-CnqLoV0A.js → liquid-BnR5lV1C.js} +10 -23
- package/dist/lspLanguageFeatures-B9LRR-g_.js +1458 -0
- package/dist/{lua-C2YJo0zw.js → lua-CFY5U8qF.js} +1 -7
- package/dist/{m3-CPLP40SG.js → m3-BL_AnZVh.js} +1 -7
- package/dist/{markdown-B1mf5e0R.js → markdown-CWKQPXCv.js} +1 -7
- package/dist/{mdx-C6hXTTY6.js → mdx-DKAGILxT.js} +15 -28
- package/dist/{mips-DA33BZX1.js → mips-ButYmJ5E.js} +1 -7
- package/dist/monaco-editor.es.js +3 -228
- package/dist/monaco-editor.umd.js +515 -1194
- package/dist/{msdax-CCYFIQsP.js → msdax-C3cnXqDh.js} +1 -7
- package/dist/{mysql-hjmIjL-D.js → mysql-YlSHaf6G.js} +1 -7
- package/dist/{objective-c-RRCpEmqC.js → objective-c-Dwnlproe.js} +1 -7
- package/dist/{pascal-CeV8XfxB.js → pascal-UzGbSWEN.js} +1 -7
- package/dist/{pascaligo-IEEGVJAJ.js → pascaligo-CslTgu68.js} +1 -7
- package/dist/{perl-B5-QbHq_.js → perl-oj6r_mgw.js} +1 -7
- package/dist/{pgsql-s6kqEJmi.js → pgsql-DSBO0Mev.js} +1 -7
- package/dist/{php-CWWqzOo8.js → php-YzCD--7j.js} +1 -7
- package/dist/{pla-FSvb_YP_.js → pla-CmylB8vQ.js} +1 -7
- package/dist/{postiats-DQdscQXO.js → postiats-CLFW5gNY.js} +1 -7
- package/dist/{powerquery-CtA5JA1I.js → powerquery-CmOWUvlh.js} +1 -7
- package/dist/{powershell-DglEq96N.js → powershell-fHQcmBLK.js} +1 -7
- package/dist/{protobuf-BSepub3e.js → protobuf-p5BArb-9.js} +1 -7
- package/dist/{pug-B1847F4G.js → pug-gVdUDvqf.js} +1 -7
- package/dist/{python-CGI_fE8F.js → python-DKzFUQKC.js} +6 -19
- package/dist/{qsharp-D4i0Nqg9.js → qsharp-DnrWSUlt.js} +1 -7
- package/dist/{r-cdRigKxa.js → r-Cv309K2z.js} +1 -7
- package/dist/{razor-DNVpjohl.js → razor-PaU3XDMf.js} +10 -23
- package/dist/{redis-D9MFxvE8.js → redis-DTcS4wMj.js} +1 -7
- package/dist/{redshift-CmCnsvL-.js → redshift-hLxZVESM.js} +1 -7
- package/dist/{restructuredtext-CWy8J51t.js → restructuredtext-C898lK4f.js} +1 -7
- package/dist/{ruby-WP-c36m5.js → ruby-CgKtnJIQ.js} +1 -7
- package/dist/{rust-Q9FLdYpu.js → rust-bj8oxVnh.js} +1 -7
- package/dist/{sb-C54-JBGT.js → sb-DWynz26l.js} +1 -7
- package/dist/{scala-CzbFImc5.js → scala-BL5z1UEd.js} +1 -7
- package/dist/{scheme-BhfDmYN3.js → scheme-DUJsH6VU.js} +1 -7
- package/dist/{scss-CEmiBXpS.js → scss-CxjmhvaL.js} +1 -7
- package/dist/{shell-Bmc1VhG0.js → shell-D14Zs1dF.js} +1 -7
- package/dist/{solidity-C9Q2I8Hh.js → solidity-WyRm-BGK.js} +1 -7
- package/dist/{sophia-jWa1UyKz.js → sophia-CKk-_Oa5.js} +1 -7
- package/dist/{sparql-CM7jctbc.js → sparql-DHtmINMZ.js} +1 -7
- package/dist/{sql-WzihTkbg.js → sql-Dqaj5JHC.js} +1 -7
- package/dist/{st-6y7_3aup.js → st-Bj2IIaop.js} +1 -7
- package/dist/style.css +1 -1
- package/dist/{swift-k-0zxG_D.js → swift-DwxP72iM.js} +4 -10
- package/dist/{systemverilog-Pnr5_rIP.js → systemverilog-D7wJfuql.js} +1 -7
- package/dist/{tcl-fNPXval8.js → tcl-0ApMt-eC.js} +1 -7
- package/dist/tsMode-DvEUQx0s.js +946 -0
- package/dist/{twig-L2MkztkV.js → twig-DxwbdmvQ.js} +1 -7
- package/dist/types/composables/useMonacoEditor.d.ts +2 -2
- package/dist/types/composables/useMonacoEditor.d.ts.map +1 -1
- package/dist/types/tests/mocks/monaco-editor-api.d.ts +1 -77
- package/dist/types/tests/mocks/monaco-editor-api.d.ts.map +1 -1
- package/dist/{typescript-C2FvJtQm.js → typescript-CTTN_Zo7.js} +9 -22
- package/dist/{typespec-Cqqo-3Pt.js → typespec-Fd-JwSuS.js} +5 -11
- package/dist/{vb-B5YC2xN9.js → vb-CxuyYE1I.js} +1 -7
- package/dist/{wgsl-B-_uRex7.js → wgsl-DoEGc31J.js} +2 -8
- package/dist/{xml-e_XsfZP6.js → xml-DTUwxRkW.js} +7 -20
- package/dist/{yaml-DOzdDlyx.js → yaml-DFeVkZUP.js} +6 -19
- package/package.json +8 -8
- package/dist/cssMode-BRHW0OjB.js +0 -1577
- package/dist/htmlMode-CNpiDTvN.js +0 -1587
- package/dist/jsonMode-CEQtUpLb.js +0 -2002
- package/dist/tsMode-CRUDJ1Gx.js +0 -895
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
-
*-----------------------------------------------------------------------------*/
|
|
7
|
-
var e = {
|
|
1
|
+
const e = {
|
|
8
2
|
comments: {
|
|
9
3
|
lineComment: "--",
|
|
10
4
|
blockComment: ["--[[", "]]"]
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
-
*-----------------------------------------------------------------------------*/
|
|
7
|
-
var e = {
|
|
1
|
+
const e = {
|
|
8
2
|
comments: {
|
|
9
3
|
blockComment: ["(*", "*)"]
|
|
10
4
|
},
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
-
*-----------------------------------------------------------------------------*/
|
|
7
|
-
var e = {
|
|
1
|
+
const e = {
|
|
8
2
|
comments: {
|
|
9
3
|
blockComment: ["<!--", "-->"]
|
|
10
4
|
},
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
5
|
-
* Released under the MIT license
|
|
6
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
7
|
-
*-----------------------------------------------------------------------------*/
|
|
8
|
-
var d = Object.defineProperty, c = Object.getOwnPropertyDescriptor, p = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, k = (n, e, i, r) => {
|
|
9
|
-
if (e && typeof e == "object" || typeof e == "function")
|
|
10
|
-
for (let o of p(e))
|
|
11
|
-
!a.call(n, o) && o !== i && d(n, o, { get: () => e[o], enumerable: !(r = c(e, o)) || r.enumerable });
|
|
12
|
-
return n;
|
|
13
|
-
}, l = (n, e, i) => (k(n, e, "default"), i), t = {};
|
|
14
|
-
l(t, s);
|
|
15
|
-
var m = {
|
|
1
|
+
import { l as e } from "./index-CS38iXeV.js";
|
|
2
|
+
const i = {
|
|
16
3
|
comments: {
|
|
17
4
|
blockComment: ["{/*", "*/}"]
|
|
18
5
|
},
|
|
@@ -32,38 +19,38 @@ var m = {
|
|
|
32
19
|
onEnterRules: [
|
|
33
20
|
{
|
|
34
21
|
beforeText: /^\s*- .+/,
|
|
35
|
-
action: { indentAction:
|
|
22
|
+
action: { indentAction: e.IndentAction.None, appendText: "- " }
|
|
36
23
|
},
|
|
37
24
|
{
|
|
38
25
|
beforeText: /^\s*\+ .+/,
|
|
39
|
-
action: { indentAction:
|
|
26
|
+
action: { indentAction: e.IndentAction.None, appendText: "+ " }
|
|
40
27
|
},
|
|
41
28
|
{
|
|
42
29
|
beforeText: /^\s*\* .+/,
|
|
43
|
-
action: { indentAction:
|
|
30
|
+
action: { indentAction: e.IndentAction.None, appendText: "* " }
|
|
44
31
|
},
|
|
45
32
|
{
|
|
46
33
|
beforeText: /^> /,
|
|
47
|
-
action: { indentAction:
|
|
34
|
+
action: { indentAction: e.IndentAction.None, appendText: "> " }
|
|
48
35
|
},
|
|
49
36
|
{
|
|
50
37
|
beforeText: /<\w+/,
|
|
51
|
-
action: { indentAction:
|
|
38
|
+
action: { indentAction: e.IndentAction.Indent }
|
|
52
39
|
},
|
|
53
40
|
{
|
|
54
41
|
beforeText: /\s+>\s*$/,
|
|
55
|
-
action: { indentAction:
|
|
42
|
+
action: { indentAction: e.IndentAction.Indent }
|
|
56
43
|
},
|
|
57
44
|
{
|
|
58
45
|
beforeText: /<\/\w+>/,
|
|
59
|
-
action: { indentAction:
|
|
46
|
+
action: { indentAction: e.IndentAction.Outdent }
|
|
60
47
|
},
|
|
61
|
-
...Array.from({ length: 100 }, (n,
|
|
62
|
-
beforeText: new RegExp(`^${
|
|
63
|
-
action: { indentAction:
|
|
48
|
+
...Array.from({ length: 100 }, (n, t) => ({
|
|
49
|
+
beforeText: new RegExp(`^${t}\\. .+`),
|
|
50
|
+
action: { indentAction: e.IndentAction.None, appendText: `${t + 1}. ` }
|
|
64
51
|
}))
|
|
65
52
|
]
|
|
66
|
-
},
|
|
53
|
+
}, s = {
|
|
67
54
|
defaultToken: "",
|
|
68
55
|
tokenPostfix: ".mdx",
|
|
69
56
|
control: /[!#()*+.[\\\]_`{}\-]/,
|
|
@@ -166,6 +153,6 @@ var m = {
|
|
|
166
153
|
}
|
|
167
154
|
};
|
|
168
155
|
export {
|
|
169
|
-
|
|
170
|
-
|
|
156
|
+
i as conf,
|
|
157
|
+
s as language
|
|
171
158
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
|
-
* Released under the MIT license
|
|
5
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
6
|
-
*-----------------------------------------------------------------------------*/
|
|
7
|
-
var e = {
|
|
1
|
+
const e = {
|
|
8
2
|
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
9
3
|
comments: {
|
|
10
4
|
blockComment: ["###", "###"],
|
package/dist/monaco-editor.es.js
CHANGED
|
@@ -1,230 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const L = (n, t) => {
|
|
3
|
-
const e = n.__vccOpts || n;
|
|
4
|
-
for (const [r, a] of t)
|
|
5
|
-
e[r] = a;
|
|
6
|
-
return e;
|
|
7
|
-
}, R = {}, D = { class: "kong-ui-public-monaco-editor" };
|
|
8
|
-
function P(n, t) {
|
|
9
|
-
return x(), T("div", D, [...t[0] || (t[0] = [
|
|
10
|
-
b("p", null, [
|
|
11
|
-
M("This is the "),
|
|
12
|
-
b("b", null, "MonacoEditor"),
|
|
13
|
-
M(" content.")
|
|
14
|
-
], -1)
|
|
15
|
-
])]);
|
|
16
|
-
}
|
|
17
|
-
const Y = /* @__PURE__ */ L(R, [["render", P], ["__scopeId", "data-v-21e424a6"]]), A = "'JetBrains Mono', Consolas, monospace", j = "12px", z = "500", H = "20px", K = Object.freeze({
|
|
18
|
-
autoClosingQuotes: "always",
|
|
19
|
-
automaticLayout: !0,
|
|
20
|
-
// Auto resize layout
|
|
21
|
-
bracketPairColorization: {
|
|
22
|
-
enabled: !0
|
|
23
|
-
},
|
|
24
|
-
hideCursorInOverviewRuler: !0,
|
|
25
|
-
// hide the cursor position in the minimap TODO: maybe hide it on first line or change it colour
|
|
26
|
-
fontFamily: A,
|
|
27
|
-
fontSize: Number(j.replace("px", "")),
|
|
28
|
-
fontWeight: z,
|
|
29
|
-
lineHeight: Number(H.replace("px", "")),
|
|
30
|
-
formatOnPaste: !0,
|
|
31
|
-
formatOnType: !0,
|
|
32
|
-
// Add to enable automatic formatting as the user types.
|
|
33
|
-
lineNumbersMinChars: 3,
|
|
34
|
-
minimap: {
|
|
35
|
-
enabled: !1
|
|
36
|
-
},
|
|
37
|
-
stickyScroll: {
|
|
38
|
-
enabled: !0
|
|
39
|
-
},
|
|
40
|
-
suggest: {
|
|
41
|
-
showWords: !1
|
|
42
|
-
// Prevent showing word suggestions that exist in the document
|
|
43
|
-
},
|
|
44
|
-
quickSuggestions: !0,
|
|
45
|
-
// Enable quick suggestions
|
|
46
|
-
suggestOnTriggerCharacters: !0,
|
|
47
|
-
// Allow suggestions on trigger characters
|
|
48
|
-
wordBasedSuggestions: "off",
|
|
49
|
-
overviewRulerLanes: 0,
|
|
50
|
-
renderWhitespace: "boundary",
|
|
51
|
-
scrollBeyondLastLine: !1,
|
|
52
|
-
roundedSelection: !1,
|
|
53
|
-
wordWrapColumn: 120,
|
|
54
|
-
colorDecorators: !0,
|
|
55
|
-
folding: !0,
|
|
56
|
-
// Enable code folding for MDC block components
|
|
57
|
-
fixedOverflowWidgets: !0,
|
|
58
|
-
// Ensure suggestion widgets can overflow container
|
|
59
|
-
tabSize: 2,
|
|
60
|
-
detectIndentation: !1,
|
|
61
|
-
// Important as to not override tabSize
|
|
62
|
-
insertSpaces: !0,
|
|
63
|
-
// Since the formatter utilizes spaces, we set to true to insert spaces when pressing Tab
|
|
64
|
-
trimAutoWhitespace: !0,
|
|
65
|
-
wordWrap: "bounded",
|
|
66
|
-
find: {
|
|
67
|
-
addExtraSpaceOnTop: !1
|
|
68
|
-
// we need this set to false to get the correct absolute position, otherwise when the search box opens the content shifts
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
72
|
-
const O = () => {
|
|
73
|
-
};
|
|
74
|
-
function V(n, t) {
|
|
75
|
-
function e(...r) {
|
|
76
|
-
return new Promise((a, c) => {
|
|
77
|
-
Promise.resolve(n(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(a).catch(c);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return e;
|
|
81
|
-
}
|
|
82
|
-
function G(n, t = {}) {
|
|
83
|
-
let e, r, a = O;
|
|
84
|
-
const c = (i) => {
|
|
85
|
-
clearTimeout(i), a(), a = O;
|
|
86
|
-
};
|
|
87
|
-
let g;
|
|
88
|
-
return (i) => {
|
|
89
|
-
const h = _(n), s = _(t.maxWait);
|
|
90
|
-
return e && c(e), h <= 0 || s !== void 0 && s <= 0 ? (r && (c(r), r = void 0), Promise.resolve(i())) : new Promise((p, o) => {
|
|
91
|
-
a = t.rejectOnCancel ? o : p, g = i, s && !r && (r = setTimeout(() => {
|
|
92
|
-
e && c(e), r = void 0, p(g());
|
|
93
|
-
}, s)), e = setTimeout(() => {
|
|
94
|
-
r && c(r), r = void 0, p(i());
|
|
95
|
-
}, h);
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function $(n, t = 200, e = {}) {
|
|
100
|
-
return V(
|
|
101
|
-
G(t, e),
|
|
102
|
-
n
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
function q(n) {
|
|
106
|
-
var t;
|
|
107
|
-
const e = _(n);
|
|
108
|
-
return (t = e == null ? void 0 : e.$el) != null ? t : e;
|
|
109
|
-
}
|
|
110
|
-
class m {
|
|
111
|
-
constructor() {
|
|
112
|
-
}
|
|
113
|
-
postMessage() {
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
let u, v = null;
|
|
117
|
-
const E = /* @__PURE__ */ new Map();
|
|
118
|
-
async function J(n) {
|
|
119
|
-
return u ? (n && u.languages.register({ id: n }), u) : (v && n && E.get(n) || (v = (async () => {
|
|
120
|
-
E.set(n || "plaintext", !0);
|
|
121
|
-
const t = await import("./editor.main-BVWEsGeM.js").then((e) => e.e);
|
|
122
|
-
return (!("MonacoEnvironment" in window) || !window.MonacoEnvironment) && (window.MonacoEnvironment = {
|
|
123
|
-
getWorker(e, r) {
|
|
124
|
-
switch (r) {
|
|
125
|
-
case "json":
|
|
126
|
-
return new m();
|
|
127
|
-
case "css":
|
|
128
|
-
case "scss":
|
|
129
|
-
case "less":
|
|
130
|
-
return new m();
|
|
131
|
-
case "html":
|
|
132
|
-
case "handlebars":
|
|
133
|
-
case "razor":
|
|
134
|
-
return new m();
|
|
135
|
-
case "typescript":
|
|
136
|
-
case "javascript":
|
|
137
|
-
return new m();
|
|
138
|
-
default:
|
|
139
|
-
return new m();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}), n && !t.languages.getLanguages().some((e) => e.id === n) && t.languages.register({ id: n }), u = t, t;
|
|
143
|
-
})()), v);
|
|
144
|
-
}
|
|
145
|
-
function Z(n, t) {
|
|
146
|
-
let e;
|
|
147
|
-
const r = F({
|
|
148
|
-
editorStatus: "loading",
|
|
149
|
-
searchBoxIsRevealed: !1,
|
|
150
|
-
hasContent: !1,
|
|
151
|
-
theme: t.theme || "light"
|
|
152
|
-
}), a = W(!1), c = (o) => {
|
|
153
|
-
!a.value || !e || e.setValue(o);
|
|
154
|
-
}, g = (o) => e == null ? void 0 : e.updateOptions({ readOnly: o }), C = () => e == null ? void 0 : e.focus(), i = (o) => {
|
|
155
|
-
try {
|
|
156
|
-
if (!e || !o) return;
|
|
157
|
-
e.focus(), e.trigger("keyboard", o, null);
|
|
158
|
-
} catch (d) {
|
|
159
|
-
console.error(`useMonacoEditor: Failed to trigger command: ${o}`, d);
|
|
160
|
-
}
|
|
161
|
-
}, h = () => {
|
|
162
|
-
var o;
|
|
163
|
-
try {
|
|
164
|
-
if (!e) return;
|
|
165
|
-
if (r.searchBoxIsRevealed)
|
|
166
|
-
return (o = e.getContribution("editor.contrib.findController")) == null ? void 0 : o.closeFindWidget();
|
|
167
|
-
i("actions.find");
|
|
168
|
-
} catch (d) {
|
|
169
|
-
console.error("useMonacoEditor: Failed to close findController.", d);
|
|
170
|
-
}
|
|
171
|
-
}, s = $(() => u == null ? void 0 : u.editor.remeasureFonts(), 200);
|
|
172
|
-
return (async () => {
|
|
173
|
-
const o = await J(t.language), d = o.Uri.parse(`inmemory://model/${t.language}-${crypto.randomUUID()}`), S = o.editor.createModel(t.code.value, t.language, d);
|
|
174
|
-
B(() => _(n), async (I) => {
|
|
175
|
-
var y;
|
|
176
|
-
const w = q(I);
|
|
177
|
-
if (!(w instanceof HTMLElement)) {
|
|
178
|
-
a.value = !1;
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (!a.value) {
|
|
182
|
-
e = o.editor.create(w, {
|
|
183
|
-
...K,
|
|
184
|
-
readOnly: t.readOnly || !1,
|
|
185
|
-
language: t.language,
|
|
186
|
-
theme: r.theme,
|
|
187
|
-
model: S,
|
|
188
|
-
...t.monacoOptions
|
|
189
|
-
}), a.value = !0, r.editorStatus = "ready", r.hasContent = !!t.code.value, e.onDidChangeModelContent(() => {
|
|
190
|
-
var f;
|
|
191
|
-
const l = e.getValue();
|
|
192
|
-
r.hasContent = !!l.length, (f = t.onChanged) == null || f.call(t, l);
|
|
193
|
-
}), (y = t.onCreated) == null || y.call(t), s();
|
|
194
|
-
try {
|
|
195
|
-
const l = e.getContribution("editor.contrib.findController");
|
|
196
|
-
if (l) {
|
|
197
|
-
const f = l.getState();
|
|
198
|
-
f.onFindReplaceStateChange(() => {
|
|
199
|
-
r.searchBoxIsRevealed = f.isRevealed;
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
} catch (l) {
|
|
203
|
-
console.error("useMonacoEditor: Failed to get the state of findController", l);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
immediate: !0,
|
|
208
|
-
flush: "post"
|
|
209
|
-
});
|
|
210
|
-
})(), k(() => {
|
|
211
|
-
s();
|
|
212
|
-
}), N(s), U(() => {
|
|
213
|
-
if (!e) return;
|
|
214
|
-
const o = e.getModel();
|
|
215
|
-
e.dispose(), o && o.dispose();
|
|
216
|
-
}), {
|
|
217
|
-
editor: e,
|
|
218
|
-
editorStates: r,
|
|
219
|
-
setContent: c,
|
|
220
|
-
setReadOnly: g,
|
|
221
|
-
focus: C,
|
|
222
|
-
remeasureFonts: s,
|
|
223
|
-
toggleSearchWidget: h,
|
|
224
|
-
triggerKeyboardCommand: i
|
|
225
|
-
};
|
|
226
|
-
}
|
|
1
|
+
import { b as r, u as s } from "./index-CS38iXeV.js";
|
|
227
2
|
export {
|
|
228
|
-
|
|
229
|
-
|
|
3
|
+
r as MonacoEditor,
|
|
4
|
+
s as useMonacoEditor
|
|
230
5
|
};
|