@salilvnair/dui 1.0.2 → 1.0.6
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/assets/DuiShowcase-CRLG9S4N.css +1 -0
- package/dist/assets/{DuiShowcase-C2jk2ySV.js → DuiShowcase-DdIO2HHe.js} +1324 -1324
- package/dist/assets/{index-B12PznEF.js → index-BcOB3b2I.js} +2 -2
- package/dist/assets/index-kr_HUJjf.css +10 -0
- package/dist/index.html +2 -2
- package/dist/index.js +4832 -4630
- package/dist/index.js.map +1 -1
- package/dist/lib/components/display/CommandOrbView.d.ts +4 -1
- package/dist/lib/components/display/LoaderView.d.ts +5 -1
- package/dist/lib/components/input/HighlightedInputView.d.ts +1 -1
- package/dist/lib/components/input/SelectTextInputView.d.ts +1 -1
- package/dist/lib/components/layout/FanStackView.d.ts +35 -0
- package/dist/lib/core/VariableToken.d.ts +34 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/monaco-setup.js +510 -439
- package/dist/monaco-setup.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/vis-setup.js +323 -240
- package/dist/vis-setup.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/DuiShowcase-CZLjKDpL.css +0 -1
- package/dist/assets/index-B_5G6LrJ.css +0 -10
package/dist/monaco-setup.js
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import { q as
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { javascriptDefaults as
|
|
1
|
+
import Z, { DiffEditor as ge, loader as ce } from "@monaco-editor/react";
|
|
2
|
+
import * as O from "monaco-editor";
|
|
3
|
+
import { q as Y, E as X, A as fe, B as pe, F as me } from "./chunks/EditorView.shell-DWGMOgiy.js";
|
|
4
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
5
|
+
import { useState as ke, useEffect as L, useRef as R, useCallback as j, useMemo as Q } from "react";
|
|
6
|
+
import he from "monaco-editor/esm/vs/editor/editor.worker?worker&inline";
|
|
7
|
+
import be from "monaco-editor/esm/vs/language/json/json.worker?worker&inline";
|
|
8
|
+
import ye from "monaco-editor/esm/vs/language/html/html.worker?worker&inline";
|
|
9
|
+
import Ce from "monaco-editor/esm/vs/language/typescript/ts.worker?worker&inline";
|
|
10
|
+
import { javascriptDefaults as q, JsxEmit as ee, ModuleResolutionKind as te, ModuleKind as ne, ScriptTarget as oe, typescriptDefaults as re } from "monaco-editor/esm/vs/language/typescript/monaco.contribution";
|
|
11
11
|
function z() {
|
|
12
12
|
var t;
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const n = ((t = document.body) == null ? void 0 : t.getAttribute("data-vscode-theme-kind")) || document.documentElement.getAttribute("data-vscode-theme-kind");
|
|
14
|
+
return n ? n === "vscode-light" ? "light" : "dark" : document.documentElement.getAttribute("data-theme") || "dark";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const [
|
|
18
|
-
return
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
return document.body &&
|
|
23
|
-
|
|
16
|
+
function P() {
|
|
17
|
+
const [n, t] = ke(z);
|
|
18
|
+
return L(() => {
|
|
19
|
+
const r = () => t(z()), l = new MutationObserver(r);
|
|
20
|
+
l.observe(document.documentElement, { attributes: !0, attributeFilter: ["data-theme", "data-vscode-theme-kind"] });
|
|
21
|
+
const g = new MutationObserver(r);
|
|
22
|
+
return document.body && g.observe(document.body, { attributes: !0, attributeFilter: ["data-vscode-theme-kind"] }), () => {
|
|
23
|
+
l.disconnect(), g.disconnect();
|
|
24
24
|
};
|
|
25
|
-
}, []),
|
|
25
|
+
}, []), n;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
27
|
+
const Ee = "";
|
|
28
|
+
function we(n, t, r) {
|
|
29
29
|
return [];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Te(n) {
|
|
32
32
|
const {
|
|
33
33
|
breakpoints: t,
|
|
34
|
-
disabledBreakpoints:
|
|
35
|
-
conditionalBreakpointLines:
|
|
36
|
-
pausedLine:
|
|
37
|
-
onToggleBreakpoint:
|
|
38
|
-
onGlyphContextMenu:
|
|
39
|
-
} =
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
return !
|
|
34
|
+
disabledBreakpoints: r,
|
|
35
|
+
conditionalBreakpointLines: l,
|
|
36
|
+
pausedLine: g,
|
|
37
|
+
onToggleBreakpoint: c,
|
|
38
|
+
onGlyphContextMenu: m
|
|
39
|
+
} = n, e = R(null), k = R(null), f = R([]), y = R([]), h = R([]), b = R([]), o = j((i) => {
|
|
40
|
+
const s = e.current;
|
|
41
|
+
if (!s) return !0;
|
|
42
|
+
const d = s.getModel();
|
|
43
|
+
return !d || i > d.getLineCount() ? !1 : !!d.getLineContent(i).trim();
|
|
44
44
|
}, []);
|
|
45
|
-
return
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
45
|
+
return L(() => {
|
|
46
|
+
const i = e.current, s = k.current;
|
|
47
|
+
if (!i || !s) return;
|
|
48
|
+
const d = [];
|
|
49
49
|
if (t)
|
|
50
|
-
for (const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
range: new
|
|
50
|
+
for (const u of t) {
|
|
51
|
+
if (g && u === g) continue;
|
|
52
|
+
const C = r == null ? void 0 : r.includes(u), E = l == null ? void 0 : l.includes(u);
|
|
53
|
+
let p = "daakia-bp-glyph";
|
|
54
|
+
C ? p = "daakia-bp-glyph--disabled" : E && (p = "daakia-bp-glyph--conditional"), d.push({
|
|
55
|
+
range: new s.Range(u, 1, u, 1),
|
|
56
56
|
options: {
|
|
57
57
|
isWholeLine: !0,
|
|
58
|
-
className:
|
|
59
|
-
stickiness:
|
|
60
|
-
glyphMarginClassName:
|
|
58
|
+
className: C ? "" : "daakia-bp-line",
|
|
59
|
+
stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
60
|
+
glyphMarginClassName: p,
|
|
61
61
|
glyphMarginHoverMessage: {
|
|
62
|
-
value:
|
|
62
|
+
value: E ? "Conditional Breakpoint" : C ? "Disabled Breakpoint" : "Breakpoint"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
}, [t, l, g
|
|
69
|
-
const
|
|
70
|
-
if (!(!
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
range: new
|
|
67
|
+
f.current = i.deltaDecorations(f.current, d);
|
|
68
|
+
}, [t, r, l, g]), L(() => {
|
|
69
|
+
const i = e.current, s = k.current;
|
|
70
|
+
if (!(!i || !s))
|
|
71
|
+
if (g) {
|
|
72
|
+
const u = (t == null ? void 0 : t.includes(g)) ? "daakia-paused-line__arrow daakia-paused-line__arrow--with-bp" : "daakia-paused-line__arrow";
|
|
73
|
+
y.current = i.deltaDecorations(y.current, [{
|
|
74
|
+
range: new s.Range(g, 1, g, 1),
|
|
75
75
|
options: {
|
|
76
76
|
isWholeLine: !0,
|
|
77
77
|
className: "daakia-paused-line",
|
|
78
|
-
glyphMarginClassName:
|
|
79
|
-
stickiness:
|
|
78
|
+
glyphMarginClassName: u,
|
|
79
|
+
stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
|
|
80
80
|
}
|
|
81
|
-
}]),
|
|
81
|
+
}]), i.revealLineInCenter(g);
|
|
82
82
|
} else
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
return (
|
|
88
|
-
}),
|
|
89
|
-
}, []), { attach:
|
|
90
|
-
e.current =
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
83
|
+
y.current = i.deltaDecorations(y.current, []);
|
|
84
|
+
}, [g, t]), L(() => () => {
|
|
85
|
+
b.current.forEach((i) => {
|
|
86
|
+
var s;
|
|
87
|
+
return (s = i == null ? void 0 : i.dispose) == null ? void 0 : s.call(i);
|
|
88
|
+
}), b.current = [];
|
|
89
|
+
}, []), { attach: j((i, s) => {
|
|
90
|
+
e.current = i, k.current = s;
|
|
91
|
+
const d = i.getDomNode();
|
|
92
|
+
if (d) {
|
|
93
|
+
const u = d.querySelector(".margin");
|
|
94
|
+
u && u.setAttribute("data-daakia-bp-gutter", "");
|
|
95
95
|
}
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
var
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
|
|
96
|
+
if (c) {
|
|
97
|
+
const u = i.onMouseDown((C) => {
|
|
98
|
+
var E;
|
|
99
|
+
if (C.event.leftButton && C.target.type === s.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
100
|
+
const p = (E = C.target.position) == null ? void 0 : E.lineNumber;
|
|
101
|
+
p && o(p) && c(p);
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
|
|
104
|
+
b.current.push(u);
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
107
|
-
let
|
|
108
|
-
const
|
|
109
|
-
var
|
|
110
|
-
if (
|
|
111
|
-
const N = (
|
|
112
|
-
N && o(N) && (
|
|
106
|
+
if (m) {
|
|
107
|
+
let u = null;
|
|
108
|
+
const C = i.onMouseDown((p) => {
|
|
109
|
+
var w;
|
|
110
|
+
if (p.event.rightButton && (p.target.type === s.editor.MouseTargetType.GUTTER_GLYPH_MARGIN || p.target.type === s.editor.MouseTargetType.GUTTER_LINE_NUMBERS || p.target.type === s.editor.MouseTargetType.GUTTER_LINE_DECORATIONS)) {
|
|
111
|
+
const N = (w = p.target.position) == null ? void 0 : w.lineNumber;
|
|
112
|
+
N && o(N) && (u = { line: N, x: p.event.posx, y: p.event.posy });
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
|
|
115
|
+
b.current.push(C);
|
|
116
|
+
const E = i.getDomNode();
|
|
117
|
+
if (E) {
|
|
118
|
+
const p = (w) => {
|
|
119
|
+
u ? (w.preventDefault(), w.stopPropagation(), m(u.line, { x: u.x, y: u.y }), u = null) : w.target.closest("[data-daakia-bp-gutter]") && (w.preventDefault(), w.stopPropagation());
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
E.addEventListener("contextmenu", p, !0), b.current.push({ dispose: () => E.removeEventListener("contextmenu", p, !0) });
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
var
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const N =
|
|
124
|
+
if (c) {
|
|
125
|
+
const u = i.onMouseMove((E) => {
|
|
126
|
+
var p;
|
|
127
|
+
if (E.target.type === s.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
|
|
128
|
+
const w = (p = E.target.position) == null ? void 0 : p.lineNumber;
|
|
129
|
+
if (w && o(w)) {
|
|
130
|
+
const N = i.getModel();
|
|
131
131
|
if (N) {
|
|
132
|
-
const
|
|
133
|
-
if (!(
|
|
132
|
+
const M = N.getLineDecorations(w);
|
|
133
|
+
if (!(M == null ? void 0 : M.some(
|
|
134
134
|
(S) => {
|
|
135
|
-
var T,
|
|
136
|
-
return ((
|
|
135
|
+
var T, v, A, F;
|
|
136
|
+
return ((v = (T = S.options) == null ? void 0 : T.glyphMarginClassName) == null ? void 0 : v.startsWith("daakia-bp-glyph")) && !((F = (A = S.options) == null ? void 0 : A.glyphMarginClassName) != null && F.includes("hover"));
|
|
137
137
|
}
|
|
138
138
|
))) {
|
|
139
|
-
|
|
140
|
-
range: new
|
|
139
|
+
h.current = i.deltaDecorations(h.current, [{
|
|
140
|
+
range: new s.Range(w, 1, w, 1),
|
|
141
141
|
options: {
|
|
142
142
|
isWholeLine: !1,
|
|
143
|
-
stickiness:
|
|
143
|
+
stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
144
144
|
glyphMarginClassName: "daakia-bp-glyph--hover",
|
|
145
145
|
glyphMarginHoverMessage: { value: "Left-click to add a breakpoint" }
|
|
146
146
|
}
|
|
@@ -150,37 +150,37 @@ function ye(i) {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
h.current.length && (h.current = i.deltaDecorations(h.current, []));
|
|
154
154
|
});
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
155
|
+
b.current.push(u);
|
|
156
|
+
const C = i.onMouseLeave(() => {
|
|
157
|
+
h.current.length && (h.current = i.deltaDecorations(h.current, []));
|
|
158
158
|
});
|
|
159
|
-
|
|
159
|
+
b.current.push(C);
|
|
160
160
|
}
|
|
161
161
|
if (t) {
|
|
162
|
-
const
|
|
163
|
-
for (const
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
range: new
|
|
162
|
+
const u = [];
|
|
163
|
+
for (const C of t) {
|
|
164
|
+
const E = r == null ? void 0 : r.includes(C), p = l == null ? void 0 : l.includes(C);
|
|
165
|
+
let w = "daakia-bp-glyph";
|
|
166
|
+
E ? w = "daakia-bp-glyph--disabled" : p && (w = "daakia-bp-glyph--conditional"), u.push({
|
|
167
|
+
range: new s.Range(C, 1, C, 1),
|
|
168
168
|
options: {
|
|
169
169
|
isWholeLine: !0,
|
|
170
|
-
className:
|
|
171
|
-
stickiness:
|
|
172
|
-
glyphMarginClassName:
|
|
170
|
+
className: E ? "" : "daakia-bp-line",
|
|
171
|
+
stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
172
|
+
glyphMarginClassName: w,
|
|
173
173
|
glyphMarginHoverMessage: {
|
|
174
|
-
value:
|
|
174
|
+
value: p ? "Conditional Breakpoint" : E ? "Disabled Breakpoint" : "Breakpoint"
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
f.current = i.deltaDecorations(f.current, u);
|
|
180
180
|
}
|
|
181
|
-
}, [
|
|
181
|
+
}, [c, m, o, t, r, l]) };
|
|
182
182
|
}
|
|
183
|
-
const
|
|
183
|
+
const ie = {
|
|
184
184
|
navigateLine: null,
|
|
185
185
|
setNavigateLine: () => {
|
|
186
186
|
},
|
|
@@ -188,12 +188,139 @@ const te = {
|
|
|
188
188
|
status: "idle",
|
|
189
189
|
variables: []
|
|
190
190
|
};
|
|
191
|
-
function
|
|
192
|
-
return
|
|
191
|
+
function W(n) {
|
|
192
|
+
return n(ie);
|
|
193
|
+
}
|
|
194
|
+
W.getState = () => ie;
|
|
195
|
+
let H = !1;
|
|
196
|
+
const K = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Set(), ve = /* @__PURE__ */ new Set([
|
|
197
|
+
"area",
|
|
198
|
+
"base",
|
|
199
|
+
"br",
|
|
200
|
+
"col",
|
|
201
|
+
"embed",
|
|
202
|
+
"hr",
|
|
203
|
+
"img",
|
|
204
|
+
"input",
|
|
205
|
+
"link",
|
|
206
|
+
"meta",
|
|
207
|
+
"param",
|
|
208
|
+
"source",
|
|
209
|
+
"track",
|
|
210
|
+
"wbr"
|
|
211
|
+
]), xe = /<([_:a-zA-Z][-_:.\w]*)((?:"[^"]*"|'[^']*'|[^'">])*)>$/, V = /<\/?([_:a-zA-Z][-_:.\w]*)((?:"[^"]*"|'[^']*'|[^'">])*)>/g;
|
|
212
|
+
function Se(n) {
|
|
213
|
+
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
214
|
+
}
|
|
215
|
+
function Ne(n) {
|
|
216
|
+
const t = n.replace(/<!--[\s\S]*?-->/g, "").replace(/<!\[CDATA\[[\s\S]*?\]\]>/g, ""), r = [];
|
|
217
|
+
V.lastIndex = 0;
|
|
218
|
+
let l;
|
|
219
|
+
for (; (l = V.exec(t)) !== null; ) {
|
|
220
|
+
const [g, c, m] = l;
|
|
221
|
+
if (g.startsWith("</")) {
|
|
222
|
+
const e = r.lastIndexOf(c);
|
|
223
|
+
e !== -1 ? r.length = e : r.pop();
|
|
224
|
+
} else m.trimEnd().endsWith("/") || r.push(c);
|
|
225
|
+
}
|
|
226
|
+
return r.length ? r[r.length - 1] : null;
|
|
227
|
+
}
|
|
228
|
+
function J(n, t) {
|
|
229
|
+
if (K.has(t)) return;
|
|
230
|
+
K.add(t);
|
|
231
|
+
const r = {
|
|
232
|
+
// Deliberately no { open: '<', close: '>' } here — matching VS Code's own
|
|
233
|
+
// html/xml language configuration. Auto-inserting '>' would mean the user's
|
|
234
|
+
// own '>' keystroke merely skips over it, producing no model change, and
|
|
235
|
+
// tag auto-closing (which is what people actually expect) could never fire.
|
|
236
|
+
autoClosingPairs: [
|
|
237
|
+
{ open: "{", close: "}" },
|
|
238
|
+
{ open: "[", close: "]" },
|
|
239
|
+
{ open: "(", close: ")" },
|
|
240
|
+
{ open: '"', close: '"', notIn: ["string"] },
|
|
241
|
+
{ open: "'", close: "'", notIn: ["string", "comment"] },
|
|
242
|
+
{ open: "<!--", close: "-->", notIn: ["comment", "string"] }
|
|
243
|
+
],
|
|
244
|
+
brackets: [["{", "}"], ["[", "]"], ["(", ")"], ["<", ">"]],
|
|
245
|
+
surroundingPairs: [
|
|
246
|
+
{ open: "{", close: "}" },
|
|
247
|
+
{ open: "[", close: "]" },
|
|
248
|
+
{ open: "(", close: ")" },
|
|
249
|
+
{ open: '"', close: '"' },
|
|
250
|
+
{ open: "'", close: "'" },
|
|
251
|
+
{ open: "<", close: ">" }
|
|
252
|
+
],
|
|
253
|
+
comments: { blockComment: ["<!--", "-->"] },
|
|
254
|
+
onEnterRules: [
|
|
255
|
+
{
|
|
256
|
+
// Enter between <a>|</a> — open the pair onto three lines, caret indented.
|
|
257
|
+
beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
|
|
258
|
+
afterText: /^<\/([_:\w][_:\w\-.\d]*)\s*>$/i,
|
|
259
|
+
action: { indentAction: n.languages.IndentAction.IndentOutdent }
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
|
|
263
|
+
action: { indentAction: n.languages.IndentAction.Indent }
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
|
|
267
|
+
};
|
|
268
|
+
let l = n.languages.setLanguageConfiguration(t, r);
|
|
269
|
+
for (const g of [50, 250, 1e3])
|
|
270
|
+
setTimeout(() => {
|
|
271
|
+
var m;
|
|
272
|
+
const c = n.languages.setLanguageConfiguration(t, r);
|
|
273
|
+
(m = l == null ? void 0 : l.dispose) == null || m.call(l), l = c;
|
|
274
|
+
}, g);
|
|
275
|
+
}
|
|
276
|
+
function De(n, t) {
|
|
277
|
+
let r = !1;
|
|
278
|
+
const l = n.onDidChangeModelContent((g) => {
|
|
279
|
+
if (r || g.isUndoing || g.isRedoing) return;
|
|
280
|
+
const c = n.getModel();
|
|
281
|
+
if (!c) return;
|
|
282
|
+
const m = c.getLanguageId();
|
|
283
|
+
if (m !== "xml" && m !== "html" || g.changes.length !== 1) return;
|
|
284
|
+
const e = g.changes[0];
|
|
285
|
+
if (e.text !== ">" && e.text !== "/") return;
|
|
286
|
+
const k = e.range.startLineNumber, f = e.range.startColumn + e.text.length, y = c.getValueInRange({
|
|
287
|
+
startLineNumber: 1,
|
|
288
|
+
startColumn: 1,
|
|
289
|
+
endLineNumber: k,
|
|
290
|
+
endColumn: f
|
|
291
|
+
});
|
|
292
|
+
let h, b, o = 0;
|
|
293
|
+
if (e.text === ">") {
|
|
294
|
+
const a = xe.exec(y);
|
|
295
|
+
if (!a || a[2].trimEnd().endsWith("/") || m === "html" && ve.has(a[1].toLowerCase())) return;
|
|
296
|
+
const i = c.getValueInRange({
|
|
297
|
+
startLineNumber: k,
|
|
298
|
+
startColumn: f,
|
|
299
|
+
endLineNumber: k,
|
|
300
|
+
endColumn: c.getLineMaxColumn(k)
|
|
301
|
+
});
|
|
302
|
+
if (new RegExp(`^\\s*</${Se(a[1])}\\s*>`).test(i)) return;
|
|
303
|
+
h = `</${a[1]}>`, b = 0;
|
|
304
|
+
} else {
|
|
305
|
+
if (!/<\/$/.test(y)) return;
|
|
306
|
+
const a = Ne(y.slice(0, -2));
|
|
307
|
+
if (!a) return;
|
|
308
|
+
h = `${a}>`, b = h.length, c.getLineContent(k).charAt(f - 1) === ">" && (o = 1);
|
|
309
|
+
}
|
|
310
|
+
r = !0;
|
|
311
|
+
try {
|
|
312
|
+
n.executeEdits(
|
|
313
|
+
"daakia.autoCloseTag",
|
|
314
|
+
[{ range: new t.Range(k, f, k, f + o), text: h, forceMoveMarkers: !1 }],
|
|
315
|
+
[new t.Selection(k, f + b, k, f + b)]
|
|
316
|
+
);
|
|
317
|
+
} finally {
|
|
318
|
+
r = !1;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
n.onDidDispose(() => l.dispose());
|
|
193
322
|
}
|
|
194
|
-
|
|
195
|
-
let $ = !1;
|
|
196
|
-
const ne = {
|
|
323
|
+
const ae = {
|
|
197
324
|
javascript: ".js",
|
|
198
325
|
typescript: ".ts",
|
|
199
326
|
json: ".json",
|
|
@@ -208,160 +335,166 @@ const ne = {
|
|
|
208
335
|
plaintext: ".txt",
|
|
209
336
|
proto: ".proto"
|
|
210
337
|
};
|
|
211
|
-
function
|
|
212
|
-
let
|
|
213
|
-
const
|
|
214
|
-
for (const
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
`, !
|
|
338
|
+
function Re(n) {
|
|
339
|
+
let r = 0, l = "";
|
|
340
|
+
const g = n.replace(/>\s*</g, "><").split(new RegExp("(?<=>)(?=<)"));
|
|
341
|
+
for (const c of g) {
|
|
342
|
+
const m = /^<\//.test(c), e = /\/>$/.test(c) || /^<!/.test(c) || /^<\?/.test(c);
|
|
343
|
+
m && (r = Math.max(0, r - 1)), l += " ".repeat(r) + c.trim() + `
|
|
344
|
+
`, !m && !e && /^<[^/!?]/.test(c) && r++;
|
|
218
345
|
}
|
|
219
|
-
return
|
|
346
|
+
return l.trimEnd();
|
|
220
347
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
348
|
+
function Le(n) {
|
|
349
|
+
return n.split(`
|
|
223
350
|
`).map((t) => t.trimEnd()).join(`
|
|
224
351
|
`).replace(/\n{3,}/g, `
|
|
225
352
|
|
|
226
353
|
`).trim();
|
|
227
354
|
}
|
|
228
|
-
function
|
|
355
|
+
function Ae(n) {
|
|
229
356
|
const t = /\b(SELECT|DISTINCT|FROM|WHERE|INNER JOIN|LEFT JOIN|RIGHT JOIN|FULL OUTER JOIN|FULL JOIN|CROSS JOIN|JOIN|ON|AND|OR|NOT|ORDER BY|GROUP BY|HAVING|LIMIT|OFFSET|UNION ALL|UNION|INTERSECT|EXCEPT|INSERT INTO|VALUES|UPDATE|SET|DELETE FROM|CREATE TABLE|DROP TABLE|ALTER TABLE|WITH)\b/gi;
|
|
230
|
-
return
|
|
357
|
+
return n.replace(/\s+/g, " ").replace(t, `
|
|
231
358
|
$1`).split(`
|
|
232
|
-
`).map((
|
|
359
|
+
`).map((r) => r.trim()).filter((r) => r.length > 0).join(`
|
|
233
360
|
`);
|
|
234
361
|
}
|
|
235
|
-
function
|
|
236
|
-
value:
|
|
362
|
+
function Me({
|
|
363
|
+
value: n,
|
|
237
364
|
onChange: t,
|
|
238
|
-
language:
|
|
239
|
-
height:
|
|
240
|
-
minHeight:
|
|
241
|
-
readOnly:
|
|
242
|
-
placeholder:
|
|
365
|
+
language: r = "json",
|
|
366
|
+
height: l = "200px",
|
|
367
|
+
minHeight: g,
|
|
368
|
+
readOnly: c = !1,
|
|
369
|
+
placeholder: m,
|
|
243
370
|
wordWrap: e = !0,
|
|
244
|
-
size:
|
|
245
|
-
fontSize:
|
|
246
|
-
className:
|
|
247
|
-
bordered:
|
|
248
|
-
onEditorMount:
|
|
371
|
+
size: k,
|
|
372
|
+
fontSize: f,
|
|
373
|
+
className: y = "",
|
|
374
|
+
bordered: h = !1,
|
|
375
|
+
onEditorMount: b,
|
|
249
376
|
contextMenuMode: o = "native",
|
|
250
|
-
contextMenuItems:
|
|
251
|
-
editorOptions:
|
|
252
|
-
accentColor:
|
|
377
|
+
contextMenuItems: a,
|
|
378
|
+
editorOptions: i,
|
|
379
|
+
accentColor: s
|
|
253
380
|
}) {
|
|
254
|
-
const
|
|
255
|
-
() => `inmemory://daakia/${crypto.randomUUID()}${
|
|
256
|
-
[
|
|
257
|
-
), N = typeof
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var
|
|
261
|
-
return (
|
|
262
|
-
}),
|
|
263
|
-
const T =
|
|
381
|
+
const d = Y(k), u = f ?? d.fontSize, C = P(), E = R(null), p = R([]), w = Q(
|
|
382
|
+
() => `inmemory://daakia/${crypto.randomUUID()}${ae[r] || ".txt"}`,
|
|
383
|
+
[r]
|
|
384
|
+
), N = typeof l == "number" ? `${l}px` : l, M = g ? `max(${N}, ${g}px)` : N;
|
|
385
|
+
L(() => () => {
|
|
386
|
+
p.current.forEach((v) => {
|
|
387
|
+
var A;
|
|
388
|
+
return (A = v == null ? void 0 : v.dispose) == null ? void 0 : A.call(v);
|
|
389
|
+
}), p.current = [];
|
|
390
|
+
const T = E.current;
|
|
264
391
|
if (T) {
|
|
265
|
-
const
|
|
266
|
-
|
|
392
|
+
const v = T.getModel();
|
|
393
|
+
v && v.dispose();
|
|
267
394
|
}
|
|
268
|
-
}, [])
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
|
|
395
|
+
}, []), L(() => {
|
|
396
|
+
var T;
|
|
397
|
+
(T = E.current) == null || T.updateOptions({ placeholder: m });
|
|
398
|
+
}, [m]);
|
|
399
|
+
const B = (T, v) => {
|
|
400
|
+
E.current = T, p.current = [], le(T, v, { language: r, value: n, placeholder: m, onEditorMount: b, contextMenuMode: o });
|
|
401
|
+
}, S = C === "light" ? "daakia-light" : "daakia-dark";
|
|
402
|
+
return /* @__PURE__ */ I(X, { bordered: h, containerHeight: M, contextMenuMode: o, contextMenuItems: a, accentColor: s, children: /* @__PURE__ */ I(
|
|
403
|
+
Z,
|
|
274
404
|
{
|
|
275
405
|
height: "100%",
|
|
276
|
-
language:
|
|
277
|
-
path:
|
|
278
|
-
value:
|
|
406
|
+
language: r,
|
|
407
|
+
path: w,
|
|
408
|
+
value: n,
|
|
279
409
|
theme: S,
|
|
280
410
|
onChange: (T) => t == null ? void 0 : t(T ?? ""),
|
|
281
|
-
onMount:
|
|
282
|
-
options:
|
|
411
|
+
onMount: B,
|
|
412
|
+
options: se({ readOnly: c, fontSize: u, wordWrap: e, glyphMargin: !1, contextMenuMode: o, editorOptions: i, theme: S })
|
|
283
413
|
}
|
|
284
414
|
) });
|
|
285
415
|
}
|
|
286
|
-
function
|
|
287
|
-
value:
|
|
416
|
+
function Ie({
|
|
417
|
+
value: n,
|
|
288
418
|
onChange: t,
|
|
289
|
-
language:
|
|
290
|
-
height:
|
|
291
|
-
minHeight:
|
|
292
|
-
readOnly:
|
|
293
|
-
placeholder:
|
|
419
|
+
language: r = "json",
|
|
420
|
+
height: l = "200px",
|
|
421
|
+
minHeight: g,
|
|
422
|
+
readOnly: c = !1,
|
|
423
|
+
placeholder: m,
|
|
294
424
|
wordWrap: e = !0,
|
|
295
|
-
size:
|
|
296
|
-
fontSize:
|
|
297
|
-
className:
|
|
298
|
-
bordered:
|
|
299
|
-
breakpoints:
|
|
425
|
+
size: k,
|
|
426
|
+
fontSize: f,
|
|
427
|
+
className: y = "",
|
|
428
|
+
bordered: h = !1,
|
|
429
|
+
breakpoints: b,
|
|
300
430
|
disabledBreakpoints: o,
|
|
301
|
-
conditionalBreakpointLines:
|
|
302
|
-
pausedLine:
|
|
303
|
-
onToggleBreakpoint:
|
|
304
|
-
onGlyphContextMenu:
|
|
305
|
-
onEditorMount:
|
|
306
|
-
contextMenuMode:
|
|
307
|
-
contextMenuItems:
|
|
308
|
-
editorOptions:
|
|
309
|
-
accentColor:
|
|
431
|
+
conditionalBreakpointLines: a,
|
|
432
|
+
pausedLine: i,
|
|
433
|
+
onToggleBreakpoint: s,
|
|
434
|
+
onGlyphContextMenu: d,
|
|
435
|
+
onEditorMount: u,
|
|
436
|
+
contextMenuMode: C = "native",
|
|
437
|
+
contextMenuItems: E,
|
|
438
|
+
editorOptions: p,
|
|
439
|
+
accentColor: w
|
|
310
440
|
}) {
|
|
311
|
-
const N =
|
|
312
|
-
() => `inmemory://daakia/${crypto.randomUUID()}${
|
|
313
|
-
[
|
|
314
|
-
),
|
|
315
|
-
breakpoints:
|
|
441
|
+
const N = Y(k), M = f ?? N.fontSize, B = P(), S = R(null), T = R([]), v = Q(
|
|
442
|
+
() => `inmemory://daakia/${crypto.randomUUID()}${ae[r] || ".txt"}`,
|
|
443
|
+
[r]
|
|
444
|
+
), A = typeof l == "number" ? `${l}px` : l, F = g ? `max(${A}, ${g}px)` : A, { attach: ue } = Te({
|
|
445
|
+
breakpoints: b,
|
|
316
446
|
disabledBreakpoints: o,
|
|
317
|
-
conditionalBreakpointLines:
|
|
318
|
-
pausedLine:
|
|
319
|
-
onToggleBreakpoint:
|
|
320
|
-
onGlyphContextMenu:
|
|
321
|
-
}),
|
|
322
|
-
|
|
323
|
-
T.current.forEach((
|
|
324
|
-
var
|
|
325
|
-
return (
|
|
447
|
+
conditionalBreakpointLines: a,
|
|
448
|
+
pausedLine: i,
|
|
449
|
+
onToggleBreakpoint: s,
|
|
450
|
+
onGlyphContextMenu: d
|
|
451
|
+
}), _ = W((x) => x.navigateLine);
|
|
452
|
+
L(() => () => {
|
|
453
|
+
T.current.forEach((D) => {
|
|
454
|
+
var $;
|
|
455
|
+
return ($ = D == null ? void 0 : D.dispose) == null ? void 0 : $.call(D);
|
|
326
456
|
}), T.current = [];
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
const
|
|
330
|
-
|
|
457
|
+
const x = S.current;
|
|
458
|
+
if (x) {
|
|
459
|
+
const D = x.getModel();
|
|
460
|
+
D && D.dispose();
|
|
331
461
|
}
|
|
332
|
-
}, []),
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
S.current
|
|
337
|
-
},
|
|
338
|
-
|
|
339
|
-
|
|
462
|
+
}, []), L(() => {
|
|
463
|
+
var x;
|
|
464
|
+
(x = S.current) == null || x.updateOptions({ placeholder: m });
|
|
465
|
+
}, [m]), L(() => {
|
|
466
|
+
!_ || !S.current || !b || (S.current.revealLineInCenter(_), S.current.setPosition({ lineNumber: _, column: 1 }), W.getState().setNavigateLine(null));
|
|
467
|
+
}, [_, b]);
|
|
468
|
+
const de = (x, D) => {
|
|
469
|
+
S.current = x, T.current = [], ue(x, D), le(x, D, { language: r, value: n, placeholder: m, onEditorMount: u, contextMenuMode: C });
|
|
470
|
+
}, G = B === "light" ? "daakia-light" : "daakia-dark";
|
|
471
|
+
return /* @__PURE__ */ I(X, { bordered: h, containerHeight: F, contextMenuMode: C, contextMenuItems: E, accentColor: w, children: /* @__PURE__ */ I(
|
|
472
|
+
Z,
|
|
340
473
|
{
|
|
341
474
|
height: "100%",
|
|
342
|
-
language:
|
|
343
|
-
path:
|
|
344
|
-
value:
|
|
345
|
-
theme:
|
|
346
|
-
onChange: (
|
|
347
|
-
onMount:
|
|
348
|
-
options:
|
|
475
|
+
language: r,
|
|
476
|
+
path: v,
|
|
477
|
+
value: n,
|
|
478
|
+
theme: G,
|
|
479
|
+
onChange: (x) => t == null ? void 0 : t(x ?? ""),
|
|
480
|
+
onMount: de,
|
|
481
|
+
options: se({ readOnly: c, fontSize: M, wordWrap: e, glyphMargin: !!s, contextMenuMode: C, editorOptions: p, theme: G })
|
|
349
482
|
}
|
|
350
483
|
) });
|
|
351
484
|
}
|
|
352
|
-
function
|
|
353
|
-
return
|
|
485
|
+
function Oe({ debugSupported: n = !1, className: t = "", ...r }) {
|
|
486
|
+
return n ? /* @__PURE__ */ I(Ie, { className: t, ...r }) : /* @__PURE__ */ I(Me, { className: t, ...r });
|
|
354
487
|
}
|
|
355
|
-
function
|
|
356
|
-
var
|
|
357
|
-
const e =
|
|
488
|
+
function se({ readOnly: n, fontSize: t, wordWrap: r, glyphMargin: l, contextMenuMode: g = "native", editorOptions: c, theme: m }) {
|
|
489
|
+
var k, f, y, h, b, o, a, i, s, d, u;
|
|
490
|
+
const e = c ?? {};
|
|
358
491
|
return {
|
|
359
492
|
// Baked into construction options (not just the top-level <Editor theme=""> prop)
|
|
360
493
|
// so Monaco applies it before its first paint — @monaco-editor/react creates the
|
|
361
494
|
// editor first and only calls the global setTheme() afterward as a separate step,
|
|
362
495
|
// which is what caused a flash of the default white 'vs' theme on every remount
|
|
363
496
|
// (tab switch, subtab switch, new-tab-then-close) before this fix.
|
|
364
|
-
theme:
|
|
497
|
+
theme: m,
|
|
365
498
|
// ── Consumer-overridable defaults ────────────────────────────────────────
|
|
366
499
|
lineNumbers: e.lineNumbers ?? "on",
|
|
367
500
|
minimap: { enabled: e.minimap ?? !1 },
|
|
@@ -387,7 +520,7 @@ function oe({ readOnly: i, fontSize: t, wordWrap: l, glyphMargin: g, contextMenu
|
|
|
387
520
|
parameterHints: { enabled: e.parameterHints ?? !0 },
|
|
388
521
|
codeLens: e.codeLens ?? !1,
|
|
389
522
|
inlayHints: { enabled: e.inlayHints ?? !1 ? "on" : "off" },
|
|
390
|
-
padding: { top: ((
|
|
523
|
+
padding: { top: ((k = e.padding) == null ? void 0 : k.top) ?? 8, bottom: ((f = e.padding) == null ? void 0 : f.bottom) ?? 8 },
|
|
391
524
|
...e.cursorStyle && { cursorStyle: e.cursorStyle },
|
|
392
525
|
...e.cursorBlinking && { cursorBlinking: e.cursorBlinking },
|
|
393
526
|
...e.lineHeight && { lineHeight: e.lineHeight },
|
|
@@ -396,22 +529,22 @@ function oe({ readOnly: i, fontSize: t, wordWrap: l, glyphMargin: g, contextMenu
|
|
|
396
529
|
...e.lineDecorationsWidth !== void 0 && { lineDecorationsWidth: e.lineDecorationsWidth },
|
|
397
530
|
...e.lineNumbersMinChars !== void 0 && { lineNumbersMinChars: e.lineNumbersMinChars },
|
|
398
531
|
// ── Prop-level overrides (top-level EditorView props win over editorOptions) ─
|
|
399
|
-
readOnly:
|
|
532
|
+
readOnly: n,
|
|
400
533
|
fontSize: t,
|
|
401
|
-
wordWrap: e.wordWrap ?? (
|
|
534
|
+
wordWrap: e.wordWrap ?? (r ? "on" : "off"),
|
|
402
535
|
// ── DUI structural — never overridable ──────────────────────────────────
|
|
403
536
|
automaticLayout: !0,
|
|
404
|
-
glyphMargin:
|
|
405
|
-
renderLineHighlight: e.renderLineHighlight ?? (
|
|
537
|
+
glyphMargin: l,
|
|
538
|
+
renderLineHighlight: e.renderLineHighlight ?? (l ? "line" : "none"),
|
|
406
539
|
fixedOverflowWidgets: !0,
|
|
407
|
-
contextmenu:
|
|
540
|
+
contextmenu: g === "native",
|
|
408
541
|
overviewRulerLanes: 0,
|
|
409
542
|
hideCursorInOverviewRuler: !0,
|
|
410
543
|
overviewRulerBorder: !1,
|
|
411
544
|
scrollbar: {
|
|
412
|
-
vertical: ((
|
|
413
|
-
horizontal: ((
|
|
414
|
-
verticalScrollbarSize: ((
|
|
545
|
+
vertical: ((y = e.scrollbar) == null ? void 0 : y.vertical) ?? "auto",
|
|
546
|
+
horizontal: ((h = e.scrollbar) == null ? void 0 : h.horizontal) ?? "auto",
|
|
547
|
+
verticalScrollbarSize: ((b = e.scrollbar) == null ? void 0 : b.verticalScrollbarSize) ?? 6,
|
|
415
548
|
horizontalScrollbarSize: ((o = e.scrollbar) == null ? void 0 : o.horizontalScrollbarSize) ?? 6
|
|
416
549
|
},
|
|
417
550
|
fontFamily: e.fontFamily ?? 'Menlo, Monaco, "Courier New", monospace',
|
|
@@ -421,194 +554,132 @@ function oe({ readOnly: i, fontSize: t, wordWrap: l, glyphMargin: g, contextMenu
|
|
|
421
554
|
autoSurround: "languageDefined",
|
|
422
555
|
guides: { bracketPairs: !0, indentation: !0 },
|
|
423
556
|
suggest: {
|
|
424
|
-
showKeywords: ((
|
|
425
|
-
showSnippets: ((
|
|
426
|
-
showValues: ((
|
|
427
|
-
showProperties: ((
|
|
428
|
-
...((
|
|
557
|
+
showKeywords: ((a = e.suggest) == null ? void 0 : a.showKeywords) ?? !0,
|
|
558
|
+
showSnippets: ((i = e.suggest) == null ? void 0 : i.showSnippets) ?? !0,
|
|
559
|
+
showValues: ((s = e.suggest) == null ? void 0 : s.showValues) ?? !0,
|
|
560
|
+
showProperties: ((d = e.suggest) == null ? void 0 : d.showProperties) ?? !0,
|
|
561
|
+
...((u = e.suggest) == null ? void 0 : u.showIcons) !== void 0 && { showIcons: e.suggest.showIcons }
|
|
429
562
|
}
|
|
430
563
|
};
|
|
431
564
|
}
|
|
432
|
-
function
|
|
433
|
-
const e = () =>
|
|
565
|
+
function le(n, t, { language: r, value: l, placeholder: g, onEditorMount: c, contextMenuMode: m = "native" }) {
|
|
566
|
+
const e = () => n.layout();
|
|
434
567
|
e(), requestAnimationFrame(e), setTimeout(e, 50), setTimeout(e, 200);
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
568
|
+
const k = n.getContainerDomNode().parentElement;
|
|
569
|
+
if (k) {
|
|
437
570
|
const o = new ResizeObserver(e);
|
|
438
|
-
o.observe(
|
|
571
|
+
o.observe(k), n.onDidDispose(() => o.disconnect());
|
|
439
572
|
}
|
|
440
|
-
|
|
573
|
+
n.updateOptions({
|
|
441
574
|
autoClosingBrackets: "always",
|
|
442
575
|
autoClosingQuotes: "always",
|
|
443
576
|
autoClosingDelete: "always",
|
|
444
577
|
autoSurround: "languageDefined",
|
|
445
578
|
autoIndent: "full"
|
|
446
579
|
});
|
|
447
|
-
const
|
|
448
|
-
|
|
580
|
+
const f = t.KeyMod, y = t.KeyCode;
|
|
581
|
+
n.addAction({
|
|
449
582
|
id: "daakia.clipboard.copy",
|
|
450
583
|
label: "Copy",
|
|
451
|
-
keybindings: [
|
|
584
|
+
keybindings: [f.CtrlCmd | y.KeyC],
|
|
452
585
|
run: (o) => {
|
|
453
|
-
var
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
456
|
-
navigator.clipboard.writeText(((
|
|
586
|
+
var i, s;
|
|
587
|
+
const a = o.getSelection();
|
|
588
|
+
if (a && !a.isEmpty())
|
|
589
|
+
navigator.clipboard.writeText(((i = o.getModel()) == null ? void 0 : i.getValueInRange(a)) || "");
|
|
457
590
|
else {
|
|
458
|
-
const
|
|
459
|
-
|
|
591
|
+
const d = o.getPosition();
|
|
592
|
+
d && navigator.clipboard.writeText((((s = o.getModel()) == null ? void 0 : s.getLineContent(d.lineNumber)) || "") + `
|
|
460
593
|
`);
|
|
461
594
|
}
|
|
462
595
|
}
|
|
463
|
-
}),
|
|
596
|
+
}), n.addAction({
|
|
464
597
|
id: "daakia.clipboard.cut",
|
|
465
598
|
label: "Cut",
|
|
466
|
-
keybindings: [
|
|
599
|
+
keybindings: [f.CtrlCmd | y.KeyX],
|
|
467
600
|
run: (o) => {
|
|
468
|
-
var
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
471
|
-
navigator.clipboard.writeText(((
|
|
601
|
+
var i;
|
|
602
|
+
const a = o.getSelection();
|
|
603
|
+
if (a && !a.isEmpty())
|
|
604
|
+
navigator.clipboard.writeText(((i = o.getModel()) == null ? void 0 : i.getValueInRange(a)) || ""), o.executeEdits("cut", [{ range: a, text: "" }]);
|
|
472
605
|
else {
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
`), o.executeEdits("cut", [{ range: new t.Range(
|
|
606
|
+
const s = o.getPosition();
|
|
607
|
+
if (s) {
|
|
608
|
+
const d = o.getModel();
|
|
609
|
+
d && (navigator.clipboard.writeText(d.getLineContent(s.lineNumber) + `
|
|
610
|
+
`), o.executeEdits("cut", [{ range: new t.Range(s.lineNumber, 1, s.lineNumber + 1, 1), text: "" }]));
|
|
478
611
|
}
|
|
479
612
|
}
|
|
480
613
|
}
|
|
481
|
-
}),
|
|
614
|
+
}), n.addAction({
|
|
482
615
|
id: "daakia.clipboard.paste",
|
|
483
616
|
label: "Paste",
|
|
484
|
-
keybindings: [
|
|
617
|
+
keybindings: [f.CtrlCmd | y.KeyV],
|
|
485
618
|
run: async (o) => {
|
|
486
619
|
try {
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
const
|
|
490
|
-
|
|
620
|
+
const a = await navigator.clipboard.readText();
|
|
621
|
+
if (a) {
|
|
622
|
+
const i = o.getSelection();
|
|
623
|
+
i && o.executeEdits("paste", [{ range: i, text: a, forceMoveMarkers: !0 }]);
|
|
491
624
|
}
|
|
492
625
|
} catch {
|
|
493
626
|
}
|
|
494
627
|
}
|
|
495
|
-
}),
|
|
628
|
+
}), n.addAction({
|
|
496
629
|
id: "daakia.clipboard.selectAll",
|
|
497
630
|
label: "Select All",
|
|
498
|
-
keybindings: [
|
|
631
|
+
keybindings: [f.CtrlCmd | y.KeyA],
|
|
499
632
|
run: (o) => {
|
|
500
|
-
const
|
|
501
|
-
|
|
633
|
+
const a = o.getModel();
|
|
634
|
+
a && o.setSelection(a.getFullModelRange());
|
|
502
635
|
}
|
|
503
|
-
}),
|
|
636
|
+
}), n.addAction({
|
|
504
637
|
id: "daakia.format.document",
|
|
505
638
|
label: "Format Document",
|
|
506
|
-
keybindings: [
|
|
639
|
+
keybindings: [f.Shift | f.Alt | y.KeyF],
|
|
507
640
|
contextMenuGroupId: "modification",
|
|
508
641
|
contextMenuOrder: 1.5,
|
|
509
642
|
run: async (o) => {
|
|
510
|
-
var
|
|
511
|
-
const
|
|
512
|
-
if (!
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
643
|
+
var s;
|
|
644
|
+
const a = o.getModel();
|
|
645
|
+
if (!a) return;
|
|
646
|
+
const i = a.getLanguageId();
|
|
647
|
+
if (i === "xml" || i === "html")
|
|
515
648
|
try {
|
|
516
|
-
const
|
|
517
|
-
|
|
649
|
+
const d = a.getValue(), u = Re(d);
|
|
650
|
+
u !== d && o.executeEdits("daakia.format", [{ range: a.getFullModelRange(), text: u }]);
|
|
518
651
|
} catch {
|
|
519
652
|
}
|
|
520
|
-
else if (
|
|
653
|
+
else if (i === "yaml")
|
|
521
654
|
try {
|
|
522
|
-
const
|
|
523
|
-
|
|
655
|
+
const d = a.getValue(), u = Le(d);
|
|
656
|
+
u !== d && o.executeEdits("daakia.format", [{ range: a.getFullModelRange(), text: u }]);
|
|
524
657
|
} catch {
|
|
525
658
|
}
|
|
526
|
-
else if (
|
|
659
|
+
else if (i === "sql")
|
|
527
660
|
try {
|
|
528
|
-
const
|
|
529
|
-
|
|
661
|
+
const d = a.getValue(), u = Ae(d);
|
|
662
|
+
u !== d && o.executeEdits("daakia.format", [{ range: a.getFullModelRange(), text: u }]);
|
|
530
663
|
} catch {
|
|
531
664
|
}
|
|
532
665
|
else
|
|
533
|
-
await ((
|
|
666
|
+
await ((s = o.getAction("editor.action.formatDocument")) == null ? void 0 : s.run());
|
|
534
667
|
}
|
|
535
|
-
}),
|
|
668
|
+
}), n.addAction({
|
|
536
669
|
id: "daakia.findAndReplace",
|
|
537
670
|
label: "Find and Replace",
|
|
538
|
-
keybindings: [
|
|
671
|
+
keybindings: [f.CtrlCmd | f.Shift | y.KeyH],
|
|
539
672
|
contextMenuGroupId: "navigation",
|
|
540
673
|
contextMenuOrder: 1.5,
|
|
541
674
|
run: () => {
|
|
542
675
|
var o;
|
|
543
|
-
return (o =
|
|
676
|
+
return (o = n.getAction("editor.action.startFindReplaceAction")) == null ? void 0 : o.run();
|
|
544
677
|
}
|
|
545
|
-
});
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
const o =
|
|
549
|
-
o
|
|
550
|
-
autoClosingPairs: [
|
|
551
|
-
{ open: "{", close: "}" },
|
|
552
|
-
{ open: "[", close: "]" },
|
|
553
|
-
{ open: "(", close: ")" },
|
|
554
|
-
{ open: '"', close: '"', notIn: ["string"] },
|
|
555
|
-
{ open: "'", close: "'", notIn: ["string", "comment"] },
|
|
556
|
-
{ open: "<", close: ">", notIn: ["string"] }
|
|
557
|
-
],
|
|
558
|
-
brackets: [["{", "}"], ["[", "]"], ["(", ")"], ["<", ">"]],
|
|
559
|
-
surroundingPairs: [
|
|
560
|
-
{ open: "{", close: "}" },
|
|
561
|
-
{ open: "[", close: "]" },
|
|
562
|
-
{ open: "(", close: ")" },
|
|
563
|
-
{ open: '"', close: '"' },
|
|
564
|
-
{ open: "'", close: "'" },
|
|
565
|
-
{ open: "<", close: ">" }
|
|
566
|
-
],
|
|
567
|
-
onEnterRules: [
|
|
568
|
-
{
|
|
569
|
-
beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
|
|
570
|
-
afterText: /^<\/([_:\w][_:\w\-.\d]*)\s*>$/i,
|
|
571
|
-
action: { indentAction: t.languages.IndentAction.IndentOutdent }
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
|
|
575
|
-
action: { indentAction: t.languages.IndentAction.Indent }
|
|
576
|
-
}
|
|
577
|
-
],
|
|
578
|
-
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
|
|
579
|
-
}), t.languages.registerCompletionItemProvider(o, {
|
|
580
|
-
triggerCharacters: ["/"],
|
|
581
|
-
provideCompletionItems: (s, n) => {
|
|
582
|
-
const r = s.getValueInRange({
|
|
583
|
-
startLineNumber: 1,
|
|
584
|
-
startColumn: 1,
|
|
585
|
-
endLineNumber: n.lineNumber,
|
|
586
|
-
endColumn: n.column
|
|
587
|
-
});
|
|
588
|
-
if (r.match(/<\/\s*$/)) {
|
|
589
|
-
const a = [], p = /<\/?([_:\w][_:\w\-.\d]*)[^>]*\/?>/g;
|
|
590
|
-
let f;
|
|
591
|
-
for (; (f = p.exec(r.slice(0, -2))) !== null; )
|
|
592
|
-
f[0].startsWith("</") ? a.pop() : f[0].endsWith("/>") || a.push(f[1]);
|
|
593
|
-
const d = a[a.length - 1];
|
|
594
|
-
if (d)
|
|
595
|
-
return {
|
|
596
|
-
suggestions: [{
|
|
597
|
-
label: `/${d}>`,
|
|
598
|
-
kind: t.languages.CompletionItemKind.Keyword,
|
|
599
|
-
insertText: `${d}>`,
|
|
600
|
-
range: {
|
|
601
|
-
startLineNumber: n.lineNumber,
|
|
602
|
-
startColumn: n.column,
|
|
603
|
-
endLineNumber: n.lineNumber,
|
|
604
|
-
endColumn: n.column
|
|
605
|
-
}
|
|
606
|
-
}]
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
return { suggestions: [] };
|
|
610
|
-
}
|
|
611
|
-
})) : t.languages.setLanguageConfiguration(o, {
|
|
678
|
+
}), J(t, "xml"), J(t, "html");
|
|
679
|
+
const h = n.getModel();
|
|
680
|
+
if (h) {
|
|
681
|
+
const o = h.getLanguageId();
|
|
682
|
+
o !== "xml" && o !== "html" && !U.has(o) && (U.add(o), t.languages.setLanguageConfiguration(o, {
|
|
612
683
|
autoClosingPairs: [
|
|
613
684
|
{ open: "{", close: "}" },
|
|
614
685
|
{ open: "[", close: "]" },
|
|
@@ -624,9 +695,9 @@ function re(i, t, { language: l, value: g, placeholder: c, onEditorMount: m, con
|
|
|
624
695
|
{ open: '"', close: '"' },
|
|
625
696
|
{ open: "'", close: "'" }
|
|
626
697
|
]
|
|
627
|
-
});
|
|
698
|
+
}));
|
|
628
699
|
}
|
|
629
|
-
t.languages.getLanguages().some((o) => o.id === "graphql") || (t.languages.register({ id: "graphql" }), t.languages.setMonarchTokensProvider("graphql", {
|
|
700
|
+
De(n, t), t.languages.getLanguages().some((o) => o.id === "graphql") || (t.languages.register({ id: "graphql" }), t.languages.setMonarchTokensProvider("graphql", {
|
|
630
701
|
keywords: ["type", "input", "enum", "union", "interface", "scalar", "schema", "query", "mutation", "subscription", "fragment", "on", "extend", "implements", "directive", "repeatable"],
|
|
631
702
|
typeKeywords: ["String", "Int", "Float", "Boolean", "ID"],
|
|
632
703
|
operators: ["!", "=", "|", "&", "..."],
|
|
@@ -648,61 +719,61 @@ function re(i, t, { language: l, value: g, placeholder: c, onEditorMount: m, con
|
|
|
648
719
|
[/@[a-zA-Z_]\w*/, "annotation"]
|
|
649
720
|
]
|
|
650
721
|
}
|
|
651
|
-
})),
|
|
722
|
+
})), r === "javascript" && (H || (t.languages.typescript.javascriptDefaults.addExtraLib(Ee, "dk-globals.d.ts"), H = !0), t.languages.registerCompletionItemProvider("javascript", {
|
|
652
723
|
triggerCharacters: ["."],
|
|
653
|
-
provideCompletionItems: (o,
|
|
654
|
-
const
|
|
655
|
-
startLineNumber:
|
|
724
|
+
provideCompletionItems: (o, a) => {
|
|
725
|
+
const i = o.getValueInRange({
|
|
726
|
+
startLineNumber: a.lineNumber,
|
|
656
727
|
startColumn: 1,
|
|
657
|
-
endLineNumber:
|
|
658
|
-
endColumn:
|
|
659
|
-
}),
|
|
660
|
-
if (
|
|
661
|
-
const
|
|
662
|
-
return /\bconsole\.\s*$/.test(
|
|
728
|
+
endLineNumber: a.lineNumber,
|
|
729
|
+
endColumn: a.column
|
|
730
|
+
}), s = we();
|
|
731
|
+
if (s.length > 0) return { suggestions: s };
|
|
732
|
+
const d = { startLineNumber: a.lineNumber, endLineNumber: a.lineNumber, startColumn: a.column, endColumn: a.column };
|
|
733
|
+
return /\bconsole\.\s*$/.test(i) ? {
|
|
663
734
|
suggestions: [
|
|
664
|
-
{ label: "log", kind: t.languages.CompletionItemKind.Function, insertText: "log(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Log output", range:
|
|
665
|
-
{ label: "info", kind: t.languages.CompletionItemKind.Function, insertText: "info(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Info output", range:
|
|
666
|
-
{ label: "warn", kind: t.languages.CompletionItemKind.Function, insertText: "warn(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Warning output", range:
|
|
667
|
-
{ label: "error", kind: t.languages.CompletionItemKind.Function, insertText: "error(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Error output", range:
|
|
668
|
-
{ label: "debug", kind: t.languages.CompletionItemKind.Function, insertText: "debug(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Debug output", range:
|
|
735
|
+
{ label: "log", kind: t.languages.CompletionItemKind.Function, insertText: "log(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Log output", range: d },
|
|
736
|
+
{ label: "info", kind: t.languages.CompletionItemKind.Function, insertText: "info(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Info output", range: d },
|
|
737
|
+
{ label: "warn", kind: t.languages.CompletionItemKind.Function, insertText: "warn(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Warning output", range: d },
|
|
738
|
+
{ label: "error", kind: t.languages.CompletionItemKind.Function, insertText: "error(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Error output", range: d },
|
|
739
|
+
{ label: "debug", kind: t.languages.CompletionItemKind.Function, insertText: "debug(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Debug output", range: d }
|
|
669
740
|
]
|
|
670
741
|
} : { suggestions: [] };
|
|
671
742
|
}
|
|
672
|
-
})), !
|
|
743
|
+
})), !l && g && n.updateOptions({ placeholder: g }), c == null || c(n, t), n.updateOptions({ contextmenu: m === "native" });
|
|
673
744
|
}
|
|
674
|
-
function
|
|
675
|
-
original:
|
|
745
|
+
function Be({
|
|
746
|
+
original: n,
|
|
676
747
|
modified: t,
|
|
677
|
-
language:
|
|
678
|
-
height:
|
|
679
|
-
readOnly:
|
|
680
|
-
renderSideBySide:
|
|
681
|
-
wordWrap:
|
|
748
|
+
language: r = "sql",
|
|
749
|
+
height: l = 300,
|
|
750
|
+
readOnly: g = !0,
|
|
751
|
+
renderSideBySide: c = !0,
|
|
752
|
+
wordWrap: m = !1,
|
|
682
753
|
fontSize: e = 12,
|
|
683
|
-
theme:
|
|
684
|
-
onMount:
|
|
754
|
+
theme: k,
|
|
755
|
+
onMount: f
|
|
685
756
|
}) {
|
|
686
|
-
const
|
|
687
|
-
return /* @__PURE__ */
|
|
688
|
-
|
|
757
|
+
const y = P(), h = k ?? (y === "light" ? "vs" : "vs-dark"), b = typeof l == "number" ? `${l}px` : l;
|
|
758
|
+
return /* @__PURE__ */ I(
|
|
759
|
+
ge,
|
|
689
760
|
{
|
|
690
|
-
height:
|
|
691
|
-
language:
|
|
692
|
-
theme:
|
|
693
|
-
original:
|
|
761
|
+
height: b,
|
|
762
|
+
language: r,
|
|
763
|
+
theme: h,
|
|
764
|
+
original: n,
|
|
694
765
|
modified: t,
|
|
695
|
-
onMount:
|
|
766
|
+
onMount: f,
|
|
696
767
|
options: {
|
|
697
|
-
readOnly:
|
|
698
|
-
renderSideBySide:
|
|
768
|
+
readOnly: g,
|
|
769
|
+
renderSideBySide: c,
|
|
699
770
|
// Monaco silently drops to inline/unified rendering below its own
|
|
700
771
|
// width threshold regardless of renderSideBySide — this diff editor
|
|
701
772
|
// is often mounted inside narrow panels (e.g. Merkle's expanded
|
|
702
773
|
// table row), so pin side-by-side explicitly instead of letting it
|
|
703
774
|
// auto-collapse.
|
|
704
775
|
useInlineViewWhenSpaceIsLimited: !1,
|
|
705
|
-
wordWrap:
|
|
776
|
+
wordWrap: m ? "on" : "off",
|
|
706
777
|
fontSize: e,
|
|
707
778
|
automaticLayout: !0,
|
|
708
779
|
minimap: { enabled: !1 },
|
|
@@ -715,11 +786,11 @@ function Se({
|
|
|
715
786
|
);
|
|
716
787
|
}
|
|
717
788
|
window.MonacoEnvironment = {
|
|
718
|
-
getWorker(
|
|
719
|
-
return t === "json" ? new
|
|
789
|
+
getWorker(n, t) {
|
|
790
|
+
return t === "json" ? new be() : t === "html" || t === "handlebars" || t === "razor" ? new ye() : t === "typescript" || t === "javascript" ? new Ce() : new he();
|
|
720
791
|
}
|
|
721
792
|
};
|
|
722
|
-
|
|
793
|
+
O.editor.defineTheme("daakia-dark", {
|
|
723
794
|
base: "vs-dark",
|
|
724
795
|
inherit: !0,
|
|
725
796
|
rules: [
|
|
@@ -786,36 +857,36 @@ B.editor.defineTheme("daakia-dark", {
|
|
|
786
857
|
focusBorder: "#6366f1"
|
|
787
858
|
}
|
|
788
859
|
});
|
|
789
|
-
|
|
790
|
-
target:
|
|
791
|
-
module:
|
|
860
|
+
q.setCompilerOptions({
|
|
861
|
+
target: oe.ESNext,
|
|
862
|
+
module: ne.ESNext,
|
|
792
863
|
allowNonTsExtensions: !0,
|
|
793
864
|
allowJs: !0,
|
|
794
865
|
checkJs: !0,
|
|
795
866
|
strict: !1,
|
|
796
867
|
noEmit: !0,
|
|
797
868
|
esModuleInterop: !0,
|
|
798
|
-
moduleResolution:
|
|
799
|
-
jsx:
|
|
869
|
+
moduleResolution: te.NodeJs,
|
|
870
|
+
jsx: ee.React
|
|
800
871
|
});
|
|
801
|
-
|
|
872
|
+
q.setDiagnosticsOptions({
|
|
802
873
|
noSemanticValidation: !1,
|
|
803
874
|
noSyntaxValidation: !1
|
|
804
875
|
});
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
target:
|
|
809
|
-
module:
|
|
876
|
+
q.setEagerModelSync(!0);
|
|
877
|
+
re.setEagerModelSync(!0);
|
|
878
|
+
re.setCompilerOptions({
|
|
879
|
+
target: oe.ESNext,
|
|
880
|
+
module: ne.ESNext,
|
|
810
881
|
allowNonTsExtensions: !0,
|
|
811
882
|
allowJs: !0,
|
|
812
883
|
strict: !1,
|
|
813
884
|
noEmit: !0,
|
|
814
885
|
esModuleInterop: !0,
|
|
815
|
-
moduleResolution:
|
|
816
|
-
jsx:
|
|
886
|
+
moduleResolution: te.NodeJs,
|
|
887
|
+
jsx: ee.React
|
|
817
888
|
});
|
|
818
|
-
|
|
889
|
+
O.editor.defineTheme("daakia-light", {
|
|
819
890
|
base: "vs",
|
|
820
891
|
inherit: !0,
|
|
821
892
|
rules: [
|
|
@@ -873,16 +944,16 @@ B.editor.defineTheme("daakia-light", {
|
|
|
873
944
|
focusBorder: "#6366f1"
|
|
874
945
|
}
|
|
875
946
|
});
|
|
876
|
-
|
|
877
|
-
window.monaco =
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
function
|
|
882
|
-
|
|
947
|
+
ce.config({ monaco: O });
|
|
948
|
+
window.monaco = O;
|
|
949
|
+
pe(Oe);
|
|
950
|
+
me(Be);
|
|
951
|
+
fe();
|
|
952
|
+
function He(n) {
|
|
953
|
+
O.editor.setTheme(n === "dark" ? "daakia-dark" : "daakia-light");
|
|
883
954
|
}
|
|
884
955
|
export {
|
|
885
|
-
|
|
886
|
-
|
|
956
|
+
He as applyMonacoTheme,
|
|
957
|
+
O as monaco
|
|
887
958
|
};
|
|
888
959
|
//# sourceMappingURL=monaco-setup.js.map
|