@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.
@@ -1,146 +1,146 @@
1
- import K, { DiffEditor as se, loader as le } from "@monaco-editor/react";
2
- import * as B from "monaco-editor";
3
- import { q as U, E as V, A as ue, B as de, F as ge } from "./chunks/EditorView.shell-DWGMOgiy.js";
4
- import { jsx as A } from "react/jsx-runtime";
5
- import { useState as ce, useEffect as M, useRef as R, useCallback as H, useMemo as J } from "react";
6
- import fe from "monaco-editor/esm/vs/editor/editor.worker?worker&inline";
7
- import pe from "monaco-editor/esm/vs/language/json/json.worker?worker&inline";
8
- import me from "monaco-editor/esm/vs/language/html/html.worker?worker&inline";
9
- import ke from "monaco-editor/esm/vs/language/typescript/ts.worker?worker&inline";
10
- import { javascriptDefaults as P, JsxEmit as Z, ModuleResolutionKind as Y, ModuleKind as X, ScriptTarget as Q, typescriptDefaults as ee } from "monaco-editor/esm/vs/language/typescript/monaco.contribution";
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 i = ((t = document.body) == null ? void 0 : t.getAttribute("data-vscode-theme-kind")) || document.documentElement.getAttribute("data-vscode-theme-kind");
14
- return i ? i === "vscode-light" ? "light" : "dark" : document.documentElement.getAttribute("data-theme") || "dark";
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 q() {
17
- const [i, t] = ce(z);
18
- return M(() => {
19
- const l = () => t(z()), g = new MutationObserver(l);
20
- g.observe(document.documentElement, { attributes: !0, attributeFilter: ["data-theme", "data-vscode-theme-kind"] });
21
- const c = new MutationObserver(l);
22
- return document.body && c.observe(document.body, { attributes: !0, attributeFilter: ["data-vscode-theme-kind"] }), () => {
23
- g.disconnect(), c.disconnect();
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
- }, []), i;
25
+ }, []), n;
26
26
  }
27
- const he = "";
28
- function be(i, t, l) {
27
+ const Ee = "";
28
+ function we(n, t, r) {
29
29
  return [];
30
30
  }
31
- function ye(i) {
31
+ function Te(n) {
32
32
  const {
33
33
  breakpoints: t,
34
- disabledBreakpoints: l,
35
- conditionalBreakpointLines: g,
36
- pausedLine: c,
37
- onToggleBreakpoint: m,
38
- onGlyphContextMenu: v
39
- } = i, e = R(null), E = R(null), k = R([]), C = R([]), b = R([]), y = R([]), o = H((n) => {
40
- const r = e.current;
41
- if (!r) return !0;
42
- const u = r.getModel();
43
- return !u || n > u.getLineCount() ? !1 : !!u.getLineContent(n).trim();
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 M(() => {
46
- const n = e.current, r = E.current;
47
- if (!n || !r) return;
48
- const u = [];
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 a of t) {
51
- if (c && a === c) continue;
52
- const p = l == null ? void 0 : l.includes(a), f = g == null ? void 0 : g.includes(a);
53
- let d = "daakia-bp-glyph";
54
- p ? d = "daakia-bp-glyph--disabled" : f && (d = "daakia-bp-glyph--conditional"), u.push({
55
- range: new r.Range(a, 1, a, 1),
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: p ? "" : "daakia-bp-line",
59
- stickiness: r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
60
- glyphMarginClassName: d,
58
+ className: C ? "" : "daakia-bp-line",
59
+ stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
60
+ glyphMarginClassName: p,
61
61
  glyphMarginHoverMessage: {
62
- value: f ? "Conditional Breakpoint" : p ? "Disabled Breakpoint" : "Breakpoint"
62
+ value: E ? "Conditional Breakpoint" : C ? "Disabled Breakpoint" : "Breakpoint"
63
63
  }
64
64
  }
65
65
  });
66
66
  }
67
- k.current = n.deltaDecorations(k.current, u);
68
- }, [t, l, g, c]), M(() => {
69
- const n = e.current, r = E.current;
70
- if (!(!n || !r))
71
- if (c) {
72
- const a = (t == null ? void 0 : t.includes(c)) ? "daakia-paused-line__arrow daakia-paused-line__arrow--with-bp" : "daakia-paused-line__arrow";
73
- C.current = n.deltaDecorations(C.current, [{
74
- range: new r.Range(c, 1, c, 1),
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: a,
79
- stickiness: r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
78
+ glyphMarginClassName: u,
79
+ stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
80
80
  }
81
- }]), n.revealLineInCenter(c);
81
+ }]), i.revealLineInCenter(g);
82
82
  } else
83
- C.current = n.deltaDecorations(C.current, []);
84
- }, [c, t]), M(() => () => {
85
- y.current.forEach((n) => {
86
- var r;
87
- return (r = n == null ? void 0 : n.dispose) == null ? void 0 : r.call(n);
88
- }), y.current = [];
89
- }, []), { attach: H((n, r) => {
90
- e.current = n, E.current = r;
91
- const u = n.getDomNode();
92
- if (u) {
93
- const a = u.querySelector(".margin");
94
- a && a.setAttribute("data-daakia-bp-gutter", "");
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 (m) {
97
- const a = n.onMouseDown((p) => {
98
- var f;
99
- if (p.event.leftButton && p.target.type === r.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
100
- const d = (f = p.target.position) == null ? void 0 : f.lineNumber;
101
- d && o(d) && m(d);
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
- y.current.push(a);
104
+ b.current.push(u);
105
105
  }
106
- if (v) {
107
- let a = null;
108
- const p = n.onMouseDown((d) => {
109
- var h;
110
- if (d.event.rightButton && (d.target.type === r.editor.MouseTargetType.GUTTER_GLYPH_MARGIN || d.target.type === r.editor.MouseTargetType.GUTTER_LINE_NUMBERS || d.target.type === r.editor.MouseTargetType.GUTTER_LINE_DECORATIONS)) {
111
- const N = (h = d.target.position) == null ? void 0 : h.lineNumber;
112
- N && o(N) && (a = { line: N, x: d.event.posx, y: d.event.posy });
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
- y.current.push(p);
116
- const f = n.getDomNode();
117
- if (f) {
118
- const d = (h) => {
119
- a ? (h.preventDefault(), h.stopPropagation(), v(a.line, { x: a.x, y: a.y }), a = null) : h.target.closest("[data-daakia-bp-gutter]") && (h.preventDefault(), h.stopPropagation());
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
- f.addEventListener("contextmenu", d, !0), y.current.push({ dispose: () => f.removeEventListener("contextmenu", d, !0) });
121
+ E.addEventListener("contextmenu", p, !0), b.current.push({ dispose: () => E.removeEventListener("contextmenu", p, !0) });
122
122
  }
123
123
  }
124
- if (m) {
125
- const a = n.onMouseMove((f) => {
126
- var d;
127
- if (f.target.type === r.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
128
- const h = (d = f.target.position) == null ? void 0 : d.lineNumber;
129
- if (h && o(h)) {
130
- const N = n.getModel();
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 L = N.getLineDecorations(h);
133
- if (!(L == null ? void 0 : L.some(
132
+ const M = N.getLineDecorations(w);
133
+ if (!(M == null ? void 0 : M.some(
134
134
  (S) => {
135
- var T, w, I, F;
136
- return ((w = (T = S.options) == null ? void 0 : T.glyphMarginClassName) == null ? void 0 : w.startsWith("daakia-bp-glyph")) && !((F = (I = S.options) == null ? void 0 : I.glyphMarginClassName) != null && F.includes("hover"));
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
- b.current = n.deltaDecorations(b.current, [{
140
- range: new r.Range(h, 1, h, 1),
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: r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
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
- b.current.length && (b.current = n.deltaDecorations(b.current, []));
153
+ h.current.length && (h.current = i.deltaDecorations(h.current, []));
154
154
  });
155
- y.current.push(a);
156
- const p = n.onMouseLeave(() => {
157
- b.current.length && (b.current = n.deltaDecorations(b.current, []));
155
+ b.current.push(u);
156
+ const C = i.onMouseLeave(() => {
157
+ h.current.length && (h.current = i.deltaDecorations(h.current, []));
158
158
  });
159
- y.current.push(p);
159
+ b.current.push(C);
160
160
  }
161
161
  if (t) {
162
- const a = [];
163
- for (const p of t) {
164
- const f = l == null ? void 0 : l.includes(p), d = g == null ? void 0 : g.includes(p);
165
- let h = "daakia-bp-glyph";
166
- f ? h = "daakia-bp-glyph--disabled" : d && (h = "daakia-bp-glyph--conditional"), a.push({
167
- range: new r.Range(p, 1, p, 1),
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: f ? "" : "daakia-bp-line",
171
- stickiness: r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
172
- glyphMarginClassName: h,
170
+ className: E ? "" : "daakia-bp-line",
171
+ stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
172
+ glyphMarginClassName: w,
173
173
  glyphMarginHoverMessage: {
174
- value: d ? "Conditional Breakpoint" : f ? "Disabled Breakpoint" : "Breakpoint"
174
+ value: p ? "Conditional Breakpoint" : E ? "Disabled Breakpoint" : "Breakpoint"
175
175
  }
176
176
  }
177
177
  });
178
178
  }
179
- k.current = n.deltaDecorations(k.current, a);
179
+ f.current = i.deltaDecorations(f.current, u);
180
180
  }
181
- }, [m, v, o, t, l, g]) };
181
+ }, [c, m, o, t, r, l]) };
182
182
  }
183
- const te = {
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 _(i) {
192
- return i(te);
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
- _.getState = () => te;
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 Ce(i) {
212
- let l = 0, g = "";
213
- const c = i.replace(/>\s*</g, "><").split(new RegExp("(?<=>)(?=<)"));
214
- for (const m of c) {
215
- const v = /^<\//.test(m), e = /\/>$/.test(m) || /^<!/.test(m) || /^<\?/.test(m);
216
- v && (l = Math.max(0, l - 1)), g += " ".repeat(l) + m.trim() + `
217
- `, !v && !e && /^<[^/!?]/.test(m) && l++;
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 g.trimEnd();
346
+ return l.trimEnd();
220
347
  }
221
- function ve(i) {
222
- return i.split(`
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 Ee(i) {
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 i.replace(/\s+/g, " ").replace(t, `
357
+ return n.replace(/\s+/g, " ").replace(t, `
231
358
  $1`).split(`
232
- `).map((l) => l.trim()).filter((l) => l.length > 0).join(`
359
+ `).map((r) => r.trim()).filter((r) => r.length > 0).join(`
233
360
  `);
234
361
  }
235
- function we({
236
- value: i,
362
+ function Me({
363
+ value: n,
237
364
  onChange: t,
238
- language: l = "json",
239
- height: g = "200px",
240
- minHeight: c,
241
- readOnly: m = !1,
242
- placeholder: v,
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: E,
245
- fontSize: k,
246
- className: C = "",
247
- bordered: b = !1,
248
- onEditorMount: y,
371
+ size: k,
372
+ fontSize: f,
373
+ className: y = "",
374
+ bordered: h = !1,
375
+ onEditorMount: b,
249
376
  contextMenuMode: o = "native",
250
- contextMenuItems: s,
251
- editorOptions: n,
252
- accentColor: r
377
+ contextMenuItems: a,
378
+ editorOptions: i,
379
+ accentColor: s
253
380
  }) {
254
- const u = U(E), a = k ?? u.fontSize, p = q(), f = R(null), d = R([]), h = J(
255
- () => `inmemory://daakia/${crypto.randomUUID()}${ne[l] || ".txt"}`,
256
- [l]
257
- ), N = typeof g == "number" ? `${g}px` : g, L = c ? `max(${N}, ${c}px)` : N;
258
- M(() => () => {
259
- d.current.forEach((w) => {
260
- var I;
261
- return (I = w == null ? void 0 : w.dispose) == null ? void 0 : I.call(w);
262
- }), d.current = [];
263
- const T = f.current;
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 w = T.getModel();
266
- w && w.dispose();
392
+ const v = T.getModel();
393
+ v && v.dispose();
267
394
  }
268
- }, []);
269
- const O = (T, w) => {
270
- f.current = T, d.current = [], re(T, w, { language: l, value: i, placeholder: v, onEditorMount: y, contextMenuMode: o });
271
- }, S = p === "light" ? "daakia-light" : "daakia-dark";
272
- return /* @__PURE__ */ A(V, { bordered: b, containerHeight: L, contextMenuMode: o, contextMenuItems: s, accentColor: r, children: /* @__PURE__ */ A(
273
- K,
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: l,
277
- path: h,
278
- value: i,
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: O,
282
- options: oe({ readOnly: m, fontSize: a, wordWrap: e, glyphMargin: !1, contextMenuMode: o, editorOptions: n, theme: S })
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 Te({
287
- value: i,
416
+ function Ie({
417
+ value: n,
288
418
  onChange: t,
289
- language: l = "json",
290
- height: g = "200px",
291
- minHeight: c,
292
- readOnly: m = !1,
293
- placeholder: v,
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: E,
296
- fontSize: k,
297
- className: C = "",
298
- bordered: b = !1,
299
- breakpoints: y,
425
+ size: k,
426
+ fontSize: f,
427
+ className: y = "",
428
+ bordered: h = !1,
429
+ breakpoints: b,
300
430
  disabledBreakpoints: o,
301
- conditionalBreakpointLines: s,
302
- pausedLine: n,
303
- onToggleBreakpoint: r,
304
- onGlyphContextMenu: u,
305
- onEditorMount: a,
306
- contextMenuMode: p = "native",
307
- contextMenuItems: f,
308
- editorOptions: d,
309
- accentColor: h
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 = U(E), L = k ?? N.fontSize, O = q(), S = R(null), T = R([]), w = J(
312
- () => `inmemory://daakia/${crypto.randomUUID()}${ne[l] || ".txt"}`,
313
- [l]
314
- ), I = typeof g == "number" ? `${g}px` : g, F = c ? `max(${I}, ${c}px)` : I, { attach: ie } = ye({
315
- breakpoints: y,
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: s,
318
- pausedLine: n,
319
- onToggleBreakpoint: r,
320
- onGlyphContextMenu: u
321
- }), W = _((D) => D.navigateLine);
322
- M(() => () => {
323
- T.current.forEach((x) => {
324
- var G;
325
- return (G = x == null ? void 0 : x.dispose) == null ? void 0 : G.call(x);
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 D = S.current;
328
- if (D) {
329
- const x = D.getModel();
330
- x && x.dispose();
457
+ const x = S.current;
458
+ if (x) {
459
+ const D = x.getModel();
460
+ D && D.dispose();
331
461
  }
332
- }, []), M(() => {
333
- !W || !S.current || !y || (S.current.revealLineInCenter(W), S.current.setPosition({ lineNumber: W, column: 1 }), _.getState().setNavigateLine(null));
334
- }, [W, y]);
335
- const ae = (D, x) => {
336
- S.current = D, T.current = [], ie(D, x), re(D, x, { language: l, value: i, placeholder: v, onEditorMount: a, contextMenuMode: p });
337
- }, j = O === "light" ? "daakia-light" : "daakia-dark";
338
- return /* @__PURE__ */ A(V, { bordered: b, containerHeight: F, contextMenuMode: p, contextMenuItems: f, accentColor: h, children: /* @__PURE__ */ A(
339
- K,
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: l,
343
- path: w,
344
- value: i,
345
- theme: j,
346
- onChange: (D) => t == null ? void 0 : t(D ?? ""),
347
- onMount: ae,
348
- options: oe({ readOnly: m, fontSize: L, wordWrap: e, glyphMargin: !!r, contextMenuMode: p, editorOptions: d, theme: j })
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 Ne({ debugSupported: i = !1, className: t = "", ...l }) {
353
- return i ? /* @__PURE__ */ A(Te, { className: t, ...l }) : /* @__PURE__ */ A(we, { className: t, ...l });
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 oe({ readOnly: i, fontSize: t, wordWrap: l, glyphMargin: g, contextMenuMode: c = "native", editorOptions: m, theme: v }) {
356
- var E, k, C, b, y, o, s, n, r, u, a;
357
- const e = m ?? {};
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: v,
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: ((E = e.padding) == null ? void 0 : E.top) ?? 8, bottom: ((k = e.padding) == null ? void 0 : k.bottom) ?? 8 },
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: i,
532
+ readOnly: n,
400
533
  fontSize: t,
401
- wordWrap: e.wordWrap ?? (l ? "on" : "off"),
534
+ wordWrap: e.wordWrap ?? (r ? "on" : "off"),
402
535
  // ── DUI structural — never overridable ──────────────────────────────────
403
536
  automaticLayout: !0,
404
- glyphMargin: g,
405
- renderLineHighlight: e.renderLineHighlight ?? (g ? "line" : "none"),
537
+ glyphMargin: l,
538
+ renderLineHighlight: e.renderLineHighlight ?? (l ? "line" : "none"),
406
539
  fixedOverflowWidgets: !0,
407
- contextmenu: c === "native",
540
+ contextmenu: g === "native",
408
541
  overviewRulerLanes: 0,
409
542
  hideCursorInOverviewRuler: !0,
410
543
  overviewRulerBorder: !1,
411
544
  scrollbar: {
412
- vertical: ((C = e.scrollbar) == null ? void 0 : C.vertical) ?? "auto",
413
- horizontal: ((b = e.scrollbar) == null ? void 0 : b.horizontal) ?? "auto",
414
- verticalScrollbarSize: ((y = e.scrollbar) == null ? void 0 : y.verticalScrollbarSize) ?? 6,
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: ((s = e.suggest) == null ? void 0 : s.showKeywords) ?? !0,
425
- showSnippets: ((n = e.suggest) == null ? void 0 : n.showSnippets) ?? !0,
426
- showValues: ((r = e.suggest) == null ? void 0 : r.showValues) ?? !0,
427
- showProperties: ((u = e.suggest) == null ? void 0 : u.showProperties) ?? !0,
428
- ...((a = e.suggest) == null ? void 0 : a.showIcons) !== void 0 && { showIcons: e.suggest.showIcons }
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 re(i, t, { language: l, value: g, placeholder: c, onEditorMount: m, contextMenuMode: v = "native" }) {
433
- const e = () => i.layout();
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 E = i.getContainerDomNode().parentElement;
436
- if (E) {
568
+ const k = n.getContainerDomNode().parentElement;
569
+ if (k) {
437
570
  const o = new ResizeObserver(e);
438
- o.observe(E), i.onDidDispose(() => o.disconnect());
571
+ o.observe(k), n.onDidDispose(() => o.disconnect());
439
572
  }
440
- i.updateOptions({
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 k = t.KeyMod, C = t.KeyCode;
448
- i.addAction({
580
+ const f = t.KeyMod, y = t.KeyCode;
581
+ n.addAction({
449
582
  id: "daakia.clipboard.copy",
450
583
  label: "Copy",
451
- keybindings: [k.CtrlCmd | C.KeyC],
584
+ keybindings: [f.CtrlCmd | y.KeyC],
452
585
  run: (o) => {
453
- var n, r;
454
- const s = o.getSelection();
455
- if (s && !s.isEmpty())
456
- navigator.clipboard.writeText(((n = o.getModel()) == null ? void 0 : n.getValueInRange(s)) || "");
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 u = o.getPosition();
459
- u && navigator.clipboard.writeText((((r = o.getModel()) == null ? void 0 : r.getLineContent(u.lineNumber)) || "") + `
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
- }), i.addAction({
596
+ }), n.addAction({
464
597
  id: "daakia.clipboard.cut",
465
598
  label: "Cut",
466
- keybindings: [k.CtrlCmd | C.KeyX],
599
+ keybindings: [f.CtrlCmd | y.KeyX],
467
600
  run: (o) => {
468
- var n;
469
- const s = o.getSelection();
470
- if (s && !s.isEmpty())
471
- navigator.clipboard.writeText(((n = o.getModel()) == null ? void 0 : n.getValueInRange(s)) || ""), o.executeEdits("cut", [{ range: s, text: "" }]);
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 r = o.getPosition();
474
- if (r) {
475
- const u = o.getModel();
476
- u && (navigator.clipboard.writeText(u.getLineContent(r.lineNumber) + `
477
- `), o.executeEdits("cut", [{ range: new t.Range(r.lineNumber, 1, r.lineNumber + 1, 1), text: "" }]));
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
- }), i.addAction({
614
+ }), n.addAction({
482
615
  id: "daakia.clipboard.paste",
483
616
  label: "Paste",
484
- keybindings: [k.CtrlCmd | C.KeyV],
617
+ keybindings: [f.CtrlCmd | y.KeyV],
485
618
  run: async (o) => {
486
619
  try {
487
- const s = await navigator.clipboard.readText();
488
- if (s) {
489
- const n = o.getSelection();
490
- n && o.executeEdits("paste", [{ range: n, text: s, forceMoveMarkers: !0 }]);
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
- }), i.addAction({
628
+ }), n.addAction({
496
629
  id: "daakia.clipboard.selectAll",
497
630
  label: "Select All",
498
- keybindings: [k.CtrlCmd | C.KeyA],
631
+ keybindings: [f.CtrlCmd | y.KeyA],
499
632
  run: (o) => {
500
- const s = o.getModel();
501
- s && o.setSelection(s.getFullModelRange());
633
+ const a = o.getModel();
634
+ a && o.setSelection(a.getFullModelRange());
502
635
  }
503
- }), i.addAction({
636
+ }), n.addAction({
504
637
  id: "daakia.format.document",
505
638
  label: "Format Document",
506
- keybindings: [k.Shift | k.Alt | C.KeyF],
639
+ keybindings: [f.Shift | f.Alt | y.KeyF],
507
640
  contextMenuGroupId: "modification",
508
641
  contextMenuOrder: 1.5,
509
642
  run: async (o) => {
510
- var r;
511
- const s = o.getModel();
512
- if (!s) return;
513
- const n = s.getLanguageId();
514
- if (n === "xml" || n === "html")
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 u = s.getValue(), a = Ce(u);
517
- a !== u && o.executeEdits("daakia.format", [{ range: s.getFullModelRange(), text: a }]);
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 (n === "yaml")
653
+ else if (i === "yaml")
521
654
  try {
522
- const u = s.getValue(), a = ve(u);
523
- a !== u && o.executeEdits("daakia.format", [{ range: s.getFullModelRange(), text: a }]);
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 (n === "sql")
659
+ else if (i === "sql")
527
660
  try {
528
- const u = s.getValue(), a = Ee(u);
529
- a !== u && o.executeEdits("daakia.format", [{ range: s.getFullModelRange(), text: a }]);
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 ((r = o.getAction("editor.action.formatDocument")) == null ? void 0 : r.run());
666
+ await ((s = o.getAction("editor.action.formatDocument")) == null ? void 0 : s.run());
534
667
  }
535
- }), i.addAction({
668
+ }), n.addAction({
536
669
  id: "daakia.findAndReplace",
537
670
  label: "Find and Replace",
538
- keybindings: [k.CtrlCmd | k.Shift | C.KeyH],
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 = i.getAction("editor.action.startFindReplaceAction")) == null ? void 0 : o.run();
676
+ return (o = n.getAction("editor.action.startFindReplaceAction")) == null ? void 0 : o.run();
544
677
  }
545
- });
546
- const b = i.getModel();
547
- if (b) {
548
- const o = b.getLanguageId();
549
- o === "xml" || o === "html" ? (t.languages.setLanguageConfiguration(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
- })), l === "javascript" && ($ || (t.languages.typescript.javascriptDefaults.addExtraLib(he, "dk-globals.d.ts"), $ = !0), t.languages.registerCompletionItemProvider("javascript", {
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, s) => {
654
- const n = o.getValueInRange({
655
- startLineNumber: s.lineNumber,
724
+ provideCompletionItems: (o, a) => {
725
+ const i = o.getValueInRange({
726
+ startLineNumber: a.lineNumber,
656
727
  startColumn: 1,
657
- endLineNumber: s.lineNumber,
658
- endColumn: s.column
659
- }), r = be();
660
- if (r.length > 0) return { suggestions: r };
661
- const u = { startLineNumber: s.lineNumber, endLineNumber: s.lineNumber, startColumn: s.column, endColumn: s.column };
662
- return /\bconsole\.\s*$/.test(n) ? {
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: u },
665
- { label: "info", kind: t.languages.CompletionItemKind.Function, insertText: "info(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Info output", range: u },
666
- { label: "warn", kind: t.languages.CompletionItemKind.Function, insertText: "warn(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Warning output", range: u },
667
- { label: "error", kind: t.languages.CompletionItemKind.Function, insertText: "error(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Error output", range: u },
668
- { label: "debug", kind: t.languages.CompletionItemKind.Function, insertText: "debug(${1})", insertTextRules: t.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Debug output", range: u }
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
- })), !g && c && i.updateOptions({ placeholder: c }), m == null || m(i, t), i.updateOptions({ contextmenu: v === "native" });
743
+ })), !l && g && n.updateOptions({ placeholder: g }), c == null || c(n, t), n.updateOptions({ contextmenu: m === "native" });
673
744
  }
674
- function Se({
675
- original: i,
745
+ function Be({
746
+ original: n,
676
747
  modified: t,
677
- language: l = "sql",
678
- height: g = 300,
679
- readOnly: c = !0,
680
- renderSideBySide: m = !0,
681
- wordWrap: v = !1,
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: E,
684
- onMount: k
754
+ theme: k,
755
+ onMount: f
685
756
  }) {
686
- const C = q(), b = E ?? (C === "light" ? "vs" : "vs-dark"), y = typeof g == "number" ? `${g}px` : g;
687
- return /* @__PURE__ */ A(
688
- se,
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: y,
691
- language: l,
692
- theme: b,
693
- original: i,
761
+ height: b,
762
+ language: r,
763
+ theme: h,
764
+ original: n,
694
765
  modified: t,
695
- onMount: k,
766
+ onMount: f,
696
767
  options: {
697
- readOnly: c,
698
- renderSideBySide: m,
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: v ? "on" : "off",
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(i, t) {
719
- return t === "json" ? new pe() : t === "html" || t === "handlebars" || t === "razor" ? new me() : t === "typescript" || t === "javascript" ? new ke() : new fe();
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
- B.editor.defineTheme("daakia-dark", {
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
- P.setCompilerOptions({
790
- target: Q.ESNext,
791
- module: X.ESNext,
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: Y.NodeJs,
799
- jsx: Z.React
869
+ moduleResolution: te.NodeJs,
870
+ jsx: ee.React
800
871
  });
801
- P.setDiagnosticsOptions({
872
+ q.setDiagnosticsOptions({
802
873
  noSemanticValidation: !1,
803
874
  noSyntaxValidation: !1
804
875
  });
805
- P.setEagerModelSync(!0);
806
- ee.setEagerModelSync(!0);
807
- ee.setCompilerOptions({
808
- target: Q.ESNext,
809
- module: X.ESNext,
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: Y.NodeJs,
816
- jsx: Z.React
886
+ moduleResolution: te.NodeJs,
887
+ jsx: ee.React
817
888
  });
818
- B.editor.defineTheme("daakia-light", {
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
- le.config({ monaco: B });
877
- window.monaco = B;
878
- de(Ne);
879
- ge(Se);
880
- ue();
881
- function Fe(i) {
882
- B.editor.setTheme(i === "dark" ? "daakia-dark" : "daakia-light");
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
- Fe as applyMonacoTheme,
886
- B as monaco
956
+ He as applyMonacoTheme,
957
+ O as monaco
887
958
  };
888
959
  //# sourceMappingURL=monaco-setup.js.map