@harnessio/yaml-editor 0.13.0 → 0.14.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/components/BlameEditor.d.ts +4 -2
- package/dist/components/CodeEditor.d.ts +4 -2
- package/dist/components/DiffEditor.d.ts +3 -1
- package/dist/components/YamlEditor.d.ts +6 -2
- package/dist/components/YamlProvider.d.ts +1 -1
- package/dist/constants/monaco-common-default-options.d.ts +2 -0
- package/dist/index.js +486 -371
- package/dist/index.js.map +1 -1
- package/dist/monacoeditorwork/css.worker.bundle.js +8373 -13225
- package/dist/monacoeditorwork/editor.worker.bundle.js +1345 -3036
- package/dist/monacoeditorwork/html.worker.bundle.js +3502 -5305
- package/dist/monacoeditorwork/json.worker.bundle.js +3996 -6228
- package/dist/monacoeditorwork/ts.worker.bundle.js +48966 -122143
- package/dist/monacoeditorwork/yaml.worker.bundle.js +4067 -4184
- package/dist/utils/schema-utils.d.ts +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import { languages as
|
|
8
|
-
import {
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var pe = (e, t, n) => t in e ? fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var X = (e, t, n) => (pe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import he, { useState as L, useEffect as P, useRef as C, useMemo as T, useCallback as R, createContext as ge, useContext as be } from "react";
|
|
5
|
+
import q, { loader as F, useMonaco as z, DiffEditor as ye } from "@monaco-editor/react";
|
|
6
|
+
import * as D from "monaco-editor";
|
|
7
|
+
import { languages as Y, Uri as ve } from "monaco-editor";
|
|
8
|
+
import { yamlDefaults as Se } from "monaco-yaml";
|
|
9
|
+
var oe = { exports: {} }, A = {};
|
|
10
|
+
/*
|
|
11
|
+
object-assign
|
|
12
|
+
(c) Sindre Sorhus
|
|
13
|
+
@license MIT
|
|
14
|
+
*/
|
|
15
|
+
var ee = Object.getOwnPropertySymbols, xe = Object.prototype.hasOwnProperty, Ee = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
function Me(e) {
|
|
17
|
+
if (e == null)
|
|
18
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
19
|
+
return Object(e);
|
|
20
|
+
}
|
|
21
|
+
function Oe() {
|
|
22
|
+
try {
|
|
23
|
+
if (!Object.assign)
|
|
24
|
+
return !1;
|
|
25
|
+
var e = new String("abc");
|
|
26
|
+
if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5")
|
|
27
|
+
return !1;
|
|
28
|
+
for (var t = {}, n = 0; n < 10; n++)
|
|
29
|
+
t["_" + String.fromCharCode(n)] = n;
|
|
30
|
+
var r = Object.getOwnPropertyNames(t).map(function(o) {
|
|
31
|
+
return t[o];
|
|
32
|
+
});
|
|
33
|
+
if (r.join("") !== "0123456789")
|
|
34
|
+
return !1;
|
|
35
|
+
var a = {};
|
|
36
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(o) {
|
|
37
|
+
a[o] = o;
|
|
38
|
+
}), Object.keys(Object.assign({}, a)).join("") === "abcdefghijklmnopqrst";
|
|
39
|
+
} catch {
|
|
40
|
+
return !1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
Oe();
|
|
44
|
+
/** @license React v17.0.2
|
|
12
45
|
* react-jsx-runtime.production.min.js
|
|
13
46
|
*
|
|
14
47
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -16,98 +49,120 @@ var Y = { exports: {} }, j = {};
|
|
|
16
49
|
* This source code is licensed under the MIT license found in the
|
|
17
50
|
* LICENSE file in the root directory of this source tree.
|
|
18
51
|
*/
|
|
19
|
-
var
|
|
20
|
-
|
|
52
|
+
var Ce = he, ae = 60103;
|
|
53
|
+
A.Fragment = 60107;
|
|
54
|
+
if (typeof Symbol == "function" && Symbol.for) {
|
|
55
|
+
var te = Symbol.for;
|
|
56
|
+
ae = te("react.element"), A.Fragment = te("react.fragment");
|
|
57
|
+
}
|
|
58
|
+
var we = Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Pe = Object.prototype.hasOwnProperty, $e = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
59
|
+
function se(e, t, n) {
|
|
21
60
|
var r, a = {}, o = null, s = null;
|
|
22
|
-
n !== void 0 && (o = "" + n),
|
|
23
|
-
for (r in
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
for (r in
|
|
27
|
-
a[r] === void 0 && (a[r] =
|
|
28
|
-
return { $$typeof:
|
|
61
|
+
n !== void 0 && (o = "" + n), t.key !== void 0 && (o = "" + t.key), t.ref !== void 0 && (s = t.ref);
|
|
62
|
+
for (r in t)
|
|
63
|
+
Pe.call(t, r) && !$e.hasOwnProperty(r) && (a[r] = t[r]);
|
|
64
|
+
if (e && e.defaultProps)
|
|
65
|
+
for (r in t = e.defaultProps, t)
|
|
66
|
+
a[r] === void 0 && (a[r] = t[r]);
|
|
67
|
+
return { $$typeof: ae, type: e, key: o, ref: s, props: a, _owner: we.current };
|
|
29
68
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
69
|
+
A.jsx = se;
|
|
70
|
+
A.jsxs = se;
|
|
71
|
+
oe.exports = A;
|
|
72
|
+
var w = oe.exports;
|
|
73
|
+
const H = {
|
|
74
|
+
selectOnLineNumbers: !0,
|
|
75
|
+
scrollBeyondLastLine: !1,
|
|
76
|
+
padding: {
|
|
77
|
+
top: 16,
|
|
78
|
+
bottom: 16
|
|
79
|
+
},
|
|
80
|
+
minimap: { enabled: !1 },
|
|
81
|
+
fontSize: 14,
|
|
82
|
+
fontFamily: '"JetBrains Mono", "monospace"',
|
|
83
|
+
lineHeight: 20,
|
|
84
|
+
scrollbar: {
|
|
85
|
+
verticalScrollbarSize: 14,
|
|
86
|
+
horizontalScrollbarSize: 14,
|
|
87
|
+
verticalSliderSize: 6,
|
|
88
|
+
horizontalSliderSize: 6
|
|
89
|
+
}
|
|
90
|
+
}, B = (e) => {
|
|
91
|
+
const { themeConfig: t, editor: n, theme: r } = e, { defaultTheme: a } = t ?? {}, [o, s] = L(r ?? a ?? "vs-dark");
|
|
92
|
+
return P(() => {
|
|
93
|
+
var c;
|
|
94
|
+
(c = t == null ? void 0 : t.themes) == null || c.forEach((m) => {
|
|
95
|
+
D.editor.defineTheme(m.themeName, m.themeData);
|
|
41
96
|
});
|
|
42
|
-
}, [
|
|
43
|
-
|
|
97
|
+
}, [D]), P(() => {
|
|
98
|
+
D.editor && r && (D.editor.setTheme(r), s(r));
|
|
44
99
|
}, [n, r]), { theme: o };
|
|
45
100
|
};
|
|
46
|
-
function
|
|
47
|
-
const
|
|
101
|
+
function je(e) {
|
|
102
|
+
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
48
103
|
let n = "";
|
|
49
|
-
for (let r = 0; r <
|
|
50
|
-
n +=
|
|
104
|
+
for (let r = 0; r < e; r++)
|
|
105
|
+
n += t.charAt(Math.floor(Math.random() * t.length));
|
|
51
106
|
return n;
|
|
52
107
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
108
|
+
function Ne(e) {
|
|
109
|
+
return e.replace("'", "'");
|
|
55
110
|
}
|
|
56
|
-
function
|
|
57
|
-
instanceId:
|
|
58
|
-
lineNumbersPosition:
|
|
111
|
+
function ke({
|
|
112
|
+
instanceId: e,
|
|
113
|
+
lineNumbersPosition: t
|
|
59
114
|
}) {
|
|
60
115
|
let n = "";
|
|
61
|
-
return
|
|
62
|
-
.monaco-editor-${
|
|
116
|
+
return t === "center" && (n += `
|
|
117
|
+
.monaco-editor-${e} .monaco-scrollable-element.editor-scrollable {
|
|
63
118
|
width: 100% !important;
|
|
64
119
|
left: 0px !important;
|
|
65
120
|
}
|
|
66
121
|
|
|
67
|
-
.monaco-editor-${
|
|
122
|
+
.monaco-editor-${e} .view-lines, .view-zones {
|
|
68
123
|
width: 100% !important;
|
|
69
124
|
}
|
|
70
125
|
|
|
71
|
-
.monaco-editor-${
|
|
126
|
+
.monaco-editor-${e} .margin {
|
|
72
127
|
z-index: 1000;
|
|
73
128
|
background: transparent !important;
|
|
74
129
|
}`), n += `
|
|
75
|
-
.monaco-editor-${
|
|
130
|
+
.monaco-editor-${e} .blame-editor-separator {
|
|
76
131
|
right: 14px;
|
|
77
132
|
pointer-events: none;
|
|
78
133
|
}
|
|
79
134
|
|
|
80
|
-
.monaco-editor-${
|
|
135
|
+
.monaco-editor-${e} {
|
|
81
136
|
outline: none !important;
|
|
82
137
|
}
|
|
83
138
|
|
|
84
|
-
.monaco-editor-${
|
|
139
|
+
.monaco-editor-${e} .view-line .blame-editor-commit {
|
|
85
140
|
display: inline-block;
|
|
86
|
-
color:
|
|
141
|
+
color: var(--canary-foreground-01);
|
|
87
142
|
}`, n;
|
|
88
143
|
}
|
|
89
|
-
function
|
|
90
|
-
instanceId:
|
|
91
|
-
blameData:
|
|
144
|
+
function De({
|
|
145
|
+
instanceId: e,
|
|
146
|
+
blameData: t,
|
|
92
147
|
dateWidth: n,
|
|
93
148
|
avatarSize: r
|
|
94
149
|
}) {
|
|
95
150
|
let a = "";
|
|
96
|
-
return
|
|
97
|
-
var
|
|
98
|
-
const s = (f = (
|
|
99
|
-
for (let
|
|
100
|
-
|
|
101
|
-
.monaco-editor-${
|
|
102
|
-
content: '${
|
|
151
|
+
return t.forEach((o) => {
|
|
152
|
+
var u, f, l, p, E, i, g, b;
|
|
153
|
+
const s = (f = (u = o == null ? void 0 : o.commitInfo) == null ? void 0 : u.author) == null ? void 0 : f.avatarUrl, c = (p = (l = o == null ? void 0 : o.commitInfo) == null ? void 0 : l.author) == null ? void 0 : p.initials, m = s ? `background: url('${(i = (E = o == null ? void 0 : o.commitInfo) == null ? void 0 : E.author) == null ? void 0 : i.avatarUrl}');` : "";
|
|
154
|
+
for (let y = o.fromLineNumber; y <= o.toLineNumber; y++)
|
|
155
|
+
y === o.fromLineNumber ? a += `
|
|
156
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${y}:before {
|
|
157
|
+
content: '${Ne(((b = (g = o == null ? void 0 : o.commitInfo) == null ? void 0 : g.author) == null ? void 0 : b.when) || "")}';
|
|
103
158
|
position: absolute;
|
|
104
159
|
left: 10px;
|
|
105
160
|
top: 0px;
|
|
106
161
|
color: hsl(var(--canary-foreground-03));
|
|
107
162
|
}
|
|
108
163
|
|
|
109
|
-
.monaco-editor-${
|
|
110
|
-
content: '${
|
|
164
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${y}:after {
|
|
165
|
+
content: '${c ?? " "}';
|
|
111
166
|
position: absolute;
|
|
112
167
|
border-radius: 50%;
|
|
113
168
|
padding: 4px;
|
|
@@ -119,10 +174,10 @@ function Me({
|
|
|
119
174
|
color: hsl(var(--canary-foreground-03));
|
|
120
175
|
width: ${r}px;
|
|
121
176
|
height: ${r}px;
|
|
122
|
-
${
|
|
177
|
+
${m}
|
|
123
178
|
background-size: 100% 100%;
|
|
124
179
|
}` : a += `
|
|
125
|
-
.monaco-editor-${
|
|
180
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${y}:before {
|
|
126
181
|
content: ' ';
|
|
127
182
|
left: 10px;
|
|
128
183
|
top: 0px;
|
|
@@ -130,13 +185,13 @@ function Me({
|
|
|
130
185
|
}`;
|
|
131
186
|
}), a;
|
|
132
187
|
}
|
|
133
|
-
function
|
|
188
|
+
function Le(e, t) {
|
|
134
189
|
let n = "";
|
|
135
|
-
return
|
|
190
|
+
return e.length > t ? n = e.slice(0, t - 3) + "..." : e.length < t ? n = e + " ".repeat(t - e.length) : n = e, " ".repeat(25) + n + " ".repeat(10);
|
|
136
191
|
}
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
|
|
192
|
+
F.config({ monaco: D });
|
|
193
|
+
const W = 450, _e = 30, Te = 140, Ie = 24, Ve = {
|
|
194
|
+
...H,
|
|
140
195
|
readOnly: !0,
|
|
141
196
|
matchBrackets: "never",
|
|
142
197
|
renderValidationDecorations: "off",
|
|
@@ -144,251 +199,266 @@ const R = 450, xe = 30, Ce = 140, Pe = 24, $e = 46, Ne = {
|
|
|
144
199
|
folding: !1,
|
|
145
200
|
stickyScroll: { enabled: !1 },
|
|
146
201
|
renderWhitespace: "none",
|
|
147
|
-
renderLineHighlight: "none"
|
|
148
|
-
minimap: { enabled: !1 },
|
|
149
|
-
scrollBeyondLastLine: !1,
|
|
150
|
-
fontSize: 14,
|
|
151
|
-
fontFamily: '"JetBrains Mono", "monospace"',
|
|
152
|
-
lineHeight: 20
|
|
202
|
+
renderLineHighlight: "none"
|
|
153
203
|
};
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
u
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
204
|
+
function et({
|
|
205
|
+
code: e,
|
|
206
|
+
language: t,
|
|
207
|
+
themeConfig: n,
|
|
208
|
+
lineNumbersPosition: r = "left",
|
|
209
|
+
blameData: a,
|
|
210
|
+
showSeparators: o = !0,
|
|
211
|
+
theme: s,
|
|
212
|
+
height: c = "75vh"
|
|
213
|
+
}) {
|
|
214
|
+
const m = C(a), u = C(je(5));
|
|
215
|
+
z();
|
|
216
|
+
const [f, l] = L(), [p, E] = L(0), i = C(null), g = C(null);
|
|
217
|
+
P(() => {
|
|
218
|
+
m.current = a;
|
|
219
|
+
}, [a]);
|
|
220
|
+
function b() {
|
|
221
|
+
const O = g.current, $ = i.current;
|
|
222
|
+
if (!O || !$)
|
|
171
223
|
return;
|
|
172
|
-
|
|
224
|
+
o && O.changeViewZones(function(v) {
|
|
173
225
|
v.addZone({
|
|
174
226
|
afterLineNumber: 0,
|
|
175
227
|
heightInPx: 10,
|
|
176
228
|
domNode: document.createElement("div")
|
|
177
|
-
}),
|
|
178
|
-
if (
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
afterLineNumber:
|
|
229
|
+
}), m.current.forEach((h, d) => {
|
|
230
|
+
if (d !== m.current.length - 1) {
|
|
231
|
+
const x = document.createElement("div");
|
|
232
|
+
x.style.borderTop = "1px solid hsl(var(--canary-border-01))", x.style.marginTop = "9px", x.className = "blame-editor-separator", v.addZone({
|
|
233
|
+
afterLineNumber: h.toLineNumber,
|
|
182
234
|
heightInPx: 20,
|
|
183
|
-
domNode:
|
|
235
|
+
domNode: x
|
|
184
236
|
});
|
|
185
237
|
}
|
|
186
238
|
});
|
|
187
239
|
});
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
var
|
|
191
|
-
for (let
|
|
192
|
-
|
|
193
|
-
range: new $.Range(
|
|
240
|
+
const k = [];
|
|
241
|
+
m.current.forEach((v) => {
|
|
242
|
+
var h;
|
|
243
|
+
for (let d = v.fromLineNumber; d <= v.toLineNumber; d++)
|
|
244
|
+
k.push({
|
|
245
|
+
range: new $.Range(d, 0, d + 1, 0),
|
|
194
246
|
options: {
|
|
195
247
|
before: {
|
|
196
|
-
content:
|
|
197
|
-
|
|
198
|
-
|
|
248
|
+
content: Le(
|
|
249
|
+
d === v.fromLineNumber && ((h = v == null ? void 0 : v.commitInfo) == null ? void 0 : h.title) || "",
|
|
250
|
+
_e
|
|
199
251
|
),
|
|
200
252
|
cursorStops: $.editor.InjectedTextCursorStops.None,
|
|
201
|
-
inlineClassName: `blame-editor-commit blame-editor-commit-${
|
|
253
|
+
inlineClassName: `blame-editor-commit blame-editor-commit-${d}`
|
|
202
254
|
}
|
|
203
255
|
}
|
|
204
256
|
});
|
|
205
|
-
}),
|
|
257
|
+
}), O.createDecorationsCollection(k);
|
|
206
258
|
}
|
|
207
|
-
function
|
|
208
|
-
var
|
|
209
|
-
|
|
259
|
+
function y(O, $) {
|
|
260
|
+
var k, v, h, d, x, I;
|
|
261
|
+
g.current = O, i.current = $, O.setValue(e), l(O), (h = (v = (k = $.languages.typescript) == null ? void 0 : k.typescriptDefaults) == null ? void 0 : v.setDiagnosticsOptions) == null || h.call(v, {
|
|
262
|
+
noSuggestionDiagnostics: !0,
|
|
263
|
+
noSyntaxValidation: !0,
|
|
264
|
+
noSemanticValidation: !0
|
|
265
|
+
}), (I = (x = (d = $.languages.typescript) == null ? void 0 : d.javascriptDefaults) == null ? void 0 : x.setDiagnosticsOptions) == null || I.call(x, {
|
|
266
|
+
noSuggestionDiagnostics: !0,
|
|
267
|
+
noSyntaxValidation: !0,
|
|
268
|
+
noSemanticValidation: !0
|
|
269
|
+
}), b();
|
|
210
270
|
}
|
|
211
|
-
|
|
271
|
+
P(() => {
|
|
212
272
|
f == null || f.setValue(e);
|
|
213
273
|
}, [e]);
|
|
214
|
-
const { theme:
|
|
215
|
-
() =>
|
|
216
|
-
instanceId:
|
|
217
|
-
lineNumbersPosition:
|
|
274
|
+
const { theme: M } = B({ monacoRef: i, themeConfig: n, editor: f, theme: s }), j = T(
|
|
275
|
+
() => ke({
|
|
276
|
+
instanceId: u.current,
|
|
277
|
+
lineNumbersPosition: r
|
|
218
278
|
}),
|
|
219
|
-
[
|
|
220
|
-
),
|
|
221
|
-
() =>
|
|
222
|
-
instanceId:
|
|
223
|
-
blameData:
|
|
224
|
-
avatarSize:
|
|
225
|
-
dateWidth:
|
|
279
|
+
[a]
|
|
280
|
+
), _ = T(
|
|
281
|
+
() => De({
|
|
282
|
+
instanceId: u.current,
|
|
283
|
+
blameData: a,
|
|
284
|
+
avatarSize: Ie,
|
|
285
|
+
dateWidth: Te
|
|
226
286
|
}),
|
|
227
|
-
[
|
|
287
|
+
[a]
|
|
228
288
|
);
|
|
229
|
-
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
const $ = { attributes: !0 },
|
|
234
|
-
for (const
|
|
235
|
-
const
|
|
236
|
-
|
|
289
|
+
P(() => {
|
|
290
|
+
if (r === "center") {
|
|
291
|
+
const O = document.getElementsByClassName("lines-content")[0];
|
|
292
|
+
if (O) {
|
|
293
|
+
const $ = { attributes: !0 }, k = (h) => {
|
|
294
|
+
for (const d of h) {
|
|
295
|
+
const x = parseInt(getComputedStyle(O).left);
|
|
296
|
+
E(x);
|
|
237
297
|
}
|
|
238
|
-
}, v = new MutationObserver(
|
|
239
|
-
return v.observe(
|
|
298
|
+
}, v = new MutationObserver(k);
|
|
299
|
+
return v.observe(O, $), () => {
|
|
240
300
|
v.disconnect();
|
|
241
301
|
};
|
|
242
302
|
}
|
|
243
303
|
}
|
|
244
304
|
});
|
|
245
|
-
const
|
|
246
|
-
.monaco-editor-${
|
|
247
|
-
left: ${
|
|
305
|
+
const S = T(() => `
|
|
306
|
+
.monaco-editor-${u.current} .margin {
|
|
307
|
+
left: ${W + 16 + p}px !important;
|
|
248
308
|
pointer-events: none;
|
|
249
|
-
}`, [p]),
|
|
250
|
-
.monaco-editor-${
|
|
251
|
-
clip-path: polygon(${
|
|
309
|
+
}`, [p]), N = `
|
|
310
|
+
.monaco-editor-${u.current} .view-overlays {
|
|
311
|
+
clip-path: polygon(${W + 16}px 0, 100% 0%, 100% 100%, ${W + 16}px 100%);
|
|
252
312
|
height:100% !important;
|
|
253
313
|
}`;
|
|
254
|
-
return /* @__PURE__ */
|
|
255
|
-
/* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
315
|
+
/* @__PURE__ */ w.jsx(
|
|
256
316
|
"style",
|
|
257
317
|
{
|
|
258
318
|
dangerouslySetInnerHTML: {
|
|
259
|
-
__html: `${
|
|
319
|
+
__html: `${j} ${_} ${S} ${N}`
|
|
260
320
|
}
|
|
261
321
|
}
|
|
262
322
|
),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
|
|
323
|
+
/* @__PURE__ */ w.jsx(
|
|
324
|
+
q,
|
|
265
325
|
{
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
language:
|
|
269
|
-
theme:
|
|
270
|
-
options:
|
|
271
|
-
onMount:
|
|
326
|
+
className: `monaco-editor-${u.current} overflow-hidden rounded-b-md border-x border-b`,
|
|
327
|
+
height: c,
|
|
328
|
+
language: t,
|
|
329
|
+
theme: M,
|
|
330
|
+
options: Ve,
|
|
331
|
+
onMount: y
|
|
272
332
|
}
|
|
273
333
|
)
|
|
274
334
|
] });
|
|
275
335
|
}
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
scrollBeyondLastLine: !1,
|
|
280
|
-
padding: {
|
|
281
|
-
top: 10
|
|
282
|
-
},
|
|
283
|
-
minimap: { enabled: !1 },
|
|
284
|
-
fontSize: 14,
|
|
285
|
-
fontFamily: '"JetBrains Mono", "monospace"',
|
|
286
|
-
lineHeight: 20
|
|
336
|
+
F.config({ monaco: D });
|
|
337
|
+
const Ue = {
|
|
338
|
+
...H
|
|
287
339
|
};
|
|
288
|
-
function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
340
|
+
function tt({
|
|
341
|
+
codeRevision: e,
|
|
342
|
+
onCodeRevisionChange: t,
|
|
343
|
+
language: n,
|
|
344
|
+
themeConfig: r,
|
|
345
|
+
options: a,
|
|
346
|
+
theme: o,
|
|
347
|
+
height: s = "75vh"
|
|
348
|
+
}) {
|
|
349
|
+
z();
|
|
350
|
+
const [c, m] = L(), u = C(), f = C({ code: "", revisionId: 0 }), l = C(null), p = R(
|
|
351
|
+
(g, b) => {
|
|
352
|
+
var y, M, j, _, S, N;
|
|
353
|
+
l.current = g, u.current = b, g.setValue(e.code), m(g), (j = (M = (y = b.languages.typescript) == null ? void 0 : y.typescriptDefaults) == null ? void 0 : M.setDiagnosticsOptions) == null || j.call(M, {
|
|
354
|
+
noSuggestionDiagnostics: !0,
|
|
355
|
+
noSyntaxValidation: !0,
|
|
356
|
+
noSemanticValidation: !0
|
|
357
|
+
}), (N = (S = (_ = b.languages.typescript) == null ? void 0 : _.javascriptDefaults) == null ? void 0 : S.setDiagnosticsOptions) == null || N.call(S, {
|
|
358
|
+
noSuggestionDiagnostics: !0,
|
|
359
|
+
noSyntaxValidation: !0,
|
|
360
|
+
noSemanticValidation: !0
|
|
361
|
+
});
|
|
362
|
+
},
|
|
363
|
+
[e.code]
|
|
364
|
+
);
|
|
365
|
+
P(() => {
|
|
366
|
+
var g, b;
|
|
367
|
+
if (l.current && (!e.revisionId || e.revisionId > Number((g = f.current) == null ? void 0 : g.revisionId))) {
|
|
368
|
+
const y = l.current.getModel();
|
|
369
|
+
y && (a != null && a.readOnly ? (b = l.current) == null || b.setValue(e.code) : (l.current.pushUndoStop(), l.current.executeEdits("edit", [
|
|
300
370
|
{
|
|
301
|
-
range:
|
|
371
|
+
range: y.getFullModelRange(),
|
|
302
372
|
text: e.code
|
|
303
373
|
}
|
|
304
|
-
]),
|
|
374
|
+
]), l.current.pushUndoStop()));
|
|
305
375
|
}
|
|
306
|
-
}, [e,
|
|
307
|
-
const { theme:
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
|
|
376
|
+
}, [e, l.current]);
|
|
377
|
+
const { theme: E } = B({ monacoRef: u, themeConfig: r, editor: c, theme: o }), i = T(() => ({ ...Ue, ...a || {} }), [a]);
|
|
378
|
+
return /* @__PURE__ */ w.jsx(w.Fragment, { children: /* @__PURE__ */ w.jsx(
|
|
379
|
+
q,
|
|
310
380
|
{
|
|
311
381
|
className: "overflow-hidden rounded-b-md border-x border-b",
|
|
312
|
-
height:
|
|
313
|
-
onChange: (
|
|
314
|
-
f.current = { code:
|
|
382
|
+
height: s,
|
|
383
|
+
onChange: (g, b) => {
|
|
384
|
+
f.current = { code: g ?? "", revisionId: b.versionId }, t({ ...f.current }, b);
|
|
315
385
|
},
|
|
316
|
-
language:
|
|
317
|
-
theme:
|
|
386
|
+
language: n,
|
|
387
|
+
theme: E,
|
|
318
388
|
options: i,
|
|
319
389
|
onMount: p
|
|
320
390
|
}
|
|
321
391
|
) });
|
|
322
392
|
}
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
|
|
393
|
+
F.config({ monaco: D });
|
|
394
|
+
const Ae = {
|
|
395
|
+
...H,
|
|
326
396
|
minimap: { enabled: !1 },
|
|
327
397
|
codeLens: !1,
|
|
328
|
-
scrollBeyondLastLine: !1,
|
|
329
398
|
smartSelect: {
|
|
330
399
|
selectLeadingAndTrailingWhitespace: !0
|
|
331
400
|
},
|
|
332
401
|
originalEditable: !1,
|
|
333
|
-
overviewRulerBorder: !1
|
|
334
|
-
padding: {
|
|
335
|
-
top: 10
|
|
336
|
-
},
|
|
337
|
-
fontSize: 14,
|
|
338
|
-
fontFamily: '"JetBrains Mono", "monospace"',
|
|
339
|
-
lineHeight: 20
|
|
402
|
+
overviewRulerBorder: !1
|
|
340
403
|
};
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
404
|
+
function nt({
|
|
405
|
+
original: e,
|
|
406
|
+
modified: t,
|
|
407
|
+
language: n,
|
|
408
|
+
themeConfig: r,
|
|
409
|
+
options: a,
|
|
410
|
+
theme: o,
|
|
411
|
+
height: s = "75vh"
|
|
412
|
+
}) {
|
|
413
|
+
z();
|
|
414
|
+
const [c, m] = L(), u = C(), { theme: f } = B({ monacoRef: u, themeConfig: r, editor: c, theme: o }), l = T(() => ({ ...Ae, ...a || {} }), [a]);
|
|
415
|
+
return /* @__PURE__ */ w.jsx(w.Fragment, { children: /* @__PURE__ */ w.jsx(
|
|
416
|
+
ye,
|
|
347
417
|
{
|
|
348
418
|
className: "overflow-hidden rounded-b-md border-x border-b",
|
|
349
|
-
language:
|
|
419
|
+
language: n,
|
|
350
420
|
theme: f,
|
|
351
421
|
original: e,
|
|
352
|
-
modified:
|
|
353
|
-
height:
|
|
354
|
-
options:
|
|
355
|
-
onMount:
|
|
422
|
+
modified: t,
|
|
423
|
+
height: s,
|
|
424
|
+
options: l,
|
|
425
|
+
onMount: m
|
|
356
426
|
}
|
|
357
427
|
) });
|
|
358
428
|
}
|
|
359
|
-
var
|
|
360
|
-
function
|
|
361
|
-
const { pathSymbolMap:
|
|
429
|
+
var ie = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(ie || {});
|
|
430
|
+
function Fe(e) {
|
|
431
|
+
const { pathSymbolMap: t, inlineActions: n = [], commandId: r } = e, a = Object.fromEntries(t.entries()), o = [];
|
|
362
432
|
return n == null || n.forEach((s) => {
|
|
363
|
-
const
|
|
364
|
-
s.selectors.forEach((
|
|
365
|
-
switch (
|
|
366
|
-
case
|
|
367
|
-
|
|
433
|
+
const c = s.actions;
|
|
434
|
+
s.selectors.forEach((u) => {
|
|
435
|
+
switch (u.type) {
|
|
436
|
+
case ie.ContainsPath: {
|
|
437
|
+
u.paths.forEach((f) => {
|
|
368
438
|
let p = Object.keys(a).map((i) => ({
|
|
369
439
|
fullPath: i,
|
|
370
440
|
path: i,
|
|
371
441
|
symbol: a[i]
|
|
372
|
-
})).filter((i) => i.path.startsWith(
|
|
442
|
+
})).filter((i) => i.path.startsWith(u.basePath));
|
|
373
443
|
p = p.map((i) => ({
|
|
374
444
|
...i,
|
|
375
|
-
path: i.path.substring(
|
|
445
|
+
path: i.path.substring(u.basePath.length)
|
|
376
446
|
})), p.filter((i) => f.test(i.path)).forEach((i) => {
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
range:
|
|
381
|
-
symbols: [
|
|
382
|
-
onClick:
|
|
383
|
-
data:
|
|
384
|
-
path:
|
|
447
|
+
const g = i.fullPath, b = i.symbol, y = b.range;
|
|
448
|
+
c.forEach((M) => {
|
|
449
|
+
const j = {
|
|
450
|
+
range: y,
|
|
451
|
+
symbols: [b],
|
|
452
|
+
onClick: M.onClick,
|
|
453
|
+
data: M.data,
|
|
454
|
+
path: g
|
|
385
455
|
};
|
|
386
456
|
o.push({
|
|
387
|
-
range:
|
|
457
|
+
range: y,
|
|
388
458
|
command: {
|
|
389
459
|
id: r,
|
|
390
|
-
title:
|
|
391
|
-
arguments: [
|
|
460
|
+
title: M.title,
|
|
461
|
+
arguments: [j]
|
|
392
462
|
}
|
|
393
463
|
});
|
|
394
464
|
});
|
|
@@ -400,261 +470,306 @@ function we(t) {
|
|
|
400
470
|
});
|
|
401
471
|
}), o;
|
|
402
472
|
}
|
|
403
|
-
const
|
|
404
|
-
static set(
|
|
405
|
-
|
|
473
|
+
const U = class U {
|
|
474
|
+
static set(t) {
|
|
475
|
+
U.data = t;
|
|
406
476
|
}
|
|
407
477
|
static get() {
|
|
408
|
-
return
|
|
478
|
+
return U.data;
|
|
409
479
|
}
|
|
410
480
|
};
|
|
411
|
-
|
|
412
|
-
let
|
|
413
|
-
async function
|
|
414
|
-
const
|
|
415
|
-
return await
|
|
481
|
+
X(U, "data", {});
|
|
482
|
+
let K = U;
|
|
483
|
+
async function ce(e) {
|
|
484
|
+
const t = K.get(), { documentSymbolProvider: n } = t.StandaloneServices.get(t.ILanguageFeaturesService);
|
|
485
|
+
return await t.OutlineModel.create(n, e);
|
|
416
486
|
}
|
|
417
|
-
function
|
|
418
|
-
const
|
|
419
|
-
return
|
|
420
|
-
pathSymbolMap:
|
|
487
|
+
function le(e) {
|
|
488
|
+
const t = /* @__PURE__ */ new Map();
|
|
489
|
+
return Z({
|
|
490
|
+
pathSymbolMap: t,
|
|
421
491
|
parentPath: "",
|
|
422
|
-
children:
|
|
423
|
-
parentKind:
|
|
424
|
-
}),
|
|
492
|
+
children: e.children,
|
|
493
|
+
parentKind: Y.SymbolKind.Module
|
|
494
|
+
}), t;
|
|
425
495
|
}
|
|
426
|
-
function
|
|
427
|
-
switch (
|
|
428
|
-
case
|
|
429
|
-
|
|
496
|
+
function Z(e) {
|
|
497
|
+
switch (e.parentKind) {
|
|
498
|
+
case Y.SymbolKind.Module: {
|
|
499
|
+
ze(e);
|
|
430
500
|
break;
|
|
431
501
|
}
|
|
432
|
-
case
|
|
433
|
-
|
|
502
|
+
case Y.SymbolKind.Array: {
|
|
503
|
+
Be(e);
|
|
434
504
|
break;
|
|
435
505
|
}
|
|
436
506
|
default:
|
|
437
|
-
|
|
507
|
+
We(e);
|
|
438
508
|
}
|
|
439
509
|
}
|
|
440
|
-
function
|
|
441
|
-
|
|
510
|
+
function ze(e) {
|
|
511
|
+
e.children.forEach((t) => {
|
|
442
512
|
var r;
|
|
443
|
-
let n =
|
|
444
|
-
|
|
445
|
-
pathSymbolMap:
|
|
513
|
+
let n = e.parentPath;
|
|
514
|
+
t.symbol && (n = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(n, t.symbol)), Z({
|
|
515
|
+
pathSymbolMap: e.pathSymbolMap,
|
|
446
516
|
parentPath: n,
|
|
447
|
-
children:
|
|
448
|
-
parentKind: ((r =
|
|
517
|
+
children: t.children,
|
|
518
|
+
parentKind: ((r = t == null ? void 0 : t.symbol) == null ? void 0 : r.kind) ?? e.parentKind
|
|
449
519
|
});
|
|
450
520
|
});
|
|
451
521
|
}
|
|
452
|
-
function
|
|
453
|
-
let
|
|
454
|
-
|
|
455
|
-
const r =
|
|
456
|
-
|
|
457
|
-
pathSymbolMap:
|
|
522
|
+
function Be(e) {
|
|
523
|
+
let t = 0;
|
|
524
|
+
e.children.forEach((n) => {
|
|
525
|
+
const r = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
|
|
526
|
+
e.pathSymbolMap.set(r, n.symbol), t += 1, Z({
|
|
527
|
+
pathSymbolMap: e.pathSymbolMap,
|
|
458
528
|
parentPath: r,
|
|
459
529
|
children: n.children,
|
|
460
530
|
parentKind: n.symbol.kind
|
|
461
531
|
});
|
|
462
532
|
});
|
|
463
533
|
}
|
|
464
|
-
function
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
467
|
-
const n =
|
|
468
|
-
|
|
534
|
+
function We(e) {
|
|
535
|
+
const t = e.children.get("0");
|
|
536
|
+
if (t) {
|
|
537
|
+
const n = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
|
|
538
|
+
e.pathSymbolMap.set(n, t.symbol);
|
|
469
539
|
}
|
|
470
540
|
}
|
|
471
|
-
function
|
|
472
|
-
editorRef:
|
|
473
|
-
inlineActions:
|
|
541
|
+
function Ye({
|
|
542
|
+
editorRef: e,
|
|
543
|
+
inlineActions: t
|
|
474
544
|
}) {
|
|
475
|
-
|
|
545
|
+
P(() => D.languages.registerCodeLensProvider("yaml", {
|
|
476
546
|
provideCodeLenses: async (r) => {
|
|
477
|
-
var
|
|
478
|
-
const a = await
|
|
479
|
-
f({ path:
|
|
547
|
+
var m;
|
|
548
|
+
const a = await ce(r), o = le(a), s = (m = e == null ? void 0 : e.current) == null ? void 0 : m.addCommand(0, (u, { onClick: f, path: l, range: p, data: E }) => {
|
|
549
|
+
f({ path: l, range: p, data: E });
|
|
480
550
|
});
|
|
481
551
|
return s ? {
|
|
482
|
-
lenses:
|
|
552
|
+
lenses: Fe({ pathSymbolMap: o, inlineActions: t, commandId: s }),
|
|
483
553
|
dispose: () => {
|
|
484
554
|
}
|
|
485
555
|
} : void 0;
|
|
486
556
|
}
|
|
487
|
-
}).dispose, [
|
|
557
|
+
}).dispose, [t, e]);
|
|
488
558
|
}
|
|
489
|
-
const
|
|
490
|
-
const [n, r] =
|
|
491
|
-
() => async (o, s,
|
|
492
|
-
var p,
|
|
493
|
-
const
|
|
494
|
-
if (!
|
|
559
|
+
const Ke = ({ editorRef: e, selection: t }) => {
|
|
560
|
+
const [n, r] = L(), a = T(
|
|
561
|
+
() => async (o, s, c) => {
|
|
562
|
+
var p, E, i;
|
|
563
|
+
const m = (p = e == null ? void 0 : e.current) == null ? void 0 : p.getModel();
|
|
564
|
+
if (!m || !s)
|
|
495
565
|
return r(void 0);
|
|
496
|
-
const
|
|
497
|
-
|
|
566
|
+
const u = await ce(m), l = (E = le(u).get(s)) == null ? void 0 : E.range;
|
|
567
|
+
l && (r(l), c && ((i = e == null ? void 0 : e.current) == null || i.revealLineInCenter(l.startLineNumber)));
|
|
498
568
|
},
|
|
499
569
|
[]
|
|
500
570
|
);
|
|
501
|
-
|
|
571
|
+
P(() => {
|
|
502
572
|
if ("requestIdleCallback" in window) {
|
|
503
573
|
const o = requestIdleCallback(() => {
|
|
504
|
-
a(
|
|
574
|
+
a(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
|
|
505
575
|
});
|
|
506
576
|
return () => cancelIdleCallback(o);
|
|
507
577
|
} else {
|
|
508
578
|
const o = setTimeout(() => {
|
|
509
|
-
a(
|
|
579
|
+
a(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
|
|
510
580
|
}, 100);
|
|
511
581
|
return () => clearTimeout(o);
|
|
512
582
|
}
|
|
513
|
-
}, [
|
|
583
|
+
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, a]), P(() => {
|
|
514
584
|
var s;
|
|
515
585
|
if (!n)
|
|
516
586
|
return;
|
|
517
|
-
const o = (s =
|
|
587
|
+
const o = (s = e == null ? void 0 : e.current) == null ? void 0 : s.createDecorationsCollection([
|
|
518
588
|
{
|
|
519
589
|
// TODO: check why startColumn is set to "end of row"
|
|
520
590
|
range: { ...n, startColumn: 1 },
|
|
521
591
|
options: {
|
|
522
592
|
isWholeLine: !1,
|
|
523
|
-
className:
|
|
593
|
+
className: t == null ? void 0 : t.className
|
|
524
594
|
}
|
|
525
595
|
}
|
|
526
596
|
]);
|
|
527
597
|
return () => o == null ? void 0 : o.clear();
|
|
528
|
-
}, [n,
|
|
529
|
-
},
|
|
598
|
+
}, [n, e, t == null ? void 0 : t.className]);
|
|
599
|
+
}, ue = ge({
|
|
530
600
|
markers: [],
|
|
531
601
|
setMarkers: () => {
|
|
532
602
|
},
|
|
533
603
|
editor: null,
|
|
534
|
-
setEditor: (
|
|
604
|
+
setEditor: (e) => {
|
|
535
605
|
},
|
|
536
|
-
updateCursorPosition: (
|
|
606
|
+
updateCursorPosition: (e) => {
|
|
537
607
|
}
|
|
538
608
|
});
|
|
539
|
-
function
|
|
540
|
-
|
|
609
|
+
function rt({
|
|
610
|
+
children: e
|
|
611
|
+
}) {
|
|
612
|
+
const [t, n] = L([]), [r, a] = L(null), o = R(
|
|
541
613
|
(s) => {
|
|
542
614
|
r == null || r.setPosition(s), r == null || r.focus();
|
|
543
615
|
},
|
|
544
616
|
[r]
|
|
545
617
|
);
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
|
|
618
|
+
return /* @__PURE__ */ w.jsx(
|
|
619
|
+
ue.Provider,
|
|
548
620
|
{
|
|
549
621
|
value: {
|
|
550
|
-
markers:
|
|
622
|
+
markers: t,
|
|
551
623
|
setMarkers: n,
|
|
552
624
|
editor: r,
|
|
553
625
|
setEditor: a,
|
|
554
626
|
updateCursorPosition: o
|
|
555
627
|
},
|
|
556
|
-
children:
|
|
628
|
+
children: e
|
|
557
629
|
}
|
|
558
630
|
);
|
|
559
631
|
}
|
|
560
|
-
function
|
|
561
|
-
return
|
|
632
|
+
function de() {
|
|
633
|
+
return be(ue);
|
|
562
634
|
}
|
|
563
|
-
const
|
|
564
|
-
const { setMarkers:
|
|
565
|
-
|
|
635
|
+
const Re = ({ monacoRef: e }) => {
|
|
636
|
+
const { setMarkers: t } = de();
|
|
637
|
+
P(() => {
|
|
566
638
|
let n;
|
|
567
639
|
const r = setTimeout(() => {
|
|
568
640
|
var o;
|
|
569
|
-
const a = (o =
|
|
641
|
+
const a = (o = e.current) == null ? void 0 : o.editor;
|
|
570
642
|
a && (n = a.onDidChangeMarkers(([s]) => {
|
|
571
|
-
const
|
|
572
|
-
|
|
643
|
+
const c = a.getModelMarkers({ resource: s });
|
|
644
|
+
t(c);
|
|
573
645
|
}));
|
|
574
646
|
}, 100);
|
|
575
647
|
return () => {
|
|
576
648
|
clearTimeout(r), n == null || n.dispose();
|
|
577
649
|
};
|
|
578
|
-
}, [
|
|
650
|
+
}, [e]);
|
|
579
651
|
};
|
|
580
|
-
let
|
|
581
|
-
function
|
|
582
|
-
if (
|
|
652
|
+
let ne = !1;
|
|
653
|
+
function qe(e) {
|
|
654
|
+
if (ne)
|
|
583
655
|
return;
|
|
584
|
-
const
|
|
656
|
+
const t = {
|
|
585
657
|
hover: !0,
|
|
586
658
|
completion: !0,
|
|
587
659
|
enableSchemaRequest: !1,
|
|
588
660
|
validate: !0,
|
|
589
|
-
schemas: [
|
|
661
|
+
schemas: [e]
|
|
590
662
|
};
|
|
591
|
-
|
|
663
|
+
ne = !0, Se.setDiagnosticsOptions({ ...t });
|
|
592
664
|
}
|
|
593
|
-
const
|
|
594
|
-
const { schemaConfig:
|
|
595
|
-
|
|
596
|
-
|
|
665
|
+
const me = (e) => ve.parse(`file://${e}`).toString(), He = (e) => {
|
|
666
|
+
const { schemaConfig: t, instanceId: n } = e;
|
|
667
|
+
P(() => {
|
|
668
|
+
t != null && t.schema && qe({
|
|
597
669
|
// If YAML file is opened matching this glob
|
|
598
|
-
fileMatch: [
|
|
599
|
-
...
|
|
670
|
+
fileMatch: [me(n.toString())],
|
|
671
|
+
...t
|
|
600
672
|
});
|
|
601
|
-
}, [
|
|
673
|
+
}, [t == null ? void 0 : t.schema, n]);
|
|
602
674
|
};
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
selectOnLineNumbers: !0
|
|
606
|
-
|
|
607
|
-
|
|
675
|
+
F.config({ monaco: D });
|
|
676
|
+
const re = {
|
|
677
|
+
selectOnLineNumbers: !0,
|
|
678
|
+
minimap: {
|
|
679
|
+
enabled: !0
|
|
680
|
+
},
|
|
681
|
+
folding: !0
|
|
682
|
+
}, ot = function(t) {
|
|
608
683
|
const {
|
|
609
|
-
yamlRevision:
|
|
610
|
-
schemaConfig:
|
|
611
|
-
inlineActions:
|
|
612
|
-
themeConfig:
|
|
613
|
-
onYamlRevisionChange:
|
|
614
|
-
selection:
|
|
615
|
-
theme:
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
684
|
+
yamlRevision: n,
|
|
685
|
+
schemaConfig: r,
|
|
686
|
+
inlineActions: a,
|
|
687
|
+
themeConfig: o,
|
|
688
|
+
onYamlRevisionChange: s,
|
|
689
|
+
selection: c,
|
|
690
|
+
theme: m,
|
|
691
|
+
options: u,
|
|
692
|
+
minimap: f = !1,
|
|
693
|
+
folding: l = !0,
|
|
694
|
+
animateOnUpdate: p = !1,
|
|
695
|
+
onAnimateEnd: E
|
|
696
|
+
} = t, i = z(), [g] = L("yaml"), { editor: b, setEditor: y } = de(), M = C(null), j = C(), _ = C({ yaml: "", revisionId: 0 }), S = C(null), N = C(null), O = R(
|
|
697
|
+
(h) => {
|
|
698
|
+
var I, G, J;
|
|
699
|
+
const d = h.split(`
|
|
700
|
+
`), x = (I = S.current) == null ? void 0 : I.getModel();
|
|
701
|
+
if (x) {
|
|
702
|
+
(G = S.current) == null || G.pushUndoStop(), x.setValue("");
|
|
703
|
+
let V = 0;
|
|
704
|
+
N.current = window.setInterval(() => {
|
|
705
|
+
var Q;
|
|
706
|
+
V < d.length ? (i && ((Q = S.current) == null || Q.executeEdits("addLine", [
|
|
707
|
+
{
|
|
708
|
+
range: new i.Range(V + 1, 1, V + 1, 1),
|
|
709
|
+
text: d[V] + `
|
|
710
|
+
`
|
|
711
|
+
}
|
|
712
|
+
])), V++) : N.current && (clearInterval(N.current), E == null || E());
|
|
713
|
+
}, 100), (J = S.current) == null || J.pushUndoStop();
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
[i]
|
|
717
|
+
);
|
|
718
|
+
P(() => () => {
|
|
719
|
+
N.current && clearInterval(N.current);
|
|
720
|
+
}, []);
|
|
721
|
+
function $(h, d) {
|
|
722
|
+
S.current = h, j.current = d, h.setValue(n.yaml), y(h), setTimeout(() => {
|
|
723
|
+
var x;
|
|
724
|
+
(x = M.current) != null && x.style && (M.current.style.opacity = "1");
|
|
725
|
+
}, 50);
|
|
621
726
|
}
|
|
622
|
-
|
|
623
|
-
var
|
|
624
|
-
if (
|
|
625
|
-
const
|
|
626
|
-
|
|
727
|
+
P(() => {
|
|
728
|
+
var h;
|
|
729
|
+
if (S.current && (!n.revisionId || n.revisionId > Number((h = _.current) == null ? void 0 : h.revisionId))) {
|
|
730
|
+
const d = S.current.getModel();
|
|
731
|
+
d && (S.current.executeEdits("edit", [
|
|
627
732
|
{
|
|
628
|
-
range:
|
|
629
|
-
text:
|
|
733
|
+
range: d.getFullModelRange(),
|
|
734
|
+
text: p ? "" : n.yaml
|
|
630
735
|
}
|
|
631
|
-
]),
|
|
736
|
+
]), p && O(n.yaml));
|
|
632
737
|
}
|
|
633
|
-
}, [
|
|
634
|
-
const { theme:
|
|
635
|
-
|
|
636
|
-
|
|
738
|
+
}, [O, n, p]), He({ schemaConfig: r, instanceId: g }), Ye({ editorRef: S, inlineActions: a });
|
|
739
|
+
const { theme: k } = B({ monacoRef: j, themeConfig: o, editor: b, theme: m });
|
|
740
|
+
Re({ monacoRef: j }), Ke({ editorRef: S, selection: c });
|
|
741
|
+
const v = T(
|
|
742
|
+
() => ({
|
|
743
|
+
...re,
|
|
744
|
+
folding: l,
|
|
745
|
+
minimap: { ...re.minimap, enabled: f },
|
|
746
|
+
...u
|
|
747
|
+
}),
|
|
748
|
+
[l, f, u]
|
|
749
|
+
);
|
|
750
|
+
return /* @__PURE__ */ w.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: M, children: /* @__PURE__ */ w.jsx(
|
|
751
|
+
q,
|
|
637
752
|
{
|
|
638
|
-
onChange: (
|
|
639
|
-
|
|
753
|
+
onChange: (h, d) => {
|
|
754
|
+
_.current = { yaml: h ?? "", revisionId: d.versionId }, s({ ..._.current }, d);
|
|
640
755
|
},
|
|
641
756
|
language: "yaml",
|
|
642
|
-
theme:
|
|
643
|
-
options:
|
|
644
|
-
path:
|
|
645
|
-
onMount:
|
|
757
|
+
theme: k,
|
|
758
|
+
options: v,
|
|
759
|
+
path: me(g),
|
|
760
|
+
onMount: $
|
|
646
761
|
}
|
|
647
762
|
) });
|
|
648
|
-
}
|
|
763
|
+
};
|
|
649
764
|
export {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
765
|
+
et as BlameEditor,
|
|
766
|
+
nt as CodeDiffEditor,
|
|
767
|
+
tt as CodeEditor,
|
|
768
|
+
K as MonacoGlobals,
|
|
769
|
+
ie as SelectorType,
|
|
770
|
+
ot as YamlEditor,
|
|
771
|
+
ue as YamlEditorContext,
|
|
772
|
+
rt as YamlEditorContextProvider,
|
|
773
|
+
de as useYamlEditorContext
|
|
659
774
|
};
|
|
660
775
|
//# sourceMappingURL=index.js.map
|