@harnessio/yaml-editor 0.17.0 → 0.18.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/index.cjs +89 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +987 -428
- package/dist/index.js.map +1 -1
- package/package.json +9 -2
package/dist/index.js
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
var te = { exports: {} }, A = {};
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var Ze = (e, t, r) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Se = (e, t, r) => (Ze(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import W, { memo as ye, useState as A, useRef as y, useCallback as G, useEffect as $, useMemo as q, createContext as Ge, useContext as Je } from "react";
|
|
5
|
+
import * as F from "monaco-editor";
|
|
6
|
+
import { languages as he, Uri as Qe } from "monaco-editor";
|
|
7
|
+
import { yamlDefaults as Xe } from "monaco-yaml";
|
|
8
|
+
var Ne = { exports: {} }, ne = {};
|
|
10
9
|
/*
|
|
11
10
|
object-assign
|
|
12
11
|
(c) Sindre Sorhus
|
|
13
12
|
@license MIT
|
|
14
13
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
14
|
+
var Me = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
function rt(e) {
|
|
17
16
|
if (e == null)
|
|
18
17
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
19
18
|
return Object(e);
|
|
20
19
|
}
|
|
21
|
-
function
|
|
20
|
+
function nt() {
|
|
22
21
|
try {
|
|
23
22
|
if (!Object.assign)
|
|
24
23
|
return !1;
|
|
25
24
|
var e = new String("abc");
|
|
26
25
|
if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5")
|
|
27
26
|
return !1;
|
|
28
|
-
for (var t = {},
|
|
29
|
-
t["_" + String.fromCharCode(
|
|
30
|
-
var
|
|
31
|
-
return t[
|
|
27
|
+
for (var t = {}, r = 0; r < 10; r++)
|
|
28
|
+
t["_" + String.fromCharCode(r)] = r;
|
|
29
|
+
var n = Object.getOwnPropertyNames(t).map(function(a) {
|
|
30
|
+
return t[a];
|
|
32
31
|
});
|
|
33
|
-
if (
|
|
32
|
+
if (n.join("") !== "0123456789")
|
|
34
33
|
return !1;
|
|
35
|
-
var
|
|
36
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(
|
|
37
|
-
a
|
|
38
|
-
}), Object.keys(Object.assign({},
|
|
34
|
+
var o = {};
|
|
35
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(a) {
|
|
36
|
+
o[a] = a;
|
|
37
|
+
}), Object.keys(Object.assign({}, o)).join("") === "abcdefghijklmnopqrst";
|
|
39
38
|
} catch {
|
|
40
39
|
return !1;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
|
|
42
|
+
nt();
|
|
44
43
|
/** @license React v17.0.2
|
|
45
44
|
* react-jsx-runtime.production.min.js
|
|
46
45
|
*
|
|
@@ -49,28 +48,588 @@ xe();
|
|
|
49
48
|
* This source code is licensed under the MIT license found in the
|
|
50
49
|
* LICENSE file in the root directory of this source tree.
|
|
51
50
|
*/
|
|
52
|
-
var
|
|
53
|
-
|
|
51
|
+
var ot = W, De = 60103;
|
|
52
|
+
ne.Fragment = 60107;
|
|
54
53
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
for (
|
|
63
|
-
|
|
54
|
+
var je = Symbol.for;
|
|
55
|
+
De = je("react.element"), ne.Fragment = je("react.fragment");
|
|
56
|
+
}
|
|
57
|
+
var at = ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, it = Object.prototype.hasOwnProperty, ct = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
58
|
+
function Te(e, t, r) {
|
|
59
|
+
var n, o = {}, a = null, i = null;
|
|
60
|
+
r !== void 0 && (a = "" + r), t.key !== void 0 && (a = "" + t.key), t.ref !== void 0 && (i = t.ref);
|
|
61
|
+
for (n in t)
|
|
62
|
+
it.call(t, n) && !ct.hasOwnProperty(n) && (o[n] = t[n]);
|
|
64
63
|
if (e && e.defaultProps)
|
|
65
|
-
for (
|
|
66
|
-
|
|
67
|
-
return { $$typeof:
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var
|
|
73
|
-
|
|
64
|
+
for (n in t = e.defaultProps, t)
|
|
65
|
+
o[n] === void 0 && (o[n] = t[n]);
|
|
66
|
+
return { $$typeof: De, type: e, key: a, ref: i, props: o, _owner: at.current };
|
|
67
|
+
}
|
|
68
|
+
ne.jsx = Te;
|
|
69
|
+
ne.jsxs = Te;
|
|
70
|
+
Ne.exports = ne;
|
|
71
|
+
var U = Ne.exports;
|
|
72
|
+
function ut(e, t, r) {
|
|
73
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
74
|
+
value: r,
|
|
75
|
+
enumerable: !0,
|
|
76
|
+
configurable: !0,
|
|
77
|
+
writable: !0
|
|
78
|
+
}) : e[t] = r, e;
|
|
79
|
+
}
|
|
80
|
+
function Ee(e, t) {
|
|
81
|
+
var r = Object.keys(e);
|
|
82
|
+
if (Object.getOwnPropertySymbols) {
|
|
83
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
84
|
+
t && (n = n.filter(function(o) {
|
|
85
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
86
|
+
})), r.push.apply(r, n);
|
|
87
|
+
}
|
|
88
|
+
return r;
|
|
89
|
+
}
|
|
90
|
+
function Pe(e) {
|
|
91
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
92
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
93
|
+
t % 2 ? Ee(Object(r), !0).forEach(function(n) {
|
|
94
|
+
ut(e, n, r[n]);
|
|
95
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach(function(n) {
|
|
96
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return e;
|
|
100
|
+
}
|
|
101
|
+
function st(e, t) {
|
|
102
|
+
if (e == null)
|
|
103
|
+
return {};
|
|
104
|
+
var r = {}, n = Object.keys(e), o, a;
|
|
105
|
+
for (a = 0; a < n.length; a++)
|
|
106
|
+
o = n[a], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
|
|
107
|
+
return r;
|
|
108
|
+
}
|
|
109
|
+
function lt(e, t) {
|
|
110
|
+
if (e == null)
|
|
111
|
+
return {};
|
|
112
|
+
var r = st(e, t), n, o;
|
|
113
|
+
if (Object.getOwnPropertySymbols) {
|
|
114
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
115
|
+
for (o = 0; o < a.length; o++)
|
|
116
|
+
n = a[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
117
|
+
}
|
|
118
|
+
return r;
|
|
119
|
+
}
|
|
120
|
+
function dt(e, t) {
|
|
121
|
+
return ft(e) || pt(e, t) || gt(e, t) || mt();
|
|
122
|
+
}
|
|
123
|
+
function ft(e) {
|
|
124
|
+
if (Array.isArray(e))
|
|
125
|
+
return e;
|
|
126
|
+
}
|
|
127
|
+
function pt(e, t) {
|
|
128
|
+
if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
|
|
129
|
+
var r = [], n = !0, o = !1, a = void 0;
|
|
130
|
+
try {
|
|
131
|
+
for (var i = e[Symbol.iterator](), s; !(n = (s = i.next()).done) && (r.push(s.value), !(t && r.length === t)); n = !0)
|
|
132
|
+
;
|
|
133
|
+
} catch (l) {
|
|
134
|
+
o = !0, a = l;
|
|
135
|
+
} finally {
|
|
136
|
+
try {
|
|
137
|
+
!n && i.return != null && i.return();
|
|
138
|
+
} finally {
|
|
139
|
+
if (o)
|
|
140
|
+
throw a;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return r;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function gt(e, t) {
|
|
147
|
+
if (e) {
|
|
148
|
+
if (typeof e == "string")
|
|
149
|
+
return Ce(e, t);
|
|
150
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
151
|
+
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set")
|
|
152
|
+
return Array.from(e);
|
|
153
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
|
|
154
|
+
return Ce(e, t);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function Ce(e, t) {
|
|
158
|
+
(t == null || t > e.length) && (t = e.length);
|
|
159
|
+
for (var r = 0, n = new Array(t); r < t; r++)
|
|
160
|
+
n[r] = e[r];
|
|
161
|
+
return n;
|
|
162
|
+
}
|
|
163
|
+
function mt() {
|
|
164
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
165
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
166
|
+
}
|
|
167
|
+
function ht(e, t, r) {
|
|
168
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
169
|
+
value: r,
|
|
170
|
+
enumerable: !0,
|
|
171
|
+
configurable: !0,
|
|
172
|
+
writable: !0
|
|
173
|
+
}) : e[t] = r, e;
|
|
174
|
+
}
|
|
175
|
+
function xe(e, t) {
|
|
176
|
+
var r = Object.keys(e);
|
|
177
|
+
if (Object.getOwnPropertySymbols) {
|
|
178
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
179
|
+
t && (n = n.filter(function(o) {
|
|
180
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
181
|
+
})), r.push.apply(r, n);
|
|
182
|
+
}
|
|
183
|
+
return r;
|
|
184
|
+
}
|
|
185
|
+
function $e(e) {
|
|
186
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
187
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
188
|
+
t % 2 ? xe(Object(r), !0).forEach(function(n) {
|
|
189
|
+
ht(e, n, r[n]);
|
|
190
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
|
|
191
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return e;
|
|
195
|
+
}
|
|
196
|
+
function vt() {
|
|
197
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
198
|
+
t[r] = arguments[r];
|
|
199
|
+
return function(n) {
|
|
200
|
+
return t.reduceRight(function(o, a) {
|
|
201
|
+
return a(o);
|
|
202
|
+
}, n);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function X(e) {
|
|
206
|
+
return function t() {
|
|
207
|
+
for (var r = this, n = arguments.length, o = new Array(n), a = 0; a < n; a++)
|
|
208
|
+
o[a] = arguments[a];
|
|
209
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
210
|
+
for (var i = arguments.length, s = new Array(i), l = 0; l < i; l++)
|
|
211
|
+
s[l] = arguments[l];
|
|
212
|
+
return t.apply(r, [].concat(o, s));
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function ce(e) {
|
|
217
|
+
return {}.toString.call(e).includes("Object");
|
|
218
|
+
}
|
|
219
|
+
function yt(e) {
|
|
220
|
+
return !Object.keys(e).length;
|
|
221
|
+
}
|
|
222
|
+
function re(e) {
|
|
223
|
+
return typeof e == "function";
|
|
224
|
+
}
|
|
225
|
+
function bt(e, t) {
|
|
226
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
227
|
+
}
|
|
228
|
+
function wt(e, t) {
|
|
229
|
+
return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
|
|
230
|
+
return !bt(e, r);
|
|
231
|
+
}) && B("changeField"), t;
|
|
232
|
+
}
|
|
233
|
+
function Ot(e) {
|
|
234
|
+
re(e) || B("selectorType");
|
|
235
|
+
}
|
|
236
|
+
function St(e) {
|
|
237
|
+
re(e) || ce(e) || B("handlerType"), ce(e) && Object.values(e).some(function(t) {
|
|
238
|
+
return !re(t);
|
|
239
|
+
}) && B("handlersType");
|
|
240
|
+
}
|
|
241
|
+
function Mt(e) {
|
|
242
|
+
e || B("initialIsRequired"), ce(e) || B("initialType"), yt(e) && B("initialContent");
|
|
243
|
+
}
|
|
244
|
+
function jt(e, t) {
|
|
245
|
+
throw new Error(e[t] || e.default);
|
|
246
|
+
}
|
|
247
|
+
var Et = {
|
|
248
|
+
initialIsRequired: "initial state is required",
|
|
249
|
+
initialType: "initial state should be an object",
|
|
250
|
+
initialContent: "initial state shouldn't be an empty object",
|
|
251
|
+
handlerType: "handler should be an object or a function",
|
|
252
|
+
handlersType: "all handlers should be a functions",
|
|
253
|
+
selectorType: "selector should be a function",
|
|
254
|
+
changeType: "provided value of changes should be an object",
|
|
255
|
+
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
256
|
+
default: "an unknown error accured in `state-local` package"
|
|
257
|
+
}, B = X(jt)(Et), ae = {
|
|
258
|
+
changes: wt,
|
|
259
|
+
selector: Ot,
|
|
260
|
+
handler: St,
|
|
261
|
+
initial: Mt
|
|
262
|
+
};
|
|
263
|
+
function Pt(e) {
|
|
264
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
265
|
+
ae.initial(e), ae.handler(t);
|
|
266
|
+
var r = {
|
|
267
|
+
current: e
|
|
268
|
+
}, n = X($t)(r, t), o = X(xt)(r), a = X(ae.changes)(e), i = X(Ct)(r);
|
|
269
|
+
function s() {
|
|
270
|
+
var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(b) {
|
|
271
|
+
return b;
|
|
272
|
+
};
|
|
273
|
+
return ae.selector(f), f(r.current);
|
|
274
|
+
}
|
|
275
|
+
function l(f) {
|
|
276
|
+
vt(n, o, a, i)(f);
|
|
277
|
+
}
|
|
278
|
+
return [s, l];
|
|
279
|
+
}
|
|
280
|
+
function Ct(e, t) {
|
|
281
|
+
return re(t) ? t(e.current) : t;
|
|
282
|
+
}
|
|
283
|
+
function xt(e, t) {
|
|
284
|
+
return e.current = $e($e({}, e.current), t), t;
|
|
285
|
+
}
|
|
286
|
+
function $t(e, t, r) {
|
|
287
|
+
return re(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
288
|
+
var o;
|
|
289
|
+
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
290
|
+
}), r;
|
|
291
|
+
}
|
|
292
|
+
var Lt = {
|
|
293
|
+
create: Pt
|
|
294
|
+
}, It = {
|
|
295
|
+
paths: {
|
|
296
|
+
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
function Nt(e) {
|
|
300
|
+
return function t() {
|
|
301
|
+
for (var r = this, n = arguments.length, o = new Array(n), a = 0; a < n; a++)
|
|
302
|
+
o[a] = arguments[a];
|
|
303
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
304
|
+
for (var i = arguments.length, s = new Array(i), l = 0; l < i; l++)
|
|
305
|
+
s[l] = arguments[l];
|
|
306
|
+
return t.apply(r, [].concat(o, s));
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function Dt(e) {
|
|
311
|
+
return {}.toString.call(e).includes("Object");
|
|
312
|
+
}
|
|
313
|
+
function Tt(e) {
|
|
314
|
+
return e || Le("configIsRequired"), Dt(e) || Le("configType"), e.urls ? (kt(), {
|
|
315
|
+
paths: {
|
|
316
|
+
vs: e.urls.monacoBase
|
|
317
|
+
}
|
|
318
|
+
}) : e;
|
|
319
|
+
}
|
|
320
|
+
function kt() {
|
|
321
|
+
console.warn(ke.deprecation);
|
|
322
|
+
}
|
|
323
|
+
function At(e, t) {
|
|
324
|
+
throw new Error(e[t] || e.default);
|
|
325
|
+
}
|
|
326
|
+
var ke = {
|
|
327
|
+
configIsRequired: "the configuration object is required",
|
|
328
|
+
configType: "the configuration object should be an object",
|
|
329
|
+
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
330
|
+
deprecation: `Deprecation warning!
|
|
331
|
+
You are using deprecated way of configuration.
|
|
332
|
+
|
|
333
|
+
Instead of using
|
|
334
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
335
|
+
use
|
|
336
|
+
monaco.config({ paths: { vs: '...' } })
|
|
337
|
+
|
|
338
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
339
|
+
`
|
|
340
|
+
}, Le = Nt(At)(ke), Vt = {
|
|
341
|
+
config: Tt
|
|
342
|
+
}, _t = function() {
|
|
343
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
344
|
+
r[n] = arguments[n];
|
|
345
|
+
return function(o) {
|
|
346
|
+
return r.reduceRight(function(a, i) {
|
|
347
|
+
return i(a);
|
|
348
|
+
}, o);
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
function Ae(e, t) {
|
|
352
|
+
return Object.keys(t).forEach(function(r) {
|
|
353
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], Ae(e[r], t[r]));
|
|
354
|
+
}), Pe(Pe({}, e), t);
|
|
355
|
+
}
|
|
356
|
+
var Ut = {
|
|
357
|
+
type: "cancelation",
|
|
358
|
+
msg: "operation is manually canceled"
|
|
359
|
+
};
|
|
360
|
+
function fe(e) {
|
|
361
|
+
var t = !1, r = new Promise(function(n, o) {
|
|
362
|
+
e.then(function(a) {
|
|
363
|
+
return t ? o(Ut) : n(a);
|
|
364
|
+
}), e.catch(o);
|
|
365
|
+
});
|
|
366
|
+
return r.cancel = function() {
|
|
367
|
+
return t = !0;
|
|
368
|
+
}, r;
|
|
369
|
+
}
|
|
370
|
+
var zt = Lt.create({
|
|
371
|
+
config: It,
|
|
372
|
+
isInitialized: !1,
|
|
373
|
+
resolve: null,
|
|
374
|
+
reject: null,
|
|
375
|
+
monaco: null
|
|
376
|
+
}), Ve = dt(zt, 2), oe = Ve[0], ue = Ve[1];
|
|
377
|
+
function Ft(e) {
|
|
378
|
+
var t = Vt.config(e), r = t.monaco, n = lt(t, ["monaco"]);
|
|
379
|
+
ue(function(o) {
|
|
380
|
+
return {
|
|
381
|
+
config: Ae(o.config, n),
|
|
382
|
+
monaco: r
|
|
383
|
+
};
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
function Rt() {
|
|
387
|
+
var e = oe(function(t) {
|
|
388
|
+
var r = t.monaco, n = t.isInitialized, o = t.resolve;
|
|
389
|
+
return {
|
|
390
|
+
monaco: r,
|
|
391
|
+
isInitialized: n,
|
|
392
|
+
resolve: o
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
if (!e.isInitialized) {
|
|
396
|
+
if (ue({
|
|
397
|
+
isInitialized: !0
|
|
398
|
+
}), e.monaco)
|
|
399
|
+
return e.resolve(e.monaco), fe(pe);
|
|
400
|
+
if (window.monaco && window.monaco.editor)
|
|
401
|
+
return _e(window.monaco), e.resolve(window.monaco), fe(pe);
|
|
402
|
+
_t(qt, Ht)(Wt);
|
|
403
|
+
}
|
|
404
|
+
return fe(pe);
|
|
405
|
+
}
|
|
406
|
+
function qt(e) {
|
|
407
|
+
return document.body.appendChild(e);
|
|
408
|
+
}
|
|
409
|
+
function Bt(e) {
|
|
410
|
+
var t = document.createElement("script");
|
|
411
|
+
return e && (t.src = e), t;
|
|
412
|
+
}
|
|
413
|
+
function Ht(e) {
|
|
414
|
+
var t = oe(function(n) {
|
|
415
|
+
var o = n.config, a = n.reject;
|
|
416
|
+
return {
|
|
417
|
+
config: o,
|
|
418
|
+
reject: a
|
|
419
|
+
};
|
|
420
|
+
}), r = Bt("".concat(t.config.paths.vs, "/loader.js"));
|
|
421
|
+
return r.onload = function() {
|
|
422
|
+
return e();
|
|
423
|
+
}, r.onerror = t.reject, r;
|
|
424
|
+
}
|
|
425
|
+
function Wt() {
|
|
426
|
+
var e = oe(function(r) {
|
|
427
|
+
var n = r.config, o = r.resolve, a = r.reject;
|
|
428
|
+
return {
|
|
429
|
+
config: n,
|
|
430
|
+
resolve: o,
|
|
431
|
+
reject: a
|
|
432
|
+
};
|
|
433
|
+
}), t = window.require;
|
|
434
|
+
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
435
|
+
_e(r), e.resolve(r);
|
|
436
|
+
}, function(r) {
|
|
437
|
+
e.reject(r);
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function _e(e) {
|
|
441
|
+
oe().monaco || ue({
|
|
442
|
+
monaco: e
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function Kt() {
|
|
446
|
+
return oe(function(e) {
|
|
447
|
+
var t = e.monaco;
|
|
448
|
+
return t;
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
var pe = new Promise(function(e, t) {
|
|
452
|
+
return ue({
|
|
453
|
+
resolve: e,
|
|
454
|
+
reject: t
|
|
455
|
+
});
|
|
456
|
+
}), H = {
|
|
457
|
+
config: Ft,
|
|
458
|
+
init: Rt,
|
|
459
|
+
__getMonacoInstance: Kt
|
|
460
|
+
}, Yt = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, ge = Yt, Zt = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Gt = Zt;
|
|
461
|
+
function Jt({ children: e }) {
|
|
462
|
+
return W.createElement("div", { style: Gt.container }, e);
|
|
463
|
+
}
|
|
464
|
+
var Qt = Jt, Xt = Qt;
|
|
465
|
+
function er({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: a, wrapperProps: i }) {
|
|
466
|
+
return W.createElement("section", { style: { ...ge.wrapper, width: e, height: t }, ...i }, !r && W.createElement(Xt, null, n), W.createElement("div", { ref: o, style: { ...ge.fullWidth, ...!r && ge.hide }, className: a }));
|
|
467
|
+
}
|
|
468
|
+
var tr = er, Ue = ye(tr);
|
|
469
|
+
function rr(e) {
|
|
470
|
+
$(e, []);
|
|
471
|
+
}
|
|
472
|
+
var be = rr;
|
|
473
|
+
function nr(e, t, r = !0) {
|
|
474
|
+
let n = y(!0);
|
|
475
|
+
$(n.current || !r ? () => {
|
|
476
|
+
n.current = !1;
|
|
477
|
+
} : e, t);
|
|
478
|
+
}
|
|
479
|
+
var _ = nr;
|
|
480
|
+
function ee() {
|
|
481
|
+
}
|
|
482
|
+
function Z(e, t, r, n) {
|
|
483
|
+
return or(e, n) || ar(e, t, r, n);
|
|
484
|
+
}
|
|
485
|
+
function or(e, t) {
|
|
486
|
+
return e.editor.getModel(ze(e, t));
|
|
487
|
+
}
|
|
488
|
+
function ar(e, t, r, n) {
|
|
489
|
+
return e.editor.createModel(t, r, n ? ze(e, n) : void 0);
|
|
490
|
+
}
|
|
491
|
+
function ze(e, t) {
|
|
492
|
+
return e.Uri.parse(t);
|
|
493
|
+
}
|
|
494
|
+
function ir({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: a, modifiedModelPath: i, keepCurrentOriginalModel: s = !1, keepCurrentModifiedModel: l = !1, theme: f = "light", loading: b = "Loading...", options: p = {}, height: g = "100%", width: I = "100%", className: w, wrapperProps: k = {}, beforeMount: M = ee, onMount: O = ee }) {
|
|
495
|
+
let [m, j] = A(!1), [D, E] = A(!0), P = y(null), S = y(null), z = y(null), d = y(O), u = y(M), N = y(!1);
|
|
496
|
+
be(() => {
|
|
497
|
+
let c = H.init();
|
|
498
|
+
return c.then((h) => (S.current = h) && E(!1)).catch((h) => (h == null ? void 0 : h.type) !== "cancelation" && console.error("Monaco initialization: error:", h)), () => P.current ? L() : c.cancel();
|
|
499
|
+
}), _(() => {
|
|
500
|
+
if (P.current && S.current) {
|
|
501
|
+
let c = P.current.getOriginalEditor(), h = Z(S.current, e || "", n || r || "text", a || "");
|
|
502
|
+
h !== c.getModel() && c.setModel(h);
|
|
503
|
+
}
|
|
504
|
+
}, [a], m), _(() => {
|
|
505
|
+
if (P.current && S.current) {
|
|
506
|
+
let c = P.current.getModifiedEditor(), h = Z(S.current, t || "", o || r || "text", i || "");
|
|
507
|
+
h !== c.getModel() && c.setModel(h);
|
|
508
|
+
}
|
|
509
|
+
}, [i], m), _(() => {
|
|
510
|
+
let c = P.current.getModifiedEditor();
|
|
511
|
+
c.getOption(S.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
|
|
512
|
+
}, [t], m), _(() => {
|
|
513
|
+
var c, h;
|
|
514
|
+
(h = (c = P.current) == null ? void 0 : c.getModel()) == null || h.original.setValue(e || "");
|
|
515
|
+
}, [e], m), _(() => {
|
|
516
|
+
let { original: c, modified: h } = P.current.getModel();
|
|
517
|
+
S.current.editor.setModelLanguage(c, n || r || "text"), S.current.editor.setModelLanguage(h, o || r || "text");
|
|
518
|
+
}, [r, n, o], m), _(() => {
|
|
519
|
+
var c;
|
|
520
|
+
(c = S.current) == null || c.editor.setTheme(f);
|
|
521
|
+
}, [f], m), _(() => {
|
|
522
|
+
var c;
|
|
523
|
+
(c = P.current) == null || c.updateOptions(p);
|
|
524
|
+
}, [p], m);
|
|
525
|
+
let C = G(() => {
|
|
526
|
+
var R;
|
|
527
|
+
if (!S.current)
|
|
528
|
+
return;
|
|
529
|
+
u.current(S.current);
|
|
530
|
+
let c = Z(S.current, e || "", n || r || "text", a || ""), h = Z(S.current, t || "", o || r || "text", i || "");
|
|
531
|
+
(R = P.current) == null || R.setModel({ original: c, modified: h });
|
|
532
|
+
}, [r, t, o, e, n, a, i]), T = G(() => {
|
|
533
|
+
var c;
|
|
534
|
+
!N.current && z.current && (P.current = S.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...p }), C(), (c = S.current) == null || c.editor.setTheme(f), j(!0), N.current = !0);
|
|
535
|
+
}, [p, f, C]);
|
|
536
|
+
$(() => {
|
|
537
|
+
m && d.current(P.current, S.current);
|
|
538
|
+
}, [m]), $(() => {
|
|
539
|
+
!D && !m && T();
|
|
540
|
+
}, [D, m, T]);
|
|
541
|
+
function L() {
|
|
542
|
+
var h, R, K, J;
|
|
543
|
+
let c = (h = P.current) == null ? void 0 : h.getModel();
|
|
544
|
+
s || ((R = c == null ? void 0 : c.original) == null || R.dispose()), l || ((K = c == null ? void 0 : c.modified) == null || K.dispose()), (J = P.current) == null || J.dispose();
|
|
545
|
+
}
|
|
546
|
+
return W.createElement(Ue, { width: I, height: g, isEditorReady: m, loading: b, _ref: z, className: w, wrapperProps: k });
|
|
547
|
+
}
|
|
548
|
+
var cr = ir, ur = ye(cr);
|
|
549
|
+
function sr() {
|
|
550
|
+
let [e, t] = A(H.__getMonacoInstance());
|
|
551
|
+
return be(() => {
|
|
552
|
+
let r;
|
|
553
|
+
return e || (r = H.init(), r.then((n) => {
|
|
554
|
+
t(n);
|
|
555
|
+
})), () => r == null ? void 0 : r.cancel();
|
|
556
|
+
}), e;
|
|
557
|
+
}
|
|
558
|
+
var se = sr;
|
|
559
|
+
function lr(e) {
|
|
560
|
+
let t = y();
|
|
561
|
+
return $(() => {
|
|
562
|
+
t.current = e;
|
|
563
|
+
}, [e]), t.current;
|
|
564
|
+
}
|
|
565
|
+
var dr = lr, ie = /* @__PURE__ */ new Map();
|
|
566
|
+
function fr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: a, theme: i = "light", line: s, loading: l = "Loading...", options: f = {}, overrideServices: b = {}, saveViewState: p = !0, keepCurrentModel: g = !1, width: I = "100%", height: w = "100%", className: k, wrapperProps: M = {}, beforeMount: O = ee, onMount: m = ee, onChange: j, onValidate: D = ee }) {
|
|
567
|
+
let [E, P] = A(!1), [S, z] = A(!0), d = y(null), u = y(null), N = y(null), C = y(m), T = y(O), L = y(), c = y(n), h = dr(a), R = y(!1), K = y(!1);
|
|
568
|
+
be(() => {
|
|
569
|
+
let v = H.init();
|
|
570
|
+
return v.then((x) => (d.current = x) && z(!1)).catch((x) => (x == null ? void 0 : x.type) !== "cancelation" && console.error("Monaco initialization: error:", x)), () => u.current ? Ke() : v.cancel();
|
|
571
|
+
}), _(() => {
|
|
572
|
+
var x, V, Q, Y;
|
|
573
|
+
let v = Z(d.current, e || n || "", t || o || "", a || r || "");
|
|
574
|
+
v !== ((x = u.current) == null ? void 0 : x.getModel()) && (p && ie.set(h, (V = u.current) == null ? void 0 : V.saveViewState()), (Q = u.current) == null || Q.setModel(v), p && ((Y = u.current) == null || Y.restoreViewState(ie.get(a))));
|
|
575
|
+
}, [a], E), _(() => {
|
|
576
|
+
var v;
|
|
577
|
+
(v = u.current) == null || v.updateOptions(f);
|
|
578
|
+
}, [f], E), _(() => {
|
|
579
|
+
!u.current || n === void 0 || (u.current.getOption(d.current.editor.EditorOption.readOnly) ? u.current.setValue(n) : n !== u.current.getValue() && (K.current = !0, u.current.executeEdits("", [{ range: u.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), u.current.pushUndoStop(), K.current = !1));
|
|
580
|
+
}, [n], E), _(() => {
|
|
581
|
+
var x, V;
|
|
582
|
+
let v = (x = u.current) == null ? void 0 : x.getModel();
|
|
583
|
+
v && o && ((V = d.current) == null || V.editor.setModelLanguage(v, o));
|
|
584
|
+
}, [o], E), _(() => {
|
|
585
|
+
var v;
|
|
586
|
+
s !== void 0 && ((v = u.current) == null || v.revealLine(s));
|
|
587
|
+
}, [s], E), _(() => {
|
|
588
|
+
var v;
|
|
589
|
+
(v = d.current) == null || v.editor.setTheme(i);
|
|
590
|
+
}, [i], E);
|
|
591
|
+
let J = G(() => {
|
|
592
|
+
var v;
|
|
593
|
+
if (!(!N.current || !d.current) && !R.current) {
|
|
594
|
+
T.current(d.current);
|
|
595
|
+
let x = a || r, V = Z(d.current, n || e || "", t || o || "", x || "");
|
|
596
|
+
u.current = (v = d.current) == null ? void 0 : v.editor.create(N.current, { model: V, automaticLayout: !0, ...f }, b), p && u.current.restoreViewState(ie.get(x)), d.current.editor.setTheme(i), s !== void 0 && u.current.revealLine(s), P(!0), R.current = !0;
|
|
597
|
+
}
|
|
598
|
+
}, [e, t, r, n, o, a, f, b, p, i, s]);
|
|
599
|
+
$(() => {
|
|
600
|
+
E && C.current(u.current, d.current);
|
|
601
|
+
}, [E]), $(() => {
|
|
602
|
+
!S && !E && J();
|
|
603
|
+
}, [S, E, J]), c.current = n, $(() => {
|
|
604
|
+
var v, x;
|
|
605
|
+
E && j && ((v = L.current) == null || v.dispose(), L.current = (x = u.current) == null ? void 0 : x.onDidChangeModelContent((V) => {
|
|
606
|
+
K.current || j(u.current.getValue(), V);
|
|
607
|
+
}));
|
|
608
|
+
}, [E, j]), $(() => {
|
|
609
|
+
if (E) {
|
|
610
|
+
let v = d.current.editor.onDidChangeMarkers((x) => {
|
|
611
|
+
var Q;
|
|
612
|
+
let V = (Q = u.current.getModel()) == null ? void 0 : Q.uri;
|
|
613
|
+
if (V && x.find((Y) => Y.path === V.path)) {
|
|
614
|
+
let Y = d.current.editor.getModelMarkers({ resource: V });
|
|
615
|
+
D == null || D(Y);
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
return () => {
|
|
619
|
+
v == null || v.dispose();
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
return () => {
|
|
623
|
+
};
|
|
624
|
+
}, [E, D]);
|
|
625
|
+
function Ke() {
|
|
626
|
+
var v, x;
|
|
627
|
+
(v = L.current) == null || v.dispose(), g ? p && ie.set(a, u.current.saveViewState()) : (x = u.current.getModel()) == null || x.dispose(), u.current.dispose();
|
|
628
|
+
}
|
|
629
|
+
return W.createElement(Ue, { width: I, height: w, isEditorReady: E, loading: l, _ref: N, className: k, wrapperProps: M });
|
|
630
|
+
}
|
|
631
|
+
var pr = fr, gr = ye(pr), we = gr;
|
|
632
|
+
const le = {
|
|
74
633
|
selectOnLineNumbers: !0,
|
|
75
634
|
scrollBeyondLastLine: !1,
|
|
76
635
|
padding: {
|
|
@@ -90,33 +649,33 @@ const z = {
|
|
|
90
649
|
overviewRulerBorder: !1,
|
|
91
650
|
overviewRulerLanes: 0,
|
|
92
651
|
renderLineHighlight: "none"
|
|
93
|
-
},
|
|
94
|
-
const { themeConfig: t, editor:
|
|
95
|
-
return
|
|
96
|
-
var
|
|
97
|
-
(
|
|
98
|
-
|
|
652
|
+
}, de = (e) => {
|
|
653
|
+
const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [a, i] = A(n ?? o ?? "vs-dark");
|
|
654
|
+
return $(() => {
|
|
655
|
+
var s;
|
|
656
|
+
(s = t == null ? void 0 : t.themes) == null || s.forEach((l) => {
|
|
657
|
+
F.editor.defineTheme(l.themeName, l.themeData);
|
|
99
658
|
});
|
|
100
|
-
}, [
|
|
101
|
-
|
|
102
|
-
}, [
|
|
659
|
+
}, [F]), $(() => {
|
|
660
|
+
F.editor && n && (F.editor.setTheme(n), i(n));
|
|
661
|
+
}, [r, n]), { theme: a };
|
|
103
662
|
};
|
|
104
|
-
function
|
|
663
|
+
function mr(e) {
|
|
105
664
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
106
|
-
let
|
|
107
|
-
for (let
|
|
108
|
-
|
|
109
|
-
return
|
|
665
|
+
let r = "";
|
|
666
|
+
for (let n = 0; n < e; n++)
|
|
667
|
+
r += t.charAt(Math.floor(Math.random() * t.length));
|
|
668
|
+
return r;
|
|
110
669
|
}
|
|
111
|
-
function
|
|
670
|
+
function hr(e) {
|
|
112
671
|
return e.replace("'", "'");
|
|
113
672
|
}
|
|
114
|
-
function
|
|
673
|
+
function vr({
|
|
115
674
|
instanceId: e,
|
|
116
675
|
lineNumbersPosition: t
|
|
117
676
|
}) {
|
|
118
|
-
let
|
|
119
|
-
return t === "center" && (
|
|
677
|
+
let r = "";
|
|
678
|
+
return t === "center" && (r += `
|
|
120
679
|
.monaco-editor-${e} .monaco-scrollable-element.editor-scrollable {
|
|
121
680
|
width: 100% !important;
|
|
122
681
|
left: 0px !important;
|
|
@@ -129,7 +688,7 @@ function $e({
|
|
|
129
688
|
.monaco-editor-${e} .margin {
|
|
130
689
|
z-index: 1000;
|
|
131
690
|
background: transparent !important;
|
|
132
|
-
}`),
|
|
691
|
+
}`), r += `
|
|
133
692
|
.monaco-editor-${e} .blame-editor-separator {
|
|
134
693
|
right: 14px;
|
|
135
694
|
pointer-events: none;
|
|
@@ -142,59 +701,59 @@ function $e({
|
|
|
142
701
|
.monaco-editor-${e} .view-line .blame-editor-commit {
|
|
143
702
|
display: inline-block;
|
|
144
703
|
color: var(--canary-foreground-01);
|
|
145
|
-
}`,
|
|
704
|
+
}`, r;
|
|
146
705
|
}
|
|
147
|
-
function
|
|
706
|
+
function yr({
|
|
148
707
|
instanceId: e,
|
|
149
708
|
blameData: t,
|
|
150
|
-
dateWidth:
|
|
151
|
-
avatarSize:
|
|
709
|
+
dateWidth: r,
|
|
710
|
+
avatarSize: n
|
|
152
711
|
}) {
|
|
153
|
-
let
|
|
154
|
-
return t.forEach((
|
|
155
|
-
var
|
|
156
|
-
const
|
|
157
|
-
for (let
|
|
158
|
-
|
|
159
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
160
|
-
content: '${
|
|
712
|
+
let o = "";
|
|
713
|
+
return t.forEach((a) => {
|
|
714
|
+
var f, b, p, g, I, w, k, M;
|
|
715
|
+
const i = (b = (f = a == null ? void 0 : a.commitInfo) == null ? void 0 : f.author) == null ? void 0 : b.avatarUrl, s = (g = (p = a == null ? void 0 : a.commitInfo) == null ? void 0 : p.author) == null ? void 0 : g.initials, l = i ? `background: url('${(w = (I = a == null ? void 0 : a.commitInfo) == null ? void 0 : I.author) == null ? void 0 : w.avatarUrl}');` : "";
|
|
716
|
+
for (let O = a.fromLineNumber; O <= a.toLineNumber; O++)
|
|
717
|
+
O === a.fromLineNumber ? o += `
|
|
718
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${O}:before {
|
|
719
|
+
content: '${hr(((M = (k = a == null ? void 0 : a.commitInfo) == null ? void 0 : k.author) == null ? void 0 : M.when) || "")}';
|
|
161
720
|
position: absolute;
|
|
162
721
|
left: 10px;
|
|
163
722
|
top: 0px;
|
|
164
723
|
color: hsl(var(--canary-foreground-03));
|
|
165
724
|
}
|
|
166
725
|
|
|
167
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
168
|
-
content: '${
|
|
726
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${O}:after {
|
|
727
|
+
content: '${s ?? " "}';
|
|
169
728
|
position: absolute;
|
|
170
729
|
border-radius: 50%;
|
|
171
730
|
padding: 4px;
|
|
172
731
|
text-align: center;
|
|
173
732
|
background: hsl(var(--canary-background-11));
|
|
174
733
|
line-height: 17px;
|
|
175
|
-
left: ${
|
|
734
|
+
left: ${r + 10}px;
|
|
176
735
|
top: -4px;
|
|
177
736
|
color: hsl(var(--canary-foreground-03));
|
|
178
|
-
width: ${
|
|
179
|
-
height: ${
|
|
180
|
-
${
|
|
737
|
+
width: ${n}px;
|
|
738
|
+
height: ${n}px;
|
|
739
|
+
${l}
|
|
181
740
|
background-size: 100% 100%;
|
|
182
|
-
}` :
|
|
183
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
741
|
+
}` : o += `
|
|
742
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${O}:before {
|
|
184
743
|
content: ' ';
|
|
185
744
|
left: 10px;
|
|
186
745
|
top: 0px;
|
|
187
746
|
color: gray;
|
|
188
747
|
}`;
|
|
189
|
-
}),
|
|
748
|
+
}), o;
|
|
190
749
|
}
|
|
191
|
-
function
|
|
192
|
-
let
|
|
193
|
-
return e.length > t ?
|
|
750
|
+
function br(e, t) {
|
|
751
|
+
let r = "";
|
|
752
|
+
return e.length > t ? r = e.slice(0, t - 3) + "..." : e.length < t ? r = e + " ".repeat(t - e.length) : r = e, " ".repeat(25) + r + " ".repeat(10);
|
|
194
753
|
}
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
...
|
|
754
|
+
H.config({ monaco: F });
|
|
755
|
+
const me = 450, wr = 30, Or = 140, Sr = 24, Mr = {
|
|
756
|
+
...le,
|
|
198
757
|
readOnly: !0,
|
|
199
758
|
matchBrackets: "never",
|
|
200
759
|
renderValidationDecorations: "off",
|
|
@@ -204,168 +763,168 @@ const Y = 450, ke = 30, Le = 140, De = 24, _e = {
|
|
|
204
763
|
renderWhitespace: "none",
|
|
205
764
|
renderLineHighlight: "none"
|
|
206
765
|
};
|
|
207
|
-
function
|
|
766
|
+
function zr({
|
|
208
767
|
code: e,
|
|
209
768
|
language: t,
|
|
210
|
-
themeConfig:
|
|
211
|
-
lineNumbersPosition:
|
|
212
|
-
blameData:
|
|
213
|
-
showSeparators:
|
|
214
|
-
theme:
|
|
215
|
-
height:
|
|
216
|
-
options:
|
|
769
|
+
themeConfig: r,
|
|
770
|
+
lineNumbersPosition: n = "left",
|
|
771
|
+
blameData: o,
|
|
772
|
+
showSeparators: a = !0,
|
|
773
|
+
theme: i,
|
|
774
|
+
height: s = "75vh",
|
|
775
|
+
options: l
|
|
217
776
|
}) {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
const [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}, [
|
|
224
|
-
function
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
777
|
+
const f = y(o), b = y(mr(5));
|
|
778
|
+
se();
|
|
779
|
+
const [p, g] = A(), [I, w] = A(0), k = y(null), M = y(null);
|
|
780
|
+
$(() => {
|
|
781
|
+
f.current = o;
|
|
782
|
+
}, [o]);
|
|
783
|
+
function O() {
|
|
784
|
+
const d = M.current, u = k.current;
|
|
785
|
+
if (!d || !u)
|
|
227
786
|
return;
|
|
228
|
-
|
|
229
|
-
|
|
787
|
+
a && d.changeViewZones(function(C) {
|
|
788
|
+
C.addZone({
|
|
230
789
|
afterLineNumber: 0,
|
|
231
790
|
heightInPx: 10,
|
|
232
791
|
domNode: document.createElement("div")
|
|
233
|
-
}),
|
|
234
|
-
if (
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
afterLineNumber:
|
|
792
|
+
}), f.current.forEach((T, L) => {
|
|
793
|
+
if (L !== f.current.length - 1) {
|
|
794
|
+
const c = document.createElement("div");
|
|
795
|
+
c.style.borderTop = "1px solid hsl(var(--canary-border-01))", c.style.marginTop = "9px", c.className = "blame-editor-separator", C.addZone({
|
|
796
|
+
afterLineNumber: T.toLineNumber,
|
|
238
797
|
heightInPx: 20,
|
|
239
|
-
domNode:
|
|
798
|
+
domNode: c
|
|
240
799
|
});
|
|
241
800
|
}
|
|
242
801
|
});
|
|
243
802
|
});
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
var
|
|
247
|
-
for (let
|
|
248
|
-
|
|
249
|
-
range: new
|
|
803
|
+
const N = [];
|
|
804
|
+
f.current.forEach((C) => {
|
|
805
|
+
var T;
|
|
806
|
+
for (let L = C.fromLineNumber; L <= C.toLineNumber; L++)
|
|
807
|
+
N.push({
|
|
808
|
+
range: new u.Range(L, 0, L + 1, 0),
|
|
250
809
|
options: {
|
|
251
810
|
before: {
|
|
252
|
-
content:
|
|
253
|
-
|
|
254
|
-
|
|
811
|
+
content: br(
|
|
812
|
+
L === C.fromLineNumber && ((T = C == null ? void 0 : C.commitInfo) == null ? void 0 : T.title) || "",
|
|
813
|
+
wr
|
|
255
814
|
),
|
|
256
|
-
cursorStops:
|
|
257
|
-
inlineClassName: `blame-editor-commit blame-editor-commit-${
|
|
815
|
+
cursorStops: u.editor.InjectedTextCursorStops.None,
|
|
816
|
+
inlineClassName: `blame-editor-commit blame-editor-commit-${L}`
|
|
258
817
|
}
|
|
259
818
|
}
|
|
260
819
|
});
|
|
261
|
-
}),
|
|
820
|
+
}), d.createDecorationsCollection(N);
|
|
262
821
|
}
|
|
263
|
-
function
|
|
264
|
-
var
|
|
265
|
-
|
|
822
|
+
function m(d, u) {
|
|
823
|
+
var N, C, T, L, c, h;
|
|
824
|
+
M.current = d, k.current = u, d.setValue(e), g(d), (T = (C = (N = u.languages.typescript) == null ? void 0 : N.typescriptDefaults) == null ? void 0 : C.setDiagnosticsOptions) == null || T.call(C, {
|
|
266
825
|
noSuggestionDiagnostics: !0,
|
|
267
826
|
noSyntaxValidation: !0,
|
|
268
827
|
noSemanticValidation: !0
|
|
269
|
-
}), (
|
|
828
|
+
}), (h = (c = (L = u.languages.typescript) == null ? void 0 : L.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || h.call(c, {
|
|
270
829
|
noSuggestionDiagnostics: !0,
|
|
271
830
|
noSyntaxValidation: !0,
|
|
272
831
|
noSemanticValidation: !0
|
|
273
|
-
}),
|
|
832
|
+
}), O();
|
|
274
833
|
}
|
|
275
|
-
|
|
276
|
-
|
|
834
|
+
$(() => {
|
|
835
|
+
p == null || p.setValue(e);
|
|
277
836
|
}, [e]);
|
|
278
|
-
const { theme:
|
|
279
|
-
() =>
|
|
280
|
-
instanceId:
|
|
281
|
-
lineNumbersPosition:
|
|
837
|
+
const { theme: j } = de({ monacoRef: k, themeConfig: r, editor: p, theme: i }), D = q(
|
|
838
|
+
() => vr({
|
|
839
|
+
instanceId: b.current,
|
|
840
|
+
lineNumbersPosition: n
|
|
282
841
|
}),
|
|
283
|
-
[
|
|
284
|
-
),
|
|
285
|
-
() =>
|
|
286
|
-
instanceId:
|
|
287
|
-
blameData:
|
|
288
|
-
avatarSize:
|
|
289
|
-
dateWidth:
|
|
842
|
+
[o]
|
|
843
|
+
), E = q(
|
|
844
|
+
() => yr({
|
|
845
|
+
instanceId: b.current,
|
|
846
|
+
blameData: o,
|
|
847
|
+
avatarSize: Sr,
|
|
848
|
+
dateWidth: Or
|
|
290
849
|
}),
|
|
291
|
-
[
|
|
850
|
+
[o]
|
|
292
851
|
);
|
|
293
|
-
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
for (const
|
|
299
|
-
const
|
|
300
|
-
|
|
852
|
+
$(() => {
|
|
853
|
+
if (n === "center") {
|
|
854
|
+
const d = document.getElementsByClassName("lines-content")[0];
|
|
855
|
+
if (d) {
|
|
856
|
+
const u = { attributes: !0 }, N = (T) => {
|
|
857
|
+
for (const L of T) {
|
|
858
|
+
const c = parseInt(getComputedStyle(d).left);
|
|
859
|
+
w(c);
|
|
301
860
|
}
|
|
302
|
-
},
|
|
303
|
-
return
|
|
304
|
-
|
|
861
|
+
}, C = new MutationObserver(N);
|
|
862
|
+
return C.observe(d, u), () => {
|
|
863
|
+
C.disconnect();
|
|
305
864
|
};
|
|
306
865
|
}
|
|
307
866
|
}
|
|
308
867
|
});
|
|
309
|
-
const
|
|
310
|
-
.monaco-editor-${
|
|
311
|
-
left: ${
|
|
868
|
+
const P = q(() => `
|
|
869
|
+
.monaco-editor-${b.current} .margin {
|
|
870
|
+
left: ${me + 16 + I}px !important;
|
|
312
871
|
pointer-events: none;
|
|
313
|
-
}`, [
|
|
314
|
-
.monaco-editor-${
|
|
315
|
-
clip-path: polygon(${
|
|
872
|
+
}`, [I]), S = `
|
|
873
|
+
.monaco-editor-${b.current} .view-overlays {
|
|
874
|
+
clip-path: polygon(${me + 16}px 0, 100% 0%, 100% 100%, ${me + 16}px 100%);
|
|
316
875
|
height:100% !important;
|
|
317
|
-
}`,
|
|
876
|
+
}`, z = q(
|
|
318
877
|
() => ({
|
|
319
|
-
...
|
|
320
|
-
...
|
|
878
|
+
...Mr,
|
|
879
|
+
...l
|
|
321
880
|
}),
|
|
322
|
-
[
|
|
881
|
+
[l]
|
|
323
882
|
);
|
|
324
|
-
return /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ U.jsxs(U.Fragment, { children: [
|
|
884
|
+
/* @__PURE__ */ U.jsx(
|
|
326
885
|
"style",
|
|
327
886
|
{
|
|
328
887
|
dangerouslySetInnerHTML: {
|
|
329
|
-
__html: `${
|
|
888
|
+
__html: `${D} ${E} ${P} ${S}`
|
|
330
889
|
}
|
|
331
890
|
}
|
|
332
891
|
),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
|
|
892
|
+
/* @__PURE__ */ U.jsx(
|
|
893
|
+
we,
|
|
335
894
|
{
|
|
336
|
-
className: `monaco-editor-${
|
|
337
|
-
height:
|
|
895
|
+
className: `monaco-editor-${b.current} overflow-hidden rounded-b-md border-x border-b`,
|
|
896
|
+
height: s,
|
|
338
897
|
language: t,
|
|
339
|
-
theme:
|
|
340
|
-
options:
|
|
341
|
-
onMount:
|
|
898
|
+
theme: j,
|
|
899
|
+
options: z,
|
|
900
|
+
onMount: m
|
|
342
901
|
}
|
|
343
902
|
)
|
|
344
903
|
] });
|
|
345
904
|
}
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
...
|
|
905
|
+
H.config({ monaco: F });
|
|
906
|
+
const jr = {
|
|
907
|
+
...le
|
|
349
908
|
};
|
|
350
|
-
function
|
|
909
|
+
function Fr({
|
|
351
910
|
codeRevision: e,
|
|
352
911
|
onCodeRevisionChange: t,
|
|
353
|
-
language:
|
|
354
|
-
themeConfig:
|
|
355
|
-
options:
|
|
356
|
-
theme:
|
|
357
|
-
height:
|
|
358
|
-
className:
|
|
912
|
+
language: r,
|
|
913
|
+
themeConfig: n,
|
|
914
|
+
options: o,
|
|
915
|
+
theme: a,
|
|
916
|
+
height: i = "75vh",
|
|
917
|
+
className: s
|
|
359
918
|
}) {
|
|
360
|
-
|
|
361
|
-
const [
|
|
362
|
-
(
|
|
363
|
-
var
|
|
364
|
-
|
|
919
|
+
se();
|
|
920
|
+
const [l, f] = A(), b = y(), p = y({ code: "", revisionId: 0 }), g = y(null), I = G(
|
|
921
|
+
(M, O) => {
|
|
922
|
+
var m, j, D, E, P, S;
|
|
923
|
+
g.current = M, b.current = O, M.setValue(e.code), f(M), (D = (j = (m = O.languages.typescript) == null ? void 0 : m.typescriptDefaults) == null ? void 0 : j.setDiagnosticsOptions) == null || D.call(j, {
|
|
365
924
|
noSuggestionDiagnostics: !0,
|
|
366
925
|
noSyntaxValidation: !0,
|
|
367
926
|
noSemanticValidation: !0
|
|
368
|
-
}), (
|
|
927
|
+
}), (S = (P = (E = O.languages.typescript) == null ? void 0 : E.javascriptDefaults) == null ? void 0 : P.setDiagnosticsOptions) == null || S.call(P, {
|
|
369
928
|
noSuggestionDiagnostics: !0,
|
|
370
929
|
noSyntaxValidation: !0,
|
|
371
930
|
noSemanticValidation: !0
|
|
@@ -373,37 +932,37 @@ function Xe({
|
|
|
373
932
|
},
|
|
374
933
|
[e.code]
|
|
375
934
|
);
|
|
376
|
-
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
|
|
935
|
+
$(() => {
|
|
936
|
+
var M, O;
|
|
937
|
+
if (g.current && (!e.revisionId || e.revisionId > Number((M = p.current) == null ? void 0 : M.revisionId))) {
|
|
938
|
+
const m = g.current.getModel();
|
|
939
|
+
m && (o != null && o.readOnly ? (O = g.current) == null || O.setValue(e.code) : (g.current.pushUndoStop(), g.current.executeEdits("edit", [
|
|
381
940
|
{
|
|
382
|
-
range:
|
|
941
|
+
range: m.getFullModelRange(),
|
|
383
942
|
text: e.code
|
|
384
943
|
}
|
|
385
|
-
]),
|
|
944
|
+
]), g.current.pushUndoStop()));
|
|
386
945
|
}
|
|
387
|
-
}, [e,
|
|
388
|
-
const { theme:
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
-
|
|
946
|
+
}, [e, g.current]);
|
|
947
|
+
const { theme: w } = de({ monacoRef: b, themeConfig: n, editor: l, theme: a }), k = q(() => ({ ...jr, ...o || {} }), [o]);
|
|
948
|
+
return /* @__PURE__ */ U.jsx(U.Fragment, { children: /* @__PURE__ */ U.jsx(
|
|
949
|
+
we,
|
|
391
950
|
{
|
|
392
|
-
className:
|
|
393
|
-
height:
|
|
394
|
-
onChange: (
|
|
395
|
-
|
|
951
|
+
className: s,
|
|
952
|
+
height: i,
|
|
953
|
+
onChange: (M, O) => {
|
|
954
|
+
p.current = { code: M ?? "", revisionId: O.versionId }, t({ ...p.current }, O);
|
|
396
955
|
},
|
|
397
|
-
language:
|
|
398
|
-
theme:
|
|
399
|
-
options:
|
|
400
|
-
onMount:
|
|
956
|
+
language: r,
|
|
957
|
+
theme: w,
|
|
958
|
+
options: k,
|
|
959
|
+
onMount: I
|
|
401
960
|
}
|
|
402
961
|
) });
|
|
403
962
|
}
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
...
|
|
963
|
+
H.config({ monaco: F });
|
|
964
|
+
const Er = {
|
|
965
|
+
...le,
|
|
407
966
|
codeLens: !1,
|
|
408
967
|
smartSelect: {
|
|
409
968
|
selectLeadingAndTrailingWhitespace: !0
|
|
@@ -411,64 +970,64 @@ const Ie = {
|
|
|
411
970
|
originalEditable: !1,
|
|
412
971
|
overviewRulerBorder: !1
|
|
413
972
|
};
|
|
414
|
-
function
|
|
973
|
+
function Rr({
|
|
415
974
|
original: e,
|
|
416
975
|
modified: t,
|
|
417
|
-
language:
|
|
418
|
-
themeConfig:
|
|
419
|
-
options:
|
|
420
|
-
theme:
|
|
421
|
-
height:
|
|
976
|
+
language: r,
|
|
977
|
+
themeConfig: n,
|
|
978
|
+
options: o,
|
|
979
|
+
theme: a,
|
|
980
|
+
height: i = "75vh"
|
|
422
981
|
}) {
|
|
423
|
-
|
|
424
|
-
const [
|
|
425
|
-
return /* @__PURE__ */
|
|
426
|
-
|
|
982
|
+
se();
|
|
983
|
+
const [s, l] = A(), f = y(), { theme: b } = de({ monacoRef: f, themeConfig: n, editor: s, theme: a }), p = q(() => ({ ...Er, ...o || {} }), [o]);
|
|
984
|
+
return /* @__PURE__ */ U.jsx(U.Fragment, { children: /* @__PURE__ */ U.jsx(
|
|
985
|
+
ur,
|
|
427
986
|
{
|
|
428
987
|
className: "overflow-hidden rounded-b-md border-x border-b",
|
|
429
|
-
language:
|
|
430
|
-
theme:
|
|
988
|
+
language: r,
|
|
989
|
+
theme: b,
|
|
431
990
|
original: e,
|
|
432
991
|
modified: t,
|
|
433
|
-
height:
|
|
434
|
-
options:
|
|
435
|
-
onMount:
|
|
992
|
+
height: i,
|
|
993
|
+
options: p,
|
|
994
|
+
onMount: l
|
|
436
995
|
}
|
|
437
996
|
) });
|
|
438
997
|
}
|
|
439
|
-
var
|
|
440
|
-
function
|
|
441
|
-
const { pathSymbolMap: t, inlineActions:
|
|
442
|
-
return
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
switch (
|
|
446
|
-
case
|
|
447
|
-
|
|
448
|
-
let
|
|
449
|
-
fullPath:
|
|
450
|
-
path:
|
|
451
|
-
symbol:
|
|
452
|
-
})).filter((
|
|
453
|
-
|
|
454
|
-
...
|
|
455
|
-
path:
|
|
456
|
-
})),
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
range:
|
|
461
|
-
symbols: [
|
|
462
|
-
onClick:
|
|
463
|
-
data:
|
|
464
|
-
path:
|
|
998
|
+
var Fe = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Fe || {});
|
|
999
|
+
function Pr(e) {
|
|
1000
|
+
const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), a = [];
|
|
1001
|
+
return r == null || r.forEach((i) => {
|
|
1002
|
+
const s = i.actions;
|
|
1003
|
+
i.selectors.forEach((f) => {
|
|
1004
|
+
switch (f.type) {
|
|
1005
|
+
case Fe.ContainsPath: {
|
|
1006
|
+
f.paths.forEach((b) => {
|
|
1007
|
+
let g = Object.keys(o).map((w) => ({
|
|
1008
|
+
fullPath: w,
|
|
1009
|
+
path: w,
|
|
1010
|
+
symbol: o[w]
|
|
1011
|
+
})).filter((w) => w.path.startsWith(f.basePath));
|
|
1012
|
+
g = g.map((w) => ({
|
|
1013
|
+
...w,
|
|
1014
|
+
path: w.path.substring(f.basePath.length)
|
|
1015
|
+
})), g.filter((w) => b.test(w.path)).forEach((w) => {
|
|
1016
|
+
const k = w.fullPath, M = w.symbol, O = M.range;
|
|
1017
|
+
s.forEach((m) => {
|
|
1018
|
+
const j = {
|
|
1019
|
+
range: O,
|
|
1020
|
+
symbols: [M],
|
|
1021
|
+
onClick: m.onClick,
|
|
1022
|
+
data: m.data,
|
|
1023
|
+
path: k
|
|
465
1024
|
};
|
|
466
|
-
|
|
467
|
-
range:
|
|
1025
|
+
a.push({
|
|
1026
|
+
range: O,
|
|
468
1027
|
command: {
|
|
469
|
-
id:
|
|
470
|
-
title:
|
|
471
|
-
arguments: [
|
|
1028
|
+
id: n,
|
|
1029
|
+
title: m.title,
|
|
1030
|
+
arguments: [j]
|
|
472
1031
|
}
|
|
473
1032
|
});
|
|
474
1033
|
});
|
|
@@ -478,135 +1037,135 @@ function Ve(e) {
|
|
|
478
1037
|
}
|
|
479
1038
|
}
|
|
480
1039
|
});
|
|
481
|
-
}),
|
|
1040
|
+
}), a;
|
|
482
1041
|
}
|
|
483
|
-
const
|
|
1042
|
+
const te = class te {
|
|
484
1043
|
static set(t) {
|
|
485
|
-
|
|
1044
|
+
te.data = t;
|
|
486
1045
|
}
|
|
487
1046
|
static get() {
|
|
488
|
-
return
|
|
1047
|
+
return te.data;
|
|
489
1048
|
}
|
|
490
1049
|
};
|
|
491
|
-
|
|
492
|
-
let
|
|
493
|
-
async function
|
|
494
|
-
const t =
|
|
495
|
-
return await t.OutlineModel.create(
|
|
1050
|
+
Se(te, "data", {});
|
|
1051
|
+
let ve = te;
|
|
1052
|
+
async function Re(e) {
|
|
1053
|
+
const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
|
|
1054
|
+
return await t.OutlineModel.create(r, e);
|
|
496
1055
|
}
|
|
497
|
-
function
|
|
1056
|
+
function qe(e) {
|
|
498
1057
|
const t = /* @__PURE__ */ new Map();
|
|
499
|
-
return
|
|
1058
|
+
return Oe({
|
|
500
1059
|
pathSymbolMap: t,
|
|
501
1060
|
parentPath: "",
|
|
502
1061
|
children: e.children,
|
|
503
|
-
parentKind:
|
|
1062
|
+
parentKind: he.SymbolKind.Module
|
|
504
1063
|
}), t;
|
|
505
1064
|
}
|
|
506
|
-
function
|
|
1065
|
+
function Oe(e) {
|
|
507
1066
|
switch (e.parentKind) {
|
|
508
|
-
case
|
|
509
|
-
|
|
1067
|
+
case he.SymbolKind.Module: {
|
|
1068
|
+
Cr(e);
|
|
510
1069
|
break;
|
|
511
1070
|
}
|
|
512
|
-
case
|
|
513
|
-
|
|
1071
|
+
case he.SymbolKind.Array: {
|
|
1072
|
+
xr(e);
|
|
514
1073
|
break;
|
|
515
1074
|
}
|
|
516
1075
|
default:
|
|
517
|
-
|
|
1076
|
+
$r(e);
|
|
518
1077
|
}
|
|
519
1078
|
}
|
|
520
|
-
function
|
|
1079
|
+
function Cr(e) {
|
|
521
1080
|
e.children.forEach((t) => {
|
|
522
|
-
var
|
|
523
|
-
let
|
|
524
|
-
t.symbol && (
|
|
1081
|
+
var n;
|
|
1082
|
+
let r = e.parentPath;
|
|
1083
|
+
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Oe({
|
|
525
1084
|
pathSymbolMap: e.pathSymbolMap,
|
|
526
|
-
parentPath:
|
|
1085
|
+
parentPath: r,
|
|
527
1086
|
children: t.children,
|
|
528
|
-
parentKind: ((
|
|
1087
|
+
parentKind: ((n = t == null ? void 0 : t.symbol) == null ? void 0 : n.kind) ?? e.parentKind
|
|
529
1088
|
});
|
|
530
1089
|
});
|
|
531
1090
|
}
|
|
532
|
-
function
|
|
1091
|
+
function xr(e) {
|
|
533
1092
|
let t = 0;
|
|
534
|
-
e.children.forEach((
|
|
535
|
-
const
|
|
536
|
-
e.pathSymbolMap.set(
|
|
1093
|
+
e.children.forEach((r) => {
|
|
1094
|
+
const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
|
|
1095
|
+
e.pathSymbolMap.set(n, r.symbol), t += 1, Oe({
|
|
537
1096
|
pathSymbolMap: e.pathSymbolMap,
|
|
538
|
-
parentPath:
|
|
539
|
-
children:
|
|
540
|
-
parentKind:
|
|
1097
|
+
parentPath: n,
|
|
1098
|
+
children: r.children,
|
|
1099
|
+
parentKind: r.symbol.kind
|
|
541
1100
|
});
|
|
542
1101
|
});
|
|
543
1102
|
}
|
|
544
|
-
function
|
|
1103
|
+
function $r(e) {
|
|
545
1104
|
const t = e.children.get("0");
|
|
546
1105
|
if (t) {
|
|
547
|
-
const
|
|
548
|
-
e.pathSymbolMap.set(
|
|
1106
|
+
const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
|
|
1107
|
+
e.pathSymbolMap.set(r, t.symbol);
|
|
549
1108
|
}
|
|
550
1109
|
}
|
|
551
|
-
function
|
|
1110
|
+
function Lr({
|
|
552
1111
|
editorRef: e,
|
|
553
1112
|
inlineActions: t
|
|
554
1113
|
}) {
|
|
555
|
-
|
|
556
|
-
provideCodeLenses: async (
|
|
557
|
-
var
|
|
558
|
-
const
|
|
559
|
-
|
|
1114
|
+
$(() => F.languages.registerCodeLensProvider("yaml", {
|
|
1115
|
+
provideCodeLenses: async (n) => {
|
|
1116
|
+
var l;
|
|
1117
|
+
const o = await Re(n), a = qe(o), i = (l = e == null ? void 0 : e.current) == null ? void 0 : l.addCommand(0, (f, { onClick: b, path: p, range: g, data: I }) => {
|
|
1118
|
+
b({ path: p, range: g, data: I });
|
|
560
1119
|
});
|
|
561
|
-
return
|
|
562
|
-
lenses:
|
|
1120
|
+
return i ? {
|
|
1121
|
+
lenses: Pr({ pathSymbolMap: a, inlineActions: t, commandId: i }),
|
|
563
1122
|
dispose: () => {
|
|
564
1123
|
}
|
|
565
1124
|
} : void 0;
|
|
566
1125
|
}
|
|
567
1126
|
}).dispose, [t, e]);
|
|
568
1127
|
}
|
|
569
|
-
const
|
|
570
|
-
const [
|
|
571
|
-
() => async (
|
|
572
|
-
var
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
return
|
|
576
|
-
const
|
|
577
|
-
|
|
1128
|
+
const Ir = ({ editorRef: e, selection: t }) => {
|
|
1129
|
+
const [r, n] = A(), o = q(
|
|
1130
|
+
() => async (a, i, s) => {
|
|
1131
|
+
var g, I, w;
|
|
1132
|
+
const l = (g = e == null ? void 0 : e.current) == null ? void 0 : g.getModel();
|
|
1133
|
+
if (!l || !i)
|
|
1134
|
+
return n(void 0);
|
|
1135
|
+
const f = await Re(l), p = (I = qe(f).get(i)) == null ? void 0 : I.range;
|
|
1136
|
+
p && (n(p), s && ((w = e == null ? void 0 : e.current) == null || w.revealLineInCenter(p.startLineNumber)));
|
|
578
1137
|
},
|
|
579
1138
|
[]
|
|
580
1139
|
);
|
|
581
|
-
|
|
1140
|
+
$(() => {
|
|
582
1141
|
if ("requestIdleCallback" in window) {
|
|
583
|
-
const
|
|
584
|
-
|
|
1142
|
+
const a = requestIdleCallback(() => {
|
|
1143
|
+
o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
|
|
585
1144
|
});
|
|
586
|
-
return () => cancelIdleCallback(
|
|
1145
|
+
return () => cancelIdleCallback(a);
|
|
587
1146
|
} else {
|
|
588
|
-
const
|
|
589
|
-
|
|
1147
|
+
const a = setTimeout(() => {
|
|
1148
|
+
o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
|
|
590
1149
|
}, 100);
|
|
591
|
-
return () => clearTimeout(
|
|
1150
|
+
return () => clearTimeout(a);
|
|
592
1151
|
}
|
|
593
|
-
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e,
|
|
594
|
-
var
|
|
595
|
-
if (!
|
|
1152
|
+
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), $(() => {
|
|
1153
|
+
var i;
|
|
1154
|
+
if (!r)
|
|
596
1155
|
return;
|
|
597
|
-
const
|
|
1156
|
+
const a = (i = e == null ? void 0 : e.current) == null ? void 0 : i.createDecorationsCollection([
|
|
598
1157
|
{
|
|
599
1158
|
// TODO: check why startColumn is set to "end of row"
|
|
600
|
-
range: { ...
|
|
1159
|
+
range: { ...r, startColumn: 1 },
|
|
601
1160
|
options: {
|
|
602
1161
|
isWholeLine: !1,
|
|
603
1162
|
className: t == null ? void 0 : t.className
|
|
604
1163
|
}
|
|
605
1164
|
}
|
|
606
1165
|
]);
|
|
607
|
-
return () =>
|
|
608
|
-
}, [
|
|
609
|
-
},
|
|
1166
|
+
return () => a == null ? void 0 : a.clear();
|
|
1167
|
+
}, [r, e, t == null ? void 0 : t.className]);
|
|
1168
|
+
}, Be = Ge({
|
|
610
1169
|
markers: [],
|
|
611
1170
|
setMarkers: () => {
|
|
612
1171
|
},
|
|
@@ -616,52 +1175,52 @@ const ze = ({ editorRef: e, selection: t }) => {
|
|
|
616
1175
|
updateCursorPosition: (e) => {
|
|
617
1176
|
}
|
|
618
1177
|
});
|
|
619
|
-
function
|
|
1178
|
+
function qr({
|
|
620
1179
|
children: e
|
|
621
1180
|
}) {
|
|
622
|
-
const [t,
|
|
623
|
-
(
|
|
624
|
-
|
|
1181
|
+
const [t, r] = A([]), [n, o] = A(null), a = G(
|
|
1182
|
+
(i) => {
|
|
1183
|
+
n == null || n.setPosition(i), n == null || n.revealLineInCenterIfOutsideViewport(i.lineNumber), n == null || n.focus();
|
|
625
1184
|
},
|
|
626
|
-
[
|
|
1185
|
+
[n]
|
|
627
1186
|
);
|
|
628
|
-
return /* @__PURE__ */
|
|
629
|
-
|
|
1187
|
+
return /* @__PURE__ */ U.jsx(
|
|
1188
|
+
Be.Provider,
|
|
630
1189
|
{
|
|
631
1190
|
value: {
|
|
632
1191
|
markers: t,
|
|
633
|
-
setMarkers:
|
|
634
|
-
editor:
|
|
635
|
-
setEditor:
|
|
636
|
-
updateCursorPosition:
|
|
1192
|
+
setMarkers: r,
|
|
1193
|
+
editor: n,
|
|
1194
|
+
setEditor: o,
|
|
1195
|
+
updateCursorPosition: a
|
|
637
1196
|
},
|
|
638
1197
|
children: e
|
|
639
1198
|
}
|
|
640
1199
|
);
|
|
641
1200
|
}
|
|
642
|
-
function
|
|
643
|
-
return
|
|
644
|
-
}
|
|
645
|
-
const
|
|
646
|
-
const { setMarkers: t } =
|
|
647
|
-
|
|
648
|
-
let
|
|
649
|
-
const
|
|
650
|
-
var
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
t(
|
|
1201
|
+
function He() {
|
|
1202
|
+
return Je(Be);
|
|
1203
|
+
}
|
|
1204
|
+
const Nr = ({ monacoRef: e }) => {
|
|
1205
|
+
const { setMarkers: t } = He();
|
|
1206
|
+
$(() => {
|
|
1207
|
+
let r;
|
|
1208
|
+
const n = setTimeout(() => {
|
|
1209
|
+
var a;
|
|
1210
|
+
const o = (a = e.current) == null ? void 0 : a.editor;
|
|
1211
|
+
o && (r = o.onDidChangeMarkers(([i]) => {
|
|
1212
|
+
const s = o.getModelMarkers({ resource: i });
|
|
1213
|
+
t(s);
|
|
655
1214
|
}));
|
|
656
1215
|
}, 100);
|
|
657
1216
|
return () => {
|
|
658
|
-
clearTimeout(
|
|
1217
|
+
clearTimeout(n), r == null || r.dispose();
|
|
659
1218
|
};
|
|
660
1219
|
}, [e]);
|
|
661
1220
|
};
|
|
662
|
-
let
|
|
663
|
-
function
|
|
664
|
-
if (
|
|
1221
|
+
let Ie = !1;
|
|
1222
|
+
function Dr(e) {
|
|
1223
|
+
if (Ie)
|
|
665
1224
|
return;
|
|
666
1225
|
const t = {
|
|
667
1226
|
hover: !0,
|
|
@@ -670,109 +1229,109 @@ function We(e) {
|
|
|
670
1229
|
validate: !0,
|
|
671
1230
|
schemas: [e]
|
|
672
1231
|
};
|
|
673
|
-
|
|
1232
|
+
Ie = !0, Xe.setDiagnosticsOptions({ ...t });
|
|
674
1233
|
}
|
|
675
|
-
const
|
|
676
|
-
const { schemaConfig: t, instanceId:
|
|
677
|
-
|
|
678
|
-
t != null && t.schema &&
|
|
1234
|
+
const We = (e) => Qe.parse(`file://${e}`).toString(), Tr = (e) => {
|
|
1235
|
+
const { schemaConfig: t, instanceId: r } = e;
|
|
1236
|
+
$(() => {
|
|
1237
|
+
t != null && t.schema && Dr({
|
|
679
1238
|
// If YAML file is opened matching this glob
|
|
680
|
-
fileMatch: [
|
|
1239
|
+
fileMatch: [We(r.toString())],
|
|
681
1240
|
...t
|
|
682
1241
|
});
|
|
683
|
-
}, [t == null ? void 0 : t.schema,
|
|
1242
|
+
}, [t == null ? void 0 : t.schema, r]);
|
|
684
1243
|
};
|
|
685
|
-
|
|
686
|
-
const
|
|
687
|
-
...
|
|
1244
|
+
H.config({ monaco: F });
|
|
1245
|
+
const kr = {
|
|
1246
|
+
...le,
|
|
688
1247
|
folding: !0
|
|
689
|
-
},
|
|
1248
|
+
}, Br = function(t) {
|
|
690
1249
|
const {
|
|
691
|
-
yamlRevision:
|
|
692
|
-
schemaConfig:
|
|
693
|
-
inlineActions:
|
|
694
|
-
themeConfig:
|
|
695
|
-
onYamlRevisionChange:
|
|
696
|
-
selection:
|
|
697
|
-
theme:
|
|
698
|
-
options:
|
|
699
|
-
animateOnUpdate:
|
|
700
|
-
onAnimateEnd:
|
|
701
|
-
} = t,
|
|
702
|
-
(
|
|
703
|
-
var
|
|
704
|
-
const
|
|
705
|
-
`),
|
|
706
|
-
if (
|
|
707
|
-
(
|
|
708
|
-
let
|
|
709
|
-
|
|
710
|
-
var
|
|
711
|
-
|
|
1250
|
+
yamlRevision: r,
|
|
1251
|
+
schemaConfig: n,
|
|
1252
|
+
inlineActions: o,
|
|
1253
|
+
themeConfig: a,
|
|
1254
|
+
onYamlRevisionChange: i,
|
|
1255
|
+
selection: s,
|
|
1256
|
+
theme: l,
|
|
1257
|
+
options: f,
|
|
1258
|
+
animateOnUpdate: b = !1,
|
|
1259
|
+
onAnimateEnd: p
|
|
1260
|
+
} = t, g = se(), [I] = A("yaml"), { editor: w, setEditor: k } = He(), M = y(null), O = y(), m = y({ yaml: "", revisionId: 0 }), j = y(null), D = y(null), E = G(
|
|
1261
|
+
(d) => {
|
|
1262
|
+
var C, T, L;
|
|
1263
|
+
const u = d.split(`
|
|
1264
|
+
`), N = (C = j.current) == null ? void 0 : C.getModel();
|
|
1265
|
+
if (N) {
|
|
1266
|
+
(T = j.current) == null || T.pushUndoStop(), N.setValue("");
|
|
1267
|
+
let c = 0;
|
|
1268
|
+
D.current = window.setInterval(() => {
|
|
1269
|
+
var h;
|
|
1270
|
+
c < u.length ? (g && ((h = j.current) == null || h.executeEdits("addLine", [
|
|
712
1271
|
{
|
|
713
|
-
range: new
|
|
714
|
-
text:
|
|
1272
|
+
range: new g.Range(c + 1, 1, c + 1, 1),
|
|
1273
|
+
text: u[c] + `
|
|
715
1274
|
`
|
|
716
1275
|
}
|
|
717
|
-
])),
|
|
718
|
-
}, 100), (
|
|
1276
|
+
])), c++) : D.current && (clearInterval(D.current), p == null || p());
|
|
1277
|
+
}, 100), (L = j.current) == null || L.pushUndoStop();
|
|
719
1278
|
}
|
|
720
1279
|
},
|
|
721
|
-
[
|
|
1280
|
+
[g]
|
|
722
1281
|
);
|
|
723
|
-
|
|
724
|
-
|
|
1282
|
+
$(() => () => {
|
|
1283
|
+
D.current && clearInterval(D.current);
|
|
725
1284
|
}, []);
|
|
726
|
-
function
|
|
727
|
-
|
|
728
|
-
var
|
|
729
|
-
(
|
|
1285
|
+
function P(d, u) {
|
|
1286
|
+
j.current = d, O.current = u, d.setValue(r.yaml), k(d), setTimeout(() => {
|
|
1287
|
+
var N;
|
|
1288
|
+
(N = M.current) != null && N.style && (M.current.style.opacity = "1");
|
|
730
1289
|
}, 50);
|
|
731
1290
|
}
|
|
732
|
-
|
|
733
|
-
var
|
|
734
|
-
if (
|
|
735
|
-
const
|
|
736
|
-
|
|
1291
|
+
$(() => {
|
|
1292
|
+
var d;
|
|
1293
|
+
if (j.current && (!r.revisionId || r.revisionId > Number((d = m.current) == null ? void 0 : d.revisionId))) {
|
|
1294
|
+
const u = j.current.getModel();
|
|
1295
|
+
u && (j.current.executeEdits("edit", [
|
|
737
1296
|
{
|
|
738
|
-
range:
|
|
739
|
-
text:
|
|
1297
|
+
range: u.getFullModelRange(),
|
|
1298
|
+
text: b ? "" : r.yaml
|
|
740
1299
|
}
|
|
741
|
-
]),
|
|
1300
|
+
]), b && E(r.yaml));
|
|
742
1301
|
}
|
|
743
|
-
}, [
|
|
744
|
-
const { theme:
|
|
745
|
-
|
|
746
|
-
const
|
|
1302
|
+
}, [E, r, b]), Tr({ schemaConfig: n, instanceId: I }), Lr({ editorRef: j, inlineActions: o });
|
|
1303
|
+
const { theme: S } = de({ monacoRef: O, themeConfig: a, editor: w, theme: l });
|
|
1304
|
+
Nr({ monacoRef: O }), Ir({ editorRef: j, selection: s });
|
|
1305
|
+
const z = q(
|
|
747
1306
|
() => ({
|
|
748
|
-
...
|
|
749
|
-
...
|
|
1307
|
+
...kr,
|
|
1308
|
+
...f
|
|
750
1309
|
}),
|
|
751
|
-
[
|
|
1310
|
+
[f]
|
|
752
1311
|
);
|
|
753
|
-
return /* @__PURE__ */
|
|
754
|
-
|
|
1312
|
+
return /* @__PURE__ */ U.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: M, children: /* @__PURE__ */ U.jsx(
|
|
1313
|
+
we,
|
|
755
1314
|
{
|
|
756
|
-
onChange: (
|
|
757
|
-
|
|
1315
|
+
onChange: (d, u) => {
|
|
1316
|
+
m.current = { yaml: d ?? "", revisionId: u.versionId }, i({ ...m.current }, u);
|
|
758
1317
|
},
|
|
759
1318
|
language: "yaml",
|
|
760
|
-
theme:
|
|
761
|
-
options:
|
|
762
|
-
path:
|
|
763
|
-
onMount:
|
|
1319
|
+
theme: S,
|
|
1320
|
+
options: z,
|
|
1321
|
+
path: We(I),
|
|
1322
|
+
onMount: P
|
|
764
1323
|
}
|
|
765
1324
|
) });
|
|
766
1325
|
};
|
|
767
1326
|
export {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1327
|
+
zr as BlameEditor,
|
|
1328
|
+
Rr as CodeDiffEditor,
|
|
1329
|
+
Fr as CodeEditor,
|
|
1330
|
+
ve as MonacoGlobals,
|
|
1331
|
+
Fe as SelectorType,
|
|
1332
|
+
Br as YamlEditor,
|
|
1333
|
+
Be as YamlEditorContext,
|
|
1334
|
+
qr as YamlEditorContextProvider,
|
|
1335
|
+
He as useYamlEditorContext
|
|
777
1336
|
};
|
|
778
1337
|
//# sourceMappingURL=index.js.map
|