@harnessio/yaml-editor 0.20.0 → 0.22.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/components/BlameEditorV2.d.ts +21 -0
- package/dist/components/CodeEditor.d.ts +7 -2
- package/dist/components/YamlEditor.d.ts +1 -0
- package/dist/hooks/useHighlight.d.ts +6 -0
- package/dist/hooks/useLinesSelection.d.ts +9 -0
- package/dist/index.cjs +62 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +844 -550
- package/dist/index.js.map +1 -1
- package/dist/types/blame.d.ts +1 -0
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import { languages as
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
var tt = Object.defineProperty;
|
|
2
|
+
var rt = (e, t, r) => t in e ? tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Pe = (e, t, r) => (rt(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import Y, { memo as Me, useState as R, useRef as v, useCallback as J, useEffect as N, useMemo as k, useLayoutEffect as Ve, createContext as nt, useContext as ot } from "react";
|
|
5
|
+
import * as F from "monaco-editor";
|
|
6
|
+
import { languages as be, Uri as it } from "monaco-editor";
|
|
7
|
+
import { render as at } from "react-dom";
|
|
8
|
+
import { yamlDefaults as Oe } from "monaco-yaml";
|
|
9
|
+
var ke = { exports: {} }, ne = {};
|
|
9
10
|
/*
|
|
10
11
|
object-assign
|
|
11
12
|
(c) Sindre Sorhus
|
|
12
13
|
@license MIT
|
|
13
14
|
*/
|
|
14
|
-
var
|
|
15
|
-
function
|
|
15
|
+
var Ce = Object.getOwnPropertySymbols, ct = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
function ut(e) {
|
|
16
17
|
if (e == null)
|
|
17
18
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
18
19
|
return Object(e);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function lt() {
|
|
21
22
|
try {
|
|
22
23
|
if (!Object.assign)
|
|
23
24
|
return !1;
|
|
@@ -39,7 +40,7 @@ function nt() {
|
|
|
39
40
|
return !1;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
lt();
|
|
43
44
|
/** @license React v17.0.2
|
|
44
45
|
* react-jsx-runtime.production.min.js
|
|
45
46
|
*
|
|
@@ -48,28 +49,28 @@ nt();
|
|
|
48
49
|
* This source code is licensed under the MIT license found in the
|
|
49
50
|
* LICENSE file in the root directory of this source tree.
|
|
50
51
|
*/
|
|
51
|
-
var
|
|
52
|
+
var dt = Y, Ae = 60103;
|
|
52
53
|
ne.Fragment = 60107;
|
|
53
54
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
54
|
-
var
|
|
55
|
-
|
|
55
|
+
var $e = Symbol.for;
|
|
56
|
+
Ae = $e("react.element"), ne.Fragment = $e("react.fragment");
|
|
56
57
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
58
|
+
var ft = dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, pt = Object.prototype.hasOwnProperty, mt = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
59
|
+
function He(e, t, r) {
|
|
59
60
|
var n, o = {}, i = null, a = null;
|
|
60
61
|
r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (a = t.ref);
|
|
61
62
|
for (n in t)
|
|
62
|
-
|
|
63
|
+
pt.call(t, n) && !mt.hasOwnProperty(n) && (o[n] = t[n]);
|
|
63
64
|
if (e && e.defaultProps)
|
|
64
65
|
for (n in t = e.defaultProps, t)
|
|
65
66
|
o[n] === void 0 && (o[n] = t[n]);
|
|
66
|
-
return { $$typeof:
|
|
67
|
+
return { $$typeof: Ae, type: e, key: i, ref: a, props: o, _owner: ft.current };
|
|
67
68
|
}
|
|
68
|
-
ne.jsx =
|
|
69
|
-
ne.jsxs =
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
function
|
|
69
|
+
ne.jsx = He;
|
|
70
|
+
ne.jsxs = He;
|
|
71
|
+
ke.exports = ne;
|
|
72
|
+
var A = ke.exports;
|
|
73
|
+
function gt(e, t, r) {
|
|
73
74
|
return t in e ? Object.defineProperty(e, t, {
|
|
74
75
|
value: r,
|
|
75
76
|
enumerable: !0,
|
|
@@ -77,7 +78,7 @@ function ut(e, t, r) {
|
|
|
77
78
|
writable: !0
|
|
78
79
|
}) : e[t] = r, e;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function Ie(e, t) {
|
|
81
82
|
var r = Object.keys(e);
|
|
82
83
|
if (Object.getOwnPropertySymbols) {
|
|
83
84
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -87,18 +88,18 @@ function xe(e, t) {
|
|
|
87
88
|
}
|
|
88
89
|
return r;
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function Ne(e) {
|
|
91
92
|
for (var t = 1; t < arguments.length; t++) {
|
|
92
93
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
93
|
-
t % 2 ?
|
|
94
|
-
|
|
95
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
94
|
+
t % 2 ? Ie(Object(r), !0).forEach(function(n) {
|
|
95
|
+
gt(e, n, r[n]);
|
|
96
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ie(Object(r)).forEach(function(n) {
|
|
96
97
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
100
|
return e;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function ht(e, t) {
|
|
102
103
|
if (e == null)
|
|
103
104
|
return {};
|
|
104
105
|
var r = {}, n = Object.keys(e), o, i;
|
|
@@ -106,10 +107,10 @@ function st(e, t) {
|
|
|
106
107
|
o = n[i], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
|
|
107
108
|
return r;
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function vt(e, t) {
|
|
110
111
|
if (e == null)
|
|
111
112
|
return {};
|
|
112
|
-
var r =
|
|
113
|
+
var r = ht(e, t), n, o;
|
|
113
114
|
if (Object.getOwnPropertySymbols) {
|
|
114
115
|
var i = Object.getOwnPropertySymbols(e);
|
|
115
116
|
for (o = 0; o < i.length; o++)
|
|
@@ -117,14 +118,14 @@ function lt(e, t) {
|
|
|
117
118
|
}
|
|
118
119
|
return r;
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
121
|
+
function yt(e, t) {
|
|
122
|
+
return bt(e) || wt(e, t) || Mt(e, t) || Ot();
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function bt(e) {
|
|
124
125
|
if (Array.isArray(e))
|
|
125
126
|
return e;
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function wt(e, t) {
|
|
128
129
|
if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
|
|
129
130
|
var r = [], n = !0, o = !1, i = void 0;
|
|
130
131
|
try {
|
|
@@ -143,28 +144,28 @@ function pt(e, t) {
|
|
|
143
144
|
return r;
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function Mt(e, t) {
|
|
147
148
|
if (e) {
|
|
148
149
|
if (typeof e == "string")
|
|
149
|
-
return
|
|
150
|
+
return Le(e, t);
|
|
150
151
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
151
152
|
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set")
|
|
152
153
|
return Array.from(e);
|
|
153
154
|
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
|
|
154
|
-
return
|
|
155
|
+
return Le(e, t);
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function Le(e, t) {
|
|
158
159
|
(t == null || t > e.length) && (t = e.length);
|
|
159
160
|
for (var r = 0, n = new Array(t); r < t; r++)
|
|
160
161
|
n[r] = e[r];
|
|
161
162
|
return n;
|
|
162
163
|
}
|
|
163
|
-
function
|
|
164
|
+
function Ot() {
|
|
164
165
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
165
166
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function St(e, t, r) {
|
|
168
169
|
return t in e ? Object.defineProperty(e, t, {
|
|
169
170
|
value: r,
|
|
170
171
|
enumerable: !0,
|
|
@@ -172,7 +173,7 @@ function gt(e, t, r) {
|
|
|
172
173
|
writable: !0
|
|
173
174
|
}) : e[t] = r, e;
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
+
function Te(e, t) {
|
|
176
177
|
var r = Object.keys(e);
|
|
177
178
|
if (Object.getOwnPropertySymbols) {
|
|
178
179
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -182,18 +183,18 @@ function Ie(e, t) {
|
|
|
182
183
|
}
|
|
183
184
|
return r;
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
+
function De(e) {
|
|
186
187
|
for (var t = 1; t < arguments.length; t++) {
|
|
187
188
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
188
|
-
t % 2 ?
|
|
189
|
-
|
|
190
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
189
|
+
t % 2 ? Te(Object(r), !0).forEach(function(n) {
|
|
190
|
+
St(e, n, r[n]);
|
|
191
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Te(Object(r)).forEach(function(n) {
|
|
191
192
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
return e;
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function Et() {
|
|
197
198
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
198
199
|
t[r] = arguments[r];
|
|
199
200
|
return function(n) {
|
|
@@ -213,38 +214,38 @@ function X(e) {
|
|
|
213
214
|
};
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
|
-
function
|
|
217
|
+
function le(e) {
|
|
217
218
|
return {}.toString.call(e).includes("Object");
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
+
function xt(e) {
|
|
220
221
|
return !Object.keys(e).length;
|
|
221
222
|
}
|
|
222
223
|
function re(e) {
|
|
223
224
|
return typeof e == "function";
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
+
function jt(e, t) {
|
|
226
227
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
230
|
-
return !
|
|
231
|
-
}) &&
|
|
229
|
+
function Pt(e, t) {
|
|
230
|
+
return le(t) || K("changeType"), Object.keys(t).some(function(r) {
|
|
231
|
+
return !jt(e, r);
|
|
232
|
+
}) && K("changeField"), t;
|
|
232
233
|
}
|
|
233
|
-
function
|
|
234
|
-
re(e) ||
|
|
234
|
+
function Ct(e) {
|
|
235
|
+
re(e) || K("selectorType");
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
-
re(e) ||
|
|
237
|
+
function $t(e) {
|
|
238
|
+
re(e) || le(e) || K("handlerType"), le(e) && Object.values(e).some(function(t) {
|
|
238
239
|
return !re(t);
|
|
239
|
-
}) &&
|
|
240
|
+
}) && K("handlersType");
|
|
240
241
|
}
|
|
241
|
-
function
|
|
242
|
-
e ||
|
|
242
|
+
function It(e) {
|
|
243
|
+
e || K("initialIsRequired"), le(e) || K("initialType"), xt(e) && K("initialContent");
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function Nt(e, t) {
|
|
245
246
|
throw new Error(e[t] || e.default);
|
|
246
247
|
}
|
|
247
|
-
var
|
|
248
|
+
var Lt = {
|
|
248
249
|
initialIsRequired: "initial state is required",
|
|
249
250
|
initialType: "initial state should be an object",
|
|
250
251
|
initialContent: "initial state shouldn't be an empty object",
|
|
@@ -254,49 +255,49 @@ var Et = {
|
|
|
254
255
|
changeType: "provided value of changes should be an object",
|
|
255
256
|
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
256
257
|
default: "an unknown error accured in `state-local` package"
|
|
257
|
-
},
|
|
258
|
-
changes:
|
|
259
|
-
selector:
|
|
260
|
-
handler:
|
|
261
|
-
initial:
|
|
258
|
+
}, K = X(Nt)(Lt), se = {
|
|
259
|
+
changes: Pt,
|
|
260
|
+
selector: Ct,
|
|
261
|
+
handler: $t,
|
|
262
|
+
initial: It
|
|
262
263
|
};
|
|
263
|
-
function
|
|
264
|
+
function Tt(e) {
|
|
264
265
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
265
|
-
|
|
266
|
+
se.initial(e), se.handler(t);
|
|
266
267
|
var r = {
|
|
267
268
|
current: e
|
|
268
|
-
}, n = X(
|
|
269
|
+
}, n = X(Vt)(r, t), o = X(_t)(r), i = X(se.changes)(e), a = X(Dt)(r);
|
|
269
270
|
function u() {
|
|
270
|
-
var
|
|
271
|
+
var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(h) {
|
|
271
272
|
return h;
|
|
272
273
|
};
|
|
273
|
-
return
|
|
274
|
+
return se.selector(d), d(r.current);
|
|
274
275
|
}
|
|
275
|
-
function l(
|
|
276
|
-
|
|
276
|
+
function l(d) {
|
|
277
|
+
Et(n, o, i, a)(d);
|
|
277
278
|
}
|
|
278
279
|
return [u, l];
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
+
function Dt(e, t) {
|
|
281
282
|
return re(t) ? t(e.current) : t;
|
|
282
283
|
}
|
|
283
|
-
function
|
|
284
|
-
return e.current =
|
|
284
|
+
function _t(e, t) {
|
|
285
|
+
return e.current = De(De({}, e.current), t), t;
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
+
function Vt(e, t, r) {
|
|
287
288
|
return re(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
288
289
|
var o;
|
|
289
290
|
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
290
291
|
}), r;
|
|
291
292
|
}
|
|
292
|
-
var
|
|
293
|
-
create:
|
|
294
|
-
},
|
|
293
|
+
var kt = {
|
|
294
|
+
create: Tt
|
|
295
|
+
}, At = {
|
|
295
296
|
paths: {
|
|
296
297
|
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
|
|
297
298
|
}
|
|
298
299
|
};
|
|
299
|
-
function
|
|
300
|
+
function Ht(e) {
|
|
300
301
|
return function t() {
|
|
301
302
|
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
302
303
|
o[i] = arguments[i];
|
|
@@ -307,23 +308,23 @@ function Tt(e) {
|
|
|
307
308
|
};
|
|
308
309
|
};
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
+
function Rt(e) {
|
|
311
312
|
return {}.toString.call(e).includes("Object");
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
-
return e ||
|
|
314
|
+
function Ut(e) {
|
|
315
|
+
return e || _e("configIsRequired"), Rt(e) || _e("configType"), e.urls ? (zt(), {
|
|
315
316
|
paths: {
|
|
316
317
|
vs: e.urls.monacoBase
|
|
317
318
|
}
|
|
318
319
|
}) : e;
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
-
console.warn(
|
|
321
|
+
function zt() {
|
|
322
|
+
console.warn(Re.deprecation);
|
|
322
323
|
}
|
|
323
|
-
function
|
|
324
|
+
function Ft(e, t) {
|
|
324
325
|
throw new Error(e[t] || e.default);
|
|
325
326
|
}
|
|
326
|
-
var
|
|
327
|
+
var Re = {
|
|
327
328
|
configIsRequired: "the configuration object is required",
|
|
328
329
|
configType: "the configuration object should be an object",
|
|
329
330
|
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
@@ -337,9 +338,9 @@ var Ae = {
|
|
|
337
338
|
|
|
338
339
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
339
340
|
`
|
|
340
|
-
},
|
|
341
|
-
config:
|
|
342
|
-
},
|
|
341
|
+
}, _e = Ht(Ft)(Re), Wt = {
|
|
342
|
+
config: Ut
|
|
343
|
+
}, qt = function() {
|
|
343
344
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
344
345
|
r[n] = arguments[n];
|
|
345
346
|
return function(o) {
|
|
@@ -348,42 +349,42 @@ var Ae = {
|
|
|
348
349
|
}, o);
|
|
349
350
|
};
|
|
350
351
|
};
|
|
351
|
-
function
|
|
352
|
+
function Ue(e, t) {
|
|
352
353
|
return Object.keys(t).forEach(function(r) {
|
|
353
|
-
t[r] instanceof Object && e[r] && Object.assign(t[r],
|
|
354
|
-
}),
|
|
354
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], Ue(e[r], t[r]));
|
|
355
|
+
}), Ne(Ne({}, e), t);
|
|
355
356
|
}
|
|
356
|
-
var
|
|
357
|
+
var Bt = {
|
|
357
358
|
type: "cancelation",
|
|
358
359
|
msg: "operation is manually canceled"
|
|
359
360
|
};
|
|
360
|
-
function
|
|
361
|
+
function pe(e) {
|
|
361
362
|
var t = !1, r = new Promise(function(n, o) {
|
|
362
363
|
e.then(function(i) {
|
|
363
|
-
return t ? o(
|
|
364
|
+
return t ? o(Bt) : n(i);
|
|
364
365
|
}), e.catch(o);
|
|
365
366
|
});
|
|
366
367
|
return r.cancel = function() {
|
|
367
368
|
return t = !0;
|
|
368
369
|
}, r;
|
|
369
370
|
}
|
|
370
|
-
var
|
|
371
|
-
config:
|
|
371
|
+
var Kt = kt.create({
|
|
372
|
+
config: At,
|
|
372
373
|
isInitialized: !1,
|
|
373
374
|
resolve: null,
|
|
374
375
|
reject: null,
|
|
375
376
|
monaco: null
|
|
376
|
-
}),
|
|
377
|
-
function
|
|
378
|
-
var t =
|
|
379
|
-
|
|
377
|
+
}), ze = yt(Kt, 2), oe = ze[0], de = ze[1];
|
|
378
|
+
function Yt(e) {
|
|
379
|
+
var t = Wt.config(e), r = t.monaco, n = vt(t, ["monaco"]);
|
|
380
|
+
de(function(o) {
|
|
380
381
|
return {
|
|
381
|
-
config:
|
|
382
|
+
config: Ue(o.config, n),
|
|
382
383
|
monaco: r
|
|
383
384
|
};
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
+
function Gt() {
|
|
387
388
|
var e = oe(function(t) {
|
|
388
389
|
var r = t.monaco, n = t.isInitialized, o = t.resolve;
|
|
389
390
|
return {
|
|
@@ -393,36 +394,36 @@ function zt() {
|
|
|
393
394
|
};
|
|
394
395
|
});
|
|
395
396
|
if (!e.isInitialized) {
|
|
396
|
-
if (
|
|
397
|
+
if (de({
|
|
397
398
|
isInitialized: !0
|
|
398
399
|
}), e.monaco)
|
|
399
|
-
return e.resolve(e.monaco),
|
|
400
|
+
return e.resolve(e.monaco), pe(me);
|
|
400
401
|
if (window.monaco && window.monaco.editor)
|
|
401
|
-
return
|
|
402
|
-
|
|
402
|
+
return Fe(window.monaco), e.resolve(window.monaco), pe(me);
|
|
403
|
+
qt(Zt, Qt)(Xt);
|
|
403
404
|
}
|
|
404
|
-
return
|
|
405
|
+
return pe(me);
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
+
function Zt(e) {
|
|
407
408
|
return document.body.appendChild(e);
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function Jt(e) {
|
|
410
411
|
var t = document.createElement("script");
|
|
411
412
|
return e && (t.src = e), t;
|
|
412
413
|
}
|
|
413
|
-
function
|
|
414
|
+
function Qt(e) {
|
|
414
415
|
var t = oe(function(n) {
|
|
415
416
|
var o = n.config, i = n.reject;
|
|
416
417
|
return {
|
|
417
418
|
config: o,
|
|
418
419
|
reject: i
|
|
419
420
|
};
|
|
420
|
-
}), r =
|
|
421
|
+
}), r = Jt("".concat(t.config.paths.vs, "/loader.js"));
|
|
421
422
|
return r.onload = function() {
|
|
422
423
|
return e();
|
|
423
424
|
}, r.onerror = t.reject, r;
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
+
function Xt() {
|
|
426
427
|
var e = oe(function(r) {
|
|
427
428
|
var n = r.config, o = r.resolve, i = r.reject;
|
|
428
429
|
return {
|
|
@@ -432,204 +433,204 @@ function Wt() {
|
|
|
432
433
|
};
|
|
433
434
|
}), t = window.require;
|
|
434
435
|
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
435
|
-
|
|
436
|
+
Fe(r), e.resolve(r);
|
|
436
437
|
}, function(r) {
|
|
437
438
|
e.reject(r);
|
|
438
439
|
});
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
-
oe().monaco ||
|
|
441
|
+
function Fe(e) {
|
|
442
|
+
oe().monaco || de({
|
|
442
443
|
monaco: e
|
|
443
444
|
});
|
|
444
445
|
}
|
|
445
|
-
function
|
|
446
|
+
function er() {
|
|
446
447
|
return oe(function(e) {
|
|
447
448
|
var t = e.monaco;
|
|
448
449
|
return t;
|
|
449
450
|
});
|
|
450
451
|
}
|
|
451
|
-
var
|
|
452
|
-
return
|
|
452
|
+
var me = new Promise(function(e, t) {
|
|
453
|
+
return de({
|
|
453
454
|
resolve: e,
|
|
454
455
|
reject: t
|
|
455
456
|
});
|
|
456
|
-
}),
|
|
457
|
-
config:
|
|
458
|
-
init:
|
|
459
|
-
__getMonacoInstance:
|
|
460
|
-
},
|
|
461
|
-
function
|
|
462
|
-
return
|
|
463
|
-
}
|
|
464
|
-
var
|
|
465
|
-
function
|
|
466
|
-
return
|
|
467
|
-
}
|
|
468
|
-
var
|
|
469
|
-
function
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
var
|
|
473
|
-
function
|
|
474
|
-
let n =
|
|
475
|
-
|
|
457
|
+
}), q = {
|
|
458
|
+
config: Yt,
|
|
459
|
+
init: Gt,
|
|
460
|
+
__getMonacoInstance: er
|
|
461
|
+
}, tr = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, ge = tr, rr = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, nr = rr;
|
|
462
|
+
function or({ children: e }) {
|
|
463
|
+
return Y.createElement("div", { style: nr.container }, e);
|
|
464
|
+
}
|
|
465
|
+
var ir = or, ar = ir;
|
|
466
|
+
function cr({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: a }) {
|
|
467
|
+
return Y.createElement("section", { style: { ...ge.wrapper, width: e, height: t }, ...a }, !r && Y.createElement(ar, null, n), Y.createElement("div", { ref: o, style: { ...ge.fullWidth, ...!r && ge.hide }, className: i }));
|
|
468
|
+
}
|
|
469
|
+
var sr = cr, We = Me(sr);
|
|
470
|
+
function ur(e) {
|
|
471
|
+
N(e, []);
|
|
472
|
+
}
|
|
473
|
+
var Se = ur;
|
|
474
|
+
function lr(e, t, r = !0) {
|
|
475
|
+
let n = v(!0);
|
|
476
|
+
N(n.current || !r ? () => {
|
|
476
477
|
n.current = !1;
|
|
477
478
|
} : e, t);
|
|
478
479
|
}
|
|
479
|
-
var
|
|
480
|
+
var z = lr;
|
|
480
481
|
function ee() {
|
|
481
482
|
}
|
|
482
483
|
function Z(e, t, r, n) {
|
|
483
|
-
return
|
|
484
|
+
return dr(e, n) || fr(e, t, r, n);
|
|
484
485
|
}
|
|
485
|
-
function
|
|
486
|
-
return e.editor.getModel(
|
|
486
|
+
function dr(e, t) {
|
|
487
|
+
return e.editor.getModel(qe(e, t));
|
|
487
488
|
}
|
|
488
|
-
function
|
|
489
|
-
return e.editor.createModel(t, r, n ?
|
|
489
|
+
function fr(e, t, r, n) {
|
|
490
|
+
return e.editor.createModel(t, r, n ? qe(e, n) : void 0);
|
|
490
491
|
}
|
|
491
|
-
function
|
|
492
|
+
function qe(e, t) {
|
|
492
493
|
return e.Uri.parse(t);
|
|
493
494
|
}
|
|
494
|
-
function
|
|
495
|
-
let [
|
|
496
|
-
|
|
497
|
-
let c =
|
|
498
|
-
return c.then((
|
|
499
|
-
}),
|
|
500
|
-
if (
|
|
501
|
-
let c =
|
|
502
|
-
|
|
495
|
+
function pr({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: a, keepCurrentOriginalModel: u = !1, keepCurrentModifiedModel: l = !1, theme: d = "light", loading: h = "Loading...", options: f = {}, height: y = "100%", width: $ = "100%", className: g, wrapperProps: L = {}, beforeMount: T = ee, onMount: I = ee }) {
|
|
496
|
+
let [E, V] = R(!1), [_, b] = R(!0), C = v(null), M = v(null), j = v(null), x = v(I), s = v(T), O = v(!1);
|
|
497
|
+
Se(() => {
|
|
498
|
+
let c = q.init();
|
|
499
|
+
return c.then((w) => (M.current = w) && b(!1)).catch((w) => (w == null ? void 0 : w.type) !== "cancelation" && console.error("Monaco initialization: error:", w)), () => C.current ? S() : c.cancel();
|
|
500
|
+
}), z(() => {
|
|
501
|
+
if (C.current && M.current) {
|
|
502
|
+
let c = C.current.getOriginalEditor(), w = Z(M.current, e || "", n || r || "text", i || "");
|
|
503
|
+
w !== c.getModel() && c.setModel(w);
|
|
503
504
|
}
|
|
504
|
-
}, [i],
|
|
505
|
-
if (
|
|
506
|
-
let c =
|
|
507
|
-
|
|
505
|
+
}, [i], E), z(() => {
|
|
506
|
+
if (C.current && M.current) {
|
|
507
|
+
let c = C.current.getModifiedEditor(), w = Z(M.current, t || "", o || r || "text", a || "");
|
|
508
|
+
w !== c.getModel() && c.setModel(w);
|
|
508
509
|
}
|
|
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],
|
|
510
|
+
}, [a], E), z(() => {
|
|
511
|
+
let c = C.current.getModifiedEditor();
|
|
512
|
+
c.getOption(M.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
|
|
513
|
+
}, [t], E), z(() => {
|
|
514
|
+
var c, w;
|
|
515
|
+
(w = (c = C.current) == null ? void 0 : c.getModel()) == null || w.original.setValue(e || "");
|
|
516
|
+
}, [e], E), z(() => {
|
|
517
|
+
let { original: c, modified: w } = C.current.getModel();
|
|
518
|
+
M.current.editor.setModelLanguage(c, n || r || "text"), M.current.editor.setModelLanguage(w, o || r || "text");
|
|
519
|
+
}, [r, n, o], E), z(() => {
|
|
519
520
|
var c;
|
|
520
|
-
(c =
|
|
521
|
-
}, [
|
|
521
|
+
(c = M.current) == null || c.editor.setTheme(d);
|
|
522
|
+
}, [d], E), z(() => {
|
|
522
523
|
var c;
|
|
523
|
-
(c =
|
|
524
|
-
}, [f],
|
|
525
|
-
let
|
|
526
|
-
var
|
|
527
|
-
if (!
|
|
524
|
+
(c = C.current) == null || c.updateOptions(f);
|
|
525
|
+
}, [f], E);
|
|
526
|
+
let m = J(() => {
|
|
527
|
+
var H;
|
|
528
|
+
if (!M.current)
|
|
528
529
|
return;
|
|
529
|
-
|
|
530
|
-
let c = Z(
|
|
531
|
-
(
|
|
532
|
-
}, [r, t, o, e, n, i, a]),
|
|
530
|
+
s.current(M.current);
|
|
531
|
+
let c = Z(M.current, e || "", n || r || "text", i || ""), w = Z(M.current, t || "", o || r || "text", a || "");
|
|
532
|
+
(H = C.current) == null || H.setModel({ original: c, modified: w });
|
|
533
|
+
}, [r, t, o, e, n, i, a]), p = J(() => {
|
|
533
534
|
var c;
|
|
534
|
-
!
|
|
535
|
-
}, [f,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}, [
|
|
539
|
-
!
|
|
540
|
-
}, [
|
|
541
|
-
function
|
|
542
|
-
var
|
|
543
|
-
let c = (
|
|
544
|
-
u || ((
|
|
535
|
+
!O.current && j.current && (C.current = M.current.editor.createDiffEditor(j.current, { automaticLayout: !0, ...f }), m(), (c = M.current) == null || c.editor.setTheme(d), V(!0), O.current = !0);
|
|
536
|
+
}, [f, d, m]);
|
|
537
|
+
N(() => {
|
|
538
|
+
E && x.current(C.current, M.current);
|
|
539
|
+
}, [E]), N(() => {
|
|
540
|
+
!_ && !E && p();
|
|
541
|
+
}, [_, E, p]);
|
|
542
|
+
function S() {
|
|
543
|
+
var w, H, W, B;
|
|
544
|
+
let c = (w = C.current) == null ? void 0 : w.getModel();
|
|
545
|
+
u || ((H = c == null ? void 0 : c.original) == null || H.dispose()), l || ((W = c == null ? void 0 : c.modified) == null || W.dispose()), (B = C.current) == null || B.dispose();
|
|
545
546
|
}
|
|
546
|
-
return
|
|
547
|
+
return Y.createElement(We, { width: $, height: y, isEditorReady: E, loading: h, _ref: j, className: g, wrapperProps: L });
|
|
547
548
|
}
|
|
548
|
-
var
|
|
549
|
-
function
|
|
550
|
-
let [e, t] =
|
|
551
|
-
return
|
|
549
|
+
var mr = pr, gr = Me(mr);
|
|
550
|
+
function hr() {
|
|
551
|
+
let [e, t] = R(q.__getMonacoInstance());
|
|
552
|
+
return Se(() => {
|
|
552
553
|
let r;
|
|
553
|
-
return e || (r =
|
|
554
|
+
return e || (r = q.init(), r.then((n) => {
|
|
554
555
|
t(n);
|
|
555
556
|
})), () => r == null ? void 0 : r.cancel();
|
|
556
557
|
}), e;
|
|
557
558
|
}
|
|
558
|
-
var
|
|
559
|
-
function
|
|
560
|
-
let t =
|
|
561
|
-
return
|
|
559
|
+
var ie = hr;
|
|
560
|
+
function vr(e) {
|
|
561
|
+
let t = v();
|
|
562
|
+
return N(() => {
|
|
562
563
|
t.current = e;
|
|
563
564
|
}, [e]), t.current;
|
|
564
565
|
}
|
|
565
|
-
var
|
|
566
|
-
function
|
|
567
|
-
let [
|
|
568
|
-
|
|
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],
|
|
591
|
-
let
|
|
592
|
-
var
|
|
593
|
-
if (!(!
|
|
594
|
-
|
|
595
|
-
let
|
|
596
|
-
|
|
566
|
+
var yr = vr, ue = /* @__PURE__ */ new Map();
|
|
567
|
+
function br({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: a = "light", line: u, loading: l = "Loading...", options: d = {}, overrideServices: h = {}, saveViewState: f = !0, keepCurrentModel: y = !1, width: $ = "100%", height: g = "100%", className: L, wrapperProps: T = {}, beforeMount: I = ee, onMount: E = ee, onChange: V, onValidate: _ = ee }) {
|
|
568
|
+
let [b, C] = R(!1), [M, j] = R(!0), x = v(null), s = v(null), O = v(null), m = v(E), p = v(I), S = v(), c = v(n), w = yr(i), H = v(!1), W = v(!1);
|
|
569
|
+
Se(() => {
|
|
570
|
+
let P = q.init();
|
|
571
|
+
return P.then((D) => (x.current = D) && j(!1)).catch((D) => (D == null ? void 0 : D.type) !== "cancelation" && console.error("Monaco initialization: error:", D)), () => s.current ? et() : P.cancel();
|
|
572
|
+
}), z(() => {
|
|
573
|
+
var D, U, Q, G;
|
|
574
|
+
let P = Z(x.current, e || n || "", t || o || "", i || r || "");
|
|
575
|
+
P !== ((D = s.current) == null ? void 0 : D.getModel()) && (f && ue.set(w, (U = s.current) == null ? void 0 : U.saveViewState()), (Q = s.current) == null || Q.setModel(P), f && ((G = s.current) == null || G.restoreViewState(ue.get(i))));
|
|
576
|
+
}, [i], b), z(() => {
|
|
577
|
+
var P;
|
|
578
|
+
(P = s.current) == null || P.updateOptions(d);
|
|
579
|
+
}, [d], b), z(() => {
|
|
580
|
+
!s.current || n === void 0 || (s.current.getOption(x.current.editor.EditorOption.readOnly) ? s.current.setValue(n) : n !== s.current.getValue() && (W.current = !0, s.current.executeEdits("", [{ range: s.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), s.current.pushUndoStop(), W.current = !1));
|
|
581
|
+
}, [n], b), z(() => {
|
|
582
|
+
var D, U;
|
|
583
|
+
let P = (D = s.current) == null ? void 0 : D.getModel();
|
|
584
|
+
P && o && ((U = x.current) == null || U.editor.setModelLanguage(P, o));
|
|
585
|
+
}, [o], b), z(() => {
|
|
586
|
+
var P;
|
|
587
|
+
u !== void 0 && ((P = s.current) == null || P.revealLine(u));
|
|
588
|
+
}, [u], b), z(() => {
|
|
589
|
+
var P;
|
|
590
|
+
(P = x.current) == null || P.editor.setTheme(a);
|
|
591
|
+
}, [a], b);
|
|
592
|
+
let B = J(() => {
|
|
593
|
+
var P;
|
|
594
|
+
if (!(!O.current || !x.current) && !H.current) {
|
|
595
|
+
p.current(x.current);
|
|
596
|
+
let D = i || r, U = Z(x.current, n || e || "", t || o || "", D || "");
|
|
597
|
+
s.current = (P = x.current) == null ? void 0 : P.editor.create(O.current, { model: U, automaticLayout: !0, ...d }, h), f && s.current.restoreViewState(ue.get(D)), x.current.editor.setTheme(a), u !== void 0 && s.current.revealLine(u), C(!0), H.current = !0;
|
|
597
598
|
}
|
|
598
|
-
}, [e, t, r, n, o, i,
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
}, [
|
|
602
|
-
!
|
|
603
|
-
}, [
|
|
604
|
-
var
|
|
605
|
-
|
|
606
|
-
|
|
599
|
+
}, [e, t, r, n, o, i, d, h, f, a, u]);
|
|
600
|
+
N(() => {
|
|
601
|
+
b && m.current(s.current, x.current);
|
|
602
|
+
}, [b]), N(() => {
|
|
603
|
+
!M && !b && B();
|
|
604
|
+
}, [M, b, B]), c.current = n, N(() => {
|
|
605
|
+
var P, D;
|
|
606
|
+
b && V && ((P = S.current) == null || P.dispose(), S.current = (D = s.current) == null ? void 0 : D.onDidChangeModelContent((U) => {
|
|
607
|
+
W.current || V(s.current.getValue(), U);
|
|
607
608
|
}));
|
|
608
|
-
}, [
|
|
609
|
-
if (
|
|
610
|
-
let
|
|
609
|
+
}, [b, V]), N(() => {
|
|
610
|
+
if (b) {
|
|
611
|
+
let P = x.current.editor.onDidChangeMarkers((D) => {
|
|
611
612
|
var Q;
|
|
612
|
-
let
|
|
613
|
-
if (
|
|
614
|
-
let
|
|
615
|
-
|
|
613
|
+
let U = (Q = s.current.getModel()) == null ? void 0 : Q.uri;
|
|
614
|
+
if (U && D.find((G) => G.path === U.path)) {
|
|
615
|
+
let G = x.current.editor.getModelMarkers({ resource: U });
|
|
616
|
+
_ == null || _(G);
|
|
616
617
|
}
|
|
617
618
|
});
|
|
618
619
|
return () => {
|
|
619
|
-
|
|
620
|
+
P == null || P.dispose();
|
|
620
621
|
};
|
|
621
622
|
}
|
|
622
623
|
return () => {
|
|
623
624
|
};
|
|
624
|
-
}, [
|
|
625
|
-
function
|
|
626
|
-
var
|
|
627
|
-
(
|
|
625
|
+
}, [b, _]);
|
|
626
|
+
function et() {
|
|
627
|
+
var P, D;
|
|
628
|
+
(P = S.current) == null || P.dispose(), y ? f && ue.set(i, s.current.saveViewState()) : (D = s.current.getModel()) == null || D.dispose(), s.current.dispose();
|
|
628
629
|
}
|
|
629
|
-
return
|
|
630
|
+
return Y.createElement(We, { width: $, height: g, isEditorReady: b, loading: l, _ref: O, className: L, wrapperProps: T });
|
|
630
631
|
}
|
|
631
|
-
var
|
|
632
|
-
const
|
|
632
|
+
var wr = br, Mr = Me(wr), fe = Mr;
|
|
633
|
+
const ae = {
|
|
633
634
|
selectOnLineNumbers: !0,
|
|
634
635
|
scrollBeyondLastLine: !1,
|
|
635
636
|
padding: {
|
|
@@ -650,28 +651,28 @@ const le = {
|
|
|
650
651
|
overviewRulerLanes: 0,
|
|
651
652
|
renderLineHighlight: "none",
|
|
652
653
|
automaticLayout: !0
|
|
653
|
-
},
|
|
654
|
-
const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] =
|
|
655
|
-
return
|
|
654
|
+
}, ce = (e) => {
|
|
655
|
+
const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = R(n ?? o ?? "vs-dark");
|
|
656
|
+
return N(() => {
|
|
656
657
|
var u;
|
|
657
658
|
(u = t == null ? void 0 : t.monacoThemes) == null || u.forEach((l) => {
|
|
658
|
-
|
|
659
|
+
F.editor.defineTheme(l.themeName, l.themeData);
|
|
659
660
|
});
|
|
660
|
-
}, [
|
|
661
|
-
|
|
661
|
+
}, [F]), N(() => {
|
|
662
|
+
F.editor && n && (F.editor.setTheme(n), a(n));
|
|
662
663
|
}, [r, n]), { theme: i };
|
|
663
664
|
};
|
|
664
|
-
function
|
|
665
|
+
function Ee(e) {
|
|
665
666
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
666
667
|
let r = "";
|
|
667
668
|
for (let n = 0; n < e; n++)
|
|
668
669
|
r += t.charAt(Math.floor(Math.random() * t.length));
|
|
669
670
|
return r;
|
|
670
671
|
}
|
|
671
|
-
function
|
|
672
|
+
function Or(e) {
|
|
672
673
|
return e.replace("'", "'");
|
|
673
674
|
}
|
|
674
|
-
const
|
|
675
|
+
const Sr = (e) => {
|
|
675
676
|
const t = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
676
677
|
if (e < 60)
|
|
677
678
|
return t.format(-e, "second");
|
|
@@ -689,11 +690,11 @@ const vr = (e) => {
|
|
|
689
690
|
return t.format(-i, "month");
|
|
690
691
|
const a = Math.floor(i / 12);
|
|
691
692
|
return t.format(-a, "year");
|
|
692
|
-
},
|
|
693
|
+
}, Er = (e) => {
|
|
693
694
|
const t = new Date(e), n = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 1e3), o = Math.abs(n);
|
|
694
|
-
return
|
|
695
|
+
return Sr(o);
|
|
695
696
|
};
|
|
696
|
-
function
|
|
697
|
+
function Be({
|
|
697
698
|
instanceId: e,
|
|
698
699
|
lineNumbersPosition: t
|
|
699
700
|
}) {
|
|
@@ -726,7 +727,7 @@ function yr({
|
|
|
726
727
|
color: var(--cn-text-1);
|
|
727
728
|
}`, r;
|
|
728
729
|
}
|
|
729
|
-
function
|
|
730
|
+
function xr({
|
|
730
731
|
instanceId: e,
|
|
731
732
|
blameData: t,
|
|
732
733
|
dateWidth: r,
|
|
@@ -734,35 +735,39 @@ function wr({
|
|
|
734
735
|
}) {
|
|
735
736
|
let o = "";
|
|
736
737
|
return t.forEach((i) => {
|
|
737
|
-
var
|
|
738
|
-
const a = (h = (
|
|
739
|
-
for (let
|
|
740
|
-
|
|
741
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
742
|
-
content: '${
|
|
738
|
+
var d, h, f, y, $, g, L, T;
|
|
739
|
+
const a = (h = (d = i == null ? void 0 : i.commitInfo) == null ? void 0 : d.author) == null ? void 0 : h.avatarUrl, u = (y = (f = i == null ? void 0 : i.commitInfo) == null ? void 0 : f.author) == null ? void 0 : y.initials, l = a ? `background: url('${(g = ($ = i == null ? void 0 : i.commitInfo) == null ? void 0 : $.author) == null ? void 0 : g.avatarUrl}');` : "";
|
|
740
|
+
for (let I = i.fromLineNumber; I <= i.toLineNumber; I++)
|
|
741
|
+
I === i.fromLineNumber ? o += `
|
|
742
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${I}:before {
|
|
743
|
+
content: '${Or(Er(((T = (L = i == null ? void 0 : i.commitInfo) == null ? void 0 : L.author) == null ? void 0 : T.when) || ""))}';
|
|
743
744
|
position: absolute;
|
|
744
745
|
left: 10px;
|
|
745
746
|
top: 0px;
|
|
746
747
|
color: var(--cn-text-3);
|
|
747
748
|
}
|
|
748
749
|
|
|
749
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
750
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${I}:after {
|
|
750
751
|
content: '${u ?? " "}';
|
|
751
752
|
position: absolute;
|
|
752
753
|
border-radius: 50%;
|
|
753
754
|
padding: 4px;
|
|
754
755
|
text-align: center;
|
|
755
|
-
background: var(--cn-set-gray-soft-bg);
|
|
756
756
|
line-height: 17px;
|
|
757
757
|
left: ${r + 10}px;
|
|
758
|
-
top: -
|
|
759
|
-
|
|
758
|
+
top: -2px;
|
|
759
|
+
box-shadow: var(--cn-shadow-comp-avatar-inner);
|
|
760
|
+
font-size: var(--cn-font-size-0);
|
|
761
|
+
font-weight: var(--cn-font-weight-default-normal-500);
|
|
762
|
+
background-color: var(--cn-set-brand-secondary-bg);
|
|
763
|
+
color: var(--cn-set-brand-secondary-text);
|
|
764
|
+
font-family: var(--font-family);
|
|
760
765
|
width: ${n}px;
|
|
761
766
|
height: ${n}px;
|
|
762
767
|
${l}
|
|
763
768
|
background-size: 100% 100%;
|
|
764
769
|
}` : o += `
|
|
765
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
770
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${I}:before {
|
|
766
771
|
content: ' ';
|
|
767
772
|
left: 10px;
|
|
768
773
|
top: 0px;
|
|
@@ -770,13 +775,13 @@ function wr({
|
|
|
770
775
|
}`;
|
|
771
776
|
}), o;
|
|
772
777
|
}
|
|
773
|
-
function
|
|
778
|
+
function Ke(e, t) {
|
|
774
779
|
let r = "";
|
|
775
780
|
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
781
|
}
|
|
777
|
-
|
|
778
|
-
const he = 450,
|
|
779
|
-
...
|
|
782
|
+
q.config({ monaco: F });
|
|
783
|
+
const he = 450, jr = 30, Pr = 140, Cr = 24, $r = {
|
|
784
|
+
...ae,
|
|
780
785
|
readOnly: !0,
|
|
781
786
|
matchBrackets: "never",
|
|
782
787
|
renderValidationDecorations: "off",
|
|
@@ -786,7 +791,7 @@ const he = 450, Mr = 30, Sr = 140, jr = 24, Er = {
|
|
|
786
791
|
renderWhitespace: "none",
|
|
787
792
|
renderLineHighlight: "none"
|
|
788
793
|
};
|
|
789
|
-
function
|
|
794
|
+
function tn({
|
|
790
795
|
code: e,
|
|
791
796
|
language: t,
|
|
792
797
|
themeConfig: r,
|
|
@@ -795,159 +800,426 @@ function Hr({
|
|
|
795
800
|
showSeparators: i = !0,
|
|
796
801
|
theme: a,
|
|
797
802
|
height: u = "75vh",
|
|
798
|
-
options: l
|
|
803
|
+
options: l,
|
|
804
|
+
className: d
|
|
799
805
|
}) {
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
const [
|
|
803
|
-
|
|
804
|
-
|
|
806
|
+
const h = v(o), f = v(null), y = v(Ee(5));
|
|
807
|
+
ie();
|
|
808
|
+
const [$, g] = R(), L = v(null), T = v(null);
|
|
809
|
+
N(() => {
|
|
810
|
+
h.current = o;
|
|
805
811
|
}, [o]);
|
|
806
|
-
function
|
|
807
|
-
const
|
|
808
|
-
if (!
|
|
812
|
+
function I() {
|
|
813
|
+
const s = T.current, O = L.current;
|
|
814
|
+
if (!s || !O)
|
|
809
815
|
return;
|
|
810
|
-
i &&
|
|
816
|
+
i && s.changeViewZones(function(p) {
|
|
811
817
|
p.addZone({
|
|
812
818
|
afterLineNumber: 0,
|
|
813
819
|
heightInPx: 10,
|
|
814
820
|
domNode: document.createElement("div")
|
|
815
|
-
}),
|
|
816
|
-
if (
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
afterLineNumber:
|
|
821
|
+
}), h.current.forEach((S, c) => {
|
|
822
|
+
if (c !== h.current.length - 1) {
|
|
823
|
+
const w = document.createElement("div");
|
|
824
|
+
w.style.borderTop = "1px solid var(--cn-border-2)", w.style.marginTop = "9px", w.className = "blame-editor-separator", p.addZone({
|
|
825
|
+
afterLineNumber: S.toLineNumber,
|
|
820
826
|
heightInPx: 20,
|
|
821
|
-
domNode:
|
|
827
|
+
domNode: w
|
|
822
828
|
});
|
|
823
829
|
}
|
|
824
830
|
});
|
|
825
831
|
});
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
var
|
|
829
|
-
for (let
|
|
830
|
-
|
|
831
|
-
range: new
|
|
832
|
+
const m = [];
|
|
833
|
+
h.current.forEach((p) => {
|
|
834
|
+
var S;
|
|
835
|
+
for (let c = p.fromLineNumber; c <= p.toLineNumber; c++)
|
|
836
|
+
m.push({
|
|
837
|
+
range: new O.Range(c, 0, c + 1, 0),
|
|
832
838
|
options: {
|
|
833
839
|
before: {
|
|
834
|
-
content:
|
|
835
|
-
|
|
836
|
-
|
|
840
|
+
content: Ke(
|
|
841
|
+
c === p.fromLineNumber && ((S = p == null ? void 0 : p.commitInfo) == null ? void 0 : S.title) || "",
|
|
842
|
+
jr
|
|
837
843
|
),
|
|
838
|
-
cursorStops:
|
|
839
|
-
inlineClassName: `blame-editor-commit blame-editor-commit-${
|
|
844
|
+
cursorStops: O.editor.InjectedTextCursorStops.None,
|
|
845
|
+
inlineClassName: `blame-editor-commit blame-editor-commit-${c}`
|
|
840
846
|
}
|
|
841
847
|
}
|
|
842
848
|
});
|
|
843
|
-
}),
|
|
849
|
+
}), s.createDecorationsCollection(m);
|
|
844
850
|
}
|
|
845
|
-
function
|
|
846
|
-
var
|
|
847
|
-
|
|
851
|
+
function E(s, O) {
|
|
852
|
+
var m, p, S, c, w, H;
|
|
853
|
+
T.current = s, L.current = O, s.setValue(e), g(s), (S = (p = (m = O.languages.typescript) == null ? void 0 : m.typescriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || S.call(p, {
|
|
848
854
|
noSuggestionDiagnostics: !0,
|
|
849
855
|
noSyntaxValidation: !0,
|
|
850
856
|
noSemanticValidation: !0
|
|
851
|
-
}), (
|
|
857
|
+
}), (H = (w = (c = O.languages.typescript) == null ? void 0 : c.javascriptDefaults) == null ? void 0 : w.setDiagnosticsOptions) == null || H.call(w, {
|
|
852
858
|
noSuggestionDiagnostics: !0,
|
|
853
859
|
noSyntaxValidation: !0,
|
|
854
860
|
noSemanticValidation: !0
|
|
855
|
-
}),
|
|
861
|
+
}), I();
|
|
856
862
|
}
|
|
857
|
-
|
|
858
|
-
|
|
863
|
+
N(() => {
|
|
864
|
+
$ == null || $.setValue(e);
|
|
859
865
|
}, [e]);
|
|
860
|
-
const { theme:
|
|
861
|
-
() =>
|
|
862
|
-
instanceId:
|
|
866
|
+
const { theme: V } = ce({ monacoRef: L, themeConfig: r, editor: $, theme: a }), _ = k(
|
|
867
|
+
() => Be({
|
|
868
|
+
instanceId: y.current,
|
|
863
869
|
lineNumbersPosition: n
|
|
864
870
|
}),
|
|
865
871
|
[o]
|
|
866
|
-
),
|
|
867
|
-
() =>
|
|
868
|
-
instanceId:
|
|
872
|
+
), b = k(
|
|
873
|
+
() => xr({
|
|
874
|
+
instanceId: y.current,
|
|
869
875
|
blameData: o,
|
|
870
|
-
avatarSize:
|
|
871
|
-
dateWidth:
|
|
876
|
+
avatarSize: Cr,
|
|
877
|
+
dateWidth: Pr
|
|
872
878
|
}),
|
|
873
879
|
[o]
|
|
874
880
|
);
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
}, p = new MutationObserver(
|
|
885
|
-
return p.observe(
|
|
881
|
+
Ve(() => {
|
|
882
|
+
f.current && f.current.style.setProperty("--line-number-display", "none");
|
|
883
|
+
}, []), N(() => {
|
|
884
|
+
if (n === "center" && f.current) {
|
|
885
|
+
const s = f.current.getElementsByClassName("lines-content")[0];
|
|
886
|
+
if (s) {
|
|
887
|
+
const O = { attributes: !0 }, m = () => {
|
|
888
|
+
const S = parseInt(getComputedStyle(s).left);
|
|
889
|
+
f.current && (f.current.style.setProperty("--line-number-offset", `${he + 16 + S}px`), f.current.style.setProperty("--line-number-display", "block"));
|
|
890
|
+
}, p = new MutationObserver(m);
|
|
891
|
+
return p.observe(s, O), m(), () => {
|
|
886
892
|
p.disconnect();
|
|
887
893
|
};
|
|
888
894
|
}
|
|
889
895
|
}
|
|
890
896
|
});
|
|
891
|
-
const
|
|
892
|
-
.monaco-editor-${
|
|
893
|
-
|
|
897
|
+
const C = k(() => `
|
|
898
|
+
.monaco-editor-${y.current} .margin {
|
|
899
|
+
display: var(--line-number-display);
|
|
900
|
+
left: var(--line-number-offset);
|
|
894
901
|
pointer-events: none;
|
|
895
|
-
}`, [
|
|
896
|
-
.monaco-editor-${h.current} .view-overlays {
|
|
902
|
+
}`, []), M = k(() => `.monaco-editor-${y.current} .view-overlays {
|
|
897
903
|
clip-path: polygon(${he + 16}px 0, 100% 0%, 100% 100%, ${he + 16}px 100%);
|
|
898
904
|
height:100% !important;
|
|
899
|
-
}`,
|
|
905
|
+
}`, []), j = k(
|
|
900
906
|
() => ({
|
|
901
|
-
|
|
907
|
+
...$r,
|
|
902
908
|
...l
|
|
903
909
|
}),
|
|
904
910
|
[l]
|
|
905
|
-
)
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
911
|
+
), x = k(() => /* @__PURE__ */ A.jsx(
|
|
912
|
+
"style",
|
|
913
|
+
{
|
|
914
|
+
dangerouslySetInnerHTML: {
|
|
915
|
+
__html: `${_} ${b} ${C} ${M}`
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
), [_, b, M, C]);
|
|
919
|
+
return /* @__PURE__ */ A.jsxs("div", { className: d, ref: f, children: [
|
|
920
|
+
x,
|
|
921
|
+
/* @__PURE__ */ A.jsx(
|
|
922
|
+
fe,
|
|
909
923
|
{
|
|
910
|
-
|
|
911
|
-
|
|
924
|
+
className: `monaco-editor-${y.current} overflow-hidden rounded-b-cn-3`,
|
|
925
|
+
height: u,
|
|
926
|
+
language: t,
|
|
927
|
+
theme: V,
|
|
928
|
+
options: j,
|
|
929
|
+
onMount: E
|
|
930
|
+
}
|
|
931
|
+
)
|
|
932
|
+
] });
|
|
933
|
+
}
|
|
934
|
+
q.config({ monaco: F });
|
|
935
|
+
const ve = 450, Ir = 30, Nr = {
|
|
936
|
+
...ae,
|
|
937
|
+
readOnly: !0,
|
|
938
|
+
matchBrackets: "never",
|
|
939
|
+
renderValidationDecorations: "off",
|
|
940
|
+
guides: { indentation: !1 },
|
|
941
|
+
folding: !1,
|
|
942
|
+
stickyScroll: { enabled: !1 },
|
|
943
|
+
renderWhitespace: "none",
|
|
944
|
+
renderLineHighlight: "none"
|
|
945
|
+
};
|
|
946
|
+
function rn({
|
|
947
|
+
code: e,
|
|
948
|
+
language: t,
|
|
949
|
+
themeConfig: r,
|
|
950
|
+
lineNumbersPosition: n = "left",
|
|
951
|
+
blameData: o,
|
|
952
|
+
theme: i,
|
|
953
|
+
height: a = "75vh",
|
|
954
|
+
options: u,
|
|
955
|
+
className: l
|
|
956
|
+
}) {
|
|
957
|
+
const d = v(o), h = v(null), f = v(Ee(5));
|
|
958
|
+
ie();
|
|
959
|
+
const [y, $] = R(), g = v(null), L = v(null);
|
|
960
|
+
N(() => {
|
|
961
|
+
d.current = o;
|
|
962
|
+
}, [o]);
|
|
963
|
+
function T() {
|
|
964
|
+
const j = L.current, x = g.current;
|
|
965
|
+
if (!j || !x)
|
|
966
|
+
return;
|
|
967
|
+
j.changeViewZones(function(O) {
|
|
968
|
+
O.addZone({
|
|
969
|
+
afterLineNumber: 0,
|
|
970
|
+
heightInPx: 1,
|
|
971
|
+
domNode: document.createElement("div")
|
|
972
|
+
}), d.current.forEach((m) => {
|
|
973
|
+
if (m.infoContent) {
|
|
974
|
+
const S = document.createElement("div");
|
|
975
|
+
S.className = "blame-editor-info-holder", S.style.position = "relative", S.style.zIndex = "100", S.style.overflow = "visible", Lr(S, m.infoContent), O.addZone({
|
|
976
|
+
afterLineNumber: m.fromLineNumber - 1,
|
|
977
|
+
heightInPx: 0,
|
|
978
|
+
domNode: S
|
|
979
|
+
});
|
|
912
980
|
}
|
|
981
|
+
const p = document.createElement("div");
|
|
982
|
+
p.style.borderTop = "1px solid var(--cn-border-2)", p.style.marginTop = "9px", p.className = "blame-editor-separator", O.addZone({
|
|
983
|
+
afterLineNumber: m.toLineNumber,
|
|
984
|
+
heightInPx: 20,
|
|
985
|
+
domNode: p
|
|
986
|
+
});
|
|
987
|
+
});
|
|
988
|
+
});
|
|
989
|
+
const s = [];
|
|
990
|
+
d.current.forEach((O) => {
|
|
991
|
+
for (let m = O.fromLineNumber; m <= O.toLineNumber; m++)
|
|
992
|
+
s.push({
|
|
993
|
+
range: new x.Range(m, 0, m + 1, 0),
|
|
994
|
+
options: {
|
|
995
|
+
before: {
|
|
996
|
+
content: Ke("", Ir),
|
|
997
|
+
cursorStops: x.editor.InjectedTextCursorStops.None,
|
|
998
|
+
inlineClassName: `blame-editor-commit blame-editor-commit-${m}`
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
}), j.createDecorationsCollection(s);
|
|
1003
|
+
}
|
|
1004
|
+
function I(j, x) {
|
|
1005
|
+
var s, O, m, p, S, c;
|
|
1006
|
+
L.current = j, g.current = x, j.setValue(e), $(j), (m = (O = (s = x.languages.typescript) == null ? void 0 : s.typescriptDefaults) == null ? void 0 : O.setDiagnosticsOptions) == null || m.call(O, {
|
|
1007
|
+
noSuggestionDiagnostics: !0,
|
|
1008
|
+
noSyntaxValidation: !0,
|
|
1009
|
+
noSemanticValidation: !0
|
|
1010
|
+
}), (c = (S = (p = x.languages.typescript) == null ? void 0 : p.javascriptDefaults) == null ? void 0 : S.setDiagnosticsOptions) == null || c.call(S, {
|
|
1011
|
+
noSuggestionDiagnostics: !0,
|
|
1012
|
+
noSyntaxValidation: !0,
|
|
1013
|
+
noSemanticValidation: !0
|
|
1014
|
+
}), T();
|
|
1015
|
+
}
|
|
1016
|
+
N(() => {
|
|
1017
|
+
y == null || y.setValue(e);
|
|
1018
|
+
}, [e]);
|
|
1019
|
+
const { theme: E } = ce({ monacoRef: g, themeConfig: r, editor: y, theme: i }), V = k(
|
|
1020
|
+
() => Be({
|
|
1021
|
+
instanceId: f.current,
|
|
1022
|
+
lineNumbersPosition: n
|
|
1023
|
+
}),
|
|
1024
|
+
[o]
|
|
1025
|
+
);
|
|
1026
|
+
Ve(() => {
|
|
1027
|
+
h.current && h.current.style.setProperty("--line-number-display", "none");
|
|
1028
|
+
}, []), N(() => {
|
|
1029
|
+
if (n === "center" && h.current) {
|
|
1030
|
+
const j = h.current.getElementsByClassName("lines-content")[0];
|
|
1031
|
+
if (j) {
|
|
1032
|
+
const x = { attributes: !0 }, s = () => {
|
|
1033
|
+
const m = parseInt(getComputedStyle(j).left);
|
|
1034
|
+
h.current && (h.current.style.setProperty("--line-number-offset", `${ve + 16 + m}px`), h.current.style.setProperty("--line-number-display", "block"));
|
|
1035
|
+
}, O = new MutationObserver(s);
|
|
1036
|
+
return O.observe(j, x), s(), () => {
|
|
1037
|
+
O.disconnect();
|
|
1038
|
+
};
|
|
913
1039
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
const _ = k(() => `
|
|
1043
|
+
.monaco-editor-${f.current} .margin {
|
|
1044
|
+
display: var(--line-number-display);
|
|
1045
|
+
left: var(--line-number-offset);
|
|
1046
|
+
pointer-events: none;
|
|
1047
|
+
}`, []), b = k(() => `.monaco-editor-${f.current} .view-overlays {
|
|
1048
|
+
clip-path: polygon(${ve + 16}px 0, 100% 0%, 100% 100%, ${ve + 16}px 100%);
|
|
1049
|
+
height:100% !important;
|
|
1050
|
+
}`, []), C = k(
|
|
1051
|
+
() => ({
|
|
1052
|
+
...Nr,
|
|
1053
|
+
...u
|
|
1054
|
+
}),
|
|
1055
|
+
[u]
|
|
1056
|
+
), M = k(() => /* @__PURE__ */ A.jsx(
|
|
1057
|
+
"style",
|
|
1058
|
+
{
|
|
1059
|
+
dangerouslySetInnerHTML: {
|
|
1060
|
+
__html: `${V} ${_} ${b}`
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
), [V, b, _]);
|
|
1064
|
+
return /* @__PURE__ */ A.jsxs("div", { className: l, ref: h, children: [
|
|
1065
|
+
M,
|
|
1066
|
+
/* @__PURE__ */ A.jsx(
|
|
1067
|
+
fe,
|
|
917
1068
|
{
|
|
918
|
-
className: `monaco-editor-${
|
|
919
|
-
height:
|
|
1069
|
+
className: `monaco-editor-${f.current} overflow-hidden rounded-b-cn-3`,
|
|
1070
|
+
height: a,
|
|
920
1071
|
language: t,
|
|
921
|
-
theme:
|
|
922
|
-
options:
|
|
923
|
-
onMount:
|
|
1072
|
+
theme: E,
|
|
1073
|
+
options: C,
|
|
1074
|
+
onMount: I
|
|
924
1075
|
}
|
|
925
1076
|
)
|
|
926
1077
|
] });
|
|
927
1078
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1079
|
+
function Lr(e, t) {
|
|
1080
|
+
return new IntersectionObserver(
|
|
1081
|
+
([n], o) => {
|
|
1082
|
+
if (n.isIntersecting) {
|
|
1083
|
+
o.disconnect();
|
|
1084
|
+
const i = document.createElement("div");
|
|
1085
|
+
i.style.position = "absolute", i.style.top = "-2px", e.appendChild(i), at(t, i);
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
root: document.querySelector(".monaco-scrollable-element"),
|
|
1090
|
+
threshold: 0.2
|
|
1091
|
+
}
|
|
1092
|
+
).observe(e), e;
|
|
1093
|
+
}
|
|
1094
|
+
function Tr(e) {
|
|
1095
|
+
const { editor: t, keyword: r } = e;
|
|
1096
|
+
N(() => {
|
|
1097
|
+
if (!t || !r)
|
|
1098
|
+
return;
|
|
1099
|
+
const n = t.getModel(), o = n.findMatches(r, !1, !1, !1, null, !1);
|
|
1100
|
+
o.length > 0 && o.forEach((i) => {
|
|
1101
|
+
n.deltaDecorations(
|
|
1102
|
+
[],
|
|
1103
|
+
[
|
|
1104
|
+
{
|
|
1105
|
+
range: i.range,
|
|
1106
|
+
options: {
|
|
1107
|
+
isWholeLine: !1,
|
|
1108
|
+
inlineClassName: "CodeEditor_HighlightedText"
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
]
|
|
1112
|
+
);
|
|
1113
|
+
});
|
|
1114
|
+
}, [t, r]);
|
|
1115
|
+
}
|
|
1116
|
+
function Dr(e) {
|
|
1117
|
+
const { enable: t, editor: r, onSelectedLineChange: n, selectedLine: o, onSelectedLineButtonClick: i } = e, a = v(null), u = v(!1), l = v(null);
|
|
1118
|
+
l.current = l.current ?? (r == null ? void 0 : r.createDecorationsCollection([])) ?? null, N(() => {
|
|
1119
|
+
let d;
|
|
1120
|
+
const h = setTimeout(() => {
|
|
1121
|
+
if (!t || !r)
|
|
1122
|
+
return;
|
|
1123
|
+
const f = (y) => {
|
|
1124
|
+
var g, L, T, I;
|
|
1125
|
+
if ((L = (g = y.target) == null ? void 0 : g.element) != null && L.classList.contains("CodeEditor_HighlightedGlyphMargin")) {
|
|
1126
|
+
i == null || i((T = y.target) == null ? void 0 : T.element);
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
const $ = _r((I = y.target) == null ? void 0 : I.element);
|
|
1130
|
+
if (!$) {
|
|
1131
|
+
n == null || n(void 0), i == null || i(void 0), ye(r, l.current, void 0);
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
u.current = !0, a.current = $, n == null || n($), ye(r, l.current, $, !1), i == null || i(void 0);
|
|
1135
|
+
};
|
|
1136
|
+
d = r.onMouseDown(f);
|
|
1137
|
+
}, 100);
|
|
1138
|
+
return () => {
|
|
1139
|
+
clearTimeout(h), d == null || d.dispose();
|
|
1140
|
+
};
|
|
1141
|
+
}, [u, o, n, t, r, i, l]), N(() => {
|
|
1142
|
+
r && a.current !== o && ye(r, l.current, o, !0);
|
|
1143
|
+
}, [r, o, l]);
|
|
1144
|
+
}
|
|
1145
|
+
function ye(e, t, r, n) {
|
|
1146
|
+
if (!r) {
|
|
1147
|
+
t == null || t.set([]);
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1150
|
+
t == null || t.set([
|
|
1151
|
+
{
|
|
1152
|
+
range: new F.Range(r, 1, r, 1),
|
|
1153
|
+
options: {
|
|
1154
|
+
isWholeLine: !0,
|
|
1155
|
+
className: "CodeEditor_HighlightedLine"
|
|
1156
|
+
// TODO: gonna be used if in the future
|
|
1157
|
+
// glyphMarginClassName: 'CodeEditor_HighlightedGlyphMargin'
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
]), e == null || e.setSelection(new F.Range(r, 0, r, 0)), n && (e == null || e.revealLineInCenter(r));
|
|
1161
|
+
}
|
|
1162
|
+
function _r(e) {
|
|
1163
|
+
const t = e != null && e.classList.contains("line-numbers") ? e : void 0;
|
|
1164
|
+
if (!t)
|
|
1165
|
+
return;
|
|
1166
|
+
const r = parseInt(t.textContent ?? "");
|
|
1167
|
+
if (!isNaN(r))
|
|
1168
|
+
return r;
|
|
1169
|
+
}
|
|
1170
|
+
const Vr = `.CodeEditor_HighlightedLine {
|
|
1171
|
+
opacity: 0.1;
|
|
1172
|
+
background-color: var(--cn-yellow-300, orange) !important;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
.CodeEditor_HighlightedText {
|
|
1176
|
+
background-color: var(--cn-yellow-100, orange) !important;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
.CodeEditor_HighlightedGlyphMargin {
|
|
1180
|
+
background: rgb(183, 183, 183);
|
|
1181
|
+
border: 1px solid gray;
|
|
1182
|
+
border-radius: 4px;
|
|
1183
|
+
margin-left: 5px;
|
|
1184
|
+
height: 20px;
|
|
1185
|
+
position: relative;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.CodeEditor_HighlightedGlyphMargin::after {
|
|
1189
|
+
content: '...';
|
|
1190
|
+
position: absolute;
|
|
1191
|
+
padding: 7px 3px;
|
|
1192
|
+
}
|
|
1193
|
+
`;
|
|
1194
|
+
q.config({ monaco: F });
|
|
1195
|
+
const kr = {
|
|
1196
|
+
...ae
|
|
931
1197
|
};
|
|
932
|
-
function
|
|
1198
|
+
function nn({
|
|
933
1199
|
codeRevision: e,
|
|
934
1200
|
onCodeRevisionChange: t,
|
|
935
1201
|
language: r,
|
|
936
1202
|
themeConfig: n,
|
|
937
1203
|
options: o,
|
|
938
1204
|
theme: i,
|
|
939
|
-
|
|
940
|
-
|
|
1205
|
+
enableLinesSelection: a = !1,
|
|
1206
|
+
selectedLine: u,
|
|
1207
|
+
onSelectedLineChange: l,
|
|
1208
|
+
onSelectedLineButtonClick: d,
|
|
1209
|
+
highlightKeyword: h,
|
|
1210
|
+
height: f = "75vh",
|
|
1211
|
+
className: y
|
|
941
1212
|
}) {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1213
|
+
const $ = v(Ee(5));
|
|
1214
|
+
ie();
|
|
1215
|
+
const [g, L] = R(), T = v(), I = v({ code: "", revisionId: 0 }), E = v(null), V = J(
|
|
1216
|
+
(M, j) => {
|
|
1217
|
+
var x, s, O, m, p, S;
|
|
1218
|
+
E.current = M, T.current = j, M.setValue(e.code), L(M), (O = (s = (x = j.languages.typescript) == null ? void 0 : x.typescriptDefaults) == null ? void 0 : s.setDiagnosticsOptions) == null || O.call(s, {
|
|
947
1219
|
noSuggestionDiagnostics: !0,
|
|
948
1220
|
noSyntaxValidation: !0,
|
|
949
1221
|
noSemanticValidation: !0
|
|
950
|
-
}), (
|
|
1222
|
+
}), (S = (p = (m = j.languages.typescript) == null ? void 0 : m.javascriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || S.call(p, {
|
|
951
1223
|
noSuggestionDiagnostics: !0,
|
|
952
1224
|
noSyntaxValidation: !0,
|
|
953
1225
|
noSemanticValidation: !0
|
|
@@ -955,37 +1227,53 @@ function qr({
|
|
|
955
1227
|
},
|
|
956
1228
|
[e.code]
|
|
957
1229
|
);
|
|
958
|
-
|
|
959
|
-
var
|
|
960
|
-
if (
|
|
961
|
-
const
|
|
962
|
-
|
|
1230
|
+
N(() => {
|
|
1231
|
+
var M, j;
|
|
1232
|
+
if (E.current && (!e.revisionId || e.revisionId > Number((M = I.current) == null ? void 0 : M.revisionId))) {
|
|
1233
|
+
const x = E.current.getModel();
|
|
1234
|
+
x && (o != null && o.readOnly ? (j = E.current) == null || j.setValue(e.code) : (E.current.pushUndoStop(), E.current.executeEdits("edit", [
|
|
963
1235
|
{
|
|
964
|
-
range:
|
|
1236
|
+
range: x.getFullModelRange(),
|
|
965
1237
|
text: e.code
|
|
966
1238
|
}
|
|
967
|
-
]),
|
|
1239
|
+
]), E.current.pushUndoStop()));
|
|
968
1240
|
}
|
|
969
|
-
}, [e,
|
|
970
|
-
const { theme:
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1241
|
+
}, [e, o == null ? void 0 : o.readOnly, E]);
|
|
1242
|
+
const { theme: _ } = ce({ monacoRef: T, themeConfig: n, editor: g, theme: i });
|
|
1243
|
+
Dr({
|
|
1244
|
+
enable: a,
|
|
1245
|
+
editor: g,
|
|
1246
|
+
selectedLine: u,
|
|
1247
|
+
onSelectedLineChange: l,
|
|
1248
|
+
onSelectedLineButtonClick: d
|
|
1249
|
+
}), Tr({ editor: g, keyword: h });
|
|
1250
|
+
const b = k(() => ({
|
|
1251
|
+
...kr,
|
|
1252
|
+
...o || {}
|
|
1253
|
+
// TODO: this will be used in the future
|
|
1254
|
+
// ...(enableLinesSelection ? { glyphMargin: true } : {})
|
|
1255
|
+
}), [o]), C = k(() => `.monaco-editor-${$.current} .margin-view-overlays .line-numbers { cursor: pointer !important; } ${Vr}`, []);
|
|
1256
|
+
return /* @__PURE__ */ A.jsxs(A.Fragment, { children: [
|
|
1257
|
+
a && /* @__PURE__ */ A.jsx("style", { dangerouslySetInnerHTML: { __html: C } }),
|
|
1258
|
+
/* @__PURE__ */ A.jsx(
|
|
1259
|
+
fe,
|
|
1260
|
+
{
|
|
1261
|
+
className: `monaco-editor-${$.current} ${y}`,
|
|
1262
|
+
height: f,
|
|
1263
|
+
onChange: (M, j) => {
|
|
1264
|
+
I.current = { code: M ?? "", revisionId: j.versionId }, t == null || t({ ...I.current }, j);
|
|
1265
|
+
},
|
|
1266
|
+
language: r,
|
|
1267
|
+
theme: _,
|
|
1268
|
+
options: b,
|
|
1269
|
+
onMount: V
|
|
1270
|
+
}
|
|
1271
|
+
)
|
|
1272
|
+
] });
|
|
985
1273
|
}
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
...
|
|
1274
|
+
q.config({ monaco: F });
|
|
1275
|
+
const Ar = {
|
|
1276
|
+
...ae,
|
|
989
1277
|
codeLens: !1,
|
|
990
1278
|
smartSelect: {
|
|
991
1279
|
selectLeadingAndTrailingWhitespace: !0
|
|
@@ -993,7 +1281,7 @@ const xr = {
|
|
|
993
1281
|
originalEditable: !1,
|
|
994
1282
|
overviewRulerBorder: !1
|
|
995
1283
|
};
|
|
996
|
-
function
|
|
1284
|
+
function on({
|
|
997
1285
|
original: e,
|
|
998
1286
|
modified: t,
|
|
999
1287
|
language: r,
|
|
@@ -1002,12 +1290,12 @@ function Br({
|
|
|
1002
1290
|
theme: i,
|
|
1003
1291
|
height: a = "75vh"
|
|
1004
1292
|
}) {
|
|
1005
|
-
|
|
1006
|
-
const [u, l] =
|
|
1007
|
-
return /* @__PURE__ */
|
|
1008
|
-
|
|
1293
|
+
ie();
|
|
1294
|
+
const [u, l] = R(), d = v(), { theme: h } = ce({ monacoRef: d, themeConfig: n, editor: u, theme: i }), f = k(() => ({ ...Ar, ...o || {} }), [o]);
|
|
1295
|
+
return /* @__PURE__ */ A.jsx(A.Fragment, { children: /* @__PURE__ */ A.jsx(
|
|
1296
|
+
gr,
|
|
1009
1297
|
{
|
|
1010
|
-
className: "overflow-hidden rounded-b-
|
|
1298
|
+
className: "overflow-hidden rounded-b-cn-3 border-x border-b",
|
|
1011
1299
|
language: r,
|
|
1012
1300
|
theme: h,
|
|
1013
1301
|
original: e,
|
|
@@ -1018,39 +1306,39 @@ function Br({
|
|
|
1018
1306
|
}
|
|
1019
1307
|
) });
|
|
1020
1308
|
}
|
|
1021
|
-
var
|
|
1022
|
-
function
|
|
1309
|
+
var Ye = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Ye || {});
|
|
1310
|
+
function Hr(e) {
|
|
1023
1311
|
const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), i = [];
|
|
1024
1312
|
return r == null || r.forEach((a) => {
|
|
1025
1313
|
const u = a.actions;
|
|
1026
|
-
a.selectors.forEach((
|
|
1027
|
-
switch (
|
|
1028
|
-
case
|
|
1029
|
-
|
|
1030
|
-
let
|
|
1314
|
+
a.selectors.forEach((d) => {
|
|
1315
|
+
switch (d.type) {
|
|
1316
|
+
case Ye.ContainsPath: {
|
|
1317
|
+
d.paths.forEach((h) => {
|
|
1318
|
+
let y = Object.keys(o).map((g) => ({
|
|
1031
1319
|
fullPath: g,
|
|
1032
1320
|
path: g,
|
|
1033
1321
|
symbol: o[g]
|
|
1034
|
-
})).filter((g) => g.path.startsWith(
|
|
1035
|
-
|
|
1322
|
+
})).filter((g) => g.path.startsWith(d.basePath));
|
|
1323
|
+
y = y.map((g) => ({
|
|
1036
1324
|
...g,
|
|
1037
|
-
path: g.path.substring(
|
|
1038
|
-
})),
|
|
1039
|
-
const
|
|
1040
|
-
u.forEach((
|
|
1041
|
-
const
|
|
1042
|
-
range:
|
|
1043
|
-
symbols: [
|
|
1044
|
-
onClick:
|
|
1045
|
-
data:
|
|
1046
|
-
path:
|
|
1325
|
+
path: g.path.substring(d.basePath.length)
|
|
1326
|
+
})), y.filter((g) => h.test(g.path)).forEach((g) => {
|
|
1327
|
+
const L = g.fullPath, T = g.symbol, I = T.range;
|
|
1328
|
+
u.forEach((E) => {
|
|
1329
|
+
const V = {
|
|
1330
|
+
range: I,
|
|
1331
|
+
symbols: [T],
|
|
1332
|
+
onClick: E.onClick,
|
|
1333
|
+
data: E.data,
|
|
1334
|
+
path: L
|
|
1047
1335
|
};
|
|
1048
1336
|
i.push({
|
|
1049
|
-
range:
|
|
1337
|
+
range: I,
|
|
1050
1338
|
command: {
|
|
1051
1339
|
id: n,
|
|
1052
|
-
title:
|
|
1053
|
-
arguments: [
|
|
1340
|
+
title: E.title,
|
|
1341
|
+
arguments: [V]
|
|
1054
1342
|
}
|
|
1055
1343
|
});
|
|
1056
1344
|
});
|
|
@@ -1070,40 +1358,40 @@ const te = class te {
|
|
|
1070
1358
|
return te.data;
|
|
1071
1359
|
}
|
|
1072
1360
|
};
|
|
1073
|
-
|
|
1074
|
-
let
|
|
1075
|
-
async function
|
|
1076
|
-
const t =
|
|
1361
|
+
Pe(te, "data", {});
|
|
1362
|
+
let we = te;
|
|
1363
|
+
async function Ge(e) {
|
|
1364
|
+
const t = we.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
|
|
1077
1365
|
return await t.OutlineModel.create(r, e);
|
|
1078
1366
|
}
|
|
1079
|
-
function
|
|
1367
|
+
function Ze(e) {
|
|
1080
1368
|
const t = /* @__PURE__ */ new Map();
|
|
1081
|
-
return
|
|
1369
|
+
return xe({
|
|
1082
1370
|
pathSymbolMap: t,
|
|
1083
1371
|
parentPath: "",
|
|
1084
1372
|
children: e.children,
|
|
1085
|
-
parentKind:
|
|
1373
|
+
parentKind: be.SymbolKind.Module
|
|
1086
1374
|
}), t;
|
|
1087
1375
|
}
|
|
1088
|
-
function
|
|
1376
|
+
function xe(e) {
|
|
1089
1377
|
switch (e.parentKind) {
|
|
1090
|
-
case
|
|
1091
|
-
|
|
1378
|
+
case be.SymbolKind.Module: {
|
|
1379
|
+
Rr(e);
|
|
1092
1380
|
break;
|
|
1093
1381
|
}
|
|
1094
|
-
case
|
|
1095
|
-
|
|
1382
|
+
case be.SymbolKind.Array: {
|
|
1383
|
+
Ur(e);
|
|
1096
1384
|
break;
|
|
1097
1385
|
}
|
|
1098
1386
|
default:
|
|
1099
|
-
|
|
1387
|
+
zr(e);
|
|
1100
1388
|
}
|
|
1101
1389
|
}
|
|
1102
|
-
function
|
|
1390
|
+
function Rr(e) {
|
|
1103
1391
|
e.children.forEach((t) => {
|
|
1104
1392
|
var n;
|
|
1105
1393
|
let r = e.parentPath;
|
|
1106
|
-
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)),
|
|
1394
|
+
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), xe({
|
|
1107
1395
|
pathSymbolMap: e.pathSymbolMap,
|
|
1108
1396
|
parentPath: r,
|
|
1109
1397
|
children: t.children,
|
|
@@ -1111,11 +1399,11 @@ function $r(e) {
|
|
|
1111
1399
|
});
|
|
1112
1400
|
});
|
|
1113
1401
|
}
|
|
1114
|
-
function
|
|
1402
|
+
function Ur(e) {
|
|
1115
1403
|
let t = 0;
|
|
1116
1404
|
e.children.forEach((r) => {
|
|
1117
1405
|
const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
|
|
1118
|
-
e.pathSymbolMap.set(n, r.symbol), t += 1,
|
|
1406
|
+
e.pathSymbolMap.set(n, r.symbol), t += 1, xe({
|
|
1119
1407
|
pathSymbolMap: e.pathSymbolMap,
|
|
1120
1408
|
parentPath: n,
|
|
1121
1409
|
children: r.children,
|
|
@@ -1123,44 +1411,47 @@ function Ir(e) {
|
|
|
1123
1411
|
});
|
|
1124
1412
|
});
|
|
1125
1413
|
}
|
|
1126
|
-
function
|
|
1414
|
+
function zr(e) {
|
|
1127
1415
|
const t = e.children.get("0");
|
|
1128
1416
|
if (t) {
|
|
1129
1417
|
const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
|
|
1130
1418
|
e.pathSymbolMap.set(r, t.symbol);
|
|
1131
1419
|
}
|
|
1132
1420
|
}
|
|
1133
|
-
function
|
|
1421
|
+
function Fr({
|
|
1134
1422
|
editorRef: e,
|
|
1135
1423
|
inlineActions: t
|
|
1136
1424
|
}) {
|
|
1137
|
-
|
|
1425
|
+
N(() => F.languages.registerCodeLensProvider("yaml", {
|
|
1138
1426
|
provideCodeLenses: async (n) => {
|
|
1139
|
-
var l;
|
|
1140
|
-
|
|
1141
|
-
|
|
1427
|
+
var l, d, h, f, y;
|
|
1428
|
+
if (((l = n == null ? void 0 : n.uri) == null ? void 0 : l.toString()) !== ((f = (h = (d = e.current) == null ? void 0 : d.getModel()) == null ? void 0 : h.uri) == null ? void 0 : f.toString()))
|
|
1429
|
+
return { lenses: [], dispose: () => {
|
|
1430
|
+
} };
|
|
1431
|
+
const o = await Ge(n), i = Ze(o), a = (y = e == null ? void 0 : e.current) == null ? void 0 : y.addCommand(0, ($, { onClick: g, path: L, range: T, data: I }) => {
|
|
1432
|
+
g({ path: L, range: T, data: I });
|
|
1142
1433
|
});
|
|
1143
1434
|
return a ? {
|
|
1144
|
-
lenses:
|
|
1435
|
+
lenses: Hr({ pathSymbolMap: i, inlineActions: t, commandId: a }),
|
|
1145
1436
|
dispose: () => {
|
|
1146
1437
|
}
|
|
1147
1438
|
} : void 0;
|
|
1148
1439
|
}
|
|
1149
1440
|
}).dispose, [t, e]);
|
|
1150
1441
|
}
|
|
1151
|
-
const
|
|
1152
|
-
const [r, n] =
|
|
1442
|
+
const Wr = ({ editorRef: e, selection: t }) => {
|
|
1443
|
+
const [r, n] = R(), o = k(
|
|
1153
1444
|
() => async (i, a, u) => {
|
|
1154
|
-
var
|
|
1155
|
-
const l = (
|
|
1445
|
+
var y, $, g;
|
|
1446
|
+
const l = (y = e == null ? void 0 : e.current) == null ? void 0 : y.getModel();
|
|
1156
1447
|
if (!l || !a)
|
|
1157
1448
|
return n(void 0);
|
|
1158
|
-
const
|
|
1449
|
+
const d = await Ge(l), f = ($ = Ze(d).get(a)) == null ? void 0 : $.range;
|
|
1159
1450
|
f && (n(f), u && ((g = e == null ? void 0 : e.current) == null || g.revealLineInCenter(f.startLineNumber)));
|
|
1160
1451
|
},
|
|
1161
1452
|
[]
|
|
1162
1453
|
);
|
|
1163
|
-
|
|
1454
|
+
N(() => {
|
|
1164
1455
|
if ("requestIdleCallback" in window) {
|
|
1165
1456
|
const i = requestIdleCallback(() => {
|
|
1166
1457
|
o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
|
|
@@ -1172,7 +1463,7 @@ const Dr = ({ editorRef: e, selection: t }) => {
|
|
|
1172
1463
|
}, 100);
|
|
1173
1464
|
return () => clearTimeout(i);
|
|
1174
1465
|
}
|
|
1175
|
-
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]),
|
|
1466
|
+
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), N(() => {
|
|
1176
1467
|
var a;
|
|
1177
1468
|
if (!r)
|
|
1178
1469
|
return;
|
|
@@ -1188,7 +1479,7 @@ const Dr = ({ editorRef: e, selection: t }) => {
|
|
|
1188
1479
|
]);
|
|
1189
1480
|
return () => i == null ? void 0 : i.clear();
|
|
1190
1481
|
}, [r, e, t == null ? void 0 : t.className]);
|
|
1191
|
-
},
|
|
1482
|
+
}, Je = nt({
|
|
1192
1483
|
markers: [],
|
|
1193
1484
|
setMarkers: () => {
|
|
1194
1485
|
},
|
|
@@ -1198,17 +1489,17 @@ const Dr = ({ editorRef: e, selection: t }) => {
|
|
|
1198
1489
|
updateCursorPosition: (e) => {
|
|
1199
1490
|
}
|
|
1200
1491
|
});
|
|
1201
|
-
function
|
|
1492
|
+
function an({
|
|
1202
1493
|
children: e
|
|
1203
1494
|
}) {
|
|
1204
|
-
const [t, r] =
|
|
1495
|
+
const [t, r] = R([]), [n, o] = R(null), i = J(
|
|
1205
1496
|
(a) => {
|
|
1206
1497
|
n == null || n.setPosition(a), n == null || n.revealLineInCenterIfOutsideViewport(a.lineNumber), n == null || n.focus();
|
|
1207
1498
|
},
|
|
1208
1499
|
[n]
|
|
1209
1500
|
);
|
|
1210
|
-
return /* @__PURE__ */
|
|
1211
|
-
|
|
1501
|
+
return /* @__PURE__ */ A.jsx(
|
|
1502
|
+
Je.Provider,
|
|
1212
1503
|
{
|
|
1213
1504
|
value: {
|
|
1214
1505
|
markers: t,
|
|
@@ -1221,25 +1512,25 @@ function Wr({
|
|
|
1221
1512
|
}
|
|
1222
1513
|
);
|
|
1223
1514
|
}
|
|
1224
|
-
function
|
|
1225
|
-
return
|
|
1515
|
+
function Qe() {
|
|
1516
|
+
return ot(Je);
|
|
1226
1517
|
}
|
|
1227
|
-
const
|
|
1228
|
-
const { setMarkers: n } =
|
|
1229
|
-
|
|
1518
|
+
const qr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
|
|
1519
|
+
const { setMarkers: n } = Qe();
|
|
1520
|
+
N(() => {
|
|
1230
1521
|
let o;
|
|
1231
1522
|
const i = setTimeout(() => {
|
|
1232
1523
|
var u;
|
|
1233
1524
|
const a = (u = e.current) == null ? void 0 : u.editor;
|
|
1234
1525
|
a && (o = a.onDidChangeMarkers((l) => {
|
|
1235
1526
|
var f;
|
|
1236
|
-
const
|
|
1237
|
-
if (!
|
|
1527
|
+
const d = (f = t.current) == null ? void 0 : f.getModel();
|
|
1528
|
+
if (!d)
|
|
1238
1529
|
return;
|
|
1239
|
-
const h =
|
|
1240
|
-
if (l.some((
|
|
1241
|
-
const
|
|
1242
|
-
n(
|
|
1530
|
+
const h = d.uri.toString();
|
|
1531
|
+
if (l.some((y) => y.toString() === h)) {
|
|
1532
|
+
const y = F.editor.getModelMarkers({ resource: d.uri });
|
|
1533
|
+
n(y);
|
|
1243
1534
|
}
|
|
1244
1535
|
}));
|
|
1245
1536
|
}, 100);
|
|
@@ -1248,17 +1539,17 @@ const Nr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
|
|
|
1248
1539
|
};
|
|
1249
1540
|
}, [e, r, n]);
|
|
1250
1541
|
};
|
|
1251
|
-
function
|
|
1542
|
+
function Br(e) {
|
|
1252
1543
|
var n, o;
|
|
1253
|
-
const t = ((o = (n =
|
|
1254
|
-
r !== -1 ? t[r] = e : t.push(e),
|
|
1544
|
+
const t = ((o = (n = Oe) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? [], r = t.findIndex((i) => i.fileMatch[0] === e.fileMatch[0]);
|
|
1545
|
+
r !== -1 ? t[r] = e : t.push(e), Xe(t);
|
|
1255
1546
|
}
|
|
1256
|
-
function
|
|
1547
|
+
function Kr(e) {
|
|
1257
1548
|
var n, o;
|
|
1258
|
-
const r = (((o = (n =
|
|
1259
|
-
|
|
1549
|
+
const r = (((o = (n = Oe) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== je(e));
|
|
1550
|
+
Xe(r);
|
|
1260
1551
|
}
|
|
1261
|
-
function
|
|
1552
|
+
function Xe(e) {
|
|
1262
1553
|
const t = {
|
|
1263
1554
|
hover: !0,
|
|
1264
1555
|
completion: !0,
|
|
@@ -1266,25 +1557,25 @@ function Ke(e) {
|
|
|
1266
1557
|
validate: !0,
|
|
1267
1558
|
schemas: e
|
|
1268
1559
|
};
|
|
1269
|
-
|
|
1560
|
+
Oe.setDiagnosticsOptions({ ...t });
|
|
1270
1561
|
}
|
|
1271
|
-
const
|
|
1562
|
+
const je = (e) => it.parse(`file://${e}`).toString(), Yr = (e) => {
|
|
1272
1563
|
const { schemaConfig: t, instanceId: r } = e;
|
|
1273
|
-
|
|
1564
|
+
N(() => {
|
|
1274
1565
|
if (t != null && t.schema)
|
|
1275
|
-
return
|
|
1276
|
-
fileMatch: [
|
|
1566
|
+
return Br({
|
|
1567
|
+
fileMatch: [je(r.toString())],
|
|
1277
1568
|
...t
|
|
1278
1569
|
}), () => {
|
|
1279
|
-
|
|
1570
|
+
Kr(r);
|
|
1280
1571
|
};
|
|
1281
1572
|
}, [t == null ? void 0 : t.schema, r]);
|
|
1282
1573
|
};
|
|
1283
|
-
|
|
1284
|
-
const
|
|
1285
|
-
...
|
|
1574
|
+
q.config({ monaco: F });
|
|
1575
|
+
const Gr = {
|
|
1576
|
+
...ae,
|
|
1286
1577
|
folding: !0
|
|
1287
|
-
},
|
|
1578
|
+
}, cn = function(t) {
|
|
1288
1579
|
const {
|
|
1289
1580
|
yamlRevision: r,
|
|
1290
1581
|
schemaConfig: n,
|
|
@@ -1293,85 +1584,88 @@ const _r = {
|
|
|
1293
1584
|
onYamlRevisionChange: a,
|
|
1294
1585
|
selection: u,
|
|
1295
1586
|
theme: l,
|
|
1296
|
-
options:
|
|
1587
|
+
options: d,
|
|
1297
1588
|
animateOnUpdate: h = !1,
|
|
1298
1589
|
onAnimateEnd: f,
|
|
1299
|
-
instanceId:
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1590
|
+
instanceId: y,
|
|
1591
|
+
height: $
|
|
1592
|
+
} = t, g = ie(), [L] = R(y ?? `yaml-editor-${Math.random()}`), { editor: T, setEditor: I } = Qe(), E = v(null), V = v(), _ = v({ yaml: "", revisionId: 0 }), b = v(null), C = v(null), M = J(
|
|
1593
|
+
(m) => {
|
|
1594
|
+
var c, w, H;
|
|
1595
|
+
const p = m.split(`
|
|
1596
|
+
`), S = (c = b.current) == null ? void 0 : c.getModel();
|
|
1597
|
+
if (S) {
|
|
1598
|
+
(w = b.current) == null || w.pushUndoStop(), S.setValue("");
|
|
1599
|
+
let W = 0;
|
|
1600
|
+
C.current = window.setInterval(() => {
|
|
1601
|
+
var B;
|
|
1602
|
+
W < p.length ? (g && ((B = b.current) == null || B.executeEdits("addLine", [
|
|
1311
1603
|
{
|
|
1312
|
-
range: new
|
|
1313
|
-
text: p[
|
|
1604
|
+
range: new g.Range(W + 1, 1, W + 1, 1),
|
|
1605
|
+
text: p[W] + `
|
|
1314
1606
|
`
|
|
1315
1607
|
}
|
|
1316
|
-
])),
|
|
1317
|
-
}, 100), (
|
|
1608
|
+
])), W++) : C.current && (clearInterval(C.current), f == null || f());
|
|
1609
|
+
}, 100), (H = b.current) == null || H.pushUndoStop();
|
|
1318
1610
|
}
|
|
1319
1611
|
},
|
|
1320
|
-
[
|
|
1612
|
+
[g]
|
|
1321
1613
|
);
|
|
1322
|
-
|
|
1323
|
-
|
|
1614
|
+
N(() => () => {
|
|
1615
|
+
C.current && clearInterval(C.current);
|
|
1324
1616
|
}, []);
|
|
1325
|
-
function
|
|
1326
|
-
|
|
1327
|
-
var
|
|
1328
|
-
(
|
|
1617
|
+
function j(m, p) {
|
|
1618
|
+
b.current = m, V.current = p, m.setValue(r.yaml), I(m), setTimeout(() => {
|
|
1619
|
+
var S;
|
|
1620
|
+
(S = E.current) != null && S.style && (E.current.style.opacity = "1");
|
|
1329
1621
|
}, 50);
|
|
1330
1622
|
}
|
|
1331
|
-
|
|
1332
|
-
var
|
|
1333
|
-
if (
|
|
1334
|
-
const p =
|
|
1335
|
-
p && (
|
|
1623
|
+
N(() => {
|
|
1624
|
+
var m;
|
|
1625
|
+
if (b.current && (!r.revisionId || r.revisionId > Number((m = _.current) == null ? void 0 : m.revisionId))) {
|
|
1626
|
+
const p = b.current.getModel();
|
|
1627
|
+
p && (b.current.executeEdits("edit", [
|
|
1336
1628
|
{
|
|
1337
1629
|
range: p.getFullModelRange(),
|
|
1338
1630
|
text: h ? "" : r.yaml
|
|
1339
1631
|
}
|
|
1340
|
-
]), h &&
|
|
1632
|
+
]), h && M(r.yaml));
|
|
1341
1633
|
}
|
|
1342
|
-
}, [
|
|
1343
|
-
const { theme:
|
|
1344
|
-
|
|
1345
|
-
const
|
|
1634
|
+
}, [M, r, h]), Yr({ schemaConfig: n, instanceId: L }), Fr({ editorRef: b, inlineActions: o });
|
|
1635
|
+
const { theme: x } = ce({ monacoRef: V, themeConfig: i, editor: T, theme: l });
|
|
1636
|
+
qr({ monacoRef: V, editorRef: b, instanceId: L }), Wr({ editorRef: b, selection: u });
|
|
1637
|
+
const s = k(() => je(L), []), O = k(
|
|
1346
1638
|
() => ({
|
|
1347
|
-
...
|
|
1348
|
-
...
|
|
1639
|
+
...Gr,
|
|
1640
|
+
...d
|
|
1349
1641
|
}),
|
|
1350
|
-
[
|
|
1642
|
+
[d]
|
|
1351
1643
|
);
|
|
1352
|
-
return /* @__PURE__ */
|
|
1353
|
-
|
|
1644
|
+
return /* @__PURE__ */ A.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: E, children: /* @__PURE__ */ A.jsx(
|
|
1645
|
+
fe,
|
|
1354
1646
|
{
|
|
1355
|
-
onChange: (
|
|
1356
|
-
|
|
1647
|
+
onChange: (m, p) => {
|
|
1648
|
+
_.current = { yaml: m ?? "", revisionId: p.versionId }, a({ ..._.current }, p);
|
|
1357
1649
|
},
|
|
1358
1650
|
language: "yaml",
|
|
1359
|
-
theme:
|
|
1360
|
-
options:
|
|
1361
|
-
path:
|
|
1362
|
-
onMount:
|
|
1651
|
+
theme: x,
|
|
1652
|
+
options: O,
|
|
1653
|
+
path: s,
|
|
1654
|
+
onMount: j,
|
|
1655
|
+
height: $
|
|
1363
1656
|
}
|
|
1364
1657
|
) });
|
|
1365
1658
|
};
|
|
1366
1659
|
export {
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1660
|
+
tn as BlameEditor,
|
|
1661
|
+
rn as BlameEditorV2,
|
|
1662
|
+
on as CodeDiffEditor,
|
|
1663
|
+
nn as CodeEditor,
|
|
1664
|
+
we as MonacoGlobals,
|
|
1665
|
+
Ye as SelectorType,
|
|
1666
|
+
cn as YamlEditor,
|
|
1667
|
+
Je as YamlEditorContext,
|
|
1668
|
+
an as YamlEditorContextProvider,
|
|
1669
|
+
Qe as useYamlEditorContext
|
|
1376
1670
|
};
|
|
1377
1671
|
//# sourceMappingURL=index.js.map
|