@harnessio/yaml-editor 0.15.0 → 0.16.0-react18.alpha.2
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 +340 -378
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,47 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var J = (
|
|
4
|
-
import
|
|
5
|
-
import Z, { loader as A, useMonaco as
|
|
6
|
-
import * as
|
|
7
|
-
import { languages as H, Uri as
|
|
8
|
-
import { yamlDefaults as
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(c) Sindre Sorhus
|
|
13
|
-
@license MIT
|
|
14
|
-
*/
|
|
15
|
-
var Q = Object.getOwnPropertySymbols, be = Object.prototype.hasOwnProperty, ve = Object.prototype.propertyIsEnumerable;
|
|
16
|
-
function Se(e) {
|
|
17
|
-
if (e == null)
|
|
18
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
19
|
-
return Object(e);
|
|
20
|
-
}
|
|
21
|
-
function xe() {
|
|
22
|
-
try {
|
|
23
|
-
if (!Object.assign)
|
|
24
|
-
return !1;
|
|
25
|
-
var e = new String("abc");
|
|
26
|
-
if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5")
|
|
27
|
-
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];
|
|
32
|
-
});
|
|
33
|
-
if (r.join("") !== "0123456789")
|
|
34
|
-
return !1;
|
|
35
|
-
var a = {};
|
|
36
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(o) {
|
|
37
|
-
a[o] = o;
|
|
38
|
-
}), Object.keys(Object.assign({}, a)).join("") === "abcdefghijklmnopqrst";
|
|
39
|
-
} catch {
|
|
40
|
-
return !1;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
xe();
|
|
44
|
-
/** @license React v17.0.2
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var ce = (t, e, n) => e in t ? ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var J = (t, e, n) => (ce(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import le, { useState as _, useEffect as w, useRef as P, useMemo as T, useCallback as q, createContext as ue, useContext as de } from "react";
|
|
5
|
+
import Z, { loader as A, useMonaco as U, DiffEditor as me } from "@monaco-editor/react";
|
|
6
|
+
import * as L from "monaco-editor";
|
|
7
|
+
import { languages as H, Uri as fe } from "monaco-editor";
|
|
8
|
+
import { yamlDefaults as he } from "monaco-yaml";
|
|
9
|
+
var X = { exports: {} }, B = {};
|
|
10
|
+
/**
|
|
11
|
+
* @license React
|
|
45
12
|
* react-jsx-runtime.production.min.js
|
|
46
13
|
*
|
|
47
14
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -49,28 +16,23 @@ xe();
|
|
|
49
16
|
* This source code is licensed under the MIT license found in the
|
|
50
17
|
* LICENSE file in the root directory of this source tree.
|
|
51
18
|
*/
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
if (typeof Symbol == "function" && Symbol.for) {
|
|
55
|
-
var X = Symbol.for;
|
|
56
|
-
ne = X("react.element"), U.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) {
|
|
19
|
+
var pe = le, ge = Symbol.for("react.element"), ye = Symbol.for("react.fragment"), ve = Object.prototype.hasOwnProperty, be = pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Se = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function ee(t, e, n) {
|
|
60
21
|
var r, a = {}, o = null, s = null;
|
|
61
|
-
n !== void 0 && (o = "" + n),
|
|
62
|
-
for (r in
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
for (r in
|
|
66
|
-
a[r] === void 0 && (a[r] =
|
|
67
|
-
return { $$typeof:
|
|
22
|
+
n !== void 0 && (o = "" + n), e.key !== void 0 && (o = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
|
23
|
+
for (r in e)
|
|
24
|
+
ve.call(e, r) && !Se.hasOwnProperty(r) && (a[r] = e[r]);
|
|
25
|
+
if (t && t.defaultProps)
|
|
26
|
+
for (r in e = t.defaultProps, e)
|
|
27
|
+
a[r] === void 0 && (a[r] = e[r]);
|
|
28
|
+
return { $$typeof: ge, type: t, key: o, ref: s, props: a, _owner: be.current };
|
|
68
29
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
30
|
+
B.Fragment = ye;
|
|
31
|
+
B.jsx = ee;
|
|
32
|
+
B.jsxs = ee;
|
|
33
|
+
X.exports = B;
|
|
34
|
+
var k = X.exports;
|
|
35
|
+
const z = {
|
|
74
36
|
selectOnLineNumbers: !0,
|
|
75
37
|
scrollBeyondLastLine: !1,
|
|
76
38
|
padding: {
|
|
@@ -90,82 +52,82 @@ const F = {
|
|
|
90
52
|
overviewRulerBorder: !1,
|
|
91
53
|
overviewRulerLanes: 0,
|
|
92
54
|
renderLineHighlight: "none"
|
|
93
|
-
},
|
|
94
|
-
const { themeConfig:
|
|
95
|
-
return
|
|
96
|
-
var
|
|
97
|
-
(
|
|
98
|
-
|
|
55
|
+
}, F = (t) => {
|
|
56
|
+
const { themeConfig: e, editor: n, theme: r } = t, { defaultTheme: a } = e ?? {}, [o, s] = _(r ?? a ?? "vs-dark");
|
|
57
|
+
return w(() => {
|
|
58
|
+
var y;
|
|
59
|
+
(y = e == null ? void 0 : e.themes) == null || y.forEach((h) => {
|
|
60
|
+
L.editor.defineTheme(h.themeName, h.themeData);
|
|
99
61
|
});
|
|
100
|
-
}, [
|
|
101
|
-
|
|
62
|
+
}, [L]), w(() => {
|
|
63
|
+
L.editor && r && (L.editor.setTheme(r), s(r));
|
|
102
64
|
}, [n, r]), { theme: o };
|
|
103
65
|
};
|
|
104
|
-
function
|
|
105
|
-
const
|
|
66
|
+
function xe(t) {
|
|
67
|
+
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
106
68
|
let n = "";
|
|
107
|
-
for (let r = 0; r <
|
|
108
|
-
n +=
|
|
69
|
+
for (let r = 0; r < t; r++)
|
|
70
|
+
n += e.charAt(Math.floor(Math.random() * e.length));
|
|
109
71
|
return n;
|
|
110
72
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
73
|
+
function Ee(t) {
|
|
74
|
+
return t.replace("'", "'");
|
|
113
75
|
}
|
|
114
|
-
function
|
|
115
|
-
instanceId:
|
|
116
|
-
lineNumbersPosition:
|
|
76
|
+
function Me({
|
|
77
|
+
instanceId: t,
|
|
78
|
+
lineNumbersPosition: e
|
|
117
79
|
}) {
|
|
118
80
|
let n = "";
|
|
119
|
-
return
|
|
120
|
-
.monaco-editor-${
|
|
81
|
+
return e === "center" && (n += `
|
|
82
|
+
.monaco-editor-${t} .monaco-scrollable-element.editor-scrollable {
|
|
121
83
|
width: 100% !important;
|
|
122
84
|
left: 0px !important;
|
|
123
85
|
}
|
|
124
86
|
|
|
125
|
-
.monaco-editor-${
|
|
87
|
+
.monaco-editor-${t} .view-lines, .view-zones {
|
|
126
88
|
width: 100% !important;
|
|
127
89
|
}
|
|
128
90
|
|
|
129
|
-
.monaco-editor-${
|
|
91
|
+
.monaco-editor-${t} .margin {
|
|
130
92
|
z-index: 1000;
|
|
131
93
|
background: transparent !important;
|
|
132
94
|
}`), n += `
|
|
133
|
-
.monaco-editor-${
|
|
95
|
+
.monaco-editor-${t} .blame-editor-separator {
|
|
134
96
|
right: 14px;
|
|
135
97
|
pointer-events: none;
|
|
136
98
|
}
|
|
137
99
|
|
|
138
|
-
.monaco-editor-${
|
|
100
|
+
.monaco-editor-${t} {
|
|
139
101
|
outline: none !important;
|
|
140
102
|
}
|
|
141
103
|
|
|
142
|
-
.monaco-editor-${
|
|
104
|
+
.monaco-editor-${t} .view-line .blame-editor-commit {
|
|
143
105
|
display: inline-block;
|
|
144
106
|
color: var(--canary-foreground-01);
|
|
145
107
|
}`, n;
|
|
146
108
|
}
|
|
147
|
-
function
|
|
148
|
-
instanceId:
|
|
149
|
-
blameData:
|
|
109
|
+
function Ce({
|
|
110
|
+
instanceId: t,
|
|
111
|
+
blameData: e,
|
|
150
112
|
dateWidth: n,
|
|
151
113
|
avatarSize: r
|
|
152
114
|
}) {
|
|
153
115
|
let a = "";
|
|
154
|
-
return
|
|
155
|
-
var
|
|
156
|
-
const s = (
|
|
157
|
-
for (let
|
|
158
|
-
|
|
159
|
-
.monaco-editor-${
|
|
160
|
-
content: '${
|
|
116
|
+
return e.forEach((o) => {
|
|
117
|
+
var l, u, i, v, E, c, b, d;
|
|
118
|
+
const s = (u = (l = o == null ? void 0 : o.commitInfo) == null ? void 0 : l.author) == null ? void 0 : u.avatarUrl, y = (v = (i = o == null ? void 0 : o.commitInfo) == null ? void 0 : i.author) == null ? void 0 : v.initials, h = s ? `background: url('${(c = (E = o == null ? void 0 : o.commitInfo) == null ? void 0 : E.author) == null ? void 0 : c.avatarUrl}');` : "";
|
|
119
|
+
for (let f = o.fromLineNumber; f <= o.toLineNumber; f++)
|
|
120
|
+
f === o.fromLineNumber ? a += `
|
|
121
|
+
.monaco-editor-${t} .view-line .blame-editor-commit-${f}:before {
|
|
122
|
+
content: '${Ee(((d = (b = o == null ? void 0 : o.commitInfo) == null ? void 0 : b.author) == null ? void 0 : d.when) || "")}';
|
|
161
123
|
position: absolute;
|
|
162
124
|
left: 10px;
|
|
163
125
|
top: 0px;
|
|
164
126
|
color: hsl(var(--canary-foreground-03));
|
|
165
127
|
}
|
|
166
128
|
|
|
167
|
-
.monaco-editor-${
|
|
168
|
-
content: '${
|
|
129
|
+
.monaco-editor-${t} .view-line .blame-editor-commit-${f}:after {
|
|
130
|
+
content: '${y ?? " "}';
|
|
169
131
|
position: absolute;
|
|
170
132
|
border-radius: 50%;
|
|
171
133
|
padding: 4px;
|
|
@@ -180,7 +142,7 @@ function je({
|
|
|
180
142
|
${h}
|
|
181
143
|
background-size: 100% 100%;
|
|
182
144
|
}` : a += `
|
|
183
|
-
.monaco-editor-${
|
|
145
|
+
.monaco-editor-${t} .view-line .blame-editor-commit-${f}:before {
|
|
184
146
|
content: ' ';
|
|
185
147
|
left: 10px;
|
|
186
148
|
top: 0px;
|
|
@@ -188,13 +150,13 @@ function je({
|
|
|
188
150
|
}`;
|
|
189
151
|
}), a;
|
|
190
152
|
}
|
|
191
|
-
function
|
|
153
|
+
function $e(t, e) {
|
|
192
154
|
let n = "";
|
|
193
|
-
return
|
|
155
|
+
return t.length > e ? n = t.slice(0, e - 3) + "..." : t.length < e ? n = t + " ".repeat(e - t.length) : n = t, " ".repeat(25) + n + " ".repeat(10);
|
|
194
156
|
}
|
|
195
|
-
A.config({ monaco:
|
|
196
|
-
const Y = 450,
|
|
197
|
-
...
|
|
157
|
+
A.config({ monaco: L });
|
|
158
|
+
const Y = 450, Pe = 30, ke = 140, we = 24, Oe = {
|
|
159
|
+
...z,
|
|
198
160
|
readOnly: !0,
|
|
199
161
|
matchBrackets: "never",
|
|
200
162
|
renderValidationDecorations: "off",
|
|
@@ -204,205 +166,205 @@ const Y = 450, ke = 30, De = 140, Le = 24, _e = {
|
|
|
204
166
|
renderWhitespace: "none",
|
|
205
167
|
renderLineHighlight: "none"
|
|
206
168
|
};
|
|
207
|
-
function
|
|
208
|
-
code:
|
|
209
|
-
language:
|
|
169
|
+
function Ke({
|
|
170
|
+
code: t,
|
|
171
|
+
language: e,
|
|
210
172
|
themeConfig: n,
|
|
211
173
|
lineNumbersPosition: r = "left",
|
|
212
174
|
blameData: a,
|
|
213
175
|
showSeparators: o = !0,
|
|
214
176
|
theme: s,
|
|
215
|
-
height:
|
|
177
|
+
height: y = "75vh",
|
|
216
178
|
options: h
|
|
217
179
|
}) {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
const [i,
|
|
221
|
-
|
|
222
|
-
|
|
180
|
+
const l = P(a), u = P(xe(5));
|
|
181
|
+
U();
|
|
182
|
+
const [i, v] = _(), [E, c] = _(0), b = P(null), d = P(null);
|
|
183
|
+
w(() => {
|
|
184
|
+
l.current = a;
|
|
223
185
|
}, [a]);
|
|
224
|
-
function
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
186
|
+
function f() {
|
|
187
|
+
const m = d.current, p = b.current;
|
|
188
|
+
if (!m || !p)
|
|
227
189
|
return;
|
|
228
|
-
o &&
|
|
229
|
-
|
|
190
|
+
o && m.changeViewZones(function(g) {
|
|
191
|
+
g.addZone({
|
|
230
192
|
afterLineNumber: 0,
|
|
231
193
|
heightInPx: 10,
|
|
232
194
|
domNode: document.createElement("div")
|
|
233
|
-
}),
|
|
234
|
-
if (M !==
|
|
195
|
+
}), l.current.forEach((O, M) => {
|
|
196
|
+
if (M !== l.current.length - 1) {
|
|
235
197
|
const x = document.createElement("div");
|
|
236
|
-
x.style.borderTop = "1px solid hsl(var(--canary-border-01))", x.style.marginTop = "9px", x.className = "blame-editor-separator",
|
|
237
|
-
afterLineNumber:
|
|
198
|
+
x.style.borderTop = "1px solid hsl(var(--canary-border-01))", x.style.marginTop = "9px", x.className = "blame-editor-separator", g.addZone({
|
|
199
|
+
afterLineNumber: O.toLineNumber,
|
|
238
200
|
heightInPx: 20,
|
|
239
201
|
domNode: x
|
|
240
202
|
});
|
|
241
203
|
}
|
|
242
204
|
});
|
|
243
205
|
});
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
var
|
|
247
|
-
for (let M =
|
|
248
|
-
|
|
249
|
-
range: new
|
|
206
|
+
const $ = [];
|
|
207
|
+
l.current.forEach((g) => {
|
|
208
|
+
var O;
|
|
209
|
+
for (let M = g.fromLineNumber; M <= g.toLineNumber; M++)
|
|
210
|
+
$.push({
|
|
211
|
+
range: new p.Range(M, 0, M + 1, 0),
|
|
250
212
|
options: {
|
|
251
213
|
before: {
|
|
252
|
-
content:
|
|
253
|
-
M ===
|
|
254
|
-
|
|
214
|
+
content: $e(
|
|
215
|
+
M === g.fromLineNumber && ((O = g == null ? void 0 : g.commitInfo) == null ? void 0 : O.title) || "",
|
|
216
|
+
Pe
|
|
255
217
|
),
|
|
256
|
-
cursorStops:
|
|
218
|
+
cursorStops: p.editor.InjectedTextCursorStops.None,
|
|
257
219
|
inlineClassName: `blame-editor-commit blame-editor-commit-${M}`
|
|
258
220
|
}
|
|
259
221
|
}
|
|
260
222
|
});
|
|
261
|
-
}),
|
|
223
|
+
}), m.createDecorationsCollection($);
|
|
262
224
|
}
|
|
263
|
-
function
|
|
264
|
-
var
|
|
265
|
-
|
|
225
|
+
function C(m, p) {
|
|
226
|
+
var $, g, O, M, x, I;
|
|
227
|
+
d.current = m, b.current = p, m.setValue(t), v(m), (O = (g = ($ = p.languages.typescript) == null ? void 0 : $.typescriptDefaults) == null ? void 0 : g.setDiagnosticsOptions) == null || O.call(g, {
|
|
266
228
|
noSuggestionDiagnostics: !0,
|
|
267
229
|
noSyntaxValidation: !0,
|
|
268
230
|
noSemanticValidation: !0
|
|
269
|
-
}), (I = (x = (M =
|
|
231
|
+
}), (I = (x = (M = p.languages.typescript) == null ? void 0 : M.javascriptDefaults) == null ? void 0 : x.setDiagnosticsOptions) == null || I.call(x, {
|
|
270
232
|
noSuggestionDiagnostics: !0,
|
|
271
233
|
noSyntaxValidation: !0,
|
|
272
234
|
noSemanticValidation: !0
|
|
273
|
-
}),
|
|
235
|
+
}), f();
|
|
274
236
|
}
|
|
275
|
-
|
|
276
|
-
i == null || i.setValue(
|
|
277
|
-
}, [
|
|
278
|
-
const { theme: S } =
|
|
279
|
-
() =>
|
|
280
|
-
instanceId:
|
|
237
|
+
w(() => {
|
|
238
|
+
i == null || i.setValue(t);
|
|
239
|
+
}, [t]);
|
|
240
|
+
const { theme: S } = F({ monacoRef: b, themeConfig: n, editor: i, theme: s }), N = T(
|
|
241
|
+
() => Me({
|
|
242
|
+
instanceId: u.current,
|
|
281
243
|
lineNumbersPosition: r
|
|
282
244
|
}),
|
|
283
245
|
[a]
|
|
284
|
-
),
|
|
285
|
-
() =>
|
|
286
|
-
instanceId:
|
|
246
|
+
), D = T(
|
|
247
|
+
() => Ce({
|
|
248
|
+
instanceId: u.current,
|
|
287
249
|
blameData: a,
|
|
288
|
-
avatarSize:
|
|
289
|
-
dateWidth:
|
|
250
|
+
avatarSize: we,
|
|
251
|
+
dateWidth: ke
|
|
290
252
|
}),
|
|
291
253
|
[a]
|
|
292
254
|
);
|
|
293
|
-
|
|
255
|
+
w(() => {
|
|
294
256
|
if (r === "center") {
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
for (const M of
|
|
299
|
-
const x = parseInt(getComputedStyle(
|
|
300
|
-
|
|
257
|
+
const m = document.getElementsByClassName("lines-content")[0];
|
|
258
|
+
if (m) {
|
|
259
|
+
const p = { attributes: !0 }, $ = (O) => {
|
|
260
|
+
for (const M of O) {
|
|
261
|
+
const x = parseInt(getComputedStyle(m).left);
|
|
262
|
+
c(x);
|
|
301
263
|
}
|
|
302
|
-
},
|
|
303
|
-
return
|
|
304
|
-
|
|
264
|
+
}, g = new MutationObserver($);
|
|
265
|
+
return g.observe(m, p), () => {
|
|
266
|
+
g.disconnect();
|
|
305
267
|
};
|
|
306
268
|
}
|
|
307
269
|
}
|
|
308
270
|
});
|
|
309
|
-
const
|
|
310
|
-
.monaco-editor-${
|
|
271
|
+
const j = T(() => `
|
|
272
|
+
.monaco-editor-${u.current} .margin {
|
|
311
273
|
left: ${Y + 16 + E}px !important;
|
|
312
274
|
pointer-events: none;
|
|
313
275
|
}`, [E]), R = `
|
|
314
|
-
.monaco-editor-${
|
|
276
|
+
.monaco-editor-${u.current} .view-overlays {
|
|
315
277
|
clip-path: polygon(${Y + 16}px 0, 100% 0%, 100% 100%, ${Y + 16}px 100%);
|
|
316
278
|
height:100% !important;
|
|
317
|
-
}`, W =
|
|
279
|
+
}`, W = T(
|
|
318
280
|
() => ({
|
|
319
|
-
...
|
|
281
|
+
...Oe,
|
|
320
282
|
...h
|
|
321
283
|
}),
|
|
322
284
|
[h]
|
|
323
285
|
);
|
|
324
|
-
return /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
286
|
+
return /* @__PURE__ */ k.jsxs(k.Fragment, { children: [
|
|
287
|
+
/* @__PURE__ */ k.jsx(
|
|
326
288
|
"style",
|
|
327
289
|
{
|
|
328
290
|
dangerouslySetInnerHTML: {
|
|
329
|
-
__html: `${N} ${
|
|
291
|
+
__html: `${N} ${D} ${j} ${R}`
|
|
330
292
|
}
|
|
331
293
|
}
|
|
332
294
|
),
|
|
333
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ k.jsx(
|
|
334
296
|
Z,
|
|
335
297
|
{
|
|
336
|
-
className: `monaco-editor-${
|
|
337
|
-
height:
|
|
338
|
-
language:
|
|
298
|
+
className: `monaco-editor-${u.current} overflow-hidden rounded-b-md border-x border-b`,
|
|
299
|
+
height: y,
|
|
300
|
+
language: e,
|
|
339
301
|
theme: S,
|
|
340
302
|
options: W,
|
|
341
|
-
onMount:
|
|
303
|
+
onMount: C
|
|
342
304
|
}
|
|
343
305
|
)
|
|
344
306
|
] });
|
|
345
307
|
}
|
|
346
|
-
A.config({ monaco:
|
|
347
|
-
const
|
|
348
|
-
...
|
|
308
|
+
A.config({ monaco: L });
|
|
309
|
+
const Ne = {
|
|
310
|
+
...z
|
|
349
311
|
};
|
|
350
|
-
function
|
|
351
|
-
codeRevision:
|
|
352
|
-
onCodeRevisionChange:
|
|
312
|
+
function qe({
|
|
313
|
+
codeRevision: t,
|
|
314
|
+
onCodeRevisionChange: e,
|
|
353
315
|
language: n,
|
|
354
316
|
themeConfig: r,
|
|
355
317
|
options: a,
|
|
356
318
|
theme: o,
|
|
357
319
|
height: s = "75vh"
|
|
358
320
|
}) {
|
|
359
|
-
|
|
360
|
-
const [
|
|
361
|
-
(
|
|
362
|
-
var
|
|
363
|
-
i.current =
|
|
321
|
+
U();
|
|
322
|
+
const [y, h] = _(), l = P(), u = P({ code: "", revisionId: 0 }), i = P(null), v = q(
|
|
323
|
+
(b, d) => {
|
|
324
|
+
var f, C, S, N, D, j;
|
|
325
|
+
i.current = b, l.current = d, b.setValue(t.code), h(b), (S = (C = (f = d.languages.typescript) == null ? void 0 : f.typescriptDefaults) == null ? void 0 : C.setDiagnosticsOptions) == null || S.call(C, {
|
|
364
326
|
noSuggestionDiagnostics: !0,
|
|
365
327
|
noSyntaxValidation: !0,
|
|
366
328
|
noSemanticValidation: !0
|
|
367
|
-
}), (
|
|
329
|
+
}), (j = (D = (N = d.languages.typescript) == null ? void 0 : N.javascriptDefaults) == null ? void 0 : D.setDiagnosticsOptions) == null || j.call(D, {
|
|
368
330
|
noSuggestionDiagnostics: !0,
|
|
369
331
|
noSyntaxValidation: !0,
|
|
370
332
|
noSemanticValidation: !0
|
|
371
333
|
});
|
|
372
334
|
},
|
|
373
|
-
[
|
|
335
|
+
[t.code]
|
|
374
336
|
);
|
|
375
|
-
|
|
376
|
-
var
|
|
377
|
-
if (i.current && (!
|
|
378
|
-
const
|
|
379
|
-
|
|
337
|
+
w(() => {
|
|
338
|
+
var b, d;
|
|
339
|
+
if (i.current && (!t.revisionId || t.revisionId > Number((b = u.current) == null ? void 0 : b.revisionId))) {
|
|
340
|
+
const f = i.current.getModel();
|
|
341
|
+
f && (a != null && a.readOnly ? (d = i.current) == null || d.setValue(t.code) : (i.current.pushUndoStop(), i.current.executeEdits("edit", [
|
|
380
342
|
{
|
|
381
|
-
range:
|
|
382
|
-
text:
|
|
343
|
+
range: f.getFullModelRange(),
|
|
344
|
+
text: t.code
|
|
383
345
|
}
|
|
384
346
|
]), i.current.pushUndoStop()));
|
|
385
347
|
}
|
|
386
|
-
}, [
|
|
387
|
-
const { theme: E } =
|
|
388
|
-
return /* @__PURE__ */
|
|
348
|
+
}, [t, i.current]);
|
|
349
|
+
const { theme: E } = F({ monacoRef: l, themeConfig: r, editor: y, theme: o }), c = T(() => ({ ...Ne, ...a || {} }), [a]);
|
|
350
|
+
return /* @__PURE__ */ k.jsx(k.Fragment, { children: /* @__PURE__ */ k.jsx(
|
|
389
351
|
Z,
|
|
390
352
|
{
|
|
391
353
|
className: "overflow-hidden rounded-b-md border-x border-b",
|
|
392
354
|
height: s,
|
|
393
|
-
onChange: (
|
|
394
|
-
|
|
355
|
+
onChange: (b, d) => {
|
|
356
|
+
u.current = { code: b ?? "", revisionId: d.versionId }, e({ ...u.current }, d);
|
|
395
357
|
},
|
|
396
358
|
language: n,
|
|
397
359
|
theme: E,
|
|
398
|
-
options:
|
|
399
|
-
onMount:
|
|
360
|
+
options: c,
|
|
361
|
+
onMount: v
|
|
400
362
|
}
|
|
401
363
|
) });
|
|
402
364
|
}
|
|
403
|
-
A.config({ monaco:
|
|
404
|
-
const
|
|
405
|
-
...
|
|
365
|
+
A.config({ monaco: L });
|
|
366
|
+
const De = {
|
|
367
|
+
...z,
|
|
406
368
|
codeLens: !1,
|
|
407
369
|
smartSelect: {
|
|
408
370
|
selectLeadingAndTrailingWhitespace: !0
|
|
@@ -410,63 +372,63 @@ const Ie = {
|
|
|
410
372
|
originalEditable: !1,
|
|
411
373
|
overviewRulerBorder: !1
|
|
412
374
|
};
|
|
413
|
-
function
|
|
414
|
-
original:
|
|
415
|
-
modified:
|
|
375
|
+
function Ze({
|
|
376
|
+
original: t,
|
|
377
|
+
modified: e,
|
|
416
378
|
language: n,
|
|
417
379
|
themeConfig: r,
|
|
418
380
|
options: a,
|
|
419
381
|
theme: o,
|
|
420
382
|
height: s = "75vh"
|
|
421
383
|
}) {
|
|
422
|
-
|
|
423
|
-
const [
|
|
424
|
-
return /* @__PURE__ */
|
|
425
|
-
|
|
384
|
+
U();
|
|
385
|
+
const [y, h] = _(), l = P(), { theme: u } = F({ monacoRef: l, themeConfig: r, editor: y, theme: o }), i = T(() => ({ ...De, ...a || {} }), [a]);
|
|
386
|
+
return /* @__PURE__ */ k.jsx(k.Fragment, { children: /* @__PURE__ */ k.jsx(
|
|
387
|
+
me,
|
|
426
388
|
{
|
|
427
389
|
className: "overflow-hidden rounded-b-md border-x border-b",
|
|
428
390
|
language: n,
|
|
429
|
-
theme:
|
|
430
|
-
original:
|
|
431
|
-
modified:
|
|
391
|
+
theme: u,
|
|
392
|
+
original: t,
|
|
393
|
+
modified: e,
|
|
432
394
|
height: s,
|
|
433
395
|
options: i,
|
|
434
396
|
onMount: h
|
|
435
397
|
}
|
|
436
398
|
) });
|
|
437
399
|
}
|
|
438
|
-
var
|
|
439
|
-
function
|
|
440
|
-
const { pathSymbolMap:
|
|
400
|
+
var te = /* @__PURE__ */ ((t) => (t.ContainsPath = "ContainsPath", t))(te || {});
|
|
401
|
+
function Le(t) {
|
|
402
|
+
const { pathSymbolMap: e, inlineActions: n = [], commandId: r } = t, a = Object.fromEntries(e.entries()), o = [];
|
|
441
403
|
return n == null || n.forEach((s) => {
|
|
442
|
-
const
|
|
443
|
-
s.selectors.forEach((
|
|
444
|
-
switch (
|
|
445
|
-
case
|
|
446
|
-
|
|
447
|
-
let
|
|
448
|
-
fullPath:
|
|
449
|
-
path:
|
|
450
|
-
symbol: a[
|
|
451
|
-
})).filter((
|
|
452
|
-
|
|
453
|
-
...
|
|
454
|
-
path:
|
|
455
|
-
})),
|
|
456
|
-
const
|
|
457
|
-
|
|
404
|
+
const y = s.actions;
|
|
405
|
+
s.selectors.forEach((l) => {
|
|
406
|
+
switch (l.type) {
|
|
407
|
+
case te.ContainsPath: {
|
|
408
|
+
l.paths.forEach((u) => {
|
|
409
|
+
let v = Object.keys(a).map((c) => ({
|
|
410
|
+
fullPath: c,
|
|
411
|
+
path: c,
|
|
412
|
+
symbol: a[c]
|
|
413
|
+
})).filter((c) => c.path.startsWith(l.basePath));
|
|
414
|
+
v = v.map((c) => ({
|
|
415
|
+
...c,
|
|
416
|
+
path: c.path.substring(l.basePath.length)
|
|
417
|
+
})), v.filter((c) => u.test(c.path)).forEach((c) => {
|
|
418
|
+
const b = c.fullPath, d = c.symbol, f = d.range;
|
|
419
|
+
y.forEach((C) => {
|
|
458
420
|
const S = {
|
|
459
|
-
range:
|
|
460
|
-
symbols: [
|
|
461
|
-
onClick:
|
|
462
|
-
data:
|
|
463
|
-
path:
|
|
421
|
+
range: f,
|
|
422
|
+
symbols: [d],
|
|
423
|
+
onClick: C.onClick,
|
|
424
|
+
data: C.data,
|
|
425
|
+
path: b
|
|
464
426
|
};
|
|
465
427
|
o.push({
|
|
466
|
-
range:
|
|
428
|
+
range: f,
|
|
467
429
|
command: {
|
|
468
430
|
id: r,
|
|
469
|
-
title:
|
|
431
|
+
title: C.title,
|
|
470
432
|
arguments: [S]
|
|
471
433
|
}
|
|
472
434
|
});
|
|
@@ -480,8 +442,8 @@ function Ve(e) {
|
|
|
480
442
|
}), o;
|
|
481
443
|
}
|
|
482
444
|
const V = class V {
|
|
483
|
-
static set(
|
|
484
|
-
V.data =
|
|
445
|
+
static set(e) {
|
|
446
|
+
V.data = e;
|
|
485
447
|
}
|
|
486
448
|
static get() {
|
|
487
449
|
return V.data;
|
|
@@ -489,289 +451,289 @@ const V = class V {
|
|
|
489
451
|
};
|
|
490
452
|
J(V, "data", {});
|
|
491
453
|
let K = V;
|
|
492
|
-
async function
|
|
493
|
-
const
|
|
494
|
-
return await
|
|
454
|
+
async function ne(t) {
|
|
455
|
+
const e = K.get(), { documentSymbolProvider: n } = e.StandaloneServices.get(e.ILanguageFeaturesService);
|
|
456
|
+
return await e.OutlineModel.create(n, t);
|
|
495
457
|
}
|
|
496
|
-
function
|
|
497
|
-
const
|
|
458
|
+
function re(t) {
|
|
459
|
+
const e = /* @__PURE__ */ new Map();
|
|
498
460
|
return G({
|
|
499
|
-
pathSymbolMap:
|
|
461
|
+
pathSymbolMap: e,
|
|
500
462
|
parentPath: "",
|
|
501
|
-
children:
|
|
463
|
+
children: t.children,
|
|
502
464
|
parentKind: H.SymbolKind.Module
|
|
503
|
-
}),
|
|
465
|
+
}), e;
|
|
504
466
|
}
|
|
505
|
-
function G(
|
|
506
|
-
switch (
|
|
467
|
+
function G(t) {
|
|
468
|
+
switch (t.parentKind) {
|
|
507
469
|
case H.SymbolKind.Module: {
|
|
508
|
-
|
|
470
|
+
_e(t);
|
|
509
471
|
break;
|
|
510
472
|
}
|
|
511
473
|
case H.SymbolKind.Array: {
|
|
512
|
-
|
|
474
|
+
Te(t);
|
|
513
475
|
break;
|
|
514
476
|
}
|
|
515
477
|
default:
|
|
516
|
-
|
|
478
|
+
je(t);
|
|
517
479
|
}
|
|
518
480
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
481
|
+
function _e(t) {
|
|
482
|
+
t.children.forEach((e) => {
|
|
521
483
|
var r;
|
|
522
|
-
let n =
|
|
523
|
-
|
|
524
|
-
pathSymbolMap:
|
|
484
|
+
let n = t.parentPath;
|
|
485
|
+
e.symbol && (n = t.parentPath ? `${t.parentPath}.${e.symbol.name}` : e.symbol.name, t.pathSymbolMap.set(n, e.symbol)), G({
|
|
486
|
+
pathSymbolMap: t.pathSymbolMap,
|
|
525
487
|
parentPath: n,
|
|
526
|
-
children:
|
|
527
|
-
parentKind: ((r =
|
|
488
|
+
children: e.children,
|
|
489
|
+
parentKind: ((r = e == null ? void 0 : e.symbol) == null ? void 0 : r.kind) ?? t.parentKind
|
|
528
490
|
});
|
|
529
491
|
});
|
|
530
492
|
}
|
|
531
|
-
function
|
|
532
|
-
let
|
|
533
|
-
|
|
534
|
-
const r =
|
|
535
|
-
|
|
536
|
-
pathSymbolMap:
|
|
493
|
+
function Te(t) {
|
|
494
|
+
let e = 0;
|
|
495
|
+
t.children.forEach((n) => {
|
|
496
|
+
const r = t.parentPath ? `${t.parentPath}.${e}` : `${e}`;
|
|
497
|
+
t.pathSymbolMap.set(r, n.symbol), e += 1, G({
|
|
498
|
+
pathSymbolMap: t.pathSymbolMap,
|
|
537
499
|
parentPath: r,
|
|
538
500
|
children: n.children,
|
|
539
501
|
parentKind: n.symbol.kind
|
|
540
502
|
});
|
|
541
503
|
});
|
|
542
504
|
}
|
|
543
|
-
function
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
546
|
-
const n =
|
|
547
|
-
|
|
505
|
+
function je(t) {
|
|
506
|
+
const e = t.children.get("0");
|
|
507
|
+
if (e) {
|
|
508
|
+
const n = t.parentPath ? `${t.parentPath}.${e.symbol.name}` : e == null ? void 0 : e.symbol.name;
|
|
509
|
+
t.pathSymbolMap.set(n, e.symbol);
|
|
548
510
|
}
|
|
549
511
|
}
|
|
550
|
-
function
|
|
551
|
-
editorRef:
|
|
552
|
-
inlineActions:
|
|
512
|
+
function Ie({
|
|
513
|
+
editorRef: t,
|
|
514
|
+
inlineActions: e
|
|
553
515
|
}) {
|
|
554
|
-
|
|
516
|
+
w(() => L.languages.registerCodeLensProvider("yaml", {
|
|
555
517
|
provideCodeLenses: async (r) => {
|
|
556
518
|
var h;
|
|
557
|
-
const a = await
|
|
558
|
-
|
|
519
|
+
const a = await ne(r), o = re(a), s = (h = t == null ? void 0 : t.current) == null ? void 0 : h.addCommand(0, (l, { onClick: u, path: i, range: v, data: E }) => {
|
|
520
|
+
u({ path: i, range: v, data: E });
|
|
559
521
|
});
|
|
560
522
|
return s ? {
|
|
561
|
-
lenses:
|
|
523
|
+
lenses: Le({ pathSymbolMap: o, inlineActions: e, commandId: s }),
|
|
562
524
|
dispose: () => {
|
|
563
525
|
}
|
|
564
526
|
} : void 0;
|
|
565
527
|
}
|
|
566
|
-
}).dispose, [
|
|
528
|
+
}).dispose, [e, t]);
|
|
567
529
|
}
|
|
568
|
-
const
|
|
569
|
-
const [n, r] =
|
|
570
|
-
() => async (o, s,
|
|
571
|
-
var
|
|
572
|
-
const h = (
|
|
530
|
+
const Ve = ({ editorRef: t, selection: e }) => {
|
|
531
|
+
const [n, r] = _(), a = T(
|
|
532
|
+
() => async (o, s, y) => {
|
|
533
|
+
var v, E, c;
|
|
534
|
+
const h = (v = t == null ? void 0 : t.current) == null ? void 0 : v.getModel();
|
|
573
535
|
if (!h || !s)
|
|
574
536
|
return r(void 0);
|
|
575
|
-
const
|
|
576
|
-
i && (r(i),
|
|
537
|
+
const l = await ne(h), i = (E = re(l).get(s)) == null ? void 0 : E.range;
|
|
538
|
+
i && (r(i), y && ((c = t == null ? void 0 : t.current) == null || c.revealLineInCenter(i.startLineNumber)));
|
|
577
539
|
},
|
|
578
540
|
[]
|
|
579
541
|
);
|
|
580
|
-
|
|
542
|
+
w(() => {
|
|
581
543
|
if ("requestIdleCallback" in window) {
|
|
582
544
|
const o = requestIdleCallback(() => {
|
|
583
|
-
a(
|
|
545
|
+
a(t, e == null ? void 0 : e.path, e == null ? void 0 : e.revealInCenter);
|
|
584
546
|
});
|
|
585
547
|
return () => cancelIdleCallback(o);
|
|
586
548
|
} else {
|
|
587
549
|
const o = setTimeout(() => {
|
|
588
|
-
a(
|
|
550
|
+
a(t, e == null ? void 0 : e.path, e == null ? void 0 : e.revealInCenter);
|
|
589
551
|
}, 100);
|
|
590
552
|
return () => clearTimeout(o);
|
|
591
553
|
}
|
|
592
|
-
}, [
|
|
554
|
+
}, [e == null ? void 0 : e.path, e == null ? void 0 : e.revealInCenter, t, a]), w(() => {
|
|
593
555
|
var s;
|
|
594
556
|
if (!n)
|
|
595
557
|
return;
|
|
596
|
-
const o = (s =
|
|
558
|
+
const o = (s = t == null ? void 0 : t.current) == null ? void 0 : s.createDecorationsCollection([
|
|
597
559
|
{
|
|
598
560
|
// TODO: check why startColumn is set to "end of row"
|
|
599
561
|
range: { ...n, startColumn: 1 },
|
|
600
562
|
options: {
|
|
601
563
|
isWholeLine: !1,
|
|
602
|
-
className:
|
|
564
|
+
className: e == null ? void 0 : e.className
|
|
603
565
|
}
|
|
604
566
|
}
|
|
605
567
|
]);
|
|
606
568
|
return () => o == null ? void 0 : o.clear();
|
|
607
|
-
}, [n,
|
|
608
|
-
},
|
|
569
|
+
}, [n, t, e == null ? void 0 : e.className]);
|
|
570
|
+
}, oe = ue({
|
|
609
571
|
markers: [],
|
|
610
572
|
setMarkers: () => {
|
|
611
573
|
},
|
|
612
574
|
editor: null,
|
|
613
|
-
setEditor: (
|
|
575
|
+
setEditor: (t) => {
|
|
614
576
|
},
|
|
615
|
-
updateCursorPosition: (
|
|
577
|
+
updateCursorPosition: (t) => {
|
|
616
578
|
}
|
|
617
579
|
});
|
|
618
|
-
function
|
|
619
|
-
children:
|
|
580
|
+
function Ge({
|
|
581
|
+
children: t
|
|
620
582
|
}) {
|
|
621
|
-
const [
|
|
583
|
+
const [e, n] = _([]), [r, a] = _(null), o = q(
|
|
622
584
|
(s) => {
|
|
623
585
|
r == null || r.setPosition(s), r == null || r.focus();
|
|
624
586
|
},
|
|
625
587
|
[r]
|
|
626
588
|
);
|
|
627
|
-
return /* @__PURE__ */
|
|
628
|
-
|
|
589
|
+
return /* @__PURE__ */ k.jsx(
|
|
590
|
+
oe.Provider,
|
|
629
591
|
{
|
|
630
592
|
value: {
|
|
631
|
-
markers:
|
|
593
|
+
markers: e,
|
|
632
594
|
setMarkers: n,
|
|
633
595
|
editor: r,
|
|
634
596
|
setEditor: a,
|
|
635
597
|
updateCursorPosition: o
|
|
636
598
|
},
|
|
637
|
-
children:
|
|
599
|
+
children: t
|
|
638
600
|
}
|
|
639
601
|
);
|
|
640
602
|
}
|
|
641
|
-
function
|
|
642
|
-
return
|
|
603
|
+
function ae() {
|
|
604
|
+
return de(oe);
|
|
643
605
|
}
|
|
644
|
-
const
|
|
645
|
-
const { setMarkers:
|
|
646
|
-
|
|
606
|
+
const Ae = ({ monacoRef: t }) => {
|
|
607
|
+
const { setMarkers: e } = ae();
|
|
608
|
+
w(() => {
|
|
647
609
|
let n;
|
|
648
610
|
const r = setTimeout(() => {
|
|
649
611
|
var o;
|
|
650
|
-
const a = (o =
|
|
612
|
+
const a = (o = t.current) == null ? void 0 : o.editor;
|
|
651
613
|
a && (n = a.onDidChangeMarkers(([s]) => {
|
|
652
|
-
const
|
|
653
|
-
|
|
614
|
+
const y = a.getModelMarkers({ resource: s });
|
|
615
|
+
e(y);
|
|
654
616
|
}));
|
|
655
617
|
}, 100);
|
|
656
618
|
return () => {
|
|
657
619
|
clearTimeout(r), n == null || n.dispose();
|
|
658
620
|
};
|
|
659
|
-
}, [
|
|
621
|
+
}, [t]);
|
|
660
622
|
};
|
|
661
|
-
let
|
|
662
|
-
function
|
|
663
|
-
if (
|
|
623
|
+
let Q = !1;
|
|
624
|
+
function Ue(t) {
|
|
625
|
+
if (Q)
|
|
664
626
|
return;
|
|
665
|
-
const
|
|
627
|
+
const e = {
|
|
666
628
|
hover: !0,
|
|
667
629
|
completion: !0,
|
|
668
630
|
enableSchemaRequest: !1,
|
|
669
631
|
validate: !0,
|
|
670
|
-
schemas: [
|
|
632
|
+
schemas: [t]
|
|
671
633
|
};
|
|
672
|
-
|
|
634
|
+
Q = !0, he.setDiagnosticsOptions({ ...e });
|
|
673
635
|
}
|
|
674
|
-
const
|
|
675
|
-
const { schemaConfig:
|
|
676
|
-
|
|
677
|
-
|
|
636
|
+
const se = (t) => fe.parse(`file://${t}`).toString(), Be = (t) => {
|
|
637
|
+
const { schemaConfig: e, instanceId: n } = t;
|
|
638
|
+
w(() => {
|
|
639
|
+
e != null && e.schema && Ue({
|
|
678
640
|
// If YAML file is opened matching this glob
|
|
679
|
-
fileMatch: [
|
|
680
|
-
...
|
|
641
|
+
fileMatch: [se(n.toString())],
|
|
642
|
+
...e
|
|
681
643
|
});
|
|
682
|
-
}, [
|
|
644
|
+
}, [e == null ? void 0 : e.schema, n]);
|
|
683
645
|
};
|
|
684
|
-
A.config({ monaco:
|
|
685
|
-
const
|
|
686
|
-
...
|
|
646
|
+
A.config({ monaco: L });
|
|
647
|
+
const ze = {
|
|
648
|
+
...z,
|
|
687
649
|
folding: !0
|
|
688
|
-
},
|
|
650
|
+
}, Je = function(e) {
|
|
689
651
|
const {
|
|
690
652
|
yamlRevision: n,
|
|
691
653
|
schemaConfig: r,
|
|
692
654
|
inlineActions: a,
|
|
693
655
|
themeConfig: o,
|
|
694
656
|
onYamlRevisionChange: s,
|
|
695
|
-
selection:
|
|
657
|
+
selection: y,
|
|
696
658
|
theme: h,
|
|
697
|
-
options:
|
|
698
|
-
animateOnUpdate:
|
|
659
|
+
options: l,
|
|
660
|
+
animateOnUpdate: u = !1,
|
|
699
661
|
onAnimateEnd: i
|
|
700
|
-
} =
|
|
701
|
-
(
|
|
702
|
-
var
|
|
703
|
-
const
|
|
704
|
-
`),
|
|
705
|
-
if (
|
|
706
|
-
(
|
|
662
|
+
} = e, v = U(), [E] = _("yaml"), { editor: c, setEditor: b } = ae(), d = P(null), f = P(), C = P({ yaml: "", revisionId: 0 }), S = P(null), N = P(null), D = q(
|
|
663
|
+
(m) => {
|
|
664
|
+
var g, O, M;
|
|
665
|
+
const p = m.split(`
|
|
666
|
+
`), $ = (g = S.current) == null ? void 0 : g.getModel();
|
|
667
|
+
if ($) {
|
|
668
|
+
(O = S.current) == null || O.pushUndoStop(), $.setValue("");
|
|
707
669
|
let x = 0;
|
|
708
670
|
N.current = window.setInterval(() => {
|
|
709
671
|
var I;
|
|
710
|
-
x <
|
|
672
|
+
x < p.length ? (v && ((I = S.current) == null || I.executeEdits("addLine", [
|
|
711
673
|
{
|
|
712
|
-
range: new
|
|
713
|
-
text:
|
|
674
|
+
range: new v.Range(x + 1, 1, x + 1, 1),
|
|
675
|
+
text: p[x] + `
|
|
714
676
|
`
|
|
715
677
|
}
|
|
716
678
|
])), x++) : N.current && (clearInterval(N.current), i == null || i());
|
|
717
679
|
}, 100), (M = S.current) == null || M.pushUndoStop();
|
|
718
680
|
}
|
|
719
681
|
},
|
|
720
|
-
[
|
|
682
|
+
[v]
|
|
721
683
|
);
|
|
722
|
-
|
|
684
|
+
w(() => () => {
|
|
723
685
|
N.current && clearInterval(N.current);
|
|
724
686
|
}, []);
|
|
725
|
-
function
|
|
726
|
-
S.current =
|
|
727
|
-
var
|
|
728
|
-
(
|
|
687
|
+
function j(m, p) {
|
|
688
|
+
S.current = m, f.current = p, m.setValue(n.yaml), b(m), setTimeout(() => {
|
|
689
|
+
var $;
|
|
690
|
+
($ = d.current) != null && $.style && (d.current.style.opacity = "1");
|
|
729
691
|
}, 50);
|
|
730
692
|
}
|
|
731
|
-
|
|
732
|
-
var
|
|
733
|
-
if (S.current && (!n.revisionId || n.revisionId > Number((
|
|
734
|
-
const
|
|
735
|
-
|
|
693
|
+
w(() => {
|
|
694
|
+
var m;
|
|
695
|
+
if (S.current && (!n.revisionId || n.revisionId > Number((m = C.current) == null ? void 0 : m.revisionId))) {
|
|
696
|
+
const p = S.current.getModel();
|
|
697
|
+
p && (S.current.executeEdits("edit", [
|
|
736
698
|
{
|
|
737
|
-
range:
|
|
738
|
-
text:
|
|
699
|
+
range: p.getFullModelRange(),
|
|
700
|
+
text: u ? "" : n.yaml
|
|
739
701
|
}
|
|
740
|
-
]),
|
|
702
|
+
]), u && D(n.yaml));
|
|
741
703
|
}
|
|
742
|
-
}, [
|
|
743
|
-
const { theme: R } =
|
|
744
|
-
|
|
745
|
-
const W =
|
|
704
|
+
}, [D, n, u]), Be({ schemaConfig: r, instanceId: E }), Ie({ editorRef: S, inlineActions: a });
|
|
705
|
+
const { theme: R } = F({ monacoRef: f, themeConfig: o, editor: c, theme: h });
|
|
706
|
+
Ae({ monacoRef: f }), Ve({ editorRef: S, selection: y });
|
|
707
|
+
const W = T(
|
|
746
708
|
() => ({
|
|
747
|
-
...
|
|
748
|
-
...
|
|
709
|
+
...ze,
|
|
710
|
+
...l
|
|
749
711
|
}),
|
|
750
|
-
[
|
|
712
|
+
[l]
|
|
751
713
|
);
|
|
752
|
-
return /* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ k.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: d, children: /* @__PURE__ */ k.jsx(
|
|
753
715
|
Z,
|
|
754
716
|
{
|
|
755
|
-
onChange: (
|
|
756
|
-
|
|
717
|
+
onChange: (m, p) => {
|
|
718
|
+
C.current = { yaml: m ?? "", revisionId: p.versionId }, s({ ...C.current }, p);
|
|
757
719
|
},
|
|
758
720
|
language: "yaml",
|
|
759
721
|
theme: R,
|
|
760
722
|
options: W,
|
|
761
|
-
path:
|
|
762
|
-
onMount:
|
|
723
|
+
path: se(E),
|
|
724
|
+
onMount: j
|
|
763
725
|
}
|
|
764
726
|
) });
|
|
765
727
|
};
|
|
766
728
|
export {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
729
|
+
Ke as BlameEditor,
|
|
730
|
+
Ze as CodeDiffEditor,
|
|
731
|
+
qe as CodeEditor,
|
|
770
732
|
K as MonacoGlobals,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
733
|
+
te as SelectorType,
|
|
734
|
+
Je as YamlEditor,
|
|
735
|
+
oe as YamlEditorContext,
|
|
736
|
+
Ge as YamlEditorContextProvider,
|
|
737
|
+
ae as useYamlEditorContext
|
|
776
738
|
};
|
|
777
739
|
//# sourceMappingURL=index.js.map
|