@harnessio/yaml-editor 0.18.0 → 0.19.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,17 +1,17 @@
1
- var Ye = Object.defineProperty;
2
- var Ze = (e, t, r) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var Se = (e, t, r) => (Ze(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import W, { memo as ye, useState as A, useRef as y, useCallback as G, useEffect as $, useMemo as q, createContext as Ge, useContext as Je } from "react";
5
- import * as F from "monaco-editor";
6
- import { languages as he, Uri as Qe } from "monaco-editor";
7
- import { yamlDefaults as Xe } from "monaco-yaml";
1
+ var Ze = Object.defineProperty;
2
+ var Ge = (e, t, r) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var je = (e, t, r) => (Ge(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import K, { memo as ye, useState as V, useRef as O, useCallback as G, useEffect as L, useMemo as B, createContext as Je, useContext as Qe } from "react";
5
+ import * as z from "monaco-editor";
6
+ import { languages as ge, Uri as Xe } from "monaco-editor";
7
+ import { yamlDefaults as be } from "monaco-yaml";
8
8
  var Ne = { exports: {} }, ne = {};
9
9
  /*
10
10
  object-assign
11
11
  (c) Sindre Sorhus
12
12
  @license MIT
13
13
  */
14
- var Me = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
14
+ var Ee = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
15
15
  function rt(e) {
16
16
  if (e == null)
17
17
  throw new TypeError("Object.assign cannot be called with null or undefined");
@@ -26,14 +26,14 @@ function nt() {
26
26
  return !1;
27
27
  for (var t = {}, r = 0; r < 10; r++)
28
28
  t["_" + String.fromCharCode(r)] = r;
29
- var n = Object.getOwnPropertyNames(t).map(function(a) {
30
- return t[a];
29
+ var n = Object.getOwnPropertyNames(t).map(function(i) {
30
+ return t[i];
31
31
  });
32
32
  if (n.join("") !== "0123456789")
33
33
  return !1;
34
34
  var o = {};
35
- return "abcdefghijklmnopqrst".split("").forEach(function(a) {
36
- o[a] = a;
35
+ return "abcdefghijklmnopqrst".split("").forEach(function(i) {
36
+ o[i] = i;
37
37
  }), Object.keys(Object.assign({}, o)).join("") === "abcdefghijklmnopqrst";
38
38
  } catch {
39
39
  return !1;
@@ -48,27 +48,27 @@ 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 = W, De = 60103;
51
+ var ot = K, Te = 60103;
52
52
  ne.Fragment = 60107;
53
53
  if (typeof Symbol == "function" && Symbol.for) {
54
- var je = Symbol.for;
55
- De = je("react.element"), ne.Fragment = je("react.fragment");
54
+ var Pe = Symbol.for;
55
+ Te = Pe("react.element"), ne.Fragment = Pe("react.fragment");
56
56
  }
57
- var at = ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, it = Object.prototype.hasOwnProperty, ct = { key: !0, ref: !0, __self: !0, __source: !0 };
58
- function Te(e, t, r) {
59
- var n, o = {}, a = null, i = null;
60
- r !== void 0 && (a = "" + r), t.key !== void 0 && (a = "" + t.key), t.ref !== void 0 && (i = t.ref);
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 };
58
+ function ke(e, t, r) {
59
+ var n, o = {}, i = null, a = null;
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
- it.call(t, n) && !ct.hasOwnProperty(n) && (o[n] = t[n]);
62
+ at.call(t, n) && !ct.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: De, type: e, key: a, ref: i, props: o, _owner: at.current };
66
+ return { $$typeof: Te, type: e, key: i, ref: a, props: o, _owner: it.current };
67
67
  }
68
- ne.jsx = Te;
69
- ne.jsxs = Te;
68
+ ne.jsx = ke;
69
+ ne.jsxs = ke;
70
70
  Ne.exports = ne;
71
- var U = Ne.exports;
71
+ var F = Ne.exports;
72
72
  function ut(e, t, r) {
73
73
  return t in e ? Object.defineProperty(e, t, {
74
74
  value: r,
@@ -77,7 +77,7 @@ function ut(e, t, r) {
77
77
  writable: !0
78
78
  }) : e[t] = r, e;
79
79
  }
80
- function Ee(e, t) {
80
+ function xe(e, t) {
81
81
  var r = Object.keys(e);
82
82
  if (Object.getOwnPropertySymbols) {
83
83
  var n = Object.getOwnPropertySymbols(e);
@@ -87,12 +87,12 @@ function Ee(e, t) {
87
87
  }
88
88
  return r;
89
89
  }
90
- function Pe(e) {
90
+ function Ce(e) {
91
91
  for (var t = 1; t < arguments.length; t++) {
92
92
  var r = arguments[t] != null ? arguments[t] : {};
93
- t % 2 ? Ee(Object(r), !0).forEach(function(n) {
93
+ t % 2 ? xe(Object(r), !0).forEach(function(n) {
94
94
  ut(e, n, r[n]);
95
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach(function(n) {
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
  }
@@ -101,9 +101,9 @@ function Pe(e) {
101
101
  function st(e, t) {
102
102
  if (e == null)
103
103
  return {};
104
- var r = {}, n = Object.keys(e), o, a;
105
- for (a = 0; a < n.length; a++)
106
- o = n[a], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
104
+ var r = {}, n = Object.keys(e), o, i;
105
+ for (i = 0; i < n.length; i++)
106
+ o = n[i], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
107
107
  return r;
108
108
  }
109
109
  function lt(e, t) {
@@ -111,14 +111,14 @@ function lt(e, t) {
111
111
  return {};
112
112
  var r = st(e, t), n, o;
113
113
  if (Object.getOwnPropertySymbols) {
114
- var a = Object.getOwnPropertySymbols(e);
115
- for (o = 0; o < a.length; o++)
116
- n = a[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
114
+ var i = Object.getOwnPropertySymbols(e);
115
+ for (o = 0; o < i.length; o++)
116
+ n = i[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
117
117
  }
118
118
  return r;
119
119
  }
120
120
  function dt(e, t) {
121
- return ft(e) || pt(e, t) || gt(e, t) || mt();
121
+ return ft(e) || pt(e, t) || mt(e, t) || ht();
122
122
  }
123
123
  function ft(e) {
124
124
  if (Array.isArray(e))
@@ -126,45 +126,45 @@ function ft(e) {
126
126
  }
127
127
  function pt(e, t) {
128
128
  if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
129
- var r = [], n = !0, o = !1, a = void 0;
129
+ var r = [], n = !0, o = !1, i = void 0;
130
130
  try {
131
- for (var i = e[Symbol.iterator](), s; !(n = (s = i.next()).done) && (r.push(s.value), !(t && r.length === t)); n = !0)
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
133
  } catch (l) {
134
- o = !0, a = l;
134
+ o = !0, i = l;
135
135
  } finally {
136
136
  try {
137
- !n && i.return != null && i.return();
137
+ !n && a.return != null && a.return();
138
138
  } finally {
139
139
  if (o)
140
- throw a;
140
+ throw i;
141
141
  }
142
142
  }
143
143
  return r;
144
144
  }
145
145
  }
146
- function gt(e, t) {
146
+ function mt(e, t) {
147
147
  if (e) {
148
148
  if (typeof e == "string")
149
- return Ce(e, t);
149
+ return $e(e, t);
150
150
  var r = Object.prototype.toString.call(e).slice(8, -1);
151
151
  if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set")
152
152
  return Array.from(e);
153
153
  if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
154
- return Ce(e, t);
154
+ return $e(e, t);
155
155
  }
156
156
  }
157
- function Ce(e, t) {
157
+ function $e(e, t) {
158
158
  (t == null || t > e.length) && (t = e.length);
159
159
  for (var r = 0, n = new Array(t); r < t; r++)
160
160
  n[r] = e[r];
161
161
  return n;
162
162
  }
163
- function mt() {
163
+ function ht() {
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 ht(e, t, r) {
167
+ function gt(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 ht(e, t, r) {
172
172
  writable: !0
173
173
  }) : e[t] = r, e;
174
174
  }
175
- function xe(e, t) {
175
+ function Le(e, t) {
176
176
  var r = Object.keys(e);
177
177
  if (Object.getOwnPropertySymbols) {
178
178
  var n = Object.getOwnPropertySymbols(e);
@@ -182,12 +182,12 @@ function xe(e, t) {
182
182
  }
183
183
  return r;
184
184
  }
185
- function $e(e) {
185
+ function Ie(e) {
186
186
  for (var t = 1; t < arguments.length; t++) {
187
187
  var r = arguments[t] != null ? arguments[t] : {};
188
- t % 2 ? xe(Object(r), !0).forEach(function(n) {
189
- ht(e, n, r[n]);
190
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
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) {
191
191
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
192
192
  });
193
193
  }
@@ -197,19 +197,19 @@ function vt() {
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) {
200
- return t.reduceRight(function(o, a) {
201
- return a(o);
200
+ return t.reduceRight(function(o, i) {
201
+ return i(o);
202
202
  }, n);
203
203
  };
204
204
  }
205
205
  function X(e) {
206
206
  return function t() {
207
- for (var r = this, n = arguments.length, o = new Array(n), a = 0; a < n; a++)
208
- o[a] = arguments[a];
207
+ for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
208
+ o[i] = arguments[i];
209
209
  return o.length >= e.length ? e.apply(this, o) : function() {
210
- for (var i = arguments.length, s = new Array(i), l = 0; l < i; l++)
211
- s[l] = arguments[l];
212
- return t.apply(r, [].concat(o, s));
210
+ for (var a = arguments.length, u = new Array(a), l = 0; l < a; l++)
211
+ u[l] = arguments[l];
212
+ return t.apply(r, [].concat(o, u));
213
213
  };
214
214
  };
215
215
  }
@@ -225,21 +225,21 @@ function re(e) {
225
225
  function bt(e, t) {
226
226
  return Object.prototype.hasOwnProperty.call(e, t);
227
227
  }
228
- function wt(e, t) {
229
- return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
228
+ function Ot(e, t) {
229
+ return ce(t) || H("changeType"), Object.keys(t).some(function(r) {
230
230
  return !bt(e, r);
231
- }) && B("changeField"), t;
231
+ }) && H("changeField"), t;
232
232
  }
233
- function Ot(e) {
234
- re(e) || B("selectorType");
233
+ function wt(e) {
234
+ re(e) || H("selectorType");
235
235
  }
236
236
  function St(e) {
237
- re(e) || ce(e) || B("handlerType"), ce(e) && Object.values(e).some(function(t) {
237
+ re(e) || ce(e) || H("handlerType"), ce(e) && Object.values(e).some(function(t) {
238
238
  return !re(t);
239
- }) && B("handlersType");
239
+ }) && H("handlersType");
240
240
  }
241
241
  function Mt(e) {
242
- e || B("initialIsRequired"), ce(e) || B("initialType"), yt(e) && B("initialContent");
242
+ e || H("initialIsRequired"), ce(e) || H("initialType"), yt(e) && H("initialContent");
243
243
  }
244
244
  function jt(e, t) {
245
245
  throw new Error(e[t] || e.default);
@@ -254,34 +254,34 @@ 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), ae = {
258
- changes: wt,
259
- selector: Ot,
257
+ }, H = X(jt)(Et), ie = {
258
+ changes: Ot,
259
+ selector: wt,
260
260
  handler: St,
261
261
  initial: Mt
262
262
  };
263
263
  function Pt(e) {
264
264
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
265
- ae.initial(e), ae.handler(t);
265
+ ie.initial(e), ie.handler(t);
266
266
  var r = {
267
267
  current: e
268
- }, n = X($t)(r, t), o = X(xt)(r), a = X(ae.changes)(e), i = X(Ct)(r);
269
- function s() {
270
- var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(b) {
271
- return b;
268
+ }, n = X($t)(r, t), o = X(Ct)(r), i = X(ie.changes)(e), a = X(xt)(r);
269
+ function u() {
270
+ var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(h) {
271
+ return h;
272
272
  };
273
- return ae.selector(f), f(r.current);
273
+ return ie.selector(s), s(r.current);
274
274
  }
275
- function l(f) {
276
- vt(n, o, a, i)(f);
275
+ function l(s) {
276
+ vt(n, o, i, a)(s);
277
277
  }
278
- return [s, l];
278
+ return [u, l];
279
279
  }
280
- function Ct(e, t) {
280
+ function xt(e, t) {
281
281
  return re(t) ? t(e.current) : t;
282
282
  }
283
- function xt(e, t) {
284
- return e.current = $e($e({}, e.current), t), t;
283
+ function Ct(e, t) {
284
+ return e.current = Ie(Ie({}, e.current), t), t;
285
285
  }
286
286
  function $t(e, t, r) {
287
287
  return re(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
@@ -296,34 +296,34 @@ var Lt = {
296
296
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
297
297
  }
298
298
  };
299
- function Nt(e) {
299
+ function Dt(e) {
300
300
  return function t() {
301
- for (var r = this, n = arguments.length, o = new Array(n), a = 0; a < n; a++)
302
- o[a] = arguments[a];
301
+ for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
302
+ o[i] = arguments[i];
303
303
  return o.length >= e.length ? e.apply(this, o) : function() {
304
- for (var i = arguments.length, s = new Array(i), l = 0; l < i; l++)
305
- s[l] = arguments[l];
306
- return t.apply(r, [].concat(o, s));
304
+ for (var a = arguments.length, u = new Array(a), l = 0; l < a; l++)
305
+ u[l] = arguments[l];
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
313
  function Tt(e) {
314
- return e || Le("configIsRequired"), Dt(e) || Le("configType"), e.urls ? (kt(), {
314
+ return e || De("configIsRequired"), Nt(e) || De("configType"), e.urls ? (kt(), {
315
315
  paths: {
316
316
  vs: e.urls.monacoBase
317
317
  }
318
318
  }) : e;
319
319
  }
320
320
  function kt() {
321
- console.warn(ke.deprecation);
321
+ console.warn(Ae.deprecation);
322
322
  }
323
323
  function At(e, t) {
324
324
  throw new Error(e[t] || e.default);
325
325
  }
326
- var ke = {
326
+ var Ae = {
327
327
  configIsRequired: "the configuration object is required",
328
328
  configType: "the configuration object should be an object",
329
329
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -337,21 +337,21 @@ var ke = {
337
337
 
338
338
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
339
339
  `
340
- }, Le = Nt(At)(ke), Vt = {
340
+ }, De = Dt(At)(Ae), Vt = {
341
341
  config: Tt
342
342
  }, _t = 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) {
346
- return r.reduceRight(function(a, i) {
347
- return i(a);
346
+ return r.reduceRight(function(i, a) {
347
+ return a(i);
348
348
  }, o);
349
349
  };
350
350
  };
351
- function Ae(e, t) {
351
+ function Ve(e, t) {
352
352
  return Object.keys(t).forEach(function(r) {
353
- t[r] instanceof Object && e[r] && Object.assign(t[r], Ae(e[r], t[r]));
354
- }), Pe(Pe({}, e), t);
353
+ t[r] instanceof Object && e[r] && Object.assign(t[r], Ve(e[r], t[r]));
354
+ }), Ce(Ce({}, e), t);
355
355
  }
356
356
  var Ut = {
357
357
  type: "cancelation",
@@ -359,26 +359,26 @@ var Ut = {
359
359
  };
360
360
  function fe(e) {
361
361
  var t = !1, r = new Promise(function(n, o) {
362
- e.then(function(a) {
363
- return t ? o(Ut) : n(a);
362
+ e.then(function(i) {
363
+ return t ? o(Ut) : 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 zt = Lt.create({
370
+ var Ft = Lt.create({
371
371
  config: It,
372
372
  isInitialized: !1,
373
373
  resolve: null,
374
374
  reject: null,
375
375
  monaco: null
376
- }), Ve = dt(zt, 2), oe = Ve[0], ue = Ve[1];
377
- function Ft(e) {
376
+ }), _e = dt(Ft, 2), oe = _e[0], ue = _e[1];
377
+ function zt(e) {
378
378
  var t = Vt.config(e), r = t.monaco, n = lt(t, ["monaco"]);
379
379
  ue(function(o) {
380
380
  return {
381
- config: Ae(o.config, n),
381
+ config: Ve(o.config, n),
382
382
  monaco: r
383
383
  };
384
384
  });
@@ -398,7 +398,7 @@ function Rt() {
398
398
  }), e.monaco)
399
399
  return e.resolve(e.monaco), fe(pe);
400
400
  if (window.monaco && window.monaco.editor)
401
- return _e(window.monaco), e.resolve(window.monaco), fe(pe);
401
+ return Ue(window.monaco), e.resolve(window.monaco), fe(pe);
402
402
  _t(qt, Ht)(Wt);
403
403
  }
404
404
  return fe(pe);
@@ -412,10 +412,10 @@ function Bt(e) {
412
412
  }
413
413
  function Ht(e) {
414
414
  var t = oe(function(n) {
415
- var o = n.config, a = n.reject;
415
+ var o = n.config, i = n.reject;
416
416
  return {
417
417
  config: o,
418
- reject: a
418
+ reject: i
419
419
  };
420
420
  }), r = Bt("".concat(t.config.paths.vs, "/loader.js"));
421
421
  return r.onload = function() {
@@ -424,20 +424,20 @@ function Ht(e) {
424
424
  }
425
425
  function Wt() {
426
426
  var e = oe(function(r) {
427
- var n = r.config, o = r.resolve, a = r.reject;
427
+ var n = r.config, o = r.resolve, i = r.reject;
428
428
  return {
429
429
  config: n,
430
430
  resolve: o,
431
- reject: a
431
+ reject: i
432
432
  };
433
433
  }), t = window.require;
434
434
  t.config(e.config), t(["vs/editor/editor.main"], function(r) {
435
- _e(r), e.resolve(r);
435
+ Ue(r), e.resolve(r);
436
436
  }, function(r) {
437
437
  e.reject(r);
438
438
  });
439
439
  }
440
- function _e(e) {
440
+ function Ue(e) {
441
441
  oe().monaco || ue({
442
442
  monaco: e
443
443
  });
@@ -453,182 +453,182 @@ var pe = new Promise(function(e, t) {
453
453
  resolve: e,
454
454
  reject: t
455
455
  });
456
- }), H = {
457
- config: Ft,
456
+ }), W = {
457
+ config: zt,
458
458
  init: Rt,
459
459
  __getMonacoInstance: Kt
460
- }, Yt = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, ge = Yt, Zt = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Gt = Zt;
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
461
  function Jt({ children: e }) {
462
- return W.createElement("div", { style: Gt.container }, e);
462
+ return K.createElement("div", { style: Gt.container }, e);
463
463
  }
464
464
  var Qt = Jt, Xt = Qt;
465
- function er({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: a, wrapperProps: i }) {
466
- return W.createElement("section", { style: { ...ge.wrapper, width: e, height: t }, ...i }, !r && W.createElement(Xt, null, n), W.createElement("div", { ref: o, style: { ...ge.fullWidth, ...!r && ge.hide }, className: a }));
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
467
  }
468
- var tr = er, Ue = ye(tr);
468
+ var tr = er, Fe = ye(tr);
469
469
  function rr(e) {
470
- $(e, []);
470
+ L(e, []);
471
471
  }
472
- var be = rr;
472
+ var Oe = rr;
473
473
  function nr(e, t, r = !0) {
474
- let n = y(!0);
475
- $(n.current || !r ? () => {
474
+ let n = O(!0);
475
+ L(n.current || !r ? () => {
476
476
  n.current = !1;
477
477
  } : e, t);
478
478
  }
479
- var _ = nr;
479
+ var U = nr;
480
480
  function ee() {
481
481
  }
482
482
  function Z(e, t, r, n) {
483
- return or(e, n) || ar(e, t, r, n);
483
+ return or(e, n) || ir(e, t, r, n);
484
484
  }
485
485
  function or(e, t) {
486
486
  return e.editor.getModel(ze(e, t));
487
487
  }
488
- function ar(e, t, r, n) {
488
+ function ir(e, t, r, n) {
489
489
  return e.editor.createModel(t, r, n ? ze(e, n) : void 0);
490
490
  }
491
491
  function ze(e, t) {
492
492
  return e.Uri.parse(t);
493
493
  }
494
- function ir({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: a, modifiedModelPath: i, keepCurrentOriginalModel: s = !1, keepCurrentModifiedModel: l = !1, theme: f = "light", loading: b = "Loading...", options: p = {}, height: g = "100%", width: I = "100%", className: w, wrapperProps: k = {}, beforeMount: M = ee, onMount: O = ee }) {
495
- let [m, j] = A(!1), [D, E] = A(!0), P = y(null), S = y(null), z = y(null), d = y(O), u = y(M), N = y(!1);
496
- be(() => {
497
- let c = H.init();
498
- return c.then((h) => (S.current = h) && E(!1)).catch((h) => (h == null ? void 0 : h.type) !== "cancelation" && console.error("Monaco initialization: error:", h)), () => P.current ? L() : c.cancel();
499
- }), _(() => {
500
- if (P.current && S.current) {
501
- let c = P.current.getOriginalEditor(), h = Z(S.current, e || "", n || r || "text", a || "");
502
- h !== c.getModel() && c.setModel(h);
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(() => {
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);
503
503
  }
504
- }, [a], m), _(() => {
505
- if (P.current && S.current) {
506
- let c = P.current.getModifiedEditor(), h = Z(S.current, t || "", o || r || "text", i || "");
507
- h !== c.getModel() && c.setModel(h);
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);
508
508
  }
509
- }, [i], m), _(() => {
510
- let c = P.current.getModifiedEditor();
511
- c.getOption(S.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
512
- }, [t], m), _(() => {
513
- var c, h;
514
- (h = (c = P.current) == null ? void 0 : c.getModel()) == null || h.original.setValue(e || "");
515
- }, [e], m), _(() => {
516
- let { original: c, modified: h } = P.current.getModel();
517
- S.current.editor.setModelLanguage(c, n || r || "text"), S.current.editor.setModelLanguage(h, o || r || "text");
518
- }, [r, n, o], m), _(() => {
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(() => {
519
519
  var c;
520
- (c = S.current) == null || c.editor.setTheme(f);
521
- }, [f], m), _(() => {
520
+ (c = E.current) == null || c.editor.setTheme(s);
521
+ }, [s], v), U(() => {
522
522
  var c;
523
- (c = P.current) == null || c.updateOptions(p);
524
- }, [p], m);
525
- let C = G(() => {
526
- var R;
527
- if (!S.current)
523
+ (c = j.current) == null || c.updateOptions(f);
524
+ }, [f], v);
525
+ let p = G(() => {
526
+ var A;
527
+ if (!E.current)
528
528
  return;
529
- u.current(S.current);
530
- let c = Z(S.current, e || "", n || r || "text", a || ""), h = Z(S.current, t || "", o || r || "text", i || "");
531
- (R = P.current) == null || R.setModel({ original: c, modified: h });
532
- }, [r, t, o, e, n, a, i]), T = G(() => {
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(() => {
533
533
  var c;
534
- !N.current && z.current && (P.current = S.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...p }), C(), (c = S.current) == null || c.editor.setTheme(f), j(!0), N.current = !0);
535
- }, [p, f, C]);
536
- $(() => {
537
- m && d.current(P.current, S.current);
538
- }, [m]), $(() => {
539
- !D && !m && T();
540
- }, [D, m, T]);
541
- function L() {
542
- var h, R, K, J;
543
- let c = (h = P.current) == null ? void 0 : h.getModel();
544
- s || ((R = c == null ? void 0 : c.original) == null || R.dispose()), l || ((K = c == null ? void 0 : c.modified) == null || K.dispose()), (J = P.current) == null || J.dispose();
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]);
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();
545
545
  }
546
- return W.createElement(Ue, { width: I, height: g, isEditorReady: m, loading: b, _ref: z, className: w, wrapperProps: k });
546
+ return K.createElement(Fe, { width: I, height: m, isEditorReady: v, loading: h, _ref: R, className: g, wrapperProps: k });
547
547
  }
548
- var cr = ir, ur = ye(cr);
548
+ var cr = ar, ur = ye(cr);
549
549
  function sr() {
550
- let [e, t] = A(H.__getMonacoInstance());
551
- return be(() => {
550
+ let [e, t] = V(W.__getMonacoInstance());
551
+ return Oe(() => {
552
552
  let r;
553
- return e || (r = H.init(), r.then((n) => {
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
558
  var se = sr;
559
559
  function lr(e) {
560
- let t = y();
561
- return $(() => {
560
+ let t = O();
561
+ return L(() => {
562
562
  t.current = e;
563
563
  }, [e]), t.current;
564
564
  }
565
- var dr = lr, ie = /* @__PURE__ */ new Map();
566
- function fr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: a, theme: i = "light", line: s, loading: l = "Loading...", options: f = {}, overrideServices: b = {}, saveViewState: p = !0, keepCurrentModel: g = !1, width: I = "100%", height: w = "100%", className: k, wrapperProps: M = {}, beforeMount: O = ee, onMount: m = ee, onChange: j, onValidate: D = ee }) {
567
- let [E, P] = A(!1), [S, z] = A(!0), d = y(null), u = y(null), N = y(null), C = y(m), T = y(O), L = y(), c = y(n), h = dr(a), R = y(!1), K = y(!1);
568
- be(() => {
569
- let v = H.init();
570
- return v.then((x) => (d.current = x) && z(!1)).catch((x) => (x == null ? void 0 : x.type) !== "cancelation" && console.error("Monaco initialization: error:", x)), () => u.current ? Ke() : v.cancel();
571
- }), _(() => {
572
- var x, V, Q, Y;
573
- let v = Z(d.current, e || n || "", t || o || "", a || r || "");
574
- v !== ((x = u.current) == null ? void 0 : x.getModel()) && (p && ie.set(h, (V = u.current) == null ? void 0 : V.saveViewState()), (Q = u.current) == null || Q.setModel(v), p && ((Y = u.current) == null || Y.restoreViewState(ie.get(a))));
575
- }, [a], E), _(() => {
576
- var v;
577
- (v = u.current) == null || v.updateOptions(f);
578
- }, [f], E), _(() => {
579
- !u.current || n === void 0 || (u.current.getOption(d.current.editor.EditorOption.readOnly) ? u.current.setValue(n) : n !== u.current.getValue() && (K.current = !0, u.current.executeEdits("", [{ range: u.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), u.current.pushUndoStop(), K.current = !1));
580
- }, [n], E), _(() => {
581
- var x, V;
582
- let v = (x = u.current) == null ? void 0 : x.getModel();
583
- v && o && ((V = d.current) == null || V.editor.setModelLanguage(v, o));
584
- }, [o], E), _(() => {
585
- var v;
586
- s !== void 0 && ((v = u.current) == null || v.revealLine(s));
587
- }, [s], E), _(() => {
588
- var v;
589
- (v = d.current) == null || v.editor.setTheme(i);
590
- }, [i], E);
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(() => {
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(() => {
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(() => {
585
+ var b;
586
+ u !== void 0 && ((b = d.current) == null || b.revealLine(u));
587
+ }, [u], M), U(() => {
588
+ var b;
589
+ (b = S.current) == null || b.editor.setTheme(a);
590
+ }, [a], M);
591
591
  let J = G(() => {
592
- var v;
593
- if (!(!N.current || !d.current) && !R.current) {
594
- T.current(d.current);
595
- let x = a || r, V = Z(d.current, n || e || "", t || o || "", x || "");
596
- u.current = (v = d.current) == null ? void 0 : v.editor.create(N.current, { model: V, automaticLayout: !0, ...f }, b), p && u.current.restoreViewState(ie.get(x)), d.current.editor.setTheme(i), s !== void 0 && u.current.revealLine(s), P(!0), R.current = !0;
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;
597
597
  }
598
- }, [e, t, r, n, o, a, f, b, p, i, s]);
599
- $(() => {
600
- E && C.current(u.current, d.current);
601
- }, [E]), $(() => {
602
- !S && !E && J();
603
- }, [S, E, J]), c.current = n, $(() => {
604
- var v, x;
605
- E && j && ((v = L.current) == null || v.dispose(), L.current = (x = u.current) == null ? void 0 : x.onDidChangeModelContent((V) => {
606
- K.current || j(u.current.getValue(), V);
598
+ }, [e, t, r, n, o, i, s, h, f, a, u]);
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(), _);
607
607
  }));
608
- }, [E, j]), $(() => {
609
- if (E) {
610
- let v = d.current.editor.onDidChangeMarkers((x) => {
608
+ }, [M, T]), L(() => {
609
+ if (M) {
610
+ let b = S.current.editor.onDidChangeMarkers(($) => {
611
611
  var Q;
612
- let V = (Q = u.current.getModel()) == null ? void 0 : Q.uri;
613
- if (V && x.find((Y) => Y.path === V.path)) {
614
- let Y = d.current.editor.getModelMarkers({ resource: V });
615
- D == null || D(Y);
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);
616
616
  }
617
617
  });
618
618
  return () => {
619
- v == null || v.dispose();
619
+ b == null || b.dispose();
620
620
  };
621
621
  }
622
622
  return () => {
623
623
  };
624
- }, [E, D]);
625
- function Ke() {
626
- var v, x;
627
- (v = L.current) == null || v.dispose(), g ? p && ie.set(a, u.current.saveViewState()) : (x = u.current.getModel()) == null || x.dispose(), u.current.dispose();
624
+ }, [M, x]);
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();
628
628
  }
629
- return W.createElement(Ue, { width: I, height: w, isEditorReady: E, loading: l, _ref: N, className: k, wrapperProps: M });
629
+ return K.createElement(Fe, { width: I, height: g, isEditorReady: M, loading: l, _ref: P, className: k, wrapperProps: C });
630
630
  }
631
- var pr = fr, gr = ye(pr), we = gr;
631
+ var pr = fr, mr = ye(pr), we = mr;
632
632
  const le = {
633
633
  selectOnLineNumbers: !0,
634
634
  scrollBeyondLastLine: !1,
@@ -637,7 +637,7 @@ const le = {
637
637
  bottom: 16
638
638
  },
639
639
  minimap: { enabled: !1 },
640
- fontSize: 13,
640
+ fontSize: 14,
641
641
  fontFamily: '"JetBrains Mono", "monospace"',
642
642
  lineHeight: 20,
643
643
  scrollbar: {
@@ -648,26 +648,27 @@ const le = {
648
648
  },
649
649
  overviewRulerBorder: !1,
650
650
  overviewRulerLanes: 0,
651
- renderLineHighlight: "none"
651
+ renderLineHighlight: "none",
652
+ automaticLayout: !0
652
653
  }, de = (e) => {
653
- const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [a, i] = A(n ?? o ?? "vs-dark");
654
- return $(() => {
655
- var s;
656
- (s = t == null ? void 0 : t.themes) == null || s.forEach((l) => {
657
- F.editor.defineTheme(l.themeName, l.themeData);
654
+ const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = V(n ?? o ?? "vs-dark");
655
+ return L(() => {
656
+ var u;
657
+ (u = t == null ? void 0 : t.themes) == null || u.forEach((l) => {
658
+ z.editor.defineTheme(l.themeName, l.themeData);
658
659
  });
659
- }, [F]), $(() => {
660
- F.editor && n && (F.editor.setTheme(n), i(n));
661
- }, [r, n]), { theme: a };
660
+ }, [z]), L(() => {
661
+ z.editor && n && (z.editor.setTheme(n), a(n));
662
+ }, [r, n]), { theme: i };
662
663
  };
663
- function mr(e) {
664
+ function hr(e) {
664
665
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
665
666
  let r = "";
666
667
  for (let n = 0; n < e; n++)
667
668
  r += t.charAt(Math.floor(Math.random() * t.length));
668
669
  return r;
669
670
  }
670
- function hr(e) {
671
+ function gr(e) {
671
672
  return e.replace("'", "&#39;");
672
673
  }
673
674
  function vr({
@@ -710,21 +711,21 @@ function yr({
710
711
  avatarSize: n
711
712
  }) {
712
713
  let o = "";
713
- return t.forEach((a) => {
714
- var f, b, p, g, I, w, k, M;
715
- const i = (b = (f = a == null ? void 0 : a.commitInfo) == null ? void 0 : f.author) == null ? void 0 : b.avatarUrl, s = (g = (p = a == null ? void 0 : a.commitInfo) == null ? void 0 : p.author) == null ? void 0 : g.initials, l = i ? `background: url('${(w = (I = a == null ? void 0 : a.commitInfo) == null ? void 0 : I.author) == null ? void 0 : w.avatarUrl}');` : "";
716
- for (let O = a.fromLineNumber; O <= a.toLineNumber; O++)
717
- O === a.fromLineNumber ? o += `
718
- .monaco-editor-${e} .view-line .blame-editor-commit-${O}:before {
719
- content: '${hr(((M = (k = a == null ? void 0 : a.commitInfo) == null ? void 0 : k.author) == null ? void 0 : M.when) || "")}';
714
+ 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}');` : "";
717
+ for (let w = i.fromLineNumber; w <= i.toLineNumber; w++)
718
+ w === i.fromLineNumber ? o += `
719
+ .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) || "")}';
720
721
  position: absolute;
721
722
  left: 10px;
722
723
  top: 0px;
723
724
  color: hsl(var(--canary-foreground-03));
724
725
  }
725
726
 
726
- .monaco-editor-${e} .view-line .blame-editor-commit-${O}:after {
727
- content: '${s ?? " "}';
727
+ .monaco-editor-${e} .view-line .blame-editor-commit-${w}:after {
728
+ content: '${u ?? " "}';
728
729
  position: absolute;
729
730
  border-radius: 50%;
730
731
  padding: 4px;
@@ -739,7 +740,7 @@ function yr({
739
740
  ${l}
740
741
  background-size: 100% 100%;
741
742
  }` : o += `
742
- .monaco-editor-${e} .view-line .blame-editor-commit-${O}:before {
743
+ .monaco-editor-${e} .view-line .blame-editor-commit-${w}:before {
743
744
  content: ' ';
744
745
  left: 10px;
745
746
  top: 0px;
@@ -751,8 +752,8 @@ function br(e, t) {
751
752
  let r = "";
752
753
  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);
753
754
  }
754
- H.config({ monaco: F });
755
- const me = 450, wr = 30, Or = 140, Sr = 24, Mr = {
755
+ W.config({ monaco: z });
756
+ const he = 450, Or = 30, wr = 140, Sr = 24, Mr = {
756
757
  ...le,
757
758
  readOnly: !0,
758
759
  matchBrackets: "never",
@@ -769,162 +770,162 @@ function zr({
769
770
  themeConfig: r,
770
771
  lineNumbersPosition: n = "left",
771
772
  blameData: o,
772
- showSeparators: a = !0,
773
- theme: i,
774
- height: s = "75vh",
773
+ showSeparators: i = !0,
774
+ theme: a,
775
+ height: u = "75vh",
775
776
  options: l
776
777
  }) {
777
- const f = y(o), b = y(mr(5));
778
+ const s = O(o), h = O(hr(5));
778
779
  se();
779
- const [p, g] = A(), [I, w] = A(0), k = y(null), M = y(null);
780
- $(() => {
781
- f.current = o;
780
+ const [f, m] = V(), [I, g] = V(0), k = O(null), C = O(null);
781
+ L(() => {
782
+ s.current = o;
782
783
  }, [o]);
783
- function O() {
784
- const d = M.current, u = k.current;
785
- if (!d || !u)
784
+ function w() {
785
+ const S = C.current, d = k.current;
786
+ if (!S || !d)
786
787
  return;
787
- a && d.changeViewZones(function(C) {
788
- C.addZone({
788
+ i && S.changeViewZones(function(p) {
789
+ p.addZone({
789
790
  afterLineNumber: 0,
790
791
  heightInPx: 10,
791
792
  domNode: document.createElement("div")
792
- }), f.current.forEach((T, L) => {
793
- if (L !== f.current.length - 1) {
793
+ }), s.current.forEach((N, D) => {
794
+ if (D !== s.current.length - 1) {
794
795
  const c = document.createElement("div");
795
- c.style.borderTop = "1px solid hsl(var(--canary-border-01))", c.style.marginTop = "9px", c.className = "blame-editor-separator", C.addZone({
796
- afterLineNumber: T.toLineNumber,
796
+ c.style.borderTop = "1px solid hsl(var(--canary-border-01))", c.style.marginTop = "9px", c.className = "blame-editor-separator", p.addZone({
797
+ afterLineNumber: N.toLineNumber,
797
798
  heightInPx: 20,
798
799
  domNode: c
799
800
  });
800
801
  }
801
802
  });
802
803
  });
803
- const N = [];
804
- f.current.forEach((C) => {
805
- var T;
806
- for (let L = C.fromLineNumber; L <= C.toLineNumber; L++)
807
- N.push({
808
- range: new u.Range(L, 0, L + 1, 0),
804
+ const P = [];
805
+ s.current.forEach((p) => {
806
+ 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),
809
810
  options: {
810
811
  before: {
811
812
  content: br(
812
- L === C.fromLineNumber && ((T = C == null ? void 0 : C.commitInfo) == null ? void 0 : T.title) || "",
813
- wr
813
+ D === p.fromLineNumber && ((N = p == null ? void 0 : p.commitInfo) == null ? void 0 : N.title) || "",
814
+ Or
814
815
  ),
815
- cursorStops: u.editor.InjectedTextCursorStops.None,
816
- inlineClassName: `blame-editor-commit blame-editor-commit-${L}`
816
+ cursorStops: d.editor.InjectedTextCursorStops.None,
817
+ inlineClassName: `blame-editor-commit blame-editor-commit-${D}`
817
818
  }
818
819
  }
819
820
  });
820
- }), d.createDecorationsCollection(N);
821
+ }), S.createDecorationsCollection(P);
821
822
  }
822
- function m(d, u) {
823
- var N, C, T, L, c, h;
824
- M.current = d, k.current = u, d.setValue(e), g(d), (T = (C = (N = u.languages.typescript) == null ? void 0 : N.typescriptDefaults) == null ? void 0 : C.setDiagnosticsOptions) == null || T.call(C, {
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, {
825
826
  noSuggestionDiagnostics: !0,
826
827
  noSyntaxValidation: !0,
827
828
  noSemanticValidation: !0
828
- }), (h = (c = (L = u.languages.typescript) == null ? void 0 : L.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || h.call(c, {
829
+ }), (y = (c = (D = d.languages.typescript) == null ? void 0 : D.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || y.call(c, {
829
830
  noSuggestionDiagnostics: !0,
830
831
  noSyntaxValidation: !0,
831
832
  noSemanticValidation: !0
832
- }), O();
833
+ }), w();
833
834
  }
834
- $(() => {
835
- p == null || p.setValue(e);
835
+ L(() => {
836
+ f == null || f.setValue(e);
836
837
  }, [e]);
837
- const { theme: j } = de({ monacoRef: k, themeConfig: r, editor: p, theme: i }), D = q(
838
+ const { theme: T } = de({ monacoRef: k, themeConfig: r, editor: f, theme: a }), x = B(
838
839
  () => vr({
839
- instanceId: b.current,
840
+ instanceId: h.current,
840
841
  lineNumbersPosition: n
841
842
  }),
842
843
  [o]
843
- ), E = q(
844
+ ), M = B(
844
845
  () => yr({
845
- instanceId: b.current,
846
+ instanceId: h.current,
846
847
  blameData: o,
847
848
  avatarSize: Sr,
848
- dateWidth: Or
849
+ dateWidth: wr
849
850
  }),
850
851
  [o]
851
852
  );
852
- $(() => {
853
+ L(() => {
853
854
  if (n === "center") {
854
- const d = document.getElementsByClassName("lines-content")[0];
855
- if (d) {
856
- const u = { attributes: !0 }, N = (T) => {
857
- for (const L of T) {
858
- const c = parseInt(getComputedStyle(d).left);
859
- w(c);
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);
860
861
  }
861
- }, C = new MutationObserver(N);
862
- return C.observe(d, u), () => {
863
- C.disconnect();
862
+ }, p = new MutationObserver(P);
863
+ return p.observe(S, d), () => {
864
+ p.disconnect();
864
865
  };
865
866
  }
866
867
  }
867
868
  });
868
- const P = q(() => `
869
- .monaco-editor-${b.current} .margin {
870
- left: ${me + 16 + I}px !important;
869
+ const j = B(() => `
870
+ .monaco-editor-${h.current} .margin {
871
+ left: ${he + 16 + I}px !important;
871
872
  pointer-events: none;
872
- }`, [I]), S = `
873
- .monaco-editor-${b.current} .view-overlays {
874
- clip-path: polygon(${me + 16}px 0, 100% 0%, 100% 100%, ${me + 16}px 100%);
873
+ }`, [I]), E = `
874
+ .monaco-editor-${h.current} .view-overlays {
875
+ clip-path: polygon(${he + 16}px 0, 100% 0%, 100% 100%, ${he + 16}px 100%);
875
876
  height:100% !important;
876
- }`, z = q(
877
+ }`, R = B(
877
878
  () => ({
878
879
  ...Mr,
879
880
  ...l
880
881
  }),
881
882
  [l]
882
883
  );
883
- return /* @__PURE__ */ U.jsxs(U.Fragment, { children: [
884
- /* @__PURE__ */ U.jsx(
884
+ return /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
885
+ /* @__PURE__ */ F.jsx(
885
886
  "style",
886
887
  {
887
888
  dangerouslySetInnerHTML: {
888
- __html: `${D} ${E} ${P} ${S}`
889
+ __html: `${x} ${M} ${j} ${E}`
889
890
  }
890
891
  }
891
892
  ),
892
- /* @__PURE__ */ U.jsx(
893
+ /* @__PURE__ */ F.jsx(
893
894
  we,
894
895
  {
895
- className: `monaco-editor-${b.current} overflow-hidden rounded-b-md border-x border-b`,
896
- height: s,
896
+ className: `monaco-editor-${h.current} overflow-hidden rounded-b-md border-x border-b`,
897
+ height: u,
897
898
  language: t,
898
- theme: j,
899
- options: z,
900
- onMount: m
899
+ theme: T,
900
+ options: R,
901
+ onMount: v
901
902
  }
902
903
  )
903
904
  ] });
904
905
  }
905
- H.config({ monaco: F });
906
+ W.config({ monaco: z });
906
907
  const jr = {
907
908
  ...le
908
909
  };
909
- function Fr({
910
+ function Rr({
910
911
  codeRevision: e,
911
912
  onCodeRevisionChange: t,
912
913
  language: r,
913
914
  themeConfig: n,
914
915
  options: o,
915
- theme: a,
916
- height: i = "75vh",
917
- className: s
916
+ theme: i,
917
+ height: a = "75vh",
918
+ className: u
918
919
  }) {
919
920
  se();
920
- const [l, f] = A(), b = y(), p = y({ code: "", revisionId: 0 }), g = y(null), I = G(
921
- (M, O) => {
922
- var m, j, D, E, P, S;
923
- g.current = M, b.current = O, M.setValue(e.code), f(M), (D = (j = (m = O.languages.typescript) == null ? void 0 : m.typescriptDefaults) == null ? void 0 : j.setDiagnosticsOptions) == null || D.call(j, {
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, {
924
925
  noSuggestionDiagnostics: !0,
925
926
  noSyntaxValidation: !0,
926
927
  noSemanticValidation: !0
927
- }), (S = (P = (E = O.languages.typescript) == null ? void 0 : E.javascriptDefaults) == null ? void 0 : P.setDiagnosticsOptions) == null || S.call(P, {
928
+ }), (E = (j = (M = w.languages.typescript) == null ? void 0 : M.javascriptDefaults) == null ? void 0 : j.setDiagnosticsOptions) == null || E.call(j, {
928
929
  noSuggestionDiagnostics: !0,
929
930
  noSyntaxValidation: !0,
930
931
  noSemanticValidation: !0
@@ -932,35 +933,35 @@ function Fr({
932
933
  },
933
934
  [e.code]
934
935
  );
935
- $(() => {
936
- var M, O;
937
- if (g.current && (!e.revisionId || e.revisionId > Number((M = p.current) == null ? void 0 : M.revisionId))) {
938
- const m = g.current.getModel();
939
- m && (o != null && o.readOnly ? (O = g.current) == null || O.setValue(e.code) : (g.current.pushUndoStop(), g.current.executeEdits("edit", [
936
+ 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", [
940
941
  {
941
- range: m.getFullModelRange(),
942
+ range: v.getFullModelRange(),
942
943
  text: e.code
943
944
  }
944
- ]), g.current.pushUndoStop()));
945
+ ]), m.current.pushUndoStop()));
945
946
  }
946
- }, [e, g.current]);
947
- const { theme: w } = de({ monacoRef: b, themeConfig: n, editor: l, theme: a }), k = q(() => ({ ...jr, ...o || {} }), [o]);
948
- return /* @__PURE__ */ U.jsx(U.Fragment, { children: /* @__PURE__ */ U.jsx(
947
+ }, [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(
949
950
  we,
950
951
  {
951
- className: s,
952
- height: i,
953
- onChange: (M, O) => {
954
- p.current = { code: M ?? "", revisionId: O.versionId }, t({ ...p.current }, O);
952
+ className: u,
953
+ height: a,
954
+ onChange: (C, w) => {
955
+ f.current = { code: C ?? "", revisionId: w.versionId }, t({ ...f.current }, w);
955
956
  },
956
957
  language: r,
957
- theme: w,
958
+ theme: g,
958
959
  options: k,
959
960
  onMount: I
960
961
  }
961
962
  ) });
962
963
  }
963
- H.config({ monaco: F });
964
+ W.config({ monaco: z });
964
965
  const Er = {
965
966
  ...le,
966
967
  codeLens: !1,
@@ -970,64 +971,64 @@ const Er = {
970
971
  originalEditable: !1,
971
972
  overviewRulerBorder: !1
972
973
  };
973
- function Rr({
974
+ function qr({
974
975
  original: e,
975
976
  modified: t,
976
977
  language: r,
977
978
  themeConfig: n,
978
979
  options: o,
979
- theme: a,
980
- height: i = "75vh"
980
+ theme: i,
981
+ height: a = "75vh"
981
982
  }) {
982
983
  se();
983
- const [s, l] = A(), f = y(), { theme: b } = de({ monacoRef: f, themeConfig: n, editor: s, theme: a }), p = q(() => ({ ...Er, ...o || {} }), [o]);
984
- return /* @__PURE__ */ U.jsx(U.Fragment, { children: /* @__PURE__ */ U.jsx(
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(
985
986
  ur,
986
987
  {
987
988
  className: "overflow-hidden rounded-b-md border-x border-b",
988
989
  language: r,
989
- theme: b,
990
+ theme: h,
990
991
  original: e,
991
992
  modified: t,
992
- height: i,
993
- options: p,
993
+ height: a,
994
+ options: f,
994
995
  onMount: l
995
996
  }
996
997
  ) });
997
998
  }
998
- var Fe = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Fe || {});
999
+ var Re = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Re || {});
999
1000
  function Pr(e) {
1000
- const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), a = [];
1001
- return r == null || r.forEach((i) => {
1002
- const s = i.actions;
1003
- i.selectors.forEach((f) => {
1004
- switch (f.type) {
1005
- case Fe.ContainsPath: {
1006
- f.paths.forEach((b) => {
1007
- let g = Object.keys(o).map((w) => ({
1008
- fullPath: w,
1009
- path: w,
1010
- symbol: o[w]
1011
- })).filter((w) => w.path.startsWith(f.basePath));
1012
- g = g.map((w) => ({
1013
- ...w,
1014
- path: w.path.substring(f.basePath.length)
1015
- })), g.filter((w) => b.test(w.path)).forEach((w) => {
1016
- const k = w.fullPath, M = w.symbol, O = M.range;
1017
- s.forEach((m) => {
1018
- const j = {
1019
- range: O,
1020
- symbols: [M],
1021
- onClick: m.onClick,
1022
- data: m.data,
1001
+ const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), i = [];
1002
+ return r == null || r.forEach((a) => {
1003
+ 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 = {
1020
+ range: w,
1021
+ symbols: [C],
1022
+ onClick: v.onClick,
1023
+ data: v.data,
1023
1024
  path: k
1024
1025
  };
1025
- a.push({
1026
- range: O,
1026
+ i.push({
1027
+ range: w,
1027
1028
  command: {
1028
1029
  id: n,
1029
- title: m.title,
1030
- arguments: [j]
1030
+ title: v.title,
1031
+ arguments: [T]
1031
1032
  }
1032
1033
  });
1033
1034
  });
@@ -1037,7 +1038,7 @@ function Pr(e) {
1037
1038
  }
1038
1039
  }
1039
1040
  });
1040
- }), a;
1041
+ }), i;
1041
1042
  }
1042
1043
  const te = class te {
1043
1044
  static set(t) {
@@ -1047,40 +1048,40 @@ const te = class te {
1047
1048
  return te.data;
1048
1049
  }
1049
1050
  };
1050
- Se(te, "data", {});
1051
+ je(te, "data", {});
1051
1052
  let ve = te;
1052
- async function Re(e) {
1053
+ async function qe(e) {
1053
1054
  const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
1054
1055
  return await t.OutlineModel.create(r, e);
1055
1056
  }
1056
- function qe(e) {
1057
+ function Be(e) {
1057
1058
  const t = /* @__PURE__ */ new Map();
1058
- return Oe({
1059
+ return Se({
1059
1060
  pathSymbolMap: t,
1060
1061
  parentPath: "",
1061
1062
  children: e.children,
1062
- parentKind: he.SymbolKind.Module
1063
+ parentKind: ge.SymbolKind.Module
1063
1064
  }), t;
1064
1065
  }
1065
- function Oe(e) {
1066
+ function Se(e) {
1066
1067
  switch (e.parentKind) {
1067
- case he.SymbolKind.Module: {
1068
- Cr(e);
1068
+ case ge.SymbolKind.Module: {
1069
+ xr(e);
1069
1070
  break;
1070
1071
  }
1071
- case he.SymbolKind.Array: {
1072
- xr(e);
1072
+ case ge.SymbolKind.Array: {
1073
+ Cr(e);
1073
1074
  break;
1074
1075
  }
1075
1076
  default:
1076
1077
  $r(e);
1077
1078
  }
1078
1079
  }
1079
- function Cr(e) {
1080
+ function xr(e) {
1080
1081
  e.children.forEach((t) => {
1081
1082
  var n;
1082
1083
  let r = e.parentPath;
1083
- t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Oe({
1084
+ t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Se({
1084
1085
  pathSymbolMap: e.pathSymbolMap,
1085
1086
  parentPath: r,
1086
1087
  children: t.children,
@@ -1088,11 +1089,11 @@ function Cr(e) {
1088
1089
  });
1089
1090
  });
1090
1091
  }
1091
- function xr(e) {
1092
+ function Cr(e) {
1092
1093
  let t = 0;
1093
1094
  e.children.forEach((r) => {
1094
1095
  const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
1095
- e.pathSymbolMap.set(n, r.symbol), t += 1, Oe({
1096
+ e.pathSymbolMap.set(n, r.symbol), t += 1, Se({
1096
1097
  pathSymbolMap: e.pathSymbolMap,
1097
1098
  parentPath: n,
1098
1099
  children: r.children,
@@ -1111,14 +1112,14 @@ function Lr({
1111
1112
  editorRef: e,
1112
1113
  inlineActions: t
1113
1114
  }) {
1114
- $(() => F.languages.registerCodeLensProvider("yaml", {
1115
+ L(() => z.languages.registerCodeLensProvider("yaml", {
1115
1116
  provideCodeLenses: async (n) => {
1116
1117
  var l;
1117
- const o = await Re(n), a = qe(o), i = (l = e == null ? void 0 : e.current) == null ? void 0 : l.addCommand(0, (f, { onClick: b, path: p, range: g, data: I }) => {
1118
- b({ path: p, range: g, data: I });
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 });
1119
1120
  });
1120
- return i ? {
1121
- lenses: Pr({ pathSymbolMap: a, inlineActions: t, commandId: i }),
1121
+ return a ? {
1122
+ lenses: Pr({ pathSymbolMap: i, inlineActions: t, commandId: a }),
1122
1123
  dispose: () => {
1123
1124
  }
1124
1125
  } : void 0;
@@ -1126,34 +1127,34 @@ function Lr({
1126
1127
  }).dispose, [t, e]);
1127
1128
  }
1128
1129
  const Ir = ({ editorRef: e, selection: t }) => {
1129
- const [r, n] = A(), o = q(
1130
- () => async (a, i, s) => {
1131
- var g, I, w;
1132
- const l = (g = e == null ? void 0 : e.current) == null ? void 0 : g.getModel();
1133
- if (!l || !i)
1130
+ const [r, n] = V(), o = B(
1131
+ () => 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)
1134
1135
  return n(void 0);
1135
- const f = await Re(l), p = (I = qe(f).get(i)) == null ? void 0 : I.range;
1136
- p && (n(p), s && ((w = e == null ? void 0 : e.current) == null || w.revealLineInCenter(p.startLineNumber)));
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)));
1137
1138
  },
1138
1139
  []
1139
1140
  );
1140
- $(() => {
1141
+ L(() => {
1141
1142
  if ("requestIdleCallback" in window) {
1142
- const a = requestIdleCallback(() => {
1143
+ const i = requestIdleCallback(() => {
1143
1144
  o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
1144
1145
  });
1145
- return () => cancelIdleCallback(a);
1146
+ return () => cancelIdleCallback(i);
1146
1147
  } else {
1147
- const a = setTimeout(() => {
1148
+ const i = setTimeout(() => {
1148
1149
  o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
1149
1150
  }, 100);
1150
- return () => clearTimeout(a);
1151
+ return () => clearTimeout(i);
1151
1152
  }
1152
- }, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), $(() => {
1153
- var i;
1153
+ }, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), L(() => {
1154
+ var a;
1154
1155
  if (!r)
1155
1156
  return;
1156
- const a = (i = e == null ? void 0 : e.current) == null ? void 0 : i.createDecorationsCollection([
1157
+ const i = (a = e == null ? void 0 : e.current) == null ? void 0 : a.createDecorationsCollection([
1157
1158
  {
1158
1159
  // TODO: check why startColumn is set to "end of row"
1159
1160
  range: { ...r, startColumn: 1 },
@@ -1163,9 +1164,9 @@ const Ir = ({ editorRef: e, selection: t }) => {
1163
1164
  }
1164
1165
  }
1165
1166
  ]);
1166
- return () => a == null ? void 0 : a.clear();
1167
+ return () => i == null ? void 0 : i.clear();
1167
1168
  }, [r, e, t == null ? void 0 : t.className]);
1168
- }, Be = Ge({
1169
+ }, He = Je({
1169
1170
  markers: [],
1170
1171
  setMarkers: () => {
1171
1172
  },
@@ -1175,163 +1176,180 @@ const Ir = ({ editorRef: e, selection: t }) => {
1175
1176
  updateCursorPosition: (e) => {
1176
1177
  }
1177
1178
  });
1178
- function qr({
1179
+ function Br({
1179
1180
  children: e
1180
1181
  }) {
1181
- const [t, r] = A([]), [n, o] = A(null), a = G(
1182
- (i) => {
1183
- n == null || n.setPosition(i), n == null || n.revealLineInCenterIfOutsideViewport(i.lineNumber), n == null || n.focus();
1182
+ const [t, r] = V([]), [n, o] = V(null), i = G(
1183
+ (a) => {
1184
+ n == null || n.setPosition(a), n == null || n.revealLineInCenterIfOutsideViewport(a.lineNumber), n == null || n.focus();
1184
1185
  },
1185
1186
  [n]
1186
1187
  );
1187
- return /* @__PURE__ */ U.jsx(
1188
- Be.Provider,
1188
+ return /* @__PURE__ */ F.jsx(
1189
+ He.Provider,
1189
1190
  {
1190
1191
  value: {
1191
1192
  markers: t,
1192
1193
  setMarkers: r,
1193
1194
  editor: n,
1194
1195
  setEditor: o,
1195
- updateCursorPosition: a
1196
+ updateCursorPosition: i
1196
1197
  },
1197
1198
  children: e
1198
1199
  }
1199
1200
  );
1200
1201
  }
1201
- function He() {
1202
- return Je(Be);
1203
- }
1204
- const Nr = ({ monacoRef: e }) => {
1205
- const { setMarkers: t } = He();
1206
- $(() => {
1207
- let r;
1208
- const n = setTimeout(() => {
1209
- var a;
1210
- const o = (a = e.current) == null ? void 0 : a.editor;
1211
- o && (r = o.onDidChangeMarkers(([i]) => {
1212
- const s = o.getModelMarkers({ resource: i });
1213
- t(s);
1202
+ function We() {
1203
+ return Qe(He);
1204
+ }
1205
+ const Dr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
1206
+ const { setMarkers: n } = We();
1207
+ L(() => {
1208
+ let o;
1209
+ const i = setTimeout(() => {
1210
+ var u;
1211
+ 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)
1216
+ return;
1217
+ const h = s.uri.toString();
1218
+ if (l.some((m) => m.toString() === h)) {
1219
+ const m = z.editor.getModelMarkers({ resource: s.uri });
1220
+ n(m);
1221
+ }
1214
1222
  }));
1215
1223
  }, 100);
1216
1224
  return () => {
1217
- clearTimeout(n), r == null || r.dispose();
1225
+ clearTimeout(i), o == null || o.dispose();
1218
1226
  };
1219
- }, [e]);
1227
+ }, [e, r, n]);
1220
1228
  };
1221
- let Ie = !1;
1222
- function Dr(e) {
1223
- if (Ie)
1224
- return;
1229
+ function Nr(e) {
1230
+ var n, o;
1231
+ 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
+ r !== -1 ? t[r] = e : t.push(e), Ke(t);
1233
+ }
1234
+ function Tr(e) {
1235
+ 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));
1237
+ Ke(r);
1238
+ }
1239
+ function Ke(e) {
1225
1240
  const t = {
1226
1241
  hover: !0,
1227
1242
  completion: !0,
1228
1243
  enableSchemaRequest: !1,
1229
1244
  validate: !0,
1230
- schemas: [e]
1245
+ schemas: e
1231
1246
  };
1232
- Ie = !0, Xe.setDiagnosticsOptions({ ...t });
1247
+ be.setDiagnosticsOptions({ ...t });
1233
1248
  }
1234
- const We = (e) => Qe.parse(`file://${e}`).toString(), Tr = (e) => {
1249
+ const Me = (e) => Xe.parse(`file://${e}`).toString(), kr = (e) => {
1235
1250
  const { schemaConfig: t, instanceId: r } = e;
1236
- $(() => {
1237
- t != null && t.schema && Dr({
1238
- // If YAML file is opened matching this glob
1239
- fileMatch: [We(r.toString())],
1240
- ...t
1241
- });
1251
+ L(() => {
1252
+ if (t != null && t.schema)
1253
+ return Nr({
1254
+ fileMatch: [Me(r.toString())],
1255
+ ...t
1256
+ }), () => {
1257
+ Tr(r);
1258
+ };
1242
1259
  }, [t == null ? void 0 : t.schema, r]);
1243
1260
  };
1244
- H.config({ monaco: F });
1245
- const kr = {
1261
+ W.config({ monaco: z });
1262
+ const Ar = {
1246
1263
  ...le,
1247
1264
  folding: !0
1248
- }, Br = function(t) {
1265
+ }, Hr = function(t) {
1249
1266
  const {
1250
1267
  yamlRevision: r,
1251
1268
  schemaConfig: n,
1252
1269
  inlineActions: o,
1253
- themeConfig: a,
1254
- onYamlRevisionChange: i,
1255
- selection: s,
1270
+ themeConfig: i,
1271
+ onYamlRevisionChange: a,
1272
+ selection: u,
1256
1273
  theme: l,
1257
- options: f,
1258
- animateOnUpdate: b = !1,
1259
- onAnimateEnd: p
1260
- } = t, g = se(), [I] = A("yaml"), { editor: w, setEditor: k } = He(), M = y(null), O = y(), m = y({ yaml: "", revisionId: 0 }), j = y(null), D = y(null), E = G(
1261
- (d) => {
1262
- var C, T, L;
1263
- const u = d.split(`
1264
- `), N = (C = j.current) == null ? void 0 : C.getModel();
1274
+ options: s,
1275
+ animateOnUpdate: h = !1,
1276
+ onAnimateEnd: f,
1277
+ 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();
1265
1283
  if (N) {
1266
- (T = j.current) == null || T.pushUndoStop(), N.setValue("");
1267
- let c = 0;
1268
- D.current = window.setInterval(() => {
1269
- var h;
1270
- c < u.length ? (g && ((h = j.current) == null || h.executeEdits("addLine", [
1284
+ (c = x.current) == null || c.pushUndoStop(), N.setValue("");
1285
+ let A = 0;
1286
+ M.current = window.setInterval(() => {
1287
+ var q;
1288
+ A < p.length ? (I && ((q = x.current) == null || q.executeEdits("addLine", [
1271
1289
  {
1272
- range: new g.Range(c + 1, 1, c + 1, 1),
1273
- text: u[c] + `
1290
+ range: new I.Range(A + 1, 1, A + 1, 1),
1291
+ text: p[A] + `
1274
1292
  `
1275
1293
  }
1276
- ])), c++) : D.current && (clearInterval(D.current), p == null || p());
1277
- }, 100), (L = j.current) == null || L.pushUndoStop();
1294
+ ])), A++) : M.current && (clearInterval(M.current), f == null || f());
1295
+ }, 100), (y = x.current) == null || y.pushUndoStop();
1278
1296
  }
1279
1297
  },
1280
- [g]
1298
+ [I]
1281
1299
  );
1282
- $(() => () => {
1283
- D.current && clearInterval(D.current);
1300
+ L(() => () => {
1301
+ M.current && clearInterval(M.current);
1284
1302
  }, []);
1285
- function P(d, u) {
1286
- j.current = d, O.current = u, d.setValue(r.yaml), k(d), setTimeout(() => {
1303
+ function E(P, p) {
1304
+ x.current = P, v.current = p, P.setValue(r.yaml), C(P), setTimeout(() => {
1287
1305
  var N;
1288
- (N = M.current) != null && N.style && (M.current.style.opacity = "1");
1306
+ (N = w.current) != null && N.style && (w.current.style.opacity = "1");
1289
1307
  }, 50);
1290
1308
  }
1291
- $(() => {
1292
- var d;
1293
- if (j.current && (!r.revisionId || r.revisionId > Number((d = m.current) == null ? void 0 : d.revisionId))) {
1294
- const u = j.current.getModel();
1295
- u && (j.current.executeEdits("edit", [
1309
+ 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", [
1296
1314
  {
1297
- range: u.getFullModelRange(),
1298
- text: b ? "" : r.yaml
1315
+ range: p.getFullModelRange(),
1316
+ text: h ? "" : r.yaml
1299
1317
  }
1300
- ]), b && E(r.yaml));
1318
+ ]), h && j(r.yaml));
1301
1319
  }
1302
- }, [E, r, b]), Tr({ schemaConfig: n, instanceId: I }), Lr({ editorRef: j, inlineActions: o });
1303
- const { theme: S } = de({ monacoRef: O, themeConfig: a, editor: w, theme: l });
1304
- Nr({ monacoRef: O }), Ir({ editorRef: j, selection: s });
1305
- const z = q(
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(
1306
1324
  () => ({
1307
- ...kr,
1308
- ...f
1325
+ ...Ar,
1326
+ ...s
1309
1327
  }),
1310
- [f]
1328
+ [s]
1311
1329
  );
1312
- return /* @__PURE__ */ U.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: M, children: /* @__PURE__ */ U.jsx(
1330
+ return /* @__PURE__ */ F.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: w, children: /* @__PURE__ */ F.jsx(
1313
1331
  we,
1314
1332
  {
1315
- onChange: (d, u) => {
1316
- m.current = { yaml: d ?? "", revisionId: u.versionId }, i({ ...m.current }, u);
1333
+ onChange: (P, p) => {
1334
+ T.current = { yaml: P ?? "", revisionId: p.versionId }, a({ ...T.current }, p);
1317
1335
  },
1318
1336
  language: "yaml",
1319
- theme: S,
1320
- options: z,
1321
- path: We(I),
1322
- onMount: P
1337
+ theme: R,
1338
+ options: d,
1339
+ path: S,
1340
+ onMount: E
1323
1341
  }
1324
1342
  ) });
1325
1343
  };
1326
1344
  export {
1327
1345
  zr as BlameEditor,
1328
- Rr as CodeDiffEditor,
1329
- Fr as CodeEditor,
1346
+ qr as CodeDiffEditor,
1347
+ Rr as CodeEditor,
1330
1348
  ve as MonacoGlobals,
1331
- Fe as SelectorType,
1332
- Br as YamlEditor,
1333
- Be as YamlEditorContext,
1334
- qr as YamlEditorContextProvider,
1335
- He as useYamlEditorContext
1349
+ Re as SelectorType,
1350
+ Hr as YamlEditor,
1351
+ He as YamlEditorContext,
1352
+ Br as YamlEditorContextProvider,
1353
+ We as useYamlEditorContext
1336
1354
  };
1337
1355
  //# sourceMappingURL=index.js.map