@harnessio/yaml-editor 0.17.0 → 0.18.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,46 +1,45 @@
1
- var ue = Object.defineProperty;
2
- var de = (e, t, n) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var J = (e, t, n) => (de(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import me, { useState as L, useEffect as P, useRef as C, useMemo as _, useCallback as q, createContext as fe, useContext as pe } from "react";
5
- import Z, { loader as B, useMonaco as F, DiffEditor as he } from "@monaco-editor/react";
6
- import * as k from "monaco-editor";
7
- import { languages as H, Uri as ge } from "monaco-editor";
8
- import { yamlDefaults as ye } from "monaco-yaml";
9
- var te = { exports: {} }, A = {};
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";
8
+ var Ne = { exports: {} }, ne = {};
10
9
  /*
11
10
  object-assign
12
11
  (c) Sindre Sorhus
13
12
  @license MIT
14
13
  */
15
- var Q = Object.getOwnPropertySymbols, ve = Object.prototype.hasOwnProperty, be = Object.prototype.propertyIsEnumerable;
16
- function Se(e) {
14
+ var Me = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
15
+ function rt(e) {
17
16
  if (e == null)
18
17
  throw new TypeError("Object.assign cannot be called with null or undefined");
19
18
  return Object(e);
20
19
  }
21
- function xe() {
20
+ function nt() {
22
21
  try {
23
22
  if (!Object.assign)
24
23
  return !1;
25
24
  var e = new String("abc");
26
25
  if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5")
27
26
  return !1;
28
- for (var t = {}, n = 0; n < 10; n++)
29
- t["_" + String.fromCharCode(n)] = n;
30
- var r = Object.getOwnPropertyNames(t).map(function(o) {
31
- return t[o];
27
+ for (var t = {}, r = 0; r < 10; r++)
28
+ t["_" + String.fromCharCode(r)] = r;
29
+ var n = Object.getOwnPropertyNames(t).map(function(a) {
30
+ return t[a];
32
31
  });
33
- if (r.join("") !== "0123456789")
32
+ if (n.join("") !== "0123456789")
34
33
  return !1;
35
- var a = {};
36
- return "abcdefghijklmnopqrst".split("").forEach(function(o) {
37
- a[o] = o;
38
- }), Object.keys(Object.assign({}, a)).join("") === "abcdefghijklmnopqrst";
34
+ var o = {};
35
+ return "abcdefghijklmnopqrst".split("").forEach(function(a) {
36
+ o[a] = a;
37
+ }), Object.keys(Object.assign({}, o)).join("") === "abcdefghijklmnopqrst";
39
38
  } catch {
40
39
  return !1;
41
40
  }
42
41
  }
43
- xe();
42
+ nt();
44
43
  /** @license React v17.0.2
45
44
  * react-jsx-runtime.production.min.js
46
45
  *
@@ -49,28 +48,588 @@ xe();
49
48
  * This source code is licensed under the MIT license found in the
50
49
  * LICENSE file in the root directory of this source tree.
51
50
  */
52
- var Ee = me, ne = 60103;
53
- A.Fragment = 60107;
51
+ var ot = W, De = 60103;
52
+ ne.Fragment = 60107;
54
53
  if (typeof Symbol == "function" && Symbol.for) {
55
- var X = Symbol.for;
56
- ne = X("react.element"), A.Fragment = X("react.fragment");
57
- }
58
- var Me = Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Oe = Object.prototype.hasOwnProperty, Ce = { key: !0, ref: !0, __self: !0, __source: !0 };
59
- function re(e, t, n) {
60
- var r, a = {}, o = null, s = null;
61
- n !== void 0 && (o = "" + n), t.key !== void 0 && (o = "" + t.key), t.ref !== void 0 && (s = t.ref);
62
- for (r in t)
63
- Oe.call(t, r) && !Ce.hasOwnProperty(r) && (a[r] = t[r]);
54
+ var je = Symbol.for;
55
+ De = je("react.element"), ne.Fragment = je("react.fragment");
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);
61
+ for (n in t)
62
+ it.call(t, n) && !ct.hasOwnProperty(n) && (o[n] = t[n]);
64
63
  if (e && e.defaultProps)
65
- for (r in t = e.defaultProps, t)
66
- a[r] === void 0 && (a[r] = t[r]);
67
- return { $$typeof: ne, type: e, key: o, ref: s, props: a, _owner: Me.current };
68
- }
69
- A.jsx = re;
70
- A.jsxs = re;
71
- te.exports = A;
72
- var w = te.exports;
73
- const z = {
64
+ for (n in t = e.defaultProps, t)
65
+ o[n] === void 0 && (o[n] = t[n]);
66
+ return { $$typeof: De, type: e, key: a, ref: i, props: o, _owner: at.current };
67
+ }
68
+ ne.jsx = Te;
69
+ ne.jsxs = Te;
70
+ Ne.exports = ne;
71
+ var U = Ne.exports;
72
+ function ut(e, t, r) {
73
+ return t in e ? Object.defineProperty(e, t, {
74
+ value: r,
75
+ enumerable: !0,
76
+ configurable: !0,
77
+ writable: !0
78
+ }) : e[t] = r, e;
79
+ }
80
+ function Ee(e, t) {
81
+ var r = Object.keys(e);
82
+ if (Object.getOwnPropertySymbols) {
83
+ var n = Object.getOwnPropertySymbols(e);
84
+ t && (n = n.filter(function(o) {
85
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
86
+ })), r.push.apply(r, n);
87
+ }
88
+ return r;
89
+ }
90
+ function Pe(e) {
91
+ for (var t = 1; t < arguments.length; t++) {
92
+ var r = arguments[t] != null ? arguments[t] : {};
93
+ t % 2 ? Ee(Object(r), !0).forEach(function(n) {
94
+ ut(e, n, r[n]);
95
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach(function(n) {
96
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
97
+ });
98
+ }
99
+ return e;
100
+ }
101
+ function st(e, t) {
102
+ if (e == null)
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]);
107
+ return r;
108
+ }
109
+ function lt(e, t) {
110
+ if (e == null)
111
+ return {};
112
+ var r = st(e, t), n, o;
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]);
117
+ }
118
+ return r;
119
+ }
120
+ function dt(e, t) {
121
+ return ft(e) || pt(e, t) || gt(e, t) || mt();
122
+ }
123
+ function ft(e) {
124
+ if (Array.isArray(e))
125
+ return e;
126
+ }
127
+ function pt(e, t) {
128
+ if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
129
+ var r = [], n = !0, o = !1, a = void 0;
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)
132
+ ;
133
+ } catch (l) {
134
+ o = !0, a = l;
135
+ } finally {
136
+ try {
137
+ !n && i.return != null && i.return();
138
+ } finally {
139
+ if (o)
140
+ throw a;
141
+ }
142
+ }
143
+ return r;
144
+ }
145
+ }
146
+ function gt(e, t) {
147
+ if (e) {
148
+ if (typeof e == "string")
149
+ return Ce(e, t);
150
+ var r = Object.prototype.toString.call(e).slice(8, -1);
151
+ if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set")
152
+ return Array.from(e);
153
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
154
+ return Ce(e, t);
155
+ }
156
+ }
157
+ function Ce(e, t) {
158
+ (t == null || t > e.length) && (t = e.length);
159
+ for (var r = 0, n = new Array(t); r < t; r++)
160
+ n[r] = e[r];
161
+ return n;
162
+ }
163
+ function mt() {
164
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
165
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
166
+ }
167
+ function ht(e, t, r) {
168
+ return t in e ? Object.defineProperty(e, t, {
169
+ value: r,
170
+ enumerable: !0,
171
+ configurable: !0,
172
+ writable: !0
173
+ }) : e[t] = r, e;
174
+ }
175
+ function xe(e, t) {
176
+ var r = Object.keys(e);
177
+ if (Object.getOwnPropertySymbols) {
178
+ var n = Object.getOwnPropertySymbols(e);
179
+ t && (n = n.filter(function(o) {
180
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
181
+ })), r.push.apply(r, n);
182
+ }
183
+ return r;
184
+ }
185
+ function $e(e) {
186
+ for (var t = 1; t < arguments.length; t++) {
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) {
191
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
192
+ });
193
+ }
194
+ return e;
195
+ }
196
+ function vt() {
197
+ for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
198
+ t[r] = arguments[r];
199
+ return function(n) {
200
+ return t.reduceRight(function(o, a) {
201
+ return a(o);
202
+ }, n);
203
+ };
204
+ }
205
+ function X(e) {
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];
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));
213
+ };
214
+ };
215
+ }
216
+ function ce(e) {
217
+ return {}.toString.call(e).includes("Object");
218
+ }
219
+ function yt(e) {
220
+ return !Object.keys(e).length;
221
+ }
222
+ function re(e) {
223
+ return typeof e == "function";
224
+ }
225
+ function bt(e, t) {
226
+ return Object.prototype.hasOwnProperty.call(e, t);
227
+ }
228
+ function wt(e, t) {
229
+ return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
230
+ return !bt(e, r);
231
+ }) && B("changeField"), t;
232
+ }
233
+ function Ot(e) {
234
+ re(e) || B("selectorType");
235
+ }
236
+ function St(e) {
237
+ re(e) || ce(e) || B("handlerType"), ce(e) && Object.values(e).some(function(t) {
238
+ return !re(t);
239
+ }) && B("handlersType");
240
+ }
241
+ function Mt(e) {
242
+ e || B("initialIsRequired"), ce(e) || B("initialType"), yt(e) && B("initialContent");
243
+ }
244
+ function jt(e, t) {
245
+ throw new Error(e[t] || e.default);
246
+ }
247
+ var Et = {
248
+ initialIsRequired: "initial state is required",
249
+ initialType: "initial state should be an object",
250
+ initialContent: "initial state shouldn't be an empty object",
251
+ handlerType: "handler should be an object or a function",
252
+ handlersType: "all handlers should be a functions",
253
+ selectorType: "selector should be a function",
254
+ changeType: "provided value of changes should be an object",
255
+ changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
256
+ default: "an unknown error accured in `state-local` package"
257
+ }, B = X(jt)(Et), ae = {
258
+ changes: wt,
259
+ selector: Ot,
260
+ handler: St,
261
+ initial: Mt
262
+ };
263
+ function Pt(e) {
264
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
265
+ ae.initial(e), ae.handler(t);
266
+ var r = {
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;
272
+ };
273
+ return ae.selector(f), f(r.current);
274
+ }
275
+ function l(f) {
276
+ vt(n, o, a, i)(f);
277
+ }
278
+ return [s, l];
279
+ }
280
+ function Ct(e, t) {
281
+ return re(t) ? t(e.current) : t;
282
+ }
283
+ function xt(e, t) {
284
+ return e.current = $e($e({}, e.current), t), t;
285
+ }
286
+ function $t(e, t, r) {
287
+ return re(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
288
+ var o;
289
+ return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
290
+ }), r;
291
+ }
292
+ var Lt = {
293
+ create: Pt
294
+ }, It = {
295
+ paths: {
296
+ vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
297
+ }
298
+ };
299
+ function Nt(e) {
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];
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));
307
+ };
308
+ };
309
+ }
310
+ function Dt(e) {
311
+ return {}.toString.call(e).includes("Object");
312
+ }
313
+ function Tt(e) {
314
+ return e || Le("configIsRequired"), Dt(e) || Le("configType"), e.urls ? (kt(), {
315
+ paths: {
316
+ vs: e.urls.monacoBase
317
+ }
318
+ }) : e;
319
+ }
320
+ function kt() {
321
+ console.warn(ke.deprecation);
322
+ }
323
+ function At(e, t) {
324
+ throw new Error(e[t] || e.default);
325
+ }
326
+ var ke = {
327
+ configIsRequired: "the configuration object is required",
328
+ configType: "the configuration object should be an object",
329
+ default: "an unknown error accured in `@monaco-editor/loader` package",
330
+ deprecation: `Deprecation warning!
331
+ You are using deprecated way of configuration.
332
+
333
+ Instead of using
334
+ monaco.config({ urls: { monacoBase: '...' } })
335
+ use
336
+ monaco.config({ paths: { vs: '...' } })
337
+
338
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
339
+ `
340
+ }, Le = Nt(At)(ke), Vt = {
341
+ config: Tt
342
+ }, _t = function() {
343
+ for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
344
+ r[n] = arguments[n];
345
+ return function(o) {
346
+ return r.reduceRight(function(a, i) {
347
+ return i(a);
348
+ }, o);
349
+ };
350
+ };
351
+ function Ae(e, t) {
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);
355
+ }
356
+ var Ut = {
357
+ type: "cancelation",
358
+ msg: "operation is manually canceled"
359
+ };
360
+ function fe(e) {
361
+ var t = !1, r = new Promise(function(n, o) {
362
+ e.then(function(a) {
363
+ return t ? o(Ut) : n(a);
364
+ }), e.catch(o);
365
+ });
366
+ return r.cancel = function() {
367
+ return t = !0;
368
+ }, r;
369
+ }
370
+ var zt = Lt.create({
371
+ config: It,
372
+ isInitialized: !1,
373
+ resolve: null,
374
+ reject: null,
375
+ monaco: null
376
+ }), Ve = dt(zt, 2), oe = Ve[0], ue = Ve[1];
377
+ function Ft(e) {
378
+ var t = Vt.config(e), r = t.monaco, n = lt(t, ["monaco"]);
379
+ ue(function(o) {
380
+ return {
381
+ config: Ae(o.config, n),
382
+ monaco: r
383
+ };
384
+ });
385
+ }
386
+ function Rt() {
387
+ var e = oe(function(t) {
388
+ var r = t.monaco, n = t.isInitialized, o = t.resolve;
389
+ return {
390
+ monaco: r,
391
+ isInitialized: n,
392
+ resolve: o
393
+ };
394
+ });
395
+ if (!e.isInitialized) {
396
+ if (ue({
397
+ isInitialized: !0
398
+ }), e.monaco)
399
+ return e.resolve(e.monaco), fe(pe);
400
+ if (window.monaco && window.monaco.editor)
401
+ return _e(window.monaco), e.resolve(window.monaco), fe(pe);
402
+ _t(qt, Ht)(Wt);
403
+ }
404
+ return fe(pe);
405
+ }
406
+ function qt(e) {
407
+ return document.body.appendChild(e);
408
+ }
409
+ function Bt(e) {
410
+ var t = document.createElement("script");
411
+ return e && (t.src = e), t;
412
+ }
413
+ function Ht(e) {
414
+ var t = oe(function(n) {
415
+ var o = n.config, a = n.reject;
416
+ return {
417
+ config: o,
418
+ reject: a
419
+ };
420
+ }), r = Bt("".concat(t.config.paths.vs, "/loader.js"));
421
+ return r.onload = function() {
422
+ return e();
423
+ }, r.onerror = t.reject, r;
424
+ }
425
+ function Wt() {
426
+ var e = oe(function(r) {
427
+ var n = r.config, o = r.resolve, a = r.reject;
428
+ return {
429
+ config: n,
430
+ resolve: o,
431
+ reject: a
432
+ };
433
+ }), t = window.require;
434
+ t.config(e.config), t(["vs/editor/editor.main"], function(r) {
435
+ _e(r), e.resolve(r);
436
+ }, function(r) {
437
+ e.reject(r);
438
+ });
439
+ }
440
+ function _e(e) {
441
+ oe().monaco || ue({
442
+ monaco: e
443
+ });
444
+ }
445
+ function Kt() {
446
+ return oe(function(e) {
447
+ var t = e.monaco;
448
+ return t;
449
+ });
450
+ }
451
+ var pe = new Promise(function(e, t) {
452
+ return ue({
453
+ resolve: e,
454
+ reject: t
455
+ });
456
+ }), H = {
457
+ config: Ft,
458
+ init: Rt,
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;
461
+ function Jt({ children: e }) {
462
+ return W.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: 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 }));
467
+ }
468
+ var tr = er, Ue = ye(tr);
469
+ function rr(e) {
470
+ $(e, []);
471
+ }
472
+ var be = rr;
473
+ function nr(e, t, r = !0) {
474
+ let n = y(!0);
475
+ $(n.current || !r ? () => {
476
+ n.current = !1;
477
+ } : e, t);
478
+ }
479
+ var _ = nr;
480
+ function ee() {
481
+ }
482
+ function Z(e, t, r, n) {
483
+ return or(e, n) || ar(e, t, r, n);
484
+ }
485
+ function or(e, t) {
486
+ return e.editor.getModel(ze(e, t));
487
+ }
488
+ function ar(e, t, r, n) {
489
+ return e.editor.createModel(t, r, n ? ze(e, n) : void 0);
490
+ }
491
+ function ze(e, t) {
492
+ return e.Uri.parse(t);
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);
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);
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), _(() => {
519
+ var c;
520
+ (c = S.current) == null || c.editor.setTheme(f);
521
+ }, [f], m), _(() => {
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)
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(() => {
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();
545
+ }
546
+ return W.createElement(Ue, { width: I, height: g, isEditorReady: m, loading: b, _ref: z, className: w, wrapperProps: k });
547
+ }
548
+ var cr = ir, ur = ye(cr);
549
+ function sr() {
550
+ let [e, t] = A(H.__getMonacoInstance());
551
+ return be(() => {
552
+ let r;
553
+ return e || (r = H.init(), r.then((n) => {
554
+ t(n);
555
+ })), () => r == null ? void 0 : r.cancel();
556
+ }), e;
557
+ }
558
+ var se = sr;
559
+ function lr(e) {
560
+ let t = y();
561
+ return $(() => {
562
+ t.current = e;
563
+ }, [e]), t.current;
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);
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;
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);
607
+ }));
608
+ }, [E, j]), $(() => {
609
+ if (E) {
610
+ let v = d.current.editor.onDidChangeMarkers((x) => {
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);
616
+ }
617
+ });
618
+ return () => {
619
+ v == null || v.dispose();
620
+ };
621
+ }
622
+ return () => {
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();
628
+ }
629
+ return W.createElement(Ue, { width: I, height: w, isEditorReady: E, loading: l, _ref: N, className: k, wrapperProps: M });
630
+ }
631
+ var pr = fr, gr = ye(pr), we = gr;
632
+ const le = {
74
633
  selectOnLineNumbers: !0,
75
634
  scrollBeyondLastLine: !1,
76
635
  padding: {
@@ -90,33 +649,33 @@ const z = {
90
649
  overviewRulerBorder: !1,
91
650
  overviewRulerLanes: 0,
92
651
  renderLineHighlight: "none"
93
- }, R = (e) => {
94
- const { themeConfig: t, editor: n, theme: r } = e, { defaultTheme: a } = t ?? {}, [o, s] = L(r ?? a ?? "vs-dark");
95
- return P(() => {
96
- var c;
97
- (c = t == null ? void 0 : t.themes) == null || c.forEach((g) => {
98
- k.editor.defineTheme(g.themeName, g.themeData);
652
+ }, 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);
99
658
  });
100
- }, [k]), P(() => {
101
- k.editor && r && (k.editor.setTheme(r), s(r));
102
- }, [n, r]), { theme: o };
659
+ }, [F]), $(() => {
660
+ F.editor && n && (F.editor.setTheme(n), i(n));
661
+ }, [r, n]), { theme: a };
103
662
  };
104
- function we(e) {
663
+ function mr(e) {
105
664
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
106
- let n = "";
107
- for (let r = 0; r < e; r++)
108
- n += t.charAt(Math.floor(Math.random() * t.length));
109
- return n;
665
+ let r = "";
666
+ for (let n = 0; n < e; n++)
667
+ r += t.charAt(Math.floor(Math.random() * t.length));
668
+ return r;
110
669
  }
111
- function Pe(e) {
670
+ function hr(e) {
112
671
  return e.replace("'", "&#39;");
113
672
  }
114
- function $e({
673
+ function vr({
115
674
  instanceId: e,
116
675
  lineNumbersPosition: t
117
676
  }) {
118
- let n = "";
119
- return t === "center" && (n += `
677
+ let r = "";
678
+ return t === "center" && (r += `
120
679
  .monaco-editor-${e} .monaco-scrollable-element.editor-scrollable {
121
680
  width: 100% !important;
122
681
  left: 0px !important;
@@ -129,7 +688,7 @@ function $e({
129
688
  .monaco-editor-${e} .margin {
130
689
  z-index: 1000;
131
690
  background: transparent !important;
132
- }`), n += `
691
+ }`), r += `
133
692
  .monaco-editor-${e} .blame-editor-separator {
134
693
  right: 14px;
135
694
  pointer-events: none;
@@ -142,59 +701,59 @@ function $e({
142
701
  .monaco-editor-${e} .view-line .blame-editor-commit {
143
702
  display: inline-block;
144
703
  color: var(--canary-foreground-01);
145
- }`, n;
704
+ }`, r;
146
705
  }
147
- function je({
706
+ function yr({
148
707
  instanceId: e,
149
708
  blameData: t,
150
- dateWidth: n,
151
- avatarSize: r
709
+ dateWidth: r,
710
+ avatarSize: n
152
711
  }) {
153
- let a = "";
154
- return t.forEach((o) => {
155
- var m, f, d, i, x, l, $, h;
156
- const s = (f = (m = o == null ? void 0 : o.commitInfo) == null ? void 0 : m.author) == null ? void 0 : f.avatarUrl, c = (i = (d = o == null ? void 0 : o.commitInfo) == null ? void 0 : d.author) == null ? void 0 : i.initials, g = s ? `background: url('${(l = (x = o == null ? void 0 : o.commitInfo) == null ? void 0 : x.author) == null ? void 0 : l.avatarUrl}');` : "";
157
- for (let u = o.fromLineNumber; u <= o.toLineNumber; u++)
158
- u === o.fromLineNumber ? a += `
159
- .monaco-editor-${e} .view-line .blame-editor-commit-${u}:before {
160
- content: '${Pe(((h = ($ = o == null ? void 0 : o.commitInfo) == null ? void 0 : $.author) == null ? void 0 : h.when) || "")}';
712
+ 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) || "")}';
161
720
  position: absolute;
162
721
  left: 10px;
163
722
  top: 0px;
164
723
  color: hsl(var(--canary-foreground-03));
165
724
  }
166
725
 
167
- .monaco-editor-${e} .view-line .blame-editor-commit-${u}:after {
168
- content: '${c ?? " "}';
726
+ .monaco-editor-${e} .view-line .blame-editor-commit-${O}:after {
727
+ content: '${s ?? " "}';
169
728
  position: absolute;
170
729
  border-radius: 50%;
171
730
  padding: 4px;
172
731
  text-align: center;
173
732
  background: hsl(var(--canary-background-11));
174
733
  line-height: 17px;
175
- left: ${n + 10}px;
734
+ left: ${r + 10}px;
176
735
  top: -4px;
177
736
  color: hsl(var(--canary-foreground-03));
178
- width: ${r}px;
179
- height: ${r}px;
180
- ${g}
737
+ width: ${n}px;
738
+ height: ${n}px;
739
+ ${l}
181
740
  background-size: 100% 100%;
182
- }` : a += `
183
- .monaco-editor-${e} .view-line .blame-editor-commit-${u}:before {
741
+ }` : o += `
742
+ .monaco-editor-${e} .view-line .blame-editor-commit-${O}:before {
184
743
  content: ' ';
185
744
  left: 10px;
186
745
  top: 0px;
187
746
  color: gray;
188
747
  }`;
189
- }), a;
748
+ }), o;
190
749
  }
191
- function Ne(e, t) {
192
- let n = "";
193
- return e.length > t ? n = e.slice(0, t - 3) + "..." : e.length < t ? n = e + " ".repeat(t - e.length) : n = e, " ".repeat(25) + n + " ".repeat(10);
750
+ function br(e, t) {
751
+ let r = "";
752
+ 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);
194
753
  }
195
- B.config({ monaco: k });
196
- const Y = 450, ke = 30, Le = 140, De = 24, _e = {
197
- ...z,
754
+ H.config({ monaco: F });
755
+ const me = 450, wr = 30, Or = 140, Sr = 24, Mr = {
756
+ ...le,
198
757
  readOnly: !0,
199
758
  matchBrackets: "never",
200
759
  renderValidationDecorations: "off",
@@ -204,168 +763,168 @@ const Y = 450, ke = 30, Le = 140, De = 24, _e = {
204
763
  renderWhitespace: "none",
205
764
  renderLineHighlight: "none"
206
765
  };
207
- function Qe({
766
+ function zr({
208
767
  code: e,
209
768
  language: t,
210
- themeConfig: n,
211
- lineNumbersPosition: r = "left",
212
- blameData: a,
213
- showSeparators: o = !0,
214
- theme: s,
215
- height: c = "75vh",
216
- options: g
769
+ themeConfig: r,
770
+ lineNumbersPosition: n = "left",
771
+ blameData: o,
772
+ showSeparators: a = !0,
773
+ theme: i,
774
+ height: s = "75vh",
775
+ options: l
217
776
  }) {
218
- const m = C(a), f = C(we(5));
219
- F();
220
- const [d, i] = L(), [x, l] = L(0), $ = C(null), h = C(null);
221
- P(() => {
222
- m.current = a;
223
- }, [a]);
224
- function u() {
225
- const p = h.current, y = $.current;
226
- if (!p || !y)
777
+ const f = y(o), b = y(mr(5));
778
+ se();
779
+ const [p, g] = A(), [I, w] = A(0), k = y(null), M = y(null);
780
+ $(() => {
781
+ f.current = o;
782
+ }, [o]);
783
+ function O() {
784
+ const d = M.current, u = k.current;
785
+ if (!d || !u)
227
786
  return;
228
- o && p.changeViewZones(function(v) {
229
- v.addZone({
787
+ a && d.changeViewZones(function(C) {
788
+ C.addZone({
230
789
  afterLineNumber: 0,
231
790
  heightInPx: 10,
232
791
  domNode: document.createElement("div")
233
- }), m.current.forEach((j, M) => {
234
- if (M !== m.current.length - 1) {
235
- const S = document.createElement("div");
236
- S.style.borderTop = "1px solid hsl(var(--canary-border-01))", S.style.marginTop = "9px", S.className = "blame-editor-separator", v.addZone({
237
- afterLineNumber: j.toLineNumber,
792
+ }), f.current.forEach((T, L) => {
793
+ if (L !== f.current.length - 1) {
794
+ 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,
238
797
  heightInPx: 20,
239
- domNode: S
798
+ domNode: c
240
799
  });
241
800
  }
242
801
  });
243
802
  });
244
- const O = [];
245
- m.current.forEach((v) => {
246
- var j;
247
- for (let M = v.fromLineNumber; M <= v.toLineNumber; M++)
248
- O.push({
249
- range: new y.Range(M, 0, M + 1, 0),
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),
250
809
  options: {
251
810
  before: {
252
- content: Ne(
253
- M === v.fromLineNumber && ((j = v == null ? void 0 : v.commitInfo) == null ? void 0 : j.title) || "",
254
- ke
811
+ content: br(
812
+ L === C.fromLineNumber && ((T = C == null ? void 0 : C.commitInfo) == null ? void 0 : T.title) || "",
813
+ wr
255
814
  ),
256
- cursorStops: y.editor.InjectedTextCursorStops.None,
257
- inlineClassName: `blame-editor-commit blame-editor-commit-${M}`
815
+ cursorStops: u.editor.InjectedTextCursorStops.None,
816
+ inlineClassName: `blame-editor-commit blame-editor-commit-${L}`
258
817
  }
259
818
  }
260
819
  });
261
- }), p.createDecorationsCollection(O);
820
+ }), d.createDecorationsCollection(N);
262
821
  }
263
- function E(p, y) {
264
- var O, v, j, M, S, V;
265
- h.current = p, $.current = y, p.setValue(e), i(p), (j = (v = (O = y.languages.typescript) == null ? void 0 : O.typescriptDefaults) == null ? void 0 : v.setDiagnosticsOptions) == null || j.call(v, {
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, {
266
825
  noSuggestionDiagnostics: !0,
267
826
  noSyntaxValidation: !0,
268
827
  noSemanticValidation: !0
269
- }), (V = (S = (M = y.languages.typescript) == null ? void 0 : M.javascriptDefaults) == null ? void 0 : S.setDiagnosticsOptions) == null || V.call(S, {
828
+ }), (h = (c = (L = u.languages.typescript) == null ? void 0 : L.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || h.call(c, {
270
829
  noSuggestionDiagnostics: !0,
271
830
  noSyntaxValidation: !0,
272
831
  noSemanticValidation: !0
273
- }), u();
832
+ }), O();
274
833
  }
275
- P(() => {
276
- d == null || d.setValue(e);
834
+ $(() => {
835
+ p == null || p.setValue(e);
277
836
  }, [e]);
278
- const { theme: b } = R({ monacoRef: $, themeConfig: n, editor: d, theme: s }), N = _(
279
- () => $e({
280
- instanceId: f.current,
281
- lineNumbersPosition: r
837
+ const { theme: j } = de({ monacoRef: k, themeConfig: r, editor: p, theme: i }), D = q(
838
+ () => vr({
839
+ instanceId: b.current,
840
+ lineNumbersPosition: n
282
841
  }),
283
- [a]
284
- ), T = _(
285
- () => je({
286
- instanceId: f.current,
287
- blameData: a,
288
- avatarSize: De,
289
- dateWidth: Le
842
+ [o]
843
+ ), E = q(
844
+ () => yr({
845
+ instanceId: b.current,
846
+ blameData: o,
847
+ avatarSize: Sr,
848
+ dateWidth: Or
290
849
  }),
291
- [a]
850
+ [o]
292
851
  );
293
- P(() => {
294
- if (r === "center") {
295
- const p = document.getElementsByClassName("lines-content")[0];
296
- if (p) {
297
- const y = { attributes: !0 }, O = (j) => {
298
- for (const M of j) {
299
- const S = parseInt(getComputedStyle(p).left);
300
- l(S);
852
+ $(() => {
853
+ 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);
301
860
  }
302
- }, v = new MutationObserver(O);
303
- return v.observe(p, y), () => {
304
- v.disconnect();
861
+ }, C = new MutationObserver(N);
862
+ return C.observe(d, u), () => {
863
+ C.disconnect();
305
864
  };
306
865
  }
307
866
  }
308
867
  });
309
- const D = _(() => `
310
- .monaco-editor-${f.current} .margin {
311
- left: ${Y + 16 + x}px !important;
868
+ const P = q(() => `
869
+ .monaco-editor-${b.current} .margin {
870
+ left: ${me + 16 + I}px !important;
312
871
  pointer-events: none;
313
- }`, [x]), I = `
314
- .monaco-editor-${f.current} .view-overlays {
315
- clip-path: polygon(${Y + 16}px 0, 100% 0%, 100% 100%, ${Y + 16}px 100%);
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%);
316
875
  height:100% !important;
317
- }`, W = _(
876
+ }`, z = q(
318
877
  () => ({
319
- ..._e,
320
- ...g
878
+ ...Mr,
879
+ ...l
321
880
  }),
322
- [g]
881
+ [l]
323
882
  );
324
- return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
325
- /* @__PURE__ */ w.jsx(
883
+ return /* @__PURE__ */ U.jsxs(U.Fragment, { children: [
884
+ /* @__PURE__ */ U.jsx(
326
885
  "style",
327
886
  {
328
887
  dangerouslySetInnerHTML: {
329
- __html: `${N} ${T} ${D} ${I}`
888
+ __html: `${D} ${E} ${P} ${S}`
330
889
  }
331
890
  }
332
891
  ),
333
- /* @__PURE__ */ w.jsx(
334
- Z,
892
+ /* @__PURE__ */ U.jsx(
893
+ we,
335
894
  {
336
- className: `monaco-editor-${f.current} overflow-hidden rounded-b-md border-x border-b`,
337
- height: c,
895
+ className: `monaco-editor-${b.current} overflow-hidden rounded-b-md border-x border-b`,
896
+ height: s,
338
897
  language: t,
339
- theme: b,
340
- options: W,
341
- onMount: E
898
+ theme: j,
899
+ options: z,
900
+ onMount: m
342
901
  }
343
902
  )
344
903
  ] });
345
904
  }
346
- B.config({ monaco: k });
347
- const Te = {
348
- ...z
905
+ H.config({ monaco: F });
906
+ const jr = {
907
+ ...le
349
908
  };
350
- function Xe({
909
+ function Fr({
351
910
  codeRevision: e,
352
911
  onCodeRevisionChange: t,
353
- language: n,
354
- themeConfig: r,
355
- options: a,
356
- theme: o,
357
- height: s = "75vh",
358
- className: c
912
+ language: r,
913
+ themeConfig: n,
914
+ options: o,
915
+ theme: a,
916
+ height: i = "75vh",
917
+ className: s
359
918
  }) {
360
- F();
361
- const [g, m] = L(), f = C(), d = C({ code: "", revisionId: 0 }), i = C(null), x = q(
362
- (h, u) => {
363
- var E, b, N, T, D, I;
364
- i.current = h, f.current = u, h.setValue(e.code), m(h), (N = (b = (E = u.languages.typescript) == null ? void 0 : E.typescriptDefaults) == null ? void 0 : b.setDiagnosticsOptions) == null || N.call(b, {
919
+ 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, {
365
924
  noSuggestionDiagnostics: !0,
366
925
  noSyntaxValidation: !0,
367
926
  noSemanticValidation: !0
368
- }), (I = (D = (T = u.languages.typescript) == null ? void 0 : T.javascriptDefaults) == null ? void 0 : D.setDiagnosticsOptions) == null || I.call(D, {
927
+ }), (S = (P = (E = O.languages.typescript) == null ? void 0 : E.javascriptDefaults) == null ? void 0 : P.setDiagnosticsOptions) == null || S.call(P, {
369
928
  noSuggestionDiagnostics: !0,
370
929
  noSyntaxValidation: !0,
371
930
  noSemanticValidation: !0
@@ -373,37 +932,37 @@ function Xe({
373
932
  },
374
933
  [e.code]
375
934
  );
376
- P(() => {
377
- var h, u;
378
- if (i.current && (!e.revisionId || e.revisionId > Number((h = d.current) == null ? void 0 : h.revisionId))) {
379
- const E = i.current.getModel();
380
- E && (a != null && a.readOnly ? (u = i.current) == null || u.setValue(e.code) : (i.current.pushUndoStop(), i.current.executeEdits("edit", [
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", [
381
940
  {
382
- range: E.getFullModelRange(),
941
+ range: m.getFullModelRange(),
383
942
  text: e.code
384
943
  }
385
- ]), i.current.pushUndoStop()));
944
+ ]), g.current.pushUndoStop()));
386
945
  }
387
- }, [e, i.current]);
388
- const { theme: l } = R({ monacoRef: f, themeConfig: r, editor: g, theme: o }), $ = _(() => ({ ...Te, ...a || {} }), [a]);
389
- return /* @__PURE__ */ w.jsx(w.Fragment, { children: /* @__PURE__ */ w.jsx(
390
- Z,
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(
949
+ we,
391
950
  {
392
- className: c,
393
- height: s,
394
- onChange: (h, u) => {
395
- d.current = { code: h ?? "", revisionId: u.versionId }, t({ ...d.current }, u);
951
+ className: s,
952
+ height: i,
953
+ onChange: (M, O) => {
954
+ p.current = { code: M ?? "", revisionId: O.versionId }, t({ ...p.current }, O);
396
955
  },
397
- language: n,
398
- theme: l,
399
- options: $,
400
- onMount: x
956
+ language: r,
957
+ theme: w,
958
+ options: k,
959
+ onMount: I
401
960
  }
402
961
  ) });
403
962
  }
404
- B.config({ monaco: k });
405
- const Ie = {
406
- ...z,
963
+ H.config({ monaco: F });
964
+ const Er = {
965
+ ...le,
407
966
  codeLens: !1,
408
967
  smartSelect: {
409
968
  selectLeadingAndTrailingWhitespace: !0
@@ -411,64 +970,64 @@ const Ie = {
411
970
  originalEditable: !1,
412
971
  overviewRulerBorder: !1
413
972
  };
414
- function et({
973
+ function Rr({
415
974
  original: e,
416
975
  modified: t,
417
- language: n,
418
- themeConfig: r,
419
- options: a,
420
- theme: o,
421
- height: s = "75vh"
976
+ language: r,
977
+ themeConfig: n,
978
+ options: o,
979
+ theme: a,
980
+ height: i = "75vh"
422
981
  }) {
423
- F();
424
- const [c, g] = L(), m = C(), { theme: f } = R({ monacoRef: m, themeConfig: r, editor: c, theme: o }), d = _(() => ({ ...Ie, ...a || {} }), [a]);
425
- return /* @__PURE__ */ w.jsx(w.Fragment, { children: /* @__PURE__ */ w.jsx(
426
- he,
982
+ 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(
985
+ ur,
427
986
  {
428
987
  className: "overflow-hidden rounded-b-md border-x border-b",
429
- language: n,
430
- theme: f,
988
+ language: r,
989
+ theme: b,
431
990
  original: e,
432
991
  modified: t,
433
- height: s,
434
- options: d,
435
- onMount: g
992
+ height: i,
993
+ options: p,
994
+ onMount: l
436
995
  }
437
996
  ) });
438
997
  }
439
- var oe = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(oe || {});
440
- function Ve(e) {
441
- const { pathSymbolMap: t, inlineActions: n = [], commandId: r } = e, a = Object.fromEntries(t.entries()), o = [];
442
- return n == null || n.forEach((s) => {
443
- const c = s.actions;
444
- s.selectors.forEach((m) => {
445
- switch (m.type) {
446
- case oe.ContainsPath: {
447
- m.paths.forEach((f) => {
448
- let i = Object.keys(a).map((l) => ({
449
- fullPath: l,
450
- path: l,
451
- symbol: a[l]
452
- })).filter((l) => l.path.startsWith(m.basePath));
453
- i = i.map((l) => ({
454
- ...l,
455
- path: l.path.substring(m.basePath.length)
456
- })), i.filter((l) => f.test(l.path)).forEach((l) => {
457
- const $ = l.fullPath, h = l.symbol, u = h.range;
458
- c.forEach((E) => {
459
- const b = {
460
- range: u,
461
- symbols: [h],
462
- onClick: E.onClick,
463
- data: E.data,
464
- path: $
998
+ var Fe = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Fe || {});
999
+ 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,
1023
+ path: k
465
1024
  };
466
- o.push({
467
- range: u,
1025
+ a.push({
1026
+ range: O,
468
1027
  command: {
469
- id: r,
470
- title: E.title,
471
- arguments: [b]
1028
+ id: n,
1029
+ title: m.title,
1030
+ arguments: [j]
472
1031
  }
473
1032
  });
474
1033
  });
@@ -478,135 +1037,135 @@ function Ve(e) {
478
1037
  }
479
1038
  }
480
1039
  });
481
- }), o;
1040
+ }), a;
482
1041
  }
483
- const U = class U {
1042
+ const te = class te {
484
1043
  static set(t) {
485
- U.data = t;
1044
+ te.data = t;
486
1045
  }
487
1046
  static get() {
488
- return U.data;
1047
+ return te.data;
489
1048
  }
490
1049
  };
491
- J(U, "data", {});
492
- let K = U;
493
- async function ae(e) {
494
- const t = K.get(), { documentSymbolProvider: n } = t.StandaloneServices.get(t.ILanguageFeaturesService);
495
- return await t.OutlineModel.create(n, e);
1050
+ Se(te, "data", {});
1051
+ let ve = te;
1052
+ async function Re(e) {
1053
+ const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
1054
+ return await t.OutlineModel.create(r, e);
496
1055
  }
497
- function se(e) {
1056
+ function qe(e) {
498
1057
  const t = /* @__PURE__ */ new Map();
499
- return G({
1058
+ return Oe({
500
1059
  pathSymbolMap: t,
501
1060
  parentPath: "",
502
1061
  children: e.children,
503
- parentKind: H.SymbolKind.Module
1062
+ parentKind: he.SymbolKind.Module
504
1063
  }), t;
505
1064
  }
506
- function G(e) {
1065
+ function Oe(e) {
507
1066
  switch (e.parentKind) {
508
- case H.SymbolKind.Module: {
509
- Ue(e);
1067
+ case he.SymbolKind.Module: {
1068
+ Cr(e);
510
1069
  break;
511
1070
  }
512
- case H.SymbolKind.Array: {
513
- Ae(e);
1071
+ case he.SymbolKind.Array: {
1072
+ xr(e);
514
1073
  break;
515
1074
  }
516
1075
  default:
517
- Be(e);
1076
+ $r(e);
518
1077
  }
519
1078
  }
520
- function Ue(e) {
1079
+ function Cr(e) {
521
1080
  e.children.forEach((t) => {
522
- var r;
523
- let n = e.parentPath;
524
- t.symbol && (n = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(n, t.symbol)), G({
1081
+ var n;
1082
+ 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({
525
1084
  pathSymbolMap: e.pathSymbolMap,
526
- parentPath: n,
1085
+ parentPath: r,
527
1086
  children: t.children,
528
- parentKind: ((r = t == null ? void 0 : t.symbol) == null ? void 0 : r.kind) ?? e.parentKind
1087
+ parentKind: ((n = t == null ? void 0 : t.symbol) == null ? void 0 : n.kind) ?? e.parentKind
529
1088
  });
530
1089
  });
531
1090
  }
532
- function Ae(e) {
1091
+ function xr(e) {
533
1092
  let t = 0;
534
- e.children.forEach((n) => {
535
- const r = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
536
- e.pathSymbolMap.set(r, n.symbol), t += 1, G({
1093
+ e.children.forEach((r) => {
1094
+ const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
1095
+ e.pathSymbolMap.set(n, r.symbol), t += 1, Oe({
537
1096
  pathSymbolMap: e.pathSymbolMap,
538
- parentPath: r,
539
- children: n.children,
540
- parentKind: n.symbol.kind
1097
+ parentPath: n,
1098
+ children: r.children,
1099
+ parentKind: r.symbol.kind
541
1100
  });
542
1101
  });
543
1102
  }
544
- function Be(e) {
1103
+ function $r(e) {
545
1104
  const t = e.children.get("0");
546
1105
  if (t) {
547
- const n = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
548
- e.pathSymbolMap.set(n, t.symbol);
1106
+ const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
1107
+ e.pathSymbolMap.set(r, t.symbol);
549
1108
  }
550
1109
  }
551
- function Fe({
1110
+ function Lr({
552
1111
  editorRef: e,
553
1112
  inlineActions: t
554
1113
  }) {
555
- P(() => k.languages.registerCodeLensProvider("yaml", {
556
- provideCodeLenses: async (r) => {
557
- var g;
558
- const a = await ae(r), o = se(a), s = (g = e == null ? void 0 : e.current) == null ? void 0 : g.addCommand(0, (m, { onClick: f, path: d, range: i, data: x }) => {
559
- f({ path: d, range: i, data: x });
1114
+ $(() => F.languages.registerCodeLensProvider("yaml", {
1115
+ provideCodeLenses: async (n) => {
1116
+ 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 });
560
1119
  });
561
- return s ? {
562
- lenses: Ve({ pathSymbolMap: o, inlineActions: t, commandId: s }),
1120
+ return i ? {
1121
+ lenses: Pr({ pathSymbolMap: a, inlineActions: t, commandId: i }),
563
1122
  dispose: () => {
564
1123
  }
565
1124
  } : void 0;
566
1125
  }
567
1126
  }).dispose, [t, e]);
568
1127
  }
569
- const ze = ({ editorRef: e, selection: t }) => {
570
- const [n, r] = L(), a = _(
571
- () => async (o, s, c) => {
572
- var i, x, l;
573
- const g = (i = e == null ? void 0 : e.current) == null ? void 0 : i.getModel();
574
- if (!g || !s)
575
- return r(void 0);
576
- const m = await ae(g), d = (x = se(m).get(s)) == null ? void 0 : x.range;
577
- d && (r(d), c && ((l = e == null ? void 0 : e.current) == null || l.revealLineInCenter(d.startLineNumber)));
1128
+ 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)
1134
+ 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)));
578
1137
  },
579
1138
  []
580
1139
  );
581
- P(() => {
1140
+ $(() => {
582
1141
  if ("requestIdleCallback" in window) {
583
- const o = requestIdleCallback(() => {
584
- a(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
1142
+ const a = requestIdleCallback(() => {
1143
+ o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
585
1144
  });
586
- return () => cancelIdleCallback(o);
1145
+ return () => cancelIdleCallback(a);
587
1146
  } else {
588
- const o = setTimeout(() => {
589
- a(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
1147
+ const a = setTimeout(() => {
1148
+ o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
590
1149
  }, 100);
591
- return () => clearTimeout(o);
1150
+ return () => clearTimeout(a);
592
1151
  }
593
- }, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, a]), P(() => {
594
- var s;
595
- if (!n)
1152
+ }, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), $(() => {
1153
+ var i;
1154
+ if (!r)
596
1155
  return;
597
- const o = (s = e == null ? void 0 : e.current) == null ? void 0 : s.createDecorationsCollection([
1156
+ const a = (i = e == null ? void 0 : e.current) == null ? void 0 : i.createDecorationsCollection([
598
1157
  {
599
1158
  // TODO: check why startColumn is set to "end of row"
600
- range: { ...n, startColumn: 1 },
1159
+ range: { ...r, startColumn: 1 },
601
1160
  options: {
602
1161
  isWholeLine: !1,
603
1162
  className: t == null ? void 0 : t.className
604
1163
  }
605
1164
  }
606
1165
  ]);
607
- return () => o == null ? void 0 : o.clear();
608
- }, [n, e, t == null ? void 0 : t.className]);
609
- }, ie = fe({
1166
+ return () => a == null ? void 0 : a.clear();
1167
+ }, [r, e, t == null ? void 0 : t.className]);
1168
+ }, Be = Ge({
610
1169
  markers: [],
611
1170
  setMarkers: () => {
612
1171
  },
@@ -616,52 +1175,52 @@ const ze = ({ editorRef: e, selection: t }) => {
616
1175
  updateCursorPosition: (e) => {
617
1176
  }
618
1177
  });
619
- function tt({
1178
+ function qr({
620
1179
  children: e
621
1180
  }) {
622
- const [t, n] = L([]), [r, a] = L(null), o = q(
623
- (s) => {
624
- r == null || r.setPosition(s), r == null || r.revealLineInCenterIfOutsideViewport(s.lineNumber), r == null || r.focus();
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();
625
1184
  },
626
- [r]
1185
+ [n]
627
1186
  );
628
- return /* @__PURE__ */ w.jsx(
629
- ie.Provider,
1187
+ return /* @__PURE__ */ U.jsx(
1188
+ Be.Provider,
630
1189
  {
631
1190
  value: {
632
1191
  markers: t,
633
- setMarkers: n,
634
- editor: r,
635
- setEditor: a,
636
- updateCursorPosition: o
1192
+ setMarkers: r,
1193
+ editor: n,
1194
+ setEditor: o,
1195
+ updateCursorPosition: a
637
1196
  },
638
1197
  children: e
639
1198
  }
640
1199
  );
641
1200
  }
642
- function ce() {
643
- return pe(ie);
644
- }
645
- const Re = ({ monacoRef: e }) => {
646
- const { setMarkers: t } = ce();
647
- P(() => {
648
- let n;
649
- const r = setTimeout(() => {
650
- var o;
651
- const a = (o = e.current) == null ? void 0 : o.editor;
652
- a && (n = a.onDidChangeMarkers(([s]) => {
653
- const c = a.getModelMarkers({ resource: s });
654
- t(c);
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);
655
1214
  }));
656
1215
  }, 100);
657
1216
  return () => {
658
- clearTimeout(r), n == null || n.dispose();
1217
+ clearTimeout(n), r == null || r.dispose();
659
1218
  };
660
1219
  }, [e]);
661
1220
  };
662
- let ee = !1;
663
- function We(e) {
664
- if (ee)
1221
+ let Ie = !1;
1222
+ function Dr(e) {
1223
+ if (Ie)
665
1224
  return;
666
1225
  const t = {
667
1226
  hover: !0,
@@ -670,109 +1229,109 @@ function We(e) {
670
1229
  validate: !0,
671
1230
  schemas: [e]
672
1231
  };
673
- ee = !0, ye.setDiagnosticsOptions({ ...t });
1232
+ Ie = !0, Xe.setDiagnosticsOptions({ ...t });
674
1233
  }
675
- const le = (e) => ge.parse(`file://${e}`).toString(), Ye = (e) => {
676
- const { schemaConfig: t, instanceId: n } = e;
677
- P(() => {
678
- t != null && t.schema && We({
1234
+ const We = (e) => Qe.parse(`file://${e}`).toString(), Tr = (e) => {
1235
+ const { schemaConfig: t, instanceId: r } = e;
1236
+ $(() => {
1237
+ t != null && t.schema && Dr({
679
1238
  // If YAML file is opened matching this glob
680
- fileMatch: [le(n.toString())],
1239
+ fileMatch: [We(r.toString())],
681
1240
  ...t
682
1241
  });
683
- }, [t == null ? void 0 : t.schema, n]);
1242
+ }, [t == null ? void 0 : t.schema, r]);
684
1243
  };
685
- B.config({ monaco: k });
686
- const He = {
687
- ...z,
1244
+ H.config({ monaco: F });
1245
+ const kr = {
1246
+ ...le,
688
1247
  folding: !0
689
- }, nt = function(t) {
1248
+ }, Br = function(t) {
690
1249
  const {
691
- yamlRevision: n,
692
- schemaConfig: r,
693
- inlineActions: a,
694
- themeConfig: o,
695
- onYamlRevisionChange: s,
696
- selection: c,
697
- theme: g,
698
- options: m,
699
- animateOnUpdate: f = !1,
700
- onAnimateEnd: d
701
- } = t, i = F(), [x] = L("yaml"), { editor: l, setEditor: $ } = ce(), h = C(null), u = C(), E = C({ yaml: "", revisionId: 0 }), b = C(null), N = C(null), T = q(
702
- (p) => {
703
- var v, j, M;
704
- const y = p.split(`
705
- `), O = (v = b.current) == null ? void 0 : v.getModel();
706
- if (O) {
707
- (j = b.current) == null || j.pushUndoStop(), O.setValue("");
708
- let S = 0;
709
- N.current = window.setInterval(() => {
710
- var V;
711
- S < y.length ? (i && ((V = b.current) == null || V.executeEdits("addLine", [
1250
+ yamlRevision: r,
1251
+ schemaConfig: n,
1252
+ inlineActions: o,
1253
+ themeConfig: a,
1254
+ onYamlRevisionChange: i,
1255
+ selection: s,
1256
+ 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();
1265
+ 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", [
712
1271
  {
713
- range: new i.Range(S + 1, 1, S + 1, 1),
714
- text: y[S] + `
1272
+ range: new g.Range(c + 1, 1, c + 1, 1),
1273
+ text: u[c] + `
715
1274
  `
716
1275
  }
717
- ])), S++) : N.current && (clearInterval(N.current), d == null || d());
718
- }, 100), (M = b.current) == null || M.pushUndoStop();
1276
+ ])), c++) : D.current && (clearInterval(D.current), p == null || p());
1277
+ }, 100), (L = j.current) == null || L.pushUndoStop();
719
1278
  }
720
1279
  },
721
- [i]
1280
+ [g]
722
1281
  );
723
- P(() => () => {
724
- N.current && clearInterval(N.current);
1282
+ $(() => () => {
1283
+ D.current && clearInterval(D.current);
725
1284
  }, []);
726
- function D(p, y) {
727
- b.current = p, u.current = y, p.setValue(n.yaml), $(p), setTimeout(() => {
728
- var O;
729
- (O = h.current) != null && O.style && (h.current.style.opacity = "1");
1285
+ function P(d, u) {
1286
+ j.current = d, O.current = u, d.setValue(r.yaml), k(d), setTimeout(() => {
1287
+ var N;
1288
+ (N = M.current) != null && N.style && (M.current.style.opacity = "1");
730
1289
  }, 50);
731
1290
  }
732
- P(() => {
733
- var p;
734
- if (b.current && (!n.revisionId || n.revisionId > Number((p = E.current) == null ? void 0 : p.revisionId))) {
735
- const y = b.current.getModel();
736
- y && (b.current.executeEdits("edit", [
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", [
737
1296
  {
738
- range: y.getFullModelRange(),
739
- text: f ? "" : n.yaml
1297
+ range: u.getFullModelRange(),
1298
+ text: b ? "" : r.yaml
740
1299
  }
741
- ]), f && T(n.yaml));
1300
+ ]), b && E(r.yaml));
742
1301
  }
743
- }, [T, n, f]), Ye({ schemaConfig: r, instanceId: x }), Fe({ editorRef: b, inlineActions: a });
744
- const { theme: I } = R({ monacoRef: u, themeConfig: o, editor: l, theme: g });
745
- Re({ monacoRef: u }), ze({ editorRef: b, selection: c });
746
- const W = _(
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(
747
1306
  () => ({
748
- ...He,
749
- ...m
1307
+ ...kr,
1308
+ ...f
750
1309
  }),
751
- [m]
1310
+ [f]
752
1311
  );
753
- return /* @__PURE__ */ w.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: h, children: /* @__PURE__ */ w.jsx(
754
- Z,
1312
+ return /* @__PURE__ */ U.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: M, children: /* @__PURE__ */ U.jsx(
1313
+ we,
755
1314
  {
756
- onChange: (p, y) => {
757
- E.current = { yaml: p ?? "", revisionId: y.versionId }, s({ ...E.current }, y);
1315
+ onChange: (d, u) => {
1316
+ m.current = { yaml: d ?? "", revisionId: u.versionId }, i({ ...m.current }, u);
758
1317
  },
759
1318
  language: "yaml",
760
- theme: I,
761
- options: W,
762
- path: le(x),
763
- onMount: D
1319
+ theme: S,
1320
+ options: z,
1321
+ path: We(I),
1322
+ onMount: P
764
1323
  }
765
1324
  ) });
766
1325
  };
767
1326
  export {
768
- Qe as BlameEditor,
769
- et as CodeDiffEditor,
770
- Xe as CodeEditor,
771
- K as MonacoGlobals,
772
- oe as SelectorType,
773
- nt as YamlEditor,
774
- ie as YamlEditorContext,
775
- tt as YamlEditorContextProvider,
776
- ce as useYamlEditorContext
1327
+ zr as BlameEditor,
1328
+ Rr as CodeDiffEditor,
1329
+ Fr as CodeEditor,
1330
+ ve as MonacoGlobals,
1331
+ Fe as SelectorType,
1332
+ Br as YamlEditor,
1333
+ Be as YamlEditorContext,
1334
+ qr as YamlEditorContextProvider,
1335
+ He as useYamlEditorContext
777
1336
  };
778
1337
  //# sourceMappingURL=index.js.map