@harnessio/yaml-editor 0.20.0 → 0.21.0

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