@harnessio/yaml-editor 0.21.0 → 0.22.1
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/BlameEditorV2.d.ts +21 -0
- package/dist/components/CodeEditor.d.ts +9 -3
- 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 +57 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +867 -573
- 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 Oe, useState as R, useRef as y, useCallback as J, useEffect as N, useMemo as V, useLayoutEffect as ke, 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 Me } from "monaco-yaml";
|
|
9
|
+
var Ve = { 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 ot() {
|
|
|
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 @@ ot();
|
|
|
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
|
+
Ve.exports = ne;
|
|
72
|
+
var A = Ve.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 st(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 lt(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,21 +118,21 @@ function dt(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) || Ot(e, t) || Mt();
|
|
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 {
|
|
131
132
|
for (var a = e[Symbol.iterator](), u; !(n = (u = a.next()).done) && (r.push(u.value), !(t && r.length === t)); n = !0)
|
|
132
133
|
;
|
|
133
|
-
} catch (
|
|
134
|
-
o = !0, i =
|
|
134
|
+
} catch (l) {
|
|
135
|
+
o = !0, i = l;
|
|
135
136
|
} finally {
|
|
136
137
|
try {
|
|
137
138
|
!n && a.return != null && a.return();
|
|
@@ -143,28 +144,28 @@ function mt(e, t) {
|
|
|
143
144
|
return r;
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function Ot(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 Mt() {
|
|
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 vt(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) {
|
|
@@ -207,44 +208,44 @@ function X(e) {
|
|
|
207
208
|
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
208
209
|
o[i] = arguments[i];
|
|
209
210
|
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
210
|
-
for (var a = arguments.length, u = new Array(a),
|
|
211
|
-
u[
|
|
211
|
+
for (var a = arguments.length, u = new Array(a), l = 0; l < a; l++)
|
|
212
|
+
u[l] = arguments[l];
|
|
212
213
|
return t.apply(r, [].concat(o, u));
|
|
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,76 +255,76 @@ var Pt = {
|
|
|
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(kt)(r, t), o = X(_t)(r), i = X(se.changes)(e), a = X(Dt)(r);
|
|
269
270
|
function u() {
|
|
270
|
-
var
|
|
271
|
-
return
|
|
271
|
+
var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(g) {
|
|
272
|
+
return g;
|
|
272
273
|
};
|
|
273
|
-
return
|
|
274
|
+
return se.selector(d), d(r.current);
|
|
274
275
|
}
|
|
275
|
-
function d
|
|
276
|
-
|
|
276
|
+
function l(d) {
|
|
277
|
+
Et(n, o, i, a)(d);
|
|
277
278
|
}
|
|
278
|
-
return [u,
|
|
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 kt(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 Vt = {
|
|
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];
|
|
303
304
|
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
304
|
-
for (var a = arguments.length, u = new Array(a),
|
|
305
|
-
u[
|
|
305
|
+
for (var a = arguments.length, u = new Array(a), l = 0; l < a; l++)
|
|
306
|
+
u[l] = arguments[l];
|
|
306
307
|
return t.apply(r, [].concat(o, u));
|
|
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 = Vt.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 Ht() {
|
|
|
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 Kt() {
|
|
|
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 = Oe(sr);
|
|
470
|
+
function ur(e) {
|
|
471
|
+
N(e, []);
|
|
472
|
+
}
|
|
473
|
+
var Se = ur;
|
|
474
|
+
function lr(e, t, r = !0) {
|
|
475
|
+
let n = y(!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: g = "Loading...", options: f = {}, height: b = "100%", width: x = "100%", className: h, wrapperProps: I = {}, beforeMount: D = ee, onMount: L = ee }) {
|
|
496
|
+
let [j, T] = R(!1), [k, M] = R(!0), C = y(null), $ = y(null), E = y(null), v = y(L), s = y(D), w = y(!1);
|
|
497
|
+
Se(() => {
|
|
498
|
+
let c = q.init();
|
|
499
|
+
return c.then((S) => ($.current = S) && M(!1)).catch((S) => (S == null ? void 0 : S.type) !== "cancelation" && console.error("Monaco initialization: error:", S)), () => C.current ? O() : c.cancel();
|
|
500
|
+
}), z(() => {
|
|
501
|
+
if (C.current && $.current) {
|
|
502
|
+
let c = C.current.getOriginalEditor(), S = Z($.current, e || "", n || r || "text", i || "");
|
|
503
|
+
S !== c.getModel() && c.setModel(S);
|
|
503
504
|
}
|
|
504
|
-
}, [i],
|
|
505
|
-
if (
|
|
506
|
-
let c =
|
|
507
|
-
|
|
505
|
+
}, [i], j), z(() => {
|
|
506
|
+
if (C.current && $.current) {
|
|
507
|
+
let c = C.current.getModifiedEditor(), S = Z($.current, t || "", o || r || "text", a || "");
|
|
508
|
+
S !== c.getModel() && c.setModel(S);
|
|
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], j), z(() => {
|
|
511
|
+
let c = C.current.getModifiedEditor();
|
|
512
|
+
c.getOption($.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
|
|
513
|
+
}, [t], j), z(() => {
|
|
514
|
+
var c, S;
|
|
515
|
+
(S = (c = C.current) == null ? void 0 : c.getModel()) == null || S.original.setValue(e || "");
|
|
516
|
+
}, [e], j), z(() => {
|
|
517
|
+
let { original: c, modified: S } = C.current.getModel();
|
|
518
|
+
$.current.editor.setModelLanguage(c, n || r || "text"), $.current.editor.setModelLanguage(S, o || r || "text");
|
|
519
|
+
}, [r, n, o], j), z(() => {
|
|
519
520
|
var c;
|
|
520
|
-
(c =
|
|
521
|
-
}, [
|
|
521
|
+
(c = $.current) == null || c.editor.setTheme(d);
|
|
522
|
+
}, [d], j), z(() => {
|
|
522
523
|
var c;
|
|
523
|
-
(c =
|
|
524
|
-
}, [
|
|
525
|
-
let
|
|
526
|
-
var
|
|
527
|
-
if (
|
|
524
|
+
(c = C.current) == null || c.updateOptions(f);
|
|
525
|
+
}, [f], j);
|
|
526
|
+
let m = J(() => {
|
|
527
|
+
var H;
|
|
528
|
+
if (!$.current)
|
|
528
529
|
return;
|
|
529
|
-
|
|
530
|
-
let c = Z(
|
|
531
|
-
(
|
|
532
|
-
}, [r, t, o, e, n, i, a]),
|
|
530
|
+
s.current($.current);
|
|
531
|
+
let c = Z($.current, e || "", n || r || "text", i || ""), S = Z($.current, t || "", o || r || "text", a || "");
|
|
532
|
+
(H = C.current) == null || H.setModel({ original: c, modified: S });
|
|
533
|
+
}, [r, t, o, e, n, i, a]), p = J(() => {
|
|
533
534
|
var c;
|
|
534
|
-
!
|
|
535
|
-
}, [
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}, [
|
|
539
|
-
!
|
|
540
|
-
}, [
|
|
541
|
-
function
|
|
542
|
-
var
|
|
543
|
-
let c = (
|
|
544
|
-
u || ((
|
|
535
|
+
!w.current && E.current && (C.current = $.current.editor.createDiffEditor(E.current, { automaticLayout: !0, ...f }), m(), (c = $.current) == null || c.editor.setTheme(d), T(!0), w.current = !0);
|
|
536
|
+
}, [f, d, m]);
|
|
537
|
+
N(() => {
|
|
538
|
+
j && v.current(C.current, $.current);
|
|
539
|
+
}, [j]), N(() => {
|
|
540
|
+
!k && !j && p();
|
|
541
|
+
}, [k, j, p]);
|
|
542
|
+
function O() {
|
|
543
|
+
var S, H, W, B;
|
|
544
|
+
let c = (S = C.current) == null ? void 0 : S.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: x, height: b, isEditorReady: j, loading: g, _ref: E, className: h, wrapperProps: I });
|
|
547
548
|
}
|
|
548
|
-
var
|
|
549
|
-
function
|
|
550
|
-
let [e, t] =
|
|
551
|
-
return
|
|
549
|
+
var mr = pr, gr = Oe(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 = y();
|
|
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: g = {}, saveViewState: f = !0, keepCurrentModel: b = !1, width: x = "100%", height: h = "100%", className: I, wrapperProps: D = {}, beforeMount: L = ee, onMount: j = ee, onChange: T, onValidate: k = ee }) {
|
|
568
|
+
let [M, C] = R(!1), [$, E] = R(!0), v = y(null), s = y(null), w = y(null), m = y(j), p = y(L), O = y(), c = y(n), S = yr(i), H = y(!1), W = y(!1);
|
|
569
|
+
Se(() => {
|
|
570
|
+
let P = q.init();
|
|
571
|
+
return P.then((_) => (v.current = _) && E(!1)).catch((_) => (_ == null ? void 0 : _.type) !== "cancelation" && console.error("Monaco initialization: error:", _)), () => s.current ? et() : P.cancel();
|
|
572
|
+
}), z(() => {
|
|
573
|
+
var _, U, Q, G;
|
|
574
|
+
let P = Z(v.current, e || n || "", t || o || "", i || r || "");
|
|
575
|
+
P !== ((_ = s.current) == null ? void 0 : _.getModel()) && (f && ue.set(S, (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], M), z(() => {
|
|
577
|
+
var P;
|
|
578
|
+
(P = s.current) == null || P.updateOptions(d);
|
|
579
|
+
}, [d], M), z(() => {
|
|
580
|
+
!s.current || n === void 0 || (s.current.getOption(v.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], M), z(() => {
|
|
582
|
+
var _, U;
|
|
583
|
+
let P = (_ = s.current) == null ? void 0 : _.getModel();
|
|
584
|
+
P && o && ((U = v.current) == null || U.editor.setModelLanguage(P, o));
|
|
585
|
+
}, [o], M), z(() => {
|
|
586
|
+
var P;
|
|
587
|
+
u !== void 0 && ((P = s.current) == null || P.revealLine(u));
|
|
588
|
+
}, [u], M), z(() => {
|
|
589
|
+
var P;
|
|
590
|
+
(P = v.current) == null || P.editor.setTheme(a);
|
|
591
|
+
}, [a], M);
|
|
592
|
+
let B = J(() => {
|
|
593
|
+
var P;
|
|
594
|
+
if (!(!w.current || !v.current) && !H.current) {
|
|
595
|
+
p.current(v.current);
|
|
596
|
+
let _ = i || r, U = Z(v.current, n || e || "", t || o || "", _ || "");
|
|
597
|
+
s.current = (P = v.current) == null ? void 0 : P.editor.create(w.current, { model: U, automaticLayout: !0, ...d }, g), f && s.current.restoreViewState(ue.get(_)), v.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, g, f, a, u]);
|
|
600
|
+
N(() => {
|
|
601
|
+
M && m.current(s.current, v.current);
|
|
602
|
+
}, [M]), N(() => {
|
|
603
|
+
!$ && !M && B();
|
|
604
|
+
}, [$, M, B]), c.current = n, N(() => {
|
|
605
|
+
var P, _;
|
|
606
|
+
M && T && ((P = O.current) == null || P.dispose(), O.current = (_ = s.current) == null ? void 0 : _.onDidChangeModelContent((U) => {
|
|
607
|
+
W.current || T(s.current.getValue(), U);
|
|
607
608
|
}));
|
|
608
|
-
}, [
|
|
609
|
-
if (
|
|
610
|
-
let
|
|
609
|
+
}, [M, T]), N(() => {
|
|
610
|
+
if (M) {
|
|
611
|
+
let P = v.current.editor.onDidChangeMarkers((_) => {
|
|
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 && _.find((G) => G.path === U.path)) {
|
|
615
|
+
let G = v.current.editor.getModelMarkers({ resource: U });
|
|
616
|
+
k == null || k(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
|
+
}, [M, k]);
|
|
626
|
+
function et() {
|
|
627
|
+
var P, _;
|
|
628
|
+
(P = O.current) == null || P.dispose(), b ? f && ue.set(i, s.current.saveViewState()) : (_ = s.current.getModel()) == null || _.dispose(), s.current.dispose();
|
|
628
629
|
}
|
|
629
|
-
return
|
|
630
|
+
return Y.createElement(We, { width: x, height: h, isEditorReady: M, loading: l, _ref: w, className: I, wrapperProps: D });
|
|
630
631
|
}
|
|
631
|
-
var
|
|
632
|
-
const
|
|
632
|
+
var wr = br, Or = Oe(wr), fe = Or;
|
|
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
|
-
(u = t == null ? void 0 : t.monacoThemes) == null || u.forEach((
|
|
658
|
-
|
|
658
|
+
(u = t == null ? void 0 : t.monacoThemes) == null || u.forEach((l) => {
|
|
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 Mr(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 yr = (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 wr({
|
|
|
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 Or({
|
|
|
734
735
|
}) {
|
|
735
736
|
let o = "";
|
|
736
737
|
return t.forEach((i) => {
|
|
737
|
-
var
|
|
738
|
-
const a = (
|
|
739
|
-
for (let
|
|
740
|
-
|
|
741
|
-
.monaco-editor-${e} .view-line .blame-editor-commit-${
|
|
742
|
-
content: '${
|
|
738
|
+
var d, g, f, b, x, h, I, D;
|
|
739
|
+
const a = (g = (d = i == null ? void 0 : i.commitInfo) == null ? void 0 : d.author) == null ? void 0 : g.avatarUrl, u = (b = (f = i == null ? void 0 : i.commitInfo) == null ? void 0 : f.author) == null ? void 0 : b.initials, l = a ? `background: url('${(h = (x = i == null ? void 0 : i.commitInfo) == null ? void 0 : x.author) == null ? void 0 : h.avatarUrl}');` : "";
|
|
740
|
+
for (let L = i.fromLineNumber; L <= i.toLineNumber; L++)
|
|
741
|
+
L === i.fromLineNumber ? o += `
|
|
742
|
+
.monaco-editor-${e} .view-line .blame-editor-commit-${L}:before {
|
|
743
|
+
content: '${Mr(Er(((D = (I = i == null ? void 0 : i.commitInfo) == null ? void 0 : I.author) == null ? void 0 : D.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-${L}: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-${L}:before {
|
|
766
771
|
content: ' ';
|
|
767
772
|
left: 10px;
|
|
768
773
|
top: 0px;
|
|
@@ -770,13 +775,13 @@ function Or({
|
|
|
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, Sr = 30, jr = 140, Er = 24, Pr = {
|
|
|
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,198 +800,481 @@ function qr({
|
|
|
795
800
|
showSeparators: i = !0,
|
|
796
801
|
theme: a,
|
|
797
802
|
height: u = "75vh",
|
|
798
|
-
options:
|
|
799
|
-
className:
|
|
803
|
+
options: l,
|
|
804
|
+
className: d
|
|
800
805
|
}) {
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
const [
|
|
804
|
-
|
|
805
|
-
|
|
806
|
+
const g = y(o), f = y(null), b = y(Ee(5));
|
|
807
|
+
ie();
|
|
808
|
+
const [x, h] = R(), I = y(null), D = y(null);
|
|
809
|
+
N(() => {
|
|
810
|
+
g.current = o;
|
|
806
811
|
}, [o]);
|
|
807
|
-
function
|
|
808
|
-
const
|
|
809
|
-
if (!
|
|
812
|
+
function L() {
|
|
813
|
+
const s = D.current, w = I.current;
|
|
814
|
+
if (!s || !w)
|
|
810
815
|
return;
|
|
811
|
-
i &&
|
|
812
|
-
|
|
816
|
+
i && s.changeViewZones(function(p) {
|
|
817
|
+
p.addZone({
|
|
813
818
|
afterLineNumber: 0,
|
|
814
819
|
heightInPx: 10,
|
|
815
820
|
domNode: document.createElement("div")
|
|
816
|
-
}),
|
|
817
|
-
if (c !==
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
afterLineNumber:
|
|
821
|
+
}), g.current.forEach((O, c) => {
|
|
822
|
+
if (c !== g.current.length - 1) {
|
|
823
|
+
const S = document.createElement("div");
|
|
824
|
+
S.style.borderTop = "1px solid var(--cn-border-2)", S.style.marginTop = "9px", S.className = "blame-editor-separator", p.addZone({
|
|
825
|
+
afterLineNumber: O.toLineNumber,
|
|
821
826
|
heightInPx: 20,
|
|
822
|
-
domNode:
|
|
827
|
+
domNode: S
|
|
823
828
|
});
|
|
824
829
|
}
|
|
825
830
|
});
|
|
826
831
|
});
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
var
|
|
830
|
-
for (let c =
|
|
831
|
-
|
|
832
|
-
range: new
|
|
832
|
+
const m = [];
|
|
833
|
+
g.current.forEach((p) => {
|
|
834
|
+
var O;
|
|
835
|
+
for (let c = p.fromLineNumber; c <= p.toLineNumber; c++)
|
|
836
|
+
m.push({
|
|
837
|
+
range: new w.Range(c, 0, c + 1, 0),
|
|
833
838
|
options: {
|
|
834
839
|
before: {
|
|
835
|
-
content:
|
|
836
|
-
c ===
|
|
837
|
-
|
|
840
|
+
content: Ke(
|
|
841
|
+
c === p.fromLineNumber && ((O = p == null ? void 0 : p.commitInfo) == null ? void 0 : O.title) || "",
|
|
842
|
+
jr
|
|
838
843
|
),
|
|
839
|
-
cursorStops:
|
|
844
|
+
cursorStops: w.editor.InjectedTextCursorStops.None,
|
|
840
845
|
inlineClassName: `blame-editor-commit blame-editor-commit-${c}`
|
|
841
846
|
}
|
|
842
847
|
}
|
|
843
848
|
});
|
|
844
|
-
}),
|
|
849
|
+
}), s.createDecorationsCollection(m);
|
|
845
850
|
}
|
|
846
|
-
function
|
|
847
|
-
var
|
|
848
|
-
|
|
851
|
+
function j(s, w) {
|
|
852
|
+
var m, p, O, c, S, H;
|
|
853
|
+
D.current = s, I.current = w, s.setValue(e), h(s), (O = (p = (m = w.languages.typescript) == null ? void 0 : m.typescriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || O.call(p, {
|
|
849
854
|
noSuggestionDiagnostics: !0,
|
|
850
855
|
noSyntaxValidation: !0,
|
|
851
856
|
noSemanticValidation: !0
|
|
852
|
-
}), (
|
|
857
|
+
}), (H = (S = (c = w.languages.typescript) == null ? void 0 : c.javascriptDefaults) == null ? void 0 : S.setDiagnosticsOptions) == null || H.call(S, {
|
|
853
858
|
noSuggestionDiagnostics: !0,
|
|
854
859
|
noSyntaxValidation: !0,
|
|
855
860
|
noSemanticValidation: !0
|
|
856
|
-
}),
|
|
861
|
+
}), L();
|
|
857
862
|
}
|
|
858
|
-
|
|
859
|
-
|
|
863
|
+
N(() => {
|
|
864
|
+
x == null || x.setValue(e);
|
|
860
865
|
}, [e]);
|
|
861
|
-
const { theme:
|
|
862
|
-
() =>
|
|
863
|
-
instanceId:
|
|
866
|
+
const { theme: T } = ce({ monacoRef: I, themeConfig: r, editor: x, theme: a }), k = V(
|
|
867
|
+
() => Be({
|
|
868
|
+
instanceId: b.current,
|
|
864
869
|
lineNumbersPosition: n
|
|
865
870
|
}),
|
|
866
871
|
[o]
|
|
867
|
-
),
|
|
868
|
-
() =>
|
|
869
|
-
instanceId:
|
|
872
|
+
), M = V(
|
|
873
|
+
() => xr({
|
|
874
|
+
instanceId: b.current,
|
|
870
875
|
blameData: o,
|
|
871
|
-
avatarSize:
|
|
872
|
-
dateWidth:
|
|
876
|
+
avatarSize: Cr,
|
|
877
|
+
dateWidth: Pr
|
|
873
878
|
}),
|
|
874
879
|
[o]
|
|
875
880
|
);
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}, []),
|
|
879
|
-
if (n === "center" &&
|
|
880
|
-
const
|
|
881
|
-
if (
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
},
|
|
886
|
-
return
|
|
887
|
-
|
|
881
|
+
ke(() => {
|
|
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 w = { attributes: !0 }, m = () => {
|
|
888
|
+
const O = parseInt(getComputedStyle(s).left);
|
|
889
|
+
f.current && (f.current.style.setProperty("--line-number-offset", `${he + 16 + O}px`), f.current.style.setProperty("--line-number-display", "block"));
|
|
890
|
+
}, p = new MutationObserver(m);
|
|
891
|
+
return p.observe(s, w), m(), () => {
|
|
892
|
+
p.disconnect();
|
|
888
893
|
};
|
|
889
894
|
}
|
|
890
895
|
}
|
|
891
896
|
});
|
|
892
|
-
const
|
|
893
|
-
.monaco-editor-${
|
|
897
|
+
const C = V(() => `
|
|
898
|
+
.monaco-editor-${b.current} .margin {
|
|
894
899
|
display: var(--line-number-display);
|
|
895
900
|
left: var(--line-number-offset);
|
|
896
901
|
pointer-events: none;
|
|
897
|
-
}`, []),
|
|
902
|
+
}`, []), $ = V(() => `.monaco-editor-${b.current} .view-overlays {
|
|
898
903
|
clip-path: polygon(${he + 16}px 0, 100% 0%, 100% 100%, ${he + 16}px 100%);
|
|
899
904
|
height:100% !important;
|
|
900
|
-
}`, []),
|
|
905
|
+
}`, []), E = V(
|
|
901
906
|
() => ({
|
|
902
|
-
|
|
903
|
-
...
|
|
907
|
+
...$r,
|
|
908
|
+
...l
|
|
904
909
|
}),
|
|
905
|
-
[
|
|
906
|
-
),
|
|
910
|
+
[l]
|
|
911
|
+
), v = V(() => /* @__PURE__ */ A.jsx(
|
|
907
912
|
"style",
|
|
908
913
|
{
|
|
909
914
|
dangerouslySetInnerHTML: {
|
|
910
|
-
__html: `${
|
|
915
|
+
__html: `${k} ${M} ${C} ${$}`
|
|
911
916
|
}
|
|
912
917
|
}
|
|
913
|
-
), [
|
|
914
|
-
return /* @__PURE__ */
|
|
915
|
-
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
|
|
918
|
+
), [k, M, $, C]);
|
|
919
|
+
return /* @__PURE__ */ A.jsxs("div", { className: d, ref: f, children: [
|
|
920
|
+
v,
|
|
921
|
+
/* @__PURE__ */ A.jsx(
|
|
922
|
+
fe,
|
|
918
923
|
{
|
|
919
|
-
className: `monaco-editor-${
|
|
924
|
+
className: `monaco-editor-${b.current} overflow-hidden rounded-b-cn-3`,
|
|
920
925
|
height: u,
|
|
921
926
|
language: t,
|
|
922
|
-
theme:
|
|
923
|
-
options:
|
|
924
|
-
onMount:
|
|
927
|
+
theme: T,
|
|
928
|
+
options: E,
|
|
929
|
+
onMount: j
|
|
925
930
|
}
|
|
926
931
|
)
|
|
927
932
|
] });
|
|
928
933
|
}
|
|
929
|
-
|
|
930
|
-
const
|
|
931
|
-
...
|
|
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"
|
|
932
945
|
};
|
|
933
|
-
function
|
|
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 = y(o), g = y(null), f = y(Ee(5));
|
|
958
|
+
ie();
|
|
959
|
+
const [b, x] = R(), h = y(null), I = y(null);
|
|
960
|
+
N(() => {
|
|
961
|
+
d.current = o;
|
|
962
|
+
}, [o]);
|
|
963
|
+
function D() {
|
|
964
|
+
const E = I.current, v = h.current;
|
|
965
|
+
if (!E || !v)
|
|
966
|
+
return;
|
|
967
|
+
E.changeViewZones(function(w) {
|
|
968
|
+
w.addZone({
|
|
969
|
+
afterLineNumber: 0,
|
|
970
|
+
heightInPx: 1,
|
|
971
|
+
domNode: document.createElement("div")
|
|
972
|
+
}), d.current.forEach((m) => {
|
|
973
|
+
if (m.infoContent) {
|
|
974
|
+
const O = document.createElement("div");
|
|
975
|
+
O.className = "blame-editor-info-holder", O.style.position = "relative", O.style.zIndex = "100", O.style.overflow = "visible", Lr(O, m.infoContent), w.addZone({
|
|
976
|
+
afterLineNumber: m.fromLineNumber - 1,
|
|
977
|
+
heightInPx: 0,
|
|
978
|
+
domNode: O
|
|
979
|
+
});
|
|
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", w.addZone({
|
|
983
|
+
afterLineNumber: m.toLineNumber,
|
|
984
|
+
heightInPx: 20,
|
|
985
|
+
domNode: p
|
|
986
|
+
});
|
|
987
|
+
});
|
|
988
|
+
});
|
|
989
|
+
const s = [];
|
|
990
|
+
d.current.forEach((w) => {
|
|
991
|
+
for (let m = w.fromLineNumber; m <= w.toLineNumber; m++)
|
|
992
|
+
s.push({
|
|
993
|
+
range: new v.Range(m, 0, m + 1, 0),
|
|
994
|
+
options: {
|
|
995
|
+
before: {
|
|
996
|
+
content: Ke("", Ir),
|
|
997
|
+
cursorStops: v.editor.InjectedTextCursorStops.None,
|
|
998
|
+
inlineClassName: `blame-editor-commit blame-editor-commit-${m}`
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
}), E.createDecorationsCollection(s);
|
|
1003
|
+
}
|
|
1004
|
+
function L(E, v) {
|
|
1005
|
+
var s, w, m, p, O, c;
|
|
1006
|
+
I.current = E, h.current = v, E.setValue(e), x(E), (m = (w = (s = v.languages.typescript) == null ? void 0 : s.typescriptDefaults) == null ? void 0 : w.setDiagnosticsOptions) == null || m.call(w, {
|
|
1007
|
+
noSuggestionDiagnostics: !0,
|
|
1008
|
+
noSyntaxValidation: !0,
|
|
1009
|
+
noSemanticValidation: !0
|
|
1010
|
+
}), (c = (O = (p = v.languages.typescript) == null ? void 0 : p.javascriptDefaults) == null ? void 0 : O.setDiagnosticsOptions) == null || c.call(O, {
|
|
1011
|
+
noSuggestionDiagnostics: !0,
|
|
1012
|
+
noSyntaxValidation: !0,
|
|
1013
|
+
noSemanticValidation: !0
|
|
1014
|
+
}), D();
|
|
1015
|
+
}
|
|
1016
|
+
N(() => {
|
|
1017
|
+
b == null || b.setValue(e);
|
|
1018
|
+
}, [e]);
|
|
1019
|
+
const { theme: j } = ce({ monacoRef: h, themeConfig: r, editor: b, theme: i }), T = V(
|
|
1020
|
+
() => Be({
|
|
1021
|
+
instanceId: f.current,
|
|
1022
|
+
lineNumbersPosition: n
|
|
1023
|
+
}),
|
|
1024
|
+
[o]
|
|
1025
|
+
);
|
|
1026
|
+
ke(() => {
|
|
1027
|
+
g.current && g.current.style.setProperty("--line-number-display", "none");
|
|
1028
|
+
}, []), N(() => {
|
|
1029
|
+
if (n === "center" && g.current) {
|
|
1030
|
+
const E = g.current.getElementsByClassName("lines-content")[0];
|
|
1031
|
+
if (E) {
|
|
1032
|
+
const v = { attributes: !0 }, s = () => {
|
|
1033
|
+
const m = parseInt(getComputedStyle(E).left);
|
|
1034
|
+
g.current && (g.current.style.setProperty("--line-number-offset", `${ve + 16 + m}px`), g.current.style.setProperty("--line-number-display", "block"));
|
|
1035
|
+
}, w = new MutationObserver(s);
|
|
1036
|
+
return w.observe(E, v), s(), () => {
|
|
1037
|
+
w.disconnect();
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
const k = V(() => `
|
|
1043
|
+
.monaco-editor-${f.current} .margin {
|
|
1044
|
+
display: var(--line-number-display);
|
|
1045
|
+
left: var(--line-number-offset);
|
|
1046
|
+
pointer-events: none;
|
|
1047
|
+
}`, []), M = V(() => `.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 = V(
|
|
1051
|
+
() => ({
|
|
1052
|
+
...Nr,
|
|
1053
|
+
...u
|
|
1054
|
+
}),
|
|
1055
|
+
[u]
|
|
1056
|
+
), $ = V(() => /* @__PURE__ */ A.jsx(
|
|
1057
|
+
"style",
|
|
1058
|
+
{
|
|
1059
|
+
dangerouslySetInnerHTML: {
|
|
1060
|
+
__html: `${T} ${k} ${M}`
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
), [T, M, k]);
|
|
1064
|
+
return /* @__PURE__ */ A.jsxs("div", { className: l, ref: g, children: [
|
|
1065
|
+
$,
|
|
1066
|
+
/* @__PURE__ */ A.jsx(
|
|
1067
|
+
fe,
|
|
1068
|
+
{
|
|
1069
|
+
className: `monaco-editor-${f.current} overflow-hidden rounded-b-cn-3`,
|
|
1070
|
+
height: a,
|
|
1071
|
+
language: t,
|
|
1072
|
+
theme: j,
|
|
1073
|
+
options: C,
|
|
1074
|
+
onMount: L
|
|
1075
|
+
}
|
|
1076
|
+
)
|
|
1077
|
+
] });
|
|
1078
|
+
}
|
|
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 = y(null), u = y(!1), l = y(null);
|
|
1118
|
+
l.current = l.current ?? (r == null ? void 0 : r.createDecorationsCollection([])) ?? null, N(() => {
|
|
1119
|
+
let d;
|
|
1120
|
+
const g = setTimeout(() => {
|
|
1121
|
+
if (!t || !r)
|
|
1122
|
+
return;
|
|
1123
|
+
const f = (b) => {
|
|
1124
|
+
var h, I, D, L;
|
|
1125
|
+
if ((I = (h = b.target) == null ? void 0 : h.element) != null && I.classList.contains("CodeEditor_HighlightedGlyphMargin")) {
|
|
1126
|
+
i == null || i((D = b.target) == null ? void 0 : D.element);
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
const x = _r((L = b.target) == null ? void 0 : L.element);
|
|
1130
|
+
if (!x) {
|
|
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 = x, n == null || n(x), ye(r, l.current, x, !1), i == null || i(void 0);
|
|
1135
|
+
};
|
|
1136
|
+
d = r.onMouseDown(f);
|
|
1137
|
+
}, 100);
|
|
1138
|
+
return () => {
|
|
1139
|
+
clearTimeout(g), 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 kr = `.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 Vr = {
|
|
1196
|
+
...ae
|
|
1197
|
+
};
|
|
1198
|
+
function nn({
|
|
934
1199
|
codeRevision: e,
|
|
935
1200
|
onCodeRevisionChange: t,
|
|
936
1201
|
language: r,
|
|
937
1202
|
themeConfig: n,
|
|
938
1203
|
options: o,
|
|
939
1204
|
theme: i,
|
|
940
|
-
|
|
941
|
-
|
|
1205
|
+
enableLinesSelection: a = !1,
|
|
1206
|
+
selectedLine: u,
|
|
1207
|
+
onSelectedLineChange: l,
|
|
1208
|
+
onSelectedLineButtonClick: d,
|
|
1209
|
+
highlightKeyword: g,
|
|
1210
|
+
height: f = "75vh",
|
|
1211
|
+
className: b,
|
|
1212
|
+
onMount: x
|
|
942
1213
|
}) {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1214
|
+
const h = y(Ee(5));
|
|
1215
|
+
ie();
|
|
1216
|
+
const [I, D] = R(), L = y(), j = y({ code: "", revisionId: 0 }), T = y(null), k = J(
|
|
1217
|
+
(E, v) => {
|
|
1218
|
+
var s, w, m, p, O, c;
|
|
1219
|
+
T.current = E, L.current = v, E.setValue(e.code), D(E), (m = (w = (s = v.languages.typescript) == null ? void 0 : s.typescriptDefaults) == null ? void 0 : w.setDiagnosticsOptions) == null || m.call(w, {
|
|
948
1220
|
noSuggestionDiagnostics: !0,
|
|
949
1221
|
noSyntaxValidation: !0,
|
|
950
1222
|
noSemanticValidation: !0
|
|
951
|
-
}), (
|
|
1223
|
+
}), (c = (O = (p = v.languages.typescript) == null ? void 0 : p.javascriptDefaults) == null ? void 0 : O.setDiagnosticsOptions) == null || c.call(O, {
|
|
952
1224
|
noSuggestionDiagnostics: !0,
|
|
953
1225
|
noSyntaxValidation: !0,
|
|
954
1226
|
noSemanticValidation: !0
|
|
955
|
-
});
|
|
1227
|
+
}), x == null || x(E, v);
|
|
956
1228
|
},
|
|
957
|
-
[e.code]
|
|
1229
|
+
[e.code, x]
|
|
958
1230
|
);
|
|
959
|
-
|
|
960
|
-
var
|
|
961
|
-
if (
|
|
962
|
-
const
|
|
963
|
-
|
|
1231
|
+
N(() => {
|
|
1232
|
+
var E, v;
|
|
1233
|
+
if (T.current && (!e.revisionId || e.revisionId > Number((E = j.current) == null ? void 0 : E.revisionId))) {
|
|
1234
|
+
const s = T.current.getModel();
|
|
1235
|
+
s && (o != null && o.readOnly ? (v = T.current) == null || v.setValue(e.code) : (T.current.pushUndoStop(), T.current.executeEdits("edit", [
|
|
964
1236
|
{
|
|
965
|
-
range:
|
|
1237
|
+
range: s.getFullModelRange(),
|
|
966
1238
|
text: e.code
|
|
967
1239
|
}
|
|
968
|
-
]),
|
|
969
|
-
}
|
|
970
|
-
}, [e, m.current]);
|
|
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,
|
|
974
|
-
{
|
|
975
|
-
className: u,
|
|
976
|
-
height: a,
|
|
977
|
-
onChange: ($, w) => {
|
|
978
|
-
s.current = { code: $ ?? "", revisionId: w.versionId }, t({ ...s.current }, w);
|
|
979
|
-
},
|
|
980
|
-
language: r,
|
|
981
|
-
theme: h,
|
|
982
|
-
options: A,
|
|
983
|
-
onMount: C
|
|
1240
|
+
]), T.current.pushUndoStop()));
|
|
984
1241
|
}
|
|
985
|
-
|
|
1242
|
+
}, [e, o == null ? void 0 : o.readOnly, T]);
|
|
1243
|
+
const { theme: M } = ce({ monacoRef: L, themeConfig: n, editor: I, theme: i });
|
|
1244
|
+
Dr({
|
|
1245
|
+
enable: a,
|
|
1246
|
+
editor: I,
|
|
1247
|
+
selectedLine: u,
|
|
1248
|
+
onSelectedLineChange: l,
|
|
1249
|
+
onSelectedLineButtonClick: d
|
|
1250
|
+
}), Tr({ editor: I, keyword: g });
|
|
1251
|
+
const C = V(() => ({
|
|
1252
|
+
...Vr,
|
|
1253
|
+
...o || {}
|
|
1254
|
+
// TODO: this will be used in the future
|
|
1255
|
+
// ...(enableLinesSelection ? { glyphMargin: true } : {})
|
|
1256
|
+
}), [o]), $ = V(() => `.monaco-editor-${h.current} .margin-view-overlays .line-numbers { cursor: pointer !important; } ${kr}`, []);
|
|
1257
|
+
return /* @__PURE__ */ A.jsxs(A.Fragment, { children: [
|
|
1258
|
+
a && /* @__PURE__ */ A.jsx("style", { dangerouslySetInnerHTML: { __html: $ } }),
|
|
1259
|
+
/* @__PURE__ */ A.jsx(
|
|
1260
|
+
fe,
|
|
1261
|
+
{
|
|
1262
|
+
className: `monaco-editor-${h.current} ${b}`,
|
|
1263
|
+
height: f,
|
|
1264
|
+
onChange: (E, v) => {
|
|
1265
|
+
j.current = { code: E ?? "", revisionId: v.versionId }, t == null || t({ ...j.current }, v);
|
|
1266
|
+
},
|
|
1267
|
+
language: r,
|
|
1268
|
+
theme: M,
|
|
1269
|
+
options: C,
|
|
1270
|
+
onMount: k
|
|
1271
|
+
}
|
|
1272
|
+
)
|
|
1273
|
+
] });
|
|
986
1274
|
}
|
|
987
|
-
|
|
988
|
-
const
|
|
989
|
-
...
|
|
1275
|
+
q.config({ monaco: F });
|
|
1276
|
+
const Ar = {
|
|
1277
|
+
...ae,
|
|
990
1278
|
codeLens: !1,
|
|
991
1279
|
smartSelect: {
|
|
992
1280
|
selectLeadingAndTrailingWhitespace: !0
|
|
@@ -994,7 +1282,7 @@ const Cr = {
|
|
|
994
1282
|
originalEditable: !1,
|
|
995
1283
|
overviewRulerBorder: !1
|
|
996
1284
|
};
|
|
997
|
-
function
|
|
1285
|
+
function on({
|
|
998
1286
|
original: e,
|
|
999
1287
|
modified: t,
|
|
1000
1288
|
language: r,
|
|
@@ -1003,55 +1291,55 @@ function Wr({
|
|
|
1003
1291
|
theme: i,
|
|
1004
1292
|
height: a = "75vh"
|
|
1005
1293
|
}) {
|
|
1006
|
-
|
|
1007
|
-
const [u,
|
|
1008
|
-
return /* @__PURE__ */
|
|
1009
|
-
|
|
1294
|
+
ie();
|
|
1295
|
+
const [u, l] = R(), d = y(), { theme: g } = ce({ monacoRef: d, themeConfig: n, editor: u, theme: i }), f = V(() => ({ ...Ar, ...o || {} }), [o]);
|
|
1296
|
+
return /* @__PURE__ */ A.jsx(A.Fragment, { children: /* @__PURE__ */ A.jsx(
|
|
1297
|
+
gr,
|
|
1010
1298
|
{
|
|
1011
|
-
className: "overflow-hidden rounded-b-
|
|
1299
|
+
className: "overflow-hidden rounded-b-cn-3 border-x border-b",
|
|
1012
1300
|
language: r,
|
|
1013
|
-
theme:
|
|
1301
|
+
theme: g,
|
|
1014
1302
|
original: e,
|
|
1015
1303
|
modified: t,
|
|
1016
1304
|
height: a,
|
|
1017
|
-
options:
|
|
1018
|
-
onMount:
|
|
1305
|
+
options: f,
|
|
1306
|
+
onMount: l
|
|
1019
1307
|
}
|
|
1020
1308
|
) });
|
|
1021
1309
|
}
|
|
1022
|
-
var
|
|
1023
|
-
function
|
|
1310
|
+
var Ye = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Ye || {});
|
|
1311
|
+
function Hr(e) {
|
|
1024
1312
|
const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), i = [];
|
|
1025
1313
|
return r == null || r.forEach((a) => {
|
|
1026
1314
|
const u = a.actions;
|
|
1027
|
-
a.selectors.forEach((
|
|
1028
|
-
switch (
|
|
1029
|
-
case
|
|
1030
|
-
|
|
1031
|
-
let
|
|
1315
|
+
a.selectors.forEach((d) => {
|
|
1316
|
+
switch (d.type) {
|
|
1317
|
+
case Ye.ContainsPath: {
|
|
1318
|
+
d.paths.forEach((g) => {
|
|
1319
|
+
let b = Object.keys(o).map((h) => ({
|
|
1032
1320
|
fullPath: h,
|
|
1033
1321
|
path: h,
|
|
1034
1322
|
symbol: o[h]
|
|
1035
|
-
})).filter((h) => h.path.startsWith(
|
|
1036
|
-
|
|
1323
|
+
})).filter((h) => h.path.startsWith(d.basePath));
|
|
1324
|
+
b = b.map((h) => ({
|
|
1037
1325
|
...h,
|
|
1038
|
-
path: h.path.substring(
|
|
1039
|
-
})),
|
|
1040
|
-
const
|
|
1041
|
-
u.forEach((
|
|
1042
|
-
const
|
|
1043
|
-
range:
|
|
1044
|
-
symbols: [
|
|
1045
|
-
onClick:
|
|
1046
|
-
data:
|
|
1047
|
-
path:
|
|
1326
|
+
path: h.path.substring(d.basePath.length)
|
|
1327
|
+
})), b.filter((h) => g.test(h.path)).forEach((h) => {
|
|
1328
|
+
const I = h.fullPath, D = h.symbol, L = D.range;
|
|
1329
|
+
u.forEach((j) => {
|
|
1330
|
+
const T = {
|
|
1331
|
+
range: L,
|
|
1332
|
+
symbols: [D],
|
|
1333
|
+
onClick: j.onClick,
|
|
1334
|
+
data: j.data,
|
|
1335
|
+
path: I
|
|
1048
1336
|
};
|
|
1049
1337
|
i.push({
|
|
1050
|
-
range:
|
|
1338
|
+
range: L,
|
|
1051
1339
|
command: {
|
|
1052
1340
|
id: n,
|
|
1053
|
-
title:
|
|
1054
|
-
arguments: [
|
|
1341
|
+
title: j.title,
|
|
1342
|
+
arguments: [T]
|
|
1055
1343
|
}
|
|
1056
1344
|
});
|
|
1057
1345
|
});
|
|
@@ -1071,40 +1359,40 @@ const te = class te {
|
|
|
1071
1359
|
return te.data;
|
|
1072
1360
|
}
|
|
1073
1361
|
};
|
|
1074
|
-
|
|
1075
|
-
let
|
|
1076
|
-
async function
|
|
1077
|
-
const t =
|
|
1362
|
+
Pe(te, "data", {});
|
|
1363
|
+
let we = te;
|
|
1364
|
+
async function Ge(e) {
|
|
1365
|
+
const t = we.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
|
|
1078
1366
|
return await t.OutlineModel.create(r, e);
|
|
1079
1367
|
}
|
|
1080
|
-
function
|
|
1368
|
+
function Ze(e) {
|
|
1081
1369
|
const t = /* @__PURE__ */ new Map();
|
|
1082
|
-
return
|
|
1370
|
+
return xe({
|
|
1083
1371
|
pathSymbolMap: t,
|
|
1084
1372
|
parentPath: "",
|
|
1085
1373
|
children: e.children,
|
|
1086
|
-
parentKind:
|
|
1374
|
+
parentKind: be.SymbolKind.Module
|
|
1087
1375
|
}), t;
|
|
1088
1376
|
}
|
|
1089
|
-
function
|
|
1377
|
+
function xe(e) {
|
|
1090
1378
|
switch (e.parentKind) {
|
|
1091
|
-
case
|
|
1092
|
-
|
|
1379
|
+
case be.SymbolKind.Module: {
|
|
1380
|
+
Rr(e);
|
|
1093
1381
|
break;
|
|
1094
1382
|
}
|
|
1095
|
-
case
|
|
1096
|
-
|
|
1383
|
+
case be.SymbolKind.Array: {
|
|
1384
|
+
Ur(e);
|
|
1097
1385
|
break;
|
|
1098
1386
|
}
|
|
1099
1387
|
default:
|
|
1100
|
-
|
|
1388
|
+
zr(e);
|
|
1101
1389
|
}
|
|
1102
1390
|
}
|
|
1103
|
-
function
|
|
1391
|
+
function Rr(e) {
|
|
1104
1392
|
e.children.forEach((t) => {
|
|
1105
1393
|
var n;
|
|
1106
1394
|
let r = e.parentPath;
|
|
1107
|
-
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)),
|
|
1395
|
+
t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), xe({
|
|
1108
1396
|
pathSymbolMap: e.pathSymbolMap,
|
|
1109
1397
|
parentPath: r,
|
|
1110
1398
|
children: t.children,
|
|
@@ -1112,11 +1400,11 @@ function Ir(e) {
|
|
|
1112
1400
|
});
|
|
1113
1401
|
});
|
|
1114
1402
|
}
|
|
1115
|
-
function
|
|
1403
|
+
function Ur(e) {
|
|
1116
1404
|
let t = 0;
|
|
1117
1405
|
e.children.forEach((r) => {
|
|
1118
1406
|
const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
|
|
1119
|
-
e.pathSymbolMap.set(n, r.symbol), t += 1,
|
|
1407
|
+
e.pathSymbolMap.set(n, r.symbol), t += 1, xe({
|
|
1120
1408
|
pathSymbolMap: e.pathSymbolMap,
|
|
1121
1409
|
parentPath: n,
|
|
1122
1410
|
children: r.children,
|
|
@@ -1124,44 +1412,47 @@ function Lr(e) {
|
|
|
1124
1412
|
});
|
|
1125
1413
|
});
|
|
1126
1414
|
}
|
|
1127
|
-
function
|
|
1415
|
+
function zr(e) {
|
|
1128
1416
|
const t = e.children.get("0");
|
|
1129
1417
|
if (t) {
|
|
1130
1418
|
const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
|
|
1131
1419
|
e.pathSymbolMap.set(r, t.symbol);
|
|
1132
1420
|
}
|
|
1133
1421
|
}
|
|
1134
|
-
function
|
|
1422
|
+
function Fr({
|
|
1135
1423
|
editorRef: e,
|
|
1136
1424
|
inlineActions: t
|
|
1137
1425
|
}) {
|
|
1138
|
-
|
|
1426
|
+
N(() => F.languages.registerCodeLensProvider("yaml", {
|
|
1139
1427
|
provideCodeLenses: async (n) => {
|
|
1140
|
-
var d;
|
|
1141
|
-
|
|
1142
|
-
|
|
1428
|
+
var l, d, g, f, b;
|
|
1429
|
+
if (((l = n == null ? void 0 : n.uri) == null ? void 0 : l.toString()) !== ((f = (g = (d = e.current) == null ? void 0 : d.getModel()) == null ? void 0 : g.uri) == null ? void 0 : f.toString()))
|
|
1430
|
+
return { lenses: [], dispose: () => {
|
|
1431
|
+
} };
|
|
1432
|
+
const o = await Ge(n), i = Ze(o), a = (b = e == null ? void 0 : e.current) == null ? void 0 : b.addCommand(0, (x, { onClick: h, path: I, range: D, data: L }) => {
|
|
1433
|
+
h({ path: I, range: D, data: L });
|
|
1143
1434
|
});
|
|
1144
1435
|
return a ? {
|
|
1145
|
-
lenses:
|
|
1436
|
+
lenses: Hr({ pathSymbolMap: i, inlineActions: t, commandId: a }),
|
|
1146
1437
|
dispose: () => {
|
|
1147
1438
|
}
|
|
1148
1439
|
} : void 0;
|
|
1149
1440
|
}
|
|
1150
1441
|
}).dispose, [t, e]);
|
|
1151
1442
|
}
|
|
1152
|
-
const
|
|
1153
|
-
const [r, n] =
|
|
1443
|
+
const Wr = ({ editorRef: e, selection: t }) => {
|
|
1444
|
+
const [r, n] = R(), o = V(
|
|
1154
1445
|
() => async (i, a, u) => {
|
|
1155
|
-
var
|
|
1156
|
-
const
|
|
1157
|
-
if (!
|
|
1446
|
+
var b, x, h;
|
|
1447
|
+
const l = (b = e == null ? void 0 : e.current) == null ? void 0 : b.getModel();
|
|
1448
|
+
if (!l || !a)
|
|
1158
1449
|
return n(void 0);
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1450
|
+
const d = await Ge(l), f = (x = Ze(d).get(a)) == null ? void 0 : x.range;
|
|
1451
|
+
f && (n(f), u && ((h = e == null ? void 0 : e.current) == null || h.revealLineInCenter(f.startLineNumber)));
|
|
1161
1452
|
},
|
|
1162
1453
|
[]
|
|
1163
1454
|
);
|
|
1164
|
-
|
|
1455
|
+
N(() => {
|
|
1165
1456
|
if ("requestIdleCallback" in window) {
|
|
1166
1457
|
const i = requestIdleCallback(() => {
|
|
1167
1458
|
o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
|
|
@@ -1173,7 +1464,7 @@ const Nr = ({ editorRef: e, selection: t }) => {
|
|
|
1173
1464
|
}, 100);
|
|
1174
1465
|
return () => clearTimeout(i);
|
|
1175
1466
|
}
|
|
1176
|
-
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]),
|
|
1467
|
+
}, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), N(() => {
|
|
1177
1468
|
var a;
|
|
1178
1469
|
if (!r)
|
|
1179
1470
|
return;
|
|
@@ -1189,7 +1480,7 @@ const Nr = ({ editorRef: e, selection: t }) => {
|
|
|
1189
1480
|
]);
|
|
1190
1481
|
return () => i == null ? void 0 : i.clear();
|
|
1191
1482
|
}, [r, e, t == null ? void 0 : t.className]);
|
|
1192
|
-
},
|
|
1483
|
+
}, Je = nt({
|
|
1193
1484
|
markers: [],
|
|
1194
1485
|
setMarkers: () => {
|
|
1195
1486
|
},
|
|
@@ -1199,17 +1490,17 @@ const Nr = ({ editorRef: e, selection: t }) => {
|
|
|
1199
1490
|
updateCursorPosition: (e) => {
|
|
1200
1491
|
}
|
|
1201
1492
|
});
|
|
1202
|
-
function
|
|
1493
|
+
function an({
|
|
1203
1494
|
children: e
|
|
1204
1495
|
}) {
|
|
1205
|
-
const [t, r] =
|
|
1496
|
+
const [t, r] = R([]), [n, o] = R(null), i = J(
|
|
1206
1497
|
(a) => {
|
|
1207
1498
|
n == null || n.setPosition(a), n == null || n.revealLineInCenterIfOutsideViewport(a.lineNumber), n == null || n.focus();
|
|
1208
1499
|
},
|
|
1209
1500
|
[n]
|
|
1210
1501
|
);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1212
|
-
|
|
1502
|
+
return /* @__PURE__ */ A.jsx(
|
|
1503
|
+
Je.Provider,
|
|
1213
1504
|
{
|
|
1214
1505
|
value: {
|
|
1215
1506
|
markers: t,
|
|
@@ -1222,25 +1513,25 @@ function Kr({
|
|
|
1222
1513
|
}
|
|
1223
1514
|
);
|
|
1224
1515
|
}
|
|
1225
|
-
function
|
|
1226
|
-
return
|
|
1516
|
+
function Qe() {
|
|
1517
|
+
return ot(Je);
|
|
1227
1518
|
}
|
|
1228
|
-
const
|
|
1229
|
-
const { setMarkers: n } =
|
|
1230
|
-
|
|
1519
|
+
const qr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
|
|
1520
|
+
const { setMarkers: n } = Qe();
|
|
1521
|
+
N(() => {
|
|
1231
1522
|
let o;
|
|
1232
1523
|
const i = setTimeout(() => {
|
|
1233
1524
|
var u;
|
|
1234
1525
|
const a = (u = e.current) == null ? void 0 : u.editor;
|
|
1235
|
-
a && (o = a.onDidChangeMarkers((
|
|
1236
|
-
var
|
|
1237
|
-
const
|
|
1238
|
-
if (!
|
|
1526
|
+
a && (o = a.onDidChangeMarkers((l) => {
|
|
1527
|
+
var f;
|
|
1528
|
+
const d = (f = t.current) == null ? void 0 : f.getModel();
|
|
1529
|
+
if (!d)
|
|
1239
1530
|
return;
|
|
1240
|
-
const
|
|
1241
|
-
if (
|
|
1242
|
-
const
|
|
1243
|
-
n(
|
|
1531
|
+
const g = d.uri.toString();
|
|
1532
|
+
if (l.some((b) => b.toString() === g)) {
|
|
1533
|
+
const b = F.editor.getModelMarkers({ resource: d.uri });
|
|
1534
|
+
n(b);
|
|
1244
1535
|
}
|
|
1245
1536
|
}));
|
|
1246
1537
|
}, 100);
|
|
@@ -1249,17 +1540,17 @@ const kr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
|
|
|
1249
1540
|
};
|
|
1250
1541
|
}, [e, r, n]);
|
|
1251
1542
|
};
|
|
1252
|
-
function
|
|
1543
|
+
function Br(e) {
|
|
1253
1544
|
var n, o;
|
|
1254
|
-
const t = ((o = (n =
|
|
1255
|
-
r !== -1 ? t[r] = e : t.push(e),
|
|
1545
|
+
const t = ((o = (n = Me) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? [], r = t.findIndex((i) => i.fileMatch[0] === e.fileMatch[0]);
|
|
1546
|
+
r !== -1 ? t[r] = e : t.push(e), Xe(t);
|
|
1256
1547
|
}
|
|
1257
|
-
function
|
|
1548
|
+
function Kr(e) {
|
|
1258
1549
|
var n, o;
|
|
1259
|
-
const r = (((o = (n =
|
|
1260
|
-
|
|
1550
|
+
const r = (((o = (n = Me) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== je(e));
|
|
1551
|
+
Xe(r);
|
|
1261
1552
|
}
|
|
1262
|
-
function
|
|
1553
|
+
function Xe(e) {
|
|
1263
1554
|
const t = {
|
|
1264
1555
|
hover: !0,
|
|
1265
1556
|
completion: !0,
|
|
@@ -1267,25 +1558,25 @@ function Ke(e) {
|
|
|
1267
1558
|
validate: !0,
|
|
1268
1559
|
schemas: e
|
|
1269
1560
|
};
|
|
1270
|
-
|
|
1561
|
+
Me.setDiagnosticsOptions({ ...t });
|
|
1271
1562
|
}
|
|
1272
|
-
const
|
|
1563
|
+
const je = (e) => it.parse(`file://${e}`).toString(), Yr = (e) => {
|
|
1273
1564
|
const { schemaConfig: t, instanceId: r } = e;
|
|
1274
|
-
|
|
1565
|
+
N(() => {
|
|
1275
1566
|
if (t != null && t.schema)
|
|
1276
|
-
return
|
|
1277
|
-
fileMatch: [
|
|
1567
|
+
return Br({
|
|
1568
|
+
fileMatch: [je(r.toString())],
|
|
1278
1569
|
...t
|
|
1279
1570
|
}), () => {
|
|
1280
|
-
|
|
1571
|
+
Kr(r);
|
|
1281
1572
|
};
|
|
1282
1573
|
}, [t == null ? void 0 : t.schema, r]);
|
|
1283
1574
|
};
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1286
|
-
...
|
|
1575
|
+
q.config({ monaco: F });
|
|
1576
|
+
const Gr = {
|
|
1577
|
+
...ae,
|
|
1287
1578
|
folding: !0
|
|
1288
|
-
},
|
|
1579
|
+
}, cn = function(t) {
|
|
1289
1580
|
const {
|
|
1290
1581
|
yamlRevision: r,
|
|
1291
1582
|
schemaConfig: n,
|
|
@@ -1293,86 +1584,89 @@ const Ur = {
|
|
|
1293
1584
|
themeConfig: i,
|
|
1294
1585
|
onYamlRevisionChange: a,
|
|
1295
1586
|
selection: u,
|
|
1296
|
-
theme:
|
|
1297
|
-
options:
|
|
1298
|
-
animateOnUpdate:
|
|
1299
|
-
onAnimateEnd:
|
|
1300
|
-
instanceId:
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1587
|
+
theme: l,
|
|
1588
|
+
options: d,
|
|
1589
|
+
animateOnUpdate: g = !1,
|
|
1590
|
+
onAnimateEnd: f,
|
|
1591
|
+
instanceId: b,
|
|
1592
|
+
height: x
|
|
1593
|
+
} = t, h = ie(), [I] = R(b ?? `yaml-editor-${Math.random()}`), { editor: D, setEditor: L } = Qe(), j = y(null), T = y(), k = y({ yaml: "", revisionId: 0 }), M = y(null), C = y(null), $ = J(
|
|
1594
|
+
(m) => {
|
|
1595
|
+
var c, S, H;
|
|
1596
|
+
const p = m.split(`
|
|
1597
|
+
`), O = (c = M.current) == null ? void 0 : c.getModel();
|
|
1598
|
+
if (O) {
|
|
1599
|
+
(S = M.current) == null || S.pushUndoStop(), O.setValue("");
|
|
1600
|
+
let W = 0;
|
|
1601
|
+
C.current = window.setInterval(() => {
|
|
1602
|
+
var B;
|
|
1603
|
+
W < p.length ? (h && ((B = M.current) == null || B.executeEdits("addLine", [
|
|
1312
1604
|
{
|
|
1313
|
-
range: new
|
|
1314
|
-
text:
|
|
1605
|
+
range: new h.Range(W + 1, 1, W + 1, 1),
|
|
1606
|
+
text: p[W] + `
|
|
1315
1607
|
`
|
|
1316
1608
|
}
|
|
1317
|
-
])),
|
|
1318
|
-
}, 100), (
|
|
1609
|
+
])), W++) : C.current && (clearInterval(C.current), f == null || f());
|
|
1610
|
+
}, 100), (H = M.current) == null || H.pushUndoStop();
|
|
1319
1611
|
}
|
|
1320
1612
|
},
|
|
1321
|
-
[
|
|
1613
|
+
[h]
|
|
1322
1614
|
);
|
|
1323
|
-
|
|
1324
|
-
|
|
1615
|
+
N(() => () => {
|
|
1616
|
+
C.current && clearInterval(C.current);
|
|
1325
1617
|
}, []);
|
|
1326
|
-
function
|
|
1327
|
-
|
|
1328
|
-
var
|
|
1329
|
-
(
|
|
1618
|
+
function E(m, p) {
|
|
1619
|
+
M.current = m, T.current = p, m.setValue(r.yaml), L(m), setTimeout(() => {
|
|
1620
|
+
var O;
|
|
1621
|
+
(O = j.current) != null && O.style && (j.current.style.opacity = "1");
|
|
1330
1622
|
}, 50);
|
|
1331
1623
|
}
|
|
1332
|
-
|
|
1333
|
-
var
|
|
1334
|
-
if (
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1624
|
+
N(() => {
|
|
1625
|
+
var m;
|
|
1626
|
+
if (M.current && (!r.revisionId || r.revisionId > Number((m = k.current) == null ? void 0 : m.revisionId))) {
|
|
1627
|
+
const p = M.current.getModel();
|
|
1628
|
+
p && (M.current.executeEdits("edit", [
|
|
1337
1629
|
{
|
|
1338
|
-
range:
|
|
1339
|
-
text:
|
|
1630
|
+
range: p.getFullModelRange(),
|
|
1631
|
+
text: g ? "" : r.yaml
|
|
1340
1632
|
}
|
|
1341
|
-
]),
|
|
1633
|
+
]), g && $(r.yaml));
|
|
1342
1634
|
}
|
|
1343
|
-
}, [
|
|
1344
|
-
const { theme:
|
|
1345
|
-
|
|
1346
|
-
const
|
|
1635
|
+
}, [$, r, g]), Yr({ schemaConfig: n, instanceId: I }), Fr({ editorRef: M, inlineActions: o });
|
|
1636
|
+
const { theme: v } = ce({ monacoRef: T, themeConfig: i, editor: D, theme: l });
|
|
1637
|
+
qr({ monacoRef: T, editorRef: M, instanceId: I }), Wr({ editorRef: M, selection: u });
|
|
1638
|
+
const s = V(() => je(I), []), w = V(
|
|
1347
1639
|
() => ({
|
|
1348
|
-
...
|
|
1349
|
-
...
|
|
1640
|
+
...Gr,
|
|
1641
|
+
...d
|
|
1350
1642
|
}),
|
|
1351
|
-
[
|
|
1643
|
+
[d]
|
|
1352
1644
|
);
|
|
1353
|
-
return /* @__PURE__ */
|
|
1354
|
-
|
|
1645
|
+
return /* @__PURE__ */ A.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: j, children: /* @__PURE__ */ A.jsx(
|
|
1646
|
+
fe,
|
|
1355
1647
|
{
|
|
1356
|
-
onChange: (
|
|
1357
|
-
|
|
1648
|
+
onChange: (m, p) => {
|
|
1649
|
+
k.current = { yaml: m ?? "", revisionId: p.versionId }, a({ ...k.current }, p);
|
|
1358
1650
|
},
|
|
1359
1651
|
language: "yaml",
|
|
1360
|
-
theme:
|
|
1361
|
-
options:
|
|
1362
|
-
path:
|
|
1363
|
-
onMount:
|
|
1652
|
+
theme: v,
|
|
1653
|
+
options: w,
|
|
1654
|
+
path: s,
|
|
1655
|
+
onMount: E,
|
|
1656
|
+
height: x
|
|
1364
1657
|
}
|
|
1365
1658
|
) });
|
|
1366
1659
|
};
|
|
1367
1660
|
export {
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1661
|
+
tn as BlameEditor,
|
|
1662
|
+
rn as BlameEditorV2,
|
|
1663
|
+
on as CodeDiffEditor,
|
|
1664
|
+
nn as CodeEditor,
|
|
1665
|
+
we as MonacoGlobals,
|
|
1666
|
+
Ye as SelectorType,
|
|
1667
|
+
cn as YamlEditor,
|
|
1668
|
+
Je as YamlEditorContext,
|
|
1669
|
+
an as YamlEditorContextProvider,
|
|
1670
|
+
Qe as useYamlEditorContext
|
|
1377
1671
|
};
|
|
1378
1672
|
//# sourceMappingURL=index.js.map
|