@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/index.js CHANGED
@@ -1,23 +1,24 @@
1
- var Ze = Object.defineProperty;
2
- var Ge = (e, t, r) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var je = (e, t, r) => (Ge(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import K, { memo as ye, useState as U, useRef as g, useCallback as G, useEffect as L, useMemo as F, useLayoutEffect as Je, createContext as Qe, useContext as Xe } from "react";
5
- import * as z from "monaco-editor";
6
- import { languages as ge, Uri as et } from "monaco-editor";
7
- import { yamlDefaults as be } from "monaco-yaml";
8
- var De = { exports: {} }, ne = {};
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 Ee = Object.getOwnPropertySymbols, tt = Object.prototype.hasOwnProperty, rt = Object.prototype.propertyIsEnumerable;
15
- function nt(e) {
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 ot() {
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
- ot();
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 it = K, Ne = 60103;
52
+ var dt = Y, Ae = 60103;
52
53
  ne.Fragment = 60107;
53
54
  if (typeof Symbol == "function" && Symbol.for) {
54
- var Pe = Symbol.for;
55
- Ne = Pe("react.element"), ne.Fragment = Pe("react.fragment");
55
+ var $e = Symbol.for;
56
+ Ae = $e("react.element"), ne.Fragment = $e("react.fragment");
56
57
  }
57
- var at = it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, ct = Object.prototype.hasOwnProperty, ut = { key: !0, ref: !0, __self: !0, __source: !0 };
58
- function ke(e, t, r) {
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
- ct.call(t, n) && !ut.hasOwnProperty(n) && (o[n] = t[n]);
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: Ne, type: e, key: i, ref: a, props: o, _owner: at.current };
67
+ return { $$typeof: Ae, type: e, key: i, ref: a, props: o, _owner: ft.current };
67
68
  }
68
- ne.jsx = ke;
69
- ne.jsxs = ke;
70
- De.exports = ne;
71
- var R = De.exports;
72
- function st(e, t, r) {
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 xe(e, t) {
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 Ce(e) {
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 ? xe(Object(r), !0).forEach(function(n) {
94
- st(e, n, r[n]);
95
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
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 lt(e, t) {
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 dt(e, t) {
110
+ function vt(e, t) {
110
111
  if (e == null)
111
112
  return {};
112
- var r = lt(e, t), n, o;
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 ft(e, t) {
121
- return pt(e) || mt(e, t) || ht(e, t) || gt();
121
+ function yt(e, t) {
122
+ return bt(e) || wt(e, t) || Ot(e, t) || Mt();
122
123
  }
123
- function pt(e) {
124
+ function bt(e) {
124
125
  if (Array.isArray(e))
125
126
  return e;
126
127
  }
127
- function mt(e, t) {
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 (d) {
134
- o = !0, i = d;
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 ht(e, t) {
147
+ function Ot(e, t) {
147
148
  if (e) {
148
149
  if (typeof e == "string")
149
- return $e(e, t);
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 $e(e, t);
155
+ return Le(e, t);
155
156
  }
156
157
  }
157
- function $e(e, t) {
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 gt() {
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 vt(e, t, r) {
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 Ie(e, t) {
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 Le(e) {
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 ? Ie(Object(r), !0).forEach(function(n) {
189
- vt(e, n, r[n]);
190
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ie(Object(r)).forEach(function(n) {
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 yt() {
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), d = 0; d < a; d++)
211
- u[d] = arguments[d];
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 ce(e) {
217
+ function le(e) {
217
218
  return {}.toString.call(e).includes("Object");
218
219
  }
219
- function bt(e) {
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 wt(e, t) {
226
+ function jt(e, t) {
226
227
  return Object.prototype.hasOwnProperty.call(e, t);
227
228
  }
228
- function Ot(e, t) {
229
- return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
230
- return !wt(e, r);
231
- }) && B("changeField"), t;
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 Mt(e) {
234
- re(e) || B("selectorType");
234
+ function Ct(e) {
235
+ re(e) || K("selectorType");
235
236
  }
236
- function St(e) {
237
- re(e) || ce(e) || B("handlerType"), ce(e) && Object.values(e).some(function(t) {
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
- }) && B("handlersType");
240
+ }) && K("handlersType");
240
241
  }
241
- function jt(e) {
242
- e || B("initialIsRequired"), ce(e) || B("initialType"), bt(e) && B("initialContent");
242
+ function It(e) {
243
+ e || K("initialIsRequired"), le(e) || K("initialType"), xt(e) && K("initialContent");
243
244
  }
244
- function Et(e, t) {
245
+ function Nt(e, t) {
245
246
  throw new Error(e[t] || e.default);
246
247
  }
247
- var Pt = {
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
- }, B = X(Et)(Pt), ie = {
258
- changes: Ot,
259
- selector: Mt,
260
- handler: St,
261
- initial: jt
258
+ }, K = X(Nt)(Lt), se = {
259
+ changes: Pt,
260
+ selector: Ct,
261
+ handler: $t,
262
+ initial: It
262
263
  };
263
- function xt(e) {
264
+ function Tt(e) {
264
265
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
265
- ie.initial(e), ie.handler(t);
266
+ se.initial(e), se.handler(t);
266
267
  var r = {
267
268
  current: e
268
- }, n = X(It)(r, t), o = X($t)(r), i = X(ie.changes)(e), a = X(Ct)(r);
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 f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(v) {
271
- return v;
271
+ var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(g) {
272
+ return g;
272
273
  };
273
- return ie.selector(f), f(r.current);
274
+ return se.selector(d), d(r.current);
274
275
  }
275
- function d(f) {
276
- yt(n, o, i, a)(f);
276
+ function l(d) {
277
+ Et(n, o, i, a)(d);
277
278
  }
278
- return [u, d];
279
+ return [u, l];
279
280
  }
280
- function Ct(e, t) {
281
+ function Dt(e, t) {
281
282
  return re(t) ? t(e.current) : t;
282
283
  }
283
- function $t(e, t) {
284
- return e.current = Le(Le({}, e.current), t), t;
284
+ function _t(e, t) {
285
+ return e.current = De(De({}, e.current), t), t;
285
286
  }
286
- function It(e, t, r) {
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 Lt = {
293
- create: xt
294
- }, Tt = {
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 Dt(e) {
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), d = 0; d < a; d++)
305
- u[d] = arguments[d];
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 Nt(e) {
311
+ function Rt(e) {
311
312
  return {}.toString.call(e).includes("Object");
312
313
  }
313
- function kt(e) {
314
- return e || Te("configIsRequired"), Nt(e) || Te("configType"), e.urls ? (At(), {
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 At() {
321
- console.warn(Ae.deprecation);
321
+ function zt() {
322
+ console.warn(Re.deprecation);
322
323
  }
323
- function Vt(e, t) {
324
+ function Ft(e, t) {
324
325
  throw new Error(e[t] || e.default);
325
326
  }
326
- var Ae = {
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
- }, Te = Dt(Vt)(Ae), _t = {
341
- config: kt
342
- }, Ut = function() {
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 Ve(e, t) {
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], Ve(e[r], t[r]));
354
- }), Ce(Ce({}, e), t);
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 Rt = {
357
+ var Bt = {
357
358
  type: "cancelation",
358
359
  msg: "operation is manually canceled"
359
360
  };
360
- function fe(e) {
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(Rt) : n(i);
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 Ft = Lt.create({
371
- config: Tt,
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
- }), _e = ft(Ft, 2), oe = _e[0], ue = _e[1];
377
- function zt(e) {
378
- var t = _t.config(e), r = t.monaco, n = dt(t, ["monaco"]);
379
- ue(function(o) {
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: Ve(o.config, n),
382
+ config: Ue(o.config, n),
382
383
  monaco: r
383
384
  };
384
385
  });
385
386
  }
386
- function Ht() {
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 (ue({
397
+ if (de({
397
398
  isInitialized: !0
398
399
  }), e.monaco)
399
- return e.resolve(e.monaco), fe(pe);
400
+ return e.resolve(e.monaco), pe(me);
400
401
  if (window.monaco && window.monaco.editor)
401
- return Ue(window.monaco), e.resolve(window.monaco), fe(pe);
402
- Ut(qt, Wt)(Kt);
402
+ return Fe(window.monaco), e.resolve(window.monaco), pe(me);
403
+ qt(Zt, Qt)(Xt);
403
404
  }
404
- return fe(pe);
405
+ return pe(me);
405
406
  }
406
- function qt(e) {
407
+ function Zt(e) {
407
408
  return document.body.appendChild(e);
408
409
  }
409
- function Bt(e) {
410
+ function Jt(e) {
410
411
  var t = document.createElement("script");
411
412
  return e && (t.src = e), t;
412
413
  }
413
- function Wt(e) {
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 = Bt("".concat(t.config.paths.vs, "/loader.js"));
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 Kt() {
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
- Ue(r), e.resolve(r);
436
+ Fe(r), e.resolve(r);
436
437
  }, function(r) {
437
438
  e.reject(r);
438
439
  });
439
440
  }
440
- function Ue(e) {
441
- oe().monaco || ue({
441
+ function Fe(e) {
442
+ oe().monaco || de({
442
443
  monaco: e
443
444
  });
444
445
  }
445
- function Yt() {
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 pe = new Promise(function(e, t) {
452
- return ue({
452
+ var me = new Promise(function(e, t) {
453
+ return de({
453
454
  resolve: e,
454
455
  reject: t
455
456
  });
456
- }), W = {
457
- config: zt,
458
- init: Ht,
459
- __getMonacoInstance: Yt
460
- }, Zt = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, me = Zt, Gt = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Jt = Gt;
461
- function Qt({ children: e }) {
462
- return K.createElement("div", { style: Jt.container }, e);
463
- }
464
- var Xt = Qt, er = Xt;
465
- function tr({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: a }) {
466
- return K.createElement("section", { style: { ...me.wrapper, width: e, height: t }, ...a }, !r && K.createElement(er, null, n), K.createElement("div", { ref: o, style: { ...me.fullWidth, ...!r && me.hide }, className: i }));
467
- }
468
- var rr = tr, Re = ye(rr);
469
- function nr(e) {
470
- L(e, []);
471
- }
472
- var we = nr;
473
- function or(e, t, r = !0) {
474
- let n = g(!0);
475
- L(n.current || !r ? () => {
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 _ = or;
480
+ var z = lr;
480
481
  function ee() {
481
482
  }
482
483
  function Z(e, t, r, n) {
483
- return ir(e, n) || ar(e, t, r, n);
484
+ return dr(e, n) || fr(e, t, r, n);
484
485
  }
485
- function ir(e, t) {
486
- return e.editor.getModel(Fe(e, t));
486
+ function dr(e, t) {
487
+ return e.editor.getModel(qe(e, t));
487
488
  }
488
- function ar(e, t, r, n) {
489
- return e.editor.createModel(t, r, n ? Fe(e, n) : void 0);
489
+ function fr(e, t, r, n) {
490
+ return e.editor.createModel(t, r, n ? qe(e, n) : void 0);
490
491
  }
491
- function Fe(e, t) {
492
+ function qe(e, t) {
492
493
  return e.Uri.parse(t);
493
494
  }
494
- function cr({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: a, keepCurrentOriginalModel: u = !1, keepCurrentModifiedModel: d = !1, theme: f = "light", loading: v = "Loading...", options: s = {}, height: m = "100%", width: C = "100%", className: h, wrapperProps: A = {}, beforeMount: $ = ee, onMount: w = ee }) {
495
- let [y, D] = U(!1), [P, O] = U(!0), S = g(null), j = g(null), H = g(null), T = g(w), l = g($), E = g(!1);
496
- we(() => {
497
- let c = W.init();
498
- return c.then((p) => (j.current = p) && O(!1)).catch((p) => (p == null ? void 0 : p.type) !== "cancelation" && console.error("Monaco initialization: error:", p)), () => S.current ? N() : c.cancel();
499
- }), _(() => {
500
- if (S.current && j.current) {
501
- let c = S.current.getOriginalEditor(), p = Z(j.current, e || "", n || r || "text", i || "");
502
- p !== c.getModel() && c.setModel(p);
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], y), _(() => {
505
- if (S.current && j.current) {
506
- let c = S.current.getModifiedEditor(), p = Z(j.current, t || "", o || r || "text", a || "");
507
- p !== c.getModel() && c.setModel(p);
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], y), _(() => {
510
- let c = S.current.getModifiedEditor();
511
- c.getOption(j.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
512
- }, [t], y), _(() => {
513
- var c, p;
514
- (p = (c = S.current) == null ? void 0 : c.getModel()) == null || p.original.setValue(e || "");
515
- }, [e], y), _(() => {
516
- let { original: c, modified: p } = S.current.getModel();
517
- j.current.editor.setModelLanguage(c, n || r || "text"), j.current.editor.setModelLanguage(p, o || r || "text");
518
- }, [r, n, o], y), _(() => {
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 = j.current) == null || c.editor.setTheme(f);
521
- }, [f], y), _(() => {
521
+ (c = $.current) == null || c.editor.setTheme(d);
522
+ }, [d], j), z(() => {
522
523
  var c;
523
- (c = S.current) == null || c.updateOptions(s);
524
- }, [s], y);
525
- let x = G(() => {
526
- var k;
527
- if (!j.current)
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
- l.current(j.current);
530
- let c = Z(j.current, e || "", n || r || "text", i || ""), p = Z(j.current, t || "", o || r || "text", a || "");
531
- (k = S.current) == null || k.setModel({ original: c, modified: p });
532
- }, [r, t, o, e, n, i, a]), M = G(() => {
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
- !E.current && H.current && (S.current = j.current.editor.createDiffEditor(H.current, { automaticLayout: !0, ...s }), x(), (c = j.current) == null || c.editor.setTheme(f), D(!0), E.current = !0);
535
- }, [s, f, x]);
536
- L(() => {
537
- y && T.current(S.current, j.current);
538
- }, [y]), L(() => {
539
- !P && !y && M();
540
- }, [P, y, M]);
541
- function N() {
542
- var p, k, q, J;
543
- let c = (p = S.current) == null ? void 0 : p.getModel();
544
- u || ((k = c == null ? void 0 : c.original) == null || k.dispose()), d || ((q = c == null ? void 0 : c.modified) == null || q.dispose()), (J = S.current) == null || J.dispose();
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 K.createElement(Re, { width: C, height: m, isEditorReady: y, loading: v, _ref: H, className: h, wrapperProps: A });
547
+ return Y.createElement(We, { width: x, height: b, isEditorReady: j, loading: g, _ref: E, className: h, wrapperProps: I });
547
548
  }
548
- var ur = cr, sr = ye(ur);
549
- function lr() {
550
- let [e, t] = U(W.__getMonacoInstance());
551
- return we(() => {
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 = W.init(), r.then((n) => {
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 se = lr;
559
- function dr(e) {
560
- let t = g();
561
- return L(() => {
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 fr = dr, ae = /* @__PURE__ */ new Map();
566
- function pr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: a = "light", line: u, loading: d = "Loading...", options: f = {}, overrideServices: v = {}, saveViewState: s = !0, keepCurrentModel: m = !1, width: C = "100%", height: h = "100%", className: A, wrapperProps: $ = {}, beforeMount: w = ee, onMount: y = ee, onChange: D, onValidate: P = ee }) {
567
- let [O, S] = U(!1), [j, H] = U(!0), T = g(null), l = g(null), E = g(null), x = g(y), M = g(w), N = g(), c = g(n), p = fr(i), k = g(!1), q = g(!1);
568
- we(() => {
569
- let b = W.init();
570
- return b.then((I) => (T.current = I) && H(!1)).catch((I) => (I == null ? void 0 : I.type) !== "cancelation" && console.error("Monaco initialization: error:", I)), () => l.current ? Ye() : b.cancel();
571
- }), _(() => {
572
- var I, V, Q, Y;
573
- let b = Z(T.current, e || n || "", t || o || "", i || r || "");
574
- b !== ((I = l.current) == null ? void 0 : I.getModel()) && (s && ae.set(p, (V = l.current) == null ? void 0 : V.saveViewState()), (Q = l.current) == null || Q.setModel(b), s && ((Y = l.current) == null || Y.restoreViewState(ae.get(i))));
575
- }, [i], O), _(() => {
576
- var b;
577
- (b = l.current) == null || b.updateOptions(f);
578
- }, [f], O), _(() => {
579
- !l.current || n === void 0 || (l.current.getOption(T.current.editor.EditorOption.readOnly) ? l.current.setValue(n) : n !== l.current.getValue() && (q.current = !0, l.current.executeEdits("", [{ range: l.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), l.current.pushUndoStop(), q.current = !1));
580
- }, [n], O), _(() => {
581
- var I, V;
582
- let b = (I = l.current) == null ? void 0 : I.getModel();
583
- b && o && ((V = T.current) == null || V.editor.setModelLanguage(b, o));
584
- }, [o], O), _(() => {
585
- var b;
586
- u !== void 0 && ((b = l.current) == null || b.revealLine(u));
587
- }, [u], O), _(() => {
588
- var b;
589
- (b = T.current) == null || b.editor.setTheme(a);
590
- }, [a], O);
591
- let J = G(() => {
592
- var b;
593
- if (!(!E.current || !T.current) && !k.current) {
594
- M.current(T.current);
595
- let I = i || r, V = Z(T.current, n || e || "", t || o || "", I || "");
596
- l.current = (b = T.current) == null ? void 0 : b.editor.create(E.current, { model: V, automaticLayout: !0, ...f }, v), s && l.current.restoreViewState(ae.get(I)), T.current.editor.setTheme(a), u !== void 0 && l.current.revealLine(u), S(!0), k.current = !0;
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, f, v, s, a, u]);
599
- L(() => {
600
- O && x.current(l.current, T.current);
601
- }, [O]), L(() => {
602
- !j && !O && J();
603
- }, [j, O, J]), c.current = n, L(() => {
604
- var b, I;
605
- O && D && ((b = N.current) == null || b.dispose(), N.current = (I = l.current) == null ? void 0 : I.onDidChangeModelContent((V) => {
606
- q.current || D(l.current.getValue(), V);
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
- }, [O, D]), L(() => {
609
- if (O) {
610
- let b = T.current.editor.onDidChangeMarkers((I) => {
609
+ }, [M, T]), N(() => {
610
+ if (M) {
611
+ let P = v.current.editor.onDidChangeMarkers((_) => {
611
612
  var Q;
612
- let V = (Q = l.current.getModel()) == null ? void 0 : Q.uri;
613
- if (V && I.find((Y) => Y.path === V.path)) {
614
- let Y = T.current.editor.getModelMarkers({ resource: V });
615
- P == null || P(Y);
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
- b == null || b.dispose();
620
+ P == null || P.dispose();
620
621
  };
621
622
  }
622
623
  return () => {
623
624
  };
624
- }, [O, P]);
625
- function Ye() {
626
- var b, I;
627
- (b = N.current) == null || b.dispose(), m ? s && ae.set(i, l.current.saveViewState()) : (I = l.current.getModel()) == null || I.dispose(), l.current.dispose();
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 K.createElement(Re, { width: C, height: h, isEditorReady: O, loading: d, _ref: E, className: A, wrapperProps: $ });
630
+ return Y.createElement(We, { width: x, height: h, isEditorReady: M, loading: l, _ref: w, className: I, wrapperProps: D });
630
631
  }
631
- var mr = pr, hr = ye(mr), Oe = hr;
632
- const le = {
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
- }, de = (e) => {
654
- const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = U(n ?? o ?? "vs-dark");
655
- return L(() => {
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((d) => {
658
- z.editor.defineTheme(d.themeName, d.themeData);
658
+ (u = t == null ? void 0 : t.monacoThemes) == null || u.forEach((l) => {
659
+ F.editor.defineTheme(l.themeName, l.themeData);
659
660
  });
660
- }, [z]), L(() => {
661
- z.editor && n && (z.editor.setTheme(n), a(n));
661
+ }, [F]), N(() => {
662
+ F.editor && n && (F.editor.setTheme(n), a(n));
662
663
  }, [r, n]), { theme: i };
663
664
  };
664
- function gr(e) {
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 vr(e) {
672
+ function Mr(e) {
672
673
  return e.replace("'", "&#39;");
673
674
  }
674
- const yr = (e) => {
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
- }, br = (e) => {
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 yr(o);
695
+ return Sr(o);
695
696
  };
696
- function wr({
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 Or({
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 f, v, s, m, C, h, A, $;
738
- const a = (v = (f = i == null ? void 0 : i.commitInfo) == null ? void 0 : f.author) == null ? void 0 : v.avatarUrl, u = (m = (s = i == null ? void 0 : i.commitInfo) == null ? void 0 : s.author) == null ? void 0 : m.initials, d = a ? `background: url('${(h = (C = i == null ? void 0 : i.commitInfo) == null ? void 0 : C.author) == null ? void 0 : h.avatarUrl}');` : "";
739
- for (let w = i.fromLineNumber; w <= i.toLineNumber; w++)
740
- w === i.fromLineNumber ? o += `
741
- .monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
742
- content: '${vr(br((($ = (A = i == null ? void 0 : i.commitInfo) == null ? void 0 : A.author) == null ? void 0 : $.when) || ""))}';
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-${w}:after {
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: -4px;
759
- color: var(--cn-text-3);
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
- ${d}
767
+ ${l}
763
768
  background-size: 100% 100%;
764
769
  }` : o += `
765
- .monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
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 Mr(e, t) {
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
- W.config({ monaco: z });
778
- const he = 450, Sr = 30, jr = 140, Er = 24, Pr = {
779
- ...le,
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 qr({
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: d,
799
- className: f
803
+ options: l,
804
+ className: d
800
805
  }) {
801
- const v = g(o), s = g(null), m = g(gr(5));
802
- se();
803
- const [C, h] = U(), A = g(null), $ = g(null);
804
- L(() => {
805
- v.current = o;
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 w() {
808
- const l = $.current, E = A.current;
809
- if (!l || !E)
812
+ function L() {
813
+ const s = D.current, w = I.current;
814
+ if (!s || !w)
810
815
  return;
811
- i && l.changeViewZones(function(M) {
812
- M.addZone({
816
+ i && s.changeViewZones(function(p) {
817
+ p.addZone({
813
818
  afterLineNumber: 0,
814
819
  heightInPx: 10,
815
820
  domNode: document.createElement("div")
816
- }), v.current.forEach((N, c) => {
817
- if (c !== v.current.length - 1) {
818
- const p = document.createElement("div");
819
- p.style.borderTop = "1px solid var(--cn-border-2)", p.style.marginTop = "9px", p.className = "blame-editor-separator", M.addZone({
820
- afterLineNumber: N.toLineNumber,
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: p
827
+ domNode: S
823
828
  });
824
829
  }
825
830
  });
826
831
  });
827
- const x = [];
828
- v.current.forEach((M) => {
829
- var N;
830
- for (let c = M.fromLineNumber; c <= M.toLineNumber; c++)
831
- x.push({
832
- range: new E.Range(c, 0, c + 1, 0),
832
+ 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: Mr(
836
- c === M.fromLineNumber && ((N = M == null ? void 0 : M.commitInfo) == null ? void 0 : N.title) || "",
837
- Sr
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: E.editor.InjectedTextCursorStops.None,
844
+ cursorStops: w.editor.InjectedTextCursorStops.None,
840
845
  inlineClassName: `blame-editor-commit blame-editor-commit-${c}`
841
846
  }
842
847
  }
843
848
  });
844
- }), l.createDecorationsCollection(x);
849
+ }), s.createDecorationsCollection(m);
845
850
  }
846
- function y(l, E) {
847
- var x, M, N, c, p, k;
848
- $.current = l, A.current = E, l.setValue(e), h(l), (N = (M = (x = E.languages.typescript) == null ? void 0 : x.typescriptDefaults) == null ? void 0 : M.setDiagnosticsOptions) == null || N.call(M, {
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
- }), (k = (p = (c = E.languages.typescript) == null ? void 0 : c.javascriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || k.call(p, {
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
- }), w();
861
+ }), L();
857
862
  }
858
- L(() => {
859
- C == null || C.setValue(e);
863
+ N(() => {
864
+ x == null || x.setValue(e);
860
865
  }, [e]);
861
- const { theme: D } = de({ monacoRef: A, themeConfig: r, editor: C, theme: a }), P = F(
862
- () => wr({
863
- instanceId: m.current,
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
- ), O = F(
868
- () => Or({
869
- instanceId: m.current,
872
+ ), M = V(
873
+ () => xr({
874
+ instanceId: b.current,
870
875
  blameData: o,
871
- avatarSize: Er,
872
- dateWidth: jr
876
+ avatarSize: Cr,
877
+ dateWidth: Pr
873
878
  }),
874
879
  [o]
875
880
  );
876
- Je(() => {
877
- s.current && s.current.style.setProperty("--line-number-display", "none");
878
- }, []), L(() => {
879
- if (n === "center" && s.current) {
880
- const l = s.current.getElementsByClassName("lines-content")[0];
881
- if (l) {
882
- const E = { attributes: !0 }, x = () => {
883
- const N = parseInt(getComputedStyle(l).left);
884
- s.current && (s.current.style.setProperty("--line-number-offset", `${he + 16 + N}px`), s.current.style.setProperty("--line-number-display", "block"));
885
- }, M = new MutationObserver(x);
886
- return M.observe(l, E), x(), () => {
887
- M.disconnect();
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 S = F(() => `
893
- .monaco-editor-${m.current} .margin {
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
- }`, []), j = F(() => `.monaco-editor-${m.current} .view-overlays {
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
- }`, []), H = F(
905
+ }`, []), E = V(
901
906
  () => ({
902
- ...Pr,
903
- ...d
907
+ ...$r,
908
+ ...l
904
909
  }),
905
- [d]
906
- ), T = F(() => /* @__PURE__ */ R.jsx(
910
+ [l]
911
+ ), v = V(() => /* @__PURE__ */ A.jsx(
907
912
  "style",
908
913
  {
909
914
  dangerouslySetInnerHTML: {
910
- __html: `${P} ${O} ${S} ${j}`
915
+ __html: `${k} ${M} ${C} ${$}`
911
916
  }
912
917
  }
913
- ), [P, O, j, S]);
914
- return /* @__PURE__ */ R.jsxs("div", { className: f, ref: s, children: [
915
- T,
916
- /* @__PURE__ */ R.jsx(
917
- Oe,
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-${m.current} overflow-hidden rounded-b-md border-x border-b`,
924
+ className: `monaco-editor-${b.current} overflow-hidden rounded-b-cn-3`,
920
925
  height: u,
921
926
  language: t,
922
- theme: D,
923
- options: H,
924
- onMount: y
927
+ theme: T,
928
+ options: E,
929
+ onMount: j
925
930
  }
926
931
  )
927
932
  ] });
928
933
  }
929
- W.config({ monaco: z });
930
- const xr = {
931
- ...le
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 Br({
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
- height: a = "75vh",
941
- className: u
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
- se();
944
- const [d, f] = U(), v = g(), s = g({ code: "", revisionId: 0 }), m = g(null), C = G(
945
- ($, w) => {
946
- var y, D, P, O, S, j;
947
- m.current = $, v.current = w, $.setValue(e.code), f($), (P = (D = (y = w.languages.typescript) == null ? void 0 : y.typescriptDefaults) == null ? void 0 : D.setDiagnosticsOptions) == null || P.call(D, {
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
- }), (j = (S = (O = w.languages.typescript) == null ? void 0 : O.javascriptDefaults) == null ? void 0 : S.setDiagnosticsOptions) == null || j.call(S, {
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
- L(() => {
960
- var $, w;
961
- if (m.current && (!e.revisionId || e.revisionId > Number(($ = s.current) == null ? void 0 : $.revisionId))) {
962
- const y = m.current.getModel();
963
- y && (o != null && o.readOnly ? (w = m.current) == null || w.setValue(e.code) : (m.current.pushUndoStop(), m.current.executeEdits("edit", [
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: y.getFullModelRange(),
1237
+ range: s.getFullModelRange(),
966
1238
  text: e.code
967
1239
  }
968
- ]), m.current.pushUndoStop()));
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
- W.config({ monaco: z });
988
- const Cr = {
989
- ...le,
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 Wr({
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
- se();
1007
- const [u, d] = U(), f = g(), { theme: v } = de({ monacoRef: f, themeConfig: n, editor: u, theme: i }), s = F(() => ({ ...Cr, ...o || {} }), [o]);
1008
- return /* @__PURE__ */ R.jsx(R.Fragment, { children: /* @__PURE__ */ R.jsx(
1009
- sr,
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-md border-x border-b",
1299
+ className: "overflow-hidden rounded-b-cn-3 border-x border-b",
1012
1300
  language: r,
1013
- theme: v,
1301
+ theme: g,
1014
1302
  original: e,
1015
1303
  modified: t,
1016
1304
  height: a,
1017
- options: s,
1018
- onMount: d
1305
+ options: f,
1306
+ onMount: l
1019
1307
  }
1020
1308
  ) });
1021
1309
  }
1022
- var ze = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(ze || {});
1023
- function $r(e) {
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((f) => {
1028
- switch (f.type) {
1029
- case ze.ContainsPath: {
1030
- f.paths.forEach((v) => {
1031
- let m = Object.keys(o).map((h) => ({
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(f.basePath));
1036
- m = m.map((h) => ({
1323
+ })).filter((h) => h.path.startsWith(d.basePath));
1324
+ b = b.map((h) => ({
1037
1325
  ...h,
1038
- path: h.path.substring(f.basePath.length)
1039
- })), m.filter((h) => v.test(h.path)).forEach((h) => {
1040
- const A = h.fullPath, $ = h.symbol, w = $.range;
1041
- u.forEach((y) => {
1042
- const D = {
1043
- range: w,
1044
- symbols: [$],
1045
- onClick: y.onClick,
1046
- data: y.data,
1047
- path: A
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: w,
1338
+ range: L,
1051
1339
  command: {
1052
1340
  id: n,
1053
- title: y.title,
1054
- arguments: [D]
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
- je(te, "data", {});
1075
- let ve = te;
1076
- async function He(e) {
1077
- const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
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 qe(e) {
1368
+ function Ze(e) {
1081
1369
  const t = /* @__PURE__ */ new Map();
1082
- return Me({
1370
+ return xe({
1083
1371
  pathSymbolMap: t,
1084
1372
  parentPath: "",
1085
1373
  children: e.children,
1086
- parentKind: ge.SymbolKind.Module
1374
+ parentKind: be.SymbolKind.Module
1087
1375
  }), t;
1088
1376
  }
1089
- function Me(e) {
1377
+ function xe(e) {
1090
1378
  switch (e.parentKind) {
1091
- case ge.SymbolKind.Module: {
1092
- Ir(e);
1379
+ case be.SymbolKind.Module: {
1380
+ Rr(e);
1093
1381
  break;
1094
1382
  }
1095
- case ge.SymbolKind.Array: {
1096
- Lr(e);
1383
+ case be.SymbolKind.Array: {
1384
+ Ur(e);
1097
1385
  break;
1098
1386
  }
1099
1387
  default:
1100
- Tr(e);
1388
+ zr(e);
1101
1389
  }
1102
1390
  }
1103
- function Ir(e) {
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)), Me({
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 Lr(e) {
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, Me({
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 Tr(e) {
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 Dr({
1422
+ function Fr({
1135
1423
  editorRef: e,
1136
1424
  inlineActions: t
1137
1425
  }) {
1138
- L(() => z.languages.registerCodeLensProvider("yaml", {
1426
+ N(() => F.languages.registerCodeLensProvider("yaml", {
1139
1427
  provideCodeLenses: async (n) => {
1140
- var d;
1141
- const o = await He(n), i = qe(o), a = (d = e == null ? void 0 : e.current) == null ? void 0 : d.addCommand(0, (f, { onClick: v, path: s, range: m, data: C }) => {
1142
- v({ path: s, range: m, data: C });
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: $r({ pathSymbolMap: i, inlineActions: t, commandId: a }),
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 Nr = ({ editorRef: e, selection: t }) => {
1153
- const [r, n] = U(), o = F(
1443
+ const Wr = ({ editorRef: e, selection: t }) => {
1444
+ const [r, n] = R(), o = V(
1154
1445
  () => async (i, a, u) => {
1155
- var m, C, h;
1156
- const d = (m = e == null ? void 0 : e.current) == null ? void 0 : m.getModel();
1157
- if (!d || !a)
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 f = await He(d), s = (C = qe(f).get(a)) == null ? void 0 : C.range;
1160
- s && (n(s), u && ((h = e == null ? void 0 : e.current) == null || h.revealLineInCenter(s.startLineNumber)));
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
- L(() => {
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]), L(() => {
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
- }, Be = Qe({
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 Kr({
1493
+ function an({
1203
1494
  children: e
1204
1495
  }) {
1205
- const [t, r] = U([]), [n, o] = U(null), i = G(
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__ */ R.jsx(
1212
- Be.Provider,
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 We() {
1226
- return Xe(Be);
1516
+ function Qe() {
1517
+ return ot(Je);
1227
1518
  }
1228
- const kr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
1229
- const { setMarkers: n } = We();
1230
- L(() => {
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((d) => {
1236
- var s;
1237
- const f = (s = t.current) == null ? void 0 : s.getModel();
1238
- if (!f)
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 v = f.uri.toString();
1241
- if (d.some((m) => m.toString() === v)) {
1242
- const m = z.editor.getModelMarkers({ resource: f.uri });
1243
- n(m);
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 Ar(e) {
1543
+ function Br(e) {
1253
1544
  var n, o;
1254
- const t = ((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? [], r = t.findIndex((i) => i.fileMatch[0] === e.fileMatch[0]);
1255
- r !== -1 ? t[r] = e : t.push(e), Ke(t);
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 Vr(e) {
1548
+ function Kr(e) {
1258
1549
  var n, o;
1259
- const r = (((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== Se(e));
1260
- Ke(r);
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 Ke(e) {
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
- be.setDiagnosticsOptions({ ...t });
1561
+ Me.setDiagnosticsOptions({ ...t });
1271
1562
  }
1272
- const Se = (e) => et.parse(`file://${e}`).toString(), _r = (e) => {
1563
+ const je = (e) => it.parse(`file://${e}`).toString(), Yr = (e) => {
1273
1564
  const { schemaConfig: t, instanceId: r } = e;
1274
- L(() => {
1565
+ N(() => {
1275
1566
  if (t != null && t.schema)
1276
- return Ar({
1277
- fileMatch: [Se(r.toString())],
1567
+ return Br({
1568
+ fileMatch: [je(r.toString())],
1278
1569
  ...t
1279
1570
  }), () => {
1280
- Vr(r);
1571
+ Kr(r);
1281
1572
  };
1282
1573
  }, [t == null ? void 0 : t.schema, r]);
1283
1574
  };
1284
- W.config({ monaco: z });
1285
- const Ur = {
1286
- ...le,
1575
+ q.config({ monaco: F });
1576
+ const Gr = {
1577
+ ...ae,
1287
1578
  folding: !0
1288
- }, Yr = function(t) {
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: d,
1297
- options: f,
1298
- animateOnUpdate: v = !1,
1299
- onAnimateEnd: s,
1300
- instanceId: m
1301
- } = t, C = se(), [h] = U(m ?? `yaml-editor-${Math.random()}`), { editor: A, setEditor: $ } = We(), w = g(null), y = g(), D = g({ yaml: "", revisionId: 0 }), P = g(null), O = g(null), S = G(
1302
- (E) => {
1303
- var N, c, p;
1304
- const x = E.split(`
1305
- `), M = (N = P.current) == null ? void 0 : N.getModel();
1306
- if (M) {
1307
- (c = P.current) == null || c.pushUndoStop(), M.setValue("");
1308
- let k = 0;
1309
- O.current = window.setInterval(() => {
1310
- var q;
1311
- k < x.length ? (C && ((q = P.current) == null || q.executeEdits("addLine", [
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 C.Range(k + 1, 1, k + 1, 1),
1314
- text: x[k] + `
1605
+ range: new h.Range(W + 1, 1, W + 1, 1),
1606
+ text: p[W] + `
1315
1607
  `
1316
1608
  }
1317
- ])), k++) : O.current && (clearInterval(O.current), s == null || s());
1318
- }, 100), (p = P.current) == null || p.pushUndoStop();
1609
+ ])), W++) : C.current && (clearInterval(C.current), f == null || f());
1610
+ }, 100), (H = M.current) == null || H.pushUndoStop();
1319
1611
  }
1320
1612
  },
1321
- [C]
1613
+ [h]
1322
1614
  );
1323
- L(() => () => {
1324
- O.current && clearInterval(O.current);
1615
+ N(() => () => {
1616
+ C.current && clearInterval(C.current);
1325
1617
  }, []);
1326
- function j(E, x) {
1327
- P.current = E, y.current = x, E.setValue(r.yaml), $(E), setTimeout(() => {
1328
- var M;
1329
- (M = w.current) != null && M.style && (w.current.style.opacity = "1");
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
- L(() => {
1333
- var E;
1334
- if (P.current && (!r.revisionId || r.revisionId > Number((E = D.current) == null ? void 0 : E.revisionId))) {
1335
- const x = P.current.getModel();
1336
- x && (P.current.executeEdits("edit", [
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: x.getFullModelRange(),
1339
- text: v ? "" : r.yaml
1630
+ range: p.getFullModelRange(),
1631
+ text: g ? "" : r.yaml
1340
1632
  }
1341
- ]), v && S(r.yaml));
1633
+ ]), g && $(r.yaml));
1342
1634
  }
1343
- }, [S, r, v]), _r({ schemaConfig: n, instanceId: h }), Dr({ editorRef: P, inlineActions: o });
1344
- const { theme: H } = de({ monacoRef: y, themeConfig: i, editor: A, theme: d });
1345
- kr({ monacoRef: y, editorRef: P, instanceId: h }), Nr({ editorRef: P, selection: u });
1346
- const T = F(() => Se(h), []), l = F(
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
- ...Ur,
1349
- ...f
1640
+ ...Gr,
1641
+ ...d
1350
1642
  }),
1351
- [f]
1643
+ [d]
1352
1644
  );
1353
- return /* @__PURE__ */ R.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: w, children: /* @__PURE__ */ R.jsx(
1354
- Oe,
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: (E, x) => {
1357
- D.current = { yaml: E ?? "", revisionId: x.versionId }, a({ ...D.current }, x);
1648
+ onChange: (m, p) => {
1649
+ k.current = { yaml: m ?? "", revisionId: p.versionId }, a({ ...k.current }, p);
1358
1650
  },
1359
1651
  language: "yaml",
1360
- theme: H,
1361
- options: l,
1362
- path: T,
1363
- onMount: j
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
- qr as BlameEditor,
1369
- Wr as CodeDiffEditor,
1370
- Br as CodeEditor,
1371
- ve as MonacoGlobals,
1372
- ze as SelectorType,
1373
- Yr as YamlEditor,
1374
- Be as YamlEditorContext,
1375
- Kr as YamlEditorContextProvider,
1376
- We as useYamlEditorContext
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