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