@harnessio/yaml-editor 0.19.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/hooks/useTheme.d.ts +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +470 -447
- package/dist/index.js.map +1 -1
- package/dist/utils/utils.d.ts +7 -0
- 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 ye, useState 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
5
|
import * as z from "monaco-editor";
|
|
6
|
-
import { languages as ge, Uri as
|
|
6
|
+
import { languages as ge, Uri as et } from "monaco-editor";
|
|
7
7
|
import { yamlDefaults as be } from "monaco-yaml";
|
|
8
|
-
var
|
|
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:
|
|
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
|
-
|
|
71
|
-
var
|
|
72
|
-
function
|
|
70
|
+
De.exports = ne;
|
|
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,
|
|
@@ -172,7 +172,7 @@ function gt(e, t, r) {
|
|
|
172
172
|
writable: !0
|
|
173
173
|
}) : e[t] = r, e;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function Ie(e, t) {
|
|
176
176
|
var r = Object.keys(e);
|
|
177
177
|
if (Object.getOwnPropertySymbols) {
|
|
178
178
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -182,18 +182,18 @@ function Le(e, t) {
|
|
|
182
182
|
}
|
|
183
183
|
return r;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Le(e) {
|
|
186
186
|
for (var t = 1; t < arguments.length; t++) {
|
|
187
187
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
188
|
-
t % 2 ?
|
|
189
|
-
|
|
190
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
188
|
+
t % 2 ? Ie(Object(r), !0).forEach(function(n) {
|
|
189
|
+
vt(e, n, r[n]);
|
|
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
|
};
|
|
@@ -216,35 +216,35 @@ function X(e) {
|
|
|
216
216
|
function ce(e) {
|
|
217
217
|
return {}.toString.call(e).includes("Object");
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function bt(e) {
|
|
220
220
|
return !Object.keys(e).length;
|
|
221
221
|
}
|
|
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
228
|
function Ot(e, t) {
|
|
229
|
-
return ce(t) ||
|
|
230
|
-
return !
|
|
231
|
-
}) &&
|
|
229
|
+
return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
|
|
230
|
+
return !wt(e, r);
|
|
231
|
+
}) && B("changeField"), t;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
re(e) ||
|
|
233
|
+
function Mt(e) {
|
|
234
|
+
re(e) || B("selectorType");
|
|
235
235
|
}
|
|
236
236
|
function St(e) {
|
|
237
|
-
re(e) || ce(e) ||
|
|
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
|
|
242
|
-
e ||
|
|
241
|
+
function jt(e) {
|
|
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,44 +254,44 @@ 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
|
-
},
|
|
257
|
+
}, B = X(Et)(Pt), ie = {
|
|
258
258
|
changes: Ot,
|
|
259
|
-
selector:
|
|
259
|
+
selector: Mt,
|
|
260
260
|
handler: St,
|
|
261
|
-
initial:
|
|
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
|
|
284
|
-
return e.current =
|
|
283
|
+
function $t(e, t) {
|
|
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
292
|
var Lt = {
|
|
293
|
-
create:
|
|
294
|
-
},
|
|
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
|
}
|
|
@@ -301,8 +301,8 @@ function Dt(e) {
|
|
|
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
|
};
|
|
@@ -310,17 +310,17 @@ function Dt(e) {
|
|
|
310
310
|
function Nt(e) {
|
|
311
311
|
return {}.toString.call(e).includes("Object");
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
return e ||
|
|
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
|
-
},
|
|
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,14 +353,14 @@ 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() {
|
|
@@ -368,14 +368,14 @@ function fe(e) {
|
|
|
368
368
|
}, r;
|
|
369
369
|
}
|
|
370
370
|
var Ft = Lt.create({
|
|
371
|
-
config:
|
|
371
|
+
config: Tt,
|
|
372
372
|
isInitialized: !1,
|
|
373
373
|
resolve: null,
|
|
374
374
|
reject: null,
|
|
375
375
|
monaco: null
|
|
376
|
-
}), _e =
|
|
376
|
+
}), _e = ft(Ft, 2), oe = _e[0], ue = _e[1];
|
|
377
377
|
function zt(e) {
|
|
378
|
-
var t =
|
|
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 zt(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,7 +399,7 @@ function Rt() {
|
|
|
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
|
}
|
|
@@ -410,7 +410,7 @@ 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 {
|
|
@@ -422,7 +422,7 @@ function Ht(e) {
|
|
|
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;
|
|
@@ -455,164 +455,164 @@ var pe = new Promise(function(e, t) {
|
|
|
455
455
|
});
|
|
456
456
|
}), W = {
|
|
457
457
|
config: zt,
|
|
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
|
|
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
470
|
L(e, []);
|
|
471
471
|
}
|
|
472
|
-
var
|
|
473
|
-
function
|
|
474
|
-
let n =
|
|
472
|
+
var we = nr;
|
|
473
|
+
function or(e, t, r = !0) {
|
|
474
|
+
let n = g(!0);
|
|
475
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 [
|
|
496
|
-
|
|
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
|
+
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
|
-
}, [
|
|
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
536
|
L(() => {
|
|
537
|
-
|
|
538
|
-
}, [
|
|
539
|
-
!
|
|
540
|
-
}, [
|
|
541
|
-
function
|
|
542
|
-
var
|
|
543
|
-
let c = (
|
|
544
|
-
u || ((
|
|
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] =
|
|
551
|
-
return
|
|
548
|
+
var ur = cr, sr = ye(ur);
|
|
549
|
+
function lr() {
|
|
550
|
+
let [e, t] = U(W.__getMonacoInstance());
|
|
551
|
+
return we(() => {
|
|
552
552
|
let r;
|
|
553
553
|
return e || (r = W.init(), r.then((n) => {
|
|
554
554
|
t(n);
|
|
555
555
|
})), () => r == null ? void 0 : r.cancel();
|
|
556
556
|
}), e;
|
|
557
557
|
}
|
|
558
|
-
var se =
|
|
559
|
-
function
|
|
560
|
-
let t =
|
|
558
|
+
var se = lr;
|
|
559
|
+
function dr(e) {
|
|
560
|
+
let t = g();
|
|
561
561
|
return L(() => {
|
|
562
562
|
t.current = e;
|
|
563
563
|
}, [e]), t.current;
|
|
564
564
|
}
|
|
565
|
-
var
|
|
566
|
-
function
|
|
567
|
-
let [
|
|
568
|
-
|
|
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
|
+
we(() => {
|
|
569
569
|
let b = W.init();
|
|
570
|
-
return b.then((
|
|
571
|
-
}),
|
|
572
|
-
var
|
|
573
|
-
let b = Z(
|
|
574
|
-
b !== ((
|
|
575
|
-
}, [i],
|
|
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
576
|
var b;
|
|
577
|
-
(b =
|
|
578
|
-
}, [
|
|
579
|
-
!
|
|
580
|
-
}, [n],
|
|
581
|
-
var
|
|
582
|
-
let b = (
|
|
583
|
-
b && o && ((
|
|
584
|
-
}, [o],
|
|
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
585
|
var b;
|
|
586
|
-
u !== void 0 && ((b =
|
|
587
|
-
}, [u],
|
|
586
|
+
u !== void 0 && ((b = l.current) == null || b.revealLine(u));
|
|
587
|
+
}, [u], O), _(() => {
|
|
588
588
|
var b;
|
|
589
|
-
(b =
|
|
590
|
-
}, [a],
|
|
589
|
+
(b = T.current) == null || b.editor.setTheme(a);
|
|
590
|
+
}, [a], O);
|
|
591
591
|
let J = G(() => {
|
|
592
592
|
var b;
|
|
593
|
-
if (!(!
|
|
594
|
-
|
|
595
|
-
let
|
|
596
|
-
|
|
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,
|
|
598
|
+
}, [e, t, r, n, o, i, f, v, s, a, u]);
|
|
599
599
|
L(() => {
|
|
600
|
-
|
|
601
|
-
}, [
|
|
602
|
-
!
|
|
603
|
-
}, [
|
|
604
|
-
var b,
|
|
605
|
-
|
|
606
|
-
q.current ||
|
|
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 b =
|
|
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 () => {
|
|
@@ -621,14 +621,14 @@ function fr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, lan
|
|
|
621
621
|
}
|
|
622
622
|
return () => {
|
|
623
623
|
};
|
|
624
|
-
}, [
|
|
624
|
+
}, [O, P]);
|
|
625
625
|
function Ye() {
|
|
626
|
-
var b,
|
|
627
|
-
(b =
|
|
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,49 @@ 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] =
|
|
654
|
+
const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = U(n ?? o ?? "vs-dark");
|
|
655
655
|
return L(() => {
|
|
656
656
|
var u;
|
|
657
|
-
(u = t == null ? void 0 : t.
|
|
658
|
-
z.editor.defineTheme(
|
|
657
|
+
(u = t == null ? void 0 : t.monacoThemes) == null || u.forEach((d) => {
|
|
658
|
+
z.editor.defineTheme(d.themeName, d.themeData);
|
|
659
659
|
});
|
|
660
660
|
}, [z]), L(() => {
|
|
661
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
|
-
|
|
674
|
+
const yr = (e) => {
|
|
675
|
+
const t = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
676
|
+
if (e < 60)
|
|
677
|
+
return t.format(-e, "second");
|
|
678
|
+
const r = Math.floor(e / 60);
|
|
679
|
+
if (r < 60)
|
|
680
|
+
return t.format(-r, "minute");
|
|
681
|
+
const n = Math.floor(r / 60);
|
|
682
|
+
if (n < 24)
|
|
683
|
+
return t.format(-n, "hour");
|
|
684
|
+
const o = Math.floor(n / 24);
|
|
685
|
+
if (o < 30)
|
|
686
|
+
return t.format(-o, "day");
|
|
687
|
+
const i = Math.floor(o / 30);
|
|
688
|
+
if (i < 12)
|
|
689
|
+
return t.format(-i, "month");
|
|
690
|
+
const a = Math.floor(i / 12);
|
|
691
|
+
return t.format(-a, "year");
|
|
692
|
+
}, br = (e) => {
|
|
693
|
+
const t = new Date(e), n = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 1e3), o = Math.abs(n);
|
|
694
|
+
return yr(o);
|
|
695
|
+
};
|
|
696
|
+
function wr({
|
|
675
697
|
instanceId: e,
|
|
676
698
|
lineNumbersPosition: t
|
|
677
699
|
}) {
|
|
@@ -701,10 +723,10 @@ function vr({
|
|
|
701
723
|
|
|
702
724
|
.monaco-editor-${e} .view-line .blame-editor-commit {
|
|
703
725
|
display: inline-block;
|
|
704
|
-
color: var(--
|
|
726
|
+
color: var(--cn-text-1);
|
|
705
727
|
}`, r;
|
|
706
728
|
}
|
|
707
|
-
function
|
|
729
|
+
function Or({
|
|
708
730
|
instanceId: e,
|
|
709
731
|
blameData: t,
|
|
710
732
|
dateWidth: r,
|
|
@@ -712,16 +734,16 @@ function yr({
|
|
|
712
734
|
}) {
|
|
713
735
|
let o = "";
|
|
714
736
|
return t.forEach((i) => {
|
|
715
|
-
var
|
|
716
|
-
const a = (
|
|
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}');` : "";
|
|
717
739
|
for (let w = i.fromLineNumber; w <= i.toLineNumber; w++)
|
|
718
740
|
w === i.fromLineNumber ? o += `
|
|
719
741
|
.monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
|
|
720
|
-
content: '${
|
|
742
|
+
content: '${vr(br((($ = (A = i == null ? void 0 : i.commitInfo) == null ? void 0 : A.author) == null ? void 0 : $.when) || ""))}';
|
|
721
743
|
position: absolute;
|
|
722
744
|
left: 10px;
|
|
723
745
|
top: 0px;
|
|
724
|
-
color:
|
|
746
|
+
color: var(--cn-text-3);
|
|
725
747
|
}
|
|
726
748
|
|
|
727
749
|
.monaco-editor-${e} .view-line .blame-editor-commit-${w}:after {
|
|
@@ -730,14 +752,14 @@ function yr({
|
|
|
730
752
|
border-radius: 50%;
|
|
731
753
|
padding: 4px;
|
|
732
754
|
text-align: center;
|
|
733
|
-
background:
|
|
755
|
+
background: var(--cn-set-gray-soft-bg);
|
|
734
756
|
line-height: 17px;
|
|
735
757
|
left: ${r + 10}px;
|
|
736
758
|
top: -4px;
|
|
737
|
-
color:
|
|
759
|
+
color: var(--cn-text-3);
|
|
738
760
|
width: ${n}px;
|
|
739
761
|
height: ${n}px;
|
|
740
|
-
${
|
|
762
|
+
${d}
|
|
741
763
|
background-size: 100% 100%;
|
|
742
764
|
}` : o += `
|
|
743
765
|
.monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
|
|
@@ -748,12 +770,12 @@ function yr({
|
|
|
748
770
|
}`;
|
|
749
771
|
}), o;
|
|
750
772
|
}
|
|
751
|
-
function
|
|
773
|
+
function Mr(e, t) {
|
|
752
774
|
let r = "";
|
|
753
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);
|
|
754
776
|
}
|
|
755
777
|
W.config({ monaco: z });
|
|
756
|
-
const he = 450,
|
|
778
|
+
const he = 450, Sr = 30, jr = 140, Er = 24, Pr = {
|
|
757
779
|
...le,
|
|
758
780
|
readOnly: !0,
|
|
759
781
|
matchBrackets: "never",
|
|
@@ -764,7 +786,7 @@ const he = 450, Or = 30, wr = 140, Sr = 24, Mr = {
|
|
|
764
786
|
renderWhitespace: "none",
|
|
765
787
|
renderLineHighlight: "none"
|
|
766
788
|
};
|
|
767
|
-
function
|
|
789
|
+
function qr({
|
|
768
790
|
code: e,
|
|
769
791
|
language: t,
|
|
770
792
|
themeConfig: r,
|
|
@@ -773,141 +795,142 @@ function zr({
|
|
|
773
795
|
showSeparators: i = !0,
|
|
774
796
|
theme: a,
|
|
775
797
|
height: u = "75vh",
|
|
776
|
-
options:
|
|
798
|
+
options: d,
|
|
799
|
+
className: f
|
|
777
800
|
}) {
|
|
778
|
-
const
|
|
801
|
+
const v = g(o), s = g(null), m = g(gr(5));
|
|
779
802
|
se();
|
|
780
|
-
const [
|
|
803
|
+
const [C, h] = U(), A = g(null), $ = g(null);
|
|
781
804
|
L(() => {
|
|
782
|
-
|
|
805
|
+
v.current = o;
|
|
783
806
|
}, [o]);
|
|
784
807
|
function w() {
|
|
785
|
-
const
|
|
786
|
-
if (!
|
|
808
|
+
const l = $.current, E = A.current;
|
|
809
|
+
if (!l || !E)
|
|
787
810
|
return;
|
|
788
|
-
i &&
|
|
789
|
-
|
|
811
|
+
i && l.changeViewZones(function(M) {
|
|
812
|
+
M.addZone({
|
|
790
813
|
afterLineNumber: 0,
|
|
791
814
|
heightInPx: 10,
|
|
792
815
|
domNode: document.createElement("div")
|
|
793
|
-
}),
|
|
794
|
-
if (
|
|
795
|
-
const
|
|
796
|
-
|
|
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({
|
|
797
820
|
afterLineNumber: N.toLineNumber,
|
|
798
821
|
heightInPx: 20,
|
|
799
|
-
domNode:
|
|
822
|
+
domNode: p
|
|
800
823
|
});
|
|
801
824
|
}
|
|
802
825
|
});
|
|
803
826
|
});
|
|
804
|
-
const
|
|
805
|
-
|
|
827
|
+
const x = [];
|
|
828
|
+
v.current.forEach((M) => {
|
|
806
829
|
var N;
|
|
807
|
-
for (let
|
|
808
|
-
|
|
809
|
-
range: new
|
|
830
|
+
for (let c = M.fromLineNumber; c <= M.toLineNumber; c++)
|
|
831
|
+
x.push({
|
|
832
|
+
range: new E.Range(c, 0, c + 1, 0),
|
|
810
833
|
options: {
|
|
811
834
|
before: {
|
|
812
|
-
content:
|
|
813
|
-
|
|
814
|
-
|
|
835
|
+
content: Mr(
|
|
836
|
+
c === M.fromLineNumber && ((N = M == null ? void 0 : M.commitInfo) == null ? void 0 : N.title) || "",
|
|
837
|
+
Sr
|
|
815
838
|
),
|
|
816
|
-
cursorStops:
|
|
817
|
-
inlineClassName: `blame-editor-commit blame-editor-commit-${
|
|
839
|
+
cursorStops: E.editor.InjectedTextCursorStops.None,
|
|
840
|
+
inlineClassName: `blame-editor-commit blame-editor-commit-${c}`
|
|
818
841
|
}
|
|
819
842
|
}
|
|
820
843
|
});
|
|
821
|
-
}),
|
|
844
|
+
}), l.createDecorationsCollection(x);
|
|
822
845
|
}
|
|
823
|
-
function
|
|
824
|
-
var
|
|
825
|
-
|
|
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, {
|
|
826
849
|
noSuggestionDiagnostics: !0,
|
|
827
850
|
noSyntaxValidation: !0,
|
|
828
851
|
noSemanticValidation: !0
|
|
829
|
-
}), (
|
|
852
|
+
}), (k = (p = (c = E.languages.typescript) == null ? void 0 : c.javascriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || k.call(p, {
|
|
830
853
|
noSuggestionDiagnostics: !0,
|
|
831
854
|
noSyntaxValidation: !0,
|
|
832
855
|
noSemanticValidation: !0
|
|
833
856
|
}), w();
|
|
834
857
|
}
|
|
835
858
|
L(() => {
|
|
836
|
-
|
|
859
|
+
C == null || C.setValue(e);
|
|
837
860
|
}, [e]);
|
|
838
|
-
const { theme:
|
|
839
|
-
() =>
|
|
840
|
-
instanceId:
|
|
861
|
+
const { theme: D } = de({ monacoRef: A, themeConfig: r, editor: C, theme: a }), P = F(
|
|
862
|
+
() => wr({
|
|
863
|
+
instanceId: m.current,
|
|
841
864
|
lineNumbersPosition: n
|
|
842
865
|
}),
|
|
843
866
|
[o]
|
|
844
|
-
),
|
|
845
|
-
() =>
|
|
846
|
-
instanceId:
|
|
867
|
+
), O = F(
|
|
868
|
+
() => Or({
|
|
869
|
+
instanceId: m.current,
|
|
847
870
|
blameData: o,
|
|
848
|
-
avatarSize:
|
|
849
|
-
dateWidth:
|
|
871
|
+
avatarSize: Er,
|
|
872
|
+
dateWidth: jr
|
|
850
873
|
}),
|
|
851
874
|
[o]
|
|
852
875
|
);
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
},
|
|
863
|
-
return
|
|
864
|
-
|
|
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();
|
|
865
888
|
};
|
|
866
889
|
}
|
|
867
890
|
}
|
|
868
891
|
});
|
|
869
|
-
const
|
|
870
|
-
.monaco-editor-${
|
|
871
|
-
|
|
892
|
+
const S = F(() => `
|
|
893
|
+
.monaco-editor-${m.current} .margin {
|
|
894
|
+
display: var(--line-number-display);
|
|
895
|
+
left: var(--line-number-offset);
|
|
872
896
|
pointer-events: none;
|
|
873
|
-
}`, [
|
|
874
|
-
.monaco-editor-${h.current} .view-overlays {
|
|
897
|
+
}`, []), j = F(() => `.monaco-editor-${m.current} .view-overlays {
|
|
875
898
|
clip-path: polygon(${he + 16}px 0, 100% 0%, 100% 100%, ${he + 16}px 100%);
|
|
876
899
|
height:100% !important;
|
|
877
|
-
}`,
|
|
900
|
+
}`, []), H = F(
|
|
878
901
|
() => ({
|
|
879
|
-
...
|
|
880
|
-
...
|
|
902
|
+
...Pr,
|
|
903
|
+
...d
|
|
881
904
|
}),
|
|
882
|
-
[
|
|
883
|
-
)
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
dangerouslySetInnerHTML: {
|
|
889
|
-
__html: `${x} ${M} ${j} ${E}`
|
|
890
|
-
}
|
|
905
|
+
[d]
|
|
906
|
+
), T = F(() => /* @__PURE__ */ R.jsx(
|
|
907
|
+
"style",
|
|
908
|
+
{
|
|
909
|
+
dangerouslySetInnerHTML: {
|
|
910
|
+
__html: `${P} ${O} ${S} ${j}`
|
|
891
911
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
912
|
+
}
|
|
913
|
+
), [P, O, j, S]);
|
|
914
|
+
return /* @__PURE__ */ R.jsxs("div", { className: f, ref: s, children: [
|
|
915
|
+
T,
|
|
916
|
+
/* @__PURE__ */ R.jsx(
|
|
917
|
+
Oe,
|
|
895
918
|
{
|
|
896
|
-
className: `monaco-editor-${
|
|
919
|
+
className: `monaco-editor-${m.current} overflow-hidden rounded-b-md border-x border-b`,
|
|
897
920
|
height: u,
|
|
898
921
|
language: t,
|
|
899
|
-
theme:
|
|
900
|
-
options:
|
|
901
|
-
onMount:
|
|
922
|
+
theme: D,
|
|
923
|
+
options: H,
|
|
924
|
+
onMount: y
|
|
902
925
|
}
|
|
903
926
|
)
|
|
904
927
|
] });
|
|
905
928
|
}
|
|
906
929
|
W.config({ monaco: z });
|
|
907
|
-
const
|
|
930
|
+
const xr = {
|
|
908
931
|
...le
|
|
909
932
|
};
|
|
910
|
-
function
|
|
933
|
+
function Br({
|
|
911
934
|
codeRevision: e,
|
|
912
935
|
onCodeRevisionChange: t,
|
|
913
936
|
language: r,
|
|
@@ -918,14 +941,14 @@ function Rr({
|
|
|
918
941
|
className: u
|
|
919
942
|
}) {
|
|
920
943
|
se();
|
|
921
|
-
const [
|
|
922
|
-
(
|
|
923
|
-
var
|
|
924
|
-
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, {
|
|
925
948
|
noSuggestionDiagnostics: !0,
|
|
926
949
|
noSyntaxValidation: !0,
|
|
927
950
|
noSemanticValidation: !0
|
|
928
|
-
}), (
|
|
951
|
+
}), (j = (S = (O = w.languages.typescript) == null ? void 0 : O.javascriptDefaults) == null ? void 0 : S.setDiagnosticsOptions) == null || j.call(S, {
|
|
929
952
|
noSuggestionDiagnostics: !0,
|
|
930
953
|
noSyntaxValidation: !0,
|
|
931
954
|
noSemanticValidation: !0
|
|
@@ -934,35 +957,35 @@ function Rr({
|
|
|
934
957
|
[e.code]
|
|
935
958
|
);
|
|
936
959
|
L(() => {
|
|
937
|
-
var
|
|
938
|
-
if (m.current && (!e.revisionId || e.revisionId > Number((
|
|
939
|
-
const
|
|
940
|
-
|
|
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", [
|
|
941
964
|
{
|
|
942
|
-
range:
|
|
965
|
+
range: y.getFullModelRange(),
|
|
943
966
|
text: e.code
|
|
944
967
|
}
|
|
945
968
|
]), m.current.pushUndoStop()));
|
|
946
969
|
}
|
|
947
970
|
}, [e, m.current]);
|
|
948
|
-
const { theme:
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
|
|
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(
|
|
973
|
+
Oe,
|
|
951
974
|
{
|
|
952
975
|
className: u,
|
|
953
976
|
height: a,
|
|
954
|
-
onChange: (
|
|
955
|
-
|
|
977
|
+
onChange: ($, w) => {
|
|
978
|
+
s.current = { code: $ ?? "", revisionId: w.versionId }, t({ ...s.current }, w);
|
|
956
979
|
},
|
|
957
980
|
language: r,
|
|
958
|
-
theme:
|
|
959
|
-
options:
|
|
960
|
-
onMount:
|
|
981
|
+
theme: h,
|
|
982
|
+
options: A,
|
|
983
|
+
onMount: C
|
|
961
984
|
}
|
|
962
985
|
) });
|
|
963
986
|
}
|
|
964
987
|
W.config({ monaco: z });
|
|
965
|
-
const
|
|
988
|
+
const Cr = {
|
|
966
989
|
...le,
|
|
967
990
|
codeLens: !1,
|
|
968
991
|
smartSelect: {
|
|
@@ -971,7 +994,7 @@ const Er = {
|
|
|
971
994
|
originalEditable: !1,
|
|
972
995
|
overviewRulerBorder: !1
|
|
973
996
|
};
|
|
974
|
-
function
|
|
997
|
+
function Wr({
|
|
975
998
|
original: e,
|
|
976
999
|
modified: t,
|
|
977
1000
|
language: r,
|
|
@@ -981,54 +1004,54 @@ function qr({
|
|
|
981
1004
|
height: a = "75vh"
|
|
982
1005
|
}) {
|
|
983
1006
|
se();
|
|
984
|
-
const [u,
|
|
985
|
-
return /* @__PURE__ */
|
|
986
|
-
|
|
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,
|
|
987
1010
|
{
|
|
988
1011
|
className: "overflow-hidden rounded-b-md border-x border-b",
|
|
989
1012
|
language: r,
|
|
990
|
-
theme:
|
|
1013
|
+
theme: v,
|
|
991
1014
|
original: e,
|
|
992
1015
|
modified: t,
|
|
993
1016
|
height: a,
|
|
994
|
-
options:
|
|
995
|
-
onMount:
|
|
1017
|
+
options: s,
|
|
1018
|
+
onMount: d
|
|
996
1019
|
}
|
|
997
1020
|
) });
|
|
998
1021
|
}
|
|
999
|
-
var
|
|
1000
|
-
function
|
|
1022
|
+
var ze = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(ze || {});
|
|
1023
|
+
function $r(e) {
|
|
1001
1024
|
const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), i = [];
|
|
1002
1025
|
return r == null || r.forEach((a) => {
|
|
1003
1026
|
const u = a.actions;
|
|
1004
|
-
a.selectors.forEach((
|
|
1005
|
-
switch (
|
|
1006
|
-
case
|
|
1007
|
-
|
|
1008
|
-
let m = Object.keys(o).map((
|
|
1009
|
-
fullPath:
|
|
1010
|
-
path:
|
|
1011
|
-
symbol: o[
|
|
1012
|
-
})).filter((
|
|
1013
|
-
m = m.map((
|
|
1014
|
-
...
|
|
1015
|
-
path:
|
|
1016
|
-
})), m.filter((
|
|
1017
|
-
const
|
|
1018
|
-
u.forEach((
|
|
1019
|
-
const
|
|
1027
|
+
a.selectors.forEach((f) => {
|
|
1028
|
+
switch (f.type) {
|
|
1029
|
+
case ze.ContainsPath: {
|
|
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 = {
|
|
1020
1043
|
range: w,
|
|
1021
|
-
symbols: [
|
|
1022
|
-
onClick:
|
|
1023
|
-
data:
|
|
1024
|
-
path:
|
|
1044
|
+
symbols: [$],
|
|
1045
|
+
onClick: y.onClick,
|
|
1046
|
+
data: y.data,
|
|
1047
|
+
path: A
|
|
1025
1048
|
};
|
|
1026
1049
|
i.push({
|
|
1027
1050
|
range: w,
|
|
1028
1051
|
command: {
|
|
1029
1052
|
id: n,
|
|
1030
|
-
title:
|
|
1031
|
-
arguments: [
|
|
1053
|
+
title: y.title,
|
|
1054
|
+
arguments: [D]
|
|
1032
1055
|
}
|
|
1033
1056
|
});
|
|
1034
1057
|
});
|
|
@@ -1050,38 +1073,38 @@ const te = class te {
|
|
|
1050
1073
|
};
|
|
1051
1074
|
je(te, "data", {});
|
|
1052
1075
|
let ve = te;
|
|
1053
|
-
async function
|
|
1076
|
+
async function He(e) {
|
|
1054
1077
|
const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
|
|
1055
1078
|
return await t.OutlineModel.create(r, e);
|
|
1056
1079
|
}
|
|
1057
|
-
function
|
|
1080
|
+
function qe(e) {
|
|
1058
1081
|
const t = /* @__PURE__ */ new Map();
|
|
1059
|
-
return
|
|
1082
|
+
return Me({
|
|
1060
1083
|
pathSymbolMap: t,
|
|
1061
1084
|
parentPath: "",
|
|
1062
1085
|
children: e.children,
|
|
1063
1086
|
parentKind: ge.SymbolKind.Module
|
|
1064
1087
|
}), t;
|
|
1065
1088
|
}
|
|
1066
|
-
function
|
|
1089
|
+
function Me(e) {
|
|
1067
1090
|
switch (e.parentKind) {
|
|
1068
1091
|
case ge.SymbolKind.Module: {
|
|
1069
|
-
|
|
1092
|
+
Ir(e);
|
|
1070
1093
|
break;
|
|
1071
1094
|
}
|
|
1072
1095
|
case ge.SymbolKind.Array: {
|
|
1073
|
-
|
|
1096
|
+
Lr(e);
|
|
1074
1097
|
break;
|
|
1075
1098
|
}
|
|
1076
1099
|
default:
|
|
1077
|
-
|
|
1100
|
+
Tr(e);
|
|
1078
1101
|
}
|
|
1079
1102
|
}
|
|
1080
|
-
function
|
|
1103
|
+
function Ir(e) {
|
|
1081
1104
|
e.children.forEach((t) => {
|
|
1082
1105
|
var n;
|
|
1083
1106
|
let r = e.parentPath;
|
|
1084
|
-
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)),
|
|
1107
|
+
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Me({
|
|
1085
1108
|
pathSymbolMap: e.pathSymbolMap,
|
|
1086
1109
|
parentPath: r,
|
|
1087
1110
|
children: t.children,
|
|
@@ -1089,11 +1112,11 @@ function xr(e) {
|
|
|
1089
1112
|
});
|
|
1090
1113
|
});
|
|
1091
1114
|
}
|
|
1092
|
-
function
|
|
1115
|
+
function Lr(e) {
|
|
1093
1116
|
let t = 0;
|
|
1094
1117
|
e.children.forEach((r) => {
|
|
1095
1118
|
const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
|
|
1096
|
-
e.pathSymbolMap.set(n, r.symbol), t += 1,
|
|
1119
|
+
e.pathSymbolMap.set(n, r.symbol), t += 1, Me({
|
|
1097
1120
|
pathSymbolMap: e.pathSymbolMap,
|
|
1098
1121
|
parentPath: n,
|
|
1099
1122
|
children: r.children,
|
|
@@ -1101,40 +1124,40 @@ function Cr(e) {
|
|
|
1101
1124
|
});
|
|
1102
1125
|
});
|
|
1103
1126
|
}
|
|
1104
|
-
function
|
|
1127
|
+
function Tr(e) {
|
|
1105
1128
|
const t = e.children.get("0");
|
|
1106
1129
|
if (t) {
|
|
1107
1130
|
const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
|
|
1108
1131
|
e.pathSymbolMap.set(r, t.symbol);
|
|
1109
1132
|
}
|
|
1110
1133
|
}
|
|
1111
|
-
function
|
|
1134
|
+
function Dr({
|
|
1112
1135
|
editorRef: e,
|
|
1113
1136
|
inlineActions: t
|
|
1114
1137
|
}) {
|
|
1115
1138
|
L(() => z.languages.registerCodeLensProvider("yaml", {
|
|
1116
1139
|
provideCodeLenses: async (n) => {
|
|
1117
|
-
var
|
|
1118
|
-
const o = await
|
|
1119
|
-
|
|
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 });
|
|
1120
1143
|
});
|
|
1121
1144
|
return a ? {
|
|
1122
|
-
lenses:
|
|
1145
|
+
lenses: $r({ pathSymbolMap: i, inlineActions: t, commandId: a }),
|
|
1123
1146
|
dispose: () => {
|
|
1124
1147
|
}
|
|
1125
1148
|
} : void 0;
|
|
1126
1149
|
}
|
|
1127
1150
|
}).dispose, [t, e]);
|
|
1128
1151
|
}
|
|
1129
|
-
const
|
|
1130
|
-
const [r, n] =
|
|
1152
|
+
const Nr = ({ editorRef: e, selection: t }) => {
|
|
1153
|
+
const [r, n] = U(), o = F(
|
|
1131
1154
|
() => async (i, a, u) => {
|
|
1132
|
-
var m,
|
|
1133
|
-
const
|
|
1134
|
-
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)
|
|
1135
1158
|
return n(void 0);
|
|
1136
|
-
const
|
|
1137
|
-
|
|
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)));
|
|
1138
1161
|
},
|
|
1139
1162
|
[]
|
|
1140
1163
|
);
|
|
@@ -1166,7 +1189,7 @@ const Ir = ({ editorRef: e, selection: t }) => {
|
|
|
1166
1189
|
]);
|
|
1167
1190
|
return () => i == null ? void 0 : i.clear();
|
|
1168
1191
|
}, [r, e, t == null ? void 0 : t.className]);
|
|
1169
|
-
},
|
|
1192
|
+
}, Be = Qe({
|
|
1170
1193
|
markers: [],
|
|
1171
1194
|
setMarkers: () => {
|
|
1172
1195
|
},
|
|
@@ -1176,17 +1199,17 @@ const Ir = ({ editorRef: e, selection: t }) => {
|
|
|
1176
1199
|
updateCursorPosition: (e) => {
|
|
1177
1200
|
}
|
|
1178
1201
|
});
|
|
1179
|
-
function
|
|
1202
|
+
function Kr({
|
|
1180
1203
|
children: e
|
|
1181
1204
|
}) {
|
|
1182
|
-
const [t, r] =
|
|
1205
|
+
const [t, r] = U([]), [n, o] = U(null), i = G(
|
|
1183
1206
|
(a) => {
|
|
1184
1207
|
n == null || n.setPosition(a), n == null || n.revealLineInCenterIfOutsideViewport(a.lineNumber), n == null || n.focus();
|
|
1185
1208
|
},
|
|
1186
1209
|
[n]
|
|
1187
1210
|
);
|
|
1188
|
-
return /* @__PURE__ */
|
|
1189
|
-
|
|
1211
|
+
return /* @__PURE__ */ R.jsx(
|
|
1212
|
+
Be.Provider,
|
|
1190
1213
|
{
|
|
1191
1214
|
value: {
|
|
1192
1215
|
markers: t,
|
|
@@ -1200,23 +1223,23 @@ function Br({
|
|
|
1200
1223
|
);
|
|
1201
1224
|
}
|
|
1202
1225
|
function We() {
|
|
1203
|
-
return
|
|
1226
|
+
return Xe(Be);
|
|
1204
1227
|
}
|
|
1205
|
-
const
|
|
1228
|
+
const kr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
|
|
1206
1229
|
const { setMarkers: n } = We();
|
|
1207
1230
|
L(() => {
|
|
1208
1231
|
let o;
|
|
1209
1232
|
const i = setTimeout(() => {
|
|
1210
1233
|
var u;
|
|
1211
1234
|
const a = (u = e.current) == null ? void 0 : u.editor;
|
|
1212
|
-
a && (o = a.onDidChangeMarkers((
|
|
1213
|
-
var
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1235
|
+
a && (o = a.onDidChangeMarkers((d) => {
|
|
1236
|
+
var s;
|
|
1237
|
+
const f = (s = t.current) == null ? void 0 : s.getModel();
|
|
1238
|
+
if (!f)
|
|
1216
1239
|
return;
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
const m = z.editor.getModelMarkers({ resource:
|
|
1240
|
+
const v = f.uri.toString();
|
|
1241
|
+
if (d.some((m) => m.toString() === v)) {
|
|
1242
|
+
const m = z.editor.getModelMarkers({ resource: f.uri });
|
|
1220
1243
|
n(m);
|
|
1221
1244
|
}
|
|
1222
1245
|
}));
|
|
@@ -1226,14 +1249,14 @@ const Dr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
|
|
|
1226
1249
|
};
|
|
1227
1250
|
}, [e, r, n]);
|
|
1228
1251
|
};
|
|
1229
|
-
function
|
|
1252
|
+
function Ar(e) {
|
|
1230
1253
|
var n, o;
|
|
1231
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]);
|
|
1232
1255
|
r !== -1 ? t[r] = e : t.push(e), Ke(t);
|
|
1233
1256
|
}
|
|
1234
|
-
function
|
|
1257
|
+
function Vr(e) {
|
|
1235
1258
|
var n, o;
|
|
1236
|
-
const r = (((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !==
|
|
1259
|
+
const r = (((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== Se(e));
|
|
1237
1260
|
Ke(r);
|
|
1238
1261
|
}
|
|
1239
1262
|
function Ke(e) {
|
|
@@ -1246,23 +1269,23 @@ function Ke(e) {
|
|
|
1246
1269
|
};
|
|
1247
1270
|
be.setDiagnosticsOptions({ ...t });
|
|
1248
1271
|
}
|
|
1249
|
-
const
|
|
1272
|
+
const Se = (e) => et.parse(`file://${e}`).toString(), _r = (e) => {
|
|
1250
1273
|
const { schemaConfig: t, instanceId: r } = e;
|
|
1251
1274
|
L(() => {
|
|
1252
1275
|
if (t != null && t.schema)
|
|
1253
|
-
return
|
|
1254
|
-
fileMatch: [
|
|
1276
|
+
return Ar({
|
|
1277
|
+
fileMatch: [Se(r.toString())],
|
|
1255
1278
|
...t
|
|
1256
1279
|
}), () => {
|
|
1257
|
-
|
|
1280
|
+
Vr(r);
|
|
1258
1281
|
};
|
|
1259
1282
|
}, [t == null ? void 0 : t.schema, r]);
|
|
1260
1283
|
};
|
|
1261
1284
|
W.config({ monaco: z });
|
|
1262
|
-
const
|
|
1285
|
+
const Ur = {
|
|
1263
1286
|
...le,
|
|
1264
1287
|
folding: !0
|
|
1265
|
-
},
|
|
1288
|
+
}, Yr = function(t) {
|
|
1266
1289
|
const {
|
|
1267
1290
|
yamlRevision: r,
|
|
1268
1291
|
schemaConfig: n,
|
|
@@ -1270,86 +1293,86 @@ const Ar = {
|
|
|
1270
1293
|
themeConfig: i,
|
|
1271
1294
|
onYamlRevisionChange: a,
|
|
1272
1295
|
selection: u,
|
|
1273
|
-
theme:
|
|
1274
|
-
options:
|
|
1275
|
-
animateOnUpdate:
|
|
1276
|
-
onAnimateEnd:
|
|
1296
|
+
theme: d,
|
|
1297
|
+
options: f,
|
|
1298
|
+
animateOnUpdate: v = !1,
|
|
1299
|
+
onAnimateEnd: s,
|
|
1277
1300
|
instanceId: m
|
|
1278
|
-
} = t,
|
|
1279
|
-
(
|
|
1280
|
-
var
|
|
1281
|
-
const
|
|
1282
|
-
`),
|
|
1283
|
-
if (
|
|
1284
|
-
(c =
|
|
1285
|
-
let
|
|
1286
|
-
|
|
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(() => {
|
|
1287
1310
|
var q;
|
|
1288
|
-
|
|
1311
|
+
k < x.length ? (C && ((q = P.current) == null || q.executeEdits("addLine", [
|
|
1289
1312
|
{
|
|
1290
|
-
range: new
|
|
1291
|
-
text:
|
|
1313
|
+
range: new C.Range(k + 1, 1, k + 1, 1),
|
|
1314
|
+
text: x[k] + `
|
|
1292
1315
|
`
|
|
1293
1316
|
}
|
|
1294
|
-
])),
|
|
1295
|
-
}, 100), (
|
|
1317
|
+
])), k++) : O.current && (clearInterval(O.current), s == null || s());
|
|
1318
|
+
}, 100), (p = P.current) == null || p.pushUndoStop();
|
|
1296
1319
|
}
|
|
1297
1320
|
},
|
|
1298
|
-
[
|
|
1321
|
+
[C]
|
|
1299
1322
|
);
|
|
1300
1323
|
L(() => () => {
|
|
1301
|
-
|
|
1324
|
+
O.current && clearInterval(O.current);
|
|
1302
1325
|
}, []);
|
|
1303
|
-
function E
|
|
1304
|
-
|
|
1305
|
-
var
|
|
1306
|
-
(
|
|
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");
|
|
1307
1330
|
}, 50);
|
|
1308
1331
|
}
|
|
1309
1332
|
L(() => {
|
|
1310
|
-
var
|
|
1311
|
-
if (
|
|
1312
|
-
const
|
|
1313
|
-
|
|
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", [
|
|
1314
1337
|
{
|
|
1315
|
-
range:
|
|
1316
|
-
text:
|
|
1338
|
+
range: x.getFullModelRange(),
|
|
1339
|
+
text: v ? "" : r.yaml
|
|
1317
1340
|
}
|
|
1318
|
-
]),
|
|
1341
|
+
]), v && S(r.yaml));
|
|
1319
1342
|
}
|
|
1320
|
-
}, [
|
|
1321
|
-
const { theme:
|
|
1322
|
-
|
|
1323
|
-
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(
|
|
1324
1347
|
() => ({
|
|
1325
|
-
...
|
|
1326
|
-
...
|
|
1348
|
+
...Ur,
|
|
1349
|
+
...f
|
|
1327
1350
|
}),
|
|
1328
|
-
[
|
|
1351
|
+
[f]
|
|
1329
1352
|
);
|
|
1330
|
-
return /* @__PURE__ */
|
|
1331
|
-
|
|
1353
|
+
return /* @__PURE__ */ R.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: w, children: /* @__PURE__ */ R.jsx(
|
|
1354
|
+
Oe,
|
|
1332
1355
|
{
|
|
1333
|
-
onChange: (
|
|
1334
|
-
|
|
1356
|
+
onChange: (E, x) => {
|
|
1357
|
+
D.current = { yaml: E ?? "", revisionId: x.versionId }, a({ ...D.current }, x);
|
|
1335
1358
|
},
|
|
1336
1359
|
language: "yaml",
|
|
1337
|
-
theme:
|
|
1338
|
-
options:
|
|
1339
|
-
path:
|
|
1340
|
-
onMount:
|
|
1360
|
+
theme: H,
|
|
1361
|
+
options: l,
|
|
1362
|
+
path: T,
|
|
1363
|
+
onMount: j
|
|
1341
1364
|
}
|
|
1342
1365
|
) });
|
|
1343
1366
|
};
|
|
1344
1367
|
export {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1368
|
+
qr as BlameEditor,
|
|
1369
|
+
Wr as CodeDiffEditor,
|
|
1370
|
+
Br as CodeEditor,
|
|
1348
1371
|
ve as MonacoGlobals,
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1372
|
+
ze as SelectorType,
|
|
1373
|
+
Yr as YamlEditor,
|
|
1374
|
+
Be as YamlEditorContext,
|
|
1375
|
+
Kr as YamlEditorContextProvider,
|
|
1353
1376
|
We as useYamlEditorContext
|
|
1354
1377
|
};
|
|
1355
1378
|
//# sourceMappingURL=index.js.map
|