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