@harnessio/yaml-editor 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  var Ze = Object.defineProperty;
2
2
  var Ge = (e, t, r) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var je = (e, t, r) => (Ge(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import K, { memo as ye, useState as V, useRef as O, useCallback as G, useEffect as L, useMemo as B, createContext as Je, useContext as Qe } from "react";
4
+ import K, { memo as ye, useState as U, useRef as g, useCallback as G, useEffect as L, useMemo as F, useLayoutEffect as Je, createContext as Qe, useContext as Xe } from "react";
5
5
  import * as z from "monaco-editor";
6
- import { languages as ge, Uri as Xe } from "monaco-editor";
6
+ import { languages as ge, Uri as et } from "monaco-editor";
7
7
  import { yamlDefaults as be } from "monaco-yaml";
8
- var Ne = { exports: {} }, ne = {};
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, Te = 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
- Te = Pe("react.element"), ne.Fragment = Pe("react.fragment");
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: Te, 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
- Ne.exports = ne;
71
- var F = Ne.exports;
72
- function ut(e, t, r) {
70
+ De.exports = ne;
71
+ var R = De.exports;
72
+ function st(e, t, r) {
73
73
  return t in e ? Object.defineProperty(e, t, {
74
74
  value: r,
75
75
  enumerable: !0,
@@ -91,14 +91,14 @@ function Ce(e) {
91
91
  for (var t = 1; t < arguments.length; t++) {
92
92
  var r = arguments[t] != null ? arguments[t] : {};
93
93
  t % 2 ? xe(Object(r), !0).forEach(function(n) {
94
- 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,
@@ -172,7 +172,7 @@ function gt(e, t, r) {
172
172
  writable: !0
173
173
  }) : e[t] = r, e;
174
174
  }
175
- function Le(e, t) {
175
+ function Ie(e, t) {
176
176
  var r = Object.keys(e);
177
177
  if (Object.getOwnPropertySymbols) {
178
178
  var n = Object.getOwnPropertySymbols(e);
@@ -182,18 +182,18 @@ function Le(e, t) {
182
182
  }
183
183
  return r;
184
184
  }
185
- function Ie(e) {
185
+ function Le(e) {
186
186
  for (var t = 1; t < arguments.length; t++) {
187
187
  var r = arguments[t] != null ? arguments[t] : {};
188
- t % 2 ? Le(Object(r), !0).forEach(function(n) {
189
- gt(e, n, r[n]);
190
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Le(Object(r)).forEach(function(n) {
188
+ t % 2 ? Ie(Object(r), !0).forEach(function(n) {
189
+ vt(e, n, r[n]);
190
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ie(Object(r)).forEach(function(n) {
191
191
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
192
192
  });
193
193
  }
194
194
  return e;
195
195
  }
196
- function 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
  };
@@ -216,35 +216,35 @@ function X(e) {
216
216
  function ce(e) {
217
217
  return {}.toString.call(e).includes("Object");
218
218
  }
219
- function yt(e) {
219
+ function bt(e) {
220
220
  return !Object.keys(e).length;
221
221
  }
222
222
  function re(e) {
223
223
  return typeof e == "function";
224
224
  }
225
- function bt(e, t) {
225
+ function wt(e, t) {
226
226
  return Object.prototype.hasOwnProperty.call(e, t);
227
227
  }
228
228
  function Ot(e, t) {
229
- return ce(t) || H("changeType"), Object.keys(t).some(function(r) {
230
- return !bt(e, r);
231
- }) && H("changeField"), t;
229
+ return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
230
+ return !wt(e, r);
231
+ }) && B("changeField"), t;
232
232
  }
233
- function wt(e) {
234
- re(e) || H("selectorType");
233
+ function Mt(e) {
234
+ re(e) || B("selectorType");
235
235
  }
236
236
  function St(e) {
237
- re(e) || ce(e) || H("handlerType"), ce(e) && Object.values(e).some(function(t) {
237
+ re(e) || ce(e) || B("handlerType"), ce(e) && Object.values(e).some(function(t) {
238
238
  return !re(t);
239
- }) && H("handlersType");
239
+ }) && B("handlersType");
240
240
  }
241
- function Mt(e) {
242
- e || H("initialIsRequired"), ce(e) || H("initialType"), yt(e) && H("initialContent");
241
+ function jt(e) {
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,44 +254,44 @@ var Et = {
254
254
  changeType: "provided value of changes should be an object",
255
255
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
256
256
  default: "an unknown error accured in `state-local` package"
257
- }, H = X(jt)(Et), ie = {
257
+ }, B = X(Et)(Pt), ie = {
258
258
  changes: Ot,
259
- selector: wt,
259
+ selector: Mt,
260
260
  handler: St,
261
- initial: Mt
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) {
284
- return e.current = Ie(Ie({}, e.current), t), t;
283
+ function $t(e, t) {
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
292
  var Lt = {
293
- create: Pt
294
- }, It = {
293
+ create: xt
294
+ }, Tt = {
295
295
  paths: {
296
296
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
297
297
  }
@@ -301,8 +301,8 @@ function Dt(e) {
301
301
  for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
302
302
  o[i] = arguments[i];
303
303
  return o.length >= e.length ? e.apply(this, o) : function() {
304
- for (var a = arguments.length, u = new Array(a), 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
  };
@@ -310,17 +310,17 @@ function Dt(e) {
310
310
  function Nt(e) {
311
311
  return {}.toString.call(e).includes("Object");
312
312
  }
313
- function Tt(e) {
314
- return e || De("configIsRequired"), Nt(e) || De("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
- }, De = Dt(At)(Ae), Vt = {
341
- config: Tt
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,14 +353,14 @@ function Ve(e, t) {
353
353
  t[r] instanceof Object && e[r] && Object.assign(t[r], Ve(e[r], t[r]));
354
354
  }), Ce(Ce({}, e), t);
355
355
  }
356
- var 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() {
@@ -368,14 +368,14 @@ function fe(e) {
368
368
  }, r;
369
369
  }
370
370
  var Ft = Lt.create({
371
- config: It,
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];
376
+ }), _e = ft(Ft, 2), oe = _e[0], ue = _e[1];
377
377
  function zt(e) {
378
- var t = Vt.config(e), r = t.monaco, n = lt(t, ["monaco"]);
378
+ var t = _t.config(e), r = t.monaco, n = dt(t, ["monaco"]);
379
379
  ue(function(o) {
380
380
  return {
381
381
  config: Ve(o.config, n),
@@ -383,7 +383,7 @@ function zt(e) {
383
383
  };
384
384
  });
385
385
  }
386
- function Rt() {
386
+ function Ht() {
387
387
  var e = oe(function(t) {
388
388
  var r = t.monaco, n = t.isInitialized, o = t.resolve;
389
389
  return {
@@ -399,7 +399,7 @@ function Rt() {
399
399
  return e.resolve(e.monaco), fe(pe);
400
400
  if (window.monaco && window.monaco.editor)
401
401
  return Ue(window.monaco), e.resolve(window.monaco), fe(pe);
402
- _t(qt, Ht)(Wt);
402
+ Ut(qt, Wt)(Kt);
403
403
  }
404
404
  return fe(pe);
405
405
  }
@@ -410,7 +410,7 @@ function Bt(e) {
410
410
  var t = document.createElement("script");
411
411
  return e && (t.src = e), t;
412
412
  }
413
- function Ht(e) {
413
+ function Wt(e) {
414
414
  var t = oe(function(n) {
415
415
  var o = n.config, i = n.reject;
416
416
  return {
@@ -422,7 +422,7 @@ function Ht(e) {
422
422
  return e();
423
423
  }, r.onerror = t.reject, r;
424
424
  }
425
- function 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;
@@ -455,164 +455,164 @@ var pe = new Promise(function(e, t) {
455
455
  });
456
456
  }), W = {
457
457
  config: zt,
458
- init: Rt,
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 = ye(tr);
469
- function rr(e) {
458
+ init: Ht,
459
+ __getMonacoInstance: Yt
460
+ }, Zt = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, me = Zt, Gt = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Jt = Gt;
461
+ function Qt({ children: e }) {
462
+ return K.createElement("div", { style: Jt.container }, e);
463
+ }
464
+ var Xt = Qt, er = Xt;
465
+ function tr({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: a }) {
466
+ return K.createElement("section", { style: { ...me.wrapper, width: e, height: t }, ...a }, !r && K.createElement(er, null, n), K.createElement("div", { ref: o, style: { ...me.fullWidth, ...!r && me.hide }, className: i }));
467
+ }
468
+ var rr = tr, Re = ye(rr);
469
+ function nr(e) {
470
470
  L(e, []);
471
471
  }
472
- var Oe = rr;
473
- function nr(e, t, r = !0) {
474
- let n = O(!0);
472
+ var we = nr;
473
+ function or(e, t, r = !0) {
474
+ let n = g(!0);
475
475
  L(n.current || !r ? () => {
476
476
  n.current = !1;
477
477
  } : e, t);
478
478
  }
479
- var 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(ze(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 ? ze(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 ze(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: I = "100%", className: g, wrapperProps: k = {}, beforeMount: C = ee, onMount: w = ee }) {
495
- let [v, T] = V(!1), [x, M] = V(!0), j = O(null), E = O(null), R = O(null), S = O(w), d = O(C), P = O(!1);
496
- Oe(() => {
494
+ function cr({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: a, keepCurrentOriginalModel: u = !1, keepCurrentModifiedModel: d = !1, theme: f = "light", loading: v = "Loading...", options: s = {}, height: m = "100%", width: C = "100%", className: h, wrapperProps: A = {}, beforeMount: $ = ee, onMount: w = ee }) {
495
+ let [y, D] = U(!1), [P, O] = U(!0), S = g(null), j = g(null), H = g(null), T = g(w), l = g($), E = g(!1);
496
+ we(() => {
497
497
  let c = W.init();
498
- return c.then((y) => (E.current = y) && M(!1)).catch((y) => (y == null ? void 0 : y.type) !== "cancelation" && console.error("Monaco initialization: error:", y)), () => j.current ? D() : c.cancel();
499
- }), U(() => {
500
- if (j.current && E.current) {
501
- let c = j.current.getOriginalEditor(), y = Z(E.current, e || "", n || r || "text", i || "");
502
- y !== c.getModel() && c.setModel(y);
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(), y = Z(E.current, t || "", o || r || "text", a || "");
507
- y !== c.getModel() && c.setModel(y);
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, y;
514
- (y = (c = j.current) == null ? void 0 : c.getModel()) == null || y.original.setValue(e || "");
515
- }, [e], v), U(() => {
516
- let { original: c, modified: y } = j.current.getModel();
517
- E.current.editor.setModelLanguage(c, n || r || "text"), E.current.editor.setModelLanguage(y, 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 || ""), y = Z(E.current, t || "", o || r || "text", a || "");
531
- (A = j.current) == null || A.setModel({ original: c, modified: y });
532
- }, [r, t, o, e, n, i, a]), N = 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 && R.current && (j.current = E.current.editor.createDiffEditor(R.current, { automaticLayout: !0, ...f }), p(), (c = E.current) == null || c.editor.setTheme(s), T(!0), P.current = !0);
535
- }, [f, s, p]);
534
+ !E.current && H.current && (S.current = j.current.editor.createDiffEditor(H.current, { automaticLayout: !0, ...s }), x(), (c = j.current) == null || c.editor.setTheme(f), D(!0), E.current = !0);
535
+ }, [s, f, x]);
536
536
  L(() => {
537
- v && S.current(j.current, E.current);
538
- }, [v]), L(() => {
539
- !x && !v && N();
540
- }, [x, v, N]);
541
- function D() {
542
- var y, A, q, J;
543
- let c = (y = j.current) == null ? void 0 : y.getModel();
544
- u || ((A = c == null ? void 0 : c.original) == null || A.dispose()), l || ((q = c == null ? void 0 : c.modified) == null || q.dispose()), (J = j.current) == null || J.dispose();
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: I, height: m, isEditorReady: v, loading: h, _ref: R, 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 = ye(cr);
549
- function sr() {
550
- let [e, t] = V(W.__getMonacoInstance());
551
- return Oe(() => {
548
+ var ur = cr, sr = ye(ur);
549
+ function lr() {
550
+ let [e, t] = U(W.__getMonacoInstance());
551
+ return we(() => {
552
552
  let r;
553
553
  return e || (r = W.init(), r.then((n) => {
554
554
  t(n);
555
555
  })), () => r == null ? void 0 : r.cancel();
556
556
  }), e;
557
557
  }
558
- var se = sr;
559
- function lr(e) {
560
- let t = O();
558
+ var se = lr;
559
+ function dr(e) {
560
+ let t = g();
561
561
  return L(() => {
562
562
  t.current = e;
563
563
  }, [e]), t.current;
564
564
  }
565
- var 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: I = "100%", height: g = "100%", className: k, wrapperProps: C = {}, beforeMount: w = ee, onMount: v = ee, onChange: T, onValidate: x = ee }) {
567
- let [M, j] = V(!1), [E, R] = V(!0), S = O(null), d = O(null), P = O(null), p = O(v), N = O(w), D = O(), c = O(n), y = dr(i), A = O(!1), q = O(!1);
568
- Oe(() => {
565
+ var fr = dr, ae = /* @__PURE__ */ new Map();
566
+ function pr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: a = "light", line: u, loading: d = "Loading...", options: f = {}, overrideServices: v = {}, saveViewState: s = !0, keepCurrentModel: m = !1, width: C = "100%", height: h = "100%", className: A, wrapperProps: $ = {}, beforeMount: w = ee, onMount: y = ee, onChange: D, onValidate: P = ee }) {
567
+ let [O, S] = U(!1), [j, H] = U(!0), T = g(null), l = g(null), E = g(null), x = g(y), M = g(w), N = g(), c = g(n), p = fr(i), k = g(!1), q = g(!1);
568
+ we(() => {
569
569
  let b = W.init();
570
- return b.then(($) => (S.current = $) && R(!1)).catch(($) => ($ == null ? void 0 : $.type) !== "cancelation" && console.error("Monaco initialization: error:", $)), () => d.current ? Ye() : b.cancel();
571
- }), U(() => {
572
- var $, _, Q, Y;
573
- let b = Z(S.current, e || n || "", t || o || "", i || r || "");
574
- b !== (($ = d.current) == null ? void 0 : $.getModel()) && (f && ae.set(y, (_ = d.current) == null ? void 0 : _.saveViewState()), (Q = d.current) == null || Q.setModel(b), f && ((Y = d.current) == null || Y.restoreViewState(ae.get(i))));
575
- }, [i], M), U(() => {
570
+ return b.then((I) => (T.current = I) && H(!1)).catch((I) => (I == null ? void 0 : I.type) !== "cancelation" && console.error("Monaco initialization: error:", I)), () => l.current ? Ye() : b.cancel();
571
+ }), _(() => {
572
+ var I, V, Q, Y;
573
+ let b = Z(T.current, e || n || "", t || o || "", i || r || "");
574
+ b !== ((I = l.current) == null ? void 0 : I.getModel()) && (s && ae.set(p, (V = l.current) == null ? void 0 : V.saveViewState()), (Q = l.current) == null || Q.setModel(b), s && ((Y = l.current) == null || Y.restoreViewState(ae.get(i))));
575
+ }, [i], O), _(() => {
576
576
  var b;
577
- (b = d.current) == null || b.updateOptions(s);
578
- }, [s], M), U(() => {
579
- !d.current || n === void 0 || (d.current.getOption(S.current.editor.EditorOption.readOnly) ? d.current.setValue(n) : n !== d.current.getValue() && (q.current = !0, d.current.executeEdits("", [{ range: d.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), d.current.pushUndoStop(), q.current = !1));
580
- }, [n], M), U(() => {
581
- var $, _;
582
- let b = ($ = d.current) == null ? void 0 : $.getModel();
583
- b && o && ((_ = S.current) == null || _.editor.setModelLanguage(b, o));
584
- }, [o], M), U(() => {
577
+ (b = l.current) == null || b.updateOptions(f);
578
+ }, [f], O), _(() => {
579
+ !l.current || n === void 0 || (l.current.getOption(T.current.editor.EditorOption.readOnly) ? l.current.setValue(n) : n !== l.current.getValue() && (q.current = !0, l.current.executeEdits("", [{ range: l.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), l.current.pushUndoStop(), q.current = !1));
580
+ }, [n], O), _(() => {
581
+ var I, V;
582
+ let b = (I = l.current) == null ? void 0 : I.getModel();
583
+ b && o && ((V = T.current) == null || V.editor.setModelLanguage(b, o));
584
+ }, [o], O), _(() => {
585
585
  var b;
586
- u !== void 0 && ((b = d.current) == null || b.revealLine(u));
587
- }, [u], M), U(() => {
586
+ u !== void 0 && ((b = l.current) == null || b.revealLine(u));
587
+ }, [u], O), _(() => {
588
588
  var b;
589
- (b = S.current) == null || b.editor.setTheme(a);
590
- }, [a], M);
589
+ (b = T.current) == null || b.editor.setTheme(a);
590
+ }, [a], O);
591
591
  let J = G(() => {
592
592
  var b;
593
- if (!(!P.current || !S.current) && !A.current) {
594
- N.current(S.current);
595
- let $ = i || r, _ = Z(S.current, n || e || "", t || o || "", $ || "");
596
- d.current = (b = S.current) == null ? void 0 : b.editor.create(P.current, { model: _, automaticLayout: !0, ...s }, h), f && d.current.restoreViewState(ae.get($)), S.current.editor.setTheme(a), u !== void 0 && d.current.revealLine(u), j(!0), A.current = !0;
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]);
598
+ }, [e, t, r, n, o, i, f, v, s, a, u]);
599
599
  L(() => {
600
- M && p.current(d.current, S.current);
601
- }, [M]), L(() => {
602
- !E && !M && J();
603
- }, [E, M, J]), c.current = n, L(() => {
604
- var b, $;
605
- M && T && ((b = D.current) == null || b.dispose(), D.current = ($ = d.current) == null ? void 0 : $.onDidChangeModelContent((_) => {
606
- q.current || T(d.current.getValue(), _);
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
- }, [M, T]), L(() => {
609
- if (M) {
610
- let b = S.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 = S.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 () => {
@@ -621,14 +621,14 @@ function fr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, lan
621
621
  }
622
622
  return () => {
623
623
  };
624
- }, [M, x]);
624
+ }, [O, P]);
625
625
  function Ye() {
626
- var b, $;
627
- (b = D.current) == null || b.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: I, height: g, isEditorReady: M, 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 = ye(pr), we = 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,49 @@ const le = {
651
651
  renderLineHighlight: "none",
652
652
  automaticLayout: !0
653
653
  }, de = (e) => {
654
- const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = V(n ?? o ?? "vs-dark");
654
+ const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = U(n ?? o ?? "vs-dark");
655
655
  return L(() => {
656
656
  var u;
657
- (u = t == null ? void 0 : t.themes) == null || u.forEach((l) => {
658
- z.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
660
  }, [z]), L(() => {
661
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
- function vr({
674
+ const yr = (e) => {
675
+ const t = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
676
+ if (e < 60)
677
+ return t.format(-e, "second");
678
+ const r = Math.floor(e / 60);
679
+ if (r < 60)
680
+ return t.format(-r, "minute");
681
+ const n = Math.floor(r / 60);
682
+ if (n < 24)
683
+ return t.format(-n, "hour");
684
+ const o = Math.floor(n / 24);
685
+ if (o < 30)
686
+ return t.format(-o, "day");
687
+ const i = Math.floor(o / 30);
688
+ if (i < 12)
689
+ return t.format(-i, "month");
690
+ const a = Math.floor(i / 12);
691
+ return t.format(-a, "year");
692
+ }, br = (e) => {
693
+ const t = new Date(e), n = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 1e3), o = Math.abs(n);
694
+ return yr(o);
695
+ };
696
+ function wr({
675
697
  instanceId: e,
676
698
  lineNumbersPosition: t
677
699
  }) {
@@ -701,10 +723,10 @@ function vr({
701
723
 
702
724
  .monaco-editor-${e} .view-line .blame-editor-commit {
703
725
  display: inline-block;
704
- color: var(--canary-foreground-01);
726
+ color: var(--cn-text-1);
705
727
  }`, r;
706
728
  }
707
- function yr({
729
+ function Or({
708
730
  instanceId: e,
709
731
  blameData: t,
710
732
  dateWidth: r,
@@ -712,16 +734,16 @@ function yr({
712
734
  }) {
713
735
  let o = "";
714
736
  return t.forEach((i) => {
715
- var s, h, f, m, I, g, k, C;
716
- 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 = (I = i == null ? void 0 : i.commitInfo) == null ? void 0 : I.author) == null ? void 0 : g.avatarUrl}');` : "";
737
+ var f, v, s, m, C, h, A, $;
738
+ const a = (v = (f = i == null ? void 0 : i.commitInfo) == null ? void 0 : f.author) == null ? void 0 : v.avatarUrl, u = (m = (s = i == null ? void 0 : i.commitInfo) == null ? void 0 : s.author) == null ? void 0 : m.initials, d = a ? `background: url('${(h = (C = i == null ? void 0 : i.commitInfo) == null ? void 0 : C.author) == null ? void 0 : h.avatarUrl}');` : "";
717
739
  for (let w = i.fromLineNumber; w <= i.toLineNumber; w++)
718
740
  w === i.fromLineNumber ? o += `
719
741
  .monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
720
- content: '${gr(((C = (k = i == null ? void 0 : i.commitInfo) == null ? void 0 : k.author) == null ? void 0 : C.when) || "")}';
742
+ content: '${vr(br((($ = (A = i == null ? void 0 : i.commitInfo) == null ? void 0 : A.author) == null ? void 0 : $.when) || ""))}';
721
743
  position: absolute;
722
744
  left: 10px;
723
745
  top: 0px;
724
- color: hsl(var(--canary-foreground-03));
746
+ color: var(--cn-text-3);
725
747
  }
726
748
 
727
749
  .monaco-editor-${e} .view-line .blame-editor-commit-${w}:after {
@@ -730,14 +752,14 @@ function yr({
730
752
  border-radius: 50%;
731
753
  padding: 4px;
732
754
  text-align: center;
733
- background: hsl(var(--canary-background-11));
755
+ background: var(--cn-set-gray-soft-bg);
734
756
  line-height: 17px;
735
757
  left: ${r + 10}px;
736
758
  top: -4px;
737
- color: hsl(var(--canary-foreground-03));
759
+ color: var(--cn-text-3);
738
760
  width: ${n}px;
739
761
  height: ${n}px;
740
- ${l}
762
+ ${d}
741
763
  background-size: 100% 100%;
742
764
  }` : o += `
743
765
  .monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
@@ -748,12 +770,12 @@ function yr({
748
770
  }`;
749
771
  }), o;
750
772
  }
751
- function br(e, t) {
773
+ function Mr(e, t) {
752
774
  let r = "";
753
775
  return e.length > t ? r = e.slice(0, t - 3) + "..." : e.length < t ? r = e + " ".repeat(t - e.length) : r = e, " ".repeat(25) + r + " ".repeat(10);
754
776
  }
755
777
  W.config({ monaco: z });
756
- const he = 450, Or = 30, wr = 140, Sr = 24, Mr = {
778
+ const he = 450, Sr = 30, jr = 140, Er = 24, Pr = {
757
779
  ...le,
758
780
  readOnly: !0,
759
781
  matchBrackets: "never",
@@ -764,7 +786,7 @@ const he = 450, Or = 30, wr = 140, Sr = 24, Mr = {
764
786
  renderWhitespace: "none",
765
787
  renderLineHighlight: "none"
766
788
  };
767
- function zr({
789
+ function qr({
768
790
  code: e,
769
791
  language: t,
770
792
  themeConfig: r,
@@ -773,141 +795,142 @@ function zr({
773
795
  showSeparators: i = !0,
774
796
  theme: a,
775
797
  height: u = "75vh",
776
- options: l
798
+ options: d,
799
+ className: f
777
800
  }) {
778
- const s = O(o), h = O(hr(5));
801
+ const v = g(o), s = g(null), m = g(gr(5));
779
802
  se();
780
- const [f, m] = V(), [I, g] = V(0), k = O(null), C = O(null);
803
+ const [C, h] = U(), A = g(null), $ = g(null);
781
804
  L(() => {
782
- s.current = o;
805
+ v.current = o;
783
806
  }, [o]);
784
807
  function w() {
785
- const S = C.current, d = k.current;
786
- if (!S || !d)
808
+ const l = $.current, E = A.current;
809
+ if (!l || !E)
787
810
  return;
788
- i && S.changeViewZones(function(p) {
789
- p.addZone({
811
+ i && l.changeViewZones(function(M) {
812
+ M.addZone({
790
813
  afterLineNumber: 0,
791
814
  heightInPx: 10,
792
815
  domNode: document.createElement("div")
793
- }), s.current.forEach((N, D) => {
794
- if (D !== s.current.length - 1) {
795
- const c = document.createElement("div");
796
- c.style.borderTop = "1px solid hsl(var(--canary-border-01))", c.style.marginTop = "9px", c.className = "blame-editor-separator", p.addZone({
816
+ }), v.current.forEach((N, c) => {
817
+ if (c !== v.current.length - 1) {
818
+ const p = document.createElement("div");
819
+ p.style.borderTop = "1px solid var(--cn-border-2)", p.style.marginTop = "9px", p.className = "blame-editor-separator", M.addZone({
797
820
  afterLineNumber: N.toLineNumber,
798
821
  heightInPx: 20,
799
- domNode: c
822
+ domNode: p
800
823
  });
801
824
  }
802
825
  });
803
826
  });
804
- const P = [];
805
- s.current.forEach((p) => {
827
+ const x = [];
828
+ v.current.forEach((M) => {
806
829
  var N;
807
- for (let D = p.fromLineNumber; D <= p.toLineNumber; D++)
808
- P.push({
809
- range: new d.Range(D, 0, D + 1, 0),
830
+ for (let c = M.fromLineNumber; c <= M.toLineNumber; c++)
831
+ x.push({
832
+ range: new E.Range(c, 0, c + 1, 0),
810
833
  options: {
811
834
  before: {
812
- content: br(
813
- D === p.fromLineNumber && ((N = p == null ? void 0 : p.commitInfo) == null ? void 0 : N.title) || "",
814
- Or
835
+ content: Mr(
836
+ c === M.fromLineNumber && ((N = M == null ? void 0 : M.commitInfo) == null ? void 0 : N.title) || "",
837
+ Sr
815
838
  ),
816
- cursorStops: d.editor.InjectedTextCursorStops.None,
817
- inlineClassName: `blame-editor-commit blame-editor-commit-${D}`
839
+ cursorStops: E.editor.InjectedTextCursorStops.None,
840
+ inlineClassName: `blame-editor-commit blame-editor-commit-${c}`
818
841
  }
819
842
  }
820
843
  });
821
- }), S.createDecorationsCollection(P);
844
+ }), l.createDecorationsCollection(x);
822
845
  }
823
- function v(S, d) {
824
- var P, p, N, D, c, y;
825
- C.current = S, k.current = d, S.setValue(e), m(S), (N = (p = (P = d.languages.typescript) == null ? void 0 : P.typescriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || N.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, {
826
849
  noSuggestionDiagnostics: !0,
827
850
  noSyntaxValidation: !0,
828
851
  noSemanticValidation: !0
829
- }), (y = (c = (D = d.languages.typescript) == null ? void 0 : D.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || y.call(c, {
852
+ }), (k = (p = (c = E.languages.typescript) == null ? void 0 : c.javascriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || k.call(p, {
830
853
  noSuggestionDiagnostics: !0,
831
854
  noSyntaxValidation: !0,
832
855
  noSemanticValidation: !0
833
856
  }), w();
834
857
  }
835
858
  L(() => {
836
- f == null || f.setValue(e);
859
+ C == null || C.setValue(e);
837
860
  }, [e]);
838
- const { theme: T } = de({ monacoRef: k, themeConfig: r, editor: f, theme: a }), x = B(
839
- () => vr({
840
- instanceId: h.current,
861
+ const { theme: D } = de({ monacoRef: A, themeConfig: r, editor: C, theme: a }), P = F(
862
+ () => wr({
863
+ instanceId: m.current,
841
864
  lineNumbersPosition: n
842
865
  }),
843
866
  [o]
844
- ), M = B(
845
- () => yr({
846
- instanceId: h.current,
867
+ ), O = F(
868
+ () => Or({
869
+ instanceId: m.current,
847
870
  blameData: o,
848
- avatarSize: Sr,
849
- dateWidth: wr
871
+ avatarSize: Er,
872
+ dateWidth: jr
850
873
  }),
851
874
  [o]
852
875
  );
853
- L(() => {
854
- if (n === "center") {
855
- const S = document.getElementsByClassName("lines-content")[0];
856
- if (S) {
857
- const d = { attributes: !0 }, P = (N) => {
858
- for (const D of N) {
859
- const c = parseInt(getComputedStyle(S).left);
860
- g(c);
861
- }
862
- }, p = new MutationObserver(P);
863
- return p.observe(S, d), () => {
864
- 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();
865
888
  };
866
889
  }
867
890
  }
868
891
  });
869
- const j = B(() => `
870
- .monaco-editor-${h.current} .margin {
871
- left: ${he + 16 + I}px !important;
892
+ const S = F(() => `
893
+ .monaco-editor-${m.current} .margin {
894
+ display: var(--line-number-display);
895
+ left: var(--line-number-offset);
872
896
  pointer-events: none;
873
- }`, [I]), E = `
874
- .monaco-editor-${h.current} .view-overlays {
897
+ }`, []), j = F(() => `.monaco-editor-${m.current} .view-overlays {
875
898
  clip-path: polygon(${he + 16}px 0, 100% 0%, 100% 100%, ${he + 16}px 100%);
876
899
  height:100% !important;
877
- }`, R = B(
900
+ }`, []), H = F(
878
901
  () => ({
879
- ...Mr,
880
- ...l
902
+ ...Pr,
903
+ ...d
881
904
  }),
882
- [l]
883
- );
884
- return /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
885
- /* @__PURE__ */ F.jsx(
886
- "style",
887
- {
888
- dangerouslySetInnerHTML: {
889
- __html: `${x} ${M} ${j} ${E}`
890
- }
905
+ [d]
906
+ ), T = F(() => /* @__PURE__ */ R.jsx(
907
+ "style",
908
+ {
909
+ dangerouslySetInnerHTML: {
910
+ __html: `${P} ${O} ${S} ${j}`
891
911
  }
892
- ),
893
- /* @__PURE__ */ F.jsx(
894
- we,
912
+ }
913
+ ), [P, O, j, S]);
914
+ return /* @__PURE__ */ R.jsxs("div", { className: f, ref: s, children: [
915
+ T,
916
+ /* @__PURE__ */ R.jsx(
917
+ Oe,
895
918
  {
896
- className: `monaco-editor-${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`,
897
920
  height: u,
898
921
  language: t,
899
- theme: T,
900
- options: R,
901
- onMount: v
922
+ theme: D,
923
+ options: H,
924
+ onMount: y
902
925
  }
903
926
  )
904
927
  ] });
905
928
  }
906
929
  W.config({ monaco: z });
907
- const jr = {
930
+ const xr = {
908
931
  ...le
909
932
  };
910
- function Rr({
933
+ function Br({
911
934
  codeRevision: e,
912
935
  onCodeRevisionChange: t,
913
936
  language: r,
@@ -918,14 +941,14 @@ function Rr({
918
941
  className: u
919
942
  }) {
920
943
  se();
921
- const [l, s] = V(), h = O(), f = O({ code: "", revisionId: 0 }), m = O(null), I = G(
922
- (C, w) => {
923
- var v, T, x, M, j, E;
924
- m.current = C, h.current = w, C.setValue(e.code), s(C), (x = (T = (v = w.languages.typescript) == null ? void 0 : v.typescriptDefaults) == null ? void 0 : T.setDiagnosticsOptions) == null || x.call(T, {
944
+ const [d, f] = U(), v = g(), s = g({ code: "", revisionId: 0 }), m = g(null), C = G(
945
+ ($, w) => {
946
+ var y, D, P, O, S, j;
947
+ m.current = $, v.current = w, $.setValue(e.code), f($), (P = (D = (y = w.languages.typescript) == null ? void 0 : y.typescriptDefaults) == null ? void 0 : D.setDiagnosticsOptions) == null || P.call(D, {
925
948
  noSuggestionDiagnostics: !0,
926
949
  noSyntaxValidation: !0,
927
950
  noSemanticValidation: !0
928
- }), (E = (j = (M = w.languages.typescript) == null ? void 0 : M.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, {
929
952
  noSuggestionDiagnostics: !0,
930
953
  noSyntaxValidation: !0,
931
954
  noSemanticValidation: !0
@@ -934,35 +957,35 @@ function Rr({
934
957
  [e.code]
935
958
  );
936
959
  L(() => {
937
- var C, w;
938
- if (m.current && (!e.revisionId || e.revisionId > Number((C = f.current) == null ? void 0 : C.revisionId))) {
939
- const v = m.current.getModel();
940
- v && (o != null && o.readOnly ? (w = m.current) == null || w.setValue(e.code) : (m.current.pushUndoStop(), m.current.executeEdits("edit", [
960
+ var $, w;
961
+ if (m.current && (!e.revisionId || e.revisionId > Number(($ = s.current) == null ? void 0 : $.revisionId))) {
962
+ const y = m.current.getModel();
963
+ y && (o != null && o.readOnly ? (w = m.current) == null || w.setValue(e.code) : (m.current.pushUndoStop(), m.current.executeEdits("edit", [
941
964
  {
942
- range: v.getFullModelRange(),
965
+ range: y.getFullModelRange(),
943
966
  text: e.code
944
967
  }
945
968
  ]), m.current.pushUndoStop()));
946
969
  }
947
970
  }, [e, m.current]);
948
- const { theme: g } = de({ monacoRef: h, themeConfig: n, editor: l, theme: i }), k = B(() => ({ ...jr, ...o || {} }), [o]);
949
- return /* @__PURE__ */ F.jsx(F.Fragment, { children: /* @__PURE__ */ F.jsx(
950
- we,
971
+ const { theme: h } = de({ monacoRef: v, themeConfig: n, editor: d, theme: i }), A = F(() => ({ ...xr, ...o || {} }), [o]);
972
+ return /* @__PURE__ */ R.jsx(R.Fragment, { children: /* @__PURE__ */ R.jsx(
973
+ Oe,
951
974
  {
952
975
  className: u,
953
976
  height: a,
954
- onChange: (C, w) => {
955
- f.current = { code: C ?? "", revisionId: w.versionId }, t({ ...f.current }, w);
977
+ onChange: ($, w) => {
978
+ s.current = { code: $ ?? "", revisionId: w.versionId }, t({ ...s.current }, w);
956
979
  },
957
980
  language: r,
958
- theme: g,
959
- options: k,
960
- onMount: I
981
+ theme: h,
982
+ options: A,
983
+ onMount: C
961
984
  }
962
985
  ) });
963
986
  }
964
987
  W.config({ monaco: z });
965
- const Er = {
988
+ const Cr = {
966
989
  ...le,
967
990
  codeLens: !1,
968
991
  smartSelect: {
@@ -971,7 +994,7 @@ const Er = {
971
994
  originalEditable: !1,
972
995
  overviewRulerBorder: !1
973
996
  };
974
- function qr({
997
+ function Wr({
975
998
  original: e,
976
999
  modified: t,
977
1000
  language: r,
@@ -981,54 +1004,54 @@ function qr({
981
1004
  height: a = "75vh"
982
1005
  }) {
983
1006
  se();
984
- const [u, l] = V(), s = O(), { theme: h } = de({ monacoRef: s, themeConfig: n, editor: u, theme: i }), f = B(() => ({ ...Er, ...o || {} }), [o]);
985
- return /* @__PURE__ */ F.jsx(F.Fragment, { children: /* @__PURE__ */ F.jsx(
986
- 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,
987
1010
  {
988
1011
  className: "overflow-hidden rounded-b-md border-x border-b",
989
1012
  language: r,
990
- theme: h,
1013
+ theme: v,
991
1014
  original: e,
992
1015
  modified: t,
993
1016
  height: a,
994
- options: f,
995
- onMount: l
1017
+ options: s,
1018
+ onMount: d
996
1019
  }
997
1020
  ) });
998
1021
  }
999
- var Re = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Re || {});
1000
- function Pr(e) {
1022
+ var ze = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(ze || {});
1023
+ function $r(e) {
1001
1024
  const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), i = [];
1002
1025
  return r == null || r.forEach((a) => {
1003
1026
  const u = a.actions;
1004
- a.selectors.forEach((s) => {
1005
- switch (s.type) {
1006
- case Re.ContainsPath: {
1007
- s.paths.forEach((h) => {
1008
- let m = Object.keys(o).map((g) => ({
1009
- fullPath: g,
1010
- path: g,
1011
- symbol: o[g]
1012
- })).filter((g) => g.path.startsWith(s.basePath));
1013
- m = m.map((g) => ({
1014
- ...g,
1015
- path: g.path.substring(s.basePath.length)
1016
- })), m.filter((g) => h.test(g.path)).forEach((g) => {
1017
- const k = g.fullPath, C = g.symbol, w = C.range;
1018
- u.forEach((v) => {
1019
- const T = {
1027
+ a.selectors.forEach((f) => {
1028
+ switch (f.type) {
1029
+ case ze.ContainsPath: {
1030
+ f.paths.forEach((v) => {
1031
+ let m = Object.keys(o).map((h) => ({
1032
+ fullPath: h,
1033
+ path: h,
1034
+ symbol: o[h]
1035
+ })).filter((h) => h.path.startsWith(f.basePath));
1036
+ m = m.map((h) => ({
1037
+ ...h,
1038
+ path: h.path.substring(f.basePath.length)
1039
+ })), m.filter((h) => v.test(h.path)).forEach((h) => {
1040
+ const A = h.fullPath, $ = h.symbol, w = $.range;
1041
+ u.forEach((y) => {
1042
+ const D = {
1020
1043
  range: w,
1021
- symbols: [C],
1022
- onClick: v.onClick,
1023
- data: v.data,
1024
- path: k
1044
+ symbols: [$],
1045
+ onClick: y.onClick,
1046
+ data: y.data,
1047
+ path: A
1025
1048
  };
1026
1049
  i.push({
1027
1050
  range: w,
1028
1051
  command: {
1029
1052
  id: n,
1030
- title: v.title,
1031
- arguments: [T]
1053
+ title: y.title,
1054
+ arguments: [D]
1032
1055
  }
1033
1056
  });
1034
1057
  });
@@ -1050,38 +1073,38 @@ const te = class te {
1050
1073
  };
1051
1074
  je(te, "data", {});
1052
1075
  let ve = te;
1053
- async function qe(e) {
1076
+ async function He(e) {
1054
1077
  const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
1055
1078
  return await t.OutlineModel.create(r, e);
1056
1079
  }
1057
- function Be(e) {
1080
+ function qe(e) {
1058
1081
  const t = /* @__PURE__ */ new Map();
1059
- return Se({
1082
+ return Me({
1060
1083
  pathSymbolMap: t,
1061
1084
  parentPath: "",
1062
1085
  children: e.children,
1063
1086
  parentKind: ge.SymbolKind.Module
1064
1087
  }), t;
1065
1088
  }
1066
- function Se(e) {
1089
+ function Me(e) {
1067
1090
  switch (e.parentKind) {
1068
1091
  case ge.SymbolKind.Module: {
1069
- xr(e);
1092
+ Ir(e);
1070
1093
  break;
1071
1094
  }
1072
1095
  case ge.SymbolKind.Array: {
1073
- Cr(e);
1096
+ Lr(e);
1074
1097
  break;
1075
1098
  }
1076
1099
  default:
1077
- $r(e);
1100
+ Tr(e);
1078
1101
  }
1079
1102
  }
1080
- function xr(e) {
1103
+ function Ir(e) {
1081
1104
  e.children.forEach((t) => {
1082
1105
  var n;
1083
1106
  let r = e.parentPath;
1084
- t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Se({
1107
+ t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Me({
1085
1108
  pathSymbolMap: e.pathSymbolMap,
1086
1109
  parentPath: r,
1087
1110
  children: t.children,
@@ -1089,11 +1112,11 @@ function xr(e) {
1089
1112
  });
1090
1113
  });
1091
1114
  }
1092
- function Cr(e) {
1115
+ function Lr(e) {
1093
1116
  let t = 0;
1094
1117
  e.children.forEach((r) => {
1095
1118
  const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
1096
- e.pathSymbolMap.set(n, r.symbol), t += 1, Se({
1119
+ e.pathSymbolMap.set(n, r.symbol), t += 1, Me({
1097
1120
  pathSymbolMap: e.pathSymbolMap,
1098
1121
  parentPath: n,
1099
1122
  children: r.children,
@@ -1101,40 +1124,40 @@ function Cr(e) {
1101
1124
  });
1102
1125
  });
1103
1126
  }
1104
- function $r(e) {
1127
+ function Tr(e) {
1105
1128
  const t = e.children.get("0");
1106
1129
  if (t) {
1107
1130
  const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
1108
1131
  e.pathSymbolMap.set(r, t.symbol);
1109
1132
  }
1110
1133
  }
1111
- function Lr({
1134
+ function Dr({
1112
1135
  editorRef: e,
1113
1136
  inlineActions: t
1114
1137
  }) {
1115
1138
  L(() => z.languages.registerCodeLensProvider("yaml", {
1116
1139
  provideCodeLenses: async (n) => {
1117
- var l;
1118
- const o = await qe(n), i = Be(o), a = (l = e == null ? void 0 : e.current) == null ? void 0 : l.addCommand(0, (s, { onClick: h, path: f, range: m, data: I }) => {
1119
- h({ path: f, range: m, data: I });
1140
+ var d;
1141
+ const o = await He(n), i = qe(o), a = (d = e == null ? void 0 : e.current) == null ? void 0 : d.addCommand(0, (f, { onClick: v, path: s, range: m, data: C }) => {
1142
+ v({ path: s, range: m, data: C });
1120
1143
  });
1121
1144
  return a ? {
1122
- lenses: Pr({ pathSymbolMap: i, inlineActions: t, commandId: a }),
1145
+ lenses: $r({ pathSymbolMap: i, inlineActions: t, commandId: a }),
1123
1146
  dispose: () => {
1124
1147
  }
1125
1148
  } : void 0;
1126
1149
  }
1127
1150
  }).dispose, [t, e]);
1128
1151
  }
1129
- const Ir = ({ editorRef: e, selection: t }) => {
1130
- const [r, n] = V(), o = B(
1152
+ const Nr = ({ editorRef: e, selection: t }) => {
1153
+ const [r, n] = U(), o = F(
1131
1154
  () => async (i, a, u) => {
1132
- var m, I, g;
1133
- const l = (m = e == null ? void 0 : e.current) == null ? void 0 : m.getModel();
1134
- 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)
1135
1158
  return n(void 0);
1136
- const s = await qe(l), f = (I = Be(s).get(a)) == null ? void 0 : I.range;
1137
- 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)));
1138
1161
  },
1139
1162
  []
1140
1163
  );
@@ -1166,7 +1189,7 @@ const Ir = ({ editorRef: e, selection: t }) => {
1166
1189
  ]);
1167
1190
  return () => i == null ? void 0 : i.clear();
1168
1191
  }, [r, e, t == null ? void 0 : t.className]);
1169
- }, He = Je({
1192
+ }, Be = Qe({
1170
1193
  markers: [],
1171
1194
  setMarkers: () => {
1172
1195
  },
@@ -1176,17 +1199,17 @@ const Ir = ({ editorRef: e, selection: t }) => {
1176
1199
  updateCursorPosition: (e) => {
1177
1200
  }
1178
1201
  });
1179
- function Br({
1202
+ function Kr({
1180
1203
  children: e
1181
1204
  }) {
1182
- const [t, r] = V([]), [n, o] = V(null), i = G(
1205
+ const [t, r] = U([]), [n, o] = U(null), i = G(
1183
1206
  (a) => {
1184
1207
  n == null || n.setPosition(a), n == null || n.revealLineInCenterIfOutsideViewport(a.lineNumber), n == null || n.focus();
1185
1208
  },
1186
1209
  [n]
1187
1210
  );
1188
- return /* @__PURE__ */ F.jsx(
1189
- He.Provider,
1211
+ return /* @__PURE__ */ R.jsx(
1212
+ Be.Provider,
1190
1213
  {
1191
1214
  value: {
1192
1215
  markers: t,
@@ -1200,23 +1223,23 @@ function Br({
1200
1223
  );
1201
1224
  }
1202
1225
  function We() {
1203
- return Qe(He);
1226
+ return Xe(Be);
1204
1227
  }
1205
- const Dr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
1228
+ const kr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
1206
1229
  const { setMarkers: n } = We();
1207
1230
  L(() => {
1208
1231
  let o;
1209
1232
  const i = setTimeout(() => {
1210
1233
  var u;
1211
1234
  const a = (u = e.current) == null ? void 0 : u.editor;
1212
- a && (o = a.onDidChangeMarkers((l) => {
1213
- var f;
1214
- const s = (f = t.current) == null ? void 0 : f.getModel();
1215
- 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)
1216
1239
  return;
1217
- const h = s.uri.toString();
1218
- if (l.some((m) => m.toString() === h)) {
1219
- const m = z.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 });
1220
1243
  n(m);
1221
1244
  }
1222
1245
  }));
@@ -1226,14 +1249,14 @@ const Dr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
1226
1249
  };
1227
1250
  }, [e, r, n]);
1228
1251
  };
1229
- function Nr(e) {
1252
+ function Ar(e) {
1230
1253
  var n, o;
1231
1254
  const t = ((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? [], r = t.findIndex((i) => i.fileMatch[0] === e.fileMatch[0]);
1232
1255
  r !== -1 ? t[r] = e : t.push(e), Ke(t);
1233
1256
  }
1234
- function Tr(e) {
1257
+ function Vr(e) {
1235
1258
  var n, o;
1236
- const r = (((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== Me(e));
1259
+ const r = (((o = (n = be) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== Se(e));
1237
1260
  Ke(r);
1238
1261
  }
1239
1262
  function Ke(e) {
@@ -1246,23 +1269,23 @@ function Ke(e) {
1246
1269
  };
1247
1270
  be.setDiagnosticsOptions({ ...t });
1248
1271
  }
1249
- const Me = (e) => Xe.parse(`file://${e}`).toString(), kr = (e) => {
1272
+ const Se = (e) => et.parse(`file://${e}`).toString(), _r = (e) => {
1250
1273
  const { schemaConfig: t, instanceId: r } = e;
1251
1274
  L(() => {
1252
1275
  if (t != null && t.schema)
1253
- return Nr({
1254
- fileMatch: [Me(r.toString())],
1276
+ return Ar({
1277
+ fileMatch: [Se(r.toString())],
1255
1278
  ...t
1256
1279
  }), () => {
1257
- Tr(r);
1280
+ Vr(r);
1258
1281
  };
1259
1282
  }, [t == null ? void 0 : t.schema, r]);
1260
1283
  };
1261
1284
  W.config({ monaco: z });
1262
- const Ar = {
1285
+ const Ur = {
1263
1286
  ...le,
1264
1287
  folding: !0
1265
- }, Hr = function(t) {
1288
+ }, Yr = function(t) {
1266
1289
  const {
1267
1290
  yamlRevision: r,
1268
1291
  schemaConfig: n,
@@ -1270,86 +1293,86 @@ const Ar = {
1270
1293
  themeConfig: i,
1271
1294
  onYamlRevisionChange: a,
1272
1295
  selection: u,
1273
- theme: l,
1274
- options: s,
1275
- animateOnUpdate: h = !1,
1276
- onAnimateEnd: f,
1296
+ theme: d,
1297
+ options: f,
1298
+ animateOnUpdate: v = !1,
1299
+ onAnimateEnd: s,
1277
1300
  instanceId: m
1278
- } = t, I = se(), [g] = V(m ?? `yaml-editor-${Math.random()}`), { editor: k, setEditor: C } = We(), w = O(null), v = O(), T = O({ yaml: "", revisionId: 0 }), x = O(null), M = O(null), j = G(
1279
- (P) => {
1280
- var D, c, y;
1281
- const p = P.split(`
1282
- `), N = (D = x.current) == null ? void 0 : D.getModel();
1283
- if (N) {
1284
- (c = x.current) == null || c.pushUndoStop(), N.setValue("");
1285
- let A = 0;
1286
- M.current = window.setInterval(() => {
1301
+ } = t, C = se(), [h] = U(m ?? `yaml-editor-${Math.random()}`), { editor: A, setEditor: $ } = We(), w = g(null), y = g(), D = g({ yaml: "", revisionId: 0 }), P = g(null), O = g(null), S = G(
1302
+ (E) => {
1303
+ var N, c, p;
1304
+ const x = E.split(`
1305
+ `), M = (N = P.current) == null ? void 0 : N.getModel();
1306
+ if (M) {
1307
+ (c = P.current) == null || c.pushUndoStop(), M.setValue("");
1308
+ let k = 0;
1309
+ O.current = window.setInterval(() => {
1287
1310
  var q;
1288
- A < p.length ? (I && ((q = x.current) == null || q.executeEdits("addLine", [
1311
+ k < x.length ? (C && ((q = P.current) == null || q.executeEdits("addLine", [
1289
1312
  {
1290
- range: new I.Range(A + 1, 1, A + 1, 1),
1291
- text: p[A] + `
1313
+ range: new C.Range(k + 1, 1, k + 1, 1),
1314
+ text: x[k] + `
1292
1315
  `
1293
1316
  }
1294
- ])), A++) : M.current && (clearInterval(M.current), f == null || f());
1295
- }, 100), (y = x.current) == null || y.pushUndoStop();
1317
+ ])), k++) : O.current && (clearInterval(O.current), s == null || s());
1318
+ }, 100), (p = P.current) == null || p.pushUndoStop();
1296
1319
  }
1297
1320
  },
1298
- [I]
1321
+ [C]
1299
1322
  );
1300
1323
  L(() => () => {
1301
- M.current && clearInterval(M.current);
1324
+ O.current && clearInterval(O.current);
1302
1325
  }, []);
1303
- function E(P, p) {
1304
- x.current = P, v.current = p, P.setValue(r.yaml), C(P), setTimeout(() => {
1305
- var N;
1306
- (N = w.current) != null && N.style && (w.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");
1307
1330
  }, 50);
1308
1331
  }
1309
1332
  L(() => {
1310
- var P;
1311
- if (x.current && (!r.revisionId || r.revisionId > Number((P = T.current) == null ? void 0 : P.revisionId))) {
1312
- const p = x.current.getModel();
1313
- p && (x.current.executeEdits("edit", [
1333
+ var E;
1334
+ if (P.current && (!r.revisionId || r.revisionId > Number((E = D.current) == null ? void 0 : E.revisionId))) {
1335
+ const x = P.current.getModel();
1336
+ x && (P.current.executeEdits("edit", [
1314
1337
  {
1315
- range: p.getFullModelRange(),
1316
- text: h ? "" : r.yaml
1338
+ range: x.getFullModelRange(),
1339
+ text: v ? "" : r.yaml
1317
1340
  }
1318
- ]), h && j(r.yaml));
1341
+ ]), v && S(r.yaml));
1319
1342
  }
1320
- }, [j, r, h]), kr({ schemaConfig: n, instanceId: g }), Lr({ editorRef: x, inlineActions: o });
1321
- const { theme: R } = de({ monacoRef: v, themeConfig: i, editor: k, theme: l });
1322
- Dr({ monacoRef: v, editorRef: x, instanceId: g }), Ir({ editorRef: x, selection: u });
1323
- const S = B(() => Me(g), []), d = B(
1343
+ }, [S, r, v]), _r({ schemaConfig: n, instanceId: h }), Dr({ editorRef: P, inlineActions: o });
1344
+ const { theme: H } = de({ monacoRef: y, themeConfig: i, editor: A, theme: d });
1345
+ kr({ monacoRef: y, editorRef: P, instanceId: h }), Nr({ editorRef: P, selection: u });
1346
+ const T = F(() => Se(h), []), l = F(
1324
1347
  () => ({
1325
- ...Ar,
1326
- ...s
1348
+ ...Ur,
1349
+ ...f
1327
1350
  }),
1328
- [s]
1351
+ [f]
1329
1352
  );
1330
- return /* @__PURE__ */ F.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: w, children: /* @__PURE__ */ F.jsx(
1331
- we,
1353
+ return /* @__PURE__ */ R.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: w, children: /* @__PURE__ */ R.jsx(
1354
+ Oe,
1332
1355
  {
1333
- onChange: (P, p) => {
1334
- T.current = { yaml: P ?? "", revisionId: p.versionId }, a({ ...T.current }, p);
1356
+ onChange: (E, x) => {
1357
+ D.current = { yaml: E ?? "", revisionId: x.versionId }, a({ ...D.current }, x);
1335
1358
  },
1336
1359
  language: "yaml",
1337
- theme: R,
1338
- options: d,
1339
- path: S,
1340
- onMount: E
1360
+ theme: H,
1361
+ options: l,
1362
+ path: T,
1363
+ onMount: j
1341
1364
  }
1342
1365
  ) });
1343
1366
  };
1344
1367
  export {
1345
- zr as BlameEditor,
1346
- qr as CodeDiffEditor,
1347
- Rr as CodeEditor,
1368
+ qr as BlameEditor,
1369
+ Wr as CodeDiffEditor,
1370
+ Br as CodeEditor,
1348
1371
  ve as MonacoGlobals,
1349
- Re as SelectorType,
1350
- Hr as YamlEditor,
1351
- He as YamlEditorContext,
1352
- Br as YamlEditorContextProvider,
1372
+ ze as SelectorType,
1373
+ Yr as YamlEditor,
1374
+ Be as YamlEditorContext,
1375
+ Kr as YamlEditorContextProvider,
1353
1376
  We as useYamlEditorContext
1354
1377
  };
1355
1378
  //# sourceMappingURL=index.js.map