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